From 82ec6560e1e4fc27f6078c635aa09453fb9ffc39 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 21 Sep 2023 18:28:05 +0000 Subject: [PATCH] update jsdoc / bundles to release Itowns : itowns-2.5.0-beta --- current/dist/itowns/GpPluginItowns-map.css | 4 +- current/dist/itowns/GpPluginItowns-map.js | 76 +- current/dist/itowns/GpPluginItowns-src.css | 4 +- current/dist/itowns/GpPluginItowns-src.js | 816 +- current/dist/itowns/GpPluginItowns.css | 4 +- current/dist/itowns/GpPluginItowns.js | 10 +- .../itowns/Itowns/Controls/Buildings.d.ts | 5 - .../itowns/Itowns/Controls/Buildings.d.ts.map | 2 +- current/jsdoc/itowns/GlobeViewExtended.html | 2 +- current/jsdoc/itowns/global.html | 6 +- current/jsdoc/itowns/index.html | 2 +- .../itowns/itowns.control.Attributions.html | 2 +- .../itowns/itowns.control.BoostRelief.html | 2 +- .../itowns/itowns.control.Buildings.html | 42 +- .../itowns/itowns.control.LayerSwitcher.html | 2 +- .../itowns/itowns.control.MiniGlobe.html | 2 +- .../itowns/itowns.control.MousePosition.html | 2 +- .../jsdoc/itowns/itowns.control.Scale.html | 2 +- .../jsdoc/itowns/itowns.control.Widget.html | 2 +- .../itowns.layer.GeoportalElevation.html | 2 +- .../itowns/itowns.layer.GeoportalWMS.html | 2 +- .../itowns/itowns.layer.GeoportalWMTS.html | 2 +- .../itowns/itowns.layer.VectorTileLayer.html | 2 +- current/jsdoc/itowns/module-ColorUtils.html | 2 +- current/jsdoc/itowns/module-Config.html | 2 +- current/jsdoc/itowns/module-Draggable.html | 2 +- current/jsdoc/itowns/module-Gp.html | 2 +- current/jsdoc/itowns/module-LayerUtils.html | 2 +- .../jsdoc/itowns/module-LoggerByDefault.html | 2 +- current/jsdoc/itowns/module-MathUtils.html | 2 +- current/jsdoc/itowns/module-Parser.html | 2 +- .../module-ProfileElevationPathDOM.html | 2 +- current/jsdoc/itowns/module-ProxyUtils.html | 2 +- current/jsdoc/itowns/module-Register.html | 2 +- .../itowns/module-SearchEngineUtils.html | 2 +- current/jsdoc/itowns/module-SelectorID.html | 2 +- current/jsdoc/itowns/module-Utils.html | 2 +- .../dist/Common/Controls/AttributionDOM.d.ts | 10 + .../Common/Controls/AttributionDOM.d.ts.map | 1 + .../dist/Common/Controls/BoostReliefDOM.d.ts | 11 + .../Common/Controls/BoostReliefDOM.d.ts.map | 1 + .../dist/Common/Controls/BuildingsDOM.d.ts | 7 + .../Common/Controls/BuildingsDOM.d.ts.map | 1 + .../dist/Common/Controls/DrawingDOM.d.ts | 3 + .../dist/Common/Controls/DrawingDOM.d.ts.map | 1 + .../Common/Controls/Editor/EditorDOM.d.ts | 5 + .../Common/Controls/Editor/EditorDOM.d.ts.map | 1 + .../Common/Controls/ElevationPathDOM.d.ts | 14 + .../Common/Controls/ElevationPathDOM.d.ts.map | 1 + .../dist/Common/Controls/ExportDOM.d.ts | 5 + .../dist/Common/Controls/ExportDOM.d.ts.map | 1 + .../Common/Controls/GetFeatureInfoDOM.d.ts | 8 + .../Controls/GetFeatureInfoDOM.d.ts.map | 1 + .../dist/Common/Controls/IsoDOM.d.ts | 26 + .../dist/Common/Controls/IsoDOM.d.ts.map | 1 + .../dist/Common/Controls/LayerImportDOM.d.ts | 42 + .../Common/Controls/LayerImportDOM.d.ts.map | 1 + .../Common/Controls/LayerSwitcherDOM.d.ts | 28 + .../Common/Controls/LayerSwitcherDOM.d.ts.map | 1 + .../Common/Controls/LocationSelectorDOM.d.ts | 17 + .../Controls/LocationSelectorDOM.d.ts.map | 1 + .../dist/Common/Controls/MeasureAreaDOM.d.ts | 8 + .../Common/Controls/MeasureAreaDOM.d.ts.map | 1 + .../Common/Controls/MeasureAzimuthDOM.d.ts | 8 + .../Controls/MeasureAzimuthDOM.d.ts.map | 1 + .../Common/Controls/MeasureLengthDOM.d.ts | 8 + .../Common/Controls/MeasureLengthDOM.d.ts.map | 1 + .../Common/Controls/MeasureToolBoxDOM.d.ts | 11 + .../Controls/MeasureToolBoxDOM.d.ts.map | 1 + .../dist/Common/Controls/MiniGlobeDOM.d.ts | 6 + .../Common/Controls/MiniGlobeDOM.d.ts.map | 1 + .../Common/Controls/MousePositionDOM.d.ts | 30 + .../Common/Controls/MousePositionDOM.d.ts.map | 1 + .../Controls/ProfileElevationPathDOM.d.ts | 14 + .../Controls/ProfileElevationPathDOM.d.ts.map | 1 + .../Common/Controls/ReverseGeocodingDOM.d.ts | 21 + .../Controls/ReverseGeocodingDOM.d.ts.map | 1 + .../dist/Common/Controls/RouteDOM.d.ts | 34 + .../dist/Common/Controls/RouteDOM.d.ts.map | 1 + .../dist/Common/Controls/ScaleDOM.d.ts | 6 + .../dist/Common/Controls/ScaleDOM.d.ts.map | 1 + .../dist/Common/Controls/SearchEngineDOM.d.ts | 31 + .../Common/Controls/SearchEngineDOM.d.ts.map | 1 + itowns-2.5.0-beta/dist/Common/Styles.d.ts | 2 + itowns-2.5.0-beta/dist/Common/Styles.d.ts.map | 1 + itowns-2.5.0-beta/dist/Common/Utils.d.ts | 7 + itowns-2.5.0-beta/dist/Common/Utils.d.ts.map | 1 + .../dist/Common/Utils/AutoLoadConfig.d.ts | 2 + .../dist/Common/Utils/AutoLoadConfig.d.ts.map | 1 + .../dist/Common/Utils/ColorUtils.d.ts | 12 + .../dist/Common/Utils/ColorUtils.d.ts.map | 1 + .../dist/Common/Utils/Config.d.ts | 6 + .../dist/Common/Utils/Config.d.ts.map | 1 + .../dist/Common/Utils/Draggable.d.ts | 5 + .../dist/Common/Utils/Draggable.d.ts.map | 1 + .../dist/Common/Utils/GeocodeUtils.d.ts | 6 + .../dist/Common/Utils/GeocodeUtils.d.ts.map | 1 + .../dist/Common/Utils/LayerUtils.d.ts | 13 + .../dist/Common/Utils/LayerUtils.d.ts.map | 1 + .../dist/Common/Utils/LoggerByDefault.d.ts | 7 + .../Common/Utils/LoggerByDefault.d.ts.map | 1 + .../dist/Common/Utils/MathUtils.d.ts | 9 + .../dist/Common/Utils/MathUtils.d.ts.map | 1 + .../dist/Common/Utils/Parser.d.ts | 7 + .../dist/Common/Utils/Parser.d.ts.map | 1 + .../dist/Common/Utils/ProxyUtils.d.ts | 8 + .../dist/Common/Utils/ProxyUtils.d.ts.map | 1 + .../dist/Common/Utils/Register.d.ts | 441 + .../dist/Common/Utils/Register.d.ts.map | 1 + .../dist/Common/Utils/SearchEngineUtils.d.ts | 25 + .../Common/Utils/SearchEngineUtils.d.ts.map | 1 + .../dist/Common/Utils/SelectorID.d.ts | 8 + .../dist/Common/Utils/SelectorID.d.ts.map | 1 + itowns-2.5.0-beta/dist/GpPluginItowns-map.css | 3098 + itowns-2.5.0-beta/dist/GpPluginItowns-map.js | 1636 + itowns-2.5.0-beta/dist/GpPluginItowns-src.css | 3098 + itowns-2.5.0-beta/dist/GpPluginItowns-src.js | 81923 ++++++++++++++++ itowns-2.5.0-beta/dist/GpPluginItowns.css | 72 + itowns-2.5.0-beta/dist/GpPluginItowns.js | 83 + itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts | 179 + .../dist/Itowns/CRS/CRS.d.ts.map | 1 + .../dist/Itowns/Controls/Attributions.d.ts | 112 + .../Itowns/Controls/Attributions.d.ts.map | 1 + .../dist/Itowns/Controls/BoostRelief.d.ts | 107 + .../dist/Itowns/Controls/BoostRelief.d.ts.map | 1 + .../dist/Itowns/Controls/Buildings.d.ts | 95 + .../dist/Itowns/Controls/Buildings.d.ts.map | 1 + .../dist/Itowns/Controls/LayerSwitcher.d.ts | 163 + .../Itowns/Controls/LayerSwitcher.d.ts.map | 1 + .../dist/Itowns/Controls/MiniGlobe.d.ts | 58 + .../dist/Itowns/Controls/MiniGlobe.d.ts.map | 1 + .../dist/Itowns/Controls/MousePosition.d.ts | 255 + .../Itowns/Controls/MousePosition.d.ts.map | 1 + .../dist/Itowns/Controls/Scale.d.ts | 60 + .../dist/Itowns/Controls/Scale.d.ts.map | 1 + .../Controls/Utils/PositionFormater.d.ts | 18 + .../Controls/Utils/PositionFormater.d.ts.map | 1 + .../dist/Itowns/Controls/Widget.d.ts | 123 + .../dist/Itowns/Controls/Widget.d.ts.map | 1 + .../dist/Itowns/GlobeViewExtended.d.ts | 412 + .../dist/Itowns/GlobeViewExtended.d.ts.map | 1 + .../dist/Itowns/Layer/LayerElevation.d.ts | 69 + .../dist/Itowns/Layer/LayerElevation.d.ts.map | 1 + .../dist/Itowns/Layer/LayerWMS.d.ts | 69 + .../dist/Itowns/Layer/LayerWMS.d.ts.map | 1 + .../dist/Itowns/Layer/LayerWMTS.d.ts | 69 + .../dist/Itowns/Layer/LayerWMTS.d.ts.map | 1 + .../dist/Itowns/Layer/VectorTileLayer.d.ts | 61 + .../Itowns/Layer/VectorTileLayer.d.ts.map | 1 + itowns-2.5.0-beta/dist/Itowns/Styles.d.ts | 2 + itowns-2.5.0-beta/dist/Itowns/Styles.d.ts.map | 1 + itowns-2.5.0-beta/dist/Itowns/index.d.ts | 49 + itowns-2.5.0-beta/dist/Itowns/index.d.ts.map | 1 + .../jsdoc/GlobeViewExtended.html | 9018 ++ .../fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20290 bytes .../fonts/glyphicons-halflings-regular.svg | 229 + .../fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 41236 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23292 bytes itowns-2.5.0-beta/jsdoc/global.html | 2846 + itowns-2.5.0-beta/jsdoc/images/entete.png | Bin 0 -> 119357 bytes itowns-2.5.0-beta/jsdoc/images/logoIGN.png | Bin 0 -> 7387 bytes .../jsdoc/images/logoIGNsmall.png | Bin 0 -> 1010 bytes .../jsdoc/images/showLeftMenu.png | Bin 0 -> 502 bytes itowns-2.5.0-beta/jsdoc/index.html | 2300 + .../jsdoc/itowns.control.Attributions.html | 3515 + .../jsdoc/itowns.control.BoostRelief.html | 3644 + .../jsdoc/itowns.control.Buildings.html | 3250 + .../jsdoc/itowns.control.LayerSwitcher.html | 4266 + .../jsdoc/itowns.control.MiniGlobe.html | 3256 + .../jsdoc/itowns.control.MousePosition.html | 4542 + .../jsdoc/itowns.control.Scale.html | 3265 + .../jsdoc/itowns.control.Widget.html | 3430 + .../itowns.layer.GeoportalElevation.html | 2691 + .../jsdoc/itowns.layer.GeoportalWMS.html | 2731 + .../jsdoc/itowns.layer.GeoportalWMTS.html | 2731 + .../jsdoc/itowns.layer.VectorTileLayer.html | 2629 + .../jsdoc/module-ColorUtils.html | 2857 + itowns-2.5.0-beta/jsdoc/module-Config.html | 2315 + itowns-2.5.0-beta/jsdoc/module-Draggable.html | 2511 + itowns-2.5.0-beta/jsdoc/module-Gp.html | 2786 + .../jsdoc/module-LayerUtils.html | 2886 + .../jsdoc/module-LoggerByDefault.html | 2601 + itowns-2.5.0-beta/jsdoc/module-MathUtils.html | 3039 + itowns-2.5.0-beta/jsdoc/module-Parser.html | 2316 + .../jsdoc/module-ProfileElevationPathDOM.html | 2307 + .../jsdoc/module-ProxyUtils.html | 2562 + itowns-2.5.0-beta/jsdoc/module-Register.html | 2982 + .../jsdoc/module-SearchEngineUtils.html | 2518 + .../jsdoc/module-SelectorID.html | 2763 + itowns-2.5.0-beta/jsdoc/module-Utils.html | 2713 + .../jsdoc/scripts/bootstrap.min.js | 7 + itowns-2.5.0-beta/jsdoc/scripts/jquery.min.js | 6 + .../jsdoc/scripts/jquery.min.map | 1 + itowns-2.5.0-beta/jsdoc/scripts/linenumber.js | 29 + itowns-2.5.0-beta/jsdoc/scripts/main.js | 73 + .../scripts/prettify/Apache-License-2.0.txt | 202 + .../jsdoc/scripts/prettify/lang-css.js | 2 + .../jsdoc/scripts/prettify/prettify.js | 28 + .../jsdoc/scripts/underscore-min.js | 6 + .../jsdoc/scripts/underscore-min.map | 1 + .../jsdoc/styles/bootstrap.min.css | 7 + itowns-2.5.0-beta/jsdoc/styles/jaguar.css | 349 + .../jsdoc/styles/prettify-jsdoc.css | 111 + .../jsdoc/styles/prettify-tomorrow.css | 132 + itowns-2.5.0-beta/jsdoc/styles/sfd.css | 763 + itowns-latest | 2 +- 206 files changed, 186636 insertions(+), 382 deletions(-) create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Styles.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Styles.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts create mode 100644 itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/GpPluginItowns-map.css create mode 100644 itowns-2.5.0-beta/dist/GpPluginItowns-map.js create mode 100644 itowns-2.5.0-beta/dist/GpPluginItowns-src.css create mode 100644 itowns-2.5.0-beta/dist/GpPluginItowns-src.js create mode 100644 itowns-2.5.0-beta/dist/GpPluginItowns.css create mode 100644 itowns-2.5.0-beta/dist/GpPluginItowns.js create mode 100644 itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/Styles.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/Styles.d.ts.map create mode 100644 itowns-2.5.0-beta/dist/Itowns/index.d.ts create mode 100644 itowns-2.5.0-beta/dist/Itowns/index.d.ts.map create mode 100644 itowns-2.5.0-beta/jsdoc/GlobeViewExtended.html create mode 100644 itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.eot create mode 100644 itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.svg create mode 100644 itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.ttf create mode 100644 itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.woff create mode 100644 itowns-2.5.0-beta/jsdoc/global.html create mode 100644 itowns-2.5.0-beta/jsdoc/images/entete.png create mode 100644 itowns-2.5.0-beta/jsdoc/images/logoIGN.png create mode 100644 itowns-2.5.0-beta/jsdoc/images/logoIGNsmall.png create mode 100644 itowns-2.5.0-beta/jsdoc/images/showLeftMenu.png create mode 100644 itowns-2.5.0-beta/jsdoc/index.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.Attributions.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.BoostRelief.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.Buildings.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.LayerSwitcher.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.MiniGlobe.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.MousePosition.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.Scale.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.control.Widget.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalElevation.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMS.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMTS.html create mode 100644 itowns-2.5.0-beta/jsdoc/itowns.layer.VectorTileLayer.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-ColorUtils.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-Config.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-Draggable.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-Gp.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-LayerUtils.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-LoggerByDefault.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-MathUtils.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-Parser.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-ProfileElevationPathDOM.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-ProxyUtils.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-Register.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-SearchEngineUtils.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-SelectorID.html create mode 100644 itowns-2.5.0-beta/jsdoc/module-Utils.html create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/bootstrap.min.js create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/jquery.min.js create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/jquery.min.map create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/linenumber.js create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/main.js create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/prettify/Apache-License-2.0.txt create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/prettify/lang-css.js create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/prettify/prettify.js create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/underscore-min.js create mode 100644 itowns-2.5.0-beta/jsdoc/scripts/underscore-min.map create mode 100644 itowns-2.5.0-beta/jsdoc/styles/bootstrap.min.css create mode 100644 itowns-2.5.0-beta/jsdoc/styles/jaguar.css create mode 100644 itowns-2.5.0-beta/jsdoc/styles/prettify-jsdoc.css create mode 100644 itowns-2.5.0-beta/jsdoc/styles/prettify-tomorrow.css create mode 100644 itowns-2.5.0-beta/jsdoc/styles/sfd.css diff --git a/current/dist/itowns/GpPluginItowns-map.css b/current/dist/itowns/GpPluginItowns-map.css index 0296e4c71..b47ec69ac 100644 --- a/current/dist/itowns/GpPluginItowns-map.css +++ b/current/dist/itowns/GpPluginItowns-map.css @@ -9,8 +9,8 @@ * @copyright copyright (c) IGN * @license CeCILL-B * @author IGN - * @version 2.4.3 - * @date 04/08/2023 + * @version 2.5.0-beta + * @date 21/09/2023 * */ diff --git a/current/dist/itowns/GpPluginItowns-map.js b/current/dist/itowns/GpPluginItowns-map.js index b23ac88b6..ecfbdceaf 100644 --- a/current/dist/itowns/GpPluginItowns-map.js +++ b/current/dist/itowns/GpPluginItowns-map.js @@ -9,8 +9,8 @@ * @copyright copyright (c) IGN * @license CeCILL-B * @author IGN - * @version 2.4.3 - * @date 04/08/2023 + * @version 2.5.0-beta + * @date 21/09/2023 * */ @@ -187,7 +187,7 @@ eval("/* WEBPACK VAR INJECTION */(function(process, global) {/*!\n * @overview e /*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, date, dependencies, deprecated, description, devDependencies, homepage, keywords, license, main, module, name, nyc, optionalDependencies, peerDependencies, repository, scripts, version, default */ /***/ (function(module) { -eval("module.exports = JSON.parse(\"{\\\"_from\\\":\\\"geoportal-access-lib@3.3.3\\\",\\\"_id\\\":\\\"geoportal-access-lib@3.3.3\\\",\\\"_inBundle\\\":false,\\\"_integrity\\\":\\\"sha512-1S8B84yaU8JrkSxLXVFxqjkL4MMs1RNJwdQQMGjAoH/fXPr3CleoEaoG7z14HgVlWCvdYYqAqQuL6qGVCrlmXQ==\\\",\\\"_location\\\":\\\"/geoportal-access-lib\\\",\\\"_phantomChildren\\\":{},\\\"_requested\\\":{\\\"type\\\":\\\"version\\\",\\\"registry\\\":true,\\\"raw\\\":\\\"geoportal-access-lib@3.3.3\\\",\\\"name\\\":\\\"geoportal-access-lib\\\",\\\"escapedName\\\":\\\"geoportal-access-lib\\\",\\\"rawSpec\\\":\\\"3.3.3\\\",\\\"saveSpec\\\":null,\\\"fetchSpec\\\":\\\"3.3.3\\\"},\\\"_requiredBy\\\":[\\\"/\\\"],\\\"_resolved\\\":\\\"https://registry.npmjs.org/geoportal-access-lib/-/geoportal-access-lib-3.3.3.tgz\\\",\\\"_shasum\\\":\\\"33b1dc313ca8aeadd0adebf3bca4ef75ea48c50b\\\",\\\"_spec\\\":\\\"geoportal-access-lib@3.3.3\\\",\\\"_where\\\":\\\"/home/runner/work/geoportal-extensions/geoportal-extensions\\\",\\\"author\\\":{\\\"name\\\":\\\"IGNF\\\"},\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/IGNF/geoportal-access-lib/issues\\\"},\\\"bundleDependencies\\\":false,\\\"date\\\":\\\"02/08/2023\\\",\\\"dependencies\\\":{\\\"es6-promise\\\":\\\"^4.2.4\\\",\\\"node-fetch\\\":\\\"^2.6.1\\\",\\\"xmldom\\\":\\\"^0.1.27\\\"},\\\"deprecated\\\":false,\\\"description\\\":\\\"French Geoportal resources access library\\\",\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"^7.12.10\\\",\\\"@babel/plugin-transform-template-literals\\\":\\\"^7.12.1\\\",\\\"@babel/preset-env\\\":\\\"^7.12.11\\\",\\\"babel-loader\\\":\\\"^8.2.2\\\",\\\"chai\\\":\\\"^4.1.2\\\",\\\"clean-webpack-plugin\\\":\\\"^3.0.0\\\",\\\"copy-webpack-plugin\\\":\\\"^5.1.2\\\",\\\"eslint\\\":\\\"^7.18.0\\\",\\\"eslint-config-standard\\\":\\\"^16.0.2\\\",\\\"eslint-loader\\\":\\\"^4.0.2\\\",\\\"eslint-plugin-import\\\":\\\"^2.22.1\\\",\\\"eslint-plugin-node\\\":\\\"^11.1.0\\\",\\\"eslint-plugin-promise\\\":\\\"^4.2.1\\\",\\\"eslint-plugin-standard\\\":\\\"^5.0.0\\\",\\\"glob\\\":\\\"^7.1.2\\\",\\\"handlebars-layouts\\\":\\\"^3.1.4\\\",\\\"handlebars-webpack-plugin\\\":\\\"^1.4.1\\\",\\\"html-webpack-plugin\\\":\\\"^4.5.1\\\",\\\"istanbul-instrumenter-loader\\\":\\\"^3.0.1\\\",\\\"jsdoc-webpack-plugin\\\":\\\"^0.3.0\\\",\\\"loglevel\\\":\\\"^1.6.1\\\",\\\"mocha\\\":\\\"^7.2.0\\\",\\\"mocha-loader\\\":\\\"^5.1.5\\\",\\\"mocha-webpack\\\":\\\"^2.0.0-beta.0\\\",\\\"mochawesome\\\":\\\"^6.2.1\\\",\\\"nyc\\\":\\\"^15.1.0\\\",\\\"path\\\":\\\"^0.12.7\\\",\\\"replace-bundle-webpack-plugin\\\":\\\"^1.0.0\\\",\\\"sinon\\\":\\\"^9.2.4\\\",\\\"sinon-es6\\\":\\\"0.0.3\\\",\\\"speed-measure-webpack-plugin\\\":\\\"^1.4.2\\\",\\\"string-template\\\":\\\"^1.0.0\\\",\\\"terser-webpack-plugin\\\":\\\"^2.3.8\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^3.3.12\\\",\\\"webpack-dev-server\\\":\\\"^3.11.2\\\",\\\"webpack-node-externals\\\":\\\"^2.5.2\\\",\\\"webpack-shell-plugin\\\":\\\"^0.5.0\\\"},\\\"homepage\\\":\\\"https://github.com/IGNF/geoportal-access-lib#readme\\\",\\\"keywords\\\":[\\\"geoportail\\\",\\\"webservice\\\",\\\"javascript\\\",\\\"es6\\\"],\\\"license\\\":\\\"CECILL-B\\\",\\\"main\\\":\\\"dist/GpServices-src.js\\\",\\\"module\\\":\\\"src/Gp.js\\\",\\\"name\\\":\\\"geoportal-access-lib\\\",\\\"nyc\\\":{\\\"include\\\":[\\\"src/**/*.js\\\"],\\\"instrument\\\":false,\\\"sourceMap\\\":false},\\\"optionalDependencies\\\":{},\\\"peerDependencies\\\":{},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"git+https://github.com/IGNF/geoportal-access-lib.git\\\"},\\\"scripts\\\":{\\\"build\\\":\\\"webpack --mode=none\\\",\\\"build:dev\\\":\\\"webpack --mode=development\\\",\\\"build:prod\\\":\\\"webpack --mode=production\\\",\\\"clean\\\":\\\"echo \\\\\\\"Warning: no yet implemented!\\\\\\\" && exit 0\\\",\\\"cover\\\":\\\"nyc --reporter=lcov --reporter=text npm run test\\\",\\\"doc\\\":\\\"npm run doc:serve\\\",\\\"doc:serve\\\":\\\"webpack-dev-server --content-base jsdoc --port 9001 --open\\\",\\\"eslint\\\":\\\"eslint src/\\\",\\\"sample\\\":\\\"npm run sample:serve\\\",\\\"sample:serve\\\":\\\"webpack-dev-server --mode=none --open-page samples/index-src.html --https --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"sample:serve:dev\\\":\\\"webpack-dev-server --mode=development --open-page samples/index-map.html --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"sample:serve:prod\\\":\\\"webpack-dev-server --mode=production --open-page samples/index-prod.html --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"setup\\\":\\\"npm install\\\",\\\"test\\\":\\\"mocha-webpack --reporter mochawesome --reporter-options reportDir=test-report,reportFilename=index --webpack-config ./test/webpack/webpack.test.js --glob \\\\\\\"test_*.js\\\\\\\" test/spec/\\\",\\\"test:end-to-end:serve\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.js\\\",\\\"test:end-to-end:serve:docker\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.docker.js\\\",\\\"test:serve\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.js\\\",\\\"test:serve:docker\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.docker.js\\\"},\\\"version\\\":\\\"3.3.3\\\"}\");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9wYWNrYWdlLmpzb24uanMiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/package.json\n"); +eval("module.exports = JSON.parse(\"{\\\"_from\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"_id\\\":\\\"geoportal-access-lib@3.4.0-beta\\\",\\\"_inBundle\\\":false,\\\"_integrity\\\":\\\"sha512-gphFcmz76I5nDU8c5HS1X/afidc1hZMNKVESfzr212WyMpVCNbQhImVlLJakAlffXMCkNb40bVZnehKlKvD+9w==\\\",\\\"_location\\\":\\\"/geoportal-access-lib\\\",\\\"_phantomChildren\\\":{},\\\"_requested\\\":{\\\"type\\\":\\\"remote\\\",\\\"raw\\\":\\\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"name\\\":\\\"geoportal-access-lib\\\",\\\"escapedName\\\":\\\"geoportal-access-lib\\\",\\\"rawSpec\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"saveSpec\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"fetchSpec\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\"},\\\"_requiredBy\\\":[\\\"/\\\"],\\\"_resolved\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"_shasum\\\":\\\"4972f1314445354d85baad4d3b0e59f0be27ab82\\\",\\\"_spec\\\":\\\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"_where\\\":\\\"/home/runner/work/geoportal-extensions/geoportal-extensions\\\",\\\"author\\\":{\\\"name\\\":\\\"IGNF\\\"},\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/IGNF/geoportal-access-lib/issues\\\"},\\\"bundleDependencies\\\":[],\\\"date\\\":\\\"21/09/2023\\\",\\\"dependencies\\\":{\\\"es6-promise\\\":\\\"^4.2.4\\\",\\\"node-fetch\\\":\\\"^2.6.1\\\",\\\"xmldom\\\":\\\"^0.1.27\\\"},\\\"deprecated\\\":false,\\\"description\\\":\\\"French Geoportal resources access library\\\",\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"^7.12.10\\\",\\\"@babel/plugin-transform-template-literals\\\":\\\"^7.12.1\\\",\\\"@babel/preset-env\\\":\\\"^7.12.11\\\",\\\"babel-loader\\\":\\\"^8.2.2\\\",\\\"chai\\\":\\\"^4.1.2\\\",\\\"clean-webpack-plugin\\\":\\\"^3.0.0\\\",\\\"copy-webpack-plugin\\\":\\\"^5.1.2\\\",\\\"eslint\\\":\\\"^7.18.0\\\",\\\"eslint-config-standard\\\":\\\"^16.0.2\\\",\\\"eslint-loader\\\":\\\"^4.0.2\\\",\\\"eslint-plugin-import\\\":\\\"^2.22.1\\\",\\\"eslint-plugin-node\\\":\\\"^11.1.0\\\",\\\"eslint-plugin-promise\\\":\\\"^4.2.1\\\",\\\"eslint-plugin-standard\\\":\\\"^5.0.0\\\",\\\"glob\\\":\\\"^7.1.2\\\",\\\"handlebars-layouts\\\":\\\"^3.1.4\\\",\\\"handlebars-webpack-plugin\\\":\\\"^1.4.1\\\",\\\"html-webpack-plugin\\\":\\\"^4.5.1\\\",\\\"istanbul-instrumenter-loader\\\":\\\"^3.0.1\\\",\\\"jsdoc-webpack-plugin\\\":\\\"^0.3.0\\\",\\\"loglevel\\\":\\\"^1.6.1\\\",\\\"mocha\\\":\\\"^7.2.0\\\",\\\"mocha-loader\\\":\\\"^5.1.5\\\",\\\"mocha-webpack\\\":\\\"^2.0.0-beta.0\\\",\\\"mochawesome\\\":\\\"^6.2.1\\\",\\\"nyc\\\":\\\"^15.1.0\\\",\\\"path\\\":\\\"^0.12.7\\\",\\\"replace-bundle-webpack-plugin\\\":\\\"^1.0.0\\\",\\\"sinon\\\":\\\"^9.2.4\\\",\\\"sinon-es6\\\":\\\"0.0.3\\\",\\\"speed-measure-webpack-plugin\\\":\\\"^1.4.2\\\",\\\"string-template\\\":\\\"^1.0.0\\\",\\\"terser-webpack-plugin\\\":\\\"^2.3.8\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^3.3.12\\\",\\\"webpack-dev-server\\\":\\\"^3.11.2\\\",\\\"webpack-node-externals\\\":\\\"^2.5.2\\\",\\\"webpack-shell-plugin\\\":\\\"^0.5.0\\\"},\\\"homepage\\\":\\\"https://github.com/IGNF/geoportal-access-lib#readme\\\",\\\"keywords\\\":[\\\"geoportail\\\",\\\"webservice\\\",\\\"javascript\\\",\\\"es6\\\"],\\\"license\\\":\\\"CECILL-B\\\",\\\"main\\\":\\\"dist/GpServices-src.js\\\",\\\"module\\\":\\\"src/Gp.js\\\",\\\"name\\\":\\\"geoportal-access-lib\\\",\\\"nyc\\\":{\\\"include\\\":[\\\"src/**/*.js\\\"],\\\"instrument\\\":false,\\\"sourceMap\\\":false},\\\"optionalDependencies\\\":{},\\\"peerDependencies\\\":{},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"git+https://github.com/IGNF/geoportal-access-lib.git\\\"},\\\"scripts\\\":{\\\"build\\\":\\\"webpack --mode=none\\\",\\\"build:dev\\\":\\\"webpack --mode=development\\\",\\\"build:prod\\\":\\\"webpack --mode=production\\\",\\\"clean\\\":\\\"echo \\\\\\\"Warning: no yet implemented!\\\\\\\" && exit 0\\\",\\\"cover\\\":\\\"nyc --reporter=lcov --reporter=text npm run test\\\",\\\"doc\\\":\\\"npm run doc:serve\\\",\\\"doc:serve\\\":\\\"webpack-dev-server --content-base jsdoc --port 9001 --open\\\",\\\"eslint\\\":\\\"eslint src/\\\",\\\"sample\\\":\\\"npm run sample:serve\\\",\\\"sample:serve\\\":\\\"webpack-dev-server --mode=none --open-page samples/index-src.html --https --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"sample:serve:dev\\\":\\\"webpack-dev-server --mode=development --open-page samples/index-map.html --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"sample:serve:prod\\\":\\\"webpack-dev-server --mode=production --open-page samples/index-prod.html --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"setup\\\":\\\"npm install\\\",\\\"test\\\":\\\"mocha-webpack --reporter mochawesome --reporter-options reportDir=test-report,reportFilename=index --webpack-config ./test/webpack/webpack.test.js --glob \\\\\\\"test_*.js\\\\\\\" test/spec/\\\",\\\"test:end-to-end:serve\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.js\\\",\\\"test:end-to-end:serve:docker\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.docker.js\\\",\\\"test:serve\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.js\\\",\\\"test:serve:docker\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.docker.js\\\"},\\\"version\\\":\\\"3.4.0-beta\\\"}\");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9wYWNrYWdlLmpzb24uanMiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/package.json\n"); /***/ }), @@ -283,7 +283,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/AltiRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js\");\n/* harmony import */ var _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/AltiResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n *\n * Appel du service d'altimétrie du Géoportail\n *\n * @todo gestion du parma. output et callback\n * @todo outputFormat (REST) et format (WPS)\n * @todo La reponse JSON peut encapsuler un XML !\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Alti\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {Array.} options.positions - Tableau ({lon:float,lat:float}) contenant les coordonnées des points (CRS:84)\n * dont on veut connaître les altitudes (ou à partir desquelles on va calculer le profil).\n * Chaque élément du tableau est un objet JavaScript avec deux attributs : lon et lat, qui sont des flottants.\n * Minimum 2 éléments si on souhaite calculer un profil altimétrique (ElevationLine).\n * Maximum 50 éléments.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service alti : 'xml' ou 'json'.\n * Ce paramètre déterminera l'extension '.xml' ou '.json' du service dans le cas de l'API REST,\n * ou la valeur du paramètre 'format' dans le cas de la norme WPS.\n * Nécessaire si serverUrl est renseigné, et qu'on souhaite passer par l'API REST,\n * pour connaître le format dans lequel sera fournie la réponse (pour son traitement).\n * Non nécessaire pour la norme WPS. Par défaut, ce paramètre vaut 'json'.\n *\n * @param {Number} [options.sampling] - Nombre de points à utiliser pour déterminer le tracé d'un profil altimétrique, compris entre 2 et 5000.\n * A spécifier lorsqu'on souhaite accéder à cette fonctionnalité.\n * Dans ce cas, les points fournis en entrée (au minimum de deux) servent à déterminer l'axe planimétrique\n * le long duquel le profil doit être calculé.\n * Si le paramètre sampling n'est pas spécifié ou moins de deux points sont fournis,\n * c'est le service Elevation qui sera interrogé (altitudes simples calculées pour les points fournis).\n * Une valeur de sampling strictement inférieure à 2 déclenchera un échantillonnage avec la valeur par défaut du service (3 points).\n *\n * @param {String} [options.api] - Manière d'accéder au service : 'REST' (via l'API REST) ou 'WPS' (via la norme WPS).\n * Par défaut, on utilise l'API REST.\n *\n * @param {Boolean} [options.zonly] - Permet de ne récupérer que les altitudes en sortie s'il vaut 'true'.\n * Vaut 'false' par défaut.\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * positions : [{lon:, lat:}, {lon:, lat:}],\n * outputFormat : 'json' // json|xml\n * sampling : 3,\n * api : 'REST', // REST|WPS\n * zonly : false // false|true\n * };\n *\n */\nfunction Alti (options) {\n if (!(this instanceof Alti)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Alti\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"Alti\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Alti\");\n this.logger.trace(\"[Constructeur Alti (options)]\");\n\n // #####################\n // analyse des options\n // #####################\n\n if (!options.positions) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"positions\"));\n }\n\n if (options.positions.length === 0) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"positions\"));\n }\n\n // ajout des options spécifiques au service\n this.options.positions = options.positions;\n\n // format de réponse du service : \"json\" ou \"xml\" (valeur par défaut), en minuscule !\n this.options.outputFormat = (typeof options.outputFormat === \"string\") ? options.outputFormat.toLowerCase() : \"xml\";\n\n // sampling\n this.options.sampling = options.sampling || null;\n\n // type d'api utilisé pour requeter le service, en majuscule !\n this.options.api = (typeof options.api === \"string\") ? options.api.toUpperCase() : \"REST\";\n\n // l'api ne peut être interrogée qu'en GET.\n if (this.options.api === \"REST\") {\n this.options.httpMethod = \"GET\";\n }\n\n // param. zonly\n this.options.zonly = options.zonly || false;\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n // en fonction du type d'api, REST ou WPS, du format de reponse demandé (outputFormat)\n // ainsi que sur le type de service (profil ou elevation)\n if (!this.options.serverUrl) {\n var lstUrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Alti.url(\"calcul\");\n var urlFound = null;\n switch (this.options.api) {\n case \"WPS\":\n urlFound = lstUrlByDefault.wps;\n break;\n case \"REST\":\n var key = (options.sampling ? \"profil\" : \"elevation\") + \"-\" + this.options.outputFormat;\n urlFound = lstUrlByDefault[key];\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"api\"));\n }\n\n if (!urlFound) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = urlFound;\n this.logger.trace(\"Server URL by default : \" + this.options.serverUrl);\n }\n\n // gestion du type de service\n // si l'extension de l'url est .json ou .xml, on surcharge le format de sortie (outputFormat)\n var idx = this.options.serverUrl.lastIndexOf(\".\");\n if (idx !== -1) {\n var extension = this.options.serverUrl.substring(idx + 1);\n if (extension && extension.length < 5) { // FIXME extension de moins de 4 car. ...\n this.logger.trace(\"Server Extension URL : \" + extension);\n switch (extension.toLowerCase()) {\n case \"json\":\n case \"xml\":\n this.options.outputFormat = extension.toLowerCase();\n break;\n default:\n throw new Error(\"type of service : unknown or unsupported (json or xml) !\");\n }\n }\n }\n}\n\n/**\n * @lends module:Alti#\n */\nAlti.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/**\n * Constructeur (alias)\n */\nAlti.prototype.constructor = Alti;\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAlti.prototype.buildRequest = function (error, success) {\n // utilisation en mode callback\n var options = {\n httpMethod : this.options.httpMethod,\n // callback\n onSuccess : function (result) {\n // sauvegarde de la requete !\n this.request = result;\n success.call(this, this.request);\n },\n onError : error,\n scope : this,\n // spécifique au service :\n positions : this.options.positions,\n outputFormat : this.options.outputFormat,\n sampling : this.options.sampling,\n api : this.options.api,\n zonly : this.options.zonly\n };\n\n _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n};\n\n/**\n * Analyse de la reponse (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAlti.prototype.analyzeResponse = function (error, success) {\n // INFO\n // Factory pour masquer la complexité du retour du service qui renvoie soit\n // - une 'string' qui contient du XML ou JSON natif en mode XHR\n // - un objet JSON qui est natif ou encapsulé\n\n if (this.response) {\n var options = {\n response : this.response,\n outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML !\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Alti);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9BbHRpLmpzPzJlNDIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQ2lEO0FBQ0g7QUFDVztBQUNaO0FBQ1E7QUFDUztBQUNHOztBQUVqRTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsZUFBZSwrQkFBK0Isb0JBQW9CO0FBQzdFO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0F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Ly8gRmFjdG9yeSBwb3VyIG1hc3F1ZXIgbGEgY29tcGxleGl0w6kgZHUgcmV0b3VyIGR1IHNlcnZpY2UgcXVpIHJlbnZvaWUgc29pdFxuICAgIC8vICAtIHVuZSAnc3RyaW5nJyBxdWkgY29udGllbnQgZHUgWE1MIG91IEpTT04gbmF0aWYgZW4gbW9kZSBYSFJcbiAgICAvLyAgLSB1biBvYmpldCBKU09OIHF1aSBlc3QgbmF0aWYgb3UgZW5jYXBzdWzDqVxuXG4gICAgaWYgKHRoaXMucmVzcG9uc2UpIHtcbiAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICByZXNwb25zZSA6IHRoaXMucmVzcG9uc2UsXG4gICAgICAgICAgICBvdXRwdXRGb3JtYXQgOiB0aGlzLm9wdGlvbnMub3V0cHV0Rm9ybWF0LCAvLyB1dGlsZSBwb3VyIHBhcnNlciBsYSBzdHJpbmcgZW4gbW9kZSBYSFIgOiBKU09OIG91IFhNTCAhXG4gICAgICAgICAgICByYXdSZXNwb25zZSA6IHRoaXMub3B0aW9ucy5yYXdSZXNwb25zZSxcbiAgICAgICAgICAgIG9uRXJyb3IgOiBlcnJvcixcbiAgICAgICAgICAgIG9uU3VjY2VzcyA6IHN1Y2Nlc3MsXG4gICAgICAgICAgICBzY29wZSA6IHRoaXNcbiAgICAgICAgfTtcblxuICAgICAgICBBbHRpUmVzcG9uc2VGYWN0b3J5LmJ1aWxkKG9wdGlvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShfLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQWx0aTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/AltiRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js\");\n/* harmony import */ var _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/AltiResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n *\n * Appel du service d'altimétrie du Géoportail\n *\n * @todo gestion du parma. output et callback\n * @todo outputFormat (REST) et format (WPS)\n * @todo La reponse JSON peut encapsuler un XML !\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Alti\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {Array.} options.positions - Tableau ({lon:float,lat:float}) contenant les coordonnées des points (CRS:84)\n * dont on veut connaître les altitudes (ou à partir desquelles on va calculer le profil).\n * Chaque élément du tableau est un objet JavaScript avec deux attributs : lon et lat, qui sont des flottants.\n * Minimum 2 éléments si on souhaite calculer un profil altimétrique (ElevationLine).\n * Maximum 50 éléments.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service alti : 'xml' ou 'json'.\n * Ce paramètre déterminera l'extension '.xml' ou '.json' du service dans le cas de l'API REST,\n * ou la valeur du paramètre 'format' dans le cas de la norme WPS.\n * Nécessaire si serverUrl est renseigné, et qu'on souhaite passer par l'API REST,\n * pour connaître le format dans lequel sera fournie la réponse (pour son traitement).\n * Non nécessaire pour la norme WPS. Par défaut, ce paramètre vaut 'json'.\n *\n * @param {Number} [options.sampling] - Nombre de points à utiliser pour déterminer le tracé d'un profil altimétrique, compris entre 2 et 5000.\n * A spécifier lorsqu'on souhaite accéder à cette fonctionnalité.\n * Dans ce cas, les points fournis en entrée (au minimum de deux) servent à déterminer l'axe planimétrique\n * le long duquel le profil doit être calculé.\n * Si le paramètre sampling n'est pas spécifié ou moins de deux points sont fournis,\n * c'est le service Elevation qui sera interrogé (altitudes simples calculées pour les points fournis).\n * Une valeur de sampling strictement inférieure à 2 déclenchera un échantillonnage avec la valeur par défaut du service (3 points).\n *\n * @param {String} [options.api] - Manière d'accéder au service : 'REST' (via l'API REST) ou 'WPS' (via la norme WPS).\n * Par défaut, on utilise l'API REST.\n *\n * @param {Boolean} [options.zonly] - Permet de ne récupérer que les altitudes en sortie s'il vaut 'true'.\n * Vaut 'false' par défaut.\n *\n * @param {String} [options.resource] - Resource utilisée pour réaliser le calcul.\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * positions : [{lon:, lat:}, {lon:, lat:}],\n * outputFormat : 'json' // json|xml\n * sampling : 3,\n * api : 'REST', // REST|WPS\n * zonly : false // false|true,\n * resource : \"resource-par-defaut\"\n * };\n *\n */\nfunction Alti (options) {\n if (!(this instanceof Alti)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Alti\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"Alti\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Alti\");\n this.logger.trace(\"[Constructeur Alti (options)]\");\n\n // #####################\n // analyse des options\n // #####################\n\n if (!options.positions) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"positions\"));\n }\n\n if (options.positions.length === 0) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"positions\"));\n }\n\n // ajout des options spécifiques au service\n this.options.positions = options.positions;\n\n // format de réponse du service : \"json\" ou \"xml\" (valeur par défaut), en minuscule !\n this.options.outputFormat = (typeof options.outputFormat === \"string\") ? options.outputFormat.toLowerCase() : \"xml\";\n\n // ressource utilisée pour le calcul altimétrique\n this.options.resource = options.resource || \"rge_alti_corse2a_float32_zip_lamb93\";\n\n // sampling\n this.options.sampling = options.sampling || null;\n\n // type d'api utilisé pour requeter le service, en majuscule !\n this.options.api = (typeof options.api === \"string\") ? options.api.toUpperCase() : \"REST\";\n\n // l'api ne peut être interrogée qu'en GET.\n if (this.options.api === \"REST\") {\n this.options.httpMethod = \"GET\";\n }\n\n // param. zonly\n this.options.zonly = options.zonly || false;\n\n // param. measures\n this.options.measures = options.measures || false;\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n // en fonction du type d'api, REST ou WPS, du format de reponse demandé (outputFormat)\n // ainsi que sur le type de service (profil ou elevation)\n if (!this.options.serverUrl) {\n // Code commenté pour Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti\n /* var lstUrlByDefault = DefaultUrlService.Alti.newUrl();\n if (this.options.oldAltiService) {\n lstUrlByDefault = DefaultUrlService.Alti.url();\n }*/\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti\n var lstUrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Alti.url();\n var urlFound = null;\n switch (this.options.api) {\n case \"WPS\":\n urlFound = lstUrlByDefault.wps;\n break;\n case \"REST\":\n var key = (options.sampling ? \"profil\" : \"elevation\") + \"-\" + this.options.outputFormat;\n urlFound = lstUrlByDefault[key];\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"api\"));\n }\n\n if (!urlFound) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = urlFound;\n this.logger.trace(\"Server URL by default : \" + this.options.serverUrl);\n }\n\n // gestion du type de service\n // si l'extension de l'url est .json ou .xml, on surcharge le format de sortie (outputFormat)\n var idx = this.options.serverUrl.lastIndexOf(\".\");\n if (idx !== -1) {\n var extension = this.options.serverUrl.substring(idx + 1);\n if (extension && extension.length < 5) { // FIXME extension de moins de 4 car. ...\n this.logger.trace(\"Server Extension URL : \" + extension);\n switch (extension.toLowerCase()) {\n case \"json\":\n case \"xml\":\n this.options.outputFormat = extension.toLowerCase();\n break;\n default:\n throw new Error(\"type of service : unknown or unsupported (json or xml) !\");\n }\n }\n }\n}\n\n/**\n * @lends module:Alti#\n */\nAlti.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/**\n * Constructeur (alias)\n */\nAlti.prototype.constructor = Alti;\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAlti.prototype.buildRequest = function (error, success) {\n // utilisation en mode callback\n var options = {\n httpMethod : this.options.httpMethod,\n // callback\n onSuccess : function (result) {\n // sauvegarde de la requete !\n this.request = result;\n success.call(this, this.request);\n },\n onError : error,\n scope : this,\n // spécifique au service :\n resource : this.options.resource,\n positions : this.options.positions,\n outputFormat : this.options.outputFormat,\n sampling : this.options.sampling,\n api : this.options.api,\n zonly : this.options.zonly,\n measures : this.options.measures\n };\n\n _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n};\n\n/**\n * Analyse de la reponse (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAlti.prototype.analyzeResponse = function (error, success) {\n // INFO\n // Factory pour masquer la complexité du retour du service qui renvoie soit\n // - une 'string' qui contient du XML ou JSON natif en mode XHR\n // - un objet JSON qui est natif ou encapsulé\n\n if (this.response) {\n var options = {\n response : this.response,\n outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML !\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Alti);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9BbHRpLmpz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RyaW5nIGVuIG1vZGUgWEhSIDogSlNPTiBvdSBYTUwgIVxuICAgICAgICAgICAgcmF3UmVzcG9uc2UgOiB0aGlzLm9wdGlvbnMucmF3UmVzcG9uc2UsXG4gICAgICAgICAgICBvbkVycm9yIDogZXJyb3IsXG4gICAgICAgICAgICBvblN1Y2Nlc3MgOiBzdWNjZXNzLFxuICAgICAgICAgICAgc2NvcGUgOiB0aGlzXG4gICAgICAgIH07XG5cbiAgICAgICAgQWx0aVJlc3BvbnNlRmFjdG9yeS5idWlsZChvcHRpb25zKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBlcnJvci5jYWxsKHRoaXMsIG5ldyBFcnJvclNlcnZpY2UoXy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FTVBUWVwiKSkpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFsdGk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js\n"); /***/ }), @@ -295,7 +295,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Response/model/AltiResponse */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\");\n/* harmony import */ var _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Response/model/Elevation */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\");\n\n/**\n * Fonction retournant un objet contenant des clés de lecture (readers)\n * qui permettent de parser des réponses XML du service Altimétrique du Géoportail\n * (calcul altimétrique simple ou profil altimétrique d'une courbe),\n * lorsque le paramètre output = xml,\n * afin de récupérer les élévations retournées.\n *\n * @module AltiResponseReader\n * @alias Gp.Services.Alti.Formats.AltiResponseReader\n * @private\n */\n\n// import Logger from \"../../../Utils/LoggerByDefault\";\n\n\n\n/**\n *\n * Objet AltiResponseReader\n *\n * @member {Object} AltiResponseReader\n *\n * @property {Object} AltiResponseReader.READERS - Objet contenant des fonctions de lecture, appelées \"readers\"\n * dont chaque clé correspond au nom d'un tag du XML que l'on souhaite lire\n * et la valeur associée est une fonction (node, data)\n * où node est un noeud du document DOM\n * et data est un objet où l'on stocke les informations lues dans le XML.\n *\n * @property {Method} AltiResponseReader.READERS.elevations - Lecture d'un noeud \"elevations\" de la réponse XML\n * du service alti, correspondant logiquement à la racine du document\n * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée)\n *\n * @property {Method} AltiResponseReader.READERS.elevation - ecture d'un noeud \"elevation\" de la réponse xml du service alti.\n * (contient un ou 4 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, et acc)\n *\n * @property {Method} AltiResponseReader.READERS.lat - Lecture d'un noeud \"lat\" de la réponse xml du service alti.\n * (contient une valeur de latitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.lon - Lecture d'un noeud \"lon\" de la réponse xml du service alti.\n * (contient une valeur de longitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.z - Lecture d'un noeud \"z\" de la réponse xml du service alti.\n * (contient une valeur d'altitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.acc - Lecture d'un noeud \"acc\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.exceptionreport - Lecture d'un noeud \"ExceptionReport\" de la réponse xml du service alti.\n *\n * @property {Method} AltiResponseReader.READERS.exception - Lecture d'un noeud \"Exception\" de la réponse xml du service alti.\n *\n * @property {Method} AltiResponseReader.read - Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique,\n * à l'aide des readers de la classe.\n *\n */\nvar AltiResponseReader = {};\n\nAltiResponseReader.READERS = {\n\n /**\n * Lecture d'un noeud \"elevations\" de la réponse XML du service alti, correspondant logiquement à la racine du document\n * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée)\n *\n * @param {DOMElement} root - racine de la réponse XML\n * @static\n * @memberof AltiResponseReader\n * @returns {Object} Retourne un objet de type AltiResponse\n */\n elevations : function (root) {\n // INFO : on passe en paramètre l'objet en entrée elevations, vide, à remplir.\n var altiResponse = new _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n\n if (root.hasChildNodes()) {\n var children = root.childNodes;\n var child;\n var elevation;\n\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n\n if (AltiResponseReader.READERS[child.nodeName]) {\n elevation = AltiResponseReader.READERS[child.nodeName](child);\n altiResponse.elevations.push(elevation);\n }\n }\n }\n\n return altiResponse;\n },\n\n /**\n * Lecture d'un noeud \"elevation\" de la réponse xml du service alti.\n * (contient un ou 4 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, et acc)\n *\n * @param {DOMElement} node - noeud elevation à lire pour récupérer les informations de l'élévation retournée (z [, lon, lat, acc])\n * @return {Array} elevationResponse - format de la réponse en sortie, instance de AltiResponse\n * @static\n * @memberof AltiResponseReader\n */\n elevation : function (node) {\n var elevation = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (AltiResponseReader.READERS[child.nodeName]) {\n // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir.\n AltiResponseReader.READERS[child.nodeName](child, elevation);\n }\n }\n }\n return elevation;\n },\n\n /**\n * Lecture d'un noeud \"lat\" de la réponse xml du service alti.\n * (contient une valeur de latitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la latitude\n * @param {Object} elevation - objet dans lequel stocker la latitude retournée\n * @static\n * @memberof AltiResponseReader\n */\n lat : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevation.lat = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : latitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"lon\" de la réponse xml du service alti.\n * (contient une valeur de longitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la longitude\n * @param {Object} elevation - objet dans lequel stocker la longitude retournée\n * @static\n * @memberof AltiResponseReader\n */\n lon : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevation.lon = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : longitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"z\" de la réponse xml du service alti.\n * (contient une valeur d'altitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'altitude\n * @param {Object} elevation - objet dans lequel stocker l'altitude retournée\n * @static\n * @memberof AltiResponseReader\n */\n z : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n if (elevation) {\n elevation.z = parseFloat(textNode.nodeValue);\n } else {\n elevation = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n elevation.z = parseFloat(textNode.nodeValue);\n return elevation;\n }\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : altitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"acc\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} elevation - objet dans lequel stocker la précision retournée\n * @static\n * @memberof AltiResponseReader\n */\n acc : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevation.acc = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : précision (acc) attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"ExceptionReport\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} exceptionReport - objet contenant l'exception\n * @static\n * @memberof AltiResponseReader\n */\n exceptionreport : function (node) {\n var response = {};\n\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.nodeName === \"Exception\") {\n response.exceptionReport = AltiResponseReader.READERS.exception(child);\n }\n }\n }\n\n return response;\n },\n\n /**\n * Lecture d'un noeud \"Exception\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} exceptionReport - objet contenant l'exception, avec deux attributs :\n * {String} exceptionReport.exceptionCode - qui contient l'identifiant du code de l'exception\n * {String} exceptionReport.exception - qui contient le message de l'exception\n * @static\n * @memberof AltiResponseReader\n */\n exception : function (node) {\n var exceptionReport = {};\n\n // get exception code\n var exceptionCode = node.getAttribute(\"exceptionCode\");\n if (exceptionCode) {\n exceptionReport.exceptionCode = exceptionCode;\n }\n\n // get exception message\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n exceptionReport.exception = textNode.nodeValue;\n }\n\n return exceptionReport;\n },\n\n /**\n * Lecture d'un noeud \"Error\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} error - objet contenant l'exception\n * @static\n */\n error : function (node) {\n var response = {\n error : {}\n };\n // get error code and description\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n var textNode;\n // get error code\n if (child.nodeType === 1 && child.nodeName === \"code\") { // 1 === node.ELEMENT_NODE\n textNode = child.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n response.error.code = textNode.nodeValue;\n }\n }\n // get error description\n if (child.nodeType === 1 && child.nodeName === \"description\") { // 1 === node.ELEMENT_NODE\n textNode = child.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n response.error.description = textNode.nodeValue;\n }\n }\n }\n }\n return response;\n }\n\n};\n\n/**\n * Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique,\n * à l'aide des readers de la classe.\n *\n * @method AltiResponseReader.read\n * @param {DOMElement} root - racine de la réponse XML à lire\n * @static\n * @memberof AltiResponseReader\n */\nAltiResponseReader.read = function (root) {\n if (root.nodeName === \"elevations\") {\n var altiResponse = AltiResponseReader.READERS.elevations(root);\n return altiResponse;\n } else if (root.nodeName === \"ExceptionReport\") {\n var exceptionReport = AltiResponseReader.READERS.exceptionreport(root);\n return exceptionReport;\n } else if (root.nodeName === \"error\") {\n var error = AltiResponseReader.READERS.error(root);\n return error;\n } else {\n throw new Error(\"Erreur lors de la lecture de la réponse : elle n'est pas au format attendu.\");\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiResponseReader);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9Gb3JtYXRzL0FsdGlSZXNwb25zZVJlYWRlci5qcz8xNzViIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQzBEO0FBQ047O0FBRXBEO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsWUFBWSxPQUFPO0FBQ25CO0FBQ0EsY0FBYyxPQUFPO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxjQUFjLE9BQU87Q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ByZW1wbGlyLlxuICAgICAgICB2YXIgYWx0aVJlc3BvbnNlID0gbmV3IEFsdGlSZXNwb25zZSgpO1xuXG4gICAgICAgIGlmIChyb290Lmhhc0NoaWxkTm9kZXMoKSkge1xuICAgICAgICAgICAgdmFyIGNoaWxkcmVuID0gcm9vdC5jaGlsZE5vZGVzO1xuICAgICAgICAgICAgdmFyIGNoaWxkO1xuICAgICAgICAgICAgdmFyIGVsZXZhdGlvbjtcblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGlsZHJlbi5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGNoaWxkID0gY2hpbGRyZW5baV07XG5cbiAgICAgICAgICAgICAgICBpZiAoQWx0aVJlc3BvbnNlUmVhZGVyLlJFQURFUlNbY2hpbGQubm9kZU5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgIGVsZXZhdGlvbiA9IEFsdGlSZXNwb25zZVJlYWRlci5SRUFERVJTW2NoaWxkLm5vZGVOYW1lXShjaGlsZCk7XG4gICAgICAgICAgICAgICAgICAgIGFsdGlSZXNwb25zZS5lbGV2YXRpb25zLnB1c2goZWxldmF0aW9uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gYWx0aVJlc3BvbnNlO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBMZWN0dXJlIGQndW4gbm9ldWQgXCJlbGV2YXRpb25cIiBkZSBsYSByw6lwb25zZSB4bWwgZHUgc2VydmljZSBhbHRpLlxuICAgICAqICAgICAgKGNvbnRpZW50IHVuIG91IDQgY2hpbGROb2RlIChzKSBjb3JyZXNwb25kYW50IMOgIGwnYWx0aXR1ZGUgKHopIGV0IMOpdmVudHVlbGxlbWVudCBsYXQsIGxvbiwgZXQgYWNjKVxuICAgICAqXG4gICAgICogQHBhcmFtIHtET01FbGVtZW50fSBub2RlIC0gbm9ldWQgZWxldmF0aW9uIMOgI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tm9kZTtcbiAgICAgICAgICAgICAgICAvLyBnZXQgZXJyb3IgY29kZVxuICAgICAgICAgICAgICAgIGlmIChjaGlsZC5ub2RlVHlwZSA9PT0gMSAmJiBjaGlsZC5ub2RlTmFtZSA9PT0gXCJjb2RlXCIpIHsgLy8gMSA9PT0gbm9kZS5FTEVNRU5UX05PREVcbiAgICAgICAgICAgICAgICAgICAgdGV4dE5vZGUgPSBjaGlsZC5maXJzdENoaWxkO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGV4dE5vZGUgJiYgdGV4dE5vZGUubm9kZVR5cGUgPT09IDMpIHsgLy8gMyA9PT0gbm9kZS5URVhUX05PREVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVycm9yLmNvZGUgPSB0ZXh0Tm9kZS5ub2RlVmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZ2V0IGVycm9yIGRlc2NyaXB0aW9uXG4gICAgICAgICAgICAgICAgaWYgKGNoaWxkLm5vZGVUeXBlID09PSAxICYmIGNoaWxkLm5vZGVOYW1lID09PSBcImRlc2NyaXB0aW9uXCIpIHsgLy8gMSA9PT0gbm9kZS5FTEVNRU5UX05PREVcbiAgICAgICAgICAgICAgICAgICAgdGV4dE5vZGUgPSBjaGlsZC5maXJzdENoaWxkO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGV4dE5vZGUgJiYgdGV4dE5vZGUubm9kZVR5cGUgPT09IDMpIHsgLy8gMyA9PT0gbm9kZS5URVhUX05PREVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVycm9yLmRlc2NyaXB0aW9uID0gdGV4dE5vZGUubm9kZVZhbHVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbn07XG5c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V3IEVycm9yKFwiRXJyZXVyIGxvcnMgZGUgbGEgbGVjdHVyZSBkZSBsYSByw6lwb25zZSA6IGVsbGUgbidlc3QgcGFzIGF1IGZvcm1hdCBhdHRlbmR1LlwiKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUmVzcG9uc2VSZWFkZXI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Response/model/AltiResponse */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\");\n/* harmony import */ var _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Response/model/Elevation */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\");\n/* harmony import */ var _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Response/model/Measure */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js\");\n\n/**\n * Fonction retournant un objet contenant des clés de lecture (readers)\n * qui permettent de parser des réponses XML du service Altimétrique du Géoportail\n * (calcul altimétrique simple ou profil altimétrique d'une courbe),\n * lorsque le paramètre output = xml,\n * afin de récupérer les élévations retournées.\n *\n * @module AltiResponseReader\n * @alias Gp.Services.Alti.Formats.AltiResponseReader\n * @private\n */\n\n// import Logger from \"../../../Utils/LoggerByDefault\";\n\n\n\n\n/**\n *\n * Objet AltiResponseReader\n *\n * @member {Object} AltiResponseReader\n *\n * @property {Object} AltiResponseReader.READERS - Objet contenant des fonctions de lecture, appelées \"readers\"\n * dont chaque clé correspond au nom d'un tag du XML que l'on souhaite lire\n * et la valeur associée est une fonction (node, data)\n * où node est un noeud du document DOM\n * et data est un objet où l'on stocke les informations lues dans le XML.\n *\n * @property {Method} AltiResponseReader.READERS.elevations - Lecture d'un noeud \"elevations\" de la réponse XML\n * du service alti, correspondant logiquement à la racine du document\n * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée)\n *\n * @property {Method} AltiResponseReader.READERS.elevation - Lecture d'un noeud \"elevation\" de la réponse xml du service alti.\n * (contient un ou 4 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, et acc)\n *\n * @property {Method} AltiResponseReader.READERS.lat - Lecture d'un noeud \"lat\" de la réponse xml du service alti.\n * (contient une valeur de latitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.lon - Lecture d'un noeud \"lon\" de la réponse xml du service alti.\n * (contient une valeur de longitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.z - Lecture d'un noeud \"z\" de la réponse xml du service alti.\n * (contient une valeur d'altitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.acc - Lecture d'un noeud \"acc\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.measures - Lecture d'un noeud \"measures\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.source_name - Lecture d'un noeud \"source_name\" de la réponse xml du service alti.\n * (pour remplir l'éventuel objet measure)\n *\n * @property {Method} AltiResponseReader.READERS.source_mesure - Lecture d'un noeud \"source_mesure\" de la réponse xml du service alti.\n * (pour remplir l'éventuel objet measure)\n *\n * @property {Method} AltiResponseReader.READERS.exceptionreport - Lecture d'un noeud \"ExceptionReport\" de la réponse xml du service alti.\n *\n * @property {Method} AltiResponseReader.READERS.exception - Lecture d'un noeud \"Exception\" de la réponse xml du service alti.\n *\n * @property {Method} AltiResponseReader.read - Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique,\n * à l'aide des readers de la classe.\n *\n */\nvar AltiResponseReader = {};\n\nAltiResponseReader.READERS = {\n\n /**\n * Lecture d'un noeud \"elevations\" de la réponse XML du service alti, correspondant logiquement à la racine du document\n * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée)\n *\n * @param {DOMElement} root - racine de la réponse XML\n * @static\n * @memberof AltiResponseReader\n * @returns {Object} Retourne un objet de type AltiResponse\n */\n elevations : function (root) {\n // INFO : on passe en paramètre l'objet en entrée elevations, vide, à remplir.\n var altiResponse = new _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n\n if (root.hasChildNodes()) {\n var children = root.childNodes;\n var child;\n var elevation;\n\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n\n if (AltiResponseReader.READERS[child.nodeName]) {\n elevation = AltiResponseReader.READERS[child.nodeName](child);\n altiResponse.elevations.push(elevation);\n }\n }\n }\n\n return altiResponse;\n },\n\n /**\n * Lecture d'un noeud \"elevation\" de la réponse xml du service alti.\n * (contient un ou 5 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, acc et measures)\n *\n * @param {DOMElement} node - noeud elevation à lire pour récupérer les informations de l'élévation retournée (z [, lon, lat, acc, measures])\n * @return {Array} elevationResponse - format de la réponse en sortie, instance de AltiResponse\n * @static\n * @memberof AltiResponseReader\n */\n elevation : function (node) {\n var elevation = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (AltiResponseReader.READERS[child.nodeName]) {\n // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir.\n AltiResponseReader.READERS[child.nodeName](child, elevation);\n }\n }\n }\n return elevation;\n },\n\n /**\n * Lecture d'un noeud \"lat\" de la réponse xml du service alti.\n * (contient une valeur de latitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la latitude\n * @param {Object} elevation - objet dans lequel stocker la latitude retournée\n * @static\n * @memberof AltiResponseReader\n */\n lat : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevation.lat = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : latitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"lon\" de la réponse xml du service alti.\n * (contient une valeur de longitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la longitude\n * @param {Object} elevation - objet dans lequel stocker la longitude retournée\n * @static\n * @memberof AltiResponseReader\n */\n lon : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevation.lon = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : longitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"z\" de la réponse xml du service alti.\n * (contient une valeur d'altitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'altitude\n * @param {Object} elevationObject - objet dans lequel stocker l'altitude retournée : elevation ou measure\n * @static\n * @memberof AltiResponseReader\n */\n z : function (node, elevationObject) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n if (elevationObject) {\n elevationObject.z = parseFloat(textNode.nodeValue);\n } else {\n elevationObject = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n elevationObject.z = parseFloat(textNode.nodeValue);\n return elevationObject;\n }\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : altitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"acc\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} elevationObject - objet dans lequel stocker la précision retournée : elevation ou measure\n * @static\n * @memberof AltiResponseReader\n */\n acc : function (node, elevationObject) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevationObject.acc = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : précision (acc) attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"source_name\" de la réponse xml du service alti.\n * (contient le nom de la source, qui est un string)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} measure - objet dans lequel stocker le nom de la source retourné\n * @static\n * @memberof AltiResponseReader\n */\n source_name : function (node, measure) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n measure.source_name = textNode.nodeValue;\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : source_name attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"source_measure\" de la réponse xml du service alti.\n * (contient le nom de la mesure, qui est un string)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} measure - objet dans lequel stocker le nom de la source retourné\n * @static\n * @memberof AltiResponseReader\n */\n source_measure : function (node, measure) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n measure.source_measure = textNode.nodeValue;\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : source_measure attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"measures\" et de ses enfants \"measure\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} elevation - objet dans lequel stocker la précision retournée\n * @static\n * @memberof AltiResponseReader\n */\n measures : function (node, elevation) {\n elevation.measures = [];\n var measure;\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var measureNode;\n var measureChildren;\n for (var i = 0; i < children.length; i++) {\n measure = new _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n measureNode = children[i];\n measureChildren = measureNode.childNodes;\n for (var j = 0; j < measureChildren.length; j++) {\n if (AltiResponseReader.READERS[measureChildren[j].nodeName]) {\n // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir.\n AltiResponseReader.READERS[measureChildren[j].nodeName](measureChildren[j], measure);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : measures attendues mais absentes\");\n }\n }\n elevation.measures.push(measure);\n }\n }\n },\n\n /**\n * Lecture d'un noeud \"ExceptionReport\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} exceptionReport - objet contenant l'exception\n * @static\n * @memberof AltiResponseReader\n */\n exceptionreport : function (node) {\n var response = {};\n\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.nodeName === \"Exception\") {\n response.exceptionReport = AltiResponseReader.READERS.exception(child);\n }\n }\n }\n\n return response;\n },\n\n /**\n * Lecture d'un noeud \"Exception\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} exceptionReport - objet contenant l'exception, avec deux attributs :\n * {String} exceptionReport.exceptionCode - qui contient l'identifiant du code de l'exception\n * {String} exceptionReport.exception - qui contient le message de l'exception\n * @static\n * @memberof AltiResponseReader\n */\n exception : function (node) {\n var exceptionReport = {};\n\n // get exception code\n var exceptionCode = node.getAttribute(\"exceptionCode\");\n if (exceptionCode) {\n exceptionReport.exceptionCode = exceptionCode;\n }\n\n // get exception message\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n exceptionReport.exception = textNode.nodeValue;\n }\n\n return exceptionReport;\n },\n\n /**\n * Lecture d'un noeud \"Error\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} error - objet contenant l'exception\n * @static\n */\n error : function (node) {\n var response = {\n error : {}\n };\n // get error code and description\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n var textNode;\n // get error code\n if (child.nodeType === 1 && child.nodeName === \"code\") { // 1 === node.ELEMENT_NODE\n textNode = child.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n response.error.code = textNode.nodeValue;\n }\n }\n // get error description\n if (child.nodeType === 1 && child.nodeName === \"description\") { // 1 === node.ELEMENT_NODE\n textNode = child.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n response.error.description = textNode.nodeValue;\n }\n }\n }\n }\n return response;\n }\n\n};\n\n/**\n * Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique,\n * à l'aide des readers de la classe.\n *\n * @method AltiResponseReader.read\n * @param {DOMElement} root - racine de la réponse XML à lire\n * @static\n * @memberof AltiResponseReader\n */\nAltiResponseReader.read = function (root) {\n if (root.nodeName === \"elevations\") {\n var altiResponse = AltiResponseReader.READERS.elevations(root);\n return altiResponse;\n } else if (root.nodeName === \"ExceptionReport\") {\n var exceptionReport = AltiResponseReader.READERS.exceptionreport(root);\n return exceptionReport;\n } else if (root.nodeName === \"error\") {\n var error = AltiResponseReader.READERS.error(root);\n return error;\n } else {\n throw new Error(\"Erreur lors de la lecture de la réponse : elle n'est pas au format attendu.\");\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiResponseReader);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9Gb3JtYXRzL0FsdGlSZXNwb25zZVJlYWRlci5qcz8xNzViIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUMwRDtBQUNOO0FBQ0o7O0FBRWhEO0FBQ0E7QUFDQTtBQUNBO0FB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EByZXR1cm4ge09iamVjdH0gZXJyb3IgLSBvYmpldCBjb250ZW5hbnQgbCdleGNlcHRpb25cbiAgICAgKiBAc3RhdGljXG4gICAgICovXG4gICAgZXJyb3IgOiBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICB2YXIgcmVzcG9uc2UgPSB7XG4gICAgICAgICAgICBlcnJvciA6IHt9XG4gICAgICAgIH07XG4gICAgICAgIC8vIGdldCBlcnJvciBjb2RlIGFuZCBkZXNjcmlwdGlvblxuICAgICAgICBpZiAobm9kZS5oYXNDaGlsZE5vZGVzKCkpIHtcbiAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IG5vZGUuY2hpbGROb2RlcztcbiAgICAgICAgICAgIHZhciBjaGlsZDtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjaGlsZCA9IGNoaWxkcmVuW2ldO1xuICAgICAgICAgICAgICAgIHZhciB0ZXh0Tm9kZTtcbiAgICAgICAgICAgICAgICAvLyBnZXQgZXJyb3IgY29kZVxuICAgICAgICAgICAgICAgIGlmIChjaGlsZC5ub2RlVHlwZSA9PT0gMSAmJiBjaGlsZC5ub2RlTmFtZSA9PT0gXCJjb2RlXCIpIHsgLy8gMSA9PT0gbm9kZS5FTEVNRU5UX05PREVcbiAgICAgICAgICAgICAgICAgICAgdGV4dE5vZGUgPSBjaGlsZC5maXJzdENoaWxkO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGV4dE5vZGUgJiYgdGV4dE5vZGUubm9kZVR5cGUgPT09IDMpIHsgLy8gMyA9PT0gbm9kZS5URVhUX05PREVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVycm9yLmNvZGUgPSB0ZXh0Tm9kZS5ub2RlVmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZ2V0IGVycm9yIGRlc2NyaXB0aW9uXG4gICAgICAgICAgICAgICAgaWYgKGNoaWxkLm5vZGVUeXBlID09PSAxICYmIGNoaWxkLm5vZGVOYW1lID09PSBcImRlc2NyaXB0aW9uXCIpIHsgLy8gMSA9PT0gbm9kZS5FTEVNRU5UX05PREVcbiAgICAgICAgICAgICAgICAgICAgdGV4dE5vZGUgPSBjaGlsZC5maXJzdENoaWxkO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGV4dE5vZGUgJiYgdGV4dE5vZGUubm9kZVR5cGUgPT09IDMpIHsgLy8gMyA9PT0gbm9kZS5URVhUX05PREVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVycm9yLmRlc2NyaXB0aW9uID0gdGV4dE5vZGUubm9kZVZhbHVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbn07XG5cbi8qKlxuICogTcOpdGhvZGUgcGVybWV0dGFudCBkZSBsYW5jZXIgbGEgbGVjdHVyZSBkJ3VuZSByw6lwb25zZSBYTUwgZHUgc2VydmljZSBhbHRpbcOpdHJpcXVlLFxuICogICAgICDDoCBsJ2FpZGUgZGVzIHJlYWRlcnMgZGUgbGEgY2xhc3NlLlxuICpcbiAqIEBtZXRob2QgQWx0aVJlc3BvbnNlUmVhZGVyLnJlYWRcbiAqIEBwYXJhbSB7RE9NRWxlbWVudH0gcm9vdCAtIHJhY2luZSBkZSBsYSByw6lwb25zZSBYTUwgw6AgbGlyZVxuICogQHN0YXRpY1xuICogQG1lbWJlcm9mIEFsdGlSZXNwb25zZVJlYWRlclxuICovXG5BbHRpUmVzcG9uc2VSZWFkZXIucmVhZCA9IGZ1bmN0aW9uIChyb290KSB7XG4gICAgaWYgKHJvb3Qubm9kZU5hbWUgPT09IFwiZWxldmF0aW9uc1wiKSB7XG4gICAgICAgIHZhciBhbHRpUmVzcG9uc2UgPSBBbHRpUmVzcG9uc2VSZWFkZXIuUkVBREVSUy5lbGV2YXRpb25zKHJvb3QpO1xuICAgICAgICByZXR1cm4gYWx0aVJlc3BvbnNlO1xuICAgIH0gZWxzZSBpZiAocm9vdC5ub2RlTmFtZSA9PT0gXCJFeGNlcHRpb25SZXBvcnRcIikge1xuICAgICAgICB2YXIgZXhjZXB0aW9uUmVwb3J0ID0gQWx0aVJlc3BvbnNlUmVhZGVyLlJFQURFUlMuZXhjZXB0aW9ucmVwb3J0KHJvb3QpO1xuICAgICAgICByZXR1cm4gZXhjZXB0aW9uUmVwb3J0O1xuICAgIH0gZWxzZSBpZiAocm9vdC5ub2RlTmFtZSA9PT0gXCJlcnJvclwiKSB7XG4gICAgICAgIHZhciBlcnJvciA9IEFsdGlSZXNwb25zZVJlYWRlci5SRUFERVJTLmVycm9yKHJvb3QpO1xuICAgICAgICByZXR1cm4gZXJyb3I7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRXJyZXVyIGxvcnMgZGUgbGEgbGVjdHVyZSBkZSBsYSByw6lwb25zZSA6IGVsbGUgbidlc3QgcGFzIGF1IGZvcm1hdCBhdHRlbmR1LlwiKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUmVzcG9uc2VSZWFkZXI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js\n"); /***/ }), @@ -307,7 +307,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Res /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AltiRequestREST */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js\");\n/* harmony import */ var _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AltiRequestWPS */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestWPS.js\");\n/**\n * Creation d'une requête en REST ou WPS\n * (Factory)\n *\n * @module AltiRequestFactory\n * @alias Gp.Services.Alti.Request.AltiRequestFactory\n * @private\n */\n\n\n\n\n\nvar AltiRequestFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Alti\n *\n * @example\n * var options = {\n * httpMethod : 'GET', // GET|POST\n * onSuccess : function (response) {},\n * onError : function (error) {},\n * scope : this,\n * positions : [{lon:, lat:}, {lon:, lat:}],\n * outputFormat : 'json' // json|xml\n * sampling : 3,\n * api : 'REST', // REST|WPS\n * zonly : false // false|true\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiRequestFactory\");\n logger.trace([\"AltiRequestFactory::build()\"]);\n\n var request = null;\n\n // on factorise les options par groupe;\n // - global,\n // - param, les params pour les data inputs\n // - wps, les param du service\n // - callback\n\n var settings = {\n // ajout des valeurs par defaut spécifiques au service\n type : options.sampling ? \"Profil\" : \"Elevation\",\n method : options.httpMethod,\n param : {\n positions : null,\n delimiter : null, // FIXME par defaut, on ne le met pas en place car ça fait planter la requête !?\n indent : null, // par defaut\n crs : null, // par defaut\n format : null, // (only to POST)\n sampling : null, // (only use by Profil)\n zonly : null // (only use by Elevation)\n }\n };\n\n // surcharge des valeurs obligatoires\n settings.param.positions = options.positions;\n settings.param.format = options.outputFormat;\n settings.param.sampling = options.sampling;\n settings.param.zonly = options.zonly;\n\n // gestion des callback\n var bOnError = !!(options.onError !== null && typeof options.onError === \"function\"); // cast variable to boolean\n var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === \"function\");\n\n var message = null;\n switch (options.api) {\n case \"REST\":\n // FIXME les exceptions ne sont pas 'catchées' sur le constructeur !\n var myReq = new _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__[\"default\"](settings);\n if (!myReq.processRequestString()) {\n message = \"Error in process request (rest) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n request = myReq.requestString;\n break;\n case \"WPS\":\n // ajout des valeurs par defaut spécifiques au service WPS\n settings.wps = {\n service : null, // par defaut\n version : null, // par defaut\n identifier : null, // par defaut\n rawdataoutput : null, // par defaut\n request : null // par defaut\n };\n\n request = _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__[\"default\"].build(settings);\n if (!request) {\n message = \"Error in process request (wps) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n break;\n default:\n message = \"Type of API is not supported by service (REST or WPS) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n\n if (bOnSuccess) {\n options.onSuccess.call(options.scope, request);\n }\n\n return request;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequestFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZ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clNlcnZpY2UobWVzc2FnZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVxdWVzdCA9IG15UmVxLnJlcXVlc3RTdHJpbmc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFwiV1BTXCI6XG4gICAgICAgICAgICAgICAgLy8gYWpvdXQgZGVzIHZhbGV1cnMgcGFyIGRlZmF1dCBzcMOpY2lmaXF1ZXMgYXUgc2VydmljZSBXUFNcbiAgICAgICAgICAgICAgICBzZXR0aW5ncy53cHMgPSB7XG4gICAgICAgICAgICAgICAgICAgIHNlcnZpY2UgOiBudWxsLCAvLyBwYXIgZGVmYXV0XG4gICAgICAgICAgICAgICAgICAgIHZlcnNpb24gOiBudWxsLCAvLyBwYXIgZGVmYXV0XG4gICAgICAgICAgICAgICAgICAgIGlkZW50aWZpZXIgOiBudWxsLCAvLyBwYXIgZGVmYXV0XG4gICAgICAgICAgICAgICAgICAgIHJhd2RhdGFvdXRwdXQgOiBudWxsLCAvLyBwYXIgZGVmYXV0XG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QgOiBudWxsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgcmVxdWVzdCA9IEFsdGlSZXF1ZXN0V1BTLmJ1aWxkKHNldHRpbmdzKTtcbiAgICAgICAgICAgICAgICBpZiAoIXJlcXVlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IFwiRXJyb3IgaW4gcHJvY2VzcyByZXF1ZXN0ICh3cHMpICFcIjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGJPbkVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKG1lc3NhZ2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBtZXNzYWdlID0gXCJUeXBlIG9mIEFQSSBpcyBub3Qgc3VwcG9ydGVkIGJ5IHNlcnZpY2UgKFJFU1Qgb3IgV1BTKSAhXCI7XG4gICAgICAgICAgICAgICAgaWYgKGJPbkVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2UobWVzc2FnZSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChiT25TdWNjZXNzKSB7XG4gICAgICAgICAgICBvcHRpb25zLm9uU3VjY2Vzcy5jYWxsKG9wdGlvbnMuc2NvcGUsIHJlcXVlc3QpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlcXVlc3Q7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQWx0aVJlcXVlc3RGYWN0b3J5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AltiRequestREST */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js\");\n/* harmony import */ var _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AltiRequestWPS */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestWPS.js\");\n/**\n * Creation d'une requête en REST ou WPS\n * (Factory)\n *\n * @module AltiRequestFactory\n * @alias Gp.Services.Alti.Request.AltiRequestFactory\n * @private\n */\n\n\n\n\n\nvar AltiRequestFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Alti\n *\n * @example\n * var options = {\n * httpMethod : 'GET', // GET|POST\n * onSuccess : function (response) {},\n * onError : function (error) {},\n * scope : this,\n * positions : [{lon:, lat:}, {lon:, lat:}],\n * outputFormat : 'json' // json|xml\n * sampling : 3,\n * api : 'REST', // REST|WPS\n * zonly : false // false|true\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiRequestFactory\");\n logger.trace([\"AltiRequestFactory::build()\"]);\n\n var request = null;\n\n // on factorise les options par groupe;\n // - global,\n // - param, les params pour les data inputs\n // - wps, les param du service\n // - callback\n\n var settings = {\n // ajout des valeurs par defaut spécifiques au service\n type : options.sampling ? \"Profil\" : \"Elevation\",\n method : options.httpMethod,\n param : {\n positions : null,\n delimiter : null, // FIXME par defaut, on ne le met pas en place car ça fait planter la requête !?\n indent : null, // par defaut\n crs : null, // par defaut\n format : null, // (only to POST)\n sampling : null, // (only use by Profil)\n zonly : null, // (only use by Elevation)\n measures : null // (only use by Elevation)\n }\n };\n\n // surcharge des valeurs obligatoires\n settings.param.positions = options.positions;\n settings.param.format = options.outputFormat;\n settings.param.sampling = options.sampling;\n settings.param.zonly = options.zonly;\n settings.param.measures = options.measures;\n settings.param.resource = options.resource;\n\n // gestion des callback\n var bOnError = !!(options.onError !== null && typeof options.onError === \"function\"); // cast variable to boolean\n var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === \"function\");\n\n var message = null;\n switch (options.api) {\n case \"REST\":\n // FIXME les exceptions ne sont pas 'catchées' sur le constructeur !\n var myReq = new _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__[\"default\"](settings);\n if (!myReq.processRequestString()) {\n message = \"Error in process request (rest) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n request = myReq.requestString;\n break;\n case \"WPS\":\n // ajout des valeurs par defaut spécifiques au service WPS\n settings.wps = {\n service : null, // par defaut\n version : null, // par defaut\n identifier : null, // par defaut\n rawdataoutput : null, // par defaut\n request : null // par defaut\n };\n\n request = _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__[\"default\"].build(settings);\n if (!request) {\n message = \"Error in process request (wps) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n break;\n default:\n message = \"Type of API is not supported by service (REST or WPS) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n\n if (bOnSuccess) {\n options.onSuccess.call(options.scope, request);\n }\n\n return request;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequestFactory);\n//# sourceURL=[module]\n//#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gLSBnbG9iYWwsXG4gICAgICAgIC8vIC0gcGFyYW0sIGxlcyBwYXJhbXMgcG91ciBsZXMgZGF0YSBpbnB1dHNcbiAgICAgICAgLy8gLSB3cHMsIGxlcyBwYXJhbSBkdSBzZXJ2aWNlXG4gICAgICAgIC8vIC0gY2FsbGJhY2tcblxuICAgICAgICB2YXIgc2V0dGluZ3MgPSB7XG4gICAgICAgICAgICAvLyBham91dCBkZXMgdmFsZXVycyBwYXIgZGVmYXV0IHNww6ljaWZpcXVlcyBhdSBzZXJ2aWNlXG4gICAgICAgICAgICB0eXBlIDogb3B0aW9ucy5zYW1wbGluZyA/IFwiUHJvZmlsXCIgOiBcIkVsZXZhdGlvblwiLFxuICAgICAgICAgICAgbWV0aG9kIDogb3B0aW9ucy5odHRwTWV0aG9kLFxuICAgICAgICAgICAgcGFyYW0gOiB7XG4gICAgICAgICAgICAgICAgcG9zaXRpb25zIDogbnVsbCxcbiAgICAgICAgICAgICAgICBkZWxpbWl0ZXIgOiBudWxsLCAvLyBGSVhNRSBwYXIgZGVmYXV0LCBvbiBuZSBsZSBtZXQgcGFzIGVuIHBsYWNlIGNhciDDp2EgZmFpdCBwbGFudGVyIGxhIHJlcXXDqnRlICE/XG4gICAgICAgICAgICAgICAgaW5kZW50IDogbnVsbCwgLy8gcGFyIGRlZmF1dFxuICAgICAgICAgICAgICAgIGNycyA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICBmb3JtYXQgOiBudWxsLCAvLyAob25seSB0byBQT1NUKVxuICAgICAgICAgICAgICAgIHNhbXBsaW5nIDogbnVsbCwgLy8gKG9ubHkgdXNlIGJ5IFByb2ZpbClcbiAgICAgICAgICAgICAgICB6b25seSA6IG51bGwsIC8vIChvbmx5IHVzZSBieSBFbGV2YXRpb24pXG4gICAgICAgICAgICAgICAgbWVhc3VyZXMgOiBudWxsIC8vIChvbmx5IHVzZSBieSBFbGV2YXRpb24pXG4gICAgICAgICAgICB9XG4gICAgICAgIH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gPSBuZXcgQWx0aVJlcXVlc3RSRVNUKHNldHRpbmdzKTtcbiAgICAgICAgICAgICAgICBpZiAoIW15UmVxLnByb2Nlc3NSZXF1ZXN0U3RyaW5nKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IFwiRXJyb3IgaW4gcHJvY2VzcyByZXF1ZXN0IChyZXN0KSAhXCI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChiT25FcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShtZXNzYWdlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXF1ZXN0ID0gbXlSZXEucmVxdWVzdFN0cmluZztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgXCJXUFNcIjpcbiAgICAgICAgICAgICAgICAvLyBham91dCBkZXMgdmFsZXVycyBwYXIgZGVmYXV0IHNww6ljaWZpcXVlcyBhdSBzZXJ2aWNlIFdQU1xuICAgICAgICAgICAgICAgIHNldHRpbmdzLndwcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgc2VydmljZSA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgdmVyc2lvbiA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgaWRlbnRpZmllciA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgcmF3ZGF0YW91dHB1dCA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdCA6IG51bGwgLy8gcGFyIGRlZmF1dFxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICByZXF1ZXN0ID0gQWx0aVJlcXVlc3RXUFMuYnVpbGQoc2V0dGluZ3MpO1xuICAgICAgICAgICAgICAgIGlmICghcmVxdWVzdCkge1xuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlID0gXCJFcnJvciBpbiBwcm9jZXNzIHJlcXVlc3QgKHdwcykgIVwiO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYk9uRXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2UobWVzc2FnZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSBcIlR5cGUgb2YgQVBJIGlzIG5vdCBzdXBwb3J0ZWQgYnkgc2VydmljZSAoUkVTVCBvciBXUFMpICFcIjtcbiAgICAgICAgICAgICAgICBpZiAoYk9uRXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShtZXNzYWdlKSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGJPblN1Y2Nlc3MpIHtcbiAgICAgICAgICAgIG9wdGlvbnMub25TdWNjZXNzLmNhbGwob3B0aW9ucy5zY29wZSwgcmVxdWVzdCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVxdWVzdDtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUmVxdWVzdEZhY3Rvcnk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js\n"); /***/ }), @@ -319,7 +319,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model/AltiElevationRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js\");\n/* harmony import */ var _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model/AltiProfilRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js\");\n/* jshint multistr : true */\n\n\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des requêtes de type REST sur le service altimetrique.\n *\n * @todo Le service Alti n'implemente pas le POST !?\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiRequestREST\n * @param {Object} options - options\n * @param {Object} options.param.positions - tableau de coordonnées lon/lat\n * @param {String} options.param.delimiter - '|'\n * @param {Boolean} options.param.indent - false|true\n * @param {String} options.param.crs - 'CRS:84'\n * @param {String} options.param.sampling - 3\n * @param {Boolean} options.param.zonly - false|true\n * @param {String} options.param.format - \"JSON|XML\"\n * @param {String} options.type - \"Profil|Elevation\"\n * @param {String} options.method - GET|POST\n *\n * @example\n * var options = {\n * type : 'Profil', // Elevation\n * method : 'GET', // par defaut\n * param : {\n * positions : [\n * {lon:'1.11', lat:'1.11'},\n * {lon:'1.10', lat:'1.10'},\n * {lon:'1.12', lat:'1.12'}\n * ],\n * delimiter : \";\", // par defaut\n * indent : true, // par defaut\n * crs : 'EPSG:4326', // par defaut\n * format : 'json', // par defaut (only to POST)\n * sampling : 3 , // par defaut (only use by Profil)\n * zonly : false // par defaut (only use by Elevation)\n * }\n * };\n *\n * var result;\n * try {\n * var obj = new AltiRequestREST (options);\n * if (! obj.processRequestString ()) {\n * throw new Error(\"Request empty !?\")\n * }\n * result = obj.requestString;\n * } catch (e) {\n * // exceptions...\n * }\n * @private\n */\nfunction AltiRequestREST (options) {\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiRequestREST\");\n this.logger.trace(\"[Constructeur AltiRequestREST ()]\");\n\n if (!(this instanceof AltiRequestREST)) {\n throw new TypeError(\"AltiRequestREST constructor cannot be called as a function.\");\n }\n\n this.options = options || {};\n\n // existance des options\n if (!this.options) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"options\"));\n }\n\n // type de requete : Altitude ou Profil\n // (param. à determiner en fonction des parametres d'entrée)\n if (!this.options.type) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"type (Elevation or Profil)\"));\n }\n\n // construction du modele de requête\n // (test du type d'objet candidat)\n this.DataObject = null;\n switch (this.options.type) {\n case \"Elevation\":\n this.DataObject = new _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.options.param);\n break;\n case \"Profil\":\n this.DataObject = new _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.options.param);\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"type (Elevation or Profil)\"));\n }\n\n /**\n * methode.\n * Par defaut, \"GET\".\n */\n this.method = this.options.method || \"GET\";\n}\n\nAltiRequestREST.prototype = {\n\n /**\n * request\n * @type {String}\n */\n requestString : null,\n\n /**\n * Constructeur (alias)\n */\n constructor : AltiRequestREST,\n\n /**\n * Template de la requête.\n */\n template : {\n get : {\n // FIXME on retire le param 'delimiter' : &delimiter='__DELIMITER__'\n value : \"lon=__LON__&lat=__LAT__&indent=__INDENT__&crs='__CRS__'\",\n input : {\n point : \"&zonly=__ZONLY__\",\n profil : \"&sampling=__SAMPLING__\"\n }\n },\n post : {\n // FIXME on retire le param 'delimiter' : delimiter='__DELIMITER__'\\n\\\n value : \"lon=__LON__\\n\" +\n \"lat=__LAT__\\n\" +\n \"indent=__INDENT__\\n\" +\n \"crs='__CRS__'\\n\",\n input : {\n point : \"zonly=__ZONLY__\",\n profil : \"sampling=__SAMPLING__\"\n }\n }\n },\n\n /**\n * Construction de la requête.\n *\n * @example\n * // GET out : lon=0.2367,2.1570&lat=48.0551,46.6077&delimiter=,&indent=true&zonly=true&crs='CRS:84'\n * // POST out : Not yet supported method POST !\n * @returns {String}\n */\n processRequestString : function () {\n this.logger.trace(\"AltiRequestREST::processRequestString ()\");\n\n var template = \"\";\n if (this.method === \"POST\") {\n template = this.template.post.value;\n } else if (this.method === \"GET\") {\n template = this.template.get.value;\n }\n\n template = template.replace(/__LON__/g, this.DataObject.getLon());\n template = template.replace(/__LAT__/g, this.DataObject.getLat());\n // FIXME on retire le param 'delimiter'\n // template = template.replace(/__DELIMITER__/g, this.DataObject.delimiter);\n template = template.replace(/__INDENT__/g, this.DataObject.indent);\n template = template.replace(/__CRS__/g, this.DataObject.crs);\n\n // ajout +\n template = template + this.__addDataInputs();\n this.logger.trace(\"traduction tmpl\", template);\n\n // sauvegarde\n this.requestString = template;\n\n return this.requestString;\n },\n\n /**\n * Ajout de parametres spécifiques (ex. zonly)\n *\n * @returns {String}\n */\n __addDataInputs : function () {\n this.logger.trace(\"AltiRequestREST::addDataInput ()\");\n\n var myTemplate;\n if (this.method === \"POST\") {\n myTemplate = this.template.post;\n } else if (this.method === \"GET\") {\n myTemplate = this.template.get;\n } else {\n throw new Error(\"No other HTTP method supported by the service !\");\n }\n\n var tmpl = null;\n if (this.DataObject.CLASSNAME === \"AltiElevationRequest\") {\n tmpl = myTemplate.input.point;\n return tmpl.replace(/__ZONLY__/g, this.DataObject.zonly);\n } else if (this.DataObject.CLASSNAME === \"AltiProfilRequest\") {\n tmpl = myTemplate.input.profil;\n return tmpl.replace(/__SAMPLING__/g, this.DataObject.sampling);\n } else {\n throw new Error(\"No other object supported than elevation or profil !?\");\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequestREST);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L0FsdGlSZXF1ZXN0UkVTVC5qcz9kNzQ0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFFb0Q7QUFDSDtBQUNlO0FBQ047O0FBRTFEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ25CLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ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BtZXRob2QgOiAnR0VUJywgIC8vIHBhciBkZWZhdXRcbiAqICAgICAgICAgICBwYXJhbSA6IHtcbiAqICAgICAgICAgICAgICAgcG9zaXRpb25zIDogW1xuICogICAgICAgICAgICAgICAgICAge2xvbjonMS4xMScsIGxhdDonMS4xMSd9LFxuICogICAgICAgICAgICAgICAgICAge2xvbjonMS4xMCcsIGxhdDonMS4xMCd9LFxuICogICAgICAgICAgICAgICAgICAge2xvbjonMS4xMicsIGxhdDonMS4xMid9XG4gKiAgICAgICAgICAgICAgIF0sXG4gKiAgICAgICAgICAgICAgIGRlbGltaXRlciA6IFwiO1wiLCAgICAgICAgIC8vIHBhciBkZWZhdXRcbiAqICAgICAgICAgICAgICAgaW5kZW50ICAgIDogdHJ1ZSwgICAgICAgIC8vIHBhciBkZWZhdXRcbiAqICAgICAgICAgICAgICAgY3JzICAgICAgIDogJ0VQU0c6NDMyNicsIC8vIHBhciBkZWZhdXRcbiAqICAgICAgICAgICAgICAgZm9ybWF0ICAgIDogJ2pzb24nLCAgICAgIC8vIHBhciBkZWZhdXQgKG9ubHkgdG8gUE9TVClcbiAqICAgICAgICAgICAgICAgc2FtcGxpbmcgIDogMyAsICAgICAgICAgIC8vIHBhciBkZWZhdXQgKG9ubHkgdXNlIGJ5IFByb2ZpbClcbiAqICAgICAgICAgICAgICAgem9ubHkgICAgIDogZmFsc2UgICAgICAgIC8vIHBhciBkZWZhdXQgKG9ubHkgdXNlIGJ5IEVsZXZhdGlvbilcbiAqICAgICAgICAgICB9XG4gKiAgICAgIH07XG4gKlxuICogICAgICB2YXIgcmVzdWx0O1xuICogICAgICB0cnkge1xuICogICAgICAgICAgdmFyIG9iaiA9IG5ldyBBbHRpUmVxdWVzdFJFU1QgKG9wdGlvbnMpO1xuICogICAgICAgICAgaWYgKCEgb2JqLnByb2Nlc3NSZXF1ZXN0U3RyaW5nICgpKSB7XG4gKiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiUmVxdWVzdCBlbX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ICAgICAqIENvbnN0cnVjdGV1ciAoYWxpYXMpXG4gICAgICovXG4gICAgY29uc3RydWN0b3IgOiBBbHRpUmVxdWVzdFJFU1QsXG5cbiAgICAvKipcbiAgICAgKiBUZW1wbGF0ZSBkZSBsYSByZXF1w6p0ZS5cbiAgICAgKi9cbiAgICB0ZW1wbGF0ZSA6IHtcbiAgICAgICAgZ2V0IDoge1xuICAgICAgICAgICAgLy8gRklYTUUgb24gcmV0aXJlIGxlIHBhcmFtICdkZWxpbWl0ZXInIDogJmRlbGltaXRlcj0nX19ERUxJTUlURVJfXydcbiAgICAgICAgICAgIHZhbHVlIDogXCJsb249X19MT05fXyZsYXQ9X19MQVRfXyZpbmRlbnQ9X19JTkRFTlRfXyZjcnM9J19fQ1JTX18nXCIsXG4gICAgICAgICAgICBpbnB1dCA6IHtcbiAgICAgICAgICAgICAgICBwb2ludCA6IFwiJnpvbmx5PV9fWk9OTFlfX1wiLFxuICAgICAgICAgICAgICAgIHByb2ZpbCA6IFwiJnNhbXBsaW5nPV9fU0FNUExJTkdfX1wiXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3QgOiB7XG4gICAgICAgICAgICAvLyBGSVhNRSBvbiByZXRpcmUgbGUgcGFyYW0gJ2RlbGltaXRlcicgOiBkZWxpbWl0ZXI9J19fREVMSU1JVEVSX18nXFxuXFxcbiAgICAgICAgICAgIHZhbHVlIDogXCJsb249X19MT05fX1xcblwiICtcbiAgICAgICAgICAgICAgICBcImxhdD1fX0xBVF9fXFxuXCIgK1xuICAgICAgICAgICAgICAgIFwiaW5kZW50PV9fSU5ERU5UX19cXG5cIiArXG4gICAgICAgICAgICAgICAgXCJjcnM9J19fQ1JTX18nXFxuXCIsXG4gICAgICAgICAgICBpbnB1dCA6IHtcbiAgICAgICAgICAgICAgICBwb2ludCA6IFwiem9ubHk9X19aT05MWV9fXCIsXG4gICAgICAgICAgICAgICAgcHJvZmlsIDogXCJzYW1wbGluZz1fX1NBTVBM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///./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model/AltiElevationRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js\");\n/* harmony import */ var _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model/AltiProfilRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js\");\n/* jshint multistr : true */\n\n\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des requêtes de type REST sur le service altimetrique.\n *\n * @todo Le service Alti n'implemente pas le POST !?\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiRequestREST\n * @param {Object} options - options\n * @param {Object} options.param.positions - tableau de coordonnées lon/lat\n * @param {String} options.param.delimiter - '|'\n * @param {Boolean} options.param.indent - false|true\n * @param {String} options.param.crs - 'CRS:84'\n * @param {String} options.param.sampling - 3\n * @param {String} options.param.resource - 'rge_alti_corse2a_float32_zip_lamb93'\n * @param {Boolean} options.param.zonly - false|true\n * @param {Boolean} options.param.measures - false|true\n * @param {String} options.param.format - \"JSON|XML\"\n * @param {String} options.type - \"Profil|Elevation\"\n * @param {String} options.method - GET|POST\n *\n * @example\n * var options = {\n * type : 'Profil', // Elevation\n * method : 'GET', // par defaut\n * param : {\n * positions : [\n * {lon:'1.11', lat:'1.11'},\n * {lon:'1.10', lat:'1.10'},\n * {lon:'1.12', lat:'1.12'}\n * ],\n * delimiter : \";\", // par defaut\n * indent : true, // par defaut\n * crs : 'EPSG:4326', // par defaut\n * format : 'json', // par defaut (only to POST)\n * sampling : 3 , // par defaut (only use by Profil)\n * zonly : false // par defaut (only use by Elevation)\n * measures : false // par defaut (only use by Elevation)\n * }\n * };\n *\n * var result;\n * try {\n * var obj = new AltiRequestREST (options);\n * if (! obj.processRequestString ()) {\n * throw new Error(\"Request empty !?\")\n * }\n * result = obj.requestString;\n * } catch (e) {\n * // exceptions...\n * }\n * @private\n */\nfunction AltiRequestREST (options) {\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiRequestREST\");\n this.logger.trace(\"[Constructeur AltiRequestREST ()]\");\n\n if (!(this instanceof AltiRequestREST)) {\n throw new TypeError(\"AltiRequestREST constructor cannot be called as a function.\");\n }\n\n this.options = options || {};\n\n // existance des options\n if (!this.options) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"options\"));\n }\n\n // type de requete : Altitude ou Profil\n // (param. à determiner en fonction des parametres d'entrée)\n if (!this.options.type) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"type (Elevation or Profil)\"));\n }\n\n // construction du modele de requête\n // (test du type d'objet candidat)\n this.DataObject = null;\n switch (this.options.type) {\n case \"Elevation\":\n this.DataObject = new _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.options.param);\n break;\n case \"Profil\":\n this.DataObject = new _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.options.param);\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"type (Elevation or Profil)\"));\n }\n\n /**\n * methode.\n * Par defaut, \"GET\".\n */\n this.method = this.options.method || \"GET\";\n}\n\nAltiRequestREST.prototype = {\n\n /**\n * request\n * @type {String}\n */\n requestString : null,\n\n /**\n * Constructeur (alias)\n */\n constructor : AltiRequestREST,\n\n /**\n * Template de la requête.\n */\n template : {\n get : {\n // FIXME on retire le param 'delimiter' : &delimiter='__DELIMITER__'\n value : \"lon=__LON__&lat=__LAT__&indent=__INDENT__&crs='__CRS__'&resource=__RESOURCE__&measures=__MEASURES__\",\n input : {\n point : \"&zonly=__ZONLY__\",\n profil : \"&sampling=__SAMPLING__\"\n }\n },\n post : {\n // FIXME on retire le param 'delimiter' : delimiter='__DELIMITER__'\\n\\\n value : \"lon=__LON__\\n\" +\n \"lat=__LAT__\\n\" +\n \"indent=__INDENT__\\n\" +\n \"crs='__CRS__'\\n\" +\n \"resource='__RESOURCE__'\\n\" +\n \"measures='__MEASURES__'\\n\",\n input : {\n point : \"zonly=__ZONLY__\\n\",\n profil : \"sampling=__SAMPLING__\"\n }\n }\n },\n\n /**\n * Construction de la requête.\n *\n * @example\n * // GET out : lon=0.2367,2.1570&lat=48.0551,46.6077&delimiter=,&indent=true&zonly=true&crs='CRS:84'\n * // POST out : Not yet supported method POST !\n * @returns {String}\n */\n processRequestString : function () {\n this.logger.trace(\"AltiRequestREST::processRequestString ()\");\n\n var template = \"\";\n if (this.method === \"POST\") {\n template = this.template.post.value;\n } else if (this.method === \"GET\") {\n template = this.template.get.value;\n }\n\n template = template.replace(/__LON__/g, this.DataObject.getLon());\n template = template.replace(/__LAT__/g, this.DataObject.getLat());\n // FIXME on retire le param 'delimiter'\n // template = template.replace(/__DELIMITER__/g, this.DataObject.delimiter);\n template = template.replace(/__INDENT__/g, this.DataObject.indent);\n template = template.replace(/__CRS__/g, this.DataObject.crs);\n template = template.replace(/__RESOURCE__/g, this.DataObject.resource);\n template = template.replace(/__MEASURES__/g, this.DataObject.measures);\n\n // ajout +\n template = template + this.__addDataInputs();\n this.logger.trace(\"traduction tmpl\", template);\n\n // sauvegarde\n this.requestString = template;\n\n return this.requestString;\n },\n\n /**\n * Ajout de parametres spécifiques (ex. zonly)\n *\n * @returns {String}\n */\n __addDataInputs : function () {\n this.logger.trace(\"AltiRequestREST::addDataInput ()\");\n\n var myTemplate;\n if (this.method === \"POST\") {\n myTemplate = this.template.post;\n } else if (this.method === \"GET\") {\n myTemplate = this.template.get;\n } else {\n throw new Error(\"No other HTTP method supported by the service !\");\n }\n\n var tmpl = null;\n if (this.DataObject.CLASSNAME === \"AltiElevationRequest\") {\n tmpl = myTemplate.input.point;\n return tmpl.replace(/__ZONLY__/g, this.DataObject.zonly.toString());\n } else if (this.DataObject.CLASSNAME === \"AltiProfilRequest\") {\n tmpl = myTemplate.input.profil;\n return tmpl.replace(/__SAMPLING__/g, this.DataObject.sampling);\n } else {\n throw new Error(\"No other object supported than elevation or profil !?\");\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequestREST);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L0FsdGlSZXF1ZXN0UkVTVC5qcz9kNzQ0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFFb0Q7QUFDSDtBQUNlO0FBQ047O0FBRTFEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ25CLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsUUFBUTtBQUNuQixXQUFXLFFBQV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BlIC0gXCJQcm9maWx8RWxldmF0aW9uXCJcbiAqIEBwYXJhbSB7U3RyaW5nfSAgIG9wdGlvbnMubWV0aG9kIC0gR0VUfFBPU1RcbiAqXG4gKiBAZXhhbXBsZVxuICogICAgICB2YXIgb3B0aW9ucyA9IHtcbiAqICAgICAgICAgICB0eXBlIDogJ1Byb2ZpbCcsIC8vIEVsZXZhdGlvblxuICogICAgICAgICAgIG1ldGhvZCA6ICdHRVQnLCAgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgIHBhcmFtIDoge1xuICogICAgICAgICAgICAgICBwb3NpdGlvbnMgOiBbXG4gKiAgICAgICAgICAgICAgICAgICB7bG9uOicxLjExJywgbGF0OicxLjExJ30sXG4gKiAgICAgICAgICAgICAgICAgICB7bG9uOicxLjEwJywgbGF0OicxLjEwJ30sXG4gKiAgICAgICAgICAgICAgICAgICB7bG9uOicxLjEyJywgbGF0OicxLjEyJ31cbiAqICAgICAgICAgICAgICAgXSxcbiAqICAgICAgICAgICAgICAgZGVsaW1pdGVyIDogXCI7XCIsICAgICAgICAgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgICAgICBpbmRlbnQgICAgOiB0cnVlLCAgICAgICAgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgICAgICBjcnMgICAgICAgOiAnRVBTRzo0MzI2JywgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgICAgICBmb3JtYXQgICAgOiAnanNvbicsICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB0byBQT1NUKVxuICogICAgICAgICAgICAgICBzYW1wbGluZyAgOiAzICwgICAgICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB1c2UgYnkgUHJvZmlsKVxuICogICAgICAgICAgICAgICB6b25seSAgICAgOiBmYWxzZSAgICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB1c2UgYnkgRWxldmF0aW9uKVxuICogICAgICAgICAgICAgICBtZWFzdXJlcyAgOiBmYWxzZSAgICAgICAgLy8gcGFyIG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0RFTElNSVRFUl9fJ1xcblxcXG4gICAgICAgICAgICB2YWx1ZSA6IFwibG9uPV9fTE9OX19cXG5cIiArXG4gICAgICAgICAgICAgICAgXCJsYXQ9X19MQVRfX1xcblwiICtcbiAgICAgICAgICAgICAgICBcImluZGVudD1fX0lOREVOVF9fXFxuXCIgK1xuICAgICAgICAgICAgICAgIFwiY3JzPSdfX0NSU19fJ1xcblwiICtcbiAgICAgICAgICAgICAgICBcInJlc291cmNlPSdfX1JFU09VUkNFX18nXFxuXCIgK1xuICAgICAgICAgICAgICAgIFwibWVhc3VyZXM9J19fTUVBU1VSRVNfXydcXG5cIixcbiAgICAgICAgICAgIGlucHV0IDoge1xuICAgICAgICAgICAgICAgIHBvaW50IDogXCJ6b25seT1fX1pPTkxZX19cXG5cIixcbiAgICAgICAgICAgICAgICBwcm9maWwgOiBcInNhbXBsaW5nPV9fU0FNUExJTkdfX1wiXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogQ29uc3RydWN0aW9uIGRlIGxhIHJlcXXDqnRlLlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiAvLyBHRVQgIG91dCA6IGxvbj0wLjIzNjcsMi4xNTcwJmxhdD00OC4wNTUxLDQ2LjYwNzcmZGVsaW1pdGVyPSwmaW5kZW50PXRydWUmem9ubHk9dHJ1ZSZjcnM9J0NSUzo4NCdcbiAgICAgKiAvLyBQT1NUIG91dCA6IE5vdCB5ZXQgc3VwcG9ydGVkIG1ldGhvZCBQT1NUICFcbiAgICAgKiBAcmV0dXJucyB7U3RyaW5nfVxuICAgICAqL1xuICAgIHByb2Nlc3NSZXF1ZXN0U3RyaW5nIDogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLmxvZ2dlci50cmFjZShcIkFsdGlSZXF1ZXN0UkVTVDo6cHJvY2Vzc1JlcXVlc3RTdHJpbmcgKClcIik7XG5cbiAgICAgICAgdmFyIHRlbXBsYXRl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BU1NOQU1FID09PSBcIkFsdGlFbGV2YXRpb25SZXF1ZXN0XCIpIHtcbiAgICAgICAgICAgIHRtcGwgPSBteVRlbXBsYXRlLmlucHV0LnBvaW50O1xuICAgICAgICAgICAgcmV0dXJuIHRtcGwucmVwbGFjZSgvX19aT05MWV9fL2csIHRoaXMuRGF0YU9iamVjdC56b25seS50b1N0cmluZygpKTtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLkRhdGFPYmplY3QuQ0xBU1NOQU1FID09PSBcIkFsdGlQcm9maWxSZXF1ZXN0XCIpIHtcbiAgICAgICAgICAgIHRtcGwgPSBteVRlbXBsYXRlLmlucHV0LnByb2ZpbDtcbiAgICAgICAgICAgIHJldHVybiB0bXBsLnJlcGxhY2UoL19fU0FNUExJTkdfXy9nLCB0aGlzLkRhdGFPYmplY3Quc2FtcGxpbmcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTm8gb3RoZXIgb2JqZWN0IHN1cHBvcnRlZCB0aGFuIGVsZXZhdGlvbiBvciBwcm9maWwgIT9cIik7XG4gICAgICAgIH1cbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUmVxdWVzdFJFU1Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js\n"); /***/ }), @@ -343,7 +343,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AltiRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\");\n\n\n\n\n/**\n * @classdesc\n *\n * Classe de gestion des param. des requêtes de type POINT du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiElevationRequest\n * @param {Object} options - options\n * @param {Boolean} options.zonly - false|true\n *\n * @private\n */\nfunction AltiElevationRequest (options) {\n if (!(this instanceof AltiElevationRequest)) {\n throw new TypeError(\"AltiElevationRequest constructor cannot be called as a function.\");\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"AltiElevationRequest\";\n\n // appel du constructeur par heritage\n _AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiElevationRequest ()]\");\n\n /**\n * Z uniquement.\n * true|false\n */\n this.zonly = this.options.zonly || false; // test des options héritées !\n}\n\n/**\n * @lends module:AltiElevationRequest#\n */\n\nAltiElevationRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].prototype, {\n\n /**\n * Setter/getter pour \"zonly\"\n */\n zonly : {\n /** getter */\n get : function () {\n return this._zonly;\n },\n /** setter */\n set : function (z) {\n this._zonly = z;\n }\n }\n\n});\n\n/**\n * Constructeur (alias)\n */\nAltiElevationRequest.prototype.constructor = AltiElevationRequest;\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Array}\n */\nAltiElevationRequest.prototype.getData = function () {\n // par glop..., appel de AltiRequest::getData () !\n var map = [];\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n // map.push({k : \"delimiter\", v : this.delimiter}); // FIXME on retire le param \"delimiter\"\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"zonly\",\n v : this.zonly\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiElevationRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlFbGV2YXRpb25SZXF1ZXN0LmpzPzNkM2YiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUN1RDtBQUNmOztBQUV4QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxJQUFJLG9EQUFXOztBQUVmLGtCQUFrQiw4REFBTTtBQUN4Qjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDZDQUE2QztBQUM3Qzs7QUFFQTtBQUNBO0FBQ0E7O0FBRUEsK0NBQStDLG9EQUFXOztBQUUxRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLENBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTCxpQkFBaUIsb0NBQW9DLEVBQUU7QUFDdkQ7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQU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hpcy56b25seVxuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiZm9ybWF0XCIsXG4gICAgICAgIHYgOiB0aGlzLmZvcm1hdFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIG1hcDtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFsdGlFbGV2YXRpb25SZXF1ZXN0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AltiRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\");\n\n\n\n\n/**\n * @classdesc\n *\n * Classe de gestion des param. des requêtes de type POINT du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiElevationRequest\n * @param {Object} options - options\n * @param {Boolean} options.zonly - false|true\n *\n * @private\n */\nfunction AltiElevationRequest (options) {\n if (!(this instanceof AltiElevationRequest)) {\n throw new TypeError(\"AltiElevationRequest constructor cannot be called as a function.\");\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"AltiElevationRequest\";\n\n // appel du constructeur par heritage\n _AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiElevationRequest ()]\");\n\n /**\n * Z uniquement.\n * true|false\n */\n this.zonly = this.options.zonly || false; // test des options héritées !\n}\n\n/**\n * @lends module:AltiElevationRequest#\n */\n\nAltiElevationRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].prototype, {\n\n /**\n * Setter/getter pour \"zonly\"\n */\n zonly : {\n /** getter */\n get : function () {\n return this._zonly;\n },\n /** setter */\n set : function (z) {\n this._zonly = z;\n }\n }\n\n});\n\n/**\n * Constructeur (alias)\n */\nAltiElevationRequest.prototype.constructor = AltiElevationRequest;\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Array}\n */\nAltiElevationRequest.prototype.getData = function () {\n // par glop..., appel de AltiRequest::getData () !\n var map = [];\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n // map.push({k : \"delimiter\", v : this.delimiter}); // FIXME on retire le param \"delimiter\"\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"zonly\",\n v : this.zonly\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n map.push({\n k : \"resource\",\n v : this.resource\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiElevationRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlFbGV2YXRpb25SZXF1ZXN0LmpzPzNkM2YiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUN1RDtBQUNmOztBQUV4QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNB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uICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwibG9uXCIsXG4gICAgICAgIHYgOiB0aGlzLmdldExvbigpXG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJsYXRcIixcbiAgICAgICAgdiA6IHRoaXMuZ2V0TGF0KClcbiAgICB9KTtcbiAgICAvLyBtYXAucHVzaCh7ayA6IFwiZGVsaW1pdGVyXCIsIHYgOiB0aGlzLmRlbGltaXRlcn0pOyAvLyBGSVhNRSBvbiByZXRpcmUgbGUgcGFyYW0gXCJkZWxpbWl0ZXJcIlxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiaW5kZW50XCIsXG4gICAgICAgIHYgOiB0aGlzLmluZGVudFxuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiY3JzXCIsXG4gICAgICAgIHYgOiB0aGlzLmNyc1xuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiem9ubHlcIixcbiAgICAgICAgdiA6IHRoaXMuem9ubHlcbiAgICB9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcImZvcm1hdFwiLFxuICAgICAgICB2IDogdGhpcy5mb3JtYXRcbiAgICB9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcInJlc291cmNlXCIsXG4gICAgICAgIHYgOiB0aGlzLnJlc291cmNlXG4gICAgfSk7XG5cbiAgICByZXR1cm4gbWFwO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQWx0aUVsZXZhdGlvblJlcXVlc3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js\n"); /***/ }), @@ -355,7 +355,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AltiRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\");\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes de type PROFIL du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiProfilRequest\n * @param {Object} options - options\n * @param {String} options.sampling - 3\n *\n * @private\n */\nfunction AltiProfilRequest (options) {\n if (!(this instanceof AltiProfilRequest)) {\n throw new TypeError(\"AltiProfilRequest constructor cannot be called as a function.\");\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"AltiProfilRequest\";\n\n // appel du constructeur par heritage\n _AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiProfilRequest ()]\");\n\n /**\n * Sampling\n * Par defaut, 3\n */\n this.sampling = this.options.sampling || 3; // test des options héritées !\n}\n\n/**\n * @lends module:AltiProfilRequest#\n */\n\nAltiProfilRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].prototype, {\n\n /**\n * Setter/getter pour \"sampling\"\n */\n sampling : {\n /** getter */\n get : function () {\n return this._sampling;\n },\n /** setter */\n set : function (value) {\n this._sampling = value;\n }\n }\n});\n\n/**\n * Constructeur (alias)\n */\nAltiProfilRequest.prototype.constructor = AltiProfilRequest;\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Object[]}\n */\nAltiProfilRequest.prototype.getData = function () {\n // par glop..., appel de AltiRequest::getData () !\n var map = [];\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n // map.push({k : \"delimiter\", v : this.delimiter}); // FIXME on retire le param \"delimiter\"\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"sampling\",\n v : this.sampling\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiProfilRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlQcm9maWxSZXF1ZXN0LmpzP2FmZjkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUN1RDtBQUNmOztBQUV4QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsSUFBSSxvREFBVzs7QUFFZixrQkFBa0IsOERBQU07QUFDeEI7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSwrQ0FBK0M7QUFDL0M7O0FBRUE7QUFDQTtBQUNBOztBQUVBLDRDQUE0QyxvREFBVzs7QUFFdkQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ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B9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcImNyc1wiLFxuICAgICAgICB2IDogdGhpcy5jcnNcbiAgICB9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcInNhbXBsaW5nXCIsXG4gICAgICAgIHYgOiB0aGlzLnNhbXBsaW5nXG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJmb3JtYXRcIixcbiAgICAgICAgdiA6IHRoaXMuZm9ybWF0XG4gICAgfSk7XG5cbiAgICByZXR1cm4gbWFwO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQWx0aVByb2ZpbFJlcXVlc3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AltiRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\");\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes de type PROFIL du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiProfilRequest\n * @param {Object} options - options\n * @param {String} options.sampling - 3\n *\n * @private\n */\nfunction AltiProfilRequest (options) {\n if (!(this instanceof AltiProfilRequest)) {\n throw new TypeError(\"AltiProfilRequest constructor cannot be called as a function.\");\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"AltiProfilRequest\";\n\n // appel du constructeur par heritage\n _AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiProfilRequest ()]\");\n\n /**\n * Sampling\n * Par defaut, 3\n */\n this.sampling = this.options.sampling || 3; // test des options héritées !\n}\n\n/**\n * @lends module:AltiProfilRequest#\n */\n\nAltiProfilRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].prototype, {\n\n /**\n * Setter/getter pour \"sampling\"\n */\n sampling : {\n /** getter */\n get : function () {\n return this._sampling;\n },\n /** setter */\n set : function (value) {\n this._sampling = value;\n }\n }\n});\n\n/**\n * Constructeur (alias)\n */\nAltiProfilRequest.prototype.constructor = AltiProfilRequest;\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Object[]}\n */\nAltiProfilRequest.prototype.getData = function () {\n // par glop..., appel de AltiRequest::getData () !\n var map = [];\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n // map.push({k : \"delimiter\", v : this.delimiter}); // FIXME on retire le param \"delimiter\"\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"sampling\",\n v : this.sampling\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n map.push({\n k : \"resource\",\n v : this.resource\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiProfilRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlQcm9maWxSZXF1ZXN0LmpzP2FmZjkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUN1RDtBQUNmOztBQUV4QztBQU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lc3QucHJvdG90eXBlLmdldERhdGEgPSBmdW5jdGlvbiAoKSB7XG4gICAgLy8gcGFyIGdsb3AuLi4sIGFwcGVsIGRlIEFsdGlSZXF1ZXN0OjpnZXREYXRhICgpICFcbiAgICB2YXIgbWFwID0gW107XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJsb25cIixcbiAgICAgICAgdiA6IHRoaXMuZ2V0TG9uKClcbiAgICB9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcImxhdFwiLFxuICAgICAgICB2IDogdGhpcy5nZXRMYXQoKVxuICAgIH0pO1xuICAgIC8vIG1hcC5wdXNoKHtrIDogXCJkZWxpbWl0ZXJcIiwgdiA6IHRoaXMuZGVsaW1pdGVyfSk7IC8vIEZJWE1FIG9uIHJldGlyZSBsZSBwYXJhbSBcImRlbGltaXRlclwiXG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJpbmRlbnRcIixcbiAgICAgICAgdiA6IHRoaXMuaW5kZW50XG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJjcnNcIixcbiAgICAgICAgdiA6IHRoaXMuY3JzXG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJzYW1wbGluZ1wiLFxuICAgICAgICB2IDogdGhpcy5zYW1wbGluZ1xuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiZm9ybWF0XCIsXG4gICAgICAgIHYgOiB0aGlzLmZvcm1hdFxuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwicmVzb3VyY2VcIixcbiAgICAgICAgdiA6IHRoaXMucmVzb3VyY2VcbiAgICB9KTtcblxuICAgIHJldHVybiBtYXA7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUHJvZmlsUmVxdWVzdDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js\n"); /***/ }), @@ -367,7 +367,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiRequest\n * @param {Object} options - options\n * @param {Object} options.positions - tableau de coordonnées lon/lat\n * @param {String} options.delimiter - \"|\"\n * @param {Boolean} options.indent - false|true\n * @param {String} options.crs - \"CRS:84\"\n * @param {String} options.format - \"JSON|XML\"\n *\n * @private\n */\nfunction AltiRequest (options) {\n if (!(this instanceof AltiRequest)) {\n throw new TypeError(\"AltiRequest constructor cannot be called as a function.\");\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiRequest ()]\");\n\n /**\n * Options en paramêtres du constructeur.\n */\n this.options = options || {};\n\n /**\n * Liste des coordonnées.\n * @example\n * var c = [{lon : \"\", lat : \"\"}, {lon : \"\", lat : \"\"}];\n */\n this.positions = this.options.positions || [];\n\n /**\n * Caractère de séparation.\n * Par defaut, \"|\".\n */\n this.delimiter = this.options.delimiter || \"|\";\n\n /**\n * Indentation.\n * true|false\n */\n this.indent = this.options.indent || false;\n\n /**\n * Projection.\n * Par defaut, CRS:84.\n */\n this.crs = this.options.crs || \"CRS:84\";\n\n /**\n * format de sortie.\n * Par defaut, \"json\".\n */\n this.format = this.options.format || \"json\";\n}\n\n/**\n * CLASSNAME\n */\nAltiRequest.CLASSNAME = \"AltiRequest\";\n\nAltiRequest.prototype = {\n\n /**\n * @lends module:AltiRequest#\n */\n\n /**\n * Constructeur (alias)\n */\n constructor : AltiRequest,\n\n /**\n * Ajout d\"une liste de coordonnées.\n *\n * @param {Object[]} lstPosition - liste de positions\n * @example\n * obj.setPositions ([{lon : \"0.15\", lat : \"0.15\"}, {lon : \"1.15\", lat : \"1.15\"}]);\n */\n setPositions : function (lstPosition) {\n var positions = [];\n for (var i = 0; i < lstPosition.length; i++) {\n var o = lstPosition[i];\n if (o.lon && o.lat) {\n positions.push(o);\n }\n }\n\n this.positions = positions;\n },\n\n /**\n * Liste des coordonnées.\n *\n * @param {Int} pos - position\n * @returns {positions}\n * @example\n * obj.getPositions (); // [{lon : \"\", lat : \"\"}, {lon : \"\", lat : \"\"}]\n * obj.getPositions (0); // [{lon : \"\", lat : \"\"}]\n */\n getPositions : function (pos) {\n // FIXME test if not a number !?\n if (!pos) {\n return this.positions;\n }\n\n var index = this.positions.length - 1;\n if (pos > index || pos < index) {\n this.logger.warn(\"index out of range !\");\n return this.positions;\n }\n\n return this.positions[pos];\n },\n\n /**\n * Ajout d\"une liste de coordonnées.\n *\n * @param {Object[]} lstPosition - liste de positions\n * @example\n * obj.addPositions ([{lon : \"0.15\", lat : \"0.15\"}, {lon : \"1.15\", lat : \"1.15\"}]);\n */\n addPositions : function (lstPosition) {\n for (var i = 0; i < lstPosition.length; i++) {\n var o = lstPosition[i];\n if (o.lon && o.lat) {\n this.positions.push(lstPosition[i]);\n }\n }\n },\n\n /**\n * Retourne la liste des longitudes avec un caractère de séparation.\n *\n * @returns {String} - une liste de longitudes\n * @example\n * // out : 0.2367|2.1570|43.789|...\n */\n getLon : function () {\n var lstLon = [];\n for (var i = 0; i < this.positions.length; i++) {\n lstLon.push(this.positions[i].lon);\n }\n this.logger.trace(lstLon);\n return lstLon.join(this.delimiter);\n },\n\n /**\n * Retourne la liste des lattitudes avec un caractère de séparation.\n *\n * @returns {String} - une liste de lattitudes\n * @example\n * // out : 0.2367|2.1570|43.789|...\n */\n getLat : function () {\n var lstLat = [];\n for (var i = 0; i < this.positions.length; i++) {\n lstLat.push(this.positions[i].lat);\n }\n this.logger.trace(lstLat);\n return lstLat.join(this.delimiter);\n }\n\n};\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Object[]}\n */\nAltiRequest.prototype.getData = function () {\n var map = [];\n\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n map.push({\n k : \"delimiter\",\n v : this.delimiter\n });\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlSZXF1ZXN0LmpzPzAyMmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ3VEOztBQUV2RDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLFFBQVE7QUFDbkIsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxrQkFBa0IsOERBQU07QUFDeEI7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsaUJBQWlCLG1CQUFtQixHQUFHLG1CQUFtQjtBQUMxRDtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0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cmF0aW9uLlxuICAgICAqXG4gICAgICogQHJldHVybnMge1N0cmluZ30gLSB1bmUgbGlzdGUgZGUgbG9uZ2l0dWRlc1xuICAgICAqIEBleGFtcGxlXG4gICAgICogLy8gb3V0IDogMC4yMzY3fDIuMTU3MHw0My43ODl8Li4uXG4gICAgICovXG4gICAgZ2V0TG9uIDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgbHN0TG9uID0gW107XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5wb3NpdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxzdExvbi5wdXNoKHRoaXMucG9zaXRpb25zW2ldLmxvbik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5sb2dnZXIudHJhY2UobHN0TG9uKTtcbiAgICAgICAgcmV0dXJuIGxzdExvbi5qb2luKHRoaXMuZGVsaW1pdGVyKTtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogUmV0b3VybmUgbGEgbGlzdGUgZGVzIGxhdHRpdHVkZXMgYXZlYyB1biBjYXJhY3TDqHJlIGRlIHPDqXBhcmF0aW9uLlxuICAgICAqXG4gICAgICogQHJldHVybnMge1N0cmluZ30gLSB1bmUgbGlzdGUgZGUgbGF0dGl0dWRlc1xuICAgICAqIEBleGFtcGxlXG4gICAgICogLy8gb3V0IDogMC4yMzY3fDIuMTU3MHw0My43ODl8Li4uXG4gICAgICovXG4gICAgZ2V0TGF0IDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgbHN0TGF0ID0gW107XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5wb3NpdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxzdExhdC5wdXNoKHRoaXMucG9zaXRpb25zW2ldLmxhdCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5sb2dnZXIudHJhY2UobHN0TGF0KTtcbiAgICAgICAgcmV0dXJuIGxzdExhdC5qb2luKHRoaXMuZGVsaW1pdGVyKTtcbiAgICB9XG5cbn07XG5cbi8qKlxuICogVGFibGVhdSBkZSBjbGVmcy92YWxldXJzIHBvdXIgcGFyYW0uXG4gKlxuICogQHJldHVybnMge09iamVjdFtdfVxuICovXG5BbHRpUmVxdWVzdC5wcm90b3R5cGUuZ2V0RGF0YSA9IGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgbWFwID0gW107XG5cbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcImxvblwiLFxuICAgICAgICB2IDogdGhpcy5nZXRMb24oKVxuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwibGF0XCIsXG4gICAgICAgIHYgOiB0aGlzLmdldExhdCgpXG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJkZWxpbWl0ZXJcIixcbiAgICAgICAgdiA6IHRoaXMuZGVsaW1pdGVyXG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJpbmRlbnRcIixcbiAgICAgICAgdiA6IHRoaXMuaW5kZW50XG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJjcnNcIixcbiAgICAgICAgdiA6IHRoaXMuY3JzXG4gICAgfSk7XG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJmb3JtYXRcIixcbiAgICAgICAgdiA6IHRoaXMuZm9ybWF0XG4gICAgfSk7XG5cbiAgICByZXR1cm4gbWFwO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQWx0aVJlcXVlc3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiRequest\n * @param {Object} options - options\n * @param {Object} options.positions - tableau de coordonnées lon/lat\n * @param {String} options.delimiter - \"|\"\n * @param {Boolean} options.indent - false|true\n * @param {String} options.crs - \"CRS:84\"\n * @param {String} options.format - \"JSON|XML\"\n *\n * @private\n */\nfunction AltiRequest (options) {\n if (!(this instanceof AltiRequest)) {\n throw new TypeError(\"AltiRequest constructor cannot be called as a function.\");\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiRequest ()]\");\n\n /**\n * Options en paramêtres du constructeur.\n */\n this.options = options || {};\n\n /**\n * Liste des coordonnées.\n * @example\n * var c = [{lon : \"\", lat : \"\"}, {lon : \"\", lat : \"\"}];\n */\n this.positions = this.options.positions || [];\n\n /**\n * Caractère de séparation.\n * Par defaut, \"|\".\n */\n this.delimiter = this.options.delimiter || \"|\";\n\n /**\n * Indentation.\n * true|false\n */\n this.indent = this.options.indent || false;\n\n /**\n * Projection.\n * Par defaut, CRS:84.\n */\n this.crs = this.options.crs || \"CRS:84\";\n\n /**\n * format de sortie.\n * Par defaut, \"json\".\n */\n this.format = this.options.format || \"json\";\n\n /*\n * Ressource utilisée\n */\n this.resource = this.options.resource;\n\n /**\n * Réponse détaillée (source & accuracy)\n * true|false\n */\n this.measures = this.options.measures || false;\n}\n\n/**\n * CLASSNAME\n */\nAltiRequest.CLASSNAME = \"AltiRequest\";\n\nAltiRequest.prototype = {\n\n /**\n * @lends module:AltiRequest#\n */\n\n /**\n * Constructeur (alias)\n */\n constructor : AltiRequest,\n\n /**\n * Ajout d\"une liste de coordonnées.\n *\n * @param {Object[]} lstPosition - liste de positions\n * @example\n * obj.setPositions ([{lon : \"0.15\", lat : \"0.15\"}, {lon : \"1.15\", lat : \"1.15\"}]);\n */\n setPositions : function (lstPosition) {\n var positions = [];\n for (var i = 0; i < lstPosition.length; i++) {\n var o = lstPosition[i];\n if (o.lon && o.lat) {\n positions.push(o);\n }\n }\n\n this.positions = positions;\n },\n\n /**\n * Liste des coordonnées.\n *\n * @param {Int} pos - position\n * @returns {positions}\n * @example\n * obj.getPositions (); // [{lon : \"\", lat : \"\"}, {lon : \"\", lat : \"\"}]\n * obj.getPositions (0); // [{lon : \"\", lat : \"\"}]\n */\n getPositions : function (pos) {\n // FIXME test if not a number !?\n if (!pos) {\n return this.positions;\n }\n\n var index = this.positions.length - 1;\n if (pos > index || pos < index) {\n this.logger.warn(\"index out of range !\");\n return this.positions;\n }\n\n return this.positions[pos];\n },\n\n /**\n * Ajout d\"une liste de coordonnées.\n *\n * @param {Object[]} lstPosition - liste de positions\n * @example\n * obj.addPositions ([{lon : \"0.15\", lat : \"0.15\"}, {lon : \"1.15\", lat : \"1.15\"}]);\n */\n addPositions : function (lstPosition) {\n for (var i = 0; i < lstPosition.length; i++) {\n var o = lstPosition[i];\n if (o.lon && o.lat) {\n this.positions.push(lstPosition[i]);\n }\n }\n },\n\n /**\n * Retourne la liste des longitudes avec un caractère de séparation.\n *\n * @returns {String} - une liste de longitudes\n * @example\n * // out : 0.2367|2.1570|43.789|...\n */\n getLon : function () {\n var lstLon = [];\n for (var i = 0; i < this.positions.length; i++) {\n lstLon.push(this.positions[i].lon);\n }\n this.logger.trace(lstLon);\n return lstLon.join(this.delimiter);\n },\n\n /**\n * Retourne la liste des lattitudes avec un caractère de séparation.\n *\n * @returns {String} - une liste de lattitudes\n * @example\n * // out : 0.2367|2.1570|43.789|...\n */\n getLat : function () {\n var lstLat = [];\n for (var i = 0; i < this.positions.length; i++) {\n lstLat.push(this.positions[i].lat);\n }\n this.logger.trace(lstLat);\n return lstLat.join(this.delimiter);\n }\n\n};\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Object[]}\n */\nAltiRequest.prototype.getData = function () {\n var map = [];\n\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n map.push({\n k : \"delimiter\",\n v : this.delimiter\n });\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlSZXF1ZXN0LmpzPzAyMmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ3VEOztBQUV2RDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLFFBQVE7QUFDbkIsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxrQkFBa0IsOERBQU07QUFDeEI7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsaUJBQWlCLG1CQUFtQixHQUFHLG1CQUFtQjtBQUMxRDtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtB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BkZWZhdWx0IEFsdGlSZXF1ZXN0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\n"); /***/ }), @@ -379,7 +379,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _Formats_XML__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../Formats/XML */ \"./node_modules/geoportal-access-lib/src/Formats/XML.js\");\n/* harmony import */ var _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Formats/AltiResponseReader */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js\");\n/* harmony import */ var _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./model/AltiResponse */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\");\n/* harmony import */ var _model_Elevation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model/Elevation */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\");\n/**\n * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON\n * (Factory)\n *\n * @module AltiResponseFactory\n * @private\n * @alias Gp.Services.Alti.Response.AltiResponseFactory\n */\n\n\n\n\n\n\n\n\nvar AltiResponseFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Alti\n *\n * @example\n * var options = {\n * response :\n * outputFormat :\n * rawResponse :\n * scope :\n * onSuccess :\n * onError :\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiResponseFactory\");\n logger.trace([\"AltiResponseFactory::build()\"]);\n\n var data = null;\n\n if (options.response) {\n if (options.rawResponse) {\n logger.trace(\"analyze response : raw\");\n data = options.response;\n } else {\n switch (options.outputFormat) {\n case \"xml\":\n logger.trace(\"analyze response : xml\");\n\n try {\n var p = new _Formats_XML__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n reader : _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n });\n\n if (typeof options.response === \"string\") {\n p.setXMLString(options.response);\n } else {\n p.setXMLDoc(options.response);\n }\n\n data = p.parse();\n\n if (!data) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION_2\"));\n }\n } catch (e) {\n var message = e.message;\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", message),\n status : 200,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR\n }));\n return;\n }\n\n break;\n\n case \"json\":\n logger.trace(\"analyze response : json\");\n logger.trace(\"analyze response : \", typeof options.response);\n\n var JSONResponse = null;\n if (typeof options.response === \"string\") {\n JSONResponse = JSON.parse(options.response);\n } else {\n JSONResponse = options.response;\n }\n\n // le service renvoie t il une erreur ?\n if (JSONResponse && JSONResponse.error) {\n // ex. {\"error\": {\"code\": \"BAD_PARAMETER\",\"description\": \"The values () cannot be parsed as a valid longitude (double value such as -180 < lat < 180).\"}}\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", JSONResponse.error.description),\n status : 200,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR\n }));\n return;\n }\n\n // analyse de la reponse\n if (JSONResponse) {\n var elevations = JSONResponse.elevations;\n var altiResponse = new _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n var elevation;\n if (Array.isArray(elevations) && elevations.length) {\n for (var i = 0; i < elevations.length; i++) {\n elevation = new _model_Elevation__WEBPACK_IMPORTED_MODULE_6__[\"default\"]();\n\n if (typeof elevations[i] === \"object\") {\n // elevations[i] est un objet elevation\n if (elevations[i].lon) {\n elevation.lon = elevations[i].lon;\n }\n if (elevations[i].lat) {\n elevation.lat = elevations[i].lat;\n }\n if (elevations[i].z) {\n elevation.z = elevations[i].z;\n }\n if (elevations[i].acc) {\n elevation.acc = elevations[i].acc;\n }\n } else if (typeof elevations[i] === \"number\") {\n // elevations[i] est un nombre, dans le cas de zonly=true notamment\n elevation.z = elevations[i];\n }\n\n if (Array.isArray(altiResponse.elevations)) {\n altiResponse.elevations.push(elevation);\n }\n }\n }\n data = altiResponse;\n }\n\n if (!data) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE_2\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n break;\n\n default:\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_FORMAT_2\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n\n // Si la réponse contenait une exception renvoyée par le service\n if (data.exceptionReport) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", data.exceptionReport),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n } else if (data.error) {\n var errorMess = data.error.description;\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", errorMess),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n }\n }\n } else {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n return;\n }\n\n options.onSuccess.call(options.scope, data);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiResponseFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC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ldGhvZCBidWlsZFxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb3B0aW9ucyAtIG9wdGlvbnMgZGVmaW5pZXMgZGFucyBsZSBjb21wb3NhbnQgQWx0aVxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiAgIHZhciBvcHRpb25zID0ge1xuICAgICAqICAgICAgcmVzcG9uc2UgOlxuICAgICAqICAgICAgb3V0cHV0Rm9ybWF0IDpcbiAgICAgKiAgICAgIHJhd1Jlc3BvbnNlIDpcbiAgICAgKiAgICAgIHNjb3BlIDpcbiAgICAgKiAgICAgIG9uU3VjY2VzcyA6XG4gICAgICogICAgICBvbkVycm9yIDpcbiAgICAgKiAgIH07XG4gICAgICpcbiAgICAgKi9cbiAgICBidWlsZCA6IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgIC8vIGxvZ2dlclxuICAgICAgICB2YXIgbG9nZ2VyID0gTG9nZ2VyLmdldExvZ2dlcihcIkFsdGlSZXNwb25zZUZhY3RvcnlcIik7XG4gICAgICAgIGxvZ2dlci50cmFjZShbXCJBbHRpUmVzcG9uc2VGYWN0b3J5OjpidWlsZCgpXCJdKTtcblxuICAgICAgICB2YXIgZGF0YSA9IG51bGw7XG5cbiAgICAgICAgaWYgKG9wdGlvbnMucmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnJhd1Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiYW5hbHl6ZSByZXNwb25zZSA6IHJhd1wiKTtcbiAgICAgICAgICAgICAgICBkYXRhID0gb3B0aW9ucy5yZXNwb25zZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoIChvcHRpb25zLm91dHB1dEZvcm1hdCkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFwieG1sXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDogeG1sXCIpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwID0gbmV3IFhNTCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRlciA6IEFsdGlSZXNwb25zZVJlYWRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAuc2V0WE1MU3RyaW5nKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAuc2V0WE1MRG9jKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBwLnBhcnNlKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRVhDRVBUSU9OXzJcIikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9IGUubWVzc2FnZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRVhDRVBUSU9OXCIsIG1lc3NhZ2UpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAyMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBjYXNlIFwianNvblwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiYW5hbHl6ZSByZXNwb25zZSA6IGpzb25cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDogXCIsIHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIEpTT05SZXNwb25zZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMucmVzcG9uc2UgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OUmVzcG9uc2UgPSBKU09OLnBhcnNlKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OUmVzcG9uc2UgPSBvcHRpb25zLnJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZSBzZXJ2aWNlIHJlbnZvaWUgdCBpbCB1bmUgZXJyZXVyID9cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChKU09OUmVzcG9uc2UgJiYgSlNPTlJlc3BvbnNlLmVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHtcImVycm9yXCI6IHtcImNvZGVcIjogXCJCQURfUEFSQU1FVEVSXCIsXCJkZXNjcmlwdGlvblwiOiBcIlRoZSB2YWx1ZXMgKCkgY2Fubm90IGJlIHBhcnNlZCBhcyBhIHZhbGlkIGxvbmdpdHVkZSAoZG91YmxlIHZhbHVlIHN1Y2ggYXMgLTE4MCA8IGxhdCA8IDE4MCkuXCJ9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgSlNPTlJlc3BvbnNlLmVycm9yLmRlc2NyaXB0aW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogMjAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfU1JWRVJSXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5hbHlzZSBkZSBsYSByZXBvbnNlXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTlJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZXZhdGlvbnMgPSBKU09OUmVzcG9uc2UuZWxldmF0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWx0aVJlc3BvbnNlID0gbmV3IEFsdGlSZXNwb25zZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGV2YXRpb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZWxldmF0aW9ucykgJiYgZWxldmF0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBlbGV2YXRpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24gPSBuZXcgRWxldmF0aW9uKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZWxldmF0aW9uc1tpXSA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVsZXZhdGlvbnNbaV0gZXN0IHVuIG9iamV0IGVsZXZhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmxvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ubG9uID0gZWxldmF0aW9uc1tpXS5sb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmxhdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ubGF0ID0gZWxldmF0aW9uc1tpXS5sYXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLnopIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxldmF0aW9uLnogPSBlbGV2YXRpb25zW2ldLno7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmFjYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24uYWNjID0gZWxldmF0aW9uc1tpXS5hY2M7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZWxldmF0aW9uc1tpXSA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVsZXZhdGlvbnNbaV0gZXN0IHVuIG5vbWJyZSwgZGFucyBsZSBjYXMgZGUgem9ubHk9dHJ1ZSBub3RhbW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ueiA9IGVsZXZhdGlvbnNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFsdGlSZXNwb25zZS5lbGV2YXRpb25zKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsdGlSZXNwb25zZS5lbGV2YXRpb25zLnB1c2goZWxldmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gYWx0aVJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfQU5BTFlTRV8yXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfVU5LRVJSLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRk9STUFUXzJcIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA6IEVycm9yU2VydmljZS5UWVBFX1VOS0VSUixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFNpIGxhIHLDqXBvbnNlIGNvbnRlbmFpdCB1bmUgZXhjZXB0aW9uIHJlbnZvecOpZSBwYXIgbGUgc2VydmljZVxuICAgICAgICAgICAgICAgIGlmIChkYXRhLmV4Y2VwdGlvblJlcG9ydCkge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VYQ0VQVElPTlwiLCBkYXRhLmV4Y2VwdGlvblJlcG9ydCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfU1JWRVJSLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogMjAwXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YS5lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXJyb3JNZXNzID0gZGF0YS5lcnJvci5kZXNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgZXJyb3JNZXNzKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAyMDBcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBvcHRpb25zLm9uU3VjY2Vzcy5jYWxsKG9wdGlvbnMuc2NvcGUsIGRhdGEpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFsdGlSZXNwb25zZUZhY3Rvcnk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _Formats_XML__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../Formats/XML */ \"./node_modules/geoportal-access-lib/src/Formats/XML.js\");\n/* harmony import */ var _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Formats/AltiResponseReader */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js\");\n/* harmony import */ var _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./model/AltiResponse */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\");\n/* harmony import */ var _model_Elevation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model/Elevation */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\");\n/**\n * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON\n * (Factory)\n *\n * @module AltiResponseFactory\n * @private\n * @alias Gp.Services.Alti.Response.AltiResponseFactory\n */\n\n\n\n\n\n\n\n\nvar AltiResponseFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Alti\n *\n * @example\n * var options = {\n * response :\n * outputFormat :\n * rawResponse :\n * scope :\n * onSuccess :\n * onError :\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiResponseFactory\");\n logger.trace([\"AltiResponseFactory::build()\"]);\n\n var data = null;\n\n if (options.response) {\n if (options.rawResponse) {\n logger.trace(\"analyze response : raw\");\n data = options.response;\n } else {\n switch (options.outputFormat) {\n case \"xml\":\n logger.trace(\"analyze response : xml\");\n\n try {\n var p = new _Formats_XML__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n reader : _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n });\n\n if (typeof options.response === \"string\") {\n p.setXMLString(options.response);\n } else {\n p.setXMLDoc(options.response);\n }\n\n data = p.parse();\n\n if (!data) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION_2\"));\n }\n } catch (e) {\n var message = e.message;\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", message),\n status : 200,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR\n }));\n return;\n }\n\n break;\n\n case \"json\":\n logger.trace(\"analyze response : json\");\n logger.trace(\"analyze response : \", typeof options.response);\n\n var JSONResponse = null;\n if (typeof options.response === \"string\") {\n JSONResponse = JSON.parse(options.response);\n } else {\n JSONResponse = options.response;\n }\n\n // le service renvoie t il une erreur ?\n if (JSONResponse && JSONResponse.error) {\n // ex. {\"error\": {\"code\": \"BAD_PARAMETER\",\"description\": \"The values () cannot be parsed as a valid longitude (double value such as -180 < lat < 180).\"}}\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", JSONResponse.error.description),\n status : 200,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR\n }));\n return;\n }\n\n // analyse de la reponse\n if (JSONResponse) {\n var elevations = JSONResponse.elevations;\n var altiResponse = new _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n var elevation;\n if (Array.isArray(elevations) && elevations.length) {\n for (var i = 0; i < elevations.length; i++) {\n elevation = new _model_Elevation__WEBPACK_IMPORTED_MODULE_6__[\"default\"]();\n\n if (typeof elevations[i] === \"object\") {\n // elevations[i] est un objet elevation\n if (elevations[i].lon) {\n elevation.lon = elevations[i].lon;\n }\n if (elevations[i].lat) {\n elevation.lat = elevations[i].lat;\n }\n if (elevations[i].z) {\n elevation.z = elevations[i].z;\n }\n if (elevations[i].acc) {\n elevation.acc = elevations[i].acc;\n }\n if (elevations[i].measures) {\n elevation.measures = elevations[i].measures;\n }\n } else if (typeof elevations[i] === \"number\") {\n // elevations[i] est un nombre, dans le cas de zonly=true notamment\n elevation.z = elevations[i];\n }\n\n if (Array.isArray(altiResponse.elevations)) {\n altiResponse.elevations.push(elevation);\n }\n }\n }\n data = altiResponse;\n }\n\n if (!data) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE_2\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n break;\n\n default:\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_FORMAT_2\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n\n // Si la réponse contenait une exception renvoyée par le service\n if (data.exceptionReport) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", data.exceptionReport),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n } else if (data.error) {\n var errorMess = data.error.description;\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", errorMess),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n }\n }\n } else {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n return;\n }\n\n options.onSuccess.call(options.scope, data);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiResponseFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXNwb25zZS9BbHRpUmVzcG9uc2VGYWN0b3J5LmpzP2QwZWYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDb0Q7QUFDQTtBQUNRO0FBQ3JCO0FBQ3dCO0FBQ2Y7QUFDTjs7QUFFMUM7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsT0FBTztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUJBQXFCLDhEQUFNO0FBQzNCOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLHdDQUF3QyxvREFBRztBQUMzQyx5Q0FBeUMsbUVBQWtCO0FBQzNELDZCQUE2Qjs7QUFFN0I7QUFDQTtBQUNBLDZCQUE2QjtBQUM3QjtBQUNBOztBQ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zcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnJhd1Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiYW5hbHl6ZSByZXNwb25zZSA6IHJhd1wiKTtcbiAgICAgICAgICAgICAgICBkYXRhID0gb3B0aW9ucy5yZXNwb25zZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoIChvcHRpb25zLm91dHB1dEZvcm1hdCkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFwieG1sXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDogeG1sXCIpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwID0gbmV3IFhNTCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRlciA6IEFsdGlSZXNwb25zZVJlYWRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAuc2V0WE1MU3RyaW5nKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAuc2V0WE1MRG9jKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBwLnBhcnNlKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRVhDRVBUSU9OXzJcIikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9IGUubWVzc2FnZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRVhDRVBUSU9OXCIsIG1lc3NhZ2UpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAyMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBjYXNlIFwianNvblwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiYW5hbHl6ZSByZXNwb25zZSA6IGpzb25cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDogXCIsIHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIEpTT05SZXNwb25zZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMucmVzcG9uc2UgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OUmVzcG9uc2UgPSBKU09OLnBhcnNlKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OUmVzcG9uc2UgPSBvcHRpb25zLnJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZSBzZXJ2aWNlIHJlbnZvaWUgdCBpbCB1bmUgZXJyZXVyID9cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChKU09OUmVzcG9uc2UgJiYgSlNPTlJlc3BvbnNlLmVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHtcImVycm9yXCI6IHtcImNvZGVcIjogXCJCQURfUEFSQU1FVEVSXCIsXCJkZXNjcmlwdGlvblwiOiBcIlRoZSB2YWx1ZXMgKCkgY2Fubm90IGJlIHBhcnNlZCBhcyBhIHZhbGlkIGxvbmdpdHVkZSAoZG91YmxlIHZhbHVlIHN1Y2ggYXMgLTE4MCA8IGxhdCA8IDE4MCkuXCJ9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgSlNPTlJlc3BvbnNlLmVycm9yLmRlc2NyaXB0aW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogMjAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfU1JWRVJSXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5hbHlzZSBkZSBsYSByZXBvbnNlXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTlJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZXZhdGlvbnMgPSBKU09OUmVzcG9uc2UuZWxldmF0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWx0aVJlc3BvbnNlID0gbmV3IEFsdGlSZXNwb25zZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGV2YXRpb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZWxldmF0aW9ucykgJiYgZWxldmF0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBlbGV2YXRpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24gPSBuZXcgRWxldmF0aW9uKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZWxldmF0aW9uc1tpXSA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVsZXZhdGlvbnNbaV0gZXN0IHVuIG9iamV0IGVsZXZhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmxvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ubG9uID0gZWxldmF0aW9uc1tpXS5sb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmxhdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ubGF0ID0gZWxldmF0aW9uc1tpXS5sYXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLnopIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxldmF0aW9uLnogPSBlbGV2YXRpb25zW2ldLno7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmFjYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24uYWNjID0gZWxldmF0aW9uc1tpXS5hY2M7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLm1lYXN1cmVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZXZhdGlvbi5tZWFzdXJlcyA9IGVsZXZhdGlvbnNbaV0ubWVhc3VyZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZWxldmF0aW9uc1tpXSA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVsZXZhdGlvbnNbaV0gZXN0IHVuIG5vbWJyZSwgZGFucyBsZSBjYXMgZGUgem9ubHk9dHJ1ZSBub3RhbW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ueiA9IGVsZXZhdGlvbnNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFsdGlSZXNwb25zZS5lbGV2YXRpb25zKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsdGlSZXNwb25zZS5lbGV2YXRpb25zLnB1c2goZWxldmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gYWx0aVJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfQU5BTFlTRV8yXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfVU5LRVJSLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRk9STUFUXzJcIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA6IEVycm9yU2VydmljZS5UWVBFX1VOS0VSUixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFNpIGxhIHLDqXBvbnNlIGNvbnRlbmFpdCB1bmUgZXhjZXB0aW9uIHJlbnZvecOpZSBwYXIgbGUgc2VydmljZVxuICAgICAgICAgICAgICAgIGlmIChkYXRhLmV4Y2VwdGlvblJlcG9ydCkge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VYQ0VQVElPTlwiLCBkYXRhLmV4Y2VwdGlvblJlcG9ydCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfU1JWRVJSLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogMjAwXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YS5lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXJyb3JNZXNzID0gZGF0YS5lcnJvci5kZXNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgZXJyb3JNZXNzKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAyMDBcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBvcHRpb25zLm9uU3VjY2Vzcy5jYWxsKG9wdGlvbnMuc2NvcGUsIGRhdGEpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFsdGlSZXNwb25zZUZhY3Rvcnk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js\n"); /***/ }), @@ -407,6 +407,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single elevation ob /***/ }), +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single measure object returned by underlying web service if measures = true and zonly = false\n *\n * @property {String} source_name - Name of the source\n * @property {String} source_measure - Name of the measure\n * @property {Float} z - Point elevation.\n * @property {Float} acc - Accuracy of elevation for this point. (only if zonly=false)\n *\n * @namespace\n * @alias Gp.Services.Alti.Measure\n */\nfunction Measure () {\n if (!(this instanceof Measure)) {\n throw new TypeError(\"Measure constructor cannot be called as a function.\");\n }\n\n this.source_name = null;\n this.source_measure = null;\n this.z = null;\n this.acc = null;\n}\n\nMeasure.prototype = {\n\n constructor : Measure\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Measure);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXNwb25zZS9tb2RlbC9NZWFzdXJlLmpzPzBlZDYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQTtBQUNBO0FBQ0E7QUFDQSxjQUFjLE9BQU87QUFDckIsY0FBYyxPQUFPO0FBQ3JCLGNBQWMsTUFBTTtBQUNwQixjQUFjLE1BQU07QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNB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IG51bGw7XG4gICAgdGhpcy56ID0gbnVsbDtcbiAgICB0aGlzLmFjYyA9IG51bGw7XG59XG5cbk1lYXN1cmUucHJvdG90eXBlID0ge1xuXG4gICAgY29uc3RydWN0b3IgOiBNZWFzdXJlXG5cbn07XG5cbmV4cG9ydCBkZWZhdWx0IE1lYXN1cmU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js\n"); + +/***/ }), + /***/ "./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js": /*!*************************************************************************************!*\ !*** ./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js ***! @@ -415,7 +427,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single elevation ob /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Response/AutoCompleteResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/AutoCompleteResponseFactory.js\");\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'autocomplétion du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.AutoComplete\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.text - La chaîne de caractère à compléter.\n * Cette chaîne n'est pas \"URL encodée\".\n * C'est l'API qui s'occupe de l'encoder pour l'inclure dans la requête.\n *\n * @param {Array.} [options.type = [\"StreetAddress\"]] - Type de l'objet recherché.\n * Le service d'autocomplétion du Géoportail permet de rechercher des toponymes 'PositionOfInterest' et/ou des adresses postales 'StreetAddress'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, type = ['StreetAddress'].\n *\n * @param {String} [options.territory] - Limitation de la zone de recherche de localisants.\n * Le service d'autocomplétion du Géoportail permet de limiter la recherche à la métropole et la Corse : options.territory = 'METROPOLE',\n * DOMS TOMS : options.territory = 'DOMTOM', ou à un département : options.territory = '31'\n * Pas de valeur par défaut.\n * La valeur par défaut est donc celle du service.\n * Le service d'autocomplétion du Géoportail renvoie toutes les informations quand aucun territoire n'est spécifié.\n *\n * @param {Number} [options.maximumResponses = 10] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut.\n * La valeur par défaut sera donc celle du service : 10.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * text : \"\",\n * type : \"StreetAddress\",\n * territory : 'METROPOLE',\n * maximumResponses : 10\n * };\n */\nfunction AutoComplete (options_) {\n if (!(this instanceof AutoComplete)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"AutoComplete\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"AutoComplete\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getLogger(\"Gp.Services.AutoComplete\");\n this.logger.trace(\"[Constructeur AutoComplete (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n options.serverUrl = options.serverUrl || \"https://wxs.ign.fr/calcul/geoportail/geocodage/rest/0.1/completion\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].apply(this, arguments);\n\n if (!options.text) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getMessage(\"PARAM_MISSING\", \"text\"));\n }\n\n // ajout des options spécifiques au service\n this.options.text = options.text;\n\n // on definit des parametres par defaut\n if (!options.type) {\n options.type = [\"StreetAddress,PositionOfInterest\"];\n }\n\n this.options.type = options.type;\n this.options.territory = options.territory || \"\";\n this.options.maximumResponses = options.maximumResponses || 10;\n\n // INFO\n // le service ne repond pas en mode POST (405 Method Not Allowed)\n if (this.options.protocol === \"XHR\" && this.options.httpMethod === \"POST\") {\n this.logger.warn(\"Le service ne gére pas le mode d'interrogation en POST, on bascule sur du GET !\");\n this.options.httpMethod = \"GET\"; // on surcharge !\n }\n\n // attributs d'instances\n\n /**\n * Format forcé de la réponse du service : \"json\"\n * sauf si l'on souhaite une reponse brute (options.rawResponse)\n */\n this.options.outputFormat = (this.options.rawResponse) ? \"\" : \"json\";\n}\n\n/**\n * @lends module:AutoComplete#\n */\n\nAutoComplete.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nAutoComplete.prototype.constructor = AutoComplete;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nAutoComplete.prototype.patchOptionConvertor = function (options_) {\n const options = options_;\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (options.filterOptions.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.type) {\n options.type = options.filterOptions.type;\n }\n }\n\n if (options.filterOptions.territory) {\n this.logger.warn(\"The parameter 'filterOptions.territory' is deprecated\");\n if (!options.terr) {\n options.terr = options.filterOptions.territory;\n }\n }\n\n delete options.filterOptions;\n }\n\n return options;\n};\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAutoComplete.prototype.buildRequest = function (error, success) {\n // ex.\n // http://wxs.ign.fr/CLEF/ols/apis/completion?\n // text=Brie-Comt&\n // type=StreetAddress,PositionOfInterest&\n // territory=METROPOLE&\n // maximumResponses=10\n\n // traitement des param KPV sous forme de tableau\n var territory = \"\";\n if (this.options.territory) {\n territory = this.options.territory;\n }\n\n var type = \"\";\n if (this.options.type) {\n type = this.options.type.join(\",\");\n }\n\n // normalisation de la requete avec param KPV\n this.request = _Utils_Helper__WEBPACK_IMPORTED_MODULE_4__[\"default\"].normalyzeParameters({\n text : encodeURIComponent(this.options.text),\n type : type,\n terr : territory,\n maximumResponses : this.options.maximumResponses\n });\n\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_5__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback de succès de l'analyse de la réponse\n */\nAutoComplete.prototype.analyzeResponse = function (error, success) {\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onSuccess : success,\n onError : error,\n scope : this\n };\n\n _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_5__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AutoComplete);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQXV0b0NvbXBsZXRlL0F1dG9Db21wbGV0ZS5qcz84MmRjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQTZDO0FBQ29DO0FBQ2hDO0FBQ0Y7QUFDUDtBQUNpQjs7QUFFekQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQSxXQUFXLGVBQWU7QUFDMUI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ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pXG4gICAgICAgIDogc3VjY2Vzcy5jYWxsKHRoaXMsIHRoaXMucmVxdWVzdCk7XG59O1xuXG4vKipcbiAqIChvdmVyd3JpdGUpXG4gKiBBbmFseXNlIGRlIGxhIHJlcG9uc2VcbiAqXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBlcnJvciAgIC0gY2FsbGJhY2sgZGVzIGVycmV1cnNcbiAqIEBwYXJhbSB7RnVuY3Rpb259IHN1Y2Nlc3MgLSBjYWxsYmFjayBkZSBzdWNjw6hzIGRlIGwnYW5hbHlzZSBkZSBsYSByw6lwb25zZVxuICovXG5BdXRvQ29tcGxldGUucHJvdG90eXBlLmFuYWx5emVSZXNwb25zZSA9IGZ1bmN0aW9uIChlcnJvciwgc3VjY2Vzcykge1xuICAgIGlmICh0aGlzLnJlc3BvbnNlKSB7XG4gICAgICAgIHZhciBvcHRpb25zID0ge1xuICAgICAgICAgICAgcmVzcG9uc2UgOiB0aGlzLnJlc3BvbnNlLFxuICAgICAgICAgICAgcmF3UmVzcG9uc2UgOiB0aGlzLm9wdGlvbnMucmF3UmVzcG9uc2UsXG4gICAgICAgICAgICBvblN1Y2Nlc3MgOiBzdWNjZXNzLFxuICAgICAgICAgICAgb25FcnJvciA6IGVycm9yLFxuICAgICAgICAgICAgc2NvcGUgOiB0aGlzXG4gICAgICAgIH07XG5cbiAgICAgICAgQXV0b0NvbXBsZXRlUmVzcG9uc2VGYWN0b3J5LmJ1aWxkKG9wdGlvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShNUi5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FTVBUWVwiKSkpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEF1dG9Db21wbGV0ZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Response/AutoCompleteResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/AutoCompleteResponseFactory.js\");\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'autocomplétion du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.AutoComplete\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.text - La chaîne de caractère à compléter.\n * Cette chaîne n'est pas \"URL encodée\".\n * C'est l'API qui s'occupe de l'encoder pour l'inclure dans la requête.\n *\n * @param {Array.} [options.type = [\"StreetAddress\"]] - Type de l'objet recherché.\n * Le service d'autocomplétion du Géoportail permet de rechercher des toponymes 'PositionOfInterest' et/ou des adresses postales 'StreetAddress'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, type = ['StreetAddress'].\n *\n * @param {String} [options.territory] - Limitation de la zone de recherche de localisants.\n * Le service d'autocomplétion du Géoportail permet de limiter la recherche à la métropole et la Corse : options.territory = 'METROPOLE',\n * DOMS TOMS : options.territory = 'DOMTOM', ou à un département : options.territory = '31'\n * Pas de valeur par défaut.\n * La valeur par défaut est donc celle du service.\n * Le service d'autocomplétion du Géoportail renvoie toutes les informations quand aucun territoire n'est spécifié.\n *\n * @param {Number} [options.maximumResponses = 10] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut.\n * La valeur par défaut sera donc celle du service : 10.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * text : \"\",\n * type : \"StreetAddress\",\n * territory : 'METROPOLE',\n * maximumResponses : 10\n * };\n */\nfunction AutoComplete (options_) {\n if (!(this instanceof AutoComplete)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"AutoComplete\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"AutoComplete\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getLogger(\"Gp.Services.AutoComplete\");\n this.logger.trace(\"[Constructeur AutoComplete (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n\n if (!options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocomplétion\n /* options.serverUrl = DefaultUrlService.AutoComplete.newUrl();\n if (options.oldAutocompleteService) {\n options.serverUrl = DefaultUrlService.AutoComplete.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocompletion\n options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__[\"default\"].AutoComplete.url();\n }\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].apply(this, arguments);\n\n if (!options.text) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"PARAM_MISSING\", \"text\"));\n }\n\n // ajout des options spécifiques au service\n this.options.text = options.text;\n\n // on definit des parametres par defaut\n if (!options.type) {\n options.type = [\"StreetAddress,PositionOfInterest\"];\n }\n\n this.options.type = options.type;\n this.options.territory = options.territory || \"\";\n this.options.maximumResponses = options.maximumResponses || 10;\n\n // INFO\n // le service ne repond pas en mode POST (405 Method Not Allowed)\n if (this.options.protocol === \"XHR\" && this.options.httpMethod === \"POST\") {\n this.logger.warn(\"Le service ne gére pas le mode d'interrogation en POST, on bascule sur du GET !\");\n this.options.httpMethod = \"GET\"; // on surcharge !\n }\n\n // attributs d'instances\n\n /**\n * Format forcé de la réponse du service : \"json\"\n * sauf si l'on souhaite une reponse brute (options.rawResponse)\n */\n this.options.outputFormat = (this.options.rawResponse) ? \"\" : \"json\";\n}\n\n/**\n * @lends module:AutoComplete#\n */\n\nAutoComplete.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nAutoComplete.prototype.constructor = AutoComplete;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nAutoComplete.prototype.patchOptionConvertor = function (options_) {\n const options = options_;\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (options.filterOptions.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.type) {\n options.type = options.filterOptions.type;\n }\n }\n\n if (options.filterOptions.territory) {\n this.logger.warn(\"The parameter 'filterOptions.territory' is deprecated\");\n if (!options.terr) {\n options.terr = options.filterOptions.territory;\n }\n }\n\n delete options.filterOptions;\n }\n\n return options;\n};\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAutoComplete.prototype.buildRequest = function (error, success) {\n // ex.\n // http://wxs.ign.fr/CLEF/ols/apis/completion?\n // text=Brie-Comt&\n // type=StreetAddress,PositionOfInterest&\n // territory=METROPOLE&\n // maximumResponses=10\n\n // traitement des param KPV sous forme de tableau\n var territory = \"\";\n if (this.options.territory) {\n territory = this.options.territory;\n }\n\n var type = \"\";\n if (this.options.type) {\n type = this.options.type.join(\",\");\n }\n\n // normalisation de la requete avec param KPV\n this.request = _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].normalyzeParameters({\n text : encodeURIComponent(this.options.text),\n type : type,\n terr : territory,\n maximumResponses : this.options.maximumResponses\n });\n\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback de succès de l'analyse de la réponse\n */\nAutoComplete.prototype.analyzeResponse = function (error, success) {\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onSuccess : success,\n onError : error,\n scope : this\n };\n\n _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AutoComplete);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQXV0b0NvbXBsZXRlL0F1dG9Db21wbGV0ZS5qcz84MmRjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBNkM7QUFDUTtBQUM0QjtBQUNoQztBQUNGO0FBQ1A7QUFDaUI7O0FBRXpEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0EsV0FBVyxlQUFlO0FBQzFCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMENBQTBDO0FBQzFDLHVDQUF1QztBQUN2QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSw0QkFBNEIsZ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6IHRoaXMub3B0aW9ucy5yYXdSZXNwb25zZSxcbiAgICAgICAgICAgIG9uU3VjY2VzcyA6IHN1Y2Nlc3MsXG4gICAgICAgICAgICBvbkVycm9yIDogZXJyb3IsXG4gICAgICAgICAgICBzY29wZSA6IHRoaXNcbiAgICAgICAgfTtcblxuICAgICAgICBBdXRvQ29tcGxldGVSZXNwb25zZUZhY3RvcnkuYnVpbGQob3B0aW9ucyk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgZXJyb3IuY2FsbCh0aGlzLCBuZXcgRXJyb3JTZXJ2aWNlKE1SLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQXV0b0NvbXBsZXRlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js\n"); /***/ }), @@ -463,7 +475,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single SuggestedLoc /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Protocols/Protocol */ \"./node_modules/geoportal-access-lib/src/Protocols/Protocol.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../package.json */ \"./node_modules/geoportal-access-lib/package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_6___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./node_modules/geoportal-access-lib/package.json\", 1);\n\n\n\n\n\n\n// package.json (extract version)\n\n\n/**\n * @classdesc\n * Composant Service\n *\n * @constructor\n * @alias Gp.Services.CommonService\n * @param {Object} options - options communes à tous les services\n *\n * @param {String} [options.serverUrl] - URL d'accès au service. Par défaut \"https://wxs.ign.fr/calcul/geoportail/SERVICE/\".\n * Permet de forcer l'utilisation d'un service équivalent déployé derrière une éventuelle autre URL d'accès.\n * Si ce paramètre est renseigné alors, le paramètre par défaut est ignoré.\n *\n * @param {String} [options.protocol] - Le protocole à utiliser pour récupérer les informations du service :\n * peut valoir 'JSONP' ou 'XHR'.\n * Par défaut, c'est le protocole XHR qui sera utilisé.\n * Attention, le protocole JSONP n'est pas valide dans un environnement NodeJS (Utilisation du mode XHR).\n *\n * @param {Boolean} [options.ssl] - Indique si l'on souhaite intérroger les services en https.\n * Ce paramètre ne fonctionne que pour une utilisation hors navigateur (ex. NodeJS).\n * Sur un navigateur, le protocole est automatiquement extrait de l'url du site...\n * Par défaut, on utilise le protocole http (ssl=false).\n *\n * @param {String} [options.proxyURL] - Le proxy à utiliser pour pallier au problème de cross-domain dans le cas d'une requête XHR.\n * Utile si le paramètre 'protocol' vaut 'XHR', il ne sera pas pris en compte si protocol vaut JSONP.\n *\n * @param {String} [options.callbackSuffix] - Suffixe de la fonction de callback à utiliser, dans le cas du protocole JSONP.\n * Par défaut, la fonction de callback portera un nom du type \"callback\"+ID, où ID est soit un identifiant unique généré à chaque requête,\n * soit le paramètre callbackSuffix s'il est spécifié. Par exemple, si callbackSuffix=\"_2\", la fonction sera \"callback_2 ()\".\n * Utile pour utiliser une réponse déjà encapsulée dans une fonction de callback, dont le nom est connu\n * Utile seulement si le paramètre 'protocol' vaut 'JSONP', il ne sera pas pris en compte si protocol vaut 'XHR'.\n *\n * @param {String} [options.httpMethod] - La méthode HTTP\n * à utiliser dans le cas d'une requête XHR : peut valoir 'GET' ou 'POST'.\n * Non pris en compte si 'protocol' vaut JSONP qui fonctionne obligatoirement en GET.\n * Par défaut, c'est la méthode GET qui est utilisée.\n *\n * @param {String} [options.contentType] - Content-Type de la requete\n * à utiliser dans le cas d'une requête XHR en mode POST.\n * Non pris en compte si 'protocol' vaut JSONP et/ou la méthode HTTP vaut GET.\n * Par défaut, c'est la méthode GET qui est utilisée donc on n'utilise pas de Content-Type.\n *\n * @param {Number} [options.timeOut] - Délai d'attente maximal (en ms) de la réponse du service (à partir de l'envoi de la requête).\n * Par défaut, aucun timeOut n'est pris en compte (timeoutDelay= 0).\n *\n * @param {Boolean} [options.rawResponse] - Indique si l'on souhaite que la réponse du service ne soit pas parsée par l'API avant d'être restituée.\n * (Cf. paramètre « onSuccess » pour plus de détails).\n *\n * @param {Function} [options.onSuccess] - Fonction appelée lorsque le service répond correctement à la requête\n * (code HTTP 200, sans message d'erreur).\n * Cette fonction prend en paramètre la réponse du service,\n * soit sous la forme d'un Object Javascript formaté par le parseur dédié à la syntaxe du service (comportement par défaut) ;\n * soit brute au format String non prétraité si le paramètre « rawResponse » a été précisé avec la valeur « true ».\n *\n * @param {Function} [options.onFailure] - Fonction appelée lorsque le service ne répond pas correctement\n * (code HTTP de retour différent de 200 ou pas de réponse).\n *\n * @param {Function} [options.onBeforeParse] - Fonction appelée avant le parsing de la réponse\n * Permet de modifier la réponse avant parsing et la fonction doit retourner une String.\n * Cette fonction prend en paramètre la réponse telle que renvoyée par le service\n * (cad au format json ou xml).\n * Pour le JSONP, si le paramètre \"rawResponse\" a été précisé avec la valeur \"true\",\n * la fonction prend en paramètre un Object JavaScript contenant la réponse XML.\n *\n * @example\n * var options = {\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * ssl : false,\n * proxyURL : null,\n * callbackName : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * onBeforeParse : function (rawResponse) {}\n * };\n */\nfunction CommonService (options) {\n if (!(this instanceof CommonService)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\"));\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"CommonService\");\n this.logger.trace(\"[Constructeur CommonService (options)]\");\n\n // #####################\n // récupération des options par défaut pour les paramètres optionnels\n // #####################\n\n /**\n * Options du service\n * @type {Object}\n */\n this.options = {\n // protocol : \"JSONP\",\n protocol : \"XHR\",\n ssl : true,\n proxyURL : \"\",\n // callbackName : \"\",\n callbackSuffix : null,\n httpMethod : \"GET\",\n timeOut : 0,\n rawResponse : false,\n scope : this,\n /**\n * callback par defaut pour la reponse\n * @param {Object} response - response\n * @private\n */\n onSuccess : function (response) {\n console.log(\"onSuccess - la reponse est la suivante : \", response);\n },\n /**\n * callback par defaut pour les erreurs\n * @param {Object} error - error\n * @private\n */\n onFailure : function (error) {\n if (error.status === 200 || !error.status) {\n console.log(\"onFailure : \", error.message);\n } else {\n console.log(\"onFailure - Erreur (\", error.status, \") : \", error.message);\n }\n }\n };\n\n // et on ajoute les options en paramètre aux options par défaut\n for (var opt in options) {\n if (options.hasOwnProperty(opt)) {\n this.options[opt] = options[opt];\n }\n }\n\n // #####################\n // analyse des options\n // #####################\n\n // modification de la fonction de callback onSuccess dans le cas où la réponse brute est demandée\n if (this.options.rawResponse && !this.options.onSuccess) {\n /**\n * callback par defaut pour la reponse\n * @param {Object} response - response\n * @private\n */\n this.options.onSuccess = function (response) {\n console.log(\"onSuccess - la réponse brute du service est la suivante : \", response);\n };\n }\n\n // gestion du callback onSuccess\n var bOnSuccess = !!(this.options.onSuccess !== null && typeof this.options.onSuccess === \"function\");\n if (!bOnSuccess) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_MISSING\", \"onSuccess()\"));\n }\n\n // gestion de l'url du service par defaut\n if (!this.options.serverUrl) {\n // INFO\n // gestion de l'url du service par defaut pour les services qui ne possèdent qu'une seul url par defaut\n // les cas particuliers des services avec plusieurs urls (ex. Alti) devront être traité dans la classe du composant\n // donc si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__[\"default\"].ssl = this.options.ssl;\n var urlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__[\"default\"][this.CLASSNAME].url(\"calcul\");\n if (typeof urlByDefault === \"string\") {\n this.options.serverUrl = urlByDefault;\n } else {\n this.logger.trace(\"URL par defaut à determiner au niveau du composant...\");\n }\n }\n\n // FIXME nettoyage des KVP dans l'url du service\n // if (this.options.serverUrl) {\n // // INFO\n // // si l'url est renseignée, il faut la nettoyer de tous ses KVP\n // // ex. on ne veut pas de params. 'callback' ou 'output' car ceci declencherait\n // // des opérations d'encapsulations des reponses légèrement farfelues ...\n // var urlsource = this.options.serverUrl;\n // var urlparts = urlsource.split(\"?\");\n // this.options.serverUrl = urlparts[0];\n // }\n\n // gestion de la methode HTTP\n this.options.httpMethod = (typeof options.httpMethod === \"string\") ? options.httpMethod.toUpperCase() : \"GET\";\n\n switch (this.options.httpMethod) {\n case \"POST\":\n case \"GET\":\n break;\n case \"PUT\":\n case \"DELETE\":\n case \"HEAD\":\n case \"OPTIONS\":\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT\", \"httpMethod\"));\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"httpMethod\"));\n }\n\n // gestion du protocole\n // this.options.protocol = (typeof options.protocol === \"string\" ) ? options.protocol.toUpperCase() : \"JSONP\";\n this.options.protocol = (typeof options.protocol === \"string\") ? options.protocol.toUpperCase() : \"XHR\";\n\n switch (this.options.protocol) {\n case \"JSONP\":\n case \"XHR\":\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"protocol\"));\n }\n\n // on determine l'environnement d'execution : browser ou non ?\n // et on lance une exception sur l'utilisation du protocole JSONP pour nodeJS...\n if (typeof window === \"undefined\" && this.options.protocol === \"JSONP\") {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT_NODEJS\", \"protocol=JSONP (instead use XHR)\"));\n }\n\n // le protocole JSONP ne fonctionne qu'en GET.\n if (this.options.protocol === \"JSONP\") {\n this.options.httpMethod = \"GET\";\n }\n\n // gestion du cache\n this.options.nocache = options.nocache || false;\n\n // #####################\n // attributs d'instances\n // #####################\n\n /**\n * Format de réponse du service\n */\n this.options.outputFormat = null;\n /**\n * Requête envoyée au service\n */\n this.request = null;\n /**\n * Reponse du service\n */\n this.response = null;\n}\n\n/**\n * @lends module:CommonService\n */\nCommonService.prototype = {\n\n /*\n * Constructeur (alias)\n */\n constructor : CommonService,\n\n /**\n * Appel du service Géoportail\n */\n call : function () {\n /* jshint validthis : true */\n this.logger.trace(\"CommonService::call ()\");\n\n var context = this;\n /** fonction d'execution */\n function run () {\n this.logger.trace(\"CommonService::run ()\");\n this.buildRequest.call(context, onError, onBuildRequest);\n }\n\n run.call(context);\n\n // callback de fin de construction de la requête\n function onBuildRequest (result) {\n this.logger.trace(\"CommonService::onBuildRequest : \", result);\n this.callService.call(context, onError, onCallService);\n }\n\n // callback de fin d'appel au service\n function onCallService (result) {\n this.logger.trace(\"CommonService::onCallService : \", result);\n this.analyzeResponse.call(context, onError, onAnalyzeResponse);\n }\n\n // callback de fin de lecture de la reponse\n function onAnalyzeResponse (result) {\n this.logger.trace(\"CommonService::onAnalyzeResponse : \", result);\n if (result) {\n this.options.onSuccess.call(this, result);\n } else {\n return onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"Analyse de la reponse en échec !?\"));\n }\n }\n\n // callback de gestion des erreurs : renvoit un objet de type ErrorService\n function onError (error) {\n this.logger.trace(\"CommonService::onError()\");\n // error : l'objet est du type ErrorService ou Error\n var e = error;\n if (!(e instanceof _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"])) {\n e = new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](error.message);\n }\n this.options.onFailure.call(this, e);\n }\n },\n\n /**\n * Création de la requête\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n buildRequest : function (error, success) {\n // INFO\n this.logger.error(\"overwritten method !\");\n // retourne l'objet 'this.request'\n if (error) {\n error.call(this, \"This method must be overwritten !\");\n }\n success.call(this, \"This method must be overwritten !\");\n },\n\n /**\n * Appel du service\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n callService : function (error, success) {\n // INFO\n // retourne l'objet 'this.response'\n\n // NOTES\n // Pour le mode XHR, on recupère une reponse sous forme d'un json ou xml (#document).\n // Pour le mode JSONP, on a toujours un objet JSON mais sous 2 formes :\n // - natif\n // - XML encapsulé :\n // {http : {status:200, error:null},xml :'réponse du service'}\n // {http : {status:400, error:'reponse du service'},xml :null}\n // En XHR, la reponse est directement sauvegardée dans 'this.response'.\n // Par contre, en JSONP, on doit analyser la reponse (status ou non vide),\n // et ne renvoyer que le contenu (xml ou l'objet)\n\n // gestion de la proxification du service\n var strUrlProxified = null;\n var strData = this.request;\n\n // a t on mis en place un proxy ?\n // la proxyfication est valable uniquement en mode XHR !\n var bUrlProxified = !!(this.options.proxyURL && this.options.protocol === \"XHR\");\n\n // rajout de l'option gpbibaccess\n // INFO : acces au numero de version de package.conf aprés compilation !\n if (this.CLASSNAME !== \"Geocode\" && this.CLASSNAME !== \"ReverseGeocode\" && this.CLASSNAME !== \"AutoComplete\") {\n this.options.serverUrl = _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, {\n \"gp-access-lib\" : _package_json__WEBPACK_IMPORTED_MODULE_6__.version\n }, false);\n }\n\n // si le proxy est renseigné, on proxifie l'url du service\n if (bUrlProxified) {\n if (this.options.httpMethod === \"GET\") {\n strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, this.request, true);\n strData = null;\n }\n\n if (this.options.httpMethod === \"POST\") {\n strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, null, true);\n strData = this.request;\n }\n }\n\n // contexte du composant spécifique !\n var self = this;\n\n var options = {\n url : strUrlProxified || this.options.serverUrl,\n method : this.options.httpMethod,\n protocol : this.options.protocol,\n timeOut : this.options.timeOut || 0,\n format : this.options.outputFormat, // ceci declenche le parsing de la reponse du service, mais on souhaite toujours une reponse brute (string) !\n nocache : this.options.nocache || false, // ceci permet d'ajouter un timestamp dans la requête\n wrap : this.options.protocol !== \"XHR\", // ceci declenche l'encapsulation de la reponse XML du service dans du JSON, mais pas en mode XHR !\n callbackSuffix : this.options.callbackSuffix,\n // callbackName : this.options.callbackName || null,\n data : strData,\n headers : null, // TODO...\n content : this.options.contentType || \"application/xml\",\n scope : this.options.scope || this,\n // callback de reponse\n onResponse : function (response) {\n self.logger.trace(\"callService::onResponse()\");\n\n // le contenu de la reponse à renvoyer !\n var content = null;\n\n // XHR : on renvoie toujours la reponse brute du service (json ou xml)\n // au parser du composant...\n if (self.options.protocol === \"XHR\") {\n self.logger.trace(\"Response XHR\", response);\n content = response; // par defaut, la reponse du service !\n }\n\n // JSONP : on pre-analyse la reponse brute du service (encapsuler ou pas)\n // avant de l'envoyer au parser du composant...\n if (self.options.protocol === \"JSONP\") {\n self.logger.trace(\"Response JSON\", response);\n if (response) {\n if (response.http) {\n // reponse encapsulée :\n // ex. reponse du service en xml\n // > {http : {status:200, error:null},xml :'réponse du service'}\n if (response.http.status !== 200) {\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"]({\n status : response.http.status,\n message : response.http.error,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TYPE_SRVERR\n }));\n return;\n } else {\n content = response.xml; // par defaut !\n if (self.options.rawResponse) {\n content = response;\n }\n }\n } else {\n // reponse non encapsulée :\n // ex. reponse du service en json ou xml\n content = response;\n }\n } else {\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"Le contenu de la reponse est vide !?\"));\n return;\n }\n }\n\n // si on souhaite parser la reponse du service\n if (typeof self.options.onBeforeParse === \"function\") {\n var newResponse = self.options.onBeforeParse(content);\n if (typeof newResponse === \"string\") {\n // la reponse parsée par l'utilisateur est retournée sous\n // forme de string !\n content = newResponse;\n }\n }\n // sauvegarde de la reponse dans l'objet parent (CommonService)\n self.response = content;\n // on renvoie la reponse...\n success.call(self, content);\n },\n // callback des erreurs\n onFailure : function (e) {\n self.logger.trace(\"callService::onFailure()\");\n // on est forcement sur une erreur levée par un service !\n e.type = _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TYPE_SRVERR;\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](e));\n },\n // callback de timeOut\n onTimeOut : function () {\n self.logger.trace(\"callService::onTimeOut()\");\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"TimeOut!\"));\n }\n };\n\n _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__[\"default\"].send(options);\n },\n\n /**\n * Analyse de la réponse\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n analyzeResponse : function (error, success) {\n // INFO\n this.logger.error(\"overwritten method !\");\n // retourne l'objet spécifique au type de composant (json)\n if (error) {\n error.call(this, \"This method must be overwritten !\");\n }\n success.call(this, \"This method must be overwritten !\");\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (CommonService);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQ29tbW9uU2VydmljZS5qcz8xYjIyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUE4QztBQUNUO0FBQ007QUFDRTtBQUNTO0FBQ0Y7QUFDcEQ7QUFDcUM7O0FBRXJDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQU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IFwiWEhSXCIsXG4gICAgICAgIHNzbCA6IHRydWUsXG4gICAgICAgIHByb3h5VVJMIDogXCJcIixcbiAgICAgICAgLy8gY2FsbGJhY2tOYW1lIDogXCJcIixcbiAgICAgICAgY2FsbGJhY2tTdWZmaXggOiBudWxsLFxuICAgICAgICBodHRwTWV0aG9kIDogXCJHRVRcIixcbiAgICAgICAgdGltZU91dCA6IDAsXG4gICAgICAgIHJhd1Jlc3BvbnNlIDogZmFsc2UsXG4gICAgICAgIHNjb3BlIDogdGhpcyxcbiAgICAgICAgLyoqXG4gICAgICAgICogY2FsbGJhY2sgcGFyIGRlZmF1dCBwb3VyIGxhIHJlcG9uc2VcbiAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcmVzcG9uc2UgLSByZXNwb25zZVxuICAgICAgICAqIEBwcml2YXRlXG4gICAgICAgICovXG4gICAgICAgIG9uU3VjY2VzcyA6IGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgY29uc29sZS5sb2coXCJvblN1Y2Nlc3MgLSBsYSByZXBvbnNlIGVzdCBsYSBzdWl2YW50ZSA6IFwiLCByZXNwb25zZSk7XG4gICAgICAgIH0sXG4gICAgICAgIC8qKlxuICAgICAgICAqIGNhbGxiYWNrIHBhciBkZWZhdXQgcG91ciBsZXMgZXJyZXVyc1xuICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSBlcnJvciAtIGVycm9yXG4gICAgICAgICogQHByaXZhdGVcbiAgICAgICAgKi9cbiAgICAgICAgb25GYWlsdXJlIDogZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICBpZiAoZXJyb3Iuc3RhdHVzID09PSAyMDAgfHwgIWVycm9yLnN0YXR1cykge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwib25GYWlsdXJlIDogXCIsIGVycm9yLm1lc3NhZ2UpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIm9uR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29uZiBhcHLDqXMgY29tcGlsYXRpb24gIVxuICAgICAgICBpZiAodGhpcy5DTEFTU05BTUUgIT09IFwiR2VvY29kZVwiICYmIHRoaXMuQ0xBU1NOQU1FICE9PSBcIlJldmVyc2VHZW9jb2RlXCIgJiYgdGhpcy5DTEFTU05BTUUgIT09IFwiQXV0b0NvbXBsZXRlXCIpIHtcbiAgICAgICAgICAgIHRoaXMub3B0aW9ucy5zZXJ2ZXJVcmwgPSBIZWxwZXIubm9ybWFseXplVXJsKHRoaXMub3B0aW9ucy5zZXJ2ZXJVcmwsIHtcbiAgICAgICAgICAgICAgICBcImdwLWFjY2Vzcy1saWJcIiA6IFBrZy52ZXJzaW9uXG4gICAgICAgICAgICB9LCBmYWxzZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBzaSBsZSBwcm94eSBlc3QgcmVuc2VpZ27DqSwgb24gcHJveGlmaWUgbCd1cmwgZHUgc2VydmljZVxuICAgICAgICBpZiAoYlVybFByb3hpZmllZCkge1xuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5odHRwTWV0aG9kID09PSBcIkdFVFwiKSB7XG4gICAgICAgICAgICAgICAgc3RyVXJsUHJveGlmaWVkID0gdGhpcy5vcHRpb25zLnByb3h5VVJMICsgSGVscGVyLm5vcm1hbHl6ZVVybCh0aGlzLm9wdGlvbnMuc2VydmVyVXJsLCB0aGlzLnJlcXVlc3QsIHRydWUpO1xuICAgICAgICAgICAgICAgIHN0ckRhdGEgPSBudWxsO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmh0dHBNZXRob2QgPT09IFwiUE9TVFwiKSB7XG4gICAgICAgICAgICAgICAgc3RyVXJsUHJveGlmaWVkID0gdGhpcy5vcHRpb25zLnByb3h5VVJMICsgSGVscGVyLm5vcm1hbHl6ZVVybCh0aGlzLm9wdGlvbnMuc2VydmVyVXJsLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBzdHJE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ja1N1ZmZpeCxcbiAgICAgICAgICAgIC8vIGNhbGxiYWNrTmFtZSA6IHRoaXMub3B0aW9ucy5jYWxsYmFja05hbWUgfHwgbnVsbCxcbiAgICAgICAgICAgIGRhdGEgOiBzdHJEYXRhLFxuICAgICAgICAgICAgaGVhZGVycyA6IG51bGwsIC8vIFRPRE8uLi5cbiAgICAgICAgICAgIGNvbnRlbnQgOiB0aGlzLm9wdGlvbnMuY29udGVudFR5cGUgfHwgXCJhcHBsaWNhdGlvbi94bWxcIixcbiAgICAgICAgICAgIHNjb3BlIDogdGhpcy5vcHRpb25zLnNjb3BlIHx8IHRoaXMsXG4gICAgICAgICAgICAvLyBjYWxsYmFjayBkZSByZXBvbnNlXG4gICAgICAgICAgICBvblJlc3BvbnNlIDogZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJjYWxsU2VydmljZTo6b25SZXNwb25zZSgpXCIpO1xuXG4gICAgICAgICAgICAgICAgLy8gbGUgY29udGVudSBkZSBsYSByZXBvbnNlIMOgIHJlbnZveWVyICFcbiAgICAgICAgICAgICAgICB2YXIgY29udGVudCA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAvLyBYSFIgOiBvbiByZW52b2llIHRvdWpvdXJzIGxhIHJlcG9uc2UgYnJ1dGUgZHUgc2VydmljZSAoanNvbiBvdSB4bWwpXG4gICAgICAgICAgICAgICAgLy8gYXUgcGFyc2VyIGR1IGNvbXBvc2FudC4uLlxuICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMucHJvdG9jb2wgPT09IFwiWEhSXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJSZXNwb25zZSBYSFJcIiwgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gcmVzcG9uc2U7IC8vIHBhciBkZWZhdXQsIGxhIHJlcG9uc2UgZHUgc2VydmljZSAgIVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIEpTT05QIDogb24gcHJlLWFuYWx5c2UgbGEgcmVwb25zZSBicnV0ZSBkdSBzZXJ2aWNlIChlbmNhcHN1bGVyIG91IHBhcylcbiAgICAgICAgICAgICAgICAvLyBhdmFudCBkZSBsJ2Vudm95ZXIgYXUgcGFyc2VyIGR1IGNvbXBvc2FudC4uLlxuICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMucHJvdG9jb2wgPT09IFwiSlNPTlBcIikge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmxvZ2dlci50cmFjZShcIlJlc3BvbnNlIEpTT05cIiwgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5odHRwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVwb25zZSBlbmNhcHN1bMOpZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHJlcG9uc2UgZHUgc2VydmljZSBlbiB4bWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA+IHtodHRwIDoge3N0YXR1czoyMDAsIGVycm9yOm51bGx9LHhtbCA6J3LDqXBvbnNlIGR1IHNlcnZpY2UnfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5odHRwLnN0YXR1cyAhPT0gMjAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLmNhbGwoc2VsZiwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiByZXNwb25zZS5odHRwLnN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiByZXNwb25zZS5odHRwLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA6IEVycm9yU2VydmljZS5UWVBFX1NSVkVSUlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gcmVzcG9uc2UueG1sOyAvLyBwYXIgZGVmYXV0ICFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYub3B0aW9ucy5yYXdSZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCA9IHJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXBvbnNlIG5vbiBlbmNhcHN1bMOpZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHJlcG9uc2UgZHUgc2VydmljZSBlbiBqc29uIG91IHhtbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgPSByZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLmNhbGwoc2VsZiwgbmV3IEVycm9yU2VydmljZShcIkxlIGNvbnRlbnUgZGUgbGEgcmVwb25zZSBlc3QgdmlkZSAhP1wiKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBzaSBvbiBzb3VoYWl0ZSBwYXJzZXIgbGEgcmVwb25zZSBkdSBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzZWxmLm9wdGlvbnMub25CZWZvcmVQYXJzZSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXdSZXNwb25zZSA9IHNlbGYub3B0aW9ucy5vbkJlZm9yZVBhcnNlKGNvbnRlbnQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG5ld1Jlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsYSByZXBvbnNlIHBhcnPDqWUgcGFyIGwndXRpbGlzYXRldXIgZXN0IHJldG91cm7DqWUgc291c1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZm9ybWUgZGUgc3RyaW5nICFcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBuZXdSZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzYXV2ZWdhcmRlIGRlIGxhIHJlcG9uc2UgZGFucyBsJ29iamV0IHBhcmVudCAoQ29tbW9uU2VydmljZSlcbiAgICAgICAgICAgICAgICBzZWxmLnJlc3BvbnNlID0gY29udGVudDtcbiAgICAgICAgICAgICAgICAvLyBvbiByZW52b2llIGxhIHJlcG9uc2UuLi5cbiAgICAgICAgICAgICAgICBzdWNjZXNzLmNhbGwoc2VsZiwgY29udGVudCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gY2FsbGJhY2sgZGVzIGVycmV1cnNcbiAgICAgICAgICAgIG9uRmFpbHVyZSA6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJjYWxsU2VydmljZTo6b25GYWlsdXJlKClcIik7XG4gICAgICAgICAgICAgICAgLy8gb24gZXN0IGZvc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ldGhvZCBtdXN0IGJlIG92ZXJ3cml0dGVuICFcIik7XG4gICAgICAgIH1cbiAgICAgICAgc3VjY2Vzcy5jYWxsKHRoaXMsIFwiVGhpcyBtZXRob2QgbXVzdCBiZSBvdmVyd3JpdHRlbiAhXCIpO1xuICAgIH1cblxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29tbW9uU2VydmljZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/CommonService.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Protocols/Protocol */ \"./node_modules/geoportal-access-lib/src/Protocols/Protocol.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../package.json */ \"./node_modules/geoportal-access-lib/package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_6___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./node_modules/geoportal-access-lib/package.json\", 1);\n\n\n\n\n\n\n// package.json (extract version)\n\n\n/**\n * @classdesc\n * Composant Service\n *\n * @constructor\n * @alias Gp.Services.CommonService\n * @param {Object} options - options communes à tous les services\n *\n * @param {String} [options.serverUrl] - URL d'accès au service. Par défaut \"https://wxs.ign.fr/calcul/geoportail/SERVICE/\".\n * Permet de forcer l'utilisation d'un service équivalent déployé derrière une éventuelle autre URL d'accès.\n * Si ce paramètre est renseigné alors, le paramètre par défaut est ignoré.\n *\n * @param {String} [options.protocol] - Le protocole à utiliser pour récupérer les informations du service :\n * peut valoir 'JSONP' ou 'XHR'.\n * Par défaut, c'est le protocole XHR qui sera utilisé.\n * Attention, le protocole JSONP n'est pas valide dans un environnement NodeJS (Utilisation du mode XHR).\n *\n * @param {Boolean} [options.ssl] - Indique si l'on souhaite intérroger les services en https.\n * Ce paramètre ne fonctionne que pour une utilisation hors navigateur (ex. NodeJS).\n * Sur un navigateur, le protocole est automatiquement extrait de l'url du site...\n * Par défaut, on utilise le protocole http (ssl=false).\n *\n * @param {String} [options.proxyURL] - Le proxy à utiliser pour pallier au problème de cross-domain dans le cas d'une requête XHR.\n * Utile si le paramètre 'protocol' vaut 'XHR', il ne sera pas pris en compte si protocol vaut JSONP.\n *\n * @param {String} [options.callbackSuffix] - Suffixe de la fonction de callback à utiliser, dans le cas du protocole JSONP.\n * Par défaut, la fonction de callback portera un nom du type \"callback\"+ID, où ID est soit un identifiant unique généré à chaque requête,\n * soit le paramètre callbackSuffix s'il est spécifié. Par exemple, si callbackSuffix=\"_2\", la fonction sera \"callback_2 ()\".\n * Utile pour utiliser une réponse déjà encapsulée dans une fonction de callback, dont le nom est connu\n * Utile seulement si le paramètre 'protocol' vaut 'JSONP', il ne sera pas pris en compte si protocol vaut 'XHR'.\n *\n * @param {String} [options.httpMethod] - La méthode HTTP\n * à utiliser dans le cas d'une requête XHR : peut valoir 'GET' ou 'POST'.\n * Non pris en compte si 'protocol' vaut JSONP qui fonctionne obligatoirement en GET.\n * Par défaut, c'est la méthode GET qui est utilisée.\n *\n * @param {String} [options.contentType] - Content-Type de la requete\n * à utiliser dans le cas d'une requête XHR en mode POST.\n * Non pris en compte si 'protocol' vaut JSONP et/ou la méthode HTTP vaut GET.\n * Par défaut, c'est la méthode GET qui est utilisée donc on n'utilise pas de Content-Type.\n *\n * @param {Number} [options.timeOut] - Délai d'attente maximal (en ms) de la réponse du service (à partir de l'envoi de la requête).\n * Par défaut, aucun timeOut n'est pris en compte (timeoutDelay= 0).\n *\n * @param {Boolean} [options.rawResponse] - Indique si l'on souhaite que la réponse du service ne soit pas parsée par l'API avant d'être restituée.\n * (Cf. paramètre « onSuccess » pour plus de détails).\n *\n * @param {Function} [options.onSuccess] - Fonction appelée lorsque le service répond correctement à la requête\n * (code HTTP 200, sans message d'erreur).\n * Cette fonction prend en paramètre la réponse du service,\n * soit sous la forme d'un Object Javascript formaté par le parseur dédié à la syntaxe du service (comportement par défaut) ;\n * soit brute au format String non prétraité si le paramètre « rawResponse » a été précisé avec la valeur « true ».\n *\n * @param {Function} [options.onFailure] - Fonction appelée lorsque le service ne répond pas correctement\n * (code HTTP de retour différent de 200 ou pas de réponse).\n *\n * @param {Function} [options.onBeforeParse] - Fonction appelée avant le parsing de la réponse\n * Permet de modifier la réponse avant parsing et la fonction doit retourner une String.\n * Cette fonction prend en paramètre la réponse telle que renvoyée par le service\n * (cad au format json ou xml).\n * Pour le JSONP, si le paramètre \"rawResponse\" a été précisé avec la valeur \"true\",\n * la fonction prend en paramètre un Object JavaScript contenant la réponse XML.\n *\n * @example\n * var options = {\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * ssl : false,\n * proxyURL : null,\n * callbackName : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * onBeforeParse : function (rawResponse) {}\n * };\n */\nfunction CommonService (options) {\n if (!(this instanceof CommonService)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\"));\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"CommonService\");\n this.logger.trace(\"[Constructeur CommonService (options)]\");\n\n // #####################\n // récupération des options par défaut pour les paramètres optionnels\n // #####################\n\n /**\n * Options du service\n * @type {Object}\n */\n this.options = {\n // protocol : \"JSONP\",\n protocol : \"XHR\",\n ssl : true,\n proxyURL : \"\",\n // callbackName : \"\",\n callbackSuffix : null,\n httpMethod : \"GET\",\n timeOut : 0,\n rawResponse : false,\n scope : this,\n /**\n * callback par defaut pour la reponse\n * @param {Object} response - response\n * @private\n */\n onSuccess : function (response) {\n console.log(\"onSuccess - la reponse est la suivante : \", response);\n },\n /**\n * callback par defaut pour les erreurs\n * @param {Object} error - error\n * @private\n */\n onFailure : function (error) {\n if (error.status === 200 || !error.status) {\n console.log(\"onFailure : \", error.message);\n } else {\n console.log(\"onFailure - Erreur (\", error.status, \") : \", error.message);\n }\n }\n };\n\n // et on ajoute les options en paramètre aux options par défaut\n for (var opt in options) {\n if (options.hasOwnProperty(opt)) {\n this.options[opt] = options[opt];\n }\n }\n\n // #####################\n // analyse des options\n // #####################\n\n // modification de la fonction de callback onSuccess dans le cas où la réponse brute est demandée\n if (this.options.rawResponse && !this.options.onSuccess) {\n /**\n * callback par defaut pour la reponse\n * @param {Object} response - response\n * @private\n */\n this.options.onSuccess = function (response) {\n console.log(\"onSuccess - la réponse brute du service est la suivante : \", response);\n };\n }\n\n // gestion du callback onSuccess\n var bOnSuccess = !!(this.options.onSuccess !== null && typeof this.options.onSuccess === \"function\");\n if (!bOnSuccess) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_MISSING\", \"onSuccess()\"));\n }\n\n /* FIXME traitement au niveau de chaque composant pour tester service WXS / GPF\n // gestion de l'url du service par defaut\n if (!this.options.serverUrl) {\n // INFO\n // gestion de l'url du service par defaut pour les services qui ne possèdent qu'une seul url par defaut\n // les cas particuliers des services avec plusieurs urls (ex. Alti) devront être traité dans la classe du composant\n // donc si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n DefaultUrlService.ssl = this.options.ssl;\n var urlByDefault = DefaultUrlService[this.CLASSNAME].url(\"calcul\");\n if (typeof urlByDefault === \"string\") {\n this.options.serverUrl = urlByDefault;\n } else {\n this.logger.trace(\"URL par defaut à determiner au niveau du composant...\");\n }\n }*/\n\n // FIXME nettoyage des KVP dans l'url du service\n // if (this.options.serverUrl) {\n // // INFO\n // // si l'url est renseignée, il faut la nettoyer de tous ses KVP\n // // ex. on ne veut pas de params. 'callback' ou 'output' car ceci declencherait\n // // des opérations d'encapsulations des reponses légèrement farfelues ...\n // var urlsource = this.options.serverUrl;\n // var urlparts = urlsource.split(\"?\");\n // this.options.serverUrl = urlparts[0];\n // }\n\n // gestion de la methode HTTP\n this.options.httpMethod = (typeof options.httpMethod === \"string\") ? options.httpMethod.toUpperCase() : \"GET\";\n\n switch (this.options.httpMethod) {\n case \"POST\":\n case \"GET\":\n break;\n case \"PUT\":\n case \"DELETE\":\n case \"HEAD\":\n case \"OPTIONS\":\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT\", \"httpMethod\"));\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"httpMethod\"));\n }\n\n // gestion du protocole\n // this.options.protocol = (typeof options.protocol === \"string\" ) ? options.protocol.toUpperCase() : \"JSONP\";\n this.options.protocol = (typeof options.protocol === \"string\") ? options.protocol.toUpperCase() : \"XHR\";\n\n switch (this.options.protocol) {\n case \"JSONP\":\n case \"XHR\":\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"protocol\"));\n }\n\n // on determine l'environnement d'execution : browser ou non ?\n // et on lance une exception sur l'utilisation du protocole JSONP pour nodeJS...\n if (typeof window === \"undefined\" && this.options.protocol === \"JSONP\") {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT_NODEJS\", \"protocol=JSONP (instead use XHR)\"));\n }\n\n // le protocole JSONP ne fonctionne qu'en GET.\n if (this.options.protocol === \"JSONP\") {\n this.options.httpMethod = \"GET\";\n }\n\n // gestion du cache\n this.options.nocache = options.nocache || false;\n\n // #####################\n // attributs d'instances\n // #####################\n\n /**\n * Format de réponse du service\n */\n this.options.outputFormat = null;\n /**\n * Requête envoyée au service\n */\n this.request = null;\n /**\n * Reponse du service\n */\n this.response = null;\n}\n\n/**\n * @lends module:CommonService\n */\nCommonService.prototype = {\n\n /*\n * Constructeur (alias)\n */\n constructor : CommonService,\n\n /**\n * Appel du service Géoportail\n */\n call : function () {\n /* jshint validthis : true */\n this.logger.trace(\"CommonService::call ()\");\n\n var context = this;\n /** fonction d'execution */\n function run () {\n this.logger.trace(\"CommonService::run ()\");\n this.buildRequest.call(context, onError, onBuildRequest);\n }\n\n run.call(context);\n\n // callback de fin de construction de la requête\n function onBuildRequest (result) {\n this.logger.trace(\"CommonService::onBuildRequest : \", result);\n this.callService.call(context, onError, onCallService);\n }\n\n // callback de fin d'appel au service\n function onCallService (result) {\n this.logger.trace(\"CommonService::onCallService : \", result);\n this.analyzeResponse.call(context, onError, onAnalyzeResponse);\n }\n\n // callback de fin de lecture de la reponse\n function onAnalyzeResponse (result) {\n this.logger.trace(\"CommonService::onAnalyzeResponse : \", result);\n if (result) {\n this.options.onSuccess.call(this, result);\n } else {\n return onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"Analyse de la reponse en échec !?\"));\n }\n }\n\n // callback de gestion des erreurs : renvoit un objet de type ErrorService\n function onError (error) {\n this.logger.trace(\"CommonService::onError()\");\n // error : l'objet est du type ErrorService ou Error\n var e = error;\n if (!(e instanceof _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"])) {\n e = new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](error.message);\n }\n this.options.onFailure.call(this, e);\n }\n },\n\n /**\n * Création de la requête\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n buildRequest : function (error, success) {\n // INFO\n this.logger.error(\"overwritten method !\");\n // retourne l'objet 'this.request'\n if (error) {\n error.call(this, \"This method must be overwritten !\");\n }\n success.call(this, \"This method must be overwritten !\");\n },\n\n /**\n * Appel du service\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n callService : function (error, success) {\n // INFO\n // retourne l'objet 'this.response'\n\n // NOTES\n // Pour le mode XHR, on recupère une reponse sous forme d'un json ou xml (#document).\n // Pour le mode JSONP, on a toujours un objet JSON mais sous 2 formes :\n // - natif\n // - XML encapsulé :\n // {http : {status:200, error:null},xml :'réponse du service'}\n // {http : {status:400, error:'reponse du service'},xml :null}\n // En XHR, la reponse est directement sauvegardée dans 'this.response'.\n // Par contre, en JSONP, on doit analyser la reponse (status ou non vide),\n // et ne renvoyer que le contenu (xml ou l'objet)\n\n // gestion de la proxification du service\n var strUrlProxified = null;\n var strData = this.request;\n\n // a t on mis en place un proxy ?\n // la proxyfication est valable uniquement en mode XHR !\n var bUrlProxified = !!(this.options.proxyURL && this.options.protocol === \"XHR\");\n\n // rajout de l'option gpbibaccess\n // INFO : acces au numero de version de package.conf aprés compilation !\n if (this.CLASSNAME !== \"Geocode\" && this.CLASSNAME !== \"ReverseGeocode\" && this.CLASSNAME !== \"AutoComplete\") {\n this.options.serverUrl = _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, {\n \"gp-access-lib\" : _package_json__WEBPACK_IMPORTED_MODULE_6__.version,\n apiKey : this.options.apiKey || \"calcul\"\n }, false);\n }\n\n // si le proxy est renseigné, on proxifie l'url du service\n if (bUrlProxified) {\n if (this.options.httpMethod === \"GET\") {\n strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, this.request, true);\n strData = null;\n }\n\n if (this.options.httpMethod === \"POST\") {\n strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, null, true);\n strData = this.request;\n }\n }\n\n // contexte du composant spécifique !\n var self = this;\n\n var options = {\n url : strUrlProxified || this.options.serverUrl,\n method : this.options.httpMethod,\n protocol : this.options.protocol,\n timeOut : this.options.timeOut || 0,\n format : this.options.outputFormat, // ceci declenche le parsing de la reponse du service, mais on souhaite toujours une reponse brute (string) !\n nocache : this.options.nocache || false, // ceci permet d'ajouter un timestamp dans la requête\n wrap : this.options.protocol !== \"XHR\", // ceci declenche l'encapsulation de la reponse XML du service dans du JSON, mais pas en mode XHR !\n callbackSuffix : this.options.callbackSuffix,\n // callbackName : this.options.callbackName || null,\n data : strData,\n headers : null, // TODO...\n content : this.options.contentType || \"application/xml\",\n scope : this.options.scope || this,\n // callback de reponse\n onResponse : function (response) {\n self.logger.trace(\"callService::onResponse()\");\n\n // le contenu de la reponse à renvoyer !\n var content = null;\n\n // XHR : on renvoie toujours la reponse brute du service (json ou xml)\n // au parser du composant...\n if (self.options.protocol === \"XHR\") {\n self.logger.trace(\"Response XHR\", response);\n content = response; // par defaut, la reponse du service !\n }\n\n // JSONP : on pre-analyse la reponse brute du service (encapsuler ou pas)\n // avant de l'envoyer au parser du composant...\n if (self.options.protocol === \"JSONP\") {\n self.logger.trace(\"Response JSON\", response);\n if (response) {\n if (response.http) {\n // reponse encapsulée :\n // ex. reponse du service en xml\n // > {http : {status:200, error:null},xml :'réponse du service'}\n if (response.http.status !== 200) {\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"]({\n status : response.http.status,\n message : response.http.error,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TYPE_SRVERR\n }));\n return;\n } else {\n content = response.xml; // par defaut !\n if (self.options.rawResponse) {\n content = response;\n }\n }\n } else {\n // reponse non encapsulée :\n // ex. reponse du service en json ou xml\n content = response;\n }\n } else {\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"Le contenu de la reponse est vide !?\"));\n return;\n }\n }\n\n // si on souhaite parser la reponse du service\n if (typeof self.options.onBeforeParse === \"function\") {\n var newResponse = self.options.onBeforeParse(content);\n if (typeof newResponse === \"string\") {\n // la reponse parsée par l'utilisateur est retournée sous\n // forme de string !\n content = newResponse;\n }\n }\n // sauvegarde de la reponse dans l'objet parent (CommonService)\n self.response = content;\n // on renvoie la reponse...\n success.call(self, content);\n },\n // callback des erreurs\n onFailure : function (e) {\n self.logger.trace(\"callService::onFailure()\");\n // on est forcement sur une erreur levée par un service !\n e.type = _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TYPE_SRVERR;\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](e));\n },\n // callback de timeOut\n onTimeOut : function () {\n self.logger.trace(\"callService::onTimeOut()\");\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"TimeOut!\"));\n }\n };\n\n _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__[\"default\"].send(options);\n },\n\n /**\n * Analyse de la réponse\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n analyzeResponse : function (error, success) {\n // INFO\n this.logger.error(\"overwritten method !\");\n // retourne l'objet spécifique au type de composant (json)\n if (error) {\n error.call(this, \"This method must be overwritten !\");\n }\n success.call(this, \"This method must be overwritten !\");\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (CommonService);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQ29tbW9uU2VydmljZS5qcz8xYjIyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUE4QztBQUNUO0FBQ007QUFDRTtBQUNTO0FBQ0Y7QUFDcEQ7QUFDcUM7O0FBRXJDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxTQUFTO0FBQ3BCO0FBQ0E7QUFDQSxXQUFXLFNBQVM7QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Q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AgICovXG4gICAgdGhpcy5vcHRpb25zLm91dHB1dEZvcm1hdCA9IG51bGw7XG4gICAgLyoqXG4gICAgICogUmVxdcOqdGUgZW52b3nDqWUgYXUgc2VydmljZVxuICAgICAqL1xuICAgIHRoaXMucmVxdWVzdCA9IG51bGw7XG4gICAgLyoqXG4gICAgICogUmVwb25zZSBkdSBzZXJ2aWNlXG4gICAgICovXG4gICAgdGhpcy5yZXNwb25zZSA9IG51bGw7XG59XG5cbi8qKlxuICogQGxlbmRzIG1vZHVsZTpDb21tb25TZXJ2aWNlXG4gKi9cbkNvbW1vblNlcnZpY2UucHJvdG90eXBlID0ge1xuXG4gICAgLypcbiAgICAgKiBDb25zdHJ1Y3RldXIgKGFsaWFzKVxuICAgICAqL1xuICAgIGNvbnN0cnVjdG9yIDogQ29tbW9uU2VydmljZSxcblxuICAgIC8qKlxuICAgICAqIEFwcGVsIGR1IHNlcnZpY2UgR8Opb3BvcnRhaWxcbiAgICAgKi9cbiAgICBjYWxsIDogZnVuY3Rpb24gKCkge1xuICAgICAgICAvKiBqc2hpbnQgdmFsaWR0aGlzIDogdHJ1ZSAqL1xuICAgICAgICB0aGlzLmxvZ2dlci50cmFjZShcIkNvbW1vblNlcnZpY2U6OmNhbGwgKClcIik7XG5cbiAgICAgICAgdmFyIGNvbnRleHQgPSB0aGlzO1xuICAgICAgICAvKiogZm9uY3Rpb24gZCdleGVjdXRpb24gKi9cbiAgICAgICAgZnVuY3Rpb24gcnVuICgpIHtcbiAgICAgICAgICAgIHRoaXMubG9nZ2VyLnRyYWNlKFwiQ29tbW9uU2VydmljZTo6cnVuICgpXCIpO1xuICAgICAgICAgICAgdGhpcy5idWlsZFJlcXVlc3QuY2FsbChjb250ZXh0LCBvbkVycm9yLCBvbkJ1aWxkUmVxdWVzdCk7XG4gICAgICAgIH1cblxuICAgICAgICBydW4uY2FsbChjb250ZXh0KTtcblxuICAgICAgICAvLyBjYWxsYmFjayBkZSBmaW4gZGUgY29uc3RydWN0aW9uIG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cIikge1xuICAgICAgICAgICAgdGhpcy5vcHRpb25zLnNlcnZlclVybCA9IEhlbHBlci5ub3JtYWx5emVVcmwodGhpcy5vcHRpb25zLnNlcnZlclVybCwge1xuICAgICAgICAgICAgICAgIFwiZ3AtYWNjZXNzLWxpYlwiIDogUGtnLnZlcnNpb24sXG4gICAgICAgICAgICAgICAgYXBpS2V5IDogdGhpcy5vcHRpb25zLmFwaUtleSB8fCBcImNhbGN1bFwiXG4gICAgICAgICAgICB9LCBmYWxzZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBzaSBsZSBwcm94eSBlc3QgcmVuc2VpZ27DqSwgb24gcHJveGlmaWUgbCd1cmwgZHUgc2VydmljZVxuICAgICAgICBpZiAoYlVybFByb3hpZmllZCkge1xuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5odHRwTWV0aG9kID09PSBcIkdFVFwiKSB7XG4gICAgICAgICAgICAgICAgc3RyVXJsUHJveGlmaWVkID0gdGhpcy5vcHRpb25zLnByb3h5VVJMICsgSGVscGVyLm5vcm1hbHl6ZVVybCh0aGlzLm9wdGlvbnMuc2VydmVyVXJsLCB0aGlzLnJlcXVlc3QsIHRydWUpO1xuICAgICAgICAgICAgICAgIHN0ckRhdGEgPSBudWxsO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmh0dHBNZXRob2QgPT09IFwiUE9TVFwiKSB7XG4gICAgICAgICAgICAgICAgc3RyVXJsUHJveGlmaWVkID0gdGhpcy5vcHRpb25zLnByb3h5VVJMICsgSGVscGVyLm5vcm1hbHl6ZVVybCh0aGlzLm9wdGlvbnMuc2VydmVyVXJsLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBzdHJEYXRhID0gdGhpcy5yZXF1ZXN0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gY29udGV4dGUgZHUgY29tcG9zYW50IHNww6ljaWZpcXVlICFcbiAgICAgIC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HJEYXRhLFxuICAgICAgICAgICAgaGVhZGVycyA6IG51bGwsIC8vIFRPRE8uLi5cbiAgICAgICAgICAgIGNvbnRlbnQgOiB0aGlzLm9wdGlvbnMuY29udGVudFR5cGUgfHwgXCJhcHBsaWNhdGlvbi94bWxcIixcbiAgICAgICAgICAgIHNjb3BlIDogdGhpcy5vcHRpb25zLnNjb3BlIHx8IHRoaXMsXG4gICAgICAgICAgICAvLyBjYWxsYmFjayBkZSByZXBvbnNlXG4gICAgICAgICAgICBvblJlc3BvbnNlIDogZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJjYWxsU2VydmljZTo6b25SZXNwb25zZSgpXCIpO1xuXG4gICAgICAgICAgICAgICAgLy8gbGUgY29udGVudSBkZSBsYSByZXBvbnNlIMOgIHJlbnZveWVyICFcbiAgICAgICAgICAgICAgICB2YXIgY29udGVudCA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAvLyBYSFIgOiBvbiByZW52b2llIHRvdWpvdXJzIGxhIHJlcG9uc2UgYnJ1dGUgZHUgc2VydmljZSAoanNvbiBvdSB4bWwpXG4gICAgICAgICAgICAgICAgLy8gYXUgcGFyc2VyIGR1IGNvbXBvc2FudC4uLlxuICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMucHJvdG9jb2wgPT09IFwiWEhSXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJSZXNwb25zZSBYSFJcIiwgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gcmVzcG9uc2U7IC8vIHBhciBkZWZhdXQsIGxhIHJlcG9uc2UgZHUgc2VydmljZSAgIVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIEpTT05QIDogb24gcHJlLWFuYWx5c2UgbGEgcmVwb25zZSBicnV0ZSBkdSBzZXJ2aWNlIChlbmNhcHN1bGVyIG91IHBhcylcbiAgICAgICAgICAgICAgICAvLyBhdmFudCBkZSBsJ2Vudm95ZXIgYXUgcGFyc2VyIGR1IGNvbXBvc2FudC4uLlxuICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMucHJvdG9jb2wgPT09IFwiSlNPTlBcIikge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmxvZ2dlci50cmFjZShcIlJlc3BvbnNlIEpTT05cIiwgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5odHRwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVwb25zZSBlbmNhcHN1bMOpZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHJlcG9uc2UgZHUgc2VydmljZSBlbiB4bWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA+IHtodHRwIDoge3N0YXR1czoyMDAsIGVycm9yOm51bGx9LHhtbCA6J3LDqXBvbnNlIGR1IHNlcnZpY2UnfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5odHRwLnN0YXR1cyAhPT0gMjAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLmNhbGwoc2VsZiwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiByZXNwb25zZS5odHRwLnN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiByZXNwb25zZS5odHRwLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA6IEVycm9yU2VydmljZS5UWVBFX1NSVkVSUlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gcmVzcG9uc2UueG1sOyAvLyBwYXIgZGVmYXV0ICFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYub3B0aW9ucy5yYXdSZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCA9IHJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXBvbnNlIG5vbiBlbmNhcHN1bMOpZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHJlcG9uc2UgZHUgc2VydmljZSBlbiBqc29uIG91IHhtbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgPSByZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLmNhbGwoc2VsZiwgbmV3IEVycm9yU2VydmljZShcIkxlIGNvbnRlbnUgZGUgbGEgcmVwb25zZSBlc3QgdmlkZSAhP1wiKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBzaSBvbiBzb3VoYWl0ZSBwYXJzZXIgbGEgcmVwb25zZSBkdSBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzZWxmLm9wdGlvbnMub25CZWZvcmVQYXJzZSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXdSZXNwb25zZSA9IHNlbGYub3B0aW9ucy5vbkJlZm9yZVBhcnNlKGNvbnRlbnQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG5ld1Jlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsYSByZXBvbnNlIHBhcnPDqWUgcGFyIGwndXRpbGlzYXRldXIgZXN0IHJldG91cm7DqWUgc291c1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZm9ybWUgZGUgc3RyaW5nICFcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBuZXdSZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzYXV2ZWdhcmRlIGRlIGxhIHJlcG9uc2UgZGFucyBsJ29iamV0IHBhcmVudCAoQ29tbW9uU2VydmljZSlcbiAgICAgICAgICAgICAgICBzZWxmLnJlc3BvbnNlID0gY29udGVudDtcbiAgICAgICAgICAgICAgICAvLyBvbiByZW52b2llIGxhIHJlcG9uc2UuLi5cbiAgICAgICAgICAgICAgICBzdWNjZXNzLmNhbGwoc2VsZiwgY29udGVudCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gY2FsbGJhY2sgZGVzIGVycmV1cnNcbiAgICAgICAgICAgIG9uRmFpbHVyZSA6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJjYWxsU2VydmljZTo6b25GYWlsdXJlKClcIik7XG4gICAgICAgICAgICAgICAgLy8gb24gZXN0IGZvcmNlbWVudCBzdXIgdW5lIGVycmV1ciBsZXbDqWUgcGFyIHVuIHNlcnZpY2UgIVxuICAgICAgICAgICAgICAgIGUudHlwZSA9IEVycm9yU2VydmljZS5UWVBFX1NSVkVSUjtcb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Vyd3JpdHRlbiAhXCIpO1xuICAgIH1cblxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29tbW9uU2VydmljZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/CommonService.js\n"); /***/ }), @@ -475,7 +487,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ConfigInterface */ \"./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js\");\n\n\n\n\n\n\n/**\n * @classdesc\n *\n * Recupération de la configuration de clés Géoportail sous forme de JSON\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Config\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n * @param {Sting} options.apiKey - clé(s) dont on veut obtenir la configuration. Si plusieurs clés, séparer chacune par une virgule\n * @param {Boolean} [options.sync=false] - force le mode synchrone\n * @param {String} options.customConfigFile - chemin vers un fichier de configuration personnalisé. Surcharge le paramètre apiKey.\n *\n * @example\n * var options = {\n * apiKey : \"cartes,ortho\",\n * sync : false,\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * };\n *\n */\nfunction Config (options) {\n if (!(this instanceof Config)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Config\"));\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"Config\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Config\");\n this.logger.trace(\"[Constructeur Config (options)]\");\n\n // #####################\n // analyse des options\n // #####################\n\n // gestion du callback onSuccess\n var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === \"function\");\n if (!bOnSuccess) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"onSuccess()\"));\n }\n if (!options.apiKey && !options.customConfigFile) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"apiKey\", \"customConfigFile\"));\n }\n this.options = {};\n this.options.onSuccess = options.onSuccess;\n this.options.onFailure = options.onFailure;\n\n // mode sync\n this.options.sync = options.sync || false;\n\n // gestion d'un tableau d'url des fichiers de configuration\n this.options.listConfigUrls = (options.customConfigFile)\n ? [options.customConfigFile]\n : !Array.isArray(options.apiKey)\n ? _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Config.url(options.apiKey.split(\",\"))\n : _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Config.url(options.apiKey);\n}\n\n/**\n * @lends module:Config#\n */\nConfig.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/**\n * Constructeur (alias)\n */\nConfig.prototype.constructor = Config;\n\n/**\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.buildRequest = function (error, success) {\n // liste des urls des fichiers de configuration en JSON\n this.listConfigUrls = this.options.listConfigUrls;\n\n if (!this.listConfigUrls) {\n error.call(this, new Error(\"url by default not found !\"));\n return;\n }\n\n // INFO :\n // il n'y a pas de construction de requête,\n // on passe directement à l'appel des requêtes\n success.call(this, this.listConfigUrls);\n};\n\n/**\n * Récupération des configuration\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.callService = function (error, success) {\n if (this.options.sync) {\n __callServiceSync.call(this, error, success);\n } else {\n __callService.call(this, error, success);\n }\n};\n\n/**\n * Requêtes en mode asynchrone\n *\n * @param {*} error\n * @param {*} success\n * @private\n */\nvar __callService = function (error, success) {\n // liste des resultats au format JSON\n this.listConfigResults = [];\n\n // test on env. nodejs or browser\n let Fetch = null;\n if (typeof window === \"undefined\") {\n var nodefetch = __webpack_require__(/*! node-fetch */ \"node-fetch\");\n Fetch = nodefetch;\n } else {\n Fetch = window.fetch;\n }\n\n // the factory of fetch !\n var fetchFactory = (url) => {\n return Fetch(url, { credentials : \"same-origin\" })\n .then((response) => {\n if (response.ok) {\n return response.json()\n .then((json) => {\n // TODO :\n // tester le contenu !\n return json;\n })\n .catch((error) => {\n throw new Error(\"Exception Json : \" + error);\n });\n } else {\n throw new Error(\"Exception HTTP : \" + response.status + \" (status code) !\");\n }\n })\n .catch((error) => {\n return new Promise((resolve, reject) => {\n // eslint-disable-line no-unused-vars\n reject(error);\n });\n });\n };\n\n // construction des promises fetch\n var promises = [];\n for (let index = 0; index < this.listConfigUrls.length; index++) {\n const url = this.listConfigUrls[index];\n promises.push(fetchFactory(url));\n }\n\n Promise.all(promises)\n .then((results) => {\n if (!results) {\n throw new Error(\"results config empty !?\");\n }\n results.forEach((result) => {\n // TODO :\n // verification des resultats\n this.listConfigResults.push(result);\n });\n })\n .then(() => {\n success.call(this, this.listConfigResults);\n })\n .catch((e) => {\n // TODO :\n // construction d'un message\n error.call(this, e);\n });\n};\n\n/**\n * Requêtes en mode synchrone\n *\n * @param {*} error\n * @param {*} success\n * @private\n */\nvar __callServiceSync = function (error, success) {\n // liste des resultats au format JSON\n this.listConfigResults = [];\n\n // FIXME :\n // boucle synchrone !\n for (var i = 0; i < this.listConfigUrls.length; i++) {\n const url = this.listConfigUrls[i];\n // TODO :\n // prévoir le CORS, headers, ...\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, false);\n request.send(null);\n if (request.status === 200) {\n // TODO :\n // tester la reponse !\n var response = JSON.parse(request.responseText);\n this.listConfigResults.push(response);\n }\n }\n // callback\n if (this.listConfigResults.length !== 0) {\n success.call(this, this.listConfigResults);\n } else {\n error.call(this, new Error(\"...\"));\n }\n};\n\n/**\n * Analyse et mise en forme de la réponse en fusionnant les configurations\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.analyzeResponse = function (error, success) {\n // fonction de merge des objects JSON\n var mergeConfig = function (objects) {\n // objet fusion des couches\n var allLayersConfig = {};\n // objet fusion des clés\n var allKeysConfig = {};\n // objet fusion des TMS\n var allTMSConfig = {};\n\n // on fusionne les résultat\n for (var i = 0; i < objects.length; i++) {\n if (!objects[i].generalOptions || !objects[i].layers) {\n return;\n }\n allKeysConfig = {\n ...allKeysConfig,\n ...objects[i].generalOptions.apiKeys\n };\n allLayersConfig = {\n ...allLayersConfig,\n ...objects[i].layers\n };\n allTMSConfig = {\n ...allTMSConfig,\n ...objects[i].tileMatrixSets\n };\n }\n\n var mergedConfig = {\n generalOptions : {\n apiKeys : allKeysConfig\n },\n layers : allLayersConfig,\n tileMatrixSets : allTMSConfig\n };\n return mergedConfig;\n };\n\n // fusion des configurations JSON\n var ConfigJSON = mergeConfig(this.listConfigResults);\n if (!ConfigJSON) {\n error.call(this, new Error(\"configuration structure not conforme !\"));\n return;\n }\n\n // creation des interfaces\n var IConfig = new _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n // ajout des interfaces avec la configuration JSON\n Object.assign(IConfig, ConfigJSON);\n\n // définition de la variable globale Gp.Config\n var scope = typeof window !== \"undefined\" ? window : {};\n if (!scope.Gp) {\n scope.Gp = {};\n }\n\n // enregistrement\n if (scope.Gp.Config) {\n Object.assign(scope.Gp.Config, IConfig);\n // dans le doute..., ceinture et bretelles !\n for (var property in IConfig) {\n scope.Gp.Config[property] = IConfig[property];\n }\n } else {\n scope.Gp.Config = IConfig;\n }\n\n // INFO :\n // il n'y a pas d'analyse des résultats,\n // on passe directement à l'appel de la callback utilisateur\n success.call(this, scope.Gp.Config);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Config);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQ29uZmlnL0NvbmZpZy5qcz9lZjhmIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFpRDtBQUNIO0FBQ0Q7QUFDUTtBQUNMOztBQUVoRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsUUFBUTtBQUNuQixXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDBDQUEwQztBQUMxQyx1Q0FBdUM7QUFDdkM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDRCQUE0QixnRUFBQztBQUM3Qjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxrQkFBa0IsOERBQU07QU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sIHN1Y2Nlc3MpIHtcbiAgICAvLyBsaXN0ZSBkZXMgcmVzdWx0YXRzIGF1IGZvcm1hdCBKU09OXG4gICAgdGhpcy5saXN0Q29uZmlnUmVzdWx0cyA9IFtdO1xuXG4gICAgLy8gdGVzdCBvbiBlbnYuIG5vZGVqcyBvciBicm93c2VyXG4gICAgbGV0IEZldGNoID0gbnVsbDtcbiAgICBpZiAodHlwZW9mIHdpbmRvdyA9PT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICB2YXIgbm9kZWZldGNoID0gcmVxdWlyZShcIm5vZGUtZmV0Y2hcIik7XG4gICAgICAgIEZldGNoID0gbm9kZWZldGNoO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIEZldGNoID0gd2luZG93LmZldGNoO1xuICAgIH1cblxuICAgIC8vIHRoZSBmYWN0b3J5IG9mIGZldGNoICFcbiAgICB2YXIgZmV0Y2hGYWN0b3J5ID0gKHVybCkgPT4ge1xuICAgICAgICByZXR1cm4gRmV0Y2godXJsLCB7IGNyZWRlbnRpYWxzIDogXCJzYW1lLW9yaWdpblwiIH0pXG4gICAgICAgICAgICAudGhlbigocmVzcG9uc2UpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uub2spIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlLmpzb24oKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oKGpzb24pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZXN0ZXIgbGUgY29udGVudSAhXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGpzb247XG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkV4Y2VwdGlvbiBKc29uIDogXCIgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFeGNlcHRpb24gSFRUUCA6IFwiICsgcmVzcG9uc2Uuc3RhdHVzICsgXCIgKHN0YXR1cyBjb2RlKSAhXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2F0Y2goKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bnVzZWQtdmFyc1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIC8vIGNvbnN0cnVjdGlvbiBkZXMgcHJvbWlzZXMgZmV0Y2hcbiAgICB2YXIgcHJvbWlzZXMgPSBbXTtcbiAgICBmb3IgKGxldCBpbmRleCA9IDA7IGluZGV4IDwgdGhpcy5saXN0Q29uZmlnVXJscy5sZW5ndGg7IGluZGV4KyspIHtcbiAgICAgICAgY29uc3QgdXJsID0gdGhpcy5saXN0Q29uZmlnVXJsc1tpbmRleF07XG4gICAgICAgIHByb21pc2VzLnB1c2goZmV0Y2hGYWN0b3J5KHVybCkpO1xuICAgIH1cblxuICAgIFByb21pc2UuYWxsKHByb21pc2VzKVxuICAgICAgICAudGhlbigocmVzdWx0cykgPT4ge1xuICAgICAgICAgICAgaWYgKCFyZXN1bHRzKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwicmVzdWx0cyBjb25maWcgZW1wdHkgIT9cIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgIC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AoZXJyb3IsIHN1Y2Nlc3MpIHtcbiAgICAvLyBmb25jdGlvbiBkZSBtZXJnZSBkZXMgb2JqZWN0cyBKU09OXG4gICAgdmFyIG1lcmdlQ29uZmlnID0gZnVuY3Rpb24gKG9iamVjdHMpIHtcbiAgICAgICAgLy8gb2JqZXQgZnVzaW9uIGRlcyBjb3VjaGVzXG4gICAgICAgIHZhciBhbGxMYXllcnNDb25maWcgPSB7fTtcbiAgICAgICAgLy8gb2JqZXQgZnVzaW9uIGRlcyBjbMOpc1xuICAgICAgICB2YXIgYWxsS2V5c0NvbmZpZyA9IHt9O1xuICAgICAgICAvLyBvYmpldCBmdXNpb24gZGVzIFRNU1xuICAgICAgICB2YXIgYWxsVE1TQ29uZmlnID0ge307XG5cbiAgICAgICAgLy8gb24gZnVzaW9ubmUgbGVzIHLDqXN1bHRhdFxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG9iamVjdHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmICghb2JqZWN0c1tpXS5nZW5lcmFsT3B0aW9ucyB8fCAhb2JqZWN0c1tpXS5sYXllcnMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhbGxLZXlzQ29uZmlnID0ge1xuICAgICAgICAgICAgICAgIC4uLmFsbEtleXNDb25maWcsXG4gICAgICAgICAgICAgICAgLi4ub2JqZWN0c1tpXS5nZW5lcmFsT3B0aW9ucy5hcGlLZXlzXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWxsTGF5ZXJzQ29uZmlnID0ge1xuICAgICAgICAgICAgICAgIC4uLmFsbExheWVyc0NvbmZpZyxcbiAgICAgICAgICAgICAgICAuLi5vYmplY3RzW2ldLmxheWVyc1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFsbFRNU0NvbmZpZyA9IHtcbiAgICAgICAgICAgICAgICAuLi5hbGxUTVNDb25maWcsXG4gICAgICAgICAgICAgICAg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jb3BlLkdwKSB7XG4gICAgICAgIHNjb3BlLkdwID0ge307XG4gICAgfVxuXG4gICAgLy8gZW5yZWdpc3RyZW1lbnRcbiAgICBpZiAoc2NvcGUuR3AuQ29uZmlnKSB7XG4gICAgICAgIE9iamVjdC5hc3NpZ24oc2NvcGUuR3AuQ29uZmlnLCBJQ29uZmlnKTtcbiAgICAgICAgLy8gZGFucyBsZSBkb3V0ZS4uLiwgY2VpbnR1cmUgZXQgYnJldGVsbGVzICFcbiAgICAgICAgZm9yICh2YXIgcHJvcGVydHkgaW4gSUNvbmZpZykge1xuICAgICAgICAgICAgc2NvcGUuR3AuQ29uZmlnW3Byb3BlcnR5XSA9IElDb25maWdbcHJvcGVydHldO1xuICAgICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgICAgc2NvcGUuR3AuQ29uZmlnID0gSUNvbmZpZztcbiAgICB9XG5cbiAgICAvLyBJTkZPIDpcbiAgICAvLyBpbCBuJ3kgYSBwYXMgZCdhbmFseXNlIGRlcyByw6lzdWx0YXRzLFxuICAgIC8vIG9uIHBhc3NlIGRpcmVjdGVtZW50IMOgIGwnYXBwZWwgZGUgbGEgY2FsbGJhY2sgdXRpbGlzYXRldXJcbiAgICBzdWNjZXNzLmNhbGwodGhpcywgc2NvcGUuR3AuQ29uZmlnKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IENvbmZpZztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Config/Config.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ConfigInterface */ \"./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js\");\n\n\n\n\n\n\n/**\n * @classdesc\n *\n * Recupération de la configuration de clés Géoportail sous forme de JSON\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Config\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n * @param {Sting} options.apiKey - clé(s) dont on veut obtenir la configuration. Si plusieurs clés, séparer chacune par une virgule\n * @param {Boolean} [options.sync=false] - force le mode synchrone\n * @param {String} options.customConfigFile - chemin vers un fichier de configuration personnalisé. Surcharge le paramètre apiKey.\n *\n * @example\n * var options = {\n * apiKey : \"cartes,ortho\",\n * sync : false,\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * };\n *\n */\nfunction Config (options) {\n if (!(this instanceof Config)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Config\"));\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"Config\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Config\");\n this.logger.trace(\"[Constructeur Config (options)]\");\n\n // #####################\n // analyse des options\n // #####################\n\n // gestion du callback onSuccess\n var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === \"function\");\n if (!bOnSuccess) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"onSuccess()\"));\n }\n if (!options.apiKey && !options.customConfigFile) {\n // si pas de thème spécifié, on récupère toutes les ressources possibles dans l'objet Config\n options.apiKey = \"full\";\n }\n this.options = {};\n this.options.onSuccess = options.onSuccess;\n this.options.onFailure = options.onFailure;\n\n // mode sync\n this.options.sync = options.sync || false;\n\n // gestion d'un tableau d'url des fichiers de configuration\n this.options.listConfigUrls = (options.customConfigFile)\n ? [options.customConfigFile]\n : !Array.isArray(options.apiKey)\n ? _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Config.url(options.apiKey.split(\",\"))\n : _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Config.url(options.apiKey);\n}\n\n/**\n * @lends module:Config#\n */\nConfig.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/**\n * Constructeur (alias)\n */\nConfig.prototype.constructor = Config;\n\n/**\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.buildRequest = function (error, success) {\n // liste des urls des fichiers de configuration en JSON\n this.listConfigUrls = this.options.listConfigUrls;\n\n if (!this.listConfigUrls) {\n error.call(this, new Error(\"url by default not found !\"));\n return;\n }\n\n // INFO :\n // il n'y a pas de construction de requête,\n // on passe directement à l'appel des requêtes\n success.call(this, this.listConfigUrls);\n};\n\n/**\n * Récupération des configuration\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.callService = function (error, success) {\n if (this.options.sync) {\n __callServiceSync.call(this, error, success);\n } else {\n __callService.call(this, error, success);\n }\n};\n\n/**\n * Requêtes en mode asynchrone\n *\n * @param {*} error\n * @param {*} success\n * @private\n */\nvar __callService = function (error, success) {\n // liste des resultats au format JSON\n this.listConfigResults = [];\n\n // test on env. nodejs or browser\n let Fetch = null;\n if (typeof window === \"undefined\") {\n var nodefetch = __webpack_require__(/*! node-fetch */ \"node-fetch\");\n Fetch = nodefetch;\n } else {\n Fetch = window.fetch;\n }\n\n // the factory of fetch !\n var fetchFactory = (url) => {\n return Fetch(url, { credentials : \"same-origin\" })\n .then((response) => {\n if (response.ok) {\n return response.json()\n .then((json) => {\n // TODO :\n // tester le contenu !\n return json;\n })\n .catch((error) => {\n throw new Error(\"Exception Json : \" + error);\n });\n } else {\n throw new Error(\"Exception HTTP : \" + response.status + \" (status code) !\");\n }\n })\n .catch((error) => {\n return new Promise((resolve, reject) => {\n // eslint-disable-line no-unused-vars\n reject(error);\n });\n });\n };\n\n // construction des promises fetch\n var promises = [];\n for (let index = 0; index < this.listConfigUrls.length; index++) {\n const url = this.listConfigUrls[index];\n promises.push(fetchFactory(url));\n }\n\n Promise.all(promises)\n .then((results) => {\n if (!results) {\n throw new Error(\"results config empty !?\");\n }\n results.forEach((result) => {\n // TODO :\n // verification des resultats\n this.listConfigResults.push(result);\n });\n })\n .then(() => {\n success.call(this, this.listConfigResults);\n })\n .catch((e) => {\n // TODO :\n // construction d'un message\n error.call(this, e);\n });\n};\n\n/**\n * Requêtes en mode synchrone\n *\n * @param {*} error\n * @param {*} success\n * @private\n */\nvar __callServiceSync = function (error, success) {\n // liste des resultats au format JSON\n this.listConfigResults = [];\n\n // FIXME :\n // boucle synchrone !\n for (var i = 0; i < this.listConfigUrls.length; i++) {\n const url = this.listConfigUrls[i];\n // TODO :\n // prévoir le CORS, headers, ...\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, false);\n request.send(null);\n if (request.status === 200) {\n // TODO :\n // tester la reponse !\n var response = JSON.parse(request.responseText);\n this.listConfigResults.push(response);\n }\n }\n // callback\n if (this.listConfigResults.length !== 0) {\n success.call(this, this.listConfigResults);\n } else {\n error.call(this, new Error(\"...\"));\n }\n};\n\n/**\n * Analyse et mise en forme de la réponse en fusionnant les configurations\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.analyzeResponse = function (error, success) {\n // fonction de merge des objects JSON\n var mergeConfig = function (objects) {\n // objet fusion des couches\n var allLayersConfig = {};\n // objet fusion des clés\n var allKeysConfig = {};\n // objet fusion des TMS\n var allTMSConfig = {};\n\n // on fusionne les résultat\n for (var i = 0; i < objects.length; i++) {\n if (!objects[i].generalOptions || !objects[i].layers) {\n return;\n }\n allKeysConfig = {\n ...allKeysConfig,\n ...objects[i].generalOptions.apiKeys\n };\n allLayersConfig = {\n ...allLayersConfig,\n ...objects[i].layers\n };\n allTMSConfig = {\n ...allTMSConfig,\n ...objects[i].tileMatrixSets\n };\n }\n\n var mergedConfig = {\n generalOptions : {\n apiKeys : allKeysConfig\n },\n layers : allLayersConfig,\n tileMatrixSets : allTMSConfig\n };\n return mergedConfig;\n };\n\n // fusion des configurations JSON\n var ConfigJSON = mergeConfig(this.listConfigResults);\n if (!ConfigJSON) {\n error.call(this, new Error(\"configuration structure not conforme !\"));\n return;\n }\n\n // creation des interfaces\n var IConfig = new _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n // ajout des interfaces avec la configuration JSON\n Object.assign(IConfig, ConfigJSON);\n\n // définition de la variable globale Gp.Config\n var scope = typeof window !== \"undefined\" ? window : {};\n if (!scope.Gp) {\n scope.Gp = {};\n }\n\n // enregistrement\n if (scope.Gp.Config) {\n Object.assign(scope.Gp.Config, IConfig);\n // dans le doute..., ceinture et bretelles !\n for (var property in IConfig) {\n scope.Gp.Config[property] = IConfig[property];\n }\n } else {\n scope.Gp.Config = IConfig;\n }\n\n // INFO :\n // il n'y a pas d'analyse des résultats,\n // on passe directement à l'appel de la callback utilisateur\n success.call(this, scope.Gp.Config);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Config);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0Y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jaEZhY3RvcnkgPSAodXJsKSA9PiB7XG4gICAgICAgIHJldHVybiBGZXRjaCh1cmwsIHsgY3JlZGVudGlhbHMgOiBcInNhbWUtb3JpZ2luXCIgfSlcbiAgICAgICAgICAgIC50aGVuKChyZXNwb25zZSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5vaykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2UuanNvbigpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbigoanNvbikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRlc3RlciBsZSBjb250ZW51ICFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ganNvbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2F0Y2goKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRXhjZXB0aW9uIEpzb24gOiBcIiArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkV4Y2VwdGlvbiBIVFRQIDogXCIgKyByZXNwb25zZS5zdGF0dXMgKyBcIiAoc3RhdHVzIGNvZGUpICFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYXRjaCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgLy8gY29uc3RydWN0aW9uIGRlcyBwcm9taXNlcyBmZXRjaFxuICAgIHZhciBwcm9taXNlcyA9IFtdO1xuICAgIGZvciAobGV0IGluZGV4ID0gMDsgaW5kZXggPCB0aGlzLmxpc3RDb25maWdVcmxzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICBjb25zdCB1cmwgPSB0aGlzLmxpc3RDb25maWdVcmxzW2luZGV4XTtcbiAgICAgICAgcHJvbWlzZXMucHVzaChmZXRjaEZhY3RvcnkodXJsKSk7XG4gICAgfVxuXG4gICAgUHJvbWlzZS5hbGwocHJvbWlzZXMpXG4gICAgICAgIC50aGVuKChyZXN1bHRzKSA9PiB7XG4gICAgICAgICAgICBpZiAoIXJlc3VsdHMpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJyZXN1bHRzIGNvbmZpZyBlbXB0eSAhP1wiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdHMuZm9yRWFjaCgocmVzdWx0KSA9PiB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETyA6XG4gICAgICAgICAgICAgICAgLy8gdmVyaWZpY2F0aW9uIGRlcyByZXN1bHRhdHNcbiAgICAgICAgICAgICAgICB0aGlzLmxpc3RDb25maWdSZXN1bHRzLnB1c2gocmVzdWx0KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KVxuICAgICAgICAudGhlbigoKSA9PiB7XG4gICAgICAgICAgICBzdWNjZXNzLmNhbGwodGhpcywgdGhpcy5saXN0Q29uZmlnUmVzdWx0cyk7XG4gICAgICAgIH0pXG4gICAgICAgIC5jYXRjaCgoZSkgPT4ge1xuICAgICAgICAgICAgLy8gVE9ETyA6XG4gICAgICAgICAgICAvLyBjb25zdHJ1Y3Rpb24gZCd1biBtZXNzYWdlXG4gICAgICAgICAgICBlc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sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKCFvYmplY3RzW2ldLmdlbmVyYWxPcHRpb25zIHx8ICFvYmplY3RzW2ldLmxheWVycykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFsbEtleXNDb25maWcgPSB7XG4gICAgICAgICAgICAgICAgLi4uYWxsS2V5c0NvbmZpZyxcbiAgICAgICAgICAgICAgICAuLi5vYmplY3RzW2ldLmdlbmVyYWxPcHRpb25zLmFwaUtleXNcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhbGxMYXllcnNDb25maWcgPSB7XG4gICAgICAgICAgICAgICAgLi4uYWxsTGF5ZXJzQ29uZmlnLFxuICAgICAgICAgICAgICAgIC4uLm9iamVjdHNbaV0ubGF5ZXJzXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWxsVE1TQ29uZmlnID0ge1xuICAgICAgICAgICAgICAgIC4uLmFsbFRNU0NvbmZpZyxcbiAgICAgICAgICAgICAgICAuLi5vYmplY3RzW2ldLnRpbGVNYXRyaXhTZXRzXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIG1lcmdlZENvbmZpZyA9IHtcbiAgICAgICAgICAgIGdlbmVyYWxPcHRpb25zIDoge1xuICAgICAgICAgICAgICAgIGFwaUtleXMgOiBhbGxLZXlzQ29uZmlnXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGF5ZXJzIDogYWxsTGF5ZXJzQ29uZmlnLFxuICAgICAgICAgICAgdGlsZU1hdHJpeFNldHMgOiBhbGxUTVNDb25maWdcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIG1lcmdlZENvbmZpZztcbiAgICB9O1xuXG4gICAgLy8gZnVzaW9uIGRlcyBjb25maWd1cmF0aW9ucyBKU09OXG4gICAgdmFyIENvbmZpZ0pTT04gPSBtZXJnZUNvbmZpZyh0aGlzLmxpc3RDb25maWdSZXN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IGlsIG4neSBhIHBhcyBkJ2FuYWx5c2UgZGVzIHLDqXN1bHRhdHMsXG4gICAgLy8gb24gcGFzc2UgZGlyZWN0ZW1lbnQgw6AgbCdhcHBlbCBkZSBsYSBjYWxsYmFjayB1dGlsaXNhdGV1clxuICAgIHN1Y2Nlc3MuY2FsbCh0aGlzLCBzY29wZS5HcC5Db25maWcpO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29uZmlnO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Config/Config.js\n"); /***/ }), @@ -487,7 +499,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Response object for {@link module:Services~getConfig Gp.Services.getConfig ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Object} generalOptions - General properties for default map configuration resources.\n * @property {Object} generalOptions.apiKeys - Object that associates apiKey (s) with an array of resources IDs availables with that key.\n * @property {String} generalOptions.title - Underlying web service Title.\n * @property {String} generalOptions.defaultGMLGFIStyle - XSL URL used by default to translate an XML GetFeatureInfo response into an HTML array.\n * @property {String} generalOptions.theme - default theme (FIXME : for what ?)\n * @property {Array.} generalOptions.wgs84Resolutions - geographical resolutions Array for each [zoom level of the Geoportal platform]{@link http://api.ign.fr/tech-docs-js/webmaster/layers.html#Geoportal_resolutions} from 0 to 21. Expressed in degrees/pixel.\n * @property {Object} layers - Associative array mapping resources availables IDs (keys) with their properties (values given as {@link Gp.Services.Config.Layer}).\n * @property {Object} tileMatrixSets - Associative Array mapping TileMatrixSets IDs (keys) availables with their properties (values given as {@link Gp.Services.Config.TileMatrixSet}).\n *\n * @namespace\n * @alias Gp.Services.GetConfigInterface\n */\nfunction ConfigInterface () {\n if (!(this instanceof ConfigInterface)) {\n throw new TypeError(\"ConfigInterface constructor cannot be called as a function.\");\n }\n\n this.generalOptions = {\n apiKeys : {},\n title : null,\n defaultGMLGFIStyle : null,\n theme : null,\n wgs84Resolutions : []\n };\n\n this.layers = {};\n\n this.tileMatrixSets = {};\n}\n\nConfigInterface.prototype = {\n\n /*\n * Constructor (alias)\n */\n constructor : ConfigInterface,\n\n /**\n * Check if config is loaded for a given key\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Boolean} isKeyConfLoaded - true if config of the key is already loaded, false otherwise\n */\n isKeyConfLoaded : function (apiKey) {\n if (!apiKey) {\n return;\n }\n if (this.generalOptions.apiKeys[apiKey]) {\n return true;\n }\n return false;\n },\n\n /**\n * Returns an array of Geoportal layers identifiers, corresponding to an API contract key.\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Array} apiKeys - Array of geoportal layers identifiers\n */\n getLayersId : function (apiKey) {\n return this.generalOptions.apiKeys[apiKey];\n },\n\n /**\n * Returns the id of a Geoportal layer with its name and its service.\n *\n * @param {String} layerName - name of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {String} service - name of the service (ex. \"WMS\" ou \"WMTS\")\n * @returns {String} Id of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS\")\n */\n getLayerId : function (layerName, service) {\n if (!layerName || !service) {\n return;\n }\n var layerId = null;\n\n // layer\n // key : [layerName]$[contexte]:OGC:[service]\n // ex : \"ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS\"\n\n // service\n // key : [layerName]$[contexte];[service]\n // ex : PositionOfInterest$OGC:OPENLS;ReverseGeocode\n\n if (this.layers) {\n var layers = this.layers;\n for (var key in layers) {\n if (layers.hasOwnProperty(key)) {\n var parts = key.split(\"$\");\n if (layerName === parts[0]) {\n if (parts[1]) {\n var servicePartsLayer = parts[1].split(\":\");\n var servicePartsService = parts[1].split(\";\");\n\n if (servicePartsService[1] === service.toUpperCase()) {\n layerId = key;\n break;\n }\n if (servicePartsLayer[2] === service.toUpperCase()) {\n layerId = key;\n break;\n }\n }\n }\n }\n }\n }\n if (!layerId) {\n return;\n }\n return layerId;\n },\n\n /**\n * Returns an associative array of Geoportal layers configurations, corresponding to an API contract key.\n * If no key is specified, all layers from configuration are returned.\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Object} layers - Object which properties are layers identifiers.\n */\n getLayersConf : function (apiKey) {\n var layers = {};\n var layersIdArray = this.getLayersId(apiKey);\n if (layersIdArray) {\n for (var i = 0; i < layersIdArray.length; i++) {\n var lyrId = layersIdArray[i];\n layers[lyrId] = this.layers[lyrId];\n }\n }\n return layers;\n },\n\n /**\n * Returns a geoportal layer configuration, given its identifier\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @return {Object} layer - Layer configuration\n */\n getLayerConf : function (layerId) {\n if (!this.layers) {\n return;\n }\n return this.layers[layerId];\n },\n\n /**\n * Get all parameters needed to display a WMS or WMTS layer given its name, its service and its key\n *\n * @param {String} layerName - name of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {String} service - name of the service (ex. \"WMS\" ou \"WMTS\")\n * @param {String} [apiKey] - Contract API key\n * @returns {Object} params - params of the service (WMS or WMTS) for the given layer\n * @returns {String} params.url - Url of the service to reach to display the layer\n * @returns {String} params.version - Version of the service\n * @returns {String} params.styles - Default style of the layer\n * @returns {String} params.format - Default format of the layer\n * @returns {String} params.projection - Default projection of the layer\n * @returns {Number} params.minScale - Min scale denominator of the layer\n * @returns {Number} params.maxScale - Max scale denominator of the layer\n * @returns {Gp.BBox} params.extent - Extent of the layer, in the projection of the layer\n * @returns {Array} params.legends - Array of legends associated to the layer\n * @returns {Array} params.title - Name of the layer, readable by a human\n * @returns {Array} params.description - Description of the layer\n * @returns {String} params.[TMSLink] - Id of the Tile Matrix Set (TMS), in the case of WMTS layer\n * @returns {Gp.Point} params.[matrixOrigin] - Originof the tile matrix (top left corner), in the case of WMTS layer\n * @returns {Array} params.[nativeResolutions] - Array with the resolution of each level of the tile matrix set, in the case of WMTS layer\n * @returns {Array} params.[matrixIds] - Array with the ID of each level of the tile matrix set, in the case of WMTS layer\n */\n getLayerParams : function (layerName, service) {\n var params = {};\n\n if ((service === \"WMS\" || Object.keys(this.tileMatrixSets).length !== 0) && Object.keys(this.layers).length !== 0) {\n // get the layerId of the layer\n var layerId = this.getLayerId(layerName, service);\n\n if (layerId) {\n // get the layer Conf Object\n var layerConf = this.getLayerConf(layerId);\n\n var keys = this.getLayerKey(layerId);\n if (keys.length === 0) {\n return;\n }\n\n // get services params\n for (var i = 0; i < keys.length; i++) {\n // only one serverUrl is saved in Gp.Config : with multiKeys, we have to retrieve the key used in the serverUrl property\n if (layerConf.serviceParams.serverUrl[keys[i]]) {\n params.url = layerConf.serviceParams.serverUrl[keys[i]];\n }\n }\n\n const wmsTypeRegex = /\\/v\\//;\n // WMS vector style always empty (not in getCap)\n if (wmsTypeRegex.test(params.url)) {\n params.styles = \"\";\n } else {\n // WMS raster style is defined in getCap\n params.styles = layerConf.styles[0].name;\n }\n\n params.version = layerConf.serviceParams.version;\n params.format = layerConf.formats[0].name;\n params.projection = layerConf.defaultProjection;\n\n // get layer info and constraints\n params.minScale = layerConf.globalConstraint.minScaleDenominator;\n params.maxScale = layerConf.globalConstraint.maxScaleDenominator;\n params.extent = layerConf.globalConstraint.bbox;\n params.legends = layerConf.legends;\n params.title = layerConf.title;\n params.description = layerConf.description;\n\n if (service === \"WMS\") {\n params.metadata = layerConf.metadata;\n }\n\n // Informations non disponibles avec les getCap\n // params.metadata = layerConf.getMetadata();\n // params.originators = layerConf.getOriginators();\n // params.quicklookUrl = layerConf.getQuicklookUrl();\n\n // WMTS : get the tileMatrixSetLimits\n if (layerConf.wmtsOptions) {\n params.tileMatrixSetLimits = layerConf.wmtsOptions.tileMatrixSetLimits;\n var TMSLink = layerConf.wmtsOptions.tileMatrixSetLink;\n if (TMSLink) {\n params.TMSLink = TMSLink;\n var tmsConf = this.getTMSConf(TMSLink);\n // Get matrix origin : Gp.Point = Object{x:Float, y:Float}\n // params.matrixOrigin = tmsConf.getTopLeftCorner();\n params.matrixIds = Object.keys(tmsConf.tileMatrices);\n params.tileMatrices = tmsConf.tileMatrices;\n // by default, pseudo mercator resolutions\n params.nativeResolutions = tmsConf.nativeResolutions || this.getTMSConf(\"PM\").nativeResolutions;\n }\n }\n }\n }\n return params;\n },\n\n /**\n * Get the contract key(s) associated to a given layer.\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @return {Array} layerKey - array of key(s) associated to the given layer\n */\n getLayerKey : function (layerId) {\n var layerKey = [];\n if (this.generalOptions && this.generalOptions.apiKeys && Object.keys(this.generalOptions.apiKeys).length !== 0) {\n var resourcesByKey = this.generalOptions.apiKeys;\n for (var key in resourcesByKey) {\n var resourcesArray = resourcesByKey[key];\n resourcesArray.forEach(function (arrayLayerId) {\n if (arrayLayerId === layerId) {\n layerKey.push(key);\n }\n });\n }\n }\n return layerKey;\n },\n\n /**\n * Returns an associative array of Tile Matrix Sets configurations.\n *\n * @return {Object} tileMatrixSets - Object which properties are TMS identifiers\n *\n */\n getTileMatrixSets : function () {\n return this.tileMatrixSets;\n },\n\n /**\n * Returns a Tile Matrix Sets configuration, given its identifier.\n *\n * @param {String} tmsID - Tile Matrix Set identifier (e.g. : \"PM\")\n * @return {Object} tileMatrixSet - Tile Matrix Set configuration\n */\n getTMSConf : function (tmsID) {\n if (!this.tileMatrixSets) {\n return;\n }\n return this.tileMatrixSets[tmsID];\n },\n\n /**\n * Get global constraints for a given Layer : extent, minScale, maxScale, projection\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @returns {Object} params - layer constraints\n * @returns {String} params.projection - default layer projection\n * @returns {Number} params.minScale - layer min scale denominator\n * @returns {Number} params.maxScale - layer max scale denominator\n * @returns {Gp.BBox} params.extent - layer extent expressed in the layer projection\n */\n getGlobalConstraints : function (layerId) {\n var params = {};\n\n if (layerId) {\n // get layer configuration object\n var layerConf = this.getLayerConf(layerId);\n params.projection = layerConf.defaultProjection;\n params.minScale = layerConf.globalConstraint.minScaleDenominator;\n params.maxScale = layerConf.globalConstraint.maxScaleDenominator;\n params.extent = layerConf.globalConstraint.bbox;\n }\n\n return params;\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ConfigInterface);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQ29uZmlnL0NvbmZpZ0ludGVyZmFjZS5qcz83NDM1Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0E7QUFDQSx3QkFBd0IseURBQXlEO0FBQ2pGO0FBQ0EsY0FBYyxPQUFPO0FBQ3JCLGNBQWMsT0FBTztBQUNyQixjQUFjLE9BQU87QUFDckIsY0FBYyxPQUFPO0FBQ3JCLGNBQWMsT0FBTztBQUNyQixjQUFjLGNBQWMsa0hBQWtILGlGQUFpRjtBQUMvTixjQUFjLE9BQU8sNEdBQTRHLCtCQUErQjtBQUNoSyxjQUFjLE9BQU8seUhBQXlILHVDQUF1QztBQUNyTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0Esb0JBQW9CO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsaU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lXG5cbiAgICAgICAgaWYgKHRoaXMubGF5ZXJzKSB7XG4gICAgICAgICAgICB2YXIgbGF5ZXJzID0gdGhpcy5sYXllcnM7XG4gICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gbGF5ZXJzKSB7XG4gICAgICAgICAgICAgICAgaWYgKGxheWVycy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJ0cyA9IGtleS5zcGxpdChcIiRcIik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXllck5hbWUgPT09IHBhcnRzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFydHNbMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VydmljZVBhcnRzTGF5ZXIgPSBwYXJ0c1sxXS5zcGxpdChcIjpcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcnZpY2VQYXJ0c1NlcnZpY2UgPSBwYXJ0c1sxXS5zcGxpdChcIjtcIik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VydmljZVBhcnRzU2VydmljZVsxXSA9PT0gc2VydmljZS50b1VwcGVyQ2FzZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheWVySWQgPSBrZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VydmljZVBhcnRzTGF5ZXJbMl0gPT09IHNlcnZpY2UudG9VcHBlckNhc2UoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXllcklkID0ga2V5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICA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kgJiYgT2JqZWN0LmtleXModGhpcy5sYXllcnMpLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgLy8gZ2V0IHRoZSBsYXllcklkIG9mIHRoZSBsYXllclxuICAgICAgICAgICAgdmFyIGxheWVySWQgPSB0aGlzLmdldExheWVySWQobGF5ZXJOYW1lLCBzZXJ2aWNlKTtcblxuICAgICAgICAgICAgaWYgKGxheWVySWQpIHtcbiAgICAgICAgICAgICAgICAvLyBnZXQgdGhlIGxheWVyIENvbmYgT2JqZWN0XG4gICAgICAgICAgICAgICAgdmFyIGxheWVyQ29uZiA9IHRoaXMuZ2V0TGF5ZXJDb25mKGxheWVySWQpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGtleXMgPSB0aGlzLmdldExheWVyS2V5KGxheWVySWQpO1xuICAgICAgICAgICAgICAgIGlmIChrZXlzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gZ2V0IHNlcnZpY2VzIHBhcmFtc1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IG9uZSBzZXJ2ZXJVcmwgaXMgc2F2ZWQgaW4gR3AuQ29uZmlnIDogd2l0aCBtdWx0aUtleXMsIHdlIGhhdmUgdG8gcmV0cmlldmUgdGhlIGtleSB1c2VkIGluIHRoZSBzZXJ2ZXJVcmwgcHJvcGVydHlcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnNlcnZlclVybFtrZXlzW2ldXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnVybCA9IGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnNlcnZlclVybFtrZXlzW2ldXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IHdtc1R5cGVSZWdleCA9IC9cXC92XFwvLztcbiAgICAgICAgICAgICAgICAvLyBXTVMgdmVjdG9yIHN0eWxlIGFsd2F5cyBlbXB0eSAobm90IGluIGdldENhcClcbiAgICAgICAgICAgICAgICBpZiAod21zVHlwZVJlZ2V4LnRlc3QocGFyYW1zLnVybCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnN0eWxlcyA9IFwiXCI7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gV01TIHJhc3RlciBzdHlsZSBpcyBkZWZpbmVkIGluIGdldENhcFxuICAgICAgICAgICAgICAgICAgICBwYXJhbXMuc3R5bGVzID0gbGF5ZXJDb25mLnN0eWxlc1swXS5uYW1lO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHBhcmFtcy52ZXJzaW9uID0gbGF5ZXJDb25mLnNlcnZpY2VQYXJhbXMudmVyc2lvbjtcbiAgICAgICAgICAgICAgICBwYXJhbXMuZm9ybWF0ID0gbGF5ZXJDb25mLmZvcm1hdHNbMF0ubmFtZTtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHJvamVjdGlvbiA9IGxheWVyQ29uZi5kZWZhdWx0UHJvamVjdGlvbjtcblxuICAgICAgICAgICAgICAgIC8vIGdldCBsYXllciBpbmZvIGFuZCBjb25zdHJhaW50c1xuICAgICAgICAgICAgICAgIHBhcmFtcy5taW5TY2FsZSA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50Lm1pblNjYWxlRGVub21pbmF0b3I7XG4gICAgICAgICAgICAgICAgcGFyYW1zLm1heFNjYWxlID0gbGF5ZXJDb25mLmdsb2JhbENvbnN0cmFpbnQubWF4U2NhbGVEZW5vbWluYXRvcjtcbiAgICAgICAgICAgICAgICBwYXJhbXMuZXh0ZW50ID0gbGF5ZXJDb25mLmdsb2JhbENvbnN0cmFpbnQuYmJveDtcbiAgICAgICAgICAgICAgICBwYXJhbXMubGVnZW5kcyA9IGxheWVyQ29uZi5sZWdlbmRzO1xuICAgICAgICAgICAgICAgIHBhcmFtcy50aXRsZSA9IGxheWVyQ29uZi50aXRsZTtcbiAgICAgICAgICAgICAgICBwYXJhbXMuZGVzY3JpcHRpb24gPSBsYXllckNvbmYuZGVzY3JpcHRpb247XG5cbiAgICAgICAgICAgICAgICBpZiAoc2VydmljZSA9PT0gXCJXTVNcIikge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXMubWV0YWRhdGEgPSBsYXllckNvbmYubWV0YWRhdGE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gSW5mb3JtYXRpb25zICBub24gZGlzcG9uaWJsZXMgYXZlYyBsZXMgZ2V0Q2FwXG4gICAgICAgICAgICAgICAgLy8gcGFyYW1zLm1ldGFkYXRhID0gbGF5ZXJDb25mLmdldE1ldGFkYXRhKCk7XG4gICAgICAgICAgICAgICAgLy8gcGFyYW1zLm9yaWdpbmF0b3JzID0gbGF5ZXJDb25mLmdldE9yaWdpbmF0b3JzKCk7XG4gICAgICAgICAgICAgICAgLy8gcGFyYW1zLnF1aWNrbG9va1VybCA9IGxheWVyQ29uZi5nZXRRdWlja2xvb2tVcmwoKTtcblxuICAgICAgICAgICAgICAgIC8vIFdNVFMgOiBnZXQgdGhlIHRpbGVNYXRyaXhTZXRMaW1pdHNcbiAgICAgICAgICAgICAgICBpZiAobGF5ZXJDb25mLndtdHNPcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcmFtcy50aWxlTWF0cml4U2V0TGltaXRzID0gbGF5ZXJDb25mLndtdHNPcHRpb25zLnRpbGVNYXRyaXhTZXRMaW1pdHM7XG4gICAgICAgICAgICAgICAgICAgIHZhciBUTVNMaW5rID0gbGF5ZXJDb25mLndtdHNPcHRpb25zLnRpbGVNYXRyaXhTZXRMaW5rO1xuICAgICAgICAgICAgICAgICAgICBpZiAoVE1TTGluaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLlRNU0xpbmsgPSBUTVNMaW5rO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRtc0NvbmYgPSB0aGlzLmdldFRNU0NvbmYoVE1TTGluayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgbWF0cml4IG9yaWdpbiA6IEdwLlBvaW50ID0gT2JqZWN0e3g6RmxvYXQsIHk6RmxvYXR9XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBwYXJhbXMubWF0cml4T3JpZ2luID0gdG1zQ29uZi5nZXRUb3BMZWZ0Q29ybmVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMubWF0cml4SWRzID0gT2JqZWN0LmtleXModG1zQ29uZi50aWxlTWF0cmljZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnRpbGVNYXRyaWNlcyA9IHRtc0NvbmYudGlsZU1hdHJpY2VzO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnkgZGVmYXVsdCwgcHNldWRvIG1lcmNhdG9yIHJlc29sdXRpb25zXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMubmF0aXZlUmVzb2x1dGlvbnMgPSB0bXNDb25mLm5hdGl2ZVJlc29sdXRpb25zIHx8IHRoaXMuZ2V0VE1TQ29uZihcIlBNXCIpLm5hdGl2ZVJlc29sdXRpb25zO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBwYXJhbXM7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIEdldCB0aGUgY29udHJhY3Qga2V5KHMpIGFzc29jaWF0ZWQgdG8gYSBnaXZlbiBsYXllci5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7U3RyaW5nfSBsYXllcklkIC0gR2VvcG9ydGFsIGxheWVyIGlkZW50aWZpZXIgKGUuZy4gXCJHRU9HUkFQSElDQUxHUklEU1lTVEVNUy5NQVBTJEdFT1BPUlRBSUw6T0dDOldNVFNcIilcbiAgICAgKiBAcmV0dXJuIHtBcnJheX0gbGF5ZXJLZXkgLSBhcnJheSBvZiBrZXkocykgYXNzb2NpYXRlZCB0byB0aGUgZ2l2ZW4gbGF5ZXJcbiAgICAgKi9cbiAgICBnZXRMYXllcktleSA6IGZ1bmN0aW9uIChsYXllcklkKSB7XG4gICAgICAgIHZhciBsYXllcktleSA9IFtdO1xuICAgICAgICBpZiAodGhpcy5nZW5lcmFsT3B0aW9ucyAmJiB0aGlzLmdlbmVyYWxPcHRpb25zLmFwaUtleXMgJiYgT2JqZWN0LmtleXModGhpcy5nZW5lcmFsT3B0aW9ucy5hcGlLZXlzKS5sZW5ndGggIT09IDApIHtcbiAgICAgICAgICAgIHZhciByZXNvdXJjZXNCeUtleSA9IHRoaXMuZ2VuZXJhbE9wdGlvbnMuYXBpS2V5cztcbiAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiByZXNvdXJjZXNCeUtleSkge1xuICAgICAgICAgICAgICAgIHZhciByZXNvdXJjZXNBcnJheSA9IHJlc291cmNlc0J5S2V5W2tleV07XG4gICAgICAgICAgICAgICAgcmVzb3VyY2VzQXJyYXkuZm9yRWFjaChmdW5jdGlvbiAoYXJyYXlMYXllcklkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhcnJheUxheWVySWQgPT09IGxheWVySWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxheWVyS2V5LnB1c2goa2V5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBsYXllcktleTtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyBhbiBhc3NvY2lhdGl2ZSBhcnJheSBvZiBUaWxlIE1hdHJpeCBTZX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50ID0gbGF5ZXJDb25mLmdsb2JhbENvbnN0cmFpbnQuYmJveDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBwYXJhbXM7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBDb25maWdJbnRlcmZhY2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Response object for {@link module:Services~getConfig Gp.Services.getConfig ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Object} generalOptions - General properties for default map configuration resources.\n * @property {Object} generalOptions.apiKeys - Object that associates apiKey (s) with an array of resources IDs availables with that key.\n * @property {String} generalOptions.title - Underlying web service Title.\n * @property {String} generalOptions.defaultGMLGFIStyle - XSL URL used by default to translate an XML GetFeatureInfo response into an HTML array.\n * @property {String} generalOptions.theme - default theme (FIXME : for what ?)\n * @property {Array.} generalOptions.wgs84Resolutions - geographical resolutions Array for each [zoom level of the Geoportal platform]{@link http://api.ign.fr/tech-docs-js/webmaster/layers.html#Geoportal_resolutions} from 0 to 21. Expressed in degrees/pixel.\n * @property {Object} layers - Associative array mapping resources availables IDs (keys) with their properties (values given as {@link Gp.Services.Config.Layer}).\n * @property {Object} tileMatrixSets - Associative Array mapping TileMatrixSets IDs (keys) availables with their properties (values given as {@link Gp.Services.Config.TileMatrixSet}).\n *\n * @namespace\n * @alias Gp.Services.GetConfigInterface\n */\nfunction ConfigInterface () {\n if (!(this instanceof ConfigInterface)) {\n throw new TypeError(\"ConfigInterface constructor cannot be called as a function.\");\n }\n\n this.generalOptions = {\n apiKeys : {},\n title : null,\n defaultGMLGFIStyle : null,\n theme : null,\n wgs84Resolutions : []\n };\n\n this.layers = {};\n\n this.tileMatrixSets = {};\n}\n\nConfigInterface.prototype = {\n\n /*\n * Constructor (alias)\n */\n constructor : ConfigInterface,\n\n /**\n * Check if config is loaded for a given key\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Boolean} isKeyConfLoaded - true if config of the key is already loaded, false otherwise\n */\n isKeyConfLoaded : function (apiKey) {\n if (!apiKey) {\n return;\n }\n if (this.generalOptions.apiKeys[apiKey]) {\n return true;\n }\n return false;\n },\n\n /**\n * Returns an array of Geoportal layers identifiers, corresponding to an API contract key.\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Array} apiKeys - Array of geoportal layers identifiers\n */\n getLayersId : function (apiKey) {\n return this.generalOptions.apiKeys[apiKey];\n },\n\n /**\n * Returns the id of a Geoportal layer with its name and its service.\n *\n * @param {String} layerName - name of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {String} service - name of the service (ex. \"WMS\" ou \"WMTS\")\n * @returns {String} Id of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS\")\n */\n getLayerId : function (layerName, service) {\n if (!layerName || !service) {\n return;\n }\n var layerId = null;\n\n // layer\n // key : [layerName]$[contexte]:OGC:[service]\n // ex : \"ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS\"\n\n // service\n // key : [layerName]$[contexte];[service]\n // ex : PositionOfInterest$OGC:OPENLS;ReverseGeocode\n\n if (this.layers) {\n var layers = this.layers;\n for (var key in layers) {\n if (layers.hasOwnProperty(key)) {\n var parts = key.split(\"$\");\n if (layerName === parts[0]) {\n if (parts[1]) {\n var servicePartsLayer = parts[1].split(\":\");\n var servicePartsService = parts[1].split(\";\");\n\n if (servicePartsService[1] === service.toUpperCase()) {\n layerId = key;\n break;\n }\n if (servicePartsLayer[2] === service.toUpperCase()) {\n layerId = key;\n break;\n }\n }\n }\n }\n }\n }\n if (!layerId) {\n return;\n }\n return layerId;\n },\n\n /**\n * Returns an associative array of Geoportal layers configurations, corresponding to an API contract key.\n * If no key is specified, all layers from configuration are returned.\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Object} layers - Object which properties are layers identifiers.\n */\n getLayersConf : function (apiKey) {\n var layers = {};\n var layersIdArray = this.getLayersId(apiKey);\n if (layersIdArray) {\n for (var i = 0; i < layersIdArray.length; i++) {\n var lyrId = layersIdArray[i];\n layers[lyrId] = this.layers[lyrId];\n }\n }\n return layers;\n },\n\n /**\n * Returns a geoportal layer configuration, given its identifier\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @return {Object} layer - Layer configuration\n */\n getLayerConf : function (layerId) {\n if (!this.layers) {\n return;\n }\n return this.layers[layerId];\n },\n\n /**\n * Get all parameters needed to display a WMS or WMTS layer given its name, its service and its key\n *\n * @param {String} layerName - name of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {String} service - name of the service (ex. \"WMS\" ou \"WMTS\")\n * @param {String} [apiKey] - Contract API key\n * @returns {Object} params - params of the service (WMS or WMTS) for the given layer\n * @returns {String} params.url - Url of the service to reach to display the layer\n * @returns {String} params.version - Version of the service\n * @returns {String} params.styles - Default style of the layer\n * @returns {String} params.format - Default format of the layer\n * @returns {String} params.projection - Default projection of the layer\n * @returns {Number} params.minScale - Min scale denominator of the layer\n * @returns {Number} params.maxScale - Max scale denominator of the layer\n * @returns {Gp.BBox} params.extent - Extent of the layer, in the projection of the layer\n * @returns {Array} params.legends - Array of legends associated to the layer\n * @returns {Array} params.title - Name of the layer, readable by a human\n * @returns {Array} params.description - Description of the layer\n * @returns {String} params.[TMSLink] - Id of the Tile Matrix Set (TMS), in the case of WMTS layer\n * @returns {Gp.Point} params.[matrixOrigin] - Originof the tile matrix (top left corner), in the case of WMTS layer\n * @returns {Array} params.[nativeResolutions] - Array with the resolution of each level of the tile matrix set, in the case of WMTS layer\n * @returns {Array} params.[matrixIds] - Array with the ID of each level of the tile matrix set, in the case of WMTS layer\n */\n getLayerParams : function (layerName, service) {\n var params = {};\n\n if ((service === \"WMS\" || Object.keys(this.tileMatrixSets).length !== 0) && Object.keys(this.layers).length !== 0) {\n // get the layerId of the layer\n var layerId = this.getLayerId(layerName, service);\n\n if (layerId) {\n // get the layer Conf Object\n var layerConf = this.getLayerConf(layerId);\n\n var keys = this.getLayerKey(layerId);\n if (keys.length === 0) {\n return;\n }\n\n // get services params\n for (var i = 0; i < keys.length; i++) {\n // only one serverUrl is saved in Gp.Config : with multiKeys, we have to retrieve the key used in the serverUrl property\n if (layerConf.serviceParams.serverUrl[keys[i]]) {\n params.url = layerConf.serviceParams.serverUrl[keys[i]];\n }\n }\n\n const wmsTypeRegex = /\\/v\\//;\n // WMS vector style always empty (not in getCap)\n if (wmsTypeRegex.test(params.url)) {\n params.styles = \" \";\n } else {\n // WMS raster style is defined in getCap\n params.styles = layerConf.styles[0].name;\n }\n\n params.version = layerConf.serviceParams.version;\n params.format = layerConf.formats[0].name;\n params.projection = layerConf.defaultProjection;\n\n // get layer info and constraints\n params.minScale = layerConf.globalConstraint.minScaleDenominator;\n params.maxScale = layerConf.globalConstraint.maxScaleDenominator;\n params.extent = layerConf.globalConstraint.bbox;\n params.legends = layerConf.legends;\n params.title = layerConf.title;\n params.description = layerConf.description;\n\n if (service === \"WMS\") {\n params.metadata = layerConf.metadata;\n }\n\n // Informations non disponibles avec les getCap\n // params.metadata = layerConf.getMetadata();\n // params.originators = layerConf.getOriginators();\n // params.quicklookUrl = layerConf.getQuicklookUrl();\n\n // WMTS : get the tileMatrixSetLimits\n if (layerConf.wmtsOptions) {\n params.tileMatrixSetLimits = layerConf.wmtsOptions.tileMatrixSetLimits;\n var TMSLink = layerConf.wmtsOptions.tileMatrixSetLink;\n if (TMSLink) {\n params.TMSLink = TMSLink;\n var tmsConf = this.getTMSConf(TMSLink);\n // Get matrix origin : Gp.Point = Object{x:Float, y:Float}\n // params.matrixOrigin = tmsConf.getTopLeftCorner();\n params.matrixIds = Object.keys(tmsConf.tileMatrices);\n params.tileMatrices = tmsConf.tileMatrices;\n // by default, pseudo mercator resolutions\n params.nativeResolutions = tmsConf.nativeResolutions || this.getTMSConf(\"PM\").nativeResolutions;\n }\n }\n }\n }\n return params;\n },\n\n /**\n * Get the contract key(s) associated to a given layer.\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @return {Array} layerKey - array of key(s) associated to the given layer\n */\n getLayerKey : function (layerId) {\n var layerKey = [];\n if (this.generalOptions && this.generalOptions.apiKeys && Object.keys(this.generalOptions.apiKeys).length !== 0) {\n var resourcesByKey = this.generalOptions.apiKeys;\n for (var key in resourcesByKey) {\n var resourcesArray = resourcesByKey[key];\n resourcesArray.forEach(function (arrayLayerId) {\n if (arrayLayerId === layerId) {\n layerKey.push(key);\n }\n });\n }\n }\n return layerKey;\n },\n\n /**\n * Returns an associative array of Tile Matrix Sets configurations.\n *\n * @return {Object} tileMatrixSets - Object which properties are TMS identifiers\n *\n */\n getTileMatrixSets : function () {\n return this.tileMatrixSets;\n },\n\n /**\n * Returns a Tile Matrix Sets configuration, given its identifier.\n *\n * @param {String} tmsID - Tile Matrix Set identifier (e.g. : \"PM\")\n * @return {Object} tileMatrixSet - Tile Matrix Set configuration\n */\n getTMSConf : function (tmsID) {\n if (!this.tileMatrixSets) {\n return;\n }\n return this.tileMatrixSets[tmsID];\n },\n\n /**\n * Get global constraints for a given Layer : extent, minScale, maxScale, projection\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @returns {Object} params - layer constraints\n * @returns {String} params.projection - default layer projection\n * @returns {Number} params.minScale - layer min scale denominator\n * @returns {Number} params.maxScale - layer max scale denominator\n * @returns {Gp.BBox} params.extent - layer extent expressed in the layer projection\n */\n getGlobalConstraints : function (layerId) {\n var params = {};\n\n if (layerId) {\n // get layer configuration object\n var layerConf = this.getLayerConf(layerId);\n params.projection = layerConf.defaultProjection;\n params.minScale = layerConf.globalConstraint.minScaleDenominator;\n params.maxScale = layerConf.globalConstraint.maxScaleDenominator;\n params.extent = layerConf.globalConstraint.bbox;\n }\n\n return params;\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ConfigInterface);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQ29uZmlnL0NvbmZpZ0ludGVyZmFjZS5qcz83NDM1Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0E7QUFDQSx3QkFBd0IseURBQXlEO0FBQ2pGO0FBQ0EsY0FBYyxPQUFPO0FBQ3JCLGNBQWMsT0FBTztBQUNyQixjQUFjLE9BQU87QUFDckIsY0FBYyxPQUFPO0FBQ3JCLGNBQWMsT0FBTztBQUNyQixjQUFjLGNBQWMsa0hBQWtILGlGQUFpRjtBQUMvTixjQUFjLE9BQU8sNEdBQTRHLCtCQUErQjtBQUNoSyxjQUFjLE9BQU8seUhBQXlILHVDQUF1QztBQUNyTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0Esb0JBQW9CO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsaUJBQWlCLFFBQVE7QUFDekI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSzs7QUFFTDtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsaUJBQWlCLE1BQU07QUFDdkI7QUFDQTtBQ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25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJ0cyA9IGtleS5zcGxpdChcIiRcIik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXllck5hbWUgPT09IHBhcnRzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFydHNbMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VydmljZVBhcnRzTGF5ZXIgPSBwYXJ0c1sxXS5zcGxpdChcIjpcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcnZpY2VQYXJ0c1NlcnZpY2UgPSBwYXJ0c1sxXS5zcGxpdChcIjtcIik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VydmljZVBhcnRzU2VydmljZVsxXSA9PT0gc2VydmljZS50b1VwcGVyQ2FzZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheWVySWQgPSBrZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VydmljZVBhcnRzTGF5ZXJbMl0gPT09IHNlcnZpY2UudG9VcHBlckNhc2UoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXllcklkID0ga2V5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFsYXllcklkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGxheWVySWQ7XG4gICAgfSx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ZXJ2aWNlKTtcblxuICAgICAgICAgICAgaWYgKGxheWVySWQpIHtcbiAgICAgICAgICAgICAgICAvLyBnZXQgdGhlIGxheWVyIENvbmYgT2JqZWN0XG4gICAgICAgICAgICAgICAgdmFyIGxheWVyQ29uZiA9IHRoaXMuZ2V0TGF5ZXJDb25mKGxheWVySWQpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGtleXMgPSB0aGlzLmdldExheWVyS2V5KGxheWVySWQpO1xuICAgICAgICAgICAgICAgIGlmIChrZXlzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gZ2V0IHNlcnZpY2VzIHBhcmFtc1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IG9uZSBzZXJ2ZXJVcmwgaXMgc2F2ZWQgaW4gR3AuQ29uZmlnIDogd2l0aCBtdWx0aUtleXMsIHdlIGhhdmUgdG8gcmV0cmlldmUgdGhlIGtleSB1c2VkIGluIHRoZSBzZXJ2ZXJVcmwgcHJvcGVydHlcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnNlcnZlclVybFtrZXlzW2ldXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnVybCA9IGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnNlcnZlclVybFtrZXlzW2ldXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IHdtc1R5cGVSZWdleCA9IC9cXC92XFwvLztcbiAgICAgICAgICAgICAgICAvLyBXTVMgdmVjdG9yIHN0eWxlIGFsd2F5cyBlbXB0eSAobm90IGluIGdldENhcClcbiAgICAgICAgICAgICAgICBpZiAod21zVHlwZVJlZ2V4LnRlc3QocGFyYW1zLnVybCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnN0eWxlcyA9IFwiIFwiO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdNUyByYXN0ZXIgc3R5bGUgaXMgZGVmaW5lZCBpbiBnZXRDYXBcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnN0eWxlcyA9IGxheWVyQ29uZi5zdHlsZXNbMF0ubmFtZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBwYXJhbXMudmVyc2lvbiA9IGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnZlcnNpb247XG4gICAgICAgICAgICAgICAgcGFyYW1zLmZvcm1hdCA9IGxheWVyQ29uZi5mb3JtYXRzWzBdLm5hbWU7XG4gICAgICAgICAgICAgICAgcGFyYW1zLnByb2plY3Rpb24gPSBsYXllckNvbmYuZGVmYXVsdFByb2plY3Rpb247XG5cbiAgICAgICAgICAgICAgICAvLyBnZXQgbGF5ZXIgaW5mbyBhbmQgY29uc3RyYWludHNcbiAgICAgICAgICAgICAgICBwYXJhbXMubWluU2NhbGUgPSBsYXllckNvbmYuZ2xvYmFsQ29uc3RyYWludC5taW5TY2FsZURlbm9taW5hdG9yO1xuICAgICAgICAgICAgICAgIHBhcmFtcy5tYXhTY2FsZSA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50Lm1heFNjYWxlRGVub21pbmF0b3I7XG4gICAgICAgICAgICAgICAgcGFyYW1zLmV4dGVudCA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50LmJib3g7XG4gICAgICAgICAgICAgICAgcGFyYW1zLmxlZ2VuZHMgPSBsYXllckNvbmYubGVnZW5kcztcbiAgICAgICAgICAgICAgICBwYXJhbXMudGl0bGUgPSBsYXllckNvbmYudGl0bGU7XG4gICAgICAgICAgICAgICAgcGFyYW1zLmRlc2NyaXB0aW9uID0gbGF5ZXJDb25mLmRlc2NyaXB0aW9uO1xuXG4gICAgICAgICAgICAgICAgaWYgKHNlcnZpY2UgPT09IFwiV01TXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zLm1ldGFkYXRhID0gbGF5ZXJDb25mLm1ldGFkYXRhO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIEluZm9ybWF0aW9ucyAgbm9uIGRpc3BvbmlibGVzIGF2ZWMgbGVzIGdldENhcFxuICAgICAgICAgICAgICAgIC8vIHBhcmFtcy5tZXRhZGF0YSA9IGxheWVyQ29uZi5nZXRNZXRhZGF0YSgpO1xuICAgICAgICAgICAgICAgIC8vIHBhcmFtcy5vcmlnaW5hdG9ycyA9IGxheWVyQ29uZi5nZXRPcmlnaW5hdG9ycygpO1xuICAgICAgICAgICAgICAgIC8vIHBhcmFtcy5xdWlja2xvb2tVcmwgPSBsYXllckNvbmYuZ2V0UXVpY2tsb29rVXJsKCk7XG5cbiAgICAgICAgICAgICAgICAvLyBXTVRTIDogZ2V0IHRoZSB0aWxlTWF0cml4U2V0TGltaXRzXG4gICAgICAgICAgICAgICAgaWYgKGxheWVyQ29uZi53bXRzT3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXMudGlsZU1hdHJpeFNldExpbWl0cyA9IGxheWVyQ29uZi53bXRzT3B0aW9ucy50aWxlTWF0cml4U2V0TGltaXRzO1xuICAgICAgICAgICAgICAgICAgICB2YXIgVE1TTGluayA9IGxheWVyQ29uZi53bXRzT3B0aW9ucy50aWxlTWF0cml4U2V0TGluaztcbiAgICAgICAgICAgICAgICAgICAgaWYgKFRNU0xpbmspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5UTVNMaW5rID0gVE1TTGluaztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXNDb25mID0gdGhpcy5nZXRUTVNDb25mKFRNU0xpbmspO1xuICAgICAgICAgICA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V5KHMpIGFzc29jaWF0ZWQgdG8gdGhlIGdpdmVuIGxheWVyXG4gICAgICovXG4gICAgZ2V0TGF5ZXJLZXkgOiBmdW5jdGlvbiAobGF5ZXJJZCkge1xuICAgICAgICB2YXIgbGF5ZXJLZXkgPSBbXTtcbiAgICAgICAgaWYgKHRoaXMuZ2VuZXJhbE9wdGlvbnMgJiYgdGhpcy5nZW5lcmFsT3B0aW9ucy5hcGlLZXlzICYmIE9iamVjdC5rZXlzKHRoaXMuZ2VuZXJhbE9wdGlvbnMuYXBpS2V5cykubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgICB2YXIgcmVzb3VyY2VzQnlLZXkgPSB0aGlzLmdlbmVyYWxPcHRpb25zLmFwaUtleXM7XG4gICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gcmVzb3VyY2VzQnlLZXkpIHtcbiAgICAgICAgICAgICAgICB2YXIgcmVzb3VyY2VzQXJyYXkgPSByZXNvdXJjZXNCeUtleVtrZXldO1xuICAgICAgICAgICAgICAgIHJlc291cmNlc0FycmF5LmZvckVhY2goZnVuY3Rpb24gKGFycmF5TGF5ZXJJZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYXJyYXlMYXllcklkID09PSBsYXllcklkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXllcktleS5wdXNoKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbGF5ZXJLZXk7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYW4gYXNzb2NpYXRpdmUgYXJyYXkgb2YgVGlsZSBNYXRyaXggU2V0cyBjb25maWd1cmF0aW9ucy5cbiAgICAgKlxuICAgICAqIEByZXR1cm4ge09iamVjdH0gdGlsZU1hdHJpeFNldHMgLSBPYmplY3Qgd2hpY2ggcHJvcGVydGllcyBhcmUgVE1TIGlkZW50aW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jdGlvbiAtIGRlZmF1bHQgbGF5ZXIgcHJvamVjdGlvblxuICAgICAqIEByZXR1cm5zIHtOdW1iZXJ9IHBhcmFtcy5taW5TY2FsZSAgIC0gbGF5ZXIgbWluIHNjYWxlIGRlbm9taW5hdG9yXG4gICAgICogQHJldHVybnMge051bWJlcn0gcGFyYW1zLm1heFNjYWxlICAgLSBsYXllciBtYXggc2NhbGUgZGVub21pbmF0b3JcbiAgICAgKiBAcmV0dXJucyB7R3AuQkJveH0gcGFyYW1zLmV4dGVudCAgICAtIGxheWVyIGV4dGVudCBleHByZXNzZWQgaW4gdGhlIGxheWVyIHByb2plY3Rpb25cbiAgICAgKi9cbiAgICBnZXRHbG9iYWxDb25zdHJhaW50cyA6IGZ1bmN0aW9uIChsYXllcklkKSB7XG4gICAgICAgIHZhciBwYXJhbXMgPSB7fTtcblxuICAgICAgICBpZiAobGF5ZXJJZCkge1xuICAgICAgICAgICAgLy8gZ2V0IGxheWVyIGNvbmZpZ3VyYXRpb24gb2JqZWN0XG4gICAgICAgICAgICB2YXIgbGF5ZXJDb25mID0gdGhpcy5nZXRMYXllckNvbmYobGF5ZXJJZCk7XG4gICAgICAgICAgICBwYXJhbXMucHJvamVjdGlvbiA9IGxheWVyQ29uZi5kZWZhdWx0UHJvamVjdGlvbjtcbiAgICAgICAgICAgIHBhcmFtcy5taW5TY2FsZSA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50Lm1pblNjYWxlRGVub21pbmF0b3I7XG4gICAgICAgICAgICBwYXJhbXMubWF4U2NhbGUgPSBsYXllckNvbmYuZ2xvYmFsQ29uc3RyYWludC5tYXhTY2FsZURlbm9taW5hdG9yO1xuICAgICAgICAgICAgcGFyYW1zLmV4dGVudCA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50LmJib3g7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcGFyYW1zO1xuICAgIH1cblxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29uZmlnSW50ZXJmYWNlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js\n"); /***/ }), @@ -499,7 +511,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Response object for /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n// cette classe contient les URLs par defaut des services.\n// DefaultUrlService.Alti.url(key)[elevation-json]\n// DefaultUrlService.Alti.url(key)[elevation-xml]\n// DefaultUrlService.Alti.url(key)[profil-json]\n// DefaultUrlService.Alti.url(key)[profil-xml]\n// DefaultUrlService.Alti.url(key)[wps]\n// DefaultUrlService.ProcessIsoCurve.url(key)\n// DefaultUrlService.AutoComplete.url(key)\n// DefaultUrlService.ReverseGeocode.url(key)\n// DefaultUrlService.Geocode.url(key)\n// DefaultUrlService.Route.url(key)\n\n// Example :\n//\n// DefaultUrlService.Alti.url('alti')[elevation-json]\n// output {String} -> http://wxs.ign.fr/calcul/alti/rest/elevation.json\n//\n// DefaultUrlService.Alti.url('calcul')\n// output {Object|String}\n// -> http://wxs.ign.fr/calcul/alti/rest/elevation.json\n// -> http://wxs.ign.fr/calcul/alti/rest/elevation.xml\n// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.json\n// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.xml\n// -> http://wxs.ign.fr/calcul/alti/wps\n//\n// ssl by default.\n//\n// Force to not do ssl :\n// DefaultUrlService.ssl = false;\n//\n// DefaultUrlService.AutoComplete.url('calcul')\n// output {Object|String}\n// -> https://wxs.ign.fr/calcul/ols/apis/completion\n\n// constantes internes\nvar HOSTNAME = \"wxs.ign.fr\";\n\n/**\n * Default Geoportal web services URLs access.\n *\n * @namespace\n * @alias Gp.Services.DefaultUrl\n */\nvar DefaultUrlService = {\n\n /** if set true, require the use of https protocol */\n ssl : true,\n\n /**\n * base url of services (ssl protocol management)\n * @param {String} key - key\n * @param {String} path - path\n * @returns {String} url\n */\n url : function (key, path) {\n // comportement par défaut => https\n // sinon, il est fixé par l'option 'ssl' (false => http)\n var _protocol;\n if (DefaultUrlService.ssl === false) {\n _protocol = \"http://\";\n } else {\n _protocol = \"https://\";\n }\n\n return _protocol + HOSTNAME.concat(\"/\", key, path);\n },\n\n /**\n * Elevation web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns elevation service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols (\"elevation-json\", \"elevation-xml\", \"profil-json\" or \"profil-xml\").\n */\n Alti : {\n _key : {\n // rest\n \"elevation-json\" : \"/alti/rest/elevation.json\",\n \"elevation-xml\" : \"/alti/rest/elevation.xml\",\n \"profil-json\" : \"/alti/rest/elevationLine.json\",\n \"profil-xml\" : \"/alti/rest/elevationLine.xml\",\n // other\n wps : \"/alti/wps\"\n },\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n return {\n // rest\n \"elevation-json\" : DefaultUrlService.url(key, this._key[\"elevation-json\"]),\n \"elevation-xml\" : DefaultUrlService.url(key, this._key[\"elevation-xml\"]),\n \"profil-json\" : DefaultUrlService.url(key, this._key[\"profil-json\"]),\n \"profil-xml\" : DefaultUrlService.url(key, this._key[\"profil-xml\"]),\n // other\n wps : DefaultUrlService.url(key, this._key[\"wps\"])\n };\n }\n },\n /**\n * IsoCurve web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns isocurve service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols (\"iso-json\" or \"iso-xml\").\n */\n ProcessIsoCurve : {\n _key : \"/geoportail/isochrone/rest/1.0.0/isochrone\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n return DefaultUrlService.url(key, this._key);\n }\n },\n /**\n * Config web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns config service default urls with or without geoportal access key given as a parameter.\n */\n Config : {\n _key : \"https://raw.githubusercontent.com/IGNF/geoportal-configuration/main/dist/\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n // key must be an array of one or several keys\n if (!Array.isArray(key)) {\n key = key.split(\",\");\n }\n // not homogeneous with others geoportal services URLs\n var url = [];\n for (var i = 0; i < key.length; i++) {\n url[i] = this._key + key[i] + \"Config.json\";\n }\n return url;\n }\n },\n /**\n * Autocompletion web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns autocomplete service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n AutoComplete : {\n _key : \"/ols/apis/completion\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n return DefaultUrlService.url(key, this._key);\n }\n },\n /**\n * Reverse geocoding web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns reverse geocoding service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n ReverseGeocode : {\n _key : \"/geoportail/ols\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n return DefaultUrlService.url(key, this._key);\n }\n },\n /**\n * Geocoding web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns geocoding service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n Geocode : {\n _key : \"/geoportail/ols\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n return DefaultUrlService.url(key, this._key);\n }\n },\n /**\n * Routing web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns routing service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols.\n */\n Route : {\n _key : \"/geoportail/itineraire/rest/1.0.0/route\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n return DefaultUrlService.url(key, this._key);\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (DefaultUrlService);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6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VybChrZXksIHRoaXMuX2tleSk7XG4gICAgICAgIH1cbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBEZWZhdWx0VXJsU2VydmljZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n// cette classe contient les URLs par defaut des services.\n// DefaultUrlService.Alti.url(key)[elevation-json]\n// DefaultUrlService.Alti.url(key)[elevation-xml]\n// DefaultUrlService.Alti.url(key)[profil-json]\n// DefaultUrlService.Alti.url(key)[profil-xml]\n// DefaultUrlService.ProcessIsoCurve.url(key)\n// DefaultUrlService.AutoComplete.url(key)\n// DefaultUrlService.ReverseGeocode.url(key)\n// DefaultUrlService.Geocode.url(key)\n// DefaultUrlService.Route.url(key)\n\n// Example :\n//\n// DefaultUrlService.Alti.url('alti')[elevation-json]\n// output {String} -> http://wxs.ign.fr/calcul/alti/rest/elevation.json\n//\n// DefaultUrlService.Alti.url('calcul')\n// output {Object|String}\n// -> http://wxs.ign.fr/calcul/alti/rest/elevation.json\n// -> http://wxs.ign.fr/calcul/alti/rest/elevation.xml\n// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.json\n// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.xml\n//\n// ssl by default.\n//\n// Force to not do ssl :\n// DefaultUrlService.ssl = false;\n//\n// DefaultUrlService.AutoComplete.url('calcul')\n// output {Object|String}\n// -> https://wxs.ign.fr/calcul/ols/apis/completion\n\n// constantes internes\nvar HOSTNAME = \"wxs.ign.fr\";\n\n/**\n * Default Geoportal web services URLs access.\n *\n * @namespace\n * @alias Gp.Services.DefaultUrl\n */\nvar DefaultUrlService = {\n\n /** if set true, require the use of https protocol */\n ssl : true,\n\n /**\n * base url of services (ssl protocol management)\n * @param {String} path - path\n * @returns {String} url\n */\n url : function (path) {\n // comportement par défaut => https\n // sinon, il est fixé par l'option 'ssl' (false => http)\n var _protocol;\n if (DefaultUrlService.ssl === false) {\n _protocol = \"http://\";\n } else {\n _protocol = \"https://\";\n }\n\n return _protocol + HOSTNAME + path;\n },\n\n /**\n * base new-url of services (ssl protocol management)\n * @param {String} path - path\n * @returns {String} url\n */\n newUrl : function (path, hostname) {\n // comportement par défaut => https\n // sinon, il est fixé par l'option 'ssl' (false => http)\n var _protocol;\n if (DefaultUrlService.ssl === false) {\n _protocol = \"http://\";\n } else {\n _protocol = \"https://\";\n }\n\n return _protocol + hostname + path;\n },\n\n /**\n * Elevation web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns elevation service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols (\"elevation-json\", \"elevation-xml\", \"profil-json\" or \"profil-xml\").\n */\n Alti : {\n new_key : {\n // rest\n \"elevation-json\" : \"/altimetrie/1.0/calcul/alti/rest/elevation.json\",\n \"elevation-xml\" : \"/altimetrie/1.0/calcul/alti/rest/elevation.xml\",\n \"profil-json\" : \"/altimetrie/1.0/calcul/alti/rest/elevationLine.json\",\n \"profil-xml\" : \"/altimetrie/1.0/calcul/alti/rest/elevationLine.xml\"\n },\n _key : {\n // rest\n \"elevation-json\" : \"/calcul/alti/rest/elevation.json\",\n \"elevation-xml\" : \"/calcul/alti/rest/elevation.xml\",\n \"profil-json\" : \"/calcul/alti/rest/elevationLine.json\",\n \"profil-xml\" : \"/calcul/alti/rest/elevationLine.xml\",\n // other\n wps : \"/alti/wps\"\n },\n /**\n * newurl from geoplateforme service\n * @param {String} key - key\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n /**\n * url from wxs service\n * @returns {String} url\n */\n url : function () {\n return {\n // rest\n \"elevation-json\" : DefaultUrlService.url(this._key[\"elevation-json\"]),\n \"elevation-xml\" : DefaultUrlService.url(this._key[\"elevation-xml\"]),\n \"profil-json\" : DefaultUrlService.url(this._key[\"profil-json\"]),\n \"profil-xml\" : DefaultUrlService.url(this._key[\"profil-xml\"])\n };\n }\n },\n /**\n * IsoCurve web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns isocurve service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols (\"iso-json\" or \"iso-xml\").\n */\n ProcessIsoCurve : {\n\n new_key : \"/itineraire/isochrone\",\n\n _key : \"/calcul/geoportail/isochrone/rest/1.0.0/isochrone\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url from wxs service\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Config web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns config service default urls with or without geoportal access key given as a parameter.\n */\n Config : {\n _key : \"https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/dist/\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n // key must be an array of one or several keys\n if (!Array.isArray(key)) {\n key = key.split(\",\");\n }\n // not homogeneous with others geoportal services URLs\n var url = [];\n for (var i = 0; i < key.length; i++) {\n url[i] = this._key + key[i] + \"Config.json\";\n }\n return url;\n }\n },\n /**\n * Autocompletion web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns autocomplete service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n AutoComplete : {\n new_key : \"/completion\",\n\n _key : \"/calcul/geoportail/geocodage/rest/0.1/completion\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url\n * @returns {String} url\n */\n url : function (key) {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Reverse geocoding web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns reverse geocoding service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n ReverseGeocode : {\n new_key : \"/reverse\",\n\n _key : \"/calcul/geoportail/geocodage/rest/0.1/reverse\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Geocoding web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns geocoding service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n Geocode : {\n new_key : \"/search\",\n\n _key : \"/calcul/geoportail/geocodage/rest/0.1/search\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Routing web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns routing service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols.\n */\n Route : {\n new_key : \"/itineraire/route\",\n\n _key : \"/calcul/geoportail/itineraire/rest/1.0.0/route\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url from wxs service\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (DefaultUrlService);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvRGVmYXVsdFVybFNlcnZpY2UuanM/MzE5NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLFlBQVksT0FBTztBQUNuQjtBQUNBO0FBQ0EsV0FBVztBQUNYO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXO0FBQ1g7O0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Z1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfSxcbiAgICAgICAgLyoqXG4gICAgICAgICogdXJsIGZyb20gd3hzIHNlcnZpY2VcbiAgICAgICAgKiBAcmV0dXJucyB7U3RyaW5nfSB1cmxcbiAgICAgICAgKi9cbiAgICAgICAgdXJsIDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAvLyByZXN0XG4gICAgICAgICAgICAgICAgXCJlbGV2YXRpb24tanNvblwiIDogRGVmYXVsdFVybFNlcnZpY2UudXJsKHRoaXMuX2tleVtcImVsZXZhdGlvbi1qc29uXCJdKSxcbiAgICAgICAgICAgICAgICBcImVsZXZhdGlvbi14bWxcIiA6IERlZmF1bHRVcmxTZXJ2aWNlLnVybCh0aGlzLl9rZXlbXCJlbGV2YXRpb24teG1sXCJdKSxcbiAgICAgICAgICAgICAgICBcInByb2ZpbC1qc29uXCIgOiBEZWZhdWx0VXJsU2VydmljZS51cmwodGhpcy5fa2V5W1wicHJvZmlsLWpzb25cIl0pLFxuICAgICAgICAgICAgICAgIFwicHJvZmlsLXhtbFwiIDogRGVmYXVsdFVybFNlcnZpY2UudXJsKHRoaXMuX2tleVtcInByb2ZpbC14bWxcIl0pXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfSxcbiAgICAvKipcbiAgICAgKiBJc29DdXJ2ZSB3ZWIgc2VydmljZSBhY2Nlc3NcbiAgICAgKlxuICAgICAqIEBtZW1iZXIge09iamVjdH1cbiAgICAgKiBAcHJvcGVydHkge0Z1bmN0aW9ufSB1cmwgKGtleSkgLSBSZXR1cm5zIGlzb2N1cnZlIHNlcnZpY2UgZGVmYXVsdCB1cmxzIHdpdGggb3Igd2l0aG91dCBnZW9wb3J0YWwgYWNjZXNzIGtleSBnaXZlbiBhcyBhIHBhcmFtZXRlci4gVGhlIHJlc3VsdCBpcyBhIGphdmFzY3JpcHQgb2JqZWN0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BcImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9JR05GL2dlb3BvcnRhbC1jb25maWd1cmF0aW9uL25ldy11cmwvZGlzdC9cIixcbiAgICAgICAgLyoqXG4gICAgICAgICogdXJsXG4gICAgICAgICogQHBhcmFtIHtTdHJpbmd9IGtleSAtIGtleVxuICAgICAgICAqIEByZXR1cm5zIHtTdHJpbmd9IHVybFxuICAgICAgICAqL1xuICAgICAgICB1cmwgOiBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAvLyBrZXkgbXVzdCBiZSBhbiBhcnJheSBvZiBvbmUgb3Igc2V2ZXJhbCBrZXlzXG4gICAgICAgICAgICBpZiAoIUFycmF5LmlzQXJyYXkoa2V5KSkge1xuICAgICAgICAgICAgICAgIGtleSA9IGtleS5zcGxpdChcIixcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBub3QgaG9tb2dlbmVvdXMgd2l0aCBvdGhlcnMgZ2VvcG9ydGFsIHNlcnZpY2VzIFVSTHNcbiAgICAgICAgICAgIHZhciB1cmwgPSBbXTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwga2V5Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdXJsW2ldID0gdGhpcy5fa2V5ICsga2V5W2ldICsgXCJDb25maWcuanNvblwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHVybDtcbiAgICAgICAgfVxuICAgIH0sXG4gICAgLyoqXG4gICAgICogQXV0b2NvbXBsZXRpb24gd2ViIHNlcnZpY2UgYWNjZXNzXG4gICAgICpcbiAgICAgKiBAbWVtYmVyIHtPYmplY3R9XG4gICAgICogQHByb3BlcnR5IHtGdW5jdGlvbn0gdXJsIChrZXkpIC0gUmV0dXJucyBhdXRvY29tcGxldGUgc2VydmljZSBkZWZhdWx0IHVybHMgd2l0aCBvciB3aXRob3V0IGdlb3BvcnRhbCBhY2Nlc3Mga2V5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xuICAgICAgICBuZXdVcmwgOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICogdXJsIGZyb20gd3hzIHNlcnZpY2VcbiAgICAgICAgKiBAcmV0dXJucyB7U3RyaW5nfSB1cmxcbiAgICAgICAgKi9cbiAgICAgICAgdXJsIDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIERlZmF1bHRVcmxTZXJ2aWNlLnVybCh0aGlzLl9rZXkpO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgRGVmYXVsdFVybFNlcnZpY2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\n"); /***/ }), @@ -523,7 +535,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Request/GeocodeRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js\");\n/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Response/GeocodeResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js\");\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service de géocodage direct du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n *\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Geocode\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String|Object} options.query - Nom de l'adresse, du toponyme, de l'unité administrative ou de la parcelle cadastrale recherchée.\n *\n * @param {Object} [options.filters] - Les propriétés possibles de cet objet sont décrites ci-après.\n * @param {String} [options.filters.[prop]] - Critère supplémentaire pour filtrer la recherche sous la forme\n * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête.\n * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"city\".\n * Il permet également de filtrer les toponymes avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"type\".\n * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés :\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n *\n * @param {String} [options.index = \"StreetAddress\"] - Type de l'objet recherché.\n * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress'\n * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales.\n * L'index 'location' regroupe les indexes 'StreetAddress' et 'PositionOfInterest'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, index = 'StreetAddress'.\n *\n * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs.\n * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité.\n * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité.\n *\n * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut.\n * Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20.\n *\n * @param {Boolean} [options.returnTrueGeometry = false] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés.\n * false par défaut.\n *\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * proxyURL : null,\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * position : {lon:, lat:},\n * index : 'StreetAddress',\n * query : '10 rue du pont Machin-ville'\n * (...)\n * };\n */\nfunction Geocode (options_) {\n if (!(this instanceof Geocode)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Geocode\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"Geocode\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Geocode\");\n this.logger.trace(\"[Constructeur Geocode (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n options.serverUrl = options.serverUrl || \"https://wxs.ign.fr/calcul/geoportail/geocodage/rest/0.1/search\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, [options]);\n\n if (!options.hasOwnProperty(\"query\")) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"query\"));\n }\n\n // ajout des options spécifiques au service\n this.options.query = options.query;\n\n // on definit l'index par defaut\n if (!options.index) {\n this.options.index = options.index = \"StreetAddress\";\n }\n\n if (options.filters) {\n var filter = Object.keys(options.filters);\n for (var i = 0; i < filter.length; i++) {\n var key = filter[i];\n // on supprime les filtres vides\n if (typeof options.filters[key] === \"undefined\" ||\n (typeof options.filters[key] === \"object\" && Object.keys(options.filters[key]).length === 0) ||\n (typeof options.filters[key] === \"string\" && options.filters[key].length === 0) ||\n (Array.isArray(options.filters[key]) && options.filters[key].length === 0)\n ) {\n delete this.options.filters[key];\n }\n }\n }\n\n this.options.index = options.index || \"StreetAddress\";\n this.options.maximumResponses = options.maximumResponses || 20;\n}\n\n/**\n * @lends module:Geocode#\n */\nGeocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nGeocode.prototype.constructor = Geocode;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nGeocode.prototype.patchOptionConvertor = function (options_) {\n const options = options_;\n\n if (options.hasOwnProperty(\"location\")) {\n this.logger.warn(\"The parameter 'location' is deprecated\");\n\n if (!options.query) {\n options.query = options.location;\n }\n delete options.location;\n }\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (!options.filters) {\n options.filters = options.filterOptions;\n\n if (options.filters.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.index) {\n if (Array.isArray(options.filters.type) && options.filters.type.length > 0) {\n options.index = options.filters.type[0];\n } else {\n options.index = options.filters.type;\n }\n }\n delete options.filters.type;\n }\n\n if (options.filters.bbox) {\n this.logger.warn(\"The parameter 'filterOptions.bbox' is deprecated\");\n delete options.filters.bbox;\n }\n }\n delete options.filterOptions;\n }\n\n if (options.position) {\n if (options.position.x) {\n this.logger.warn(\"The parameter 'position.x' is deprecated\");\n\n if (!options.position.lon) {\n options.position.lon = options.position.x;\n }\n delete options.position.x;\n }\n\n if (options.position.y) {\n this.logger.warn(\"The parameter 'position.y' is deprecated\");\n\n if (!options.position.lat) {\n options.position.lat = options.position.y;\n }\n delete options.position.y;\n }\n }\n\n if (options.returnFreeForm) {\n this.logger.warn(\"The parameter 'returnFreeForm' is deprecated\");\n delete options.returnFreeForm;\n }\n\n if (options.srs) {\n this.logger.warn(\"The parameter 'srs' is deprecated\");\n delete options.srs;\n }\n\n return options;\n};\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nGeocode.prototype.buildRequest = function (error, success) {\n var options = {\n httpMethod : this.options.httpMethod,\n // options specifiques du service\n geocodeMethod : \"search\",\n query : this.options.query,\n index : this.options.index,\n returnTrueGeometry : this.options.returnTrueGeometry,\n position : this.options.position,\n maxResp : this.options.maximumResponses,\n filters : this.options.filters\n };\n\n this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * Analyse de la reponse (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nGeocode.prototype.analyzeResponse = function (error, success) {\n /* INFO :\n Etape 1 : Création de la requête (URL)\n -> stockage de la requête dans this.request\n Etape 2 : Envoi de la requête\n -> appel du protocol XHR, et envoi (par ex send ())\n -> récupération de la réponse JSON dans la fonction onSuccess () (this.response)\n -> si code HTTP 200 et pas de message d'erreur : etape 3\n -> si code HTTP != 200 : lancement de la fonction de callback onFailure avec le message d'erreur\n Etape 3 : Analyse de la réponse JSON (si rawResponse === false )\n -> appel du parser pour récupérer le document\n Etape 4 : Lancement de la fonction de callback onSuccess avec la réponse :\n -> JSON (si rawResponse === true)\n -> ou geocodedLocations\n */\n\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Geocode);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9HZW9jb2RlLmpzP2Q1NWQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBaUQ7QUFDSDtBQUNXO0FBQ1o7QUFDdUI7QUFDRzs7QUFFdkU7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLGNBQWM7QUFDekI7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGdCQUFnQixNQUFNO0FBQ3RCLGdCQ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AgICAgIHRoaXMubG9nZ2VyLndhcm4oXCJUaGUgcGFyYW1ldGVyICdmaWx0ZXJPcHRpb25zLnR5cGUnIGlzIGRlcHJlY2F0ZWRcIik7XG4gICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zLmluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9wdGlvbnMuZmlsdGVycy50eXBlKSAmJiBvcHRpb25zLmZpbHRlcnMudHlwZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmluZGV4ID0gb3B0aW9ucy5maWx0ZXJzLnR5cGVbMF07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmluZGV4ID0gb3B0aW9ucy5maWx0ZXJzLnR5cGU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZGVsZXRlIG9wdGlvbnMuZmlsdGVycy50eXBlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAob3B0aW9ucy5maWx0ZXJzLmJib3gpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci53YXJuKFwiVGhlIHBhcmFtZXRlciAnZmlsdGVyT3B0aW9ucy5iYm94JyBpcyBkZXByZWNhdGVkXCIpO1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBvcHRpb25zLmZpbHRlcnMuYmJveDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBkZWxldGUgb3B0aW9ucy5maWx0ZXJPcHRpb25zO1xuICAgIH1cblxuICAgIGlmIChvcHRpb25zLnBvc2l0aW9uKSB7XG4gICAgICAgIGlmIChvcHRpb25zLnBvc2l0aW9uLngpIHtcbiAgICAgICAgICAgIHRoaXMubG9nZ2VyLndhcm4oXCJUaGUgcGFyYW1ldGVyICdwb3NpdGlvbi54JyBpcyBkZX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NPTiAoc2kgcmF3UmVzcG9uc2UgPT09IGZhbHNlIClcbiAgICAgICAgICAgIC0+IGFwcGVsIGR1IHBhcnNlciBwb3VyIHLDqWN1cMOpcmVyIGxlIGRvY3VtZW50XG4gICAgICAgICBFdGFwZSA0IDogTGFuY2VtZW50IGRlIGxhIGZvbmN0aW9uIGRlIGNhbGxiYWNrIG9uU3VjY2VzcyBhdmVjIGxhIHLDqXBvbnNlIDpcbiAgICAgICAgICAgIC0+IEpTT04gKHNpIHJhd1Jlc3BvbnNlID09PSB0cnVlKVxuICAgICAgICAgICAgLT4gb3UgZ2VvY29kZWRMb2NhdGlvbnNcbiAgICAqL1xuXG4gICAgaWYgKHRoaXMucmVzcG9uc2UpIHtcbiAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICByZXNwb25zZSA6IHRoaXMucmVzcG9uc2UsXG4gICAgICAgICAgICByYXdSZXNwb25zZSA6IHRoaXMub3B0aW9ucy5yYXdSZXNwb25zZSxcbiAgICAgICAgICAgIG9uRXJyb3IgOiBlcnJvcixcbiAgICAgICAgICAgIG9uU3VjY2VzcyA6IHN1Y2Nlc3MsXG4gICAgICAgICAgICBzY29wZSA6IHRoaXNcbiAgICAgICAgfTtcblxuICAgICAgICBHZW9jb2RlUmVzcG9uc2VGYWN0b3J5LmJ1aWxkKG9wdGlvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShfLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgR2VvY29kZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/GeocodeRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js\");\n/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/GeocodeResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js\");\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service de géocodage direct du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n *\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Geocode\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String|Object} options.query - Nom de l'adresse, du toponyme, de l'unité administrative ou de la parcelle cadastrale recherchée.\n *\n * @param {Object} [options.filters] - Les propriétés possibles de cet objet sont décrites ci-après.\n * @param {String} [options.filters.[prop]] - Critère supplémentaire pour filtrer la recherche sous la forme\n * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête.\n * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"city\".\n * Il permet également de filtrer les toponymes avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"type\".\n * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés :\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n *\n * @param {String} [options.index = \"StreetAddress\"] - Type de l'objet recherché.\n * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress'\n * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales.\n * L'index 'location' regroupe les indexes 'StreetAddress' et 'PositionOfInterest'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, index = 'StreetAddress'.\n *\n * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs.\n * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité.\n * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité.\n *\n * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut.\n * Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20.\n *\n * @param {Boolean} [options.returnTrueGeometry = false] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés.\n * false par défaut.\n *\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * proxyURL : null,\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * position : {lon:, lat:},\n * index : 'StreetAddress',\n * query : '10 rue du pont Machin-ville'\n * (...)\n * };\n */\nfunction Geocode (options_) {\n if (!(this instanceof Geocode)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Geocode\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"Geocode\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Geocode\");\n this.logger.trace(\"[Constructeur Geocode (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n if (!options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage\n /* options.serverUrl = DefaultUrlService.Geocode.newUrl();\n if (options.oldGeocodeService) {\n options.serverUrl = DefaultUrlService.Geocode.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage\n options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Geocode.url();\n }\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, [options]);\n\n if (!options.hasOwnProperty(\"query\")) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"query\"));\n }\n\n // ajout des options spécifiques au service\n this.options.query = options.query;\n\n // on definit l'index par defaut\n if (!options.index) {\n this.options.index = options.index = \"StreetAddress\";\n }\n\n if (options.filters) {\n var filter = Object.keys(options.filters);\n for (var i = 0; i < filter.length; i++) {\n var key = filter[i];\n // on supprime les filtres vides\n if (typeof options.filters[key] === \"undefined\" ||\n (typeof options.filters[key] === \"object\" && Object.keys(options.filters[key]).length === 0) ||\n (typeof options.filters[key] === \"string\" && options.filters[key].length === 0) ||\n (Array.isArray(options.filters[key]) && options.filters[key].length === 0)\n ) {\n delete this.options.filters[key];\n }\n }\n }\n\n this.options.index = options.index || \"StreetAddress\";\n this.options.maximumResponses = options.maximumResponses || 20;\n}\n\n/**\n * @lends module:Geocode#\n */\nGeocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nGeocode.prototype.constructor = Geocode;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nGeocode.prototype.patchOptionConvertor = function (options_) {\n const options = options_;\n\n if (options.hasOwnProperty(\"location\")) {\n this.logger.warn(\"The parameter 'location' is deprecated\");\n\n if (!options.query) {\n options.query = options.location;\n }\n delete options.location;\n }\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (!options.filters) {\n options.filters = options.filterOptions;\n\n if (options.filters.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.index) {\n if (Array.isArray(options.filters.type) && options.filters.type.length > 0) {\n options.index = options.filters.type[0];\n } else {\n options.index = options.filters.type;\n }\n }\n delete options.filters.type;\n }\n\n if (options.filters.bbox) {\n this.logger.warn(\"The parameter 'filterOptions.bbox' is deprecated\");\n delete options.filters.bbox;\n }\n }\n delete options.filterOptions;\n }\n\n if (options.position) {\n if (options.position.x) {\n this.logger.warn(\"The parameter 'position.x' is deprecated\");\n\n if (!options.position.lon) {\n options.position.lon = options.position.x;\n }\n delete options.position.x;\n }\n\n if (options.position.y) {\n this.logger.warn(\"The parameter 'position.y' is deprecated\");\n\n if (!options.position.lat) {\n options.position.lat = options.position.y;\n }\n delete options.position.y;\n }\n }\n\n if (options.returnFreeForm) {\n this.logger.warn(\"The parameter 'returnFreeForm' is deprecated\");\n delete options.returnFreeForm;\n }\n\n if (options.srs) {\n this.logger.warn(\"The parameter 'srs' is deprecated\");\n delete options.srs;\n }\n\n return options;\n};\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nGeocode.prototype.buildRequest = function (error, success) {\n var options = {\n httpMethod : this.options.httpMethod,\n // options specifiques du service\n geocodeMethod : \"search\",\n query : this.options.query,\n index : this.options.index,\n returnTrueGeometry : this.options.returnTrueGeometry,\n position : this.options.position,\n maxResp : this.options.maximumResponses,\n filters : this.options.filters\n };\n\n this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * Analyse de la reponse (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nGeocode.prototype.analyzeResponse = function (error, success) {\n /* INFO :\n Etape 1 : Création de la requête (URL)\n -> stockage de la requête dans this.request\n Etape 2 : Envoi de la requête\n -> appel du protocol XHR, et envoi (par ex send ())\n -> récupération de la réponse JSON dans la fonction onSuccess () (this.response)\n -> si code HTTP 200 et pas de message d'erreur : etape 3\n -> si code HTTP != 200 : lancement de la fonction de callback onFailure avec le message d'erreur\n Etape 3 : Analyse de la réponse JSON (si rawResponse === false )\n -> appel du parser pour récupérer le document\n Etape 4 : Lancement de la fonction de callback onSuccess avec la réponse :\n -> JSON (si rawResponse === true)\n -> ou geocodedLocations\n */\n\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */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GlvbjtcbiAgICB9XG5cbiAgICBpZiAob3B0aW9ucy5maWx0ZXJPcHRpb25zKSB7XG4gICAgICAgIHRoaXMubG9nZ2VyLndhcm4oXCJUaGUgcGFyYW1ldGVyICdmaWx0ZXJPcHRpb25zJyBpcyBkZXByZWNhdGVkXCIpO1xuXG4gICAgICAgIGlmICghb3B0aW9ucy5maWx0ZXJzKSB7XG4gICAgICAgICAgICBvcHRpb25zLmZpbHRlcnMgPSBvcHRpb25zLmZpbHRlck9wdGlvbnM7XG5cbiAgICAgICAgICAgIGlmIChvcHRpb25zLmZpbHRlcnMudHlwZSkge1xuICAgICAgICAgICAgICAgIHRoaXMubG9nZ2VyLndhcm4oXCJUaGUgcGFyYW1ldGVyICdmaWx0ZXJPcHRpb25zLnR5cGUnIGlzIGRlcHJlY2F0ZWRcIik7XG4gICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zLmluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9wdGlvbnMuZmlsdGVycy50eXBlKSAmJiBvcHRpb25zLmZpbHRlcnMudHlwZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmluZGV4ID0gb3B0aW9ucy5maWx0ZXJzLnR5cGVbMF07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmluZGV4ID0gb3B0aW9ucy5maWx0ZXJzLnR5cGU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZGVsZXRlIG9wdGlvbnMuZmlsdGVycy50eXBlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAob3B0aW9ucy5maWx0ZXJzLmJib3gpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci53YXJuKFwiVGhlIHBhcmFtZXRlciAnZmlsdGVyT3B0aW9ucy5iYm94JyBpcyBkZXByZWNhdGVkXCIpO1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBvcHRpb25zLmZpbHRlcnMuYmJveDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBkZWxldGUgb3B0aW9ucy5maWx0ZXJPcHRpb25zO1xuICAgIH1cblxuICAgIGlmIChvcHRpb25zLnBvc2l0aW9uKSB7XG4gICAgICAgIGlmIChvcHRpb25zLnBvc2l0aW9uLngpIHtcbiAgICAgICAgICAgIHRoaXMubG9nZ2VyLndhcm4oXCJUaGUgcGFyYW1ldGVyICdwb3NpdGlvbi54JyBpcyBkZXByZWNhdGVkXCIpO1xuXG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMucG9zaXRpb24ubG9uKSB7XG4gICAgICAgICAgICAgICAgb3B0aW9ucy5wb3NpdGlvbi5sb24gPSBvcHRpb25zLnBvc2l0aW9uLng7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWxldGUgb3B0aW9ucy5wb3NpdGlvbi54O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG9wdGlvbnMucG9zaXRpb24ueSkge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIud2FybihcIlRoZSBwYXJhbWV0ZXIgJ3Bvc2l0aW9uLnknIGlzIGRlcHJlY2F0ZWRcIik7XG5cbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5wb3NpdGlvbi5sYXQpIHtcbiAgICAgICAgICAgICAgICBvcHRpb25zLnBvc2l0aW9uLmxhdCA9IG9wdGlvbnMucG9zaXRpb24ueTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSBvcHRpb25zLnBvc2l0aW9uLnk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAob3B0aW9ucy5yZXR1cm5GcmVlRm9ybSkge1xuICAgICAgICB0aGlzLmxvZ2dlci53YXJuKFwiVGhlIHBhcmFtZXRlciAncmV0dXJuRnJlZUZvcm0nIGlzIGRlc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O1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShfLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgR2VvY29kZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js\n"); /***/ }), @@ -607,7 +619,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single location obj /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Request/GeocodeRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js\");\n/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Response/GeocodeResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js\");\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service de géocodage inverse du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.ReverseGeocode\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs.\n * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité.\n * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité.\n *\n * @param {Object} [options.filters] - Les propriétés possibles de cet objet.\n * @param {String} [options.filters.[proprietes du filtre]] - Critère supplémentaire pour filtrer la recherche sous la forme\n * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête.\n * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"city\".\n * Il permet également de filtrer les toponymes avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"type\".\n * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés :\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n *\n * @param {Object} [options.searchGeometry] - Emprise dans laquelle on souhaite effectuer la recherche.\n * Les propriétés possibles de cet objet sont décrites ci-après.\n * @param {String} options.searchGeometry.type - Type de géometrie (Point|Circle|Linestring|Polygon)\n * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordonnées des points constituant la géométrie.\n * @param {Float} options.searchGeometry.radius - Rayon. Paramètre applicable uniquement pour le type 'Circle'.\n *\n * @param {String} [options.index = \"StreetAddress\"] - Type de l'objet recherché.\n * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress'\n * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales. L'index 'location' permet une recherche\n * multi-indexes en regroupant les indexes 'PositionOfInterest' et 'StreetAddress'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, index = 'StreetAddress'.\n *\n * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20s.\n *\n * @param {Boolean} [options.returnTrueGeometry] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés.\n * false par défaut.\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * proxyURL : null,\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * index : 'StreetAddress',\n * searchGeometry : {\n * type : Circle,\n * coordinates : [48, 2],\n * radius : 100\n * },\n * position : {lon:2 , lat:48.5},\n * maximumResponses : 25,\n * };\n *\n */\nfunction ReverseGeocode (options_) {\n if (!(this instanceof ReverseGeocode)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"ReverseGeocode\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"ReverseGeocode\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.ReverseGeocode\");\n this.logger.trace(\"[Constructeur ReverseGeocode (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n options.serverUrl = options.serverUrl || \"https://wxs.ign.fr/calcul/geoportail/geocodage/rest/0.1/reverse\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, [options]);\n\n if (!options.searchGeometry) {\n if (!options.position) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"searchGeometry\"));\n }\n } else {\n this.options.searchGeometry = options.searchGeometry;\n }\n\n // on definit l'index par defaut\n if (!options.index) {\n this.options.index = options.index = \"StreetAddress\";\n }\n\n if (options.filters) {\n var filter = Object.keys(options.filters);\n for (var i = 0; i < filter.length; i++) {\n var key = filter[i];\n // on supprime les filtres vides\n if (typeof options.filters[key] === \"undefined\" ||\n (typeof options.filters[key] === \"object\" && Object.keys(options.filters[key]).length === 0) ||\n (typeof options.filters[key] === \"string\" && options.filters[key].length === 0) ||\n (Array.isArray(options.filters[key]) && options.filters[key].length === 0)\n ) {\n delete this.options.filters[key];\n }\n }\n }\n\n this.options.position = options.position;\n this.options.index = options.index || \"StreetAddress\";\n this.options.maximumResponses = options.maximumResponses || 20;\n}\n\n/**\n * @lends module:ReverseGeocode#\n */\nReverseGeocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nReverseGeocode.prototype.constructor = ReverseGeocode;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nReverseGeocode.prototype.patchOptionConvertor = function (options_) {\n var options = options_;\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (options.filterOptions.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.index) {\n if (Array.isArray(options.filterOptions.type) && options.filterOptions.type.length > 0) {\n options.index = options.filterOptions.type[0];\n } else {\n options.index = options.filterOptions.type;\n }\n }\n delete options.filterOptions.type;\n }\n\n if (options.filterOptions.bbox) {\n this.logger.warn(\"The parameter 'filterOptions.bbox' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.bbox2Json(options.filterOptions.bbox);\n }\n delete options.filterOptions.bbox;\n }\n\n if (options.filterOptions.circle) {\n this.logger.warn(\"The parameter 'filterOptions.circle' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.circle2Json(options.filterOptions.circle);\n }\n delete options.filterOptions.circle;\n }\n\n if (options.filterOptions.polygon) {\n this.logger.warn(\"The parameter 'filterOptions.polygon' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.polygon2Json(options.filterOptions.polygon);\n }\n delete options.filterOptions.polygon;\n }\n\n if (!options.filters && Object.keys(options.filterOptions).length > 0) {\n options.filters = options.filterOptions;\n }\n\n delete options.filterOptions;\n }\n\n if (options.position) {\n if (options.position.x) {\n this.logger.warn(\"The parameter 'position.x' is deprecated\");\n\n if (!options.position.lon) {\n options.position.lon = options.position.x;\n }\n delete options.position.x;\n }\n\n if (options.position.y) {\n this.logger.warn(\"The parameter 'position.y' is deprecated\");\n\n if (!options.position.lat) {\n options.position.lat = options.position.y;\n }\n delete options.position.y;\n }\n }\n\n if (options.srs) {\n this.logger.warn(\"The parameter 'srs' is deprecated\");\n delete options.srs;\n }\n\n return options;\n};\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nReverseGeocode.prototype.buildRequest = function (error, success) {\n var options = {\n httpMethod : this.options.httpMethod,\n // options specifiques du service\n geocodeMethod : \"reverse\",\n searchGeometry : this.options.searchGeometry,\n index : this.options.index,\n position : this.options.position,\n returnTrueGeometry : this.options.returnTrueGeometry,\n maxResp : this.options.maximumResponses,\n filters : this.options.filters\n };\n\n this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nReverseGeocode.prototype.analyzeResponse = function (error, success) {\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Array} bbox - bbox\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.bbox2Json = function (bbox) {\n return {\n type : \"Polygon\",\n coordinates : [[\n [bbox.left, bbox.top],\n [bbox.right, bbox.top],\n [bbox.right, bbox.bottom],\n [bbox.left, bbox.bottom],\n [bbox.left, bbox.top]\n ]]\n };\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} circle - circle\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.circle2Json = function (circle) {\n return {\n type : \"Circle\",\n radius : circle.radius,\n coordinates : [circle.x, circle.y]\n };\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Array} polygon - polygon\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.polygon2Json = function (polygon) {\n var jsonGeom = {\n type : \"Polygon\",\n coordinates : [[]]\n };\n\n for (var i = 0; i < polygon.length; ++i) {\n jsonGeom.coordinates[0].push([polygon[i].x, polygon[i].y]);\n }\n\n return jsonGeom;\n};\n\n/**\n * Codes EPSG géographiques (lat/lon). Utiles car les coordonnées doivent être inversées.\n */\nReverseGeocode.geoEPSG = [\"EPSG:4326\"];\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReverseGeocode);\n//# sour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0ZXJPcHRpb25zLmNpcmNsZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWxldGUgb3B0aW9ucy5maWx0ZXJPcHRpb25zLmNpcmNsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChvcHRpb25zLmZpbHRlck9wdGlvbnMucG9seWdvbikge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIud2FybihcIlRoZSBwYXJhbWV0ZXIgJ2ZpbHRlck9wdGlvbnMucG9seWdvbicgaXMgZGVwcmVjYXRlZFwiKTtcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5zZWFyY2hHZW9tZXRyeSkge1xuICAgICAgICAgICAgICAgIC8vIGNvbnZlcnRpciBsYSBnZW9tZXRyaWVcbiAgICAgICAgICAgICAgICBvcHRpb25zLnNlYXJjaEdlb21ldHJ5ID0gdGhpcy5wb2x5Z29uMkpzb24ob3B0aW9ucy5maWx0ZXJPcHRpb25zLnBvbHlnb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGVsZXRlIG9wdGlvbnMuZmlsdGVyT3B0aW9ucy5wb2x5Z29uO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFvcHRpb25zLmZpbHRlcnMgJiYgT2JqZWN0LmtleXMob3B0aW9ucy5maWx0ZXJPcHRpb25zKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBvcHRpb25zLmZpbHRlcnMgPSBvcHRpb25zLmZpbHRlck9wdGlvbnM7XG4gICAgICAgIH1cblxuICAgICAgICBkZWxldGUgb3B0aW9ucy5maWx0ZXJPcHRpb25zO1xuICAgIH1cblxuICAgIGlmIChvcHRpb25zLnBvc2l0aW9uKSB7XG4gICAgICAgIGlmIChvcHRpb25zLnBvc2l0aW9uLngpIHtcbiAgICAgICAgICAgIHRoaXMubG9nZ2VyLndhcm4oXCJUaGUgcGFyYW1ldGVyICdwb3NpdGlvbi54JyBpcyBkZXByZWNhdGVkXCIpO1xuXG4gICAgICAgICAgICBpZiA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CIsXG4gICAgICAgIGNvb3JkaW5hdGVzIDogW1tdXVxuICAgIH07XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBvbHlnb24ubGVuZ3RoOyArK2kpIHtcbiAgICAgICAganNvbkdlb20uY29vcmRpbmF0ZXNbMF0ucHVzaChbcG9seWdvbltpXS54LCBwb2x5Z29uW2ldLnldKTtcbiAgICB9XG5cbiAgICByZXR1cm4ganNvbkdlb207XG59O1xuXG4vKipcbiAqIENvZGVzIEVQU0cgZ8Opb2dyYXBoaXF1ZXMgKGxhdC9sb24pLiBVdGlsZXMgY2FyIGxlcyBjb29yZG9ubsOpZXMgZG9pdmVudCDDqnRyZSBpbnZlcnPDqWVzLlxuICovXG5SZXZlcnNlR2VvY29kZS5nZW9FUFNHID0gW1wiRVBTRzo0MzI2XCJdO1xuXG5leHBvcnQgZGVmYXVsdCBSZXZlcnNlR2VvY29kZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/GeocodeRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js\");\n/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/GeocodeResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js\");\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service de géocodage inverse du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.ReverseGeocode\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs.\n * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité.\n * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité.\n *\n * @param {Object} [options.filters] - Les propriétés possibles de cet objet.\n * @param {String} [options.filters.[proprietes du filtre]] - Critère supplémentaire pour filtrer la recherche sous la forme\n * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête.\n * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"city\".\n * Il permet également de filtrer les toponymes avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"type\".\n * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés :\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n *\n * @param {Object} [options.searchGeometry] - Emprise dans laquelle on souhaite effectuer la recherche.\n * Les propriétés possibles de cet objet sont décrites ci-après.\n * @param {String} options.searchGeometry.type - Type de géometrie (Point|Circle|Linestring|Polygon)\n * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordonnées des points constituant la géométrie.\n * @param {Float} options.searchGeometry.radius - Rayon. Paramètre applicable uniquement pour le type 'Circle'.\n *\n * @param {String} [options.index = \"StreetAddress\"] - Type de l'objet recherché.\n * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress'\n * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales. L'index 'location' permet une recherche\n * multi-indexes en regroupant les indexes 'PositionOfInterest' et 'StreetAddress'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, index = 'StreetAddress'.\n *\n * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20s.\n *\n * @param {Boolean} [options.returnTrueGeometry] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés.\n * false par défaut.\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * proxyURL : null,\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * index : 'StreetAddress',\n * searchGeometry : {\n * type : Circle,\n * coordinates : [48, 2],\n * radius : 100\n * },\n * position : {lon:2 , lat:48.5},\n * maximumResponses : 25,\n * };\n *\n */\nfunction ReverseGeocode (options_) {\n if (!(this instanceof ReverseGeocode)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"ReverseGeocode\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"ReverseGeocode\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.ReverseGeocode\");\n this.logger.trace(\"[Constructeur ReverseGeocode (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n if (!options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse\n /* options.serverUrl = DefaultUrlService.ReverseGeocode.newUrl();\n if (options.oldReverseService) {\n options.serverUrl = DefaultUrlService.ReverseGeocode.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse\n options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ReverseGeocode.url();\n }\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, [options]);\n\n if (!options.searchGeometry) {\n if (!options.position) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"searchGeometry\"));\n }\n } else {\n this.options.searchGeometry = options.searchGeometry;\n }\n\n // on definit l'index par defaut\n if (!options.index) {\n this.options.index = options.index = \"StreetAddress\";\n }\n\n if (options.filters) {\n var filter = Object.keys(options.filters);\n for (var i = 0; i < filter.length; i++) {\n var key = filter[i];\n // on supprime les filtres vides\n if (typeof options.filters[key] === \"undefined\" ||\n (typeof options.filters[key] === \"object\" && Object.keys(options.filters[key]).length === 0) ||\n (typeof options.filters[key] === \"string\" && options.filters[key].length === 0) ||\n (Array.isArray(options.filters[key]) && options.filters[key].length === 0)\n ) {\n delete this.options.filters[key];\n }\n }\n }\n\n this.options.position = options.position;\n this.options.index = options.index || \"StreetAddress\";\n this.options.maximumResponses = options.maximumResponses || 20;\n}\n\n/**\n * @lends module:ReverseGeocode#\n */\nReverseGeocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nReverseGeocode.prototype.constructor = ReverseGeocode;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nReverseGeocode.prototype.patchOptionConvertor = function (options_) {\n var options = options_;\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (options.filterOptions.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.index) {\n if (Array.isArray(options.filterOptions.type) && options.filterOptions.type.length > 0) {\n options.index = options.filterOptions.type[0];\n } else {\n options.index = options.filterOptions.type;\n }\n }\n delete options.filterOptions.type;\n }\n\n if (options.filterOptions.bbox) {\n this.logger.warn(\"The parameter 'filterOptions.bbox' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.bbox2Json(options.filterOptions.bbox);\n }\n delete options.filterOptions.bbox;\n }\n\n if (options.filterOptions.circle) {\n this.logger.warn(\"The parameter 'filterOptions.circle' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.circle2Json(options.filterOptions.circle);\n }\n delete options.filterOptions.circle;\n }\n\n if (options.filterOptions.polygon) {\n this.logger.warn(\"The parameter 'filterOptions.polygon' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.polygon2Json(options.filterOptions.polygon);\n }\n delete options.filterOptions.polygon;\n }\n\n if (!options.filters && Object.keys(options.filterOptions).length > 0) {\n options.filters = options.filterOptions;\n }\n\n delete options.filterOptions;\n }\n\n if (options.position) {\n if (options.position.x) {\n this.logger.warn(\"The parameter 'position.x' is deprecated\");\n\n if (!options.position.lon) {\n options.position.lon = options.position.x;\n }\n delete options.position.x;\n }\n\n if (options.position.y) {\n this.logger.warn(\"The parameter 'position.y' is deprecated\");\n\n if (!options.position.lat) {\n options.position.lat = options.position.y;\n }\n delete options.position.y;\n }\n }\n\n if (options.srs) {\n this.logger.warn(\"The parameter 'srs' is deprecated\");\n delete options.srs;\n }\n\n return options;\n};\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nReverseGeocode.prototype.buildRequest = function (error, success) {\n var options = {\n httpMethod : this.options.httpMethod,\n // options specifiques du service\n geocodeMethod : \"reverse\",\n searchGeometry : this.options.searchGeometry,\n index : this.options.index,\n position : this.options.position,\n returnTrueGeometry : this.options.returnTrueGeometry,\n maxResp : this.options.maximumResponses,\n filters : this.options.filters\n };\n\n this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nReverseGeocode.prototype.analyzeResponse = function (error, success) {\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Array} bbox - bbox\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.bbox2Json = function (bbox) {\n return {\n type : \"Polygon\",\n coordinates : [[\n [bbox.left, bbox.top],\n [bbox.right, bbox.top],\n [bbox.right, bbox.bottom],\n [bbox.left, bbox.bottom],\n [bbox.left, bbox.top]\n ]]\n };\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} circle - circle\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.circle2Json = function (circle) {\n return {\n type : \"Circle\",\n radius : circle.radius,\n coordinates : [circle.x, circle.y]\n };\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Array} polygon - polygon\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.polygon2Json = function (polygon) {\n var jsonGeom = {\n type : \"Polygon\",\n coordinates : [[]]\n };\n\n for (var i = 0; i < polygon.length; ++i) {\n jsonGeom.coordinates[0].push([polygon[i].x, polygon[i].y]);\n }\n\n return jsonGeom;\n};\n\n/**\n * Codes EPSG géographiques (lat/lon). Utiles car les coordonnées doivent être inversées.\n */\nReverseGeocode.geoEPSG = [\"EPSG:4326\"];\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReverseGeocode);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9SZXZlcnNlR2VvY29kZS5qcz9iZGFlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBaUQ7QUFDSDtBQUNXO0FBQ1o7QUFDUTtBQUNlO0FBQ0c7O0FBRXZFO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEIsZ0JBQWdCLE1BQU07QUFDdEIsZ0JBQWdCLE1BQU07QUFDdEI7QUFDQSxXQUFXLE9BQ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gIHZhciBmaWx0ZXIgPSBPYmplY3Qua2V5cyhvcHRpb25zLmZpbHRlcnMpO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGZpbHRlci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGtleSA9IGZpbHRlcltpXTtcbiAgICAgICAgICAgIC8vIG9uIHN1cHByaW1lIGxlcyBmaWx0cmVzIHZpZGVzXG4gICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuZmlsdGVyc1trZXldID09PSBcInVuZGVmaW5lZFwiIHx8XG4gICAgICAgICAgICAgICAgKHR5cGVvZiBvcHRpb25zLmZpbHRlcnNba2V5XSA9PT0gXCJvYmplY3RcIiAmJiBPYmplY3Qua2V5cyhvcHRpb25zLmZpbHRlcnNba2V5XSkubGVuZ3RoID09PSAwKSB8fFxuICAgICAgICAgICAgICAgICh0eXBlb2Ygb3B0aW9ucy5maWx0ZXJzW2tleV0gPT09IFwic3RyaW5nXCIgJiYgb3B0aW9ucy5maWx0ZXJzW2tleV0ubGVuZ3RoID09PSAwKSB8fFxuICAgICAgICAgICAgICAgIChBcnJheS5pc0FycmF5KG9wdGlvbnMuZmlsdGVyc1trZXldKSAmJiBvcHRpb25zLmZpbHRlcnNba2V5XS5sZW5ndGggPT09IDApXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5vcHRpb25zLmZpbHRlcnNba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHRoaXMub3B0aW9ucy5wb3NpdGlvbiA9IG9wdGlvbnMucG9zaXRpb247XG4gICAgdGhpcy5vcHRpb25zLmluZGV4ID0gb3B0aW9ucy5pbmRleCB8fCBcIlN0cmVldEFkZHJlc3NcIjtcbiAgICB0aGlzLm9wdGlvbnMubWF4aW11bVJlc3BvbnNlcyA9IG9wdGlvbnMubWF4aW11bVJlc3BvbnNlcyB8fCAyMDtcbn1cblxuLyoqXG4gKiB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LSBnZW9tZXRyaWUgYXUgZm9ybWF0IGpzb25cbiAqL1xuUmV2ZXJzZUdlb2NvZGUucHJvdG90eXBlLnBvbHlnb24ySnNvbiA9IGZ1bmN0aW9uIChwb2x5Z29uKSB7XG4gICAgdmFyIGpzb25HZW9tID0ge1xuICAgICAgICB0eXBlIDogXCJQb2x5Z29uXCIsXG4gICAgICAgIGNvb3JkaW5hdGVzIDogW1tdXVxuICAgIH07XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBvbHlnb24ubGVuZ3RoOyArK2kpIHtcbiAgICAgICAganNvbkdlb20uY29vcmRpbmF0ZXNbMF0ucHVzaChbcG9seWdvbltpXS54LCBwb2x5Z29uW2ldLnldKTtcbiAgICB9XG5cbiAgICByZXR1cm4ganNvbkdlb207XG59O1xuXG4vKipcbiAqIENvZGVzIEVQU0cgZ8Opb2dyYXBoaXF1ZXMgKGxhdC9sb24pLiBVdGlsZXMgY2FyIGxlcyBjb29yZG9ubsOpZXMgZG9pdmVudCDDqnRyZSBpbnZlcnPDqWVzLlxuICovXG5SZXZlcnNlR2VvY29kZS5nZW9FUFNHID0gW1wiRVBTRzo0MzI2XCJdO1xuXG5leHBvcnQgZGVmYXVsdCBSZXZlcnNlR2VvY29kZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js\n"); /***/ }), @@ -619,7 +631,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/ProcessIsoCurveRequest */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/ProcessIsoCurveRequest.js\");\n/* harmony import */ var _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/ProcessIsoCurveResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/ProcessIsoCurveResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'isochrone/distance du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.ProcessIsoCurve\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service iso : 'json' uniquement et par défaut.\n *\n * @param {Object} options.position - Point de départ du calcul.\n * Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.position.x - Abcisse du point de départ du calcul d'isochrone/distance.\n * @param {Float} options.position.y - Ordonnée du point de départ du calcul d'isochrone/distance.\n *\n * @param {String} options.srs - Projection.\n * Système de coordonnées dans lequel les coordonnées du point « location » sont exprimées et\n * dans lequel la géométrie de la courbe résultante sera exprimée.\n * Par défaut, le système de coordonnées utilisé sera « EPSG:4326 ».\n *\n * @param {String} [options.graph = \"voiture\"] - Nom du graphe à utiliser pour le calcul (« Pieton » ou « Voiture »).\n * La valeur par défaut est : «voiture»\n *\n * @param {Array.} [options.exclusions] - DEPRECATED: Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints.\n * Critères d'exclusions à appliquer pour le calcul.\n * On précise ici le type de tronçons que l'on ne veut pas que l'isochrone/distance emprunte\n * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »).\n *\n * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement \"banned\".\n * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement \"wayType\".\n * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement \"=\".\n * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement \"autoroute\".\n *\n * @param {String} [options.method = \"time\"] - Méthode utilisée pour le calcul de la courbe iso.\n * Les valeurs possible sont \"time\" pour un calcul d'isochrone, \"distance\" pour un calcul d'isodistance.\n * Pas de valeur spécifié équivaut à un calcul d'isochrone.\n *\n * @param {String} [options.distanceUnit = \"m\"] - Indique si la distance doit être exprimée en km ou m dans la réponse (\"m\" or \"km\").\n *\n * @param {String} [options.timeUnit = \"second\"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse (\"standard\", \"second\", \"minute\", \"hour\"). Il peut-être formatté hh:mm::ss avec la valeur standard.\n *\n * @param {Float} options.time - Durée maximum (exprimée en secondes) à utiliser pour le calcul de la courbe à partir du ou jusqu'au point « location ».\n * Ce paramètre doit être renseigné si l'option \"méthod\" a la valeur \"time\".\n * Si l'option method n'est pas renseignée, ce paramètre doit être renseigné.\n *\n * @param {Float} options.distance - Distance maximum (exprimée en metres) à utiliser pour le calcul de la courbe à partir du ou j'usqu'au point « location ».\n * Ce paramètre doit être renseigné si l'option \"méthod\" a la valeur \"DISTANCE\".\n * Si l'option \"method\" n'est pas renseignée, ce paramètre sera ignoré.\n *\n * @param {Boolean} [options.reverse = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier.\n * Par défaut, la valeur « false » est appliquée.\n *\n * @param {Boolean} [options.smoothing = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier.\n * Par défaut, la valeur « false » est appliquée.\n *\n * @param {Boolean} [options.holes = false] - Indique si la géométrie résultante (surface) doit être retournée avec des trous (« true »).\n * Par défaut, la valeur « false » est appliquée.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * position : {\n * x : 2.3242664298058053,\n * y : 48.86118017324745\n * },\n * distance : 200,\n * [time : ]\n * method : \"distance\",\n * graph : \"voiture\",\n * reverse : false\n * };\n */\n\nfunction ProcessIsoCurve (options) {\n if (!(this instanceof ProcessIsoCurve)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"ProcessIsoCurve\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"ProcessIsoCurve\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.ProcessIsoCurve\");\n this.logger.trace(\"[Constructeur ProcessIsoCurve (options)]\");\n\n if (!options.position) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.position.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position.x\"));\n }\n\n if (options.position.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position.y\"));\n }\n\n if (!options.time && !options.distance) {\n throw new Error(\"Parameter (s) 'distance' missing. Parameter time to calculate an isochrone, parameter distance for an isodistance\");\n }\n\n // si on a que le paramètre \"distance\" en entrée, on calcule une isodistance.\n // Le paramètre \"méthode\" doit pour avoir une réponse du service, être passé à \"distance\"\n if (!options.time && options.distance) {\n this.options.method = \"distance\";\n // on supprime l'éventuel attribut time, résidu d'un appel antérieur\n if (this.options.time) {\n delete this.options.time;\n }\n }\n\n // si on a que le paramètre \"time\" en entrée, on calcule une isochrone.\n // Le paramètre \"méthode\" doit pour avoir une réponse du service, être passé à \"time\"\n if (options.time && !options.distance) {\n this.options.method = \"time\";\n // on supprime l'éventuel attribut time, résidu d'un appel antérieur\n if (this.options.distance) {\n delete this.options.distance;\n }\n }\n\n // au cas où on a ni l'un, ni l'autre...\n this.options.method = this.options.method || \"time\";\n\n // options par defaut du service\n // TODO: modifier la ressource lors de la mise en production du service\n this.options.resource = options.resource || \"bdtopo-iso\";\n this.options.exclusions = options.exclusions || [];\n this.options.reverse = options.reverse || false;\n this.options.srs = options.srs || \"EPSG:4326\";\n this.options.distanceUnit = options.distanceUnit || \"m\";\n this.options.timeUnit = options.timeUnit || \"second\";\n\n // options depreciees\n if (options.smoothing) {\n this.logger.warn(\"options.smoothing is DEPRECATED\");\n }\n this.options.smoothing = false;\n if (options.holes) {\n this.logger.warn(\"options.holes is DEPRECATED\");\n }\n this.options.holes = false;\n\n // Gestion du graphe\n if (options.graph) {\n if (options.graph === \"Voiture\") {\n this.options.graph = \"car\";\n }\n if (options.graph === \"Pieton\") {\n this.options.graph = \"pedestrian\";\n }\n } else {\n this.options.graph = \"car\";\n }\n\n // Gestions des contraintes\n this.options.constraints = [];\n if (options.constraints) {\n if (Array.isArray(options.constraints)) {\n for (var k = 0; k < options.constraints.length; k++) {\n this.options.constraints.push(options.constraints[k]);\n }\n } else {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"constraints\"));\n }\n }\n\n // Gestion de l'ancien paramètre exclusions\n var constraintTunnel = {};\n var constraintPont = {};\n var constraintAutoroute = {};\n if (options.exclusions) {\n if (options.exclusions.length !== 0) {\n this.logger.warn(\"options.exclusions is DEPRECATED !!\");\n for (var c = 0; c < options.exclusions.length; c++) {\n if (typeof options.exclusions[c] === \"string\") {\n options.exclusions[c] = options.exclusions[c].toLowerCase();\n } else {\n // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions\n continue;\n }\n if (options.exclusions[c] === \"toll\") {\n constraintAutoroute.constraintType = \"banned\";\n constraintAutoroute.key = \"wayType\";\n constraintAutoroute.operator = \"=\";\n constraintAutoroute.value = \"autoroute\";\n this.options.constraints.push(constraintAutoroute);\n }\n if (options.exclusions[c] === \"tunnel\") {\n constraintTunnel.constraintType = \"banned\";\n constraintTunnel.key = \"wayType\";\n constraintTunnel.operator = \"=\";\n constraintTunnel.value = \"tunnel\";\n this.options.constraints.push(constraintTunnel);\n }\n if (options.exclusions[c] === \"bridge\") {\n constraintPont.constraintType = \"banned\";\n constraintPont.key = \"wayType\";\n constraintPont.operator = \"=\";\n constraintPont.value = \"pont\";\n this.options.constraints.push(constraintPont);\n }\n }\n }\n }\n\n // on passe l'option outputFormat en minuscules afin d'éviter des exceptions.\n this.options.outputFormat = (typeof options.outputFormat === \"string\") ? options.outputFormat.toLowerCase() : \"json\";\n if (options.outputFormat && options.outputFormat !== \"json\") {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT\", \"outputFormat\"));\n }\n this.options.outputFormat = \"json\";\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n if (!this.options.serverUrl) {\n var urlFound = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ProcessIsoCurve.url(\"calcul\");\n if (!urlFound) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = urlFound;\n this.logger.trace(\"Serveur URL par defaut : \" + this.options.serverUrl);\n }\n}\n\n/**\n * @lends module:ProcessIsoCurve#\n */\nProcessIsoCurve.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nProcessIsoCurve.prototype.constructor = ProcessIsoCurve;\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nProcessIsoCurve.prototype.buildRequest = function (error, success) {\n try {\n var oIsoCurve = new _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this.options);\n if (!oIsoCurve.processRequestString()) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\"));\n }\n\n this.request = oIsoCurve.requestString;\n } catch (e) {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](e.message));\n return;\n }\n\n success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} onError - callback des erreurs\n * @param {Function} onSuccess - callback de succès de l'analyse de la réponse\n */\nProcessIsoCurve.prototype.analyzeResponse = function (onError, onSuccess) {\n if (this.response) {\n var options = {\n response : this.response,\n outputFormat : this.options.outputFormat,\n rawResponse : this.options.rawResponse,\n onSuccess : onSuccess,\n onError : onError,\n scope : this\n };\n\n _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProcessIsoCurve);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUHJvY2Vzc0lzb0N1cnZlL1Byb2Nlc3NJc29DdXJ2ZS5qcz84OGNlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUNpRDtBQUNIO0FBQ1c7QUFDWjtBQUNRO0FBQ2lCO0FBQ2lCOztBQUV2RjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLGdCQUFnQixNQUFNO0FBQ3RCLGdCQUFnQixNQUFNO0FBQ3RCO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xC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1xuICAgICAgICB0aGlzLm9wdGlvbnMuZ3JhcGggPSBcImNhclwiO1xuICAgIH1cblxuICAgIC8vIEdlc3Rpb25zIGRlcyBjb250cmFpbnRlc1xuICAgIHRoaXMub3B0aW9ucy5jb25zdHJhaW50cyA9IFtdO1xuICAgIGlmIChvcHRpb25zLmNvbnN0cmFpbnRzKSB7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9wdGlvbnMuY29uc3RyYWludHMpKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IG9wdGlvbnMuY29uc3RyYWludHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChvcHRpb25zLmNvbnN0cmFpbnRzW2tdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihfLmdldE1lc3NhZ2UoXCJQQVJBTV9UWVBFXCIsIFwiY29uc3RyYWludHNcIikpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gR2VzdGlvbiBkZSBsJ2FuY2llbiBwYXJhbcOodHJlIGV4Y2x1c2lvbnNcbiAgICB2YXIgY29uc3RyYWludFR1bm5lbCA9IHt9O1xuICAgIHZhciBjb25zdHJhaW50UG9udCA9IHt9O1xuICAgIHZhciBjb25zdHJhaW50QXV0b3JvdXRlID0ge307XG4gICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9ucykge1xuICAgICAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIud2FybihcIm9wdGlvbnMuZXhjbHVzaW9ucyBpcyBERVBSRUNBVEVEICEhXCIpO1xuICAgICAgICAgICAgZm9yICh2YXIgYyA9IDA7IGMgPCBvcHRpb25zLmV4Y2x1c2lvbnMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmV4Y2x1c2lvbnNbY10gPSBvcHRpb25zLmV4Y2x1c2lvbnNbY10udG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbiBuZSBjcsOpZSBwYXMgdW5lIGVycmV1ciBwb3VyIHLDqXRyby1jb21wYXRpYmlsaXTDqSBhdmVjIGxlcyBhbmNpZW5uZXMgdmVyc2lvbnNcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwidG9sbFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLm9wZXJhdG9yID0gXCI9XCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUudmFsdWUgPSBcImF1dG9yb3V0ZVwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChjb25zdHJhaW50QXV0b3JvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJ0dW5uZWxcIikge1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLmNvbnN0cmFpbnRUeXBlID0gXCJiYW5uZWRcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5rZXkgPSBcIndheVR5cGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5vcGVyYXRvciA9IFwiPVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLnZhbHVlID0gXCJ0dW5uZWxcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzLnB1c2goY29uc3RyYWludFR1bm5lbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwiYnJpZGdlXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC5rZXkgPSBcIndheVR5cGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQub3BlcmF0b3IgPSBcIj1cIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQudmFsdWUgPSBcInBvbnRcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzLnB1c2goY29uc3RyYWludFBvbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIG9uIHBhc3NlIGwnb3B0aW9uIG91dHB1dEZvcm1hdCBlbiBtaW51c2N1bGVzIGFmaW4gZCfDqXZpdGVyIGRlcyBleGNlcHRpb25zLlxuICAgIHRoaXMub3B0aW9ucy5vdXRwdXRGb3JtYXQgPSAodHlwZW9mIG9wdGlvbnMub3V0cHV0Rm9ybWF0ID09PSBcInN0cmluZ1wiKSA/IG9wdGlvbnMub3V0cHV0Rm9ybWF0LnRvTG93ZXJDYXNlKCkgOiBcImpzb25cIjtcbiAgICB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G9uRXJyb3IgICAtIGNhbGxiYWNrIGRlcyBlcnJldXJzXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBvblN1Y2Nlc3MgLSBjYWxsYmFjayBkZSBzdWNjw6hzIGRlIGwnYW5hbHlzZSBkZSBsYSByw6lwb25zZVxuICovXG5Qcm9jZXNzSXNvQ3VydmUucHJvdG90eXBlLmFuYWx5emVSZXNwb25zZSA9IGZ1bmN0aW9uIChvbkVycm9yLCBvblN1Y2Nlc3MpIHtcbiAgICBpZiAodGhpcy5yZXNwb25zZSkge1xuICAgICAgICB2YXIgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgIHJlc3BvbnNlIDogdGhpcy5yZXNwb25zZSxcbiAgICAgICAgICAgIG91dHB1dEZvcm1hdCA6IHRoaXMub3B0aW9ucy5vdXRwdXRGb3JtYXQsXG4gICAgICAgICAgICByYXdSZXNwb25zZSA6IHRoaXMub3B0aW9ucy5yYXdSZXNwb25zZSxcbiAgICAgICAgICAgIG9uU3VjY2VzcyA6IG9uU3VjY2VzcyxcbiAgICAgICAgICAgIG9uRXJyb3IgOiBvbkVycm9yLFxuICAgICAgICAgICAgc2NvcGUgOiB0aGlzXG4gICAgICAgIH07XG5cbiAgICAgICAgUHJvY2Vzc0lzb0N1cnZlUmVzcG9uc2VGYWN0b3J5LmJ1aWxkKG9wdGlvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIG9uRXJyb3IuY2FsbCh0aGlzLCBuZXcgRXJyb3JTZXJ2aWNlKF8uZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRU1QVFlcIikpKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBQcm9jZXNzSXNvQ3VydmU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/ProcessIsoCurveRequest */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/ProcessIsoCurveRequest.js\");\n/* harmony import */ var _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/ProcessIsoCurveResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/ProcessIsoCurveResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'isochrone/distance du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.ProcessIsoCurve\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service iso : 'json' uniquement et par défaut.\n *\n * @param {Object} options.position - Point de départ du calcul.\n * Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.position.x - Abcisse du point de départ du calcul d'isochrone/distance.\n * @param {Float} options.position.y - Ordonnée du point de départ du calcul d'isochrone/distance.\n *\n * @param {String} options.srs - Projection.\n * Système de coordonnées dans lequel les coordonnées du point « location » sont exprimées et\n * dans lequel la géométrie de la courbe résultante sera exprimée.\n * Par défaut, le système de coordonnées utilisé sera « EPSG:4326 ».\n *\n * @param {String} [options.graph = \"voiture\"] - Nom du graphe à utiliser pour le calcul (« Pieton » ou « Voiture »).\n * La valeur par défaut est : «voiture»\n *\n * @param {Array.} [options.exclusions] - DEPRECATED: Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints.\n * Critères d'exclusions à appliquer pour le calcul.\n * On précise ici le type de tronçons que l'on ne veut pas que l'isochrone/distance emprunte\n * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »).\n *\n * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement \"banned\".\n * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement \"wayType\".\n * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement \"=\".\n * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement \"autoroute\".\n *\n * @param {String} [options.method = \"time\"] - Méthode utilisée pour le calcul de la courbe iso.\n * Les valeurs possible sont \"time\" pour un calcul d'isochrone, \"distance\" pour un calcul d'isodistance.\n * Pas de valeur spécifié équivaut à un calcul d'isochrone.\n *\n * @param {String} [options.distanceUnit = \"m\"] - Indique si la distance doit être exprimée en km ou m dans la réponse (\"m\" or \"km\").\n *\n * @param {String} [options.timeUnit = \"second\"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse (\"standard\", \"second\", \"minute\", \"hour\"). Il peut-être formatté hh:mm::ss avec la valeur standard.\n *\n * @param {Float} options.time - Durée maximum (exprimée en secondes) à utiliser pour le calcul de la courbe à partir du ou jusqu'au point « location ».\n * Ce paramètre doit être renseigné si l'option \"méthod\" a la valeur \"time\".\n * Si l'option method n'est pas renseignée, ce paramètre doit être renseigné.\n *\n * @param {Float} options.distance - Distance maximum (exprimée en metres) à utiliser pour le calcul de la courbe à partir du ou j'usqu'au point « location ».\n * Ce paramètre doit être renseigné si l'option \"méthod\" a la valeur \"DISTANCE\".\n * Si l'option \"method\" n'est pas renseignée, ce paramètre sera ignoré.\n *\n * @param {Boolean} [options.reverse = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier.\n * Par défaut, la valeur « false » est appliquée.\n *\n * @param {Boolean} [options.smoothing = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier.\n * Par défaut, la valeur « false » est appliquée.\n *\n * @param {Boolean} [options.holes = false] - Indique si la géométrie résultante (surface) doit être retournée avec des trous (« true »).\n * Par défaut, la valeur « false » est appliquée.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * position : {\n * x : 2.3242664298058053,\n * y : 48.86118017324745\n * },\n * distance : 200,\n * [time : ]\n * method : \"distance\",\n * graph : \"voiture\",\n * reverse : false\n * };\n */\n\nfunction ProcessIsoCurve (options) {\n if (!(this instanceof ProcessIsoCurve)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"ProcessIsoCurve\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"ProcessIsoCurve\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.ProcessIsoCurve\");\n this.logger.trace(\"[Constructeur ProcessIsoCurve (options)]\");\n\n if (!options.position) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.position.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position.x\"));\n }\n\n if (options.position.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position.y\"));\n }\n\n if (!options.time && !options.distance) {\n throw new Error(\"Parameter (s) 'distance' missing. Parameter time to calculate an isochrone, parameter distance for an isodistance\");\n }\n\n // si on a que le paramètre \"distance\" en entrée, on calcule une isodistance.\n // Le paramètre \"méthode\" doit pour avoir une réponse du service, être passé à \"distance\"\n if (!options.time && options.distance) {\n this.options.method = \"distance\";\n // on supprime l'éventuel attribut time, résidu d'un appel antérieur\n if (this.options.time) {\n delete this.options.time;\n }\n }\n\n // si on a que le paramètre \"time\" en entrée, on calcule une isochrone.\n // Le paramètre \"méthode\" doit pour avoir une réponse du service, être passé à \"time\"\n if (options.time && !options.distance) {\n this.options.method = \"time\";\n // on supprime l'éventuel attribut time, résidu d'un appel antérieur\n if (this.options.distance) {\n delete this.options.distance;\n }\n }\n\n // au cas où on a ni l'un, ni l'autre...\n this.options.method = this.options.method || \"time\";\n\n // options par defaut du service\n // TODO: modifier la ressource lors de la mise en production du service\n this.options.resource = options.resource || \"bdtopo-iso\";\n this.options.exclusions = options.exclusions || [];\n this.options.reverse = options.reverse || false;\n this.options.srs = options.srs || \"EPSG:4326\";\n this.options.distanceUnit = options.distanceUnit || \"m\";\n this.options.timeUnit = options.timeUnit || \"second\";\n\n // options depreciees\n if (options.smoothing) {\n this.logger.warn(\"options.smoothing is DEPRECATED\");\n }\n this.options.smoothing = false;\n if (options.holes) {\n this.logger.warn(\"options.holes is DEPRECATED\");\n }\n this.options.holes = false;\n\n // Gestion du graphe\n if (options.graph) {\n if (options.graph === \"Voiture\") {\n this.options.graph = \"car\";\n }\n if (options.graph === \"Pieton\") {\n this.options.graph = \"pedestrian\";\n }\n } else {\n this.options.graph = \"car\";\n }\n\n // Gestions des contraintes\n this.options.constraints = [];\n if (options.constraints) {\n if (Array.isArray(options.constraints)) {\n for (var k = 0; k < options.constraints.length; k++) {\n this.options.constraints.push(options.constraints[k]);\n }\n } else {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"constraints\"));\n }\n }\n\n // Gestion de l'ancien paramètre exclusions\n var constraintTunnel = {};\n var constraintPont = {};\n var constraintAutoroute = {};\n if (options.exclusions) {\n if (options.exclusions.length !== 0) {\n this.logger.warn(\"options.exclusions is DEPRECATED !!\");\n for (var c = 0; c < options.exclusions.length; c++) {\n if (typeof options.exclusions[c] === \"string\") {\n options.exclusions[c] = options.exclusions[c].toLowerCase();\n } else {\n // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions\n continue;\n }\n if (options.exclusions[c] === \"toll\") {\n constraintAutoroute.constraintType = \"banned\";\n constraintAutoroute.key = \"wayType\";\n constraintAutoroute.operator = \"=\";\n constraintAutoroute.value = \"autoroute\";\n this.options.constraints.push(constraintAutoroute);\n }\n if (options.exclusions[c] === \"tunnel\") {\n constraintTunnel.constraintType = \"banned\";\n constraintTunnel.key = \"wayType\";\n constraintTunnel.operator = \"=\";\n constraintTunnel.value = \"tunnel\";\n this.options.constraints.push(constraintTunnel);\n }\n if (options.exclusions[c] === \"bridge\") {\n constraintPont.constraintType = \"banned\";\n constraintPont.key = \"wayType\";\n constraintPont.operator = \"=\";\n constraintPont.value = \"pont\";\n this.options.constraints.push(constraintPont);\n }\n }\n }\n }\n\n // on passe l'option outputFormat en minuscules afin d'éviter des exceptions.\n this.options.outputFormat = (typeof options.outputFormat === \"string\") ? options.outputFormat.toLowerCase() : \"json\";\n if (options.outputFormat && options.outputFormat !== \"json\") {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT\", \"outputFormat\"));\n }\n this.options.outputFormat = \"json\";\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n if (!this.options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone\n /* var urlFound = DefaultUrlService.ProcessIsoCurve.newUrl();\n if (this.options.oldIsoService) {\n urlFound = DefaultUrlService.ProcessIsoCurve.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone\n var urlFound = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ProcessIsoCurve.url();\n if (!urlFound) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = urlFound;\n this.logger.trace(\"Serveur URL par defaut : \" + this.options.serverUrl);\n }\n}\n\n/**\n * @lends module:ProcessIsoCurve#\n */\nProcessIsoCurve.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nProcessIsoCurve.prototype.constructor = ProcessIsoCurve;\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nProcessIsoCurve.prototype.buildRequest = function (error, success) {\n try {\n var oIsoCurve = new _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this.options);\n if (!oIsoCurve.processRequestString()) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\"));\n }\n\n this.request = oIsoCurve.requestString;\n } catch (e) {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](e.message));\n return;\n }\n\n success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} onError - callback des erreurs\n * @param {Function} onSuccess - callback de succès de l'analyse de la réponse\n */\nProcessIsoCurve.prototype.analyzeResponse = function (onError, onSuccess) {\n if (this.response) {\n var options = {\n response : this.response,\n outputFormat : this.options.outputFormat,\n rawResponse : this.options.rawResponse,\n onSuccess : onSuccess,\n onError : onError,\n scope : this\n };\n\n _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProcessIsoCurve);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUHJvY2Vzc0lzb0N1cnZlL1Byb2Nlc3NJc29DdXJ2ZS5qcz84OGNlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUNpRDtBQUNIO0FBQ1c7QUFDWjtBQUNRO0FBQ2lCO0FB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ge307XG4gICAgdmFyIGNvbnN0cmFpbnRQb250ID0ge307XG4gICAgdmFyIGNvbnN0cmFpbnRBdXRvcm91dGUgPSB7fTtcbiAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zKSB7XG4gICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgICB0aGlzLmxvZ2dlci53YXJuKFwib3B0aW9ucy5leGNsdXNpb25zIGlzIERFUFJFQ0FURUQgISFcIik7XG4gICAgICAgICAgICBmb3IgKHZhciBjID0gMDsgYyA8IG9wdGlvbnMuZXhjbHVzaW9ucy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3B0aW9ucy5leGNsdXNpb25zW2NdID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9IG9wdGlvbnMuZXhjbHVzaW9uc1tjXS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG9uIG5lIGNyw6llIHBhcyB1bmUgZXJyZXVyIHBvdXIgcsOpdHJvLWNvbXBhdGliaWxpdMOpIGF2ZWMgbGVzIGFuY2llbm5lcyB2ZXJzaW9uc1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJ0b2xsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludEF1dG9yb3V0ZS5jb25zdHJhaW50VHlwZSA9IFwiYmFubmVkXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUua2V5ID0gXCJ3YXlUeXBlXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUub3BlcmF0b3IgPSBcIj1cIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludEF1dG9yb3V0ZS52YWx1ZSA9IFwiYXV0b3JvdXRlXCI7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3B0aW9ucy5jb25zdHJhaW50cy5wdXNoKGNvbnN0cmFpbnRBdXRvcm91dGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zW2NdID09PSBcInR1bm5lbFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRUdW5uZWwuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLm9wZXJhdG9yID0gXCI9XCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRUdW5uZWwudmFsdWUgPSBcInR1bm5lbFwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChjb25zdHJhaW50VHVubmVsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJicmlkZ2VcIikge1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC5jb25zdHJhaW50VHlwZSA9IFwiYmFubmVkXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRQb250LmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC5vcGVyYXRvciA9IFwiPVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC52YWx1ZSA9IFwicG9udFwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnM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UgZGUgbGEgcsOpcG9uc2VcbiAqL1xuUHJvY2Vzc0lzb0N1cnZlLnByb3RvdHlwZS5hbmFseXplUmVzcG9uc2UgPSBmdW5jdGlvbiAob25FcnJvciwgb25TdWNjZXNzKSB7XG4gICAgaWYgKHRoaXMucmVzcG9uc2UpIHtcbiAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICByZXNwb25zZSA6IHRoaXMucmVzcG9uc2UsXG4gICAgICAgICAgICBvdXRwdXRGb3JtYXQgOiB0aGlzLm9wdGlvbnMub3V0cHV0Rm9ybWF0LFxuICAgICAgICAgICAgcmF3UmVzcG9uc2UgOiB0aGlzLm9wdGlvbnMucmF3UmVzcG9uc2UsXG4gICAgICAgICAgICBvblN1Y2Nlc3MgOiBvblN1Y2Nlc3MsXG4gICAgICAgICAgICBvbkVycm9yIDogb25FcnJvcixcbiAgICAgICAgICAgIHNjb3BlIDogdGhpc1xuICAgICAgICB9O1xuXG4gICAgICAgIFByb2Nlc3NJc29DdXJ2ZVJlc3BvbnNlRmFjdG9yeS5idWlsZChvcHRpb25zKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBvbkVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShfLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgUHJvY2Vzc0lzb0N1cnZlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js\n"); /***/ }), @@ -751,7 +763,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Response object for { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/RouteRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestFactory.js\");\n/* harmony import */ var _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/RouteResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Route/Response/RouteResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'itinéraire du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n *\n * @alias Gp.Services.Route\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service itineraire : 'json' uniquement et par défaut.\n *\n * @param {String} [options.routePreference = \"fastest\"] - Mode de calcul à utiliser :\n * - le plus rapide « fastest »\n * - le plus court « shortest »\n * Par défaut : « fastest ».\n *\n * @param {Object} options.startPoint - Point de départ du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.startPoint.x - Abcisse du point de départ du calcul d'itinéraire.\n * @param {Float} options.startPoint.y - Ordonnée du point de départ du calcul d'itinéraire.\n *\n * @param {Object} options.endPoint - Point d'arrivée du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.endPoint.x - Abcisse du point d'arrivée du calcul d'itinéraire.\n * @param {Float} options.endPoint.y - Ordonnée du point d'arrivée du calcul d'itinéraire.\n *\n * @param {Object[]} [options.viaPoints] - Liste de point ({x:Float,y:Float}) intermédaires que l'itinéraire doit emprunter dans l'ordre du tableau.\n * Coordonnées exprimées en longitudes, latitudes (EPSG:4326) :{x:float, y:float}\n *\n * @param {String} [options.graph = \"voiture\"] - Type de graphe utilisé : \"Voiture\" ou \"Pieton\".\n * Détermine le profil de vitesses utilisé pour le calcul ainsi que les tronçons autorisés ou non.\n * Par défaut, c'est la valeur \"Voiture\" qui sera utilisée.\n *\n * @param {String[]} [options.exclusions] - DEPRECATED: Critères d'exclusions à appliquer pour le calcul. (correspond au paramètre \"avoidFeature\" d'OpenLS)\n * On précise ici le type de tronçons que l'on ne veut pas que l'itinéraire emprunte\n * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »).\n * Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints\n *\n * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement \"banned\".\n * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement \"wayType\".\n * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement \"=\".\n * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement \"autoroute\".\n *\n * @param {Boolean} [options.geometryInInstructions = false] - Indique si la géométrie de l'itinéraire doit être reprise morceau par morceau dans les instructions.\n * (correspond au paramètre \"provideGeometry\" d'OpenLS) Par défaut : false.\n *\n * @param {Boolean} [options.provideBbox = true] - Indique si les instructions doivent être localisées par une bbox dans la réponse.\n * Par défaut : true.\n *\n * @param {String} [options.distanceUnit = \"m\"] - Indique si la distance doit être exprimée en km ou m dans la réponse.\n * Par défaut : m.\n * @param {String} [options.timeUnit = \"second\"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse. Il peut-être formatté hh:mm::ss avec la valeur standard.\n * Les valeurs possibles sont \"standard\", \"second\", \"minute\" ou \"hour\".\n * Par défaut : \"standard\".\n *\n * @param {String} [options.srs] - Système de coordonnées dans lequel les paramètres géographiques en entrée et la réponse du service sont exprimés.\n * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 'EPSG:4326'.\n *\n * @param {String[]} [options.waysAttributes] - Nom des attributs des voies. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'XHR',\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * resource : 'bdtopo'\n * outputFormat : 'json',\n * startPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * endPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * provideBbox : true,\n * exclusions : [\"Bridge\", \"Tunnel\", \"Toll\"],\n * distanceUnit : \"km\",\n * graph : \"Voiture\",\n * geometryInInstructions : true,\n * routePreference : \"fastest\"\n * };\n *\n */\nfunction Route (options) {\n if (!(this instanceof Route)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Route\"));\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"Route\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Route\");\n this.logger.trace(\"[Constructeur Route (options)]\");\n\n if (!options.startPoint) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.startPoint.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint.x\"));\n }\n\n if (options.startPoint.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint.y\"));\n }\n\n if (!options.endPoint) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.endPoint.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint.x\"));\n }\n\n if (options.endPoint.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint.y\"));\n }\n\n // options par defaut\n\n // on passe l'option outputFormat en minuscules afin d'éviter des exceptions.\n if (options.outputFormat && options.outputFormat !== \"json\") {\n this.logger.warn(\"options.outputFormat could only be json\");\n }\n this.options.outputFormat = \"json\";\n\n this.options.resource = options.resource || \"bdtopo-osrm\";\n this.options.startPoint = options.startPoint;\n this.options.endPoint = options.endPoint;\n this.options.viaPoints = options.viaPoints || [];\n this.options.routePreference = options.routePreference || \"fastest\";\n /** Gestion des anciennes valeurs de graph */\n if (options.graph) {\n if (options.graph === \"Voiture\") {\n this.options.graph = \"car\";\n }\n if (options.graph === \"Pieton\") {\n this.options.graph = \"pedestrian\";\n }\n } else {\n this.options.graph = \"car\";\n }\n this.options.constraints = [];\n if (options.constraints) {\n if (Array.isArray(options.constraints)) {\n for (var k = 0; k < options.constraints.length; k++) {\n this.options.constraints.push(options.constraints[k]);\n }\n } else {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"constraints\"));\n }\n }\n\n /** Gestion de l'ancien paramètre exclusion */\n var constraintTunnel = {};\n var constraintPont = {};\n var constraintAutoroute = {};\n if (options.exclusions) {\n if (options.exclusions.length !== 0) {\n this.logger.warn(\"options.exclusions is DEPRECATED !!\");\n for (var c = 0; c < options.exclusions.length; c++) {\n if (typeof options.exclusions[c] === \"string\") {\n options.exclusions[c] = options.exclusions[c].toLowerCase();\n } else {\n // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions\n continue;\n }\n if (options.exclusions[c] === \"toll\") {\n constraintAutoroute.constraintType = \"banned\";\n constraintAutoroute.key = \"wayType\";\n constraintAutoroute.operator = \"=\";\n constraintAutoroute.value = \"autoroute\";\n this.options.constraints.push(constraintAutoroute);\n }\n if (options.exclusions[c] === \"tunnel\") {\n constraintTunnel.constraintType = \"banned\";\n constraintTunnel.key = \"wayType\";\n constraintTunnel.operator = \"=\";\n constraintTunnel.value = \"tunnel\";\n this.options.constraints.push(constraintTunnel);\n }\n if (options.exclusions[c] === \"bridge\") {\n constraintPont.constraintType = \"banned\";\n constraintPont.key = \"wayType\";\n constraintPont.operator = \"=\";\n constraintPont.value = \"pont\";\n this.options.constraints.push(constraintPont);\n }\n }\n }\n }\n\n this.options.geometryInInstructions = options.geometryInInstructions || false;\n this.options.provideBbox = options.provideBbox || true;\n this.options.distanceUnit = options.distanceUnit || \"m\";\n this.options.timeUnit = options.timeUnit || \"second\";\n this.options.expectedStartTime = null; // FIXME not yet implemented !\n this.options.srs = options.srs || \"EPSG:4326\";\n this.options.waysAttributes = options.waysAttributes || [];\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n if (!this.options.serverUrl) {\n var UrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Route.url(\"calcul\");\n if (!UrlByDefault) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = UrlByDefault;\n this.logger.trace(\"Serveur URL par defaut : \" + this.options.serverUrl);\n }\n}\n\n/**\n * @lends module:Route#\n */\nRoute.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nRoute.prototype.constructor = Route;\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nRoute.prototype.buildRequest = function (error, success) {\n var options = {\n // spécifique au service\n resource : this.options.resource,\n startPoint : this.options.startPoint,\n endPoint : this.options.endPoint,\n viaPoints : this.options.viaPoints,\n provideBbox : this.options.provideBbox,\n constraints : this.options.constraints,\n distanceUnit : this.options.distanceUnit,\n timeUnit : this.options.timeUnit,\n graph : this.options.graph,\n geometryInInstructions : this.options.geometryInInstructions,\n routePreference : this.options.routePreference,\n srs : this.options.srs,\n waysAttributes : this.options.waysAttributes\n };\n\n this.request = _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n if (!this.request) {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")));\n } else {\n success.call(this, this.request);\n }\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nRoute.prototype.analyzeResponse = function (error, success) {\n // INFO\n // Factory pour masquer la complexité du retour du service\n\n if (this.response) {\n var options = {\n distanceUnit : this.options.distanceUnit,\n timeUnit : this.options.timeUnit,\n response : this.response,\n outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML !\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this,\n geometryInInstructions : this.options.geometryInInstructions\n };\n\n _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Route);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUm91dGUuanM/ZjE5YyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFDaUQ7QUFDSDtBQUNXO0FBQ1o7QUFDUTtBQUNXO0FBQ0c7O0FBRW5FO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYixXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO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IlBpZXRvblwiKSB7XG4gICAgICAgICAgICB0aGlzLm9wdGlvbnMuZ3JhcGggPSBcInBlZGVzdHJpYW5cIjtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIHRoaXMub3B0aW9ucy5ncmFwaCA9IFwiY2FyXCI7XG4gICAgfVxuICAgIHRoaXMub3B0aW9ucy5jb25zdHJhaW50cyA9IFtdO1xuICAgIGlmIChvcHRpb25zLmNvbnN0cmFpbnRzKSB7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9wdGlvbnMuY29uc3RyYWludHMpKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IG9wdGlvbnMuY29uc3RyYWludHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChvcHRpb25zLmNvbnN0cmFpbnRzW2tdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihfLmdldE1lc3NhZ2UoXCJQQVJBTV9UWVBFXCIsIFwiY29uc3RyYWludHNcIikpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqIEdlc3Rpb24gZGUgbCdhbmNpZW4gcGFyYW3DqHRyZSBleGNsdXNpb24gKi9cbiAgICB2YXIgY29uc3RyYWludFR1bm5lbCA9IHt9O1xuICAgIHZhciBjb25zdHJhaW50UG9udCA9IHt9O1xuICAgIHZhciBjb25zdHJhaW50QXV0b3JvdXRlID0ge307XG4gICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9ucykge1xuICAgICAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIud2FybihcIm9wdGlvbnMuZXhjbHVzaW9ucyBpcyBERVBSRUNBVEVEICEhXCIpO1xuICAgICAgICAgICAgZm9yICh2YXIgYyA9IDA7IGMgPCBvcHRpb25zLmV4Y2x1c2lvbnMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmV4Y2x1c2lvbnNbY10gPSBvcHRpb25zLmV4Y2x1c2lvbnNbY10udG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbiBuZSBjcsOpZSBwYXMgdW5lIGVycmV1ciBwb3VyIHLDqXRyby1jb21wYXRpYmlsaXTDqSBhdmVjIGxlcyBhbmNpZW5uZXMgdmVyc2lvbnNcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwidG9sbFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLm9wZXJhdG9yID0gXCI9XCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUudmFsdWUgPSBcImF1dG9yb3V0ZVwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChjb25zdHJhaW50QXV0b3JvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJ0dW5uZWxcIikge1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLmNvbnN0cmFpbnRUeXBlID0gXCJiYW5uZWRcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5rZXkgPSBcIndheVR5cGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5vcGVyYXRvciA9IFwiPVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLnZhbHVlID0gXCJ0dW5uZWxcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzLnB1c2goY29uc3RyYWludFR1bm5lbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwiYnJpZGdlXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC5rZXkgPSBcIndheVR5cGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQub3BlcmF0b3IgPSBcIj1cIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQudmFsdWUgPSBcInBvbnRcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzLnB1c2goY29uc3RyYWludFBvbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHRoaXMub3B0aW9ucy5nZW9tZXRyeUluSW5zdHJ1Y3Rpb25zID0gb3B0aW9ucy5nZW9tZXRyeUluSW5zdHJ1Y3Rpb25zIHx8IGZhbHNlO1xuICAgIHRoaXMub3B0aW9ucy5wcm92aWRlQmJveCA9IG9wdGlvbnMucHJvdmlkZUJib3ggfHwgdHJ1ZTtcbiAgICB0aGlzLm9wdGlv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WVyIGxhIGNvbXBsZXhpdMOpIGR1IHJldG91ciBkdSBzZXJ2aWNlXG5cbiAgICBpZiAodGhpcy5yZXNwb25zZSkge1xuICAgICAgICB2YXIgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgIGRpc3RhbmNlVW5pdCA6IHRoaXMub3B0aW9ucy5kaXN0YW5jZVVuaXQsXG4gICAgICAgICAgICB0aW1lVW5pdCA6IHRoaXMub3B0aW9ucy50aW1lVW5pdCxcbiAgICAgICAgICAgIHJlc3BvbnNlIDogdGhpcy5yZXNwb25zZSxcbiAgICAgICAgICAgIG91dHB1dEZvcm1hdCA6IHRoaXMub3B0aW9ucy5vdXRwdXRGb3JtYXQsIC8vIHV0aWxlIHBvdXIgcGFyc2VyIGxhIHN0cmluZyBlbiBtb2RlIFhIUiA6IEpTT04gb3UgWE1MICFcbiAgICAgICAgICAgIHJhd1Jlc3BvbnNlIDogdGhpcy5vcHRpb25zLnJhd1Jlc3BvbnNlLFxuICAgICAgICAgICAgb25FcnJvciA6IGVycm9yLFxuICAgICAgICAgICAgb25TdWNjZXNzIDogc3VjY2VzcyxcbiAgICAgICAgICAgIHNjb3BlIDogdGhpcyxcbiAgICAgICAgICAgIGdlb21ldHJ5SW5JbnN0cnVjdGlvbnMgOiB0aGlzLm9wdGlvbnMuZ2VvbWV0cnlJbkluc3RydWN0aW9uc1xuICAgICAgICB9O1xuXG4gICAgICAgIFJvdXRlUmVzcG9uc2VGYWN0b3J5LmJ1aWxkKG9wdGlvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShfLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgUm91dGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Route.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/RouteRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestFactory.js\");\n/* harmony import */ var _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/RouteResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Route/Response/RouteResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'itinéraire du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n *\n * @alias Gp.Services.Route\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service itineraire : 'json' uniquement et par défaut.\n *\n * @param {String} [options.routePreference = \"fastest\"] - Mode de calcul à utiliser :\n * - le plus rapide « fastest »\n * - le plus court « shortest »\n * Par défaut : « fastest ».\n *\n * @param {Object} options.startPoint - Point de départ du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.startPoint.x - Abcisse du point de départ du calcul d'itinéraire.\n * @param {Float} options.startPoint.y - Ordonnée du point de départ du calcul d'itinéraire.\n *\n * @param {Object} options.endPoint - Point d'arrivée du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.endPoint.x - Abcisse du point d'arrivée du calcul d'itinéraire.\n * @param {Float} options.endPoint.y - Ordonnée du point d'arrivée du calcul d'itinéraire.\n *\n * @param {Object[]} [options.viaPoints] - Liste de point ({x:Float,y:Float}) intermédaires que l'itinéraire doit emprunter dans l'ordre du tableau.\n * Coordonnées exprimées en longitudes, latitudes (EPSG:4326) :{x:float, y:float}\n *\n * @param {String} [options.graph = \"voiture\"] - Type de graphe utilisé : \"Voiture\" ou \"Pieton\".\n * Détermine le profil de vitesses utilisé pour le calcul ainsi que les tronçons autorisés ou non.\n * Par défaut, c'est la valeur \"Voiture\" qui sera utilisée.\n *\n * @param {String[]} [options.exclusions] - DEPRECATED: Critères d'exclusions à appliquer pour le calcul. (correspond au paramètre \"avoidFeature\" d'OpenLS)\n * On précise ici le type de tronçons que l'on ne veut pas que l'itinéraire emprunte\n * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »).\n * Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints\n *\n * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement \"banned\".\n * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement \"wayType\".\n * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement \"=\".\n * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement \"autoroute\".\n *\n * @param {Boolean} [options.geometryInInstructions = false] - Indique si la géométrie de l'itinéraire doit être reprise morceau par morceau dans les instructions.\n * (correspond au paramètre \"provideGeometry\" d'OpenLS) Par défaut : false.\n *\n * @param {Boolean} [options.provideBbox = true] - Indique si les instructions doivent être localisées par une bbox dans la réponse.\n * Par défaut : true.\n *\n * @param {String} [options.distanceUnit = \"m\"] - Indique si la distance doit être exprimée en km ou m dans la réponse.\n * Par défaut : m.\n * @param {String} [options.timeUnit = \"second\"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse. Il peut-être formatté hh:mm::ss avec la valeur standard.\n * Les valeurs possibles sont \"standard\", \"second\", \"minute\" ou \"hour\".\n * Par défaut : \"standard\".\n *\n * @param {String} [options.srs] - Système de coordonnées dans lequel les paramètres géographiques en entrée et la réponse du service sont exprimés.\n * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 'EPSG:4326'.\n *\n * @param {String[]} [options.waysAttributes] - Nom des attributs des voies. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'XHR',\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * resource : 'bdtopo'\n * outputFormat : 'json',\n * startPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * endPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * provideBbox : true,\n * exclusions : [\"Bridge\", \"Tunnel\", \"Toll\"],\n * distanceUnit : \"km\",\n * graph : \"Voiture\",\n * geometryInInstructions : true,\n * routePreference : \"fastest\"\n * };\n *\n */\nfunction Route (options) {\n if (!(this instanceof Route)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Route\"));\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"Route\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Route\");\n this.logger.trace(\"[Constructeur Route (options)]\");\n\n if (!options.startPoint) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.startPoint.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint.x\"));\n }\n\n if (options.startPoint.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint.y\"));\n }\n\n if (!options.endPoint) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.endPoint.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint.x\"));\n }\n\n if (options.endPoint.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint.y\"));\n }\n\n // options par defaut\n\n // on passe l'option outputFormat en minuscules afin d'éviter des exceptions.\n if (options.outputFormat && options.outputFormat !== \"json\") {\n this.logger.warn(\"options.outputFormat could only be json\");\n }\n this.options.outputFormat = \"json\";\n\n this.options.resource = options.resource || \"bdtopo-osrm\";\n this.options.startPoint = options.startPoint;\n this.options.endPoint = options.endPoint;\n this.options.viaPoints = options.viaPoints || [];\n this.options.routePreference = options.routePreference || \"fastest\";\n /** Gestion des anciennes valeurs de graph */\n if (options.graph) {\n if (options.graph === \"Voiture\") {\n this.options.graph = \"car\";\n }\n if (options.graph === \"Pieton\") {\n this.options.graph = \"pedestrian\";\n }\n } else {\n this.options.graph = \"car\";\n }\n this.options.constraints = [];\n if (options.constraints) {\n if (Array.isArray(options.constraints)) {\n for (var k = 0; k < options.constraints.length; k++) {\n this.options.constraints.push(options.constraints[k]);\n }\n } else {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"constraints\"));\n }\n }\n\n /** Gestion de l'ancien paramètre exclusion */\n var constraintTunnel = {};\n var constraintPont = {};\n var constraintAutoroute = {};\n if (options.exclusions) {\n if (options.exclusions.length !== 0) {\n this.logger.warn(\"options.exclusions is DEPRECATED !!\");\n for (var c = 0; c < options.exclusions.length; c++) {\n if (typeof options.exclusions[c] === \"string\") {\n options.exclusions[c] = options.exclusions[c].toLowerCase();\n } else {\n // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions\n continue;\n }\n if (options.exclusions[c] === \"toll\") {\n constraintAutoroute.constraintType = \"banned\";\n constraintAutoroute.key = \"wayType\";\n constraintAutoroute.operator = \"=\";\n constraintAutoroute.value = \"autoroute\";\n this.options.constraints.push(constraintAutoroute);\n }\n if (options.exclusions[c] === \"tunnel\") {\n constraintTunnel.constraintType = \"banned\";\n constraintTunnel.key = \"wayType\";\n constraintTunnel.operator = \"=\";\n constraintTunnel.value = \"tunnel\";\n this.options.constraints.push(constraintTunnel);\n }\n if (options.exclusions[c] === \"bridge\") {\n constraintPont.constraintType = \"banned\";\n constraintPont.key = \"wayType\";\n constraintPont.operator = \"=\";\n constraintPont.value = \"pont\";\n this.options.constraints.push(constraintPont);\n }\n }\n }\n }\n\n this.options.geometryInInstructions = options.geometryInInstructions || false;\n this.options.provideBbox = options.provideBbox || true;\n this.options.distanceUnit = options.distanceUnit || \"m\";\n this.options.timeUnit = options.timeUnit || \"second\";\n this.options.expectedStartTime = null; // FIXME not yet implemented !\n this.options.srs = options.srs || \"EPSG:4326\";\n this.options.waysAttributes = options.waysAttributes || [];\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n if (!this.options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire\n /* var UrlByDefault = DefaultUrlService.Route.newUrl();\n if (this.options.oldRouteService) {\n UrlByDefault = DefaultUrlService.Route.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire\n var UrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Route.url();\n\n if (!UrlByDefault) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = UrlByDefault;\n this.logger.trace(\"Serveur URL par defaut : \" + this.options.serverUrl);\n }\n}\n\n/**\n * @lends module:Route#\n */\nRoute.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nRoute.prototype.constructor = Route;\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nRoute.prototype.buildRequest = function (error, success) {\n var options = {\n // spécifique au service\n resource : this.options.resource,\n startPoint : this.options.startPoint,\n endPoint : this.options.endPoint,\n viaPoints : this.options.viaPoints,\n provideBbox : this.options.provideBbox,\n constraints : this.options.constraints,\n distanceUnit : this.options.distanceUnit,\n timeUnit : this.options.timeUnit,\n graph : this.options.graph,\n geometryInInstructions : this.options.geometryInInstructions,\n routePreference : this.options.routePreference,\n srs : this.options.srs,\n waysAttributes : this.options.waysAttributes\n };\n\n this.request = _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n if (!this.request) {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")));\n } else {\n success.call(this, this.request);\n }\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nRoute.prototype.analyzeResponse = function (error, success) {\n // INFO\n // Factory pour masquer la complexité du retour du service\n\n if (this.response) {\n var options = {\n distanceUnit : this.options.distanceUnit,\n timeUnit : this.options.timeUnit,\n response : this.response,\n outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML !\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this,\n geometryInInstructions : this.options.geometryInInstructions\n };\n\n _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Route);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUm91dGUuanM/ZjE5YyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFDaUQ7QUFDS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IHZhciBjb25zdHJhaW50UG9udCA9IHt9O1xuICAgIHZhciBjb25zdHJhaW50QXV0b3JvdXRlID0ge307XG4gICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9ucykge1xuICAgICAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIud2FybihcIm9wdGlvbnMuZXhjbHVzaW9ucyBpcyBERVBSRUNBVEVEICEhXCIpO1xuICAgICAgICAgICAgZm9yICh2YXIgYyA9IDA7IGMgPCBvcHRpb25zLmV4Y2x1c2lvbnMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmV4Y2x1c2lvbnNbY10gPSBvcHRpb25zLmV4Y2x1c2lvbnNbY10udG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbiBuZSBjcsOpZSBwYXMgdW5lIGVycmV1ciBwb3VyIHLDqXRyby1jb21wYXRpYmlsaXTDqSBhdmVjIGxlcyBhbmNpZW5uZXMgdmVyc2lvbnNcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwidG9sbFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLm9wZXJhdG9yID0gXCI9XCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUudmFsdWUgPSBcImF1dG9yb3V0ZVwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChjb25zdHJhaW50QXV0b3JvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJ0dW5uZWxcIikge1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLmNvbnN0cmFpbnRUeXBlID0gXCJiYW5uZWRcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5rZXkgPSBcIndheVR5cGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5vcGVyYXRvciA9IFwiPVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLnZhbHVlID0gXCJ0dW5uZWxcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzLnB1c2goY29uc3RyYWludFR1bm5lbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwiYnJpZGdlXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC5rZXkgPSBcIndheVR5cGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQub3BlcmF0b3IgPSBcIj1cIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFBvbnQudmFsdWUgPSBcInBvbnRcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzLnB1c2goY29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gICAgICAgICByZXNwb25zZSA6IHRoaXMucmVzcG9uc2UsXG4gICAgICAgICAgICBvdXRwdXRGb3JtYXQgOiB0aGlzLm9wdGlvbnMub3V0cHV0Rm9ybWF0LCAvLyB1dGlsZSBwb3VyIHBhcnNlciBsYSBzdHJpbmcgZW4gbW9kZSBYSFIgOiBKU09OIG91IFhNTCAhXG4gICAgICAgICAgICByYXdSZXNwb25zZSA6IHRoaXMub3B0aW9ucy5yYXdSZXNwb25zZSxcbiAgICAgICAgICAgIG9uRXJyb3IgOiBlcnJvcixcbiAgICAgICAgICAgIG9uU3VjY2VzcyA6IHN1Y2Nlc3MsXG4gICAgICAgICAgICBzY29wZSA6IHRoaXMsXG4gICAgICAgICAgICBnZW9tZXRyeUluSW5zdHJ1Y3Rpb25zIDogdGhpcy5vcHRpb25zLmdlb21ldHJ5SW5JbnN0cnVjdGlvbnNcbiAgICAgICAgfTtcblxuICAgICAgICBSb3V0ZVJlc3BvbnNlRmFjdG9yeS5idWlsZChvcHRpb25zKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBlcnJvci5jYWxsKHRoaXMsIG5ldyBFcnJvclNlcnZpY2UoXy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FTVBUWVwiKSkpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFJvdXRlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Route.js\n"); /***/ }), @@ -763,7 +775,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Config_Config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Config/Config */ \"./node_modules/geoportal-access-lib/src/Services/Config/Config.js\");\n/* harmony import */ var _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Alti/Alti */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js\");\n/* harmony import */ var _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Geocode/Geocode */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js\");\n/* harmony import */ var _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Geocode/ReverseGeocode */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js\");\n/* harmony import */ var _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AutoComplete/AutoComplete */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js\");\n/* harmony import */ var _Route_Route__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Route/Route */ \"./node_modules/geoportal-access-lib/src/Services/Route/Route.js\");\n/* harmony import */ var _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProcessIsoCurve/ProcessIsoCurve */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js\");\n/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"point|circle|bbox\" }] */\n\n/**\n* Geoportal web services invocation namespace.\n*\n* @module Services\n* @alias Gp.Services\n*/\n\n\n\n\n\n\n\n\nvar Services = {\n /**\n * Access to Geoportal resources metadata availables with one ore several keys\n *\n * @method getConfig\n * @param {Object} options - Options for function call.\n * @param {String} [options.apiKey] - Access key(s) (\",\" as separator, no spaces) to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}\n * @param {String} [options.customConfigFile] - path to a local config file. Overload the apiKey parameter\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GetConfigResponse} object as a parameter except if \"rawResponse\" parameter is set to true : a String will be returned.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n */\n getConfig : function (options) {\n var configService = new _Config_Config__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options);\n configService.call();\n },\n /**\n * Getting elevations in or along of one or several points on french territories using the [elevation services of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/alti.html}.
\n * Two use cases are availables :
\n * 1. getting elevations of the given points : don't use the options.sampling parameter ;
\n * 2. getting a regular set of elevations along the given points : use the options.sampling parameter.\n *\n * @method getAltitude\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {Array.} options.positions - Array of positions ({lon:float, lat:float}) expressed in CRS:84 coordinates system, where to get elevations. 50 positions maximum may be given. 2 positions minimum are required if you use the options.sampling parameter.\n * @param {Number} [options.sampling] - Number of points to use (between 2 and 5000) in order to compute an elevation path. The points given with the options.positions parameter are used to fix the planimetric path along which the elevations will be computed.
\n * If not used, only elevations of these positions will be returned.\n * @param {Boolean} [options.zonly=false] - Set this parameter to true if you only want to have elevations returned without corresponding coordinates.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AltiResponse} object as a parameter, except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/alti/rest/elevation.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n * @param {String} [options.api='REST'] - What API to use for interacting with underlying web service : 'REST' or 'WPS'. Only use if you know what you are doing.\n * @param {String} [options.outputFormat='xml'] - Output format for underlying web service response : 'xml' or 'json'. Only use if you know what you are doing.\n */\n getAltitude : function (options) {\n var altiService = new _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__[\"default\"](options);\n altiService.call();\n },\n /**\n * Getting positon of a geographic identifier (places names, address, cadastral parcel, other...) using the [geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage.html}.\n *\n * @example\n * Gp.Services.geocode ({\n * apiKey : \"carte\",\n * location : \"73 avenue de Paris, Saint-Mandé\",\n * // traitement des resultats\n * onSuccess : function (result) {\n * console.log(\"found (x:\"+result.position.x+\", y:\"+result.position.y+\")\") ;\n * }\n * }) ;\n *\n *\n * @method geocode\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.index=\"StreetAddress\"] - Geographical identifier type to search. Values currently availables are : \"PositionOfInterest\" for place names, \"StreetAddress\" for address search, \"CadastralParcel\" for Cadastral parcels search, \"location\" for a multi-index search on \"StreetAddress\" and \"PositionOfInterest\". Default is \"StreetAddress\".\n * @param {String} options.query - Geographic identifier to locate.\n * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given.\n * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be \"String\".\n *

\n * Properties availables for address search :
\n * \"postalCode\", \"inseeCode\" and \"city\".\n *

\n * Properties availables for place names search :
\n * \"postalCode\", \"inseeCode\" and \"type\".\n *

\n * Properties availables for cadastral parcels search :
\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided.\n * @param {Boolean} [options.returnTrueGeometry=false] - Set this parameter to true if you wish to have the true geometrie returned.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n geocode : function (options) {\n var geocodeService = new _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__[\"default\"](options);\n geocodeService.call();\n },\n /**\n * Retrieving geographical identifiers (place names, address, cadastral parcels, ...) near a given position, using the [reverse geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage-inverse.html}.\n *\n * @method reverseGeocode\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.index=\"StreetAddress\"] - Geographical identifier type to search. Values currently availables are : \"PositionOfInterest\" for place names, \"StreetAddress\" for address search, \"CadastralParcel\" for Cadastral parcels search, \"location\" for a multi-index search on \"StreetAddress\" and \"PositionOfInterest\". Default is \"StreetAddress\".\n * @param {Object} options.position - Reference position where to search geographical identifiers.\n * @param {Float} options.position.lon - Longitude\n * @param {Float} options.position.lat - Latitude\n * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given.\n * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be \"String\".\n *

\n * Properties availables for address search :
\n * \"postalCode\", \"inseeCode\" and \"city\".\n *

\n * Properties availables for place names search :
\n * \"postalCode\", \"inseeCode\" and \"type\".\n *

\n * Properties availables for cadastral parcels search :
\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n * @param {Object} [options.searchGeometry] - Location where to perform the search.\n * @param {String} options.searchGeometry.type - Geometry type (Point|Circle|Linestring|Polygon)\n * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordinates\n * @param {Float} [options.searchGeometry.radius] - Radius (only for type 'Circle')\n * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n reverseGeocode : function (options) {\n var reverseGeocodeService = new _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__[\"default\"](options);\n reverseGeocodeService.call();\n },\n /**\n * Getting suggestions of probable places names or address based on uncomplete texts, using the [autocompletion service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/autocompletion.html}\n *\n * @method autoComplete\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} options.text - Text input to complete.\n * @param {Array.} [options.filterOptions.type = \"StreetAddress\"] - Suggestion types to provide : address (\"StreetAddress\") and/or place name (\"PositionOfInterest\").\n * @param {Array.} [options.filterOptions.territory] - Places where to limit the search of suggestions : \"METROPOLE\" (Corsica and metropolitan France), \"DOMTOM\" (French overseas departments and territories), or an INSEE code of a department. No limitation by default. For instance : ['METROPOLE', '31']\n * @param {Number} [options.maximumResponses = 10] - Maximum number of responses.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AutoCompleteResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/ols/apis/completion] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n autoComplete : function (options) {\n var autoCompleteService = new _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__[\"default\"](options);\n autoCompleteService.call();\n },\n /**\n * Getting a route from one point to another using the [route service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/itineraires.html}.\n *\n * @method route\n * @param {Object} options - Options for function call.\n * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.routePreference = \"fastest\"] - Indicates the way to compute the route : \"fastest\" (time optimisation) or \"shortest\" (distance optimisation). Available values are in the GetCapabilities.\n * @param {Gp.Point} options.startPoint - Start point of the route. Expressed in CRS:84 coordinates system (startPoint.x corresponds to longitude, startPoint.y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {Gp.Point} options.endPoint - End point of the route. Expressed in CRS:84 coordinates system (endPoint.x corresponds to longitude, endPoint.y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {Array.} [options.viaPoints] - Ordered via Points of the route. Expressed in CRS:84 coordinates system (viaPoints[i].x corresponds to longitude, viaPoints[i].y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {String} [options.graph = \"Voiture\"] - User profile to use to compute the route : \"Voiture\" (using a vehicule) or \"Pieton\" (pedestrian). Has an influence on the kind of roads the route may use and the average speed. Available bbox are in the GetCapabilities.\n * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features (\"toll\", \"bridge\" or \"tunnel\").\n * @param {Boolean} [options.geometryInInstructions = false] - Indicates if route geometry has to be also returned with route instructions.\n * @param {Boolean} [options.provideBoundingBox = true] - Indicates if route instructions has to be localised with a BBOX in the response.\n * @param {String} [options.distanceUnit = \"m\"] - The unit used to provide distances in the response (\"meter\" or \"kilometer\").\n * @param {String} [options.timeUnit = \"second\"] - The unit used to provide duration in the response (\"standard\", \"second\", \"minute\", \"hour\").\n * @param {Array.} [options.waysAttributes] - Way Attributes to add in the response. Available values are in the GetCapabilities.\n * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.RouteResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.outputFormat='json'] - Output format (\"json\" or \"xml\") to use for underlying webService. Only use if you know what you are doing.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/itineraire/rest/route.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n route : function (options) {\n var routeService = new _Route_Route__WEBPACK_IMPORTED_MODULE_5__[\"default\"](options);\n routeService.call();\n },\n /**\n * Computing a set of places (curve) reachable from a given point (or from where to start to reach a given point) within a time or distance constraint using the [isochrone service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/isochrones.html}.\n *\n * @method isoCurve\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities.\n * @param {Gp.Point} options.position - Start or Arrival (options.reverse===true) Point for the computing. Expressed in CRS:84 coordinates system (position.x corresponds to longitude, position.y corresponds to latitude).\n * @param {String} [options.graph = \"Voiture\"] - User profile to use to compute the isoCurve : \"Voiture\" (using a vehicule) or \"Pieton\" (pedestrian). Has an influence on the kind of roads to use and the average speed. Available values are in the GetCapabilities.\n * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features (\"toll\", \"bridge\" or \"tunnel\").\n * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities.\n * @param {String} [options.method = \"time\"] - Computing method to use : \"time\" (using a duration as a constraint) or \"distance\" (using a distance as a constraint). Available values are in the GetCapabilities.\n * @param {Float} options.time - Maximum duration (expressed in seconds) to use when options.method is set to \"time\".\n * @param {Float} options.distance - Maximum distance (expressed in meters) to use when options.method is set to \"distance\".\n * @param {Boolean} [options.reverse = false] - Set this parameter to true if you want options.position to be the destination (instead of departure) for the computing.\n * @param {String} [options.distanceUnit = \"km\"] - The unit used to provide distances in the response (\"m\" or \"km\").\n * @param {String} [options.timeUnit = \"second\"] - The unit used to provide duration in the response (\"standard\", \"second\", \"minute\", \"hour\").\n * @param {Boolean} [options.smoothing = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry to be smoothed.\n * @param {Boolean} [options.holes = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry (polygon) to have holes if pertinent.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.IsoCurveResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.outputFormat='json'] - Output format (\"json\") to use for underlying webService. Only use if you know what you are doing.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/isochrone/isochrone.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n isoCurve : function (options) {\n var processIsoCurveService = new _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__[\"default\"](options);\n processIsoCurveService.call();\n }\n};\n\n/**\n * Point object.\n *\n * @namespace\n * @alias Gp.Point\n *\n * @property {Float} x - Point abscissa\n * @property {Float} y - Point ordinate\n */\nvar point = {};\n\n/**\n * Circle object.\n *\n * @namespace\n * @alias Gp.Circle\n *\n * @property {Float} x - Circle center abscissa.\n * @property {Float} y - Circle center ordinate.\n * @property {Float} radius - Circle radius.\n */\nvar circle = {};\n\n/**\n * Bounding box object, expressed with four coordinates.\n *\n * @namespace\n * @alias Gp.BBox\n *\n * @property {Float} left - minimum abscissa\n * @property {Float} right - maximum abscissa\n * @property {Float} bottom - minimum ordinate\n * @property {Float} top - maximum ordinate\n */\nvar bbox = {};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Services);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvU2VydmljZXMuanM/YmMwOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEscUNBQXFDLDJDQUEyQzs7QUFFaEY7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ3FDO0FBQ047QUFDUztBQUNjO0FBQ0M7QUFDckI7QUFDOEI7O0FBRWhFO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPLHVHQUF1RztBQUM3SCxlQUFlLE9BQU87QUFDdEIsZUFBZSxTQUFTLHlGQUF5RixvQ0FBb0M7QUFDckosZUFBZSxTQUFTLDhIQUE4SCxlQUFlO0FBQ3JLLGVBQWUsT0FBTztBQUN0QjtBQUNBO0FBQ0EsZ0NBQWdDLHNEQUFNO0FBQ3RDO0FBQ0EsS0FBSztBQUNMO0FBQ0EsOElBQThJLHFFQUFxRTtBQUNuTjtBQUNBLDZGQUE2RjtBQUM3RjtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPLG9FQUFvRSw4Q0FBOEM7QUFDeEksZUFBZSxlQUFlLDBDQUEwQyxxQkFBcUI7QUFDN0YsZUFBZSxPQUFPO0FBQ3RCO0FBQ0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m9wZXJ0eSB7RmxvYXR9IGxlZnQgLSBtaW5pbXVtIGFic2Npc3NhXG4gKiBAcHJvcGVydHkge0Zsb2F0fSByaWdodCAtIG1heGltdW0gYWJzY2lzc2FcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IGJvdHRvbSAtIG1pbmltdW0gb3JkaW5hdGVcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IHRvcCAtIG1heGltdW0gb3JkaW5hdGVcbiAqL1xudmFyIGJib3ggPSB7fTtcblxuZXhwb3J0IGRlZmF1bHQgU2VydmljZXM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Services.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Config_Config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Config/Config */ \"./node_modules/geoportal-access-lib/src/Services/Config/Config.js\");\n/* harmony import */ var _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Alti/Alti */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js\");\n/* harmony import */ var _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Geocode/Geocode */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js\");\n/* harmony import */ var _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Geocode/ReverseGeocode */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js\");\n/* harmony import */ var _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AutoComplete/AutoComplete */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js\");\n/* harmony import */ var _Route_Route__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Route/Route */ \"./node_modules/geoportal-access-lib/src/Services/Route/Route.js\");\n/* harmony import */ var _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProcessIsoCurve/ProcessIsoCurve */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js\");\n/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"point|circle|bbox\" }] */\n\n/**\n* Geoportal web services invocation namespace.\n*\n* @module Services\n* @alias Gp.Services\n*/\n\n\n\n\n\n\n\n\nvar Services = {\n /**\n * Access to Geoportal resources metadata availables with one ore several keys\n *\n * @method getConfig\n * @param {Object} options - Options for function call.\n * @param {String} [options.apiKey] - Access key(s) (\",\" as separator, no spaces) to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}\n * @param {String} [options.customConfigFile] - path to a local config file. Overload the apiKey parameter\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GetConfigResponse} object as a parameter except if \"rawResponse\" parameter is set to true : a String will be returned.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n */\n getConfig : function (options) {\n var configService = new _Config_Config__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options);\n configService.call();\n },\n /**\n * Getting elevations in or along of one or several points on french territories using the [elevation services of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/alti.html}.
\n * Two use cases are availables :
\n * 1. getting elevations of the given points : don't use the options.sampling parameter ;
\n * 2. getting a regular set of elevations along the given points : use the options.sampling parameter.\n *\n * @method getAltitude\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {Array.} options.positions - Array of positions ({lon:float, lat:float}) expressed in CRS:84 coordinates system, where to get elevations. 50 positions maximum may be given. 2 positions minimum are required if you use the options.sampling parameter.\n * @param {Number} [options.sampling] - Number of points to use (between 2 and 5000) in order to compute an elevation path. The points given with the options.positions parameter are used to fix the planimetric path along which the elevations will be computed.
\n * If not used, only elevations of these positions will be returned.\n * @param {Boolean} [options.zonly=false] - Set this parameter to true if you only want to have elevations returned without corresponding coordinates.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AltiResponse} object as a parameter, except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/alti/rest/elevation.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n * @param {String} [options.api='REST'] - What API to use for interacting with underlying web service : 'REST'. Only use if you know what you are doing.\n * @param {String} [options.outputFormat='xml'] - Output format for underlying web service response : 'xml' or 'json'. Only use if you know what you are doing.\n */\n getAltitude : function (options) {\n var altiService = new _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__[\"default\"](options);\n altiService.call();\n },\n /**\n * Getting positon of a geographic identifier (places names, address, cadastral parcel, other...) using the [geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage.html}.\n *\n * @example\n * Gp.Services.geocode ({\n * apiKey : \"carte\",\n * location : \"73 avenue de Paris, Saint-Mandé\",\n * // traitement des resultats\n * onSuccess : function (result) {\n * console.log(\"found (x:\"+result.position.x+\", y:\"+result.position.y+\")\") ;\n * }\n * }) ;\n *\n *\n * @method geocode\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.index=\"StreetAddress\"] - Geographical identifier type to search. Values currently availables are : \"PositionOfInterest\" for place names, \"StreetAddress\" for address search, \"CadastralParcel\" for Cadastral parcels search, \"location\" for a multi-index search on \"StreetAddress\" and \"PositionOfInterest\". Default is \"StreetAddress\".\n * @param {String} options.query - Geographic identifier to locate.\n * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given.\n * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be \"String\".\n *

\n * Properties availables for address search :
\n * \"postalCode\", \"inseeCode\" and \"city\".\n *

\n * Properties availables for place names search :
\n * \"postalCode\", \"inseeCode\" and \"type\".\n *

\n * Properties availables for cadastral parcels search :
\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided.\n * @param {Boolean} [options.returnTrueGeometry=false] - Set this parameter to true if you wish to have the true geometrie returned.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n geocode : function (options) {\n var geocodeService = new _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__[\"default\"](options);\n geocodeService.call();\n },\n /**\n * Retrieving geographical identifiers (place names, address, cadastral parcels, ...) near a given position, using the [reverse geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage-inverse.html}.\n *\n * @method reverseGeocode\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.index=\"StreetAddress\"] - Geographical identifier type to search. Values currently availables are : \"PositionOfInterest\" for place names, \"StreetAddress\" for address search, \"CadastralParcel\" for Cadastral parcels search, \"location\" for a multi-index search on \"StreetAddress\" and \"PositionOfInterest\". Default is \"StreetAddress\".\n * @param {Object} options.position - Reference position where to search geographical identifiers.\n * @param {Float} options.position.lon - Longitude\n * @param {Float} options.position.lat - Latitude\n * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given.\n * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be \"String\".\n *

\n * Properties availables for address search :
\n * \"postalCode\", \"inseeCode\" and \"city\".\n *

\n * Properties availables for place names search :
\n * \"postalCode\", \"inseeCode\" and \"type\".\n *

\n * Properties availables for cadastral parcels search :
\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n * @param {Object} [options.searchGeometry] - Location where to perform the search.\n * @param {String} options.searchGeometry.type - Geometry type (Point|Circle|Linestring|Polygon)\n * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordinates\n * @param {Float} [options.searchGeometry.radius] - Radius (only for type 'Circle')\n * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n reverseGeocode : function (options) {\n var reverseGeocodeService = new _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__[\"default\"](options);\n reverseGeocodeService.call();\n },\n /**\n * Getting suggestions of probable places names or address based on uncomplete texts, using the [autocompletion service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/autocompletion.html}\n *\n * @method autoComplete\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} options.text - Text input to complete.\n * @param {Array.} [options.filterOptions.type = \"StreetAddress\"] - Suggestion types to provide : address (\"StreetAddress\") and/or place name (\"PositionOfInterest\").\n * @param {Array.} [options.filterOptions.territory] - Places where to limit the search of suggestions : \"METROPOLE\" (Corsica and metropolitan France), \"DOMTOM\" (French overseas departments and territories), or an INSEE code of a department. No limitation by default. For instance : ['METROPOLE', '31']\n * @param {Number} [options.maximumResponses = 10] - Maximum number of responses.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AutoCompleteResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/ols/apis/completion] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n autoComplete : function (options) {\n var autoCompleteService = new _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__[\"default\"](options);\n autoCompleteService.call();\n },\n /**\n * Getting a route from one point to another using the [route service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/itineraires.html}.\n *\n * @method route\n * @param {Object} options - Options for function call.\n * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.routePreference = \"fastest\"] - Indicates the way to compute the route : \"fastest\" (time optimisation) or \"shortest\" (distance optimisation). Available values are in the GetCapabilities.\n * @param {Gp.Point} options.startPoint - Start point of the route. Expressed in CRS:84 coordinates system (startPoint.x corresponds to longitude, startPoint.y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {Gp.Point} options.endPoint - End point of the route. Expressed in CRS:84 coordinates system (endPoint.x corresponds to longitude, endPoint.y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {Array.} [options.viaPoints] - Ordered via Points of the route. Expressed in CRS:84 coordinates system (viaPoints[i].x corresponds to longitude, viaPoints[i].y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {String} [options.graph = \"Voiture\"] - User profile to use to compute the route : \"Voiture\" (using a vehicule) or \"Pieton\" (pedestrian). Has an influence on the kind of roads the route may use and the average speed. Available bbox are in the GetCapabilities.\n * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features (\"toll\", \"bridge\" or \"tunnel\").\n * @param {Boolean} [options.geometryInInstructions = false] - Indicates if route geometry has to be also returned with route instructions.\n * @param {Boolean} [options.provideBoundingBox = true] - Indicates if route instructions has to be localised with a BBOX in the response.\n * @param {String} [options.distanceUnit = \"m\"] - The unit used to provide distances in the response (\"meter\" or \"kilometer\").\n * @param {String} [options.timeUnit = \"second\"] - The unit used to provide duration in the response (\"standard\", \"second\", \"minute\", \"hour\").\n * @param {Array.} [options.waysAttributes] - Way Attributes to add in the response. Available values are in the GetCapabilities.\n * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.RouteResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.outputFormat='json'] - Output format (\"json\" or \"xml\") to use for underlying webService. Only use if you know what you are doing.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/itineraire/rest/route.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n route : function (options) {\n var routeService = new _Route_Route__WEBPACK_IMPORTED_MODULE_5__[\"default\"](options);\n routeService.call();\n },\n /**\n * Computing a set of places (curve) reachable from a given point (or from where to start to reach a given point) within a time or distance constraint using the [isochrone service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/isochrones.html}.\n *\n * @method isoCurve\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities.\n * @param {Gp.Point} options.position - Start or Arrival (options.reverse===true) Point for the computing. Expressed in CRS:84 coordinates system (position.x corresponds to longitude, position.y corresponds to latitude).\n * @param {String} [options.graph = \"Voiture\"] - User profile to use to compute the isoCurve : \"Voiture\" (using a vehicule) or \"Pieton\" (pedestrian). Has an influence on the kind of roads to use and the average speed. Available values are in the GetCapabilities.\n * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features (\"toll\", \"bridge\" or \"tunnel\").\n * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities.\n * @param {String} [options.method = \"time\"] - Computing method to use : \"time\" (using a duration as a constraint) or \"distance\" (using a distance as a constraint). Available values are in the GetCapabilities.\n * @param {Float} options.time - Maximum duration (expressed in seconds) to use when options.method is set to \"time\".\n * @param {Float} options.distance - Maximum distance (expressed in meters) to use when options.method is set to \"distance\".\n * @param {Boolean} [options.reverse = false] - Set this parameter to true if you want options.position to be the destination (instead of departure) for the computing.\n * @param {String} [options.distanceUnit = \"km\"] - The unit used to provide distances in the response (\"m\" or \"km\").\n * @param {String} [options.timeUnit = \"second\"] - The unit used to provide duration in the response (\"standard\", \"second\", \"minute\", \"hour\").\n * @param {Boolean} [options.smoothing = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry to be smoothed.\n * @param {Boolean} [options.holes = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry (polygon) to have holes if pertinent.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.IsoCurveResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.outputFormat='json'] - Output format (\"json\") to use for underlying webService. Only use if you know what you are doing.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/isochrone/isochrone.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n isoCurve : function (options) {\n var processIsoCurveService = new _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__[\"default\"](options);\n processIsoCurveService.call();\n }\n};\n\n/**\n * Point object.\n *\n * @namespace\n * @alias Gp.Point\n *\n * @property {Float} x - Point abscissa\n * @property {Float} y - Point ordinate\n */\nvar point = {};\n\n/**\n * Circle object.\n *\n * @namespace\n * @alias Gp.Circle\n *\n * @property {Float} x - Circle center abscissa.\n * @property {Float} y - Circle center ordinate.\n * @property {Float} radius - Circle radius.\n */\nvar circle = {};\n\n/**\n * Bounding box object, expressed with four coordinates.\n *\n * @namespace\n * @alias Gp.BBox\n *\n * @property {Float} left - minimum abscissa\n * @property {Float} right - maximum abscissa\n * @property {Float} bottom - minimum ordinate\n * @property {Float} top - maximum ordinate\n */\nvar bbox = {};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Services);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvU2VydmljZXMuanM/YmMwOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEscUNBQXFDLDJDQUEyQzs7QUFFaEY7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ3FDO0FBQ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lcnR5IHtGbG9hdH0geSAtIFBvaW50IG9yZGluYXRlXG4gKi9cbnZhciBwb2ludCA9IHt9O1xuXG4vKipcbiAqIENpcmNsZSBvYmplY3QuXG4gKlxuICogQG5hbWVzcGFjZVxuICogQGFsaWFzIEdwLkNpcmNsZVxuICpcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IHggLSBDaXJjbGUgY2VudGVyIGFic2Npc3NhLlxuICogQHByb3BlcnR5IHtGbG9hdH0geSAtIENpcmNsZSBjZW50ZXIgb3JkaW5hdGUuXG4gKiBAcHJvcGVydHkge0Zsb2F0fSByYWRpdXMgLSBDaXJjbGUgcmFkaXVzLlxuICovXG52YXIgY2lyY2xlID0ge307XG5cbi8qKlxuICogQm91bmRpbmcgYm94IG9iamVjdCwgZXhwcmVzc2VkIHdpdGggZm91ciBjb29yZGluYXRlcy5cbiAqXG4gKiBAbmFtZXNwYWNlXG4gKiBAYWxpYXMgR3AuQkJveFxuICpcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IGxlZnQgLSBtaW5pbXVtIGFic2Npc3NhXG4gKiBAcHJvcGVydHkge0Zsb2F0fSByaWdodCAtIG1heGltdW0gYWJzY2lzc2FcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IGJvdHRvbSAtIG1pbmltdW0gb3JkaW5hdGVcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IHRvcCAtIG1heGltdW0gb3JkaW5hdGVcbiAqL1xudmFyIGJib3ggPSB7fTtcblxuZXhwb3J0IGRlZmF1bHQgU2VydmljZXM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Services.js\n"); /***/ }), @@ -889,7 +901,7 @@ eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn th /*! exports provided: name, description, version, date, leafletExtName, leafletExtVersion, olExtName, olExtVersion, itownsExtName, itownsExtVersion, main, types, module, directories, scripts, repository, author, keywords, license, bugs, homepage, dependencies, devDependencies, default */ /***/ (function(module) { -eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"geoportal-extensions\\\",\\\"description\\\":\\\"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries\\\",\\\"version\\\":\\\"2.8.4\\\",\\\"date\\\":\\\"04/08/2023\\\",\\\"leafletExtName\\\":\\\"French Geoportal Extension for Leaflet\\\",\\\"leafletExtVersion\\\":\\\"2.3.3\\\",\\\"olExtName\\\":\\\"French Geoportal Extension for OpenLayers\\\",\\\"olExtVersion\\\":\\\"3.3.3\\\",\\\"itownsExtName\\\":\\\"French Geoportal Extension for Itowns\\\",\\\"itownsExtVersion\\\":\\\"2.4.3\\\",\\\"main\\\":\\\"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js\\\",\\\"types\\\":\\\"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts\\\",\\\"module\\\":\\\"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js\\\",\\\"directories\\\":{},\\\"scripts\\\":{\\\"setup\\\":\\\"npm install\\\",\\\"clean\\\":\\\"echo \\\\\\\"Warning: target not yet implemented!\\\\\\\" && exit 0\\\",\\\"eslint\\\":\\\"eslint src/\\\",\\\"test\\\":\\\"npm run test:serve\\\",\\\"test:serve\\\":\\\"cd test && webpack-dev-server --hot --config webpack.test.serve.js\\\",\\\"sample\\\":\\\"npm run sample:serve\\\",\\\"sample:serve\\\":\\\"npm run sample:ol:serve\\\",\\\"sample:itowns:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path '/dist/itowns/' --port 9001 --open\\\",\\\"sample:leaflet:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path '/dist/leaflet/' --port 9001 --open\\\",\\\"sample:ol:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path '/dist/openlayers/' --port 9001 --open\\\",\\\"generate-types:ol\\\":\\\"npx tsc -p build/types/tsconfig-openlayers.json\\\",\\\"generate-types:leaflet\\\":\\\"npx tsc -p build/types/tsconfig-leaflet.json\\\",\\\"generate-types:itowns\\\":\\\"npx tsc -p build/types/tsconfig-itowns.json\\\",\\\"generate-jsdoc:ol\\\":\\\"jsdoc -c build/jsdoc/jsdoc-openlayers.json\\\",\\\"generate-jsdoc:leaflet\\\":\\\"jsdoc -c build/jsdoc/jsdoc-leaflet.json\\\",\\\"generate-jsdoc:itowns\\\":\\\"jsdoc -c build/jsdoc/jsdoc-itowns.json\\\",\\\"doc\\\":\\\"npm run doc:serve\\\",\\\"doc:serve\\\":\\\"npm run doc:ol:serve\\\",\\\"doc:itowns:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open\\\",\\\"doc:leaflet:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open\\\",\\\"doc:ol:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open\\\",\\\"build:dev\\\":\\\"npm-run-all --print-label --print-name build:*:dev\\\",\\\"build:prod\\\":\\\"npm-run-all --print-label --print-name build:*:prod\\\",\\\"build:src\\\":\\\"npm-run-all --print-label --print-name build:*:src\\\",\\\"build\\\":\\\"npm-run-all --print-label --print-name build:*:*\\\",\\\"build:itowns\\\":\\\"npm-run-all --print-label --print-name build:itowns:*\\\",\\\"build:itowns:dev\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=development\\\",\\\"build:itowns:prod\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=production\\\",\\\"build:itowns:src\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=none\\\",\\\"build:ol\\\":\\\"npm-run-all --print-label --print-name build:ol:*\\\",\\\"build:ol:dev\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=development\\\",\\\"build:ol:prod\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=production\\\",\\\"build:ol:src\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=none\\\",\\\"build:leaflet\\\":\\\"npm-run-all --print-label --print-name build:leaflet:*\\\",\\\"build:leaflet:dev\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=development\\\",\\\"build:leaflet:prod\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=production\\\",\\\"build:leaflet:src\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=none\\\"},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"https://github.com/IGNF/geoportal-extensions.git\\\"},\\\"author\\\":\\\"IGNF\\\",\\\"keywords\\\":[\\\"geoportail\\\",\\\"javascript\\\",\\\"OpenLayers\\\",\\\"Leaflet\\\",\\\"Itowns\\\",\\\"3D\\\"],\\\"license\\\":\\\"CECILL-B\\\",\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/IGNF/geoportal-extensions/issues\\\"},\\\"homepage\\\":\\\"https://github.com/IGNF/geoportal-extensions#readme\\\",\\\"dependencies\\\":{\\\"@mapbox/mapbox-gl-style-spec\\\":\\\"13.20.1\\\",\\\"eventbusjs\\\":\\\"0.2.0\\\",\\\"geoportal-access-lib\\\":\\\"3.3.3\\\",\\\"itowns\\\":\\\"2.38.2\\\",\\\"leaflet\\\":\\\"1.7.1\\\",\\\"leaflet-draw\\\":\\\"1.0.4\\\",\\\"loglevel\\\":\\\"^1.6.7\\\",\\\"markdown-toc\\\":\\\"^1.2.0\\\",\\\"ol\\\":\\\"6.9.0\\\",\\\"ol-mapbox-style\\\":\\\"6.7.0\\\",\\\"proj4\\\":\\\"2.7.5\\\",\\\"proj4leaflet\\\":\\\"1.0.2\\\",\\\"sortablejs\\\":\\\"1.14.0\\\",\\\"three\\\":\\\"0.137.5\\\",\\\"typescript\\\":\\\"^4.5.5\\\",\\\"whatwg-fetch\\\":\\\"3.0.0\\\"},\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"^7.4.4\\\",\\\"@babel/plugin-transform-template-literals\\\":\\\"^7.7.4\\\",\\\"@babel/preset-env\\\":\\\"^7.4.4\\\",\\\"babel-loader\\\":\\\"^8.0.5\\\",\\\"chai\\\":\\\"^4.2.0\\\",\\\"chalk\\\":\\\"^4.0.0\\\",\\\"clean-webpack-plugin\\\":\\\"^3.0.0\\\",\\\"copy-webpack-plugin\\\":\\\"^5.0.3\\\",\\\"core-js\\\":\\\"^3.6.4\\\",\\\"css-loader\\\":\\\"^3.4.2\\\",\\\"eslint\\\":\\\"^6.8.0\\\",\\\"eslint-config-standard\\\":\\\"^14.1.1\\\",\\\"eslint-loader\\\":\\\"^4.0.0\\\",\\\"eslint-plugin-import\\\":\\\"^2.17.2\\\",\\\"eslint-plugin-node\\\":\\\"^11.1.0\\\",\\\"eslint-plugin-promise\\\":\\\"^4.1.1\\\",\\\"eslint-plugin-standard\\\":\\\"^4.0.0\\\",\\\"exports-loader\\\":\\\"^0.7.0\\\",\\\"expose-loader\\\":\\\"^0.7.5\\\",\\\"fs-extra\\\":\\\"^9.0.0\\\",\\\"handlebars\\\":\\\"^4.7.5\\\",\\\"handlebars-layouts\\\":\\\"^3.1.4\\\",\\\"html-webpack-plugin\\\":\\\"^4.0.4\\\",\\\"jsdoc-webpack-plugin\\\":\\\"^0.3.0\\\",\\\"mini-css-extract-plugin\\\":\\\"^0.9.0\\\",\\\"mocha\\\":\\\"^7.1.1\\\",\\\"mocha-loader\\\":\\\"^5.0.0\\\",\\\"npm-run-all\\\":\\\"^4.1.5\\\",\\\"optimize-css-assets-webpack-plugin\\\":\\\"^5.0.1\\\",\\\"path\\\":\\\"^0.12.7\\\",\\\"replace-bundle-webpack-plugin\\\":\\\"^1.0.0\\\",\\\"requirejs\\\":\\\"^2.3.6\\\",\\\"responsive-loader\\\":\\\"^1.2.0\\\",\\\"speed-measure-webpack-plugin\\\":\\\"^1.3.0\\\",\\\"string-template\\\":\\\"^1.0.0\\\",\\\"style-loader\\\":\\\"^1.1.3\\\",\\\"terser-webpack-plugin\\\":\\\"^2.0.0\\\",\\\"url-loader\\\":\\\"^4.0.0\\\",\\\"webpack\\\":\\\"^4.30.0\\\",\\\"webpack-cli\\\":\\\"^3.3.1\\\",\\\"webpack-dev-server\\\":\\\"^3.3.1\\\",\\\"webpack-node-externals\\\":\\\"^1.7.2\\\"}}\");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIuL3BhY2thZ2UuanNvbi5qcyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./package.json\n"); +eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"geoportal-extensions\\\",\\\"description\\\":\\\"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries\\\",\\\"version\\\":\\\"2.9.0\\\",\\\"date\\\":\\\"21/09/2023\\\",\\\"leafletExtName\\\":\\\"French Geoportal Extension for Leaflet\\\",\\\"leafletExtVersion\\\":\\\"2.4.0-beta\\\",\\\"olExtName\\\":\\\"French Geoportal Extension for OpenLayers\\\",\\\"olExtVersion\\\":\\\"3.4.0-beta\\\",\\\"itownsExtName\\\":\\\"French Geoportal Extension for Itowns\\\",\\\"itownsExtVersion\\\":\\\"2.5.0-beta\\\",\\\"main\\\":\\\"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js\\\",\\\"types\\\":\\\"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts\\\",\\\"module\\\":\\\"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js\\\",\\\"directories\\\":{},\\\"scripts\\\":{\\\"setup\\\":\\\"npm install\\\",\\\"clean\\\":\\\"echo \\\\\\\"Warning: target not yet implemented!\\\\\\\" && exit 0\\\",\\\"eslint\\\":\\\"eslint src/\\\",\\\"test\\\":\\\"npm run test:serve\\\",\\\"test:serve\\\":\\\"cd test && webpack-dev-server --hot --config webpack.test.serve.js\\\",\\\"sample\\\":\\\"npm run sample:serve\\\",\\\"sample:serve\\\":\\\"npm run sample:ol:serve\\\",\\\"sample:itowns:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path '/dist/itowns/' --port 9001 --open\\\",\\\"sample:leaflet:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path '/dist/leaflet/' --port 9001 --open\\\",\\\"sample:ol:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path '/dist/openlayers/' --port 9001 --open\\\",\\\"generate-types:ol\\\":\\\"npx tsc -p build/types/tsconfig-openlayers.json\\\",\\\"generate-types:leaflet\\\":\\\"npx tsc -p build/types/tsconfig-leaflet.json\\\",\\\"generate-types:itowns\\\":\\\"npx tsc -p build/types/tsconfig-itowns.json\\\",\\\"generate-jsdoc:ol\\\":\\\"jsdoc -c build/jsdoc/jsdoc-openlayers.json\\\",\\\"generate-jsdoc:leaflet\\\":\\\"jsdoc -c build/jsdoc/jsdoc-leaflet.json\\\",\\\"generate-jsdoc:itowns\\\":\\\"jsdoc -c build/jsdoc/jsdoc-itowns.json\\\",\\\"doc\\\":\\\"npm run doc:serve\\\",\\\"doc:serve\\\":\\\"npm run doc:ol:serve\\\",\\\"doc:itowns:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open\\\",\\\"doc:leaflet:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open\\\",\\\"doc:ol:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open\\\",\\\"build:dev\\\":\\\"npm-run-all --print-label --print-name build:*:dev\\\",\\\"build:prod\\\":\\\"npm-run-all --print-label --print-name build:*:prod\\\",\\\"build:src\\\":\\\"npm-run-all --print-label --print-name build:*:src\\\",\\\"build\\\":\\\"npm-run-all --print-label --print-name build:*:*\\\",\\\"build:itowns\\\":\\\"npm-run-all --print-label --print-name build:itowns:*\\\",\\\"build:itowns:dev\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=development\\\",\\\"build:itowns:prod\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=production\\\",\\\"build:itowns:src\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=none\\\",\\\"build:ol\\\":\\\"npm-run-all --print-label --print-name build:ol:*\\\",\\\"build:ol:dev\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=development\\\",\\\"build:ol:prod\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=production\\\",\\\"build:ol:src\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=none\\\",\\\"build:leaflet\\\":\\\"npm-run-all --print-label --print-name build:leaflet:*\\\",\\\"build:leaflet:dev\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=development\\\",\\\"build:leaflet:prod\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=production\\\",\\\"build:leaflet:src\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=none\\\"},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"https://github.com/IGNF/geoportal-extensions.git\\\"},\\\"author\\\":\\\"IGNF\\\",\\\"keywords\\\":[\\\"geoportail\\\",\\\"javascript\\\",\\\"OpenLayers\\\",\\\"Leaflet\\\",\\\"Itowns\\\",\\\"3D\\\"],\\\"license\\\":\\\"CECILL-B\\\",\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/IGNF/geoportal-extensions/issues\\\"},\\\"homepage\\\":\\\"https://github.com/IGNF/geoportal-extensions#readme\\\",\\\"dependencies\\\":{\\\"@mapbox/mapbox-gl-style-spec\\\":\\\"13.20.1\\\",\\\"eventbusjs\\\":\\\"0.2.0\\\",\\\"geoportal-access-lib\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"itowns\\\":\\\"2.38.2\\\",\\\"leaflet\\\":\\\"1.7.1\\\",\\\"leaflet-draw\\\":\\\"1.0.4\\\",\\\"loglevel\\\":\\\"^1.6.7\\\",\\\"markdown-toc\\\":\\\"^1.2.0\\\",\\\"ol\\\":\\\"6.9.0\\\",\\\"ol-mapbox-style\\\":\\\"6.7.0\\\",\\\"proj4\\\":\\\"2.7.5\\\",\\\"proj4leaflet\\\":\\\"1.0.2\\\",\\\"sortablejs\\\":\\\"1.14.0\\\",\\\"three\\\":\\\"0.137.5\\\",\\\"typescript\\\":\\\"^4.5.5\\\",\\\"whatwg-fetch\\\":\\\"3.0.0\\\"},\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"^7.4.4\\\",\\\"@babel/plugin-transform-template-literals\\\":\\\"^7.7.4\\\",\\\"@babel/preset-env\\\":\\\"^7.4.4\\\",\\\"babel-loader\\\":\\\"^8.0.5\\\",\\\"chai\\\":\\\"^4.2.0\\\",\\\"chalk\\\":\\\"^4.0.0\\\",\\\"clean-webpack-plugin\\\":\\\"^3.0.0\\\",\\\"copy-webpack-plugin\\\":\\\"^5.0.3\\\",\\\"core-js\\\":\\\"^3.6.4\\\",\\\"css-loader\\\":\\\"^3.4.2\\\",\\\"eslint\\\":\\\"^6.8.0\\\",\\\"eslint-config-standard\\\":\\\"^14.1.1\\\",\\\"eslint-loader\\\":\\\"^4.0.0\\\",\\\"eslint-plugin-import\\\":\\\"^2.17.2\\\",\\\"eslint-plugin-node\\\":\\\"^11.1.0\\\",\\\"eslint-plugin-promise\\\":\\\"^4.1.1\\\",\\\"eslint-plugin-standard\\\":\\\"^4.0.0\\\",\\\"exports-loader\\\":\\\"^0.7.0\\\",\\\"expose-loader\\\":\\\"^0.7.5\\\",\\\"fs-extra\\\":\\\"^9.0.0\\\",\\\"handlebars\\\":\\\"^4.7.5\\\",\\\"handlebars-layouts\\\":\\\"^3.1.4\\\",\\\"html-webpack-plugin\\\":\\\"^4.0.4\\\",\\\"jsdoc-webpack-plugin\\\":\\\"^0.3.0\\\",\\\"mini-css-extract-plugin\\\":\\\"^0.9.0\\\",\\\"mocha\\\":\\\"^7.1.1\\\",\\\"mocha-loader\\\":\\\"^5.0.0\\\",\\\"npm-run-all\\\":\\\"^4.1.5\\\",\\\"optimize-css-assets-webpack-plugin\\\":\\\"^5.0.1\\\",\\\"path\\\":\\\"^0.12.7\\\",\\\"replace-bundle-webpack-plugin\\\":\\\"^1.0.0\\\",\\\"requirejs\\\":\\\"^2.3.6\\\",\\\"responsive-loader\\\":\\\"^1.2.0\\\",\\\"speed-measure-webpack-plugin\\\":\\\"^1.3.0\\\",\\\"string-template\\\":\\\"^1.0.0\\\",\\\"style-loader\\\":\\\"^1.1.3\\\",\\\"terser-webpack-plugin\\\":\\\"^2.0.0\\\",\\\"url-loader\\\":\\\"^4.0.0\\\",\\\"webpack\\\":\\\"^4.30.0\\\",\\\"webpack-cli\\\":\\\"^3.3.1\\\",\\\"webpack-dev-server\\\":\\\"^3.3.1\\\",\\\"webpack-node-externals\\\":\\\"^1.7.2\\\"}}\");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIuL3BhY2thZ2UuanNvbi5qcyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./package.json\n"); /***/ }), @@ -1159,7 +1171,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nvar MiniGlobeDOM = {\n /**\n /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar MousePositionDOM = {\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Main container (DOM)\n *\n * @returns {DOMElement} DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePosition\");\n container.className = \"GPwidget\";\n return container;\n },\n // ################################################################### //\n // ################### Methods of main container ##################### //\n // ################################################################### //\n\n /**\n * Hidden checkbox for minimizing/maximizing\n *\n * @returns {DOMElement} DOM element\n */\n _createShowMousePositionElement: function _createShowMousePositionElement() {\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPshowMousePosition\");\n input.type = \"checkbox\";\n return input;\n },\n /**\n * Show mouse position control\n * @param {Boolean} isDesktop - specifies if the support is desktop or tactile\n *\n * @returns {DOMElement} DOM element\n */\n _createShowMousePositionPictoElement: function _createShowMousePositionPictoElement(isDesktop) {\n // contexte d'execution\n var self = this;\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowMousePositionPicto\");\n label.className = \"GPshowAdvancedToolPicto\";\n label.htmlFor = this._addUID(\"GPshowMousePosition\");\n label.title = \"Afficher les coordonnées du curseur\";\n\n // FIXME detection disponible dans le JS !\n // Detection : test for desktop or tactile\n // var isDesktop = true;\n // var userAgent = window.navigator.userAgent.toLowerCase();\n // if (userAgent.indexOf(\"iphone\") !== -1 ||\n // userAgent.indexOf(\"ipod\") !== -1 ||\n // userAgent.indexOf(\"ipad\") !== -1 ||\n // userAgent.indexOf(\"android\") !== -1 ||\n // userAgent.indexOf(\"mobile\") !== -1 ||\n // userAgent.indexOf(\"blackberry\") !== -1 ||\n // userAgent.indexOf(\"tablet\") !== -1 ||\n // userAgent.indexOf(\"phone\") !== -1 ||\n // userAgent.indexOf(\"touch\") !== -1 ) {\n // isDesktop = false;\n // }\n // if (userAgent.indexOf(\"msie\") !== -1 ||\n // userAgent.indexOf(\"trident\") !== -1) {\n // isDesktop = true;\n // }\n\n // Show map center localisation if panel opened and tactile support\n label.addEventListener(\"click\", function (e) {\n var mapCenterClass = \"\";\n if (!document.getElementById(self._addUID(\"GPshowMousePosition\")).checked && !isDesktop) {\n mapCenterClass = \"GPmapCenterVisible\";\n }\n document.getElementById(\"GPmapCenter\").className = mapCenterClass;\n self.onShowMousePositionClick(e);\n });\n var spanOpen = document.createElement(\"span\");\n spanOpen.id = this._addUID(\"GPshowMousePositionOpen\");\n spanOpen.className = \"GPshowAdvancedToolOpen\";\n label.appendChild(spanOpen);\n return label;\n },\n /**\n * mouse position panel\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionPanelElement: function _createMousePositionPanelElement() {\n var panel = document.createElement(\"div\");\n panel.id = this._addUID(\"GPmousePositionPanel\");\n panel.className = \"GPpanel\";\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // div.appendChild(this._createMousePositionPanelHeaderElement());\n // div.appendChild(this._createMousePositionPanelBasicElement());\n // div.appendChild(this._createShowMousePositionSettingsElement());\n // div.appendChild(this._createMousePositionSettingsElement());\n\n return panel;\n },\n /**\n * Map center localisation (tactile use)\n *\n * @returns {DOMElement} container\n */\n _createMapCenter: function _createMapCenter() {\n var div = document.createElement(\"div\");\n div.id = \"GPmapCenter\";\n div.className = \"\";\n return div;\n },\n // ################################################################### //\n // ####################### Panel container ########################### //\n // ################################################################### //\n\n /**\n * @returns {DOMElement} container\n */\n _createMousePositionPanelHeaderElement: function _createMousePositionPanelHeaderElement() {\n var container = document.createElement(\"div\");\n container.className = \"GPpanelHeader\";\n var divTitle = document.createElement(\"div\");\n divTitle.className = \"GPpanelTitle\";\n divTitle.innerHTML = \"Coordonnées\";\n container.appendChild(divTitle);\n var divClose = document.createElement(\"div\");\n divClose.id = \"GPmousePositionPanelClose\";\n divClose.className = \"GPpanelClose\";\n divClose.title = \"Fermer le panneau\";\n\n // Link panel close / visibility checkbox\n var self = this;\n if (divClose.addEventListener) {\n divClose.addEventListener(\"click\", function () {\n document.getElementById(self._addUID(\"GPshowMousePositionPicto\")).click();\n }, false);\n } else if (divClose.attachEvent) {\n divClose.attachEvent(\"onclick\", function () {\n document.getElementById(self._addUID(\"GPshowMousePositionPicto\")).click();\n });\n }\n container.appendChild(divClose);\n return container;\n },\n /**\n * coordinate panel\n * @param {Boolean} [displayAltitude] - specifies if the altitude panel must be displayed\n * @param {Boolean} [displayCoordinates] - specifies if the coordinates panel must be displayed\n * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed\n * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units\n *\n * FIXME\n * call this._createMousePositionPanelBasicCoordinateElement\n * call this._createMousePositionPanelBasicAltitudeElement\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionPanelBasicElement: function _createMousePositionPanelBasicElement(displayAltitude, displayCoordinates, editCoordinates, currentProjectionUnits) {\n // default Values\n displayAltitude = typeof displayAltitude === \"undefined\" ? true : displayAltitude;\n displayCoordinates = typeof displayCoordinates === \"undefined\" ? true : displayCoordinates;\n editCoordinates = typeof editCoordinates === \"undefined\" ? false : editCoordinates;\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePositionBasicPanel\");\n\n // FIXME on devrait decomposer la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n container.appendChild(this._createMousePositionPanelBasicCoordinateElement(displayCoordinates, editCoordinates, currentProjectionUnits));\n container.appendChild(this._createMousePositionPanelEditToolsElement(editCoordinates));\n container.appendChild(this._createMousePositionPanelBasicAltitudeElement(displayAltitude));\n return container;\n },\n /**\n * create coordinate elements\n *\n * @param {String} coordType - (\"Lon\" ou \"Lat\")\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {Array} list of DOM elements\n */\n _createCoordinateElement: function _createCoordinateElement(coordType, editCoordinates) {\n var context = this;\n if ([\"Lon\", \"Lat\"].indexOf(coordType) === -1) {\n return [];\n }\n var list = [];\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPmousePosition\" + coordType);\n input.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input.readOnly = true;\n if (editCoordinates) {\n input.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input.addEventListener(\"change\", function (e) {\n this.classList.remove(\"error\");\n var valid = context.validateExtentCoordinate(coordType, this.value, e);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input);\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionUnits\";\n list.push(span);\n return list;\n },\n /**\n *\n * @param {String} coordType - (\"Lon\" ou \"Lat\")\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {Array} list of DOM elements\n */\n _createDMSCoordinateElement: function _createDMSCoordinateElement(coordType, editCoordinates) {\n if ([\"Lon\", \"Lat\"].indexOf(coordType) === -1) {\n return [];\n }\n var context = this;\n var list = [];\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPmousePosition\" + coordType + \"Degrees\");\n input.className = \"GPSexagesimal\";\n input.setAttribute(\"name\", \"degrees\");\n input.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input.readOnly = true;\n input.dataset.min = 0;\n input.dataset.max = coordType === \"Lon\" ? 180 : 90;\n if (editCoordinates) {\n input.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSDegrees(coordType, this);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input);\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionSexagesimalLabel\";\n span.innerHTML = \"°\";\n list.push(span);\n var input1 = document.createElement(\"input\");\n input1.id = this._addUID(\"GPmousePosition\" + coordType + \"Minutes\");\n input1.className = \"GPSexagesimal\";\n input1.setAttribute(\"name\", \"minutes\");\n input1.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input1.readOnly = true;\n input1.dataset.min = 0;\n input1.dataset.max = 59;\n if (editCoordinates) {\n input1.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input1.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSElement(this);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input1);\n var span1 = document.createElement(\"span\");\n span1.className = \"GPmousePositionSexagesimalLabel\";\n span1.innerHTML = \"'\";\n list.push(span1);\n var input2 = document.createElement(\"input\");\n input2.id = this._addUID(\"GPmousePosition\" + coordType + \"Seconds\");\n input2.className = \"GPSexagesimalsec\";\n input2.setAttribute(\"name\", \"seconds\");\n input2.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input2.readOnly = true;\n input2.dataset.min = 0;\n input2.dataset.max = 59;\n if (editCoordinates) {\n input2.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input2.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSElement(this, true);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input2);\n var span2 = document.createElement(\"span\");\n span2.className = \"GPmousePositionSexagesimalLabel\";\n span2.innerHTML = \"''\";\n list.push(span2);\n var select = document.createElement(\"select\");\n select.id = this._addUID(\"GPmousePosition\" + coordType + \"Direction\");\n select.className = \"GPmousePositionDirection\";\n select.setAttribute(\"name\", \"direction\");\n select.disabled = true;\n var option = document.createElement(\"option\");\n option.value = coordType === \"Lon\" ? \"E\" : \"N\";\n option.innerHTML = coordType === \"Lon\" ? \"E\" : \"N\";\n select.appendChild(option);\n var option1 = document.createElement(\"option\");\n option1.value = coordType === \"Lon\" ? \"O\" : \"S\";\n option1.innerHTML = coordType === \"Lon\" ? \"O\" : \"S\";\n select.appendChild(option1);\n list.push(select);\n return list;\n },\n /**\n * @param {Boolean} [display=false] - specifies if the coordinates panel must be displayed\n * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed\n * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelBasicCoordinateElement: function _createMousePositionPanelBasicCoordinateElement(display, editCoordinates, currentProjectionUnits) {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPmousePositionCoordinate\");\n div.style.display = display ? \"block\" : \"none\";\n\n // latitude\n var divLat = document.createElement(\"div\");\n var spanLat = document.createElement(\"span\");\n spanLat.className = \"GPmousePositionLabel\";\n spanLat.id = this._addUID(\"GPmousePositionLatLabel\");\n spanLat.innerHTML = \"Latitude : \";\n divLat.appendChild(spanLat);\n var span = document.createElement(\"span\");\n span.id = this._addUID(\"GPmousePositionLatCoordinate\");\n var arrayCoords;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords = this._createDMSCoordinateElement(\"Lat\", editCoordinates);\n } else {\n arrayCoords = this._createCoordinateElement(\"Lat\", editCoordinates);\n }\n for (var i = 0; i < arrayCoords.length; i++) {\n span.appendChild(arrayCoords[i]);\n }\n divLat.appendChild(span);\n div.appendChild(divLat);\n\n // longitude\n var divLon = document.createElement(\"div\");\n var spanLon = document.createElement(\"span\");\n spanLon.className = \"GPmousePositionLabel\";\n spanLon.id = this._addUID(\"GPmousePositionLonLabel\");\n spanLon.innerHTML = \"Longitude : \";\n divLon.appendChild(spanLon);\n var span1 = document.createElement(\"span\");\n span1.id = this._addUID(\"GPmousePositionLonCoordinate\");\n var arrayCoords1;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords1 = this._createDMSCoordinateElement(\"Lon\", editCoordinates);\n } else {\n arrayCoords1 = this._createCoordinateElement(\"Lon\", editCoordinates);\n }\n for (var j = 0; j < arrayCoords1.length; j++) {\n span1.appendChild(arrayCoords1[j]);\n }\n divLon.appendChild(span1);\n div.appendChild(divLon);\n return div;\n },\n /**\n * @param {Boolean} [display=false] - specifies if the altitude panel must be displayed\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelBasicAltitudeElement: function _createMousePositionPanelBasicAltitudeElement(display) {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPmousePositionAltitude\");\n div.style.display = display ? \"block\" : \"none\";\n var spanLabel = document.createElement(\"span\");\n spanLabel.className = \"GPmousePositionLabel\";\n spanLabel.innerHTML = \"Altitude : \";\n div.appendChild(spanLabel);\n var spanAlt = document.createElement(\"span\");\n spanAlt.className = \"GPmousePositionCoords\";\n spanAlt.id = this._addUID(\"GPmousePositionAlt\");\n spanAlt.innerHTML = \"...\";\n div.appendChild(spanAlt);\n var spanUnits = document.createElement(\"span\");\n spanUnits.className = \"GPmousePositionAltitudeUnits\";\n spanUnits.innerHTML = \"m\";\n div.appendChild(spanUnits);\n return div;\n },\n /**\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelEditToolsElement: function _createMousePositionPanelEditToolsElement(editCoordinates) {\n var context = this;\n var div = document.createElement(\"div\");\n div.className = \"GPmousePositionPanelEditTools\";\n div.id = this._addUID(\"GPmousePositionPanelEditTools\");\n if (!editCoordinates) {\n div.style.display = \"none\";\n }\n var span1 = document.createElement(\"span\");\n span1.className = \"GPmousePositionEditTool\";\n span1.id = this._addUID(\"GPmousePositionLocate\");\n span1.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n if (editCoordinates) {\n span1.addEventListener(\"click\", function () {\n context.onMousePositionEditModeLocateClick();\n });\n }\n div.appendChild(span1);\n var span2 = document.createElement(\"span\");\n span2.className = \"GPmousePositionEditTool\";\n span2.id = this._addUID(\"GPmousePositionCloseEdit\");\n span2.title = \"Quitter la saisie des coordonnées\";\n span2.style.display = \"none\";\n if (editCoordinates) {\n span2.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(false);\n });\n }\n div.appendChild(span2);\n return div;\n },\n // ################################################################### //\n // #################### Settings container ########################### //\n // ################################################################### //\n\n /**\n * @param {Boolean} [display=false] - specifies if the settings panel must be displayed\n *\n * @returns {DOMElement[]} array containing input and label elements\n */\n _createShowMousePositionSettingsElement: function _createShowMousePositionSettingsElement(display) {\n var list = [];\n var context = this;\n var input = document.createElement(\"input\");\n input.type = \"checkbox\";\n input.id = this._addUID(\"GPshowMousePositionSettings\");\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowMousePositionSettingsPicto\");\n label.htmlFor = this._addUID(\"GPshowMousePositionSettings\");\n label.title = \"Réglages\";\n label.className = \"GPshowMoreOptionsImage GPshowMoreOptions GPshowMousePositionSettingsPicto\"; // FIXME classname and id ?\n label.style.display = display ? \"block\" : \"none\";\n if (label.addEventListener) {\n label.addEventListener(\"click\", function (e) {\n if (typeof context.onShowMousePositionSettingsClick === \"function\") {\n context.onShowMousePositionSettingsClick(e);\n }\n }, false);\n } else if (label.attachEvent) {\n label.attachEvent(\"onclick\", function (e) {\n if (typeof context.onShowMousePositionSettingsClick === \"function\") {\n context.onShowMousePositionSettingsClick(e);\n }\n });\n }\n list.push(input);\n list.push(label);\n return list;\n },\n /**\n * settings panel\n * @param {Boolean} [display=true] - specifies if the settings panel must be displayed\n *\n * FIXME\n * don't call this._createMousePositionSettingsSystemsElement\n * don't call this._createMousePositionSettingsUnitsElement\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionSettingsElement: function _createMousePositionSettingsElement(display) {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePositionSettings\");\n container.style.display = display === undefined || display ? \"block\" : \"none\";\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionSettingsLabel\";\n span.innerHTML = \"Système de référence\";\n container.appendChild(span);\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // FIXME tableau statique !\n // var systems = [\n // {\n // code : \"GEOGRAPHIC\",\n // label : \"Géographique\"\n // },\n // {\n // code : \"MERCATOR\",\n // label : \"Mercator\"\n // },\n // {\n // code : \"LAMB93\",\n // label : \"Lambert 93\"\n // },\n // {\n // code : \"LAMB2E\",\n // label : \"Lambert II étendu\"\n // }\n // ];\n //\n // var selectSystem = this._createMousePositionSettingsSystemsElement(systems);\n //\n // container.appendChild(selectSystem);\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // FIXME tableau statique !\n // var units = [\n // {\n // code : \"DEC\",\n // label : \"degrés décimaux\",\n // },\n // {\n // code : \"DMS\",\n // label : \"degrés sexagésimaux\",\n // },\n // {\n // code : \"RAD\",\n // label : \"radians\",\n // },\n // {\n // code : \"GON\",\n // label : \"grades\"\n // }\n // ];\n //\n // var selectUnits = this._createMousePositionSettingsUnitsElement(units);\n //\n // container.appendChild(selectUnits);\n\n return container;\n },\n /**\n * @param {Object[]} systems - list of systems\n *\n * @returns {DOMElement} DOM element select\n */\n _createMousePositionSettingsSystemsElement: function _createMousePositionSettingsSystemsElement(systems) {\n // contexte d'execution\n var context = this;\n var selectSystem = document.createElement(\"select\");\n selectSystem.id = this._addUID(\"GPmousePositionProjectionSystem\");\n selectSystem.className = \"GPinputSelect GPmousePositionSettingsSelect\";\n selectSystem.addEventListener(\"change\", function (e) {\n context.onMousePositionProjectionSystemChange(e);\n });\n selectSystem.addEventListener(\"mouseover\", function (e) {\n // FIXME mettre une condition si target === option\n if (e.target.nodeName !== \"OPTION\") {\n context.onMousePositionProjectionSystemMouseOver(e);\n }\n });\n for (var i = 0; i < systems.length; i++) {\n var obj = systems[i];\n var option = document.createElement(\"option\");\n option.value = obj.code;\n option.text = obj.label || i;\n // option.label = obj.label;\n selectSystem.appendChild(option);\n }\n return selectSystem;\n },\n /**\n * @param {Object[]} units - list of units\n *\n * @returns {DOMElement} DOM element select\n */\n _createMousePositionSettingsUnitsElement: function _createMousePositionSettingsUnitsElement(units) {\n // contexte d'execution\n var context = this;\n var selectUnits = document.createElement(\"select\");\n selectUnits.id = this._addUID(\"GPmousePositionProjectionUnits\");\n selectUnits.className = \"GPinputSelect GPmousePositionSettingsSelect\";\n selectUnits.addEventListener(\"change\", function (e) {\n context.onMousePositionProjectionUnitsChange(e);\n });\n for (var j = 0; j < units.length; j++) {\n var obj = units[j];\n var option = document.createElement(\"option\");\n option.value = obj.code ? obj.code : j;\n option.text = obj.label || j;\n // option.label = obj.label;\n selectUnits.appendChild(option);\n }\n return selectUnits;\n },\n /**\n * @param {String} [currentProjectionType=\"Metric\"] - \"Geographical\" or \"Metric\"\n */\n _resetLabelElements: function _resetLabelElements(currentProjectionType) {\n // Changement des labels dans le formulaire de saisie\n var spanLat = document.getElementById(this._addUID(\"GPmousePositionLatLabel\"));\n spanLat.innerHTML = currentProjectionType === \"Geographical\" ? \"Latitude :\" : \"X :\";\n var spanLon = document.getElementById(this._addUID(\"GPmousePositionLonLabel\"));\n spanLon.innerHTML = currentProjectionType === \"Geographical\" ? \"Longitude :\" : \"Y :\";\n },\n /**\n * @param {String} currentProjectionUnits - projection units\n */\n _resetUnitElements: function _resetUnitElements(currentProjectionUnits) {\n var value = \"\";\n if (currentProjectionUnits === \"M\" || currentProjectionUnits === \"KM\") {\n value = currentProjectionUnits.toLowerCase();\n }\n var elts = document.getElementsByClassName(\"GPmousePositionUnits\");\n for (var e = 0; e < elts.length; e++) {\n elts[e].innerHTML = value;\n }\n },\n /**\n * @param {Boolean} editCoordinates - edit coordinates option\n * @param {String} currentProjectionType - current projection type\n * @param {String} currentProjectionUnits - current projection unit\n */\n _resetCoordinateElements: function _resetCoordinateElements(editCoordinates, currentProjectionType, currentProjectionUnits) {\n // Suppression de tous les enfants de GPmousePositionLatCoordinate\n var latElt = document.getElementById(this._addUID(\"GPmousePositionLatCoordinate\"));\n while (latElt.firstChild) {\n latElt.removeChild(latElt.firstChild);\n }\n var arrayCoords;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords = this._createDMSCoordinateElement(\"Lat\", editCoordinates);\n } else {\n arrayCoords = this._createCoordinateElement(\"Lat\", editCoordinates);\n }\n for (var i = 0; i < arrayCoords.length; i++) {\n latElt.appendChild(arrayCoords[i]);\n }\n\n // Suppression de tous les enfants de GPmousePositionLonCoordinate\n var lonElt = document.getElementById(this._addUID(\"GPmousePositionLonCoordinate\"));\n while (lonElt.firstChild) {\n lonElt.removeChild(lonElt.firstChild);\n }\n var arrayCoords1;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords1 = this._createDMSCoordinateElement(\"Lon\", editCoordinates);\n } else {\n arrayCoords1 = this._createCoordinateElement(\"Lon\", editCoordinates);\n }\n for (var j = 0; j < arrayCoords1.length; j++) {\n lonElt.appendChild(arrayCoords1[j]);\n }\n\n // FIXME on simule un deplacement ?\n // this.onMapMove();\n },\n\n /**\n * Set/unset editing mode\n *\n * @param {Boolean} editing - active edit coordinates mode\n */\n _setEditMode: function _setEditMode(editing) {\n var locateElt = document.getElementById(this._addUID(\"GPmousePositionLocate\"));\n locateElt.title = editing ? \"Aller à la position ...\" : \"Cliquer pour saisir des coordonnées\";\n var closeEditElt = document.getElementById(this._addUID(\"GPmousePositionCloseEdit\"));\n closeEditElt.style.display = editing ? \"inline-block\" : \"none\";\n var selector = \"div[id^=\" + this._addUID(\"GPmousePositionCoordinate\") + \"]\";\n var inputs = document.querySelectorAll(selector + \" input\");\n for (var i = 0; i < inputs.length; i++) {\n inputs[i].readOnly = !editing;\n if (editing) {\n inputs[i].value = \"\";\n inputs[i].classList.remove(\"error\");\n }\n }\n var selects = document.querySelectorAll(selector + \" select\");\n for (var j = 0; j < selects.length; j++) {\n selects[j].disabled = !editing;\n }\n },\n /**\n *\n * @param {DOMElement} input - input element\n * @param {Boolean} isFloat - check for float value\n *\n * @returns {Boolean} true if input value is within bounds\n */\n _checkDMSElement: function _checkDMSElement(input, isFloat) {\n var b = isFloat !== undefined;\n var value = input.value;\n if (b) {\n value = value.replace(\",\", \".\");\n }\n if (isNaN(value)) {\n return false;\n }\n var v = parseFloat(value);\n if (!b && (v | 0) !== v) {\n // is it an integer\n return false;\n }\n var min = Number(input.dataset.min);\n var max = Number(input.dataset.max);\n return v >= min && v <= max;\n },\n /**\n * @param {String} coordType - \"Lon\" or \"Lat\"\n * @param {DOMElement} input - input element\n *\n * @returns {Boolean} true if input value is within bounds\n */\n _checkDMSDegrees: function _checkDMSDegrees(coordType, input) {\n if (isNaN(input.value)) {\n return false;\n }\n var v = parseFloat(input.value);\n if ((v | 0) !== v) {\n // is it an integer\n return false;\n }\n var min = Number(input.dataset.min);\n var max = Number(input.dataset.max);\n if (v < min || v > max) {\n return false;\n }\n var inputMinutes = document.getElementById(this._addUID(\"GPmousePosition\" + coordType + \"Minutes\"));\n var inputSeconds = document.getElementById(this._addUID(\"GPmousePosition\" + coordType + \"Seconds\"));\n if (v >= max) {\n inputMinutes.dataset.max = 0;\n inputSeconds.dataset.max = 0;\n } else {\n inputMinutes.dataset.max = 59;\n inputSeconds.dataset.max = 59.9999;\n }\n return true;\n },\n // ################################################################### //\n // ####################### handlers Event ############################ //\n // ################################################################### //\n\n /**\n * Function displaying coordinates from cursor position (desktop)\n * or map center (tactile)\n * @param {Object} coordinate - coordinates\n */\n GPdisplayCoords: function GPdisplayCoords(coordinate) {\n // Compute coords in case of cursor position (desktop)\n if (coordinate) {\n var labelLon = document.getElementById(this._addUID(\"GPmousePositionLonLabel\"));\n var labelLat = document.getElementById(this._addUID(\"GPmousePositionLatLabel\"));\n if (coordinate.x || coordinate.y) {\n labelLat.innerHTML = \"X : \";\n labelLon.innerHTML = \"Y : \";\n } else if (coordinate.e || coordinate.n) {\n labelLat.innerHTML = \"E : \";\n labelLon.innerHTML = \"N : \";\n } else {\n labelLat.innerHTML = \"Latitude : \";\n labelLon.innerHTML = \"Longitude : \";\n }\n if (_typeof(coordinate.lat) === \"object\" && _typeof(coordinate.lng) === \"object\") {\n var parts = {\n lng: \"Lon\",\n lat: \"Lat\"\n };\n var units = [\"Degrees\", \"Minutes\", \"Seconds\"];\n for (var p in parts) {\n for (var u = 0; u < units.length; ++u) {\n var selector = \"GPmousePosition\" + parts[p] + units[u];\n var elt = document.getElementById(this._addUID(selector));\n var key = units[u].charAt(0).toLowerCase();\n elt.value = coordinate[p][key];\n }\n }\n // directions\n document.getElementById(this._addUID(\"GPmousePositionLonDirection\")).value = coordinate.lng.direction;\n document.getElementById(this._addUID(\"GPmousePositionLatDirection\")).value = coordinate.lat.direction;\n } else {\n var elLat = document.getElementById(this._addUID(\"GPmousePositionLat\"));\n var elLon = document.getElementById(this._addUID(\"GPmousePositionLon\"));\n elLat.value = coordinate.x || coordinate.lat || coordinate.e || \"0\";\n elLon.value = coordinate.y || coordinate.lng || coordinate.lon || coordinate.n || \"0\";\n\n // les unites\n var unit = coordinate.unit === undefined ? \"\" : coordinate.unit;\n var elements = document.getElementsByClassName(\"GPmousePositionUnits\");\n for (var n = 0; n < elements.length; ++n) {\n elements[n].innerHTML = unit;\n }\n }\n }\n },\n /**\n * Function displaying altitude from cursor position (desktop)\n * or map center (tactile)\n * @param {Object} coordinate - coordinates\n * @param {Number} altitudeTimeoutDelay - when the mouse stop moving, delay before the altitude request is launched\n * @param {Number} noDataValue - the no data value\n * @param {Number} noDataValueTolerance - the no data value tolerance\n */\n GPdisplayElevation: function GPdisplayElevation(coordinate, altitudeTimeoutDelay, noDataValue, noDataValueTolerance) {\n // contexte d'execution\n var self = this;\n\n // Latency for altitude request\n var altitudeTimeout;\n if (!altitudeTimeoutDelay) {\n altitudeTimeoutDelay = 500;\n }\n clearTimeout(altitudeTimeout);\n document.getElementById(this._addUID(\"GPmousePositionAlt\")).innerHTML = \"...\";\n if (noDataValue == null) {\n noDataValue = -99999;\n }\n if (noDataValueTolerance == null) {\n noDataValueTolerance = 99980;\n }\n var maxThreshold = noDataValue + noDataValueTolerance;\n var minThreshold = noDataValue - noDataValueTolerance;\n\n // Compute coords in case of cursor position (desktop)\n if (coordinate) {\n // If no altitude panel, don't call altitude request\n if (document.getElementById(this._addUID(\"GPmousePositionAltitude\"))) {\n altitudeTimeout = setTimeout(function () {\n self.onRequestAltitude(coordinate, function (z) {\n if (minThreshold < z && z < maxThreshold) {\n self.GPresetElevation();\n } else {\n document.getElementById(self._addUID(\"GPmousePositionAlt\")).innerHTML = z;\n }\n });\n }, altitudeTimeoutDelay);\n }\n }\n },\n /**\n * Function reseting altitude value\n */\n GPresetElevation: function GPresetElevation() {\n if (document.getElementById(this._addUID(\"GPmousePositionAltitude\"))) {\n document.getElementById(this._addUID(\"GPmousePositionAlt\")).innerHTML = \"---\";\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MousePositionDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvTW91c2VQb3NpdGlvbkRPTS5qcz8xNjljIl0sIm5hbWVzIjpbIk1vdXNlUG9zaXRpb25ET00iLCJfYWRkVUlEIiwiaWQiLCJ1aWQiLCJfdWlkIiwiX2NyZWF0ZU1haW5Db250YWluZXJFbGVtZW50IiwiY29udGFpbmVyIiwiZG9jdW1lbnQiLCJjcmVhdGVFbGVtZW50IiwiY2xhc3NOYW1lIiwiX2NyZWF0ZVNob3dNb3VzZVBvc2l0aW9uRWxlbWVudCIsImlucHV0IiwidHlwZSIsIl9jcmVhdGVTaG93TW91c2VQb3NpdGlvblBpY3RvRWxlbWVudCIsImlzRGVza3RvcCIsInNlbGYiLCJsYWJlbCIsImh0bWxGb3IiLC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ICAgICAgICAgICB9LCBmYWxzZSk7XG4gICAgICAgIH0gZWxzZSBpZiAobGFiZWwuYXR0YWNoRXZlbnQpIHtcbiAgICAgICAgICAgIGxhYmVsLmF0dGFjaEV2ZW50KFwib25jbGlja1wiLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY29udGV4dC5vblNob3dNb3VzZVBvc2l0aW9uU2V0dGluZ3NDbGljayA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQub25TaG93TW91c2VQb3NpdGlvblNldHRpbmdzQ2xpY2soZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBsaXN0LnB1c2goaW5wdXQpO1xuICAgICAgICBsaXN0LnB1c2gobGFiZWwpO1xuXG4gICAgICAgIHJldHVybiBsaXN0O1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBzZXR0aW5ncyBwYW5lbFxuICAgICAqIEBwYXJhbSB7Qm9vbGVhbn0gW2Rpc3BsYXk9dHJ1ZV0gLSBzcGVjaWZpZXMgaWYgdGhlIHNldHRpbmdzIHBhbmVsIG11c3QgYmUgZGlzcGxheWVkXG4gICAgICpcbiAgICAgKiBGSVhNRVxuICAgICAqIGRvbid0IGNhbGwgdGhpcy5fY3JlYXRlTW91c2VQb3NpdGlvblNldHRpbmdzU3lzdGVtc0VsZW1lbnRcbiAgICAgKiBkb24ndCBjYWxsIHRoaXMuX2NyZWF0ZU1vdXNlUG9zaXRpb25TZXR0aW5nc1VuaXRzRWxlbWVudFxuICAgICAqXG4gICAgICogQHJldHVybnMge0RPTUVsZW1lbnR9IERPTSBlbGVtZW50XG4gICAgICovXG4gICAgX2NyZWF0ZU1vdXNlUG9zaXRpb25TZXR0aW5nc0VsZW1lbnQgOiBmdW5jdGlvbiAoZGlzcGxheSkge1xuICAgICAgICB2YXIgY29udGFpbmVyID0gZG9jdW1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AgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJMQU1COTNcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiTGFtYmVydCA5M1wiXG4gICAgICAgIC8vICAgICB9LFxuICAgICAgICAvLyAgICAge1xuICAgICAgICAvLyAgICAgICAgIGNvZGUgOiBcIkxBTUIyRVwiLFxuICAgICAgICAvLyAgICAgICAgIGxhYmVsIDogXCJMYW1iZXJ0IElJIMOpdGVuZHVcIlxuICAgICAgICAvLyAgICAgfVxuICAgICAgICAvLyBdO1xuICAgICAgICAvL1xuICAgICAgICAvLyB2YXIgc2VsZWN0U3lzdGVtID0gdGhpcy5fY3JlYXRlTW91c2VQb3NpdGlvblNldHRpbmdzU3lzdGVtc0VsZW1lbnQoc3lzdGVtcyk7XG4gICAgICAgIC8vXG4gICAgICAgIC8vIGNvbnRhaW5lci5hcHBlbmRDaGlsZChzZWxlY3RTeXN0ZW0pO1xuXG4gICAgICAgIC8vIEZJWE1FIG9uIGRlY29tcG9zZSBsYSBmb25jdGlvbiBwb3VyIGxlcyBiZXNvaW5zIGR1IGNvbnRyb2xlLFxuICAgICAgICAvLyBvbiBham91dGVyYSBjZXMgY2hpbGRzIMOgIGxhIG1haW4uLi5cbiAgICAgICAgLy8gRklYTUUgdGFibGVhdSBzdGF0aXF1ZSAhXG4gICAgICAgIC8vIHZhciB1bml0cyA9IFtcbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJERUNcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiZGVncsOpcyBkw6ljaW1hdXhcIixcbiAgICAgICAgLy8gICAgIH0sXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgY29kZSA6IFwiRE1TXCIsXG4gICAgICAgIC8vICAgICAgICAgbGFiZWwgOiBcImRlZ3LDqXMgc2V4YWfDqXNpbWF1eFwiLFxuICAgICAgICAvLyAgICA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mIGN1cnNvciBwb3NpdGlvbiAoZGVza3RvcClcbiAgICAgICAgaWYgKGNvb3JkaW5hdGUpIHtcbiAgICAgICAgICAgIHZhciBsYWJlbExvbiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxvbkxhYmVsXCIpKTtcbiAgICAgICAgICAgIHZhciBsYWJlbExhdCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxhdExhYmVsXCIpKTtcblxuICAgICAgICAgICAgaWYgKGNvb3JkaW5hdGUueCB8fCBjb29yZGluYXRlLnkpIHtcbiAgICAgICAgICAgICAgICBsYWJlbExhdC5pbm5lckhUTUwgPSBcIlggOiBcIjtcbiAgICAgICAgICAgICAgICBsYWJlbExvbi5pbm5lckhUTUwgPSBcIlkgOiBcIjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29vcmRpbmF0ZS5lIHx8IGNvb3JkaW5hdGUubikge1xuICAgICAgICAgICAgICAgIGxhYmVsTGF0LmlubmVySFRNTCA9IFwiRSA6IFwiO1xuICAgICAgICAgICAgICAgIGxhYmVsTG9uLmlubmVySFRNTCA9IFwiTiA6IFwiO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsYWJlbExhdC5pbm5lckhUTUwgPSBcIkxhdGl0dWRlIDogXCI7XG4gICAgICAgICAgICAgICAgbGFiZWxMb24uaW5uZXJIVE1MID0gXCJMb25naXR1ZGUgOiBcIjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBjb29yZGluYXRlLmxhdCA9PT0gXCJvYmplY3RcIiAmJiB0eXBlb2YgY29vcmRpbmF0ZS5sbmcgPT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFydHMgPSB7XG4gICAgICAgICAgICAgICAgICAgIGxuZyA6IFwiTG9uXCIsXG4gICAgICAgICAgICAgICAgICAgIGxhdCA6IFwiTGF0XCJcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciB1bml0cyA9IFtcIkRlZ3JlZXNcIiwgXCJNaW51dGVzXCIsIFwiU2Vjb25kc1wiXTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwIGluIHBhcnRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgdW5pdHMubGVuZ3RoOyArK3UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RvciA9IFwiR1Btb3VzZVBvc2l0aW9uXCIgKyBwYXJ0c1twXSArIHVuaXRzW3VdO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsdCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChzZWxlY3RvcikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleSA9IHVuaXRzW3VdLmNoYXJBdCgwKS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWx0LnZhbHVlID0gY29vcmRpbmF0ZVtwXVtrZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGRpcmVjdGlvbnNcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCh0aGlzLl9hZGRVSUQoXCJHUG1vdXNlUG9zaXRpb25Mb25EaXJlY3Rpb25cIikpLnZhbHVlID0gY29vcmRpbmF0ZS5sbmcuZGlyZWN0aW9uO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxhdERpcmVjdGlvblwiKSkudmFsdWUgPSBjb29yZGluYXRlLmxhdC5kaXJlY3Rpb247XG4gICAgICAgICAgICB9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ICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNlbGYuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkFsdFwiKSkuaW5uZXJIVE1MID0gejtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgYWx0aXR1ZGVUaW1lb3V0RGVsYXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIEZ1bmN0aW9uIHJlc2V0aW5nIGFsdGl0dWRlIHZhbHVlXG4gICAgICovXG4gICAgR1ByZXNldEVsZXZhdGlvbiA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkFsdGl0dWRlXCIpKSkge1xuICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQodGhpcy5fYWRkVUlEKFwiR1Btb3VzZVBvc2l0aW9uQWx0XCIpKS5pbm5lckhUTUwgPSBcIi0tLVwiO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgTW91c2VQb3NpdGlvbkRPTTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/Controls/MousePositionDOM.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar MousePositionDOM = {\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Main container (DOM)\n *\n * @returns {DOMElement} DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePosition\");\n container.className = \"GPwidget\";\n return container;\n },\n // ################################################################### //\n // ################### Methods of main container ##################### //\n // ################################################################### //\n\n /**\n * Hidden checkbox for minimizing/maximizing\n *\n * @returns {DOMElement} DOM element\n */\n _createShowMousePositionElement: function _createShowMousePositionElement() {\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPshowMousePosition\");\n input.type = \"checkbox\";\n return input;\n },\n /**\n * Show mouse position control\n * @param {Boolean} isDesktop - specifies if the support is desktop or tactile\n *\n * @returns {DOMElement} DOM element\n */\n _createShowMousePositionPictoElement: function _createShowMousePositionPictoElement(isDesktop) {\n // contexte d'execution\n var self = this;\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowMousePositionPicto\");\n label.className = \"GPshowAdvancedToolPicto\";\n label.htmlFor = this._addUID(\"GPshowMousePosition\");\n label.title = \"Afficher les coordonnées du curseur\";\n\n // FIXME detection disponible dans le JS !\n // Detection : test for desktop or tactile\n // var isDesktop = true;\n // var userAgent = window.navigator.userAgent.toLowerCase();\n // if (userAgent.indexOf(\"iphone\") !== -1 ||\n // userAgent.indexOf(\"ipod\") !== -1 ||\n // userAgent.indexOf(\"ipad\") !== -1 ||\n // userAgent.indexOf(\"android\") !== -1 ||\n // userAgent.indexOf(\"mobile\") !== -1 ||\n // userAgent.indexOf(\"blackberry\") !== -1 ||\n // userAgent.indexOf(\"tablet\") !== -1 ||\n // userAgent.indexOf(\"phone\") !== -1 ||\n // userAgent.indexOf(\"touch\") !== -1 ) {\n // isDesktop = false;\n // }\n // if (userAgent.indexOf(\"msie\") !== -1 ||\n // userAgent.indexOf(\"trident\") !== -1) {\n // isDesktop = true;\n // }\n\n // Show map center localisation if panel opened and tactile support\n label.addEventListener(\"click\", function (e) {\n var mapCenterClass = \"\";\n if (!document.getElementById(self._addUID(\"GPshowMousePosition\")).checked && !isDesktop) {\n mapCenterClass = \"GPmapCenterVisible\";\n }\n document.getElementById(\"GPmapCenter\").className = mapCenterClass;\n self.onShowMousePositionClick(e);\n });\n var spanOpen = document.createElement(\"span\");\n spanOpen.id = this._addUID(\"GPshowMousePositionOpen\");\n spanOpen.className = \"GPshowAdvancedToolOpen\";\n label.appendChild(spanOpen);\n return label;\n },\n /**\n * mouse position panel\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionPanelElement: function _createMousePositionPanelElement() {\n var panel = document.createElement(\"div\");\n panel.id = this._addUID(\"GPmousePositionPanel\");\n panel.className = \"GPpanel\";\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // div.appendChild(this._createMousePositionPanelHeaderElement());\n // div.appendChild(this._createMousePositionPanelBasicElement());\n // div.appendChild(this._createShowMousePositionSettingsElement());\n // div.appendChild(this._createMousePositionSettingsElement());\n\n return panel;\n },\n /**\n * Map center localisation (tactile use)\n *\n * @returns {DOMElement} container\n */\n _createMapCenter: function _createMapCenter() {\n var div = document.createElement(\"div\");\n div.id = \"GPmapCenter\";\n div.className = \"\";\n return div;\n },\n // ################################################################### //\n // ####################### Panel container ########################### //\n // ################################################################### //\n\n /**\n * @returns {DOMElement} container\n */\n _createMousePositionPanelHeaderElement: function _createMousePositionPanelHeaderElement() {\n var container = document.createElement(\"div\");\n container.className = \"GPpanelHeader\";\n var divTitle = document.createElement(\"div\");\n divTitle.className = \"GPpanelTitle\";\n divTitle.innerHTML = \"Coordonnées\";\n container.appendChild(divTitle);\n var divClose = document.createElement(\"div\");\n divClose.id = \"GPmousePositionPanelClose\";\n divClose.className = \"GPpanelClose\";\n divClose.title = \"Fermer le panneau\";\n\n // Link panel close / visibility checkbox\n var self = this;\n if (divClose.addEventListener) {\n divClose.addEventListener(\"click\", function () {\n document.getElementById(self._addUID(\"GPshowMousePositionPicto\")).click();\n }, false);\n } else if (divClose.attachEvent) {\n divClose.attachEvent(\"onclick\", function () {\n document.getElementById(self._addUID(\"GPshowMousePositionPicto\")).click();\n });\n }\n container.appendChild(divClose);\n return container;\n },\n /**\n * coordinate panel\n * @param {Boolean} [displayAltitude] - specifies if the altitude panel must be displayed\n * @param {Boolean} [displayCoordinates] - specifies if the coordinates panel must be displayed\n * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed\n * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units\n *\n * FIXME\n * call this._createMousePositionPanelBasicCoordinateElement\n * call this._createMousePositionPanelBasicAltitudeElement\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionPanelBasicElement: function _createMousePositionPanelBasicElement(displayAltitude, displayCoordinates, editCoordinates, currentProjectionUnits) {\n // default Values\n displayAltitude = typeof displayAltitude === \"undefined\" ? true : displayAltitude;\n displayCoordinates = typeof displayCoordinates === \"undefined\" ? true : displayCoordinates;\n editCoordinates = typeof editCoordinates === \"undefined\" ? false : editCoordinates;\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePositionBasicPanel\");\n\n // FIXME on devrait decomposer la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n container.appendChild(this._createMousePositionPanelBasicCoordinateElement(displayCoordinates, editCoordinates, currentProjectionUnits));\n container.appendChild(this._createMousePositionPanelEditToolsElement(editCoordinates));\n container.appendChild(this._createMousePositionPanelBasicAltitudeElement(displayAltitude));\n return container;\n },\n /**\n * create coordinate elements\n *\n * @param {String} coordType - (\"Lon\" ou \"Lat\")\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {Array} list of DOM elements\n */\n _createCoordinateElement: function _createCoordinateElement(coordType, editCoordinates) {\n var context = this;\n if ([\"Lon\", \"Lat\"].indexOf(coordType) === -1) {\n return [];\n }\n var list = [];\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPmousePosition\" + coordType);\n input.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input.readOnly = true;\n if (editCoordinates) {\n input.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input.addEventListener(\"change\", function (e) {\n this.classList.remove(\"error\");\n var valid = context.validateExtentCoordinate(coordType, this.value, e);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input);\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionUnits\";\n list.push(span);\n return list;\n },\n /**\n *\n * @param {String} coordType - (\"Lon\" ou \"Lat\")\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {Array} list of DOM elements\n */\n _createDMSCoordinateElement: function _createDMSCoordinateElement(coordType, editCoordinates) {\n if ([\"Lon\", \"Lat\"].indexOf(coordType) === -1) {\n return [];\n }\n var context = this;\n var list = [];\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPmousePosition\" + coordType + \"Degrees\");\n input.className = \"GPSexagesimal\";\n input.setAttribute(\"name\", \"degrees\");\n input.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input.readOnly = true;\n input.dataset.min = 0;\n input.dataset.max = coordType === \"Lon\" ? 180 : 90;\n if (editCoordinates) {\n input.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSDegrees(coordType, this);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input);\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionSexagesimalLabel\";\n span.innerHTML = \"°\";\n list.push(span);\n var input1 = document.createElement(\"input\");\n input1.id = this._addUID(\"GPmousePosition\" + coordType + \"Minutes\");\n input1.className = \"GPSexagesimal\";\n input1.setAttribute(\"name\", \"minutes\");\n input1.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input1.readOnly = true;\n input1.dataset.min = 0;\n input1.dataset.max = 59;\n if (editCoordinates) {\n input1.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input1.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSElement(this);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input1);\n var span1 = document.createElement(\"span\");\n span1.className = \"GPmousePositionSexagesimalLabel\";\n span1.innerHTML = \"'\";\n list.push(span1);\n var input2 = document.createElement(\"input\");\n input2.id = this._addUID(\"GPmousePosition\" + coordType + \"Seconds\");\n input2.className = \"GPSexagesimalsec\";\n input2.setAttribute(\"name\", \"seconds\");\n input2.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input2.readOnly = true;\n input2.dataset.min = 0;\n input2.dataset.max = 59;\n if (editCoordinates) {\n input2.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input2.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSElement(this, true);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input2);\n var span2 = document.createElement(\"span\");\n span2.className = \"GPmousePositionSexagesimalLabel\";\n span2.innerHTML = \"''\";\n list.push(span2);\n var select = document.createElement(\"select\");\n select.id = this._addUID(\"GPmousePosition\" + coordType + \"Direction\");\n select.className = \"GPmousePositionDirection\";\n select.setAttribute(\"name\", \"direction\");\n select.disabled = true;\n var option = document.createElement(\"option\");\n option.value = coordType === \"Lon\" ? \"E\" : \"N\";\n option.innerHTML = coordType === \"Lon\" ? \"E\" : \"N\";\n select.appendChild(option);\n var option1 = document.createElement(\"option\");\n option1.value = coordType === \"Lon\" ? \"O\" : \"S\";\n option1.innerHTML = coordType === \"Lon\" ? \"O\" : \"S\";\n select.appendChild(option1);\n list.push(select);\n return list;\n },\n /**\n * @param {Boolean} [display=false] - specifies if the coordinates panel must be displayed\n * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed\n * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelBasicCoordinateElement: function _createMousePositionPanelBasicCoordinateElement(display, editCoordinates, currentProjectionUnits) {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPmousePositionCoordinate\");\n div.style.display = display ? \"block\" : \"none\";\n\n // latitude\n var divLat = document.createElement(\"div\");\n var spanLat = document.createElement(\"span\");\n spanLat.className = \"GPmousePositionLabel\";\n spanLat.id = this._addUID(\"GPmousePositionLatLabel\");\n spanLat.innerHTML = \"Latitude : \";\n divLat.appendChild(spanLat);\n var span = document.createElement(\"span\");\n span.id = this._addUID(\"GPmousePositionLatCoordinate\");\n var arrayCoords;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords = this._createDMSCoordinateElement(\"Lat\", editCoordinates);\n } else {\n arrayCoords = this._createCoordinateElement(\"Lat\", editCoordinates);\n }\n for (var i = 0; i < arrayCoords.length; i++) {\n span.appendChild(arrayCoords[i]);\n }\n divLat.appendChild(span);\n div.appendChild(divLat);\n\n // longitude\n var divLon = document.createElement(\"div\");\n var spanLon = document.createElement(\"span\");\n spanLon.className = \"GPmousePositionLabel\";\n spanLon.id = this._addUID(\"GPmousePositionLonLabel\");\n spanLon.innerHTML = \"Longitude : \";\n divLon.appendChild(spanLon);\n var span1 = document.createElement(\"span\");\n span1.id = this._addUID(\"GPmousePositionLonCoordinate\");\n var arrayCoords1;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords1 = this._createDMSCoordinateElement(\"Lon\", editCoordinates);\n } else {\n arrayCoords1 = this._createCoordinateElement(\"Lon\", editCoordinates);\n }\n for (var j = 0; j < arrayCoords1.length; j++) {\n span1.appendChild(arrayCoords1[j]);\n }\n divLon.appendChild(span1);\n div.appendChild(divLon);\n return div;\n },\n /**\n * @param {Boolean} [display=false] - specifies if the altitude panel must be displayed\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelBasicAltitudeElement: function _createMousePositionPanelBasicAltitudeElement(display) {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPmousePositionAltitude\");\n div.style.display = display ? \"block\" : \"none\";\n var spanLabel = document.createElement(\"span\");\n spanLabel.className = \"GPmousePositionLabel\";\n spanLabel.innerHTML = \"Altitude : \";\n div.appendChild(spanLabel);\n var spanAlt = document.createElement(\"span\");\n spanAlt.className = \"GPmousePositionCoords\";\n spanAlt.id = this._addUID(\"GPmousePositionAlt\");\n spanAlt.innerHTML = \"...\";\n div.appendChild(spanAlt);\n var spanUnits = document.createElement(\"span\");\n spanUnits.className = \"GPmousePositionAltitudeUnits\";\n spanUnits.innerHTML = \"m\";\n div.appendChild(spanUnits);\n return div;\n },\n /**\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelEditToolsElement: function _createMousePositionPanelEditToolsElement(editCoordinates) {\n var context = this;\n var div = document.createElement(\"div\");\n div.className = \"GPmousePositionPanelEditTools\";\n div.id = this._addUID(\"GPmousePositionPanelEditTools\");\n if (!editCoordinates) {\n div.style.display = \"none\";\n }\n var span1 = document.createElement(\"span\");\n span1.className = \"GPmousePositionEditTool\";\n span1.id = this._addUID(\"GPmousePositionLocate\");\n span1.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n if (editCoordinates) {\n span1.addEventListener(\"click\", function () {\n context.onMousePositionEditModeLocateClick();\n });\n }\n div.appendChild(span1);\n var span2 = document.createElement(\"span\");\n span2.className = \"GPmousePositionEditTool\";\n span2.id = this._addUID(\"GPmousePositionCloseEdit\");\n span2.title = \"Quitter la saisie des coordonnées\";\n span2.style.display = \"none\";\n if (editCoordinates) {\n span2.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(false);\n });\n }\n div.appendChild(span2);\n return div;\n },\n // ################################################################### //\n // #################### Settings container ########################### //\n // ################################################################### //\n\n /**\n * @param {Boolean} [display=false] - specifies if the settings panel must be displayed\n *\n * @returns {DOMElement[]} array containing input and label elements\n */\n _createShowMousePositionSettingsElement: function _createShowMousePositionSettingsElement(display) {\n var list = [];\n var context = this;\n var input = document.createElement(\"input\");\n input.type = \"checkbox\";\n input.id = this._addUID(\"GPshowMousePositionSettings\");\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowMousePositionSettingsPicto\");\n label.htmlFor = this._addUID(\"GPshowMousePositionSettings\");\n label.title = \"Réglages\";\n label.className = \"GPshowMoreOptionsImage GPshowMoreOptions GPshowMousePositionSettingsPicto\"; // FIXME classname and id ?\n label.style.display = display ? \"block\" : \"none\";\n if (label.addEventListener) {\n label.addEventListener(\"click\", function (e) {\n if (typeof context.onShowMousePositionSettingsClick === \"function\") {\n context.onShowMousePositionSettingsClick(e);\n }\n }, false);\n } else if (label.attachEvent) {\n label.attachEvent(\"onclick\", function (e) {\n if (typeof context.onShowMousePositionSettingsClick === \"function\") {\n context.onShowMousePositionSettingsClick(e);\n }\n });\n }\n list.push(input);\n list.push(label);\n return list;\n },\n /**\n * settings panel\n * @param {Boolean} [display=true] - specifies if the settings panel must be displayed\n *\n * FIXME\n * don't call this._createMousePositionSettingsSystemsElement\n * don't call this._createMousePositionSettingsUnitsElement\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionSettingsElement: function _createMousePositionSettingsElement(display) {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePositionSettings\");\n container.style.display = display === undefined || display ? \"block\" : \"none\";\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionSettingsLabel\";\n span.innerHTML = \"Système de référence\";\n container.appendChild(span);\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // FIXME tableau statique !\n // var systems = [\n // {\n // code : \"GEOGRAPHIC\",\n // label : \"Géographique\"\n // },\n // {\n // code : \"MERCATOR\",\n // label : \"Mercator\"\n // },\n // {\n // code : \"LAMB93\",\n // label : \"Lambert 93\"\n // },\n // {\n // code : \"LAMB2E\",\n // label : \"Lambert II étendu\"\n // }\n // ];\n //\n // var selectSystem = this._createMousePositionSettingsSystemsElement(systems);\n //\n // container.appendChild(selectSystem);\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // FIXME tableau statique !\n // var units = [\n // {\n // code : \"DEC\",\n // label : \"degrés décimaux\",\n // },\n // {\n // code : \"DMS\",\n // label : \"degrés sexagésimaux\",\n // },\n // {\n // code : \"RAD\",\n // label : \"radians\",\n // },\n // {\n // code : \"GON\",\n // label : \"grades\"\n // }\n // ];\n //\n // var selectUnits = this._createMousePositionSettingsUnitsElement(units);\n //\n // container.appendChild(selectUnits);\n\n return container;\n },\n /**\n * @param {Object[]} systems - list of systems\n *\n * @returns {DOMElement} DOM element select\n */\n _createMousePositionSettingsSystemsElement: function _createMousePositionSettingsSystemsElement(systems) {\n // contexte d'execution\n var context = this;\n var selectSystem = document.createElement(\"select\");\n selectSystem.id = this._addUID(\"GPmousePositionProjectionSystem\");\n selectSystem.className = \"GPinputSelect GPmousePositionSettingsSelect\";\n selectSystem.addEventListener(\"change\", function (e) {\n context.onMousePositionProjectionSystemChange(e);\n });\n selectSystem.addEventListener(\"mouseover\", function (e) {\n // FIXME mettre une condition si target === option\n if (e.target.nodeName !== \"OPTION\") {\n context.onMousePositionProjectionSystemMouseOver(e);\n }\n });\n for (var i = 0; i < systems.length; i++) {\n var obj = systems[i];\n var option = document.createElement(\"option\");\n option.value = obj.code;\n option.text = obj.label || i;\n // option.label = obj.label;\n selectSystem.appendChild(option);\n }\n return selectSystem;\n },\n /**\n * @param {Object[]} units - list of units\n *\n * @returns {DOMElement} DOM element select\n */\n _createMousePositionSettingsUnitsElement: function _createMousePositionSettingsUnitsElement(units) {\n // contexte d'execution\n var context = this;\n var selectUnits = document.createElement(\"select\");\n selectUnits.id = this._addUID(\"GPmousePositionProjectionUnits\");\n selectUnits.className = \"GPinputSelect GPmousePositionSettingsSelect\";\n selectUnits.addEventListener(\"change\", function (e) {\n context.onMousePositionProjectionUnitsChange(e);\n });\n for (var j = 0; j < units.length; j++) {\n var obj = units[j];\n var option = document.createElement(\"option\");\n option.value = obj.code ? obj.code : j;\n option.text = obj.label || j;\n // option.label = obj.label;\n selectUnits.appendChild(option);\n }\n return selectUnits;\n },\n /**\n * @param {String} [currentProjectionType=\"Metric\"] - \"Geographical\" or \"Metric\"\n */\n _resetLabelElements: function _resetLabelElements(currentProjectionType) {\n // Changement des labels dans le formulaire de saisie\n var spanLat = document.getElementById(this._addUID(\"GPmousePositionLatLabel\"));\n spanLat.innerHTML = currentProjectionType === \"Geographical\" ? \"Latitude :\" : \"X :\";\n var spanLon = document.getElementById(this._addUID(\"GPmousePositionLonLabel\"));\n spanLon.innerHTML = currentProjectionType === \"Geographical\" ? \"Longitude :\" : \"Y :\";\n },\n /**\n * @param {String} currentProjectionUnits - projection units\n */\n _resetUnitElements: function _resetUnitElements(currentProjectionUnits) {\n var value = \"\";\n if (currentProjectionUnits === \"M\" || currentProjectionUnits === \"KM\") {\n value = currentProjectionUnits.toLowerCase();\n }\n var elts = document.getElementsByClassName(\"GPmousePositionUnits\");\n for (var e = 0; e < elts.length; e++) {\n elts[e].innerHTML = value;\n }\n },\n /**\n * @param {Boolean} editCoordinates - edit coordinates option\n * @param {String} currentProjectionType - current projection type\n * @param {String} currentProjectionUnits - current projection unit\n */\n _resetCoordinateElements: function _resetCoordinateElements(editCoordinates, currentProjectionType, currentProjectionUnits) {\n // Suppression de tous les enfants de GPmousePositionLatCoordinate\n var latElt = document.getElementById(this._addUID(\"GPmousePositionLatCoordinate\"));\n while (latElt.firstChild) {\n latElt.removeChild(latElt.firstChild);\n }\n var arrayCoords;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords = this._createDMSCoordinateElement(\"Lat\", editCoordinates);\n } else {\n arrayCoords = this._createCoordinateElement(\"Lat\", editCoordinates);\n }\n for (var i = 0; i < arrayCoords.length; i++) {\n latElt.appendChild(arrayCoords[i]);\n }\n\n // Suppression de tous les enfants de GPmousePositionLonCoordinate\n var lonElt = document.getElementById(this._addUID(\"GPmousePositionLonCoordinate\"));\n while (lonElt.firstChild) {\n lonElt.removeChild(lonElt.firstChild);\n }\n var arrayCoords1;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords1 = this._createDMSCoordinateElement(\"Lon\", editCoordinates);\n } else {\n arrayCoords1 = this._createCoordinateElement(\"Lon\", editCoordinates);\n }\n for (var j = 0; j < arrayCoords1.length; j++) {\n lonElt.appendChild(arrayCoords1[j]);\n }\n\n // FIXME on simule un deplacement ?\n // this.onMapMove();\n },\n\n /**\n * Set/unset editing mode\n *\n * @param {Boolean} editing - active edit coordinates mode\n */\n _setEditMode: function _setEditMode(editing) {\n var locateElt = document.getElementById(this._addUID(\"GPmousePositionLocate\"));\n locateElt.title = editing ? \"Aller à la position ...\" : \"Cliquer pour saisir des coordonnées\";\n var closeEditElt = document.getElementById(this._addUID(\"GPmousePositionCloseEdit\"));\n closeEditElt.style.display = editing ? \"inline-block\" : \"none\";\n var selector = \"div[id^=\" + this._addUID(\"GPmousePositionCoordinate\") + \"]\";\n var inputs = document.querySelectorAll(selector + \" input\");\n for (var i = 0; i < inputs.length; i++) {\n inputs[i].readOnly = !editing;\n if (editing) {\n inputs[i].value = \"\";\n inputs[i].classList.remove(\"error\");\n }\n }\n var selects = document.querySelectorAll(selector + \" select\");\n for (var j = 0; j < selects.length; j++) {\n selects[j].disabled = !editing;\n }\n },\n /**\n *\n * @param {DOMElement} input - input element\n * @param {Boolean} isFloat - check for float value\n *\n * @returns {Boolean} true if input value is within bounds\n */\n _checkDMSElement: function _checkDMSElement(input, isFloat) {\n var b = isFloat !== undefined;\n var value = input.value;\n if (b) {\n value = value.replace(\",\", \".\");\n }\n if (isNaN(value)) {\n return false;\n }\n var v = parseFloat(value);\n if (!b && (v | 0) !== v) {\n // is it an integer\n return false;\n }\n var min = Number(input.dataset.min);\n var max = Number(input.dataset.max);\n return v >= min && v <= max;\n },\n /**\n * @param {String} coordType - \"Lon\" or \"Lat\"\n * @param {DOMElement} input - input element\n *\n * @returns {Boolean} true if input value is within bounds\n */\n _checkDMSDegrees: function _checkDMSDegrees(coordType, input) {\n if (isNaN(input.value)) {\n return false;\n }\n var v = parseFloat(input.value);\n if ((v | 0) !== v) {\n // is it an integer\n return false;\n }\n var min = Number(input.dataset.min);\n var max = Number(input.dataset.max);\n if (v < min || v > max) {\n return false;\n }\n var inputMinutes = document.getElementById(this._addUID(\"GPmousePosition\" + coordType + \"Minutes\"));\n var inputSeconds = document.getElementById(this._addUID(\"GPmousePosition\" + coordType + \"Seconds\"));\n if (v >= max) {\n inputMinutes.dataset.max = 0;\n inputSeconds.dataset.max = 0;\n } else {\n inputMinutes.dataset.max = 59;\n inputSeconds.dataset.max = 59.9999;\n }\n return true;\n },\n // ################################################################### //\n // ####################### handlers Event ############################ //\n // ################################################################### //\n\n /**\n * Function displaying coordinates from cursor position (desktop)\n * or map center (tactile)\n * @param {Object} coordinate - coordinates\n */\n GPdisplayCoords: function GPdisplayCoords(coordinate) {\n // Compute coords in case of cursor position (desktop)\n if (coordinate) {\n var labelLon = document.getElementById(this._addUID(\"GPmousePositionLonLabel\"));\n var labelLat = document.getElementById(this._addUID(\"GPmousePositionLatLabel\"));\n if (coordinate.x || coordinate.y) {\n labelLat.innerHTML = \"X : \";\n labelLon.innerHTML = \"Y : \";\n } else if (coordinate.e || coordinate.n) {\n labelLat.innerHTML = \"E : \";\n labelLon.innerHTML = \"N : \";\n } else {\n labelLat.innerHTML = \"Latitude : \";\n labelLon.innerHTML = \"Longitude : \";\n }\n if (_typeof(coordinate.lat) === \"object\" && _typeof(coordinate.lng) === \"object\") {\n var parts = {\n lng: \"Lon\",\n lat: \"Lat\"\n };\n var units = [\"Degrees\", \"Minutes\", \"Seconds\"];\n for (var p in parts) {\n for (var u = 0; u < units.length; ++u) {\n var selector = \"GPmousePosition\" + parts[p] + units[u];\n var elt = document.getElementById(this._addUID(selector));\n var key = units[u].charAt(0).toLowerCase();\n elt.value = coordinate[p][key];\n }\n }\n // directions\n document.getElementById(this._addUID(\"GPmousePositionLonDirection\")).value = coordinate.lng.direction;\n document.getElementById(this._addUID(\"GPmousePositionLatDirection\")).value = coordinate.lat.direction;\n } else {\n var elLat = document.getElementById(this._addUID(\"GPmousePositionLat\"));\n var elLon = document.getElementById(this._addUID(\"GPmousePositionLon\"));\n elLat.value = coordinate.x || coordinate.lat || coordinate.e || \"0\";\n elLon.value = coordinate.y || coordinate.lng || coordinate.lon || coordinate.n || \"0\";\n\n // les unites\n var unit = coordinate.unit === undefined ? \"\" : coordinate.unit;\n var elements = document.getElementsByClassName(\"GPmousePositionUnits\");\n for (var n = 0; n < elements.length; ++n) {\n elements[n].innerHTML = unit;\n }\n }\n }\n },\n /**\n * Function displaying altitude from cursor position (desktop)\n * or map center (tactile)\n * @param {Object} coordinate - coordinates\n * @param {Number} altitudeTimeoutDelay - when the mouse stop moving, delay before the altitude request is launched\n * @param {Number} noDataValue - the no data value\n * @param {Number} noDataValueTolerance - the no data value tolerance\n */\n GPdisplayElevation: function GPdisplayElevation(coordinate, altitudeTimeoutDelay, noDataValue, noDataValueTolerance) {\n // contexte d'execution\n var self = this;\n\n // Latency for altitude request\n var altitudeTimeout;\n if (!altitudeTimeoutDelay) {\n altitudeTimeoutDelay = 500;\n }\n clearTimeout(altitudeTimeout);\n document.getElementById(this._addUID(\"GPmousePositionAlt\")).innerHTML = \"...\";\n if (noDataValue == null) {\n noDataValue = -99999;\n }\n if (noDataValueTolerance == null) {\n noDataValueTolerance = 99980;\n }\n var maxThreshold = noDataValue + noDataValueTolerance;\n var minThreshold = noDataValue - noDataValueTolerance;\n\n // Compute coords in case of cursor position (desktop)\n if (coordinate) {\n // If no altitude panel, don't call altitude request\n if (document.getElementById(this._addUID(\"GPmousePositionAltitude\"))) {\n altitudeTimeout = setTimeout(function () {\n self.onRequestAltitude(coordinate, function (z) {\n if (minThreshold < z && z < maxThreshold) {\n self.GPresetElevation();\n } else {\n document.getElementById(self._addUID(\"GPmousePositionAlt\")).innerHTML = z;\n }\n });\n }, altitudeTimeoutDelay);\n }\n }\n },\n /**\n * Function reseting altitude value\n */\n GPresetElevation: function GPresetElevation() {\n if (document.getElementById(this._addUID(\"GPmousePositionAltitude\"))) {\n document.getElementById(this._addUID(\"GPmousePositionAlt\")).innerHTML = \"---\";\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MousePositionDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvTW91c2VQb3NpdGlvbkRPTS5qcz8xNjljIl0sIm5hbWVzIjpbIk1vdXNlUG9zaXRpb25ET00iLCJfYWRkVUlEIiwiaWQiLCJ1aWQiLCJfdWlkIiwiX2NyZWF0ZU1haW5Db250YWluZXJFbGVtZW50IiwiY29udGFpbmVyIiwiZG9jdW1lbnQiLCJjcmVhdGVFbGVtZW50IiwiY2xhc3NOYW1lIiwiX2NyZWF0ZVNob3dNb3VzZVBvc2l0aW9uRWxlbWVudCIsImlucHV0IiwidHlwZSIsIl9jcmVhdGVTaG93TW91c2VQb3NpdGlvblBpY3RvRWxlbWVudCIsImlzRGVza3RvcCIsInNlbGYiLCJsYWJlbCIsImh0bWxGb3IiLCJ0aXRsZSIsImFkZEV2ZW50TGlzdGVuZXIiLCJlIiwibWFwQ2VudGVyQ2xhc3MiLCJnZXRFbGVtZW50QnlJZCIsImNoZWNrZWQiLCJvblNob3dNb3VzZVBvc2l0aW9uQ2xpY2siLCJzcGFuT3BlbiIsImFwcGVuZENoaWxkIiwiX2NyZWF0ZU1vdXNlUG9zaXRpb25QYW5lbEVsZW1lbnQiLCJwYW5lbCIsIl9jcmVhdGVNYXBDZW50ZXIiLCJkaXYiLCJfY3JlYXRlTW91c2VQb3NpdGlvblBhbmVsSGVhZGVyRWxlbWVudCIsImRpdlRpdGxlIiwiaW5uZXJIVE1MIiwiZGl2Q2xvc2UiLCJjbGljayIsImF0dGFjaEV2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YmVsXCI7XG4gICAgICAgIHNwYW4uaW5uZXJIVE1MID0gXCJTeXN0w6htZSBkZSByw6lmw6lyZW5jZVwiO1xuICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoc3Bhbik7XG5cbiAgICAgICAgLy8gRklYTUUgb24gZGVjb21wb3NlIGxhIGZvbmN0aW9uIHBvdXIgbGVzIGJlc29pbnMgZHUgY29udHJvbGUsXG4gICAgICAgIC8vIG9uIGFqb3V0ZXJhIGNlcyBjaGlsZHMgw6AgbGEgbWFpbi4uLlxuICAgICAgICAvLyBGSVhNRSB0YWJsZWF1IHN0YXRpcXVlICFcbiAgICAgICAgLy8gdmFyIHN5c3RlbXMgPSBbXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgY29kZSA6IFwiR0VPR1JBUEhJQ1wiLFxuICAgICAgICAvLyAgICAgICAgIGxhYmVsIDogXCJHw6lvZ3JhcGhpcXVlXCJcbiAgICAgICAgLy8gICAgIH0sXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgY29kZSA6IFwiTUVSQ0FUT1JcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiTWVyY2F0b3JcIlxuICAgICAgICAvLyAgICAgfSxcbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJMQU1COTNcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiTGFtYmVydCA5M1wiXG4gICAgICAgIC8vICAgICB9LFxuICAgICAgICAvLyAgICAge1xuICAgICAgICAvLyAgICAgICAgIGNvZGUgOiBcIkxBTUIyRVwiLFxuICAgICAgICAvLyAgICAgICAgIGxhYmVsIDogXCJMYW1iZXJ0IElJIMOpdGVuZHVcIlxuICAgICAgICAvLyAgICAgfVxuICAgICAgICAvLyBdO1xuICAgICAgICAvL1xuICAgICAgICAvLyB2YXIgc2VsZWN0U3lzdGVtID0gdGhpcy5fY3JlYXRlTW91c2VQb3NpdGlvblNldHRpbmdzU3lzdGVtc0VsZW1lbnQoc3lzdGVtcyk7XG4gICAgICAgIC8vXG4gICAgICAgIC8vIGNvbnRhaW5lci5hcHBlbmRDaGlsZChzZWxlY3RTeXN0ZW0pO1xuXG4gICAgICAgIC8vIEZJWE1FIG9uIGRlY29tcG9zZSBsYSBmb25jdGlvbiBwb3VyIGxlcyBiZXNvaW5zIGR1IGNvbnRyb2xlLFxuICAgICAgICAvLyBvbiBham91dGVyYSBjZXMgY2hpbGRzIMOgIGxhIG1haW4uLi5cbiAgICAgICAgLy8gRklYTUUgdGFibGVhdSBzdGF0aXF1ZSAhXG4gICAgICAgIC8vIHZhciB1bml0cyA9IFtcbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJERUNcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiZGVncsOpcyBkw6ljaW1hdXhcIixcbiAgICAgICAgLy8gICAgIH0sXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgY29kZSA6IFwiRE1TXCIsXG4gICAgICAgIC8vICAgICAgICAgbGFiZWwgOiBcImRlZ3LDqXMgc2V4YWfDqXNpbWF1eFwiLFxuICAgICAgICAvLyAgICAgfSxcbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJSQURcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwicmFkaWFuc1wiLFxuICAgICAgICAvLyAgICAgfSxcbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJHT05cIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiZ3JhZGVzXCJcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy8gXTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gdmFyIHNlbGVjdFVuaXRzID0gdGhpcy5fY3JlYXRlTW91c2VQb3NpdGlvblNldHR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kge1xuICAgICAgICAgICAgLy8gRklYTUUgbWV0dHJlIHVuZSBjb25kaXRpb24gc2kgdGFyZ2V0ID09PSBvcHRpb25cbiAgICAgICAgICAgIGlmIChlLnRhcmdldC5ub2RlTmFtZSAhPT0gXCJPUFRJT05cIikge1xuICAgICAgICAgICAgICAgIGNvbnRleHQub25Nb3VzZVBvc2l0aW9uUHJvamVjdGlvblN5c3RlbU1vdXNlT3ZlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzeXN0ZW1zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgb2JqID0gc3lzdGVtc1tpXTtcbiAgICAgICAgICAgIHZhciBvcHRpb24gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwib3B0aW9uXCIpO1xuICAgICAgICAgICAgb3B0aW9uLnZhbHVlID0gb2JqLmNvZGU7XG4gICAgICAgICAgICBvcHRpb24udGV4dCA9IG9iai5sYWJlbCB8fCBpO1xuICAgICAgICAgICAgLy8gb3B0aW9uLmxhYmVsID0gb2JqLmxhYmVsO1xuICAgICAgICAgICAgc2VsZWN0U3lzdGVtLmFwcGVuZENoaWxkKG9wdGlvbik7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gc2VsZWN0U3lzdGVtO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge09iamVjdFtdfSB1bml0cyAtIGxpc3Qgb2YgdW5pdHNcbiAgICAgKlxuICAgICAqIEByZXR1cm5zIHtET01FbGVtZW50fSBET00gZWxlbWVudCBzZWxlY3RcbiAgICAgKi9cbiAgICBfY3JlYXRlTW91c2VQb3NpdGlvblNldHRpbmdzVW5pdHNFbGVtZW50IDogZnVuY3Rpb24gKHVuaXRzKSB7XG4gICAgICAgIC8vIGNvbnRleHRlIGQnZXhlY3V0aW9uXG4gICAgICAgIHZhciBjb250ZXh0ID0gdGhpcztcblxuICA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IGlucHV0KSB7XG4gICAgICAgIGlmIChpc05hTihpbnB1dC52YWx1ZSkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB2ID0gcGFyc2VGbG9hdChpbnB1dC52YWx1ZSk7XG4gICAgICAgIGlmICgodiB8IDApICE9PSB2KSB7IC8vIGlzIGl0IGFuIGludGVnZXJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBtaW4gPSBOdW1iZXIoaW5wdXQuZGF0YXNldC5taW4pO1xuICAgICAgICB2YXIgbWF4ID0gTnVtYmVyKGlucHV0LmRhdGFzZXQubWF4KTtcbiAgICAgICAgaWYgKHYgPCBtaW4gfHwgdiA+IG1heCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGlucHV0TWludXRlcyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvblwiICsgY29vcmRUeXBlICsgXCJNaW51dGVzXCIpKTtcbiAgICAgICAgdmFyIGlucHV0U2Vjb25kcyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvblwiICsgY29vcmRUeXBlICsgXCJTZWNvbmRzXCIpKTtcblxuICAgICAgICBpZiAodiA+PSBtYXgpIHtcbiAgICAgICAgICAgIGlucHV0TWludXRlcy5kYXRhc2V0Lm1heCA9IDA7XG4gICAgICAgICAgICBpbnB1dFNlY29uZHMuZGF0YXNldC5tYXggPSAwO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5wdXRNaW51dGVzLmRhdGFzZXQubWF4ID0gNTk7XG4gICAgICAgICAgICBpbnB1dFNlY29uZHMuZGF0YXNldC5tYXggPSA1OS45OTk5O1xuICAgICAgICB9XG5cbiAgICAgIC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gICAgICAgICAgICBsYWJlbExhdC5pbm5lckhUTUwgPSBcIlggOiBcIjtcbiAgICAgICAgICAgICAgICBsYWJlbExvbi5pbm5lckhUTUwgPSBcIlkgOiBcIjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29vcmRpbmF0ZS5lIHx8IGNvb3JkaW5hdGUubikge1xuICAgICAgICAgICAgICAgIGxhYmVsTGF0LmlubmVySFRNTCA9IFwiRSA6IFwiO1xuICAgICAgICAgICAgICAgIGxhYmVsTG9uLmlubmVySFRNTCA9IFwiTiA6IFwiO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsYWJlbExhdC5pbm5lckhUTUwgPSBcIkxhdGl0dWRlIDogXCI7XG4gICAgICAgICAgICAgICAgbGFiZWxMb24uaW5uZXJIVE1MID0gXCJMb25naXR1ZGUgOiBcIjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBjb29yZGluYXRlLmxhdCA9PT0gXCJvYmplY3RcIiAmJiB0eXBlb2YgY29vcmRpbmF0ZS5sbmcgPT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFydHMgPSB7XG4gICAgICAgICAgICAgICAgICAgIGxuZyA6IFwiTG9uXCIsXG4gICAgICAgICAgICAgICAgICAgIGxhdCA6IFwiTGF0XCJcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciB1bml0cyA9IFtcIkRlZ3JlZXNcIiwgXCJNaW51dGVzXCIsIFwiU2Vjb25kc1wiXTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwIGluIHBhcnRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgdW5pdHMubGVuZ3RoOyArK3UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RvciA9IFwiR1Btb3VzZVBvc2l0aW9uXCIgKyBwYXJ0c1twXSArIHVuaXRzW3VdO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsdCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChzZWxlY3RvcikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleSA9IHVuaXRzW3VdLmNoYXJBdCgwKS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWx0LnZhbHVlID0gY29vcmRpbmF0ZVtwXVtrZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGRpcmVjdGlvbnNcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCh0aGlzLl9hZGRVSUQoXCJHUG1vdXNlUG9zaXRpb25Mb25EaXJlY3Rpb25cIikpLnZhbHVlID0gY29vcmRpbmF0ZS5sbmcuZGlyZWN0aW9uO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxhdERpcmVjdGlvblwiKSkudmFsdWUgPSBjb29yZGluYXRlLmxhdC5kaXJlY3Rpb247XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBlbExhdCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxhdFwiKSk7XG4gICAgICAgICAgICAgICAgdmFyIGVsTG9uID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQodGhpcy5fYWRkVUlEKFwiR1Btb3VzZVBvc2l0aW9uTG9uXCIpKTtcblxuICAgICAgICAgICAgICAgIGVsTGF0LnZhbHVlID0gY29vcmRpbmF0ZS54IHx8IGNvb3JkaW5hdGUubGF0IHx8IGNvb3JkaW5hdGUuZSB8fCBcIjBcIjtcbiAgICAgICAgICAgICAgICBlbEx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G4gICAgICAgIC8vIENvbXB1dGUgY29vcmRzIGluIGNhc2Ugb2YgY3Vyc29yIHBvc2l0aW9uIChkZXNrdG9wKVxuICAgICAgICBpZiAoY29vcmRpbmF0ZSkge1xuICAgICAgICAgICAgLy8gSWYgbm8gYWx0aXR1ZGUgcGFuZWwsIGRvbid0IGNhbGwgYWx0aXR1ZGUgcmVxdWVzdFxuICAgICAgICAgICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkFsdGl0dWRlXCIpKSkge1xuICAgICAgICAgICAgICAgIGFsdGl0dWRlVGltZW91dCA9IHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLm9uUmVxdWVzdEFsdGl0dWRlKGNvb3JkaW5hdGUsIGZ1bmN0aW9uICh6KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWluVGhyZXNob2xkIDwgeiAmJiB6IDwgbWF4VGhyZXNob2xkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5HUHJlc2V0RWxldmF0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNlbGYuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkFsdFwiKSkuaW5uZXJIVE1MID0gejtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgYWx0aXR1ZGVUaW1lb3V0RGVsYXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIEZ1bmN0aW9uIHJlc2V0aW5nIGFsdGl0dWRlIHZhbHVlXG4gICAgICovXG4gICAgR1ByZXNldEVsZXZhdGlvbiA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkFsdGl0dWRlXCIpKSkge1xuICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQodGhpcy5fYWRkVUlEKFwiR1Btb3VzZVBvc2l0aW9uQWx0XCIpKS5pbm5lckhUTUwgPSBcIi0tLVwiO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgTW91c2VQb3NpdGlvbkRPTTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/Controls/MousePositionDOM.js\n"); /***/ }), @@ -1195,7 +1207,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CSS /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n/**\n* @module Utils\n* @alias Gp.olUtils\n* @description\n* ...\n*\n* @example\n* detectSupport();\n* assign();\n* mergeParams();\n*/\nvar Utils = {\n /**\n * this method is called by the constructor.\n * this information is useful to switch to touch mode.\n * Detection : test for desktop or tactile\n *\n * @function detectSupport\n * @returns {Boolean} isDesktop - true for desktop userAgent, false for mobile\n */\n detectSupport: function detectSupport() {\n var isDesktop = true;\n var userAgent = window.navigator.userAgent.toLowerCase();\n if (userAgent.indexOf(\"iphone\") !== -1 || userAgent.indexOf(\"ipod\") !== -1 || userAgent.indexOf(\"ipad\") !== -1 || userAgent.indexOf(\"android\") !== -1 || userAgent.indexOf(\"mobile\") !== -1 || userAgent.indexOf(\"blackberry\") !== -1 || userAgent.indexOf(\"tablet\") !== -1 || userAgent.indexOf(\"phone\") !== -1 || userAgent.indexOf(\"touch\") !== -1) {\n isDesktop = false;\n }\n if (userAgent.indexOf(\"msie\") !== -1 || userAgent.indexOf(\"trident\") !== -1) {\n isDesktop = true;\n }\n return isDesktop;\n },\n /**\n * Copies all source object members to dest\n *\n * @function assign\n * @param {Object} dest - destination object where properties and method will be copied\n * @param {Object} source - source object from which properties and method will be copied\n * @returns {Object} dest\n */\n assign: function assign(dest, source) {\n dest = dest || {};\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n dest[prop] = source[prop];\n }\n }\n return dest;\n },\n /**\n * Merge two objects parameters (deeper than assign)\n *\n * @function mergeParams\n * @param {Object} dest - destination object where properties and method will be merge\n * @param {Object} source - source object from which properties and method will be merge\n * @param {Boolean} replace - replace destination value by source if exists or not (true by default)\n */\n mergeParams: function mergeParams(dest, source, replace) {\n if (!dest || !source) {\n return;\n }\n if (typeof replace === \"undefined\") {\n replace = true;\n }\n for (var param in source) {\n if (source.hasOwnProperty(param)) {\n if (_typeof(source[param]) === \"object\") {\n if (dest.hasOwnProperty(param)) {\n this.mergeParams(dest[param], source[param], replace);\n } else {\n dest[param] = source[param];\n }\n } else {\n if (dest.hasOwnProperty(param)) {\n if (replace) {\n dest[param] = source[param];\n }\n } else {\n dest[param] = source[param];\n }\n }\n }\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Utils);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMuanM/MTM1ZSJdLCJuYW1lcyI6WyJVdGlscyIsImRldGVjdFN1cHBvcnQiLCJpc0Rlc2t0b3AiLCJ1c2VyQWdlbnQiLCJ3aW5kb3ciLCJuYXZpZ2F0b3IiLCJ0b0xvd2VyQ2FzZSIsImluZGV4T2YiLCJhc3N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LmluZGV4T2YoXCJ0YWJsZXRcIikgIT09IC0xIHx8XG4gICAgICAgICAgICB1c2VyQWdlbnQuaW5kZXhPZihcInBob25lXCIpICE9PSAtMSB8fFxuICAgICAgICAgICAgdXNlckFnZW50LmluZGV4T2YoXCJ0b3VjaFwiKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIGlzRGVza3RvcCA9IGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHVzZXJBZ2VudC5pbmRleE9mKFwibXNpZVwiKSAhPT0gLTEgfHxcbiAgICAgICAgICAgIHVzZXJBZ2VudC5pbmRleE9mKFwidHJpZGVudFwiKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIGlzRGVza3RvcCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaXNEZXNrdG9wO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiAgQ29waWVzIGFsbCBzb3VyY2Ugb2JqZWN0IG1lbWJlcnMgdG8gZGVzdFxuICAgICAqXG4gICAgICogQGZ1bmN0aW9uIGFzc2lnblxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBkZXN0IC0gZGVzdGluYXRpb24gb2JqZWN0IHdoZXJlIHByb3BlcnRpZXMgYW5kIG1ldGhvZCB3aWxsIGJlIGNvcGllZFxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBzb3VyY2UgLSBzb3VyY2Ugb2JqZWN0IGZyb20gd2hpY2ggcHJvcGVydGllcyBhbmQgbWV0aG9kIHdpbGwgYmUgY29waWVkXG4gICAgICogQHJldHVybnMge09iamVjdH0gZGVzdFxuICAgICAqL1xuICAgIGFzc2lnbiA6IGZ1bmN0aW9uIChkZXN0LCBzb3VyY2UpIHtcbiAgICAgICAgZGVzdCA9IGRlc3QgfHwge307XG4gICAgICAgIGZvciAodmFyIHByb3AgaW4gc291cmNlKSB7XG4gICAgICAgICAgICBpZiAoc291cmNlLmhhc093blByb3BlcnR5KHByb3ApKSB7XG4gICAgICA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tXSA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGVzdC5oYXNPd25Qcm9wZXJ0eShwYXJhbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubWVyZ2VQYXJhbXMoZGVzdFtwYXJhbV0sIHNvdXJjZVtwYXJhbV0sIHJlcGxhY2UpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtwYXJhbV0gPSBzb3VyY2VbcGFyYW1dO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRlc3QuaGFzT3duUHJvcGVydHkocGFyYW0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVwbGFjZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbcGFyYW1dID0gc291cmNlW3BhcmFtXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbcGFyYW1dID0gc291cmNlW3BhcmFtXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFV0aWxzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Utils.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n* @module Utils\n* @alias Gp.olUtils\n* @description\n* ...\n*\n* @example\n* detectSupport();\n* assign();\n* mergeParams();\n*/\nvar Utils = {\n /**\n * this method is called by the constructor.\n * this information is useful to switch to touch mode.\n * Detection : test for desktop or tactile\n *\n * @function detectSupport\n * @returns {Boolean} isDesktop - true for desktop userAgent, false for mobile\n */\n detectSupport: function detectSupport() {\n var isDesktop = true;\n var userAgent = window.navigator.userAgent.toLowerCase();\n if (userAgent.indexOf(\"iphone\") !== -1 || userAgent.indexOf(\"ipod\") !== -1 || userAgent.indexOf(\"ipad\") !== -1 || userAgent.indexOf(\"android\") !== -1 || userAgent.indexOf(\"mobile\") !== -1 || userAgent.indexOf(\"blackberry\") !== -1 || userAgent.indexOf(\"tablet\") !== -1 || userAgent.indexOf(\"phone\") !== -1 || userAgent.indexOf(\"touch\") !== -1) {\n isDesktop = false;\n }\n if (userAgent.indexOf(\"msie\") !== -1 || userAgent.indexOf(\"trident\") !== -1) {\n isDesktop = true;\n }\n return isDesktop;\n },\n /**\n * Copies all source object members to dest\n *\n * @function assign\n * @param {Object} dest - destination object where properties and method will be copied\n * @param {Object} source - source object from which properties and method will be copied\n * @returns {Object} dest\n */\n assign: function assign(dest, source) {\n dest = dest || {};\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n dest[prop] = source[prop];\n }\n }\n return dest;\n },\n /**\n * Merge two objects parameters (deeper than assign)\n *\n * @function mergeParams\n * @param {Object} dest - destination object where properties and method will be merge\n * @param {Object} source - source object from which properties and method will be merge\n * @param {Boolean} replace - replace destination value by source if exists or not (true by default)\n */\n mergeParams: function mergeParams(dest, source, replace) {\n if (!dest || !source) {\n return;\n }\n if (typeof replace === \"undefined\") {\n replace = true;\n }\n for (var param in source) {\n if (source.hasOwnProperty(param)) {\n if (_typeof(source[param]) === \"object\") {\n if (dest.hasOwnProperty(param)) {\n this.mergeParams(dest[param], source[param], replace);\n } else {\n dest[param] = source[param];\n }\n } else {\n if (dest.hasOwnProperty(param)) {\n if (replace) {\n dest[param] = source[param];\n }\n } else {\n dest[param] = source[param];\n }\n }\n }\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Utils);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMuanM/MTM1ZSJdLCJuYW1lcyI6WyJVdGlscyIsImRldGVjdFN1cHBvcnQiLCJpc0Rlc2t0b3AiLCJ1c2VyQWdlbnQiLCJ3aW5kb3ciLCJuYXZpZ2F0b3IiLCJ0b0xvd2VyQ2FzZSIsImluZGV4T2YiLCJhc3NpZ24iLCJkZXN0Iiwic291cmNlIiwicHJvcCIsImhhc093blByb3BlcnR5IiwibWVyZ2VQYXJhbXMiLCJyZXBsYWNlIiwicGFyYW0iLCJfdHlwZW9mIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJQSxLQUFLLEdBQUc7RUFFUjtBQUNKO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0VBQ0lDLGFBQWEsRUFBRyxTQUFBQSxjQUFBLEVBQVk7SUFDeEIsSUFBSUMsU0FBUyxHQUFHLElBQUk7SUFDcEIsSUFBSUMsU0FBUyxHQUFHQyxNQUFNLENBQUNDLFNBQVMsQ0FBQ0YsU0FBUyxDQUFDRyxXQUFXLENBQUMsQ0FBQztJQUV4RCxJQUFJSCxTQUFTLENBQUNJLE9BQU8sQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUMsSUFDbENKLFNBQVMsQ0FBQ0ksT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxJQUNoQ0osU0FBUyxDQUFDSSxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLElBQ2hDSixTQ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bGFjZSkge1xuICAgICAgICBpZiAoIWRlc3QgfHwgIXNvdXJjZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgcmVwbGFjZSA9PT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgcmVwbGFjZSA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgcGFyYW0gaW4gc291cmNlKSB7XG4gICAgICAgICAgICBpZiAoc291cmNlLmhhc093blByb3BlcnR5KHBhcmFtKSkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc291cmNlW3BhcmFtXSA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGVzdC5oYXNPd25Qcm9wZXJ0eShwYXJhbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubWVyZ2VQYXJhbXMoZGVzdFtwYXJhbV0sIHNvdXJjZVtwYXJhbV0sIHJlcGxhY2UpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtwYXJhbV0gPSBzb3VyY2VbcGFyYW1dO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRlc3QuaGFzT3duUHJvcGVydHkocGFyYW0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVwbGFjZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbcGFyYW1dID0gc291cmNlW3BhcmFtXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbcGFyYW1dID0gc291cmNlW3BhcmFtXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFV0aWxzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Utils.js\n"); /***/ }), @@ -1403,7 +1415,7 @@ eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceM /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Utils/LayerUtils */ \"./src/Common/Utils/LayerUtils.js\");\n/* harmony import */ var _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Common/Controls/AttributionDOM */ \"./src/Common/Controls/AttributionDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"Attributions\");\n\n/**\n * @classdesc\n * Control to manage layers attributions\n *\n * @constructor\n * @alias itowns.control.Attributions\n * @extends {itowns.control.Widget}\n * @param {Object} aOptions - control options\n * @param {Object} [aOptions.options] - Itowns.control.Control options\n * @param {Boolean} [aOptions.options.collapsed = false] - Specify if the control has to be opened or not.\n * @fires attributions:update\n * @example\n * var attribution = new itowns.control.Attritbution({\n * options : {\n * collapsed: true\n * }\n * });\n * // listeners for attributions update :\n * attribution.addEventListener(\"attributions:update\", function (e) {...});\n */\nfunction Attributions(aOptions) {\n aOptions = aOptions || {};\n var options = aOptions.options || {};\n if (!(this instanceof Attributions)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options);\n var container = this._initContainer(options);\n _Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].call(this, {\n name: \"Attributions\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:Attributions\n */\nAttributions.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].prototype, {});\n\n// retrieves methods of the common class AttributionDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].assign(Attributions.prototype, _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nAttributions.prototype.constructor = Attributions;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nAttributions.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var self = this;\n\n // Adding of the listeners\n\n // At every globe movement, attributions may be updated,\n // according to layers on globe, and their visibility.\n this._callbacks.onPreRenderCallBack = function (e) {\n var allLayers = e.colorLayersId.concat(e.elevationLayersId);\n self._inRangeUpdate(allLayers, e.extent);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack);\n globe.preRenderEventFetchViewExtent();\n globe.preRenderEventFetchLayersDisplayed();\n } else {\n // delete listener\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack);\n\n // delete DOM\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nAttributions.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"Attributions:setCollapsed - missing collapsed parameter\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n document.getElementById(this._addUID(\"GPshowAttributionsList\")).checked = !collapsed;\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n *\n * @return {Boolean} collapsed\n */\nAttributions.prototype.getCollapsed = function () {\n return !document.getElementById(this._addUID(\"GPshowAttributionsList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Attributions control (called by constructor)\n *\n * @param {Object} options - Itowns.control.Control options\n * @private\n */\nAttributions.prototype._initialize = function (options) {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._AttributionContainer = null;\n\n // callbacks\n this._callbacks = {};\n\n // options\n this._options = options;\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nAttributions.prototype._initContainer = function (options) {\n var container = this._createMainContainerElement();\n\n // adds in the main container the layer display selector\n var inputShow = this._createMainAttributionsShowElement();\n container.appendChild(inputShow);\n\n // handles the \"collapsed\" mode\n if (!options.collapsed) {\n inputShow.checked = \"checked\";\n }\n // adds the layer list in the main container\n var divA = this._attributionListContainer = this._createMainAttributionsListContainer();\n var ulA = this._createAttributionsList();\n divA.appendChild(ulA);\n container.appendChild(divA);\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement(options.collapsed);\n container.appendChild(picto);\n return container;\n};\n\n/**\n * Checks layers range\n *\n * @method _inRangeUpdate\n * @param {Array} layersDisplayed - Id of the layers diplayed on screen\n * @param {Object} extent - The globe view extent\n * @private\n */\n\nAttributions.prototype._inRangeUpdate = function (layersDisplayed, extent) {\n var globe = this.getGlobe();\n var scaleDenominator = 1 / globe.getScale();\n var attributions = new Map();\n for (var h = 0; h < layersDisplayed.length; h++) {\n var layer = globe.getLayerById(layersDisplayed[h]);\n var ori = layer.source.attribution;\n if (ori) {\n for (var j = 0; j < ori.length; j++) {\n // if the attribution is already added, we skip to not add it several times\n if (attributions.has(ori[j].name)) {\n continue;\n }\n ;\n // if no constraints are associated to the originator, we just add the attribution\n if (!ori[j].constraints || !ori[j].constraints[0]) {\n // adds the attribution in the Map() called 'attributions'\n attributions.set(ori[j].name, ori[j]);\n continue;\n }\n // if the minScaleDenominator exists\n if (ori[j].constraints[0].minScaleDenominator) {\n // if min/maxScaleDenominator are equals, we display the attribution corresponding to the zoom level associated to the scale denominator\n if (ori[j].constraints[0].minScaleDenominator === ori[j].constraints[0].maxScaleDenominator) {\n // retrieves the zoom level\n var attributionZoomLevel = _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getZoomLevelFromScaleDenominator(ori[j].constraints[0].minScaleDenominator);\n // selects the scaledenominators around the corresponding zoom level\n var maxAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel - 1]) / (0.00028 * 2);\n var minAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel + 1]) / (0.00028 * 2);\n if (!(maxAttributionScaleDenominator > scaleDenominator && scaleDenominator > minAttributionScaleDenominator)) {\n continue;\n }\n // either, we check we are located between the minScaleDenominator and the maxScaleDenominator\n } else if (!(ori[j].constraints[0].minScaleDenominator < scaleDenominator && scaleDenominator < ori[j].constraints[0].maxScaleDenominator)) {\n continue;\n }\n }\n // checks if 'bbox\" exists\n if (ori[j].constraints[0].bbox) {\n // checks if we are into the bbox limits\n var intersectsX = ori[j].constraints[0].bbox.left <= extent.east && extent.west <= ori[j].constraints[0].bbox.right;\n var intersectsY = ori[j].constraints[0].bbox.bottom <= extent.north && extent.south <= ori[j].constraints[0].bbox.top;\n if (intersectsX && intersectsY) {\n // adds the attribution in the Map() called 'attributions'\n attributions.set(ori[j].name, ori[j]);\n }\n // if 'bbox' attribute doesn't exist\n } else if (!ori[j].constraints[0].bbox) {\n attributions.set(ori[j].name, ori[j]);\n }\n }\n }\n }\n if (attributions.size) {\n this._updateAttributionListContainer(attributions);\n /**\n * event triggered when the attributions are updated\n *\n * @event attributions:update\n * @type Object\n * @property {Map} attributions - list of attributions\n */\n this.dispatchEvent({\n type: \"attributions:update\",\n attributions: attributions\n });\n }\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Updates the layer list container\n *\n * @method _updateAttributionListContainer\n * @param {Map} attributions - map of attributions\n * @private\n */\nAttributions.prototype._updateAttributionListContainer = function (attributions) {\n var element = document.getElementById(this._addUID(\"GPAttributionsList\"));\n if (document.getElementById(this._addUID(\"GPAttributionsList\"))) {\n document.getElementById(this._addUID(\"GPAttributionsList\")).parentNode.removeChild(element);\n }\n var ul = this._createAttributionsList();\n attributions.forEach(function (a) {\n if (a.name) {\n var li = document.createElement(\"li\");\n var link = document.createElement(\"a\");\n link.href = a.url;\n link.innerHTML = a.name + \" \";\n link.target = \"_blank\";\n li.id = a.name.replace(/\\s/g, \"\");\n li.appendChild(link);\n ul.appendChild(li);\n }\n });\n this._attributionListContainer.appendChild(ul);\n};\nAttributions.prototype._resolutionsWGS84 = {\n 0: 156543.033928041,\n 1: 78271.51696402048,\n 2: 39135.758482010235,\n 3: 19567.87924100512,\n 4: 9783.93962050256,\n 5: 4891.96981025128,\n 6: 2445.98490512564,\n 7: 1222.99245256282,\n 8: 611.49622628141,\n 9: 305.7481131407048,\n 10: 152.8740565703525,\n 11: 76.43702828517624,\n 12: 38.21851414258813,\n 13: 19.10925707129406,\n 14: 9.554628535647032,\n 15: 4.777314267823516,\n 16: 2.388657133911758,\n 17: 1.194328566955879,\n 18: 0.5971642834779395,\n 19: 0.2985821417389697,\n 20: 0.1492910708694849,\n 21: 0.0746455354347424\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Attributions);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQXR0cmlidXRpb25zLmpzP2Q5ZjYiXSwibmFtZXMiOlsibG9nZ2VyIiwiTG9nZ2VyIiwiZ2V0TG9nZ2VyIiwiQXR0cmlidXRpb25zIiwiYU9wdGlvbnMiLCJvcHRpb25zIiwiVHlwZUVycm9yIiwiX3R5cGVvZiIsIkVycm9yIiwiX2luaXRpYWxpemUiLCJjb250YWluZXIiLCJfaW5pdENvbnRhaW5lciIsIldpZGdldCIsImNhbGwiLCJuYW1lIiwiZWxlbWVudCIsInRhcmdldCIsInBvc2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aW1lc1xuICAgICAgICAgICAgICAgIGlmIChhdHRyaWJ1dGlvbnMuaGFzKG9yaVtqXS5uYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vIGlmIG5vIGNvbnN0cmFpbnRzIGFyZSBhc3NvY2lhdGVkIHRvIHRoZSBvcmlnaW5hdG9yLCB3ZSBqdXN0IGFkZCB0aGUgYXR0cmlidXRpb25cbiAgICAgICAgICAgICAgICBpZiAoIW9yaVtqXS5jb25zdHJhaW50cyB8fCAhb3JpW2pdLmNvbnN0cmFpbnRzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGFkZHMgdGhlIGF0dHJpYnV0aW9uIGluIHRoZSBNYXAoKSBjYWxsZWQgJ2F0dHJpYnV0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25zLnNldChvcmlbal0ubmFtZSwgb3JpW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBtaW5TY2FsZURlbm9taW5hdG9yIGV4aXN0c1xuICAgICAgICAgICAgICAgIGlmIChvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvcikge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiBtaW4vbWF4U2NhbGVEZW5vbWluYXRvciBhcmUgZXF1YWxzLCB3ZSBkaXNwbGF5IHRoZSBhdHRyaWJ1dGlvbiBjb3JyZXNwb25kaW5nIHRvIHRoZSB6b29tIGxldmVsIGFzc29jaWF0ZWQgdG8gdGhlIHNjYWxlIGRlbm9taW5hdG9yXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvciA9PT0gb3JpW2pdLmNvbnN0cmFpbnRzWzBdLm1heFNjYWxlRGVub21pbmF0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHJpZXZlcyB0aGUgem9vbSBsZXZlbFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dHJpYnV0aW9uWm9vbUxldmVsID0gTGF5ZXJVdGlscy5nZXRab29tTGV2ZWxGcm9tU2NhbGVEZW5vbWluYXRvcihvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzZWxlY3RzIHRoZSBzY2FsZWRlbm9taW5hdG9ycyBhcm91bmQgdGhlIGNvcnJlc3BvbmRpbmcgem9vbSBsZXZlbFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1heEF0dHJpYnV0aW9uU2NhbGVEZW5vbWluYXRvciA9ICh0aGlzLl9yZXNvbHV0aW9uc1dHUzg0W2F0dHJpYnV0aW9uWm9vbUxldmVsXSArIHRoaXMuX3Jlc29sdXRpb25zV0dTODRbYXR0cmlidXRpb25ab29tTGV2ZWwgLSAxXSkgLyAoMC4wMDAyOCAqIDIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1pbkF0dHJpYnV0aW9uU2NhbGVEZW5vbWluYXRvciA9ICh0aGlzLl9yZXNvbHV0aW9uc1dHUzg0W2F0dHJpYnV0aW9uWm9vbUxldmVsXSArIHRoaXMuX3Jlc29sdXRpb25zV0dTODRbYXR0cmlidXRpb25ab29tTGV2ZWwgKyAxXSkgLyAoMC4wMDAyOCAqIDIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEobWF4QXR0cmlidXRpb25TY2FsZURlbm9taW5hdG9yID4gc2NhbGVEZW5vbWluYXRvciAmJiBzY2FsZURlbm9taW5hdG9yID4gbWluQXR0cmlidXRpb25TY2FsZURlbm9taW5hdG9yKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBlaXRoZXIsIHdlIGNoZWNrIHdlIGFyZSBsb2NhdGVkIGJldHdlZW4gdGhlIG1pblNjYWxlRGVub21pbmF0b3IgYW5kIHRoZSBtYXhTY2FsZURlbm9taW5hdG9yXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIShvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvciA8IHNjYWxlRGVub21pbmF0b3IgJiYgc2NhbGVEZW5vbWluYXRvciA8IG9yaVtqXS5jb25zdHJhaW50c1swXS5tYXhTY2FsZURlbm9taW5hdG9yKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gY2hlY2tzIGlmICdiYm94XCIgZXhpc3RzXG4gICAgICAgICAgICAgICAgaWYgKG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrcyBpZiB3ZSBhcmUgaW50byB0aGUgYmJveCBsaW1pdHNcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVyc2VjdHNYID0gKG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94LmxlZnQgPD0gZXh0ZW50LmVhc3QpICYmIChleHRlbnQud2VzdCA8PSBvcmlbal0uY29uc3RyYWludHNbMF0uYmJveC5yaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcnNlY3RzWSA9IChvcmlbal0uY29uc3RyYWludHNbMF0uYmJveC5ib3R0b20gPD0gZXh0ZW50Lm5vcnRoKSAmJiAoZXh0ZW50LnNvdXRoIDw9IG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94LnRvcCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnRlcnNlY3RzWCAmJiBpbnRlcnNlY3RzWSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWRkcyB0aGUgYXR0cmlidXRpb24gaW4gdGhlIE1hcCgpIGNhbGxlZCAnYXR0cmlidXRpb25zJ1xuICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25zLnNldChvcmlbal0ubmFtZSwgb3JpW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBpZiAnYmJveCcgYXR0cmlidXRlIGRvZXNuJ3QgZXhpc3RcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFvcmlbal0uY29uc3RyYWludHNbMF0uYmJveCkge1xuICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1dGlvbnMuc2V0KG9yaVtqXS5uYW1lLCBvcmlbal0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAoYXR0cmlidXRpb25zLnNpemUpIHtcbiAgICAgICAgdGhpcy5fdXBkYXRlQXR0cmlidXRpb25MaXN0Q29udGFpbmVyKGF0dHJpYnV0aW9ucyk7XG4gICAgICAgIC8qKlxuICAgICAgICAqIGV2ZW50IHRyaWdnZXJlZCB3aGVuIHRoZSBhdHRyaWJ1dGlvbnMgYXJlIHVwZGF0ZWRcbiAgICAgICAgKlxuICAgICAgICAqIEBldmVudCBhdHRyaWJ1dGlvbnM6dXBkYXRlXG4gICAgICAgICogQHR5cGUgT2JqZWN0XG4gICAgICAgICogQHByb3BlcnR5IHtNYXB9IGF0dHJpYnV0aW9ucyAtIGxpc3Qgb2YgYXR0cmlidXRpb25zXG4gICAgICAgICovXG4gICAgICAgIHRoaXMuZGlzcGF0Y2hFdmVudCh7XG4gICAgICAgICAgICB0eXBlIDogXCJhdHRyaWJ1dGlvbnM6dXBkYXRlXCIsXG4gICAgICAgICAgICBhdHRyaWJ1dGlvbnMgOiBhdHRyaWJ1dGlvbnNcbiAgICAgICAgfSk7XG4gICAgfVxufTtcblxuLy8gIyMjIy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c2LjQzNzAyODI4NTE3NjI0LFxuICAgIDEyIDogMzguMjE4NTE0MTQyNTg4MTMsXG4gICAgMTMgOiAxOS4xMDkyNTcwNzEyOTQwNixcbiAgICAxNCA6IDkuNTU0NjI4NTM1NjQ3MDMyLFxuICAgIDE1IDogNC43NzczMTQyNjc4MjM1MTYsXG4gICAgMTYgOiAyLjM4ODY1NzEzMzkxMTc1OCxcbiAgICAxNyA6IDEuMTk0MzI4NTY2OTU1ODc5LFxuICAgIDE4IDogMC41OTcxNjQyODM0Nzc5Mzk1LFxuICAgIDE5IDogMC4yOTg1ODIxNDE3Mzg5Njk3LFxuICAgIDIwIDogMC4xNDkyOTEwNzA4Njk0ODQ5LFxuICAgIDIxIDogMC4wNzQ2NDU1MzU0MzQ3NDI0XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBdHRyaWJ1dGlvbnM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Attributions.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Utils/LayerUtils */ \"./src/Common/Utils/LayerUtils.js\");\n/* harmony import */ var _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Common/Controls/AttributionDOM */ \"./src/Common/Controls/AttributionDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"Attributions\");\n\n/**\n * @classdesc\n * Control to manage layers attributions\n *\n * @constructor\n * @alias itowns.control.Attributions\n * @extends {itowns.control.Widget}\n * @param {Object} aOptions - control options\n * @param {Object} [aOptions.options] - Itowns.control.Control options\n * @param {Boolean} [aOptions.options.collapsed = false] - Specify if the control has to be opened or not.\n * @fires attributions:update\n * @example\n * var attribution = new itowns.control.Attritbution({\n * options : {\n * collapsed: true\n * }\n * });\n * // listeners for attributions update :\n * attribution.addEventListener(\"attributions:update\", function (e) {...});\n */\nfunction Attributions(aOptions) {\n aOptions = aOptions || {};\n var options = aOptions.options || {};\n if (!(this instanceof Attributions)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options);\n var container = this._initContainer(options);\n _Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].call(this, {\n name: \"Attributions\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:Attributions\n */\nAttributions.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].prototype, {});\n\n// retrieves methods of the common class AttributionDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].assign(Attributions.prototype, _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nAttributions.prototype.constructor = Attributions;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nAttributions.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var self = this;\n\n // Adding of the listeners\n\n // At every globe movement, attributions may be updated,\n // according to layers on globe, and their visibility.\n this._callbacks.onPreRenderCallBack = function (e) {\n var allLayers = e.colorLayersId.concat(e.elevationLayersId);\n self._inRangeUpdate(allLayers, e.extent);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack);\n globe.preRenderEventFetchViewExtent();\n globe.preRenderEventFetchLayersDisplayed();\n } else {\n // delete listener\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack);\n\n // delete DOM\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nAttributions.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"Attributions:setCollapsed - missing collapsed parameter\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n document.getElementById(this._addUID(\"GPshowAttributionsList\")).checked = !collapsed;\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n *\n * @return {Boolean} collapsed\n */\nAttributions.prototype.getCollapsed = function () {\n return !document.getElementById(this._addUID(\"GPshowAttributionsList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Attributions control (called by constructor)\n *\n * @param {Object} options - Itowns.control.Control options\n * @private\n */\nAttributions.prototype._initialize = function (options) {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._AttributionContainer = null;\n\n // callbacks\n this._callbacks = {};\n\n // options\n this._options = options;\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nAttributions.prototype._initContainer = function (options) {\n var container = this._createMainContainerElement();\n\n // adds in the main container the layer display selector\n var inputShow = this._createMainAttributionsShowElement();\n container.appendChild(inputShow);\n\n // handles the \"collapsed\" mode\n if (!options.collapsed) {\n inputShow.checked = \"checked\";\n }\n // adds the layer list in the main container\n var divA = this._attributionListContainer = this._createMainAttributionsListContainer();\n var ulA = this._createAttributionsList();\n divA.appendChild(ulA);\n container.appendChild(divA);\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement(options.collapsed);\n container.appendChild(picto);\n return container;\n};\n\n/**\n * Checks layers range\n *\n * @method _inRangeUpdate\n * @param {Array} layersDisplayed - Id of the layers diplayed on screen\n * @param {Object} extent - The globe view extent\n * @private\n */\n\nAttributions.prototype._inRangeUpdate = function (layersDisplayed, extent) {\n var globe = this.getGlobe();\n var scaleDenominator = 1 / globe.getScale();\n var attributions = new Map();\n for (var h = 0; h < layersDisplayed.length; h++) {\n var layer = globe.getLayerById(layersDisplayed[h]);\n var ori = layer.source.attribution;\n if (ori) {\n for (var j = 0; j < ori.length; j++) {\n // if the attribution is already added, we skip to not add it several times\n if (attributions.has(ori[j].name)) {\n continue;\n }\n ;\n // if no constraints are associated to the originator, we just add the attribution\n if (!ori[j].constraints || !ori[j].constraints[0]) {\n // adds the attribution in the Map() called 'attributions'\n attributions.set(ori[j].name, ori[j]);\n continue;\n }\n // if the minScaleDenominator exists\n if (ori[j].constraints[0].minScaleDenominator) {\n // if min/maxScaleDenominator are equals, we display the attribution corresponding to the zoom level associated to the scale denominator\n if (ori[j].constraints[0].minScaleDenominator === ori[j].constraints[0].maxScaleDenominator) {\n // retrieves the zoom level\n var attributionZoomLevel = _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getZoomLevelFromScaleDenominator(ori[j].constraints[0].minScaleDenominator);\n // selects the scaledenominators around the corresponding zoom level\n var maxAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel - 1]) / (0.00028 * 2);\n var minAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel + 1]) / (0.00028 * 2);\n if (!(maxAttributionScaleDenominator > scaleDenominator && scaleDenominator > minAttributionScaleDenominator)) {\n continue;\n }\n // either, we check we are located between the minScaleDenominator and the maxScaleDenominator\n } else if (!(ori[j].constraints[0].minScaleDenominator < scaleDenominator && scaleDenominator < ori[j].constraints[0].maxScaleDenominator)) {\n continue;\n }\n }\n // checks if 'bbox\" exists\n if (ori[j].constraints[0].bbox) {\n // checks if we are into the bbox limits\n var intersectsX = ori[j].constraints[0].bbox.left <= extent.east && extent.west <= ori[j].constraints[0].bbox.right;\n var intersectsY = ori[j].constraints[0].bbox.bottom <= extent.north && extent.south <= ori[j].constraints[0].bbox.top;\n if (intersectsX && intersectsY) {\n // adds the attribution in the Map() called 'attributions'\n attributions.set(ori[j].name, ori[j]);\n }\n // if 'bbox' attribute doesn't exist\n } else if (!ori[j].constraints[0].bbox) {\n attributions.set(ori[j].name, ori[j]);\n }\n }\n }\n }\n if (attributions.size) {\n this._updateAttributionListContainer(attributions);\n /**\n * event triggered when the attributions are updated\n *\n * @event attributions:update\n * @type Object\n * @property {Map} attributions - list of attributions\n */\n this.dispatchEvent({\n type: \"attributions:update\",\n attributions: attributions\n });\n }\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Updates the layer list container\n *\n * @method _updateAttributionListContainer\n * @param {Map} attributions - map of attributions\n * @private\n */\nAttributions.prototype._updateAttributionListContainer = function (attributions) {\n var element = document.getElementById(this._addUID(\"GPAttributionsList\"));\n if (document.getElementById(this._addUID(\"GPAttributionsList\"))) {\n document.getElementById(this._addUID(\"GPAttributionsList\")).parentNode.removeChild(element);\n }\n var ul = this._createAttributionsList();\n attributions.forEach(function (a) {\n if (a.name) {\n var li = document.createElement(\"li\");\n var link = document.createElement(\"a\");\n link.href = a.url;\n link.innerHTML = a.name + \" \";\n link.target = \"_blank\";\n li.id = a.name.replace(/\\s/g, \"\");\n li.appendChild(link);\n ul.appendChild(li);\n }\n });\n this._attributionListContainer.appendChild(ul);\n};\nAttributions.prototype._resolutionsWGS84 = {\n 0: 156543.033928041,\n 1: 78271.51696402048,\n 2: 39135.758482010235,\n 3: 19567.87924100512,\n 4: 9783.93962050256,\n 5: 4891.96981025128,\n 6: 2445.98490512564,\n 7: 1222.99245256282,\n 8: 611.49622628141,\n 9: 305.7481131407048,\n 10: 152.8740565703525,\n 11: 76.43702828517624,\n 12: 38.21851414258813,\n 13: 19.10925707129406,\n 14: 9.554628535647032,\n 15: 4.777314267823516,\n 16: 2.388657133911758,\n 17: 1.194328566955879,\n 18: 0.5971642834779395,\n 19: 0.2985821417389697,\n 20: 0.1492910708694849,\n 21: 0.0746455354347424\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Attributions);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbH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3BsYXllZFtoXSk7XG5cbiAgICAgICAgdmFyIG9yaSA9IGxheWVyLnNvdXJjZS5hdHRyaWJ1dGlvbjtcblxuICAgICAgICBpZiAob3JpKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IG9yaS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBhdHRyaWJ1dGlvbiBpcyBhbHJlYWR5IGFkZGVkLCB3ZSBza2lwIHRvIG5vdCBhZGQgaXQgc2V2ZXJhbCB0aW1lc1xuICAgICAgICAgICAgICAgIGlmIChhdHRyaWJ1dGlvbnMuaGFzKG9yaVtqXS5uYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vIGlmIG5vIGNvbnN0cmFpbnRzIGFyZSBhc3NvY2lhdGVkIHRvIHRoZSBvcmlnaW5hdG9yLCB3ZSBqdXN0IGFkZCB0aGUgYXR0cmlidXRpb25cbiAgICAgICAgICAgICAgICBpZiAoIW9yaVtqXS5jb25zdHJhaW50cyB8fCAhb3JpW2pdLmNvbnN0cmFpbnRzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGFkZHMgdGhlIGF0dHJpYnV0aW9uIGluIHRoZSBNYXAoKSBjYWxsZWQgJ2F0dHJpYnV0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25zLnNldChvcmlbal0ubmFtZSwgb3JpW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBtaW5TY2FsZURlbm9taW5hdG9yIGV4aXN0c1xuICAgICAgICAgICAgICAgIGlmIChvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvcikge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiBtaW4vbWF4U2NhbGVEZW5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b25ab29tTGV2ZWwgKyAxXSkgLyAoMC4wMDAyOCAqIDIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEobWF4QXR0cmlidXRpb25TY2FsZURlbm9taW5hdG9yID4gc2NhbGVEZW5vbWluYXRvciAmJiBzY2FsZURlbm9taW5hdG9yID4gbWluQXR0cmlidXRpb25TY2FsZURlbm9taW5hdG9yKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBlaXRoZXIsIHdlIGNoZWNrIHdlIGFyZSBsb2NhdGVkIGJldHdlZW4gdGhlIG1pblNjYWxlRGVub21pbmF0b3IgYW5kIHRoZSBtYXhTY2FsZURlbm9taW5hdG9yXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIShvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvciA8IHNjYWxlRGVub21pbmF0b3IgJiYgc2NhbGVEZW5vbWluYXRvciA8IG9yaVtqXS5jb25zdHJhaW50c1swXS5tYXhTY2FsZURlbm9taW5hdG9yKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gY2hlY2tzIGlmICdiYm94XCIgZXhpc3RzXG4gICAgICAgICAgICAgICAgaWYgKG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrcyBpZiB3ZSBhcmUgaW50byB0aGUgYmJveCBsaW1pdHNcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVyc2VjdHNYID0gKG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94LmxlZnQgPD0gZXh0ZW50LmVhc3QpICYmIChleHRlbnQud2VzdCA8PSBvcmlbal0uY29uc3RyYWludHNbMF0uYmJveC5yaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcnNlY3RzWSA9IChvcmlbal0uY29uc3RyYWludHNbMF0uYmJveC5ib3R0b20gPD0gZXh0ZW50Lm5vcnRoKSAmJiAoZXh0ZW50LnNvdXRoIDw9IG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94LnRvcCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnRlcnNlY3RzWCAmJiBpbnRlcnNlY3RzWSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWRkcyB0aGUgYXR0cmlidXRpb24gaW4gdGhlIE1hcCgpIGNhbGxlZCAnYXR0cmlidXRpb25zJ1xuICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25zLnNldChvcmlbal0ubmFtZSwgb3JpW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBpZiAnYmJveCcgYXR0cmlidXRlIGRvZXNuJ3QgZXhpc3RcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFvcmlbal0uY29uc3RyYWludHNbMF0uYmJveCkge1xuICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1dGlvbnMuc2V0KG9yaVtqXS5uYW1lLCBvcmlbal0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAoYXR0cmlidXRpb25zLnNpemUpIHtcbiAgICAgICAgdGhpcy5fdXBkYXRlQXR0cmlidXRpb25MaXN0Q29udGFpbmVyKGF0dHJpYnV0aW9ucyk7XG4gICAgICAgIC8qKlxuICAgICAgICAqIGV2ZW50IHRyaWdnZXJlZCB3aGVuIHRoZSBhdHRyaWJ1dGlvbnMgYXJlIHVwZGF0ZWRcbiAgICAgICAgKlxuICAgICAgICAqIEBldmVudCBhdHRyaWJ1dGlvbnM6dXBkYXRlXG4gICAgICAgICogQHR5cGUgT2JqZWN0XG4g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cuODc5MjQxMDA1MTIsXG4gICAgNCA6IDk3ODMuOTM5NjIwNTAyNTYsXG4gICAgNSA6IDQ4OTEuOTY5ODEwMjUxMjgsXG4gICAgNiA6IDI0NDUuOTg0OTA1MTI1NjQsXG4gICAgNyA6IDEyMjIuOTkyNDUyNTYyODIsXG4gICAgOCA6IDYxMS40OTYyMjYyODE0MSxcbiAgICA5IDogMzA1Ljc0ODExMzE0MDcwNDgsXG4gICAgMTAgOiAxNTIuODc0MDU2NTcwMzUyNSxcbiAgICAxMSA6IDc2LjQzNzAyODI4NTE3NjI0LFxuICAgIDEyIDogMzguMjE4NTE0MTQyNTg4MTMsXG4gICAgMTMgOiAxOS4xMDkyNTcwNzEyOTQwNixcbiAgICAxNCA6IDkuNTU0NjI4NTM1NjQ3MDMyLFxuICAgIDE1IDogNC43NzczMTQyNjc4MjM1MTYsXG4gICAgMTYgOiAyLjM4ODY1NzEzMzkxMTc1OCxcbiAgICAxNyA6IDEuMTk0MzI4NTY2OTU1ODc5LFxuICAgIDE4IDogMC41OTcxNjQyODM0Nzc5Mzk1LFxuICAgIDE5IDogMC4yOTg1ODIxNDE3Mzg5Njk3LFxuICAgIDIwIDogMC4xNDkyOTEwNzA4Njk0ODQ5LFxuICAgIDIxIDogMC4wNzQ2NDU1MzU0MzQ3NDI0XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBdHRyaWJ1dGlvbnM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Attributions.js\n"); /***/ }), @@ -1415,7 +1427,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Glo /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/BoostReliefDOM */ \"./src/Common/Controls/BoostReliefDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"BoostRelief\");\n\n/**\n * @classdesc\n * Control to exagerate the elevation\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.BoostRelief\n * @param {Object} brOptions - control options\n * @param {Object} [brOptions.scale] - Defines the scale used to boost the relief\n * @param {Number} [brOptions.scale.min] - Minimum of the scale - 1 by default\n * @param {Number} [brOptions.scale.max] - Maximum of the scale - 50 by default\n * @param {Number} [brOptions.scale.step] - Step of the scale - 1 by default\n * @param {Boolean} [brOptions.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading.\n * @param {Boolean} [brOptions.defaultBoost = 1] - Default boost value applied to the widget and the elevation layers when loaded\n * @example\n * var boostRelief = new itowns.control.BoostRelief({\n * scale : {\n * max : 30,\n * step : 2\n * },\n * defaultBoost : 6\n * })\n */\nfunction BoostRelief(brOptions) {\n brOptions = brOptions || {};\n var options = brOptions.options || {};\n if (!(this instanceof BoostRelief)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer(brOptions);\n var targetDiv = document.getElementById(options.target) || null;\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"BoostRelief\",\n element: container,\n target: targetDiv\n });\n}\n\n/*\n * @lends module:BoostRelief\n */\nBoostRelief.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class BoostReliefDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(BoostRelief.prototype, _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nBoostRelief.prototype.constructor = BoostRelief;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nBoostRelief.prototype.setGlobe = function (globe) {\n // TODO - removing listeners\n // this._globe.removeLayerListener(layers[j], GlobeViewExtended.EVENTS.Relief_PROPERTY_CHANGED, this._callbacks.onReliefLayerCallBack);\n // deletes the layerSwitcher DOM\n if (!globe) {\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nBoostRelief.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"BoostRelief:setCollapsed - missing collapsed parameter\");\n return;\n }\n if (typeof collapsed !== \"boolean\") {\n logger.error(\"BoostRelief:setCollapsed - collapsed parameter is not a boolean\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n var controlDiv = document.getElementById(this._addUID(\"GPBoostReliefListContainer\"));\n if (collapsed) {\n controlDiv.style.display = \"block\";\n document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked = true;\n } else {\n controlDiv.style.display = \"none\";\n document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked = false;\n }\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n * @return {Boolean} is collapsed\n */\nBoostRelief.prototype.getCollapsed = function () {\n return document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize BoostRelief control (called by constructor)\n *\n * @private\n */\nBoostRelief.prototype._initialize = function () {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...)\n this._layers = {};\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} brOptions - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nBoostRelief.prototype._initContainer = function (brOptions) {\n var container = this._createMainContainerElement();\n\n // adds in the main container the layer display selector\n var inputShow = this._createMainBoostReliefShowElement(brOptions.collapsed);\n container.appendChild(inputShow);\n\n // adds the layer list in the main container\n var divA = this._boostReliefListContainer = this._createMainBoostReliefListContainer();\n var boostReliefList = this._createAdvancedToolElement(brOptions);\n divA.appendChild(boostReliefList);\n container.appendChild(divA);\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n if (brOptions.collapsed) {\n divA.style.display = \"block\";\n } else {\n divA.style.display = \"none\";\n }\n return container;\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Changes layer relief on layer relief picto click\n *\n * @method _onChangeLayerRelief\n * @param {Object} e - HTML event\n * @private\n */\n\nBoostRelief.prototype._onChangeLayerRelief = function (e) {\n var reliefValue = parseInt(e.target.value);\n var reliefId = document.getElementById(this._addUID(\"GPreliefValue\"));\n reliefId.innerHTML = \"x\" + reliefValue;\n this._updateLayersRelief(reliefValue);\n};\n\n/**\n * Updates relief values of all elevation layers\n *\n * @method _updateLayerRelief\n * @param {Number} reliefValue - relief value\n * @private\n */\n\nBoostRelief.prototype._updateLayersRelief = function (reliefValue) {\n var globe = this.getGlobe();\n function updateScale(layer, value) {\n layer.scale = value;\n globe.notifyChange(layer);\n }\n // if the scale of a single elevationLayer change, we update the scale of all others\n var elevationLayers = globe.getElevationLayers();\n for (var i = 0; i < elevationLayers.length; i++) {\n updateScale(elevationLayers[i], reliefValue);\n }\n};\n\n/**\n * Updates relief slider and all elevation layers with the given boost value\n *\n * @method changeBoost\n * @param {Number} reliefValue - relief value\n */\n\nBoostRelief.prototype.changeBoost = function (reliefValue) {\n var layerReliefInput = document.getElementById(this._addUID(\"GPreliefValueDiv\"));\n if (!layerReliefInput) {\n logger.error(\"BoostRelief:changeBoost - boostRelief slider not loaded\");\n return;\n }\n\n // the reliefValue given must me in the slider range\n if (reliefValue > layerReliefInput.max) {\n reliefValue = layerReliefInput.max;\n }\n if (reliefValue < layerReliefInput.min) {\n reliefValue = layerReliefInput.min;\n }\n\n // updates the relief of all the elevationlayers\n this._updateLayersRelief(reliefValue);\n\n // updates the slider cursor\n layerReliefInput.value = reliefValue;\n\n // updates the slider text\n var layerReliefSpan = document.getElementById(this._addUID(\"GPreliefValue\"));\n if (layerReliefSpan) {\n layerReliefSpan.innerHTML = \"x\" + reliefValue;\n }\n};\n\n/**\n * Gets layer id from div id\n *\n * @method _resolveLayerId\n * @param {String} divId - HTML div id\n * @returns {String} layer id\n * @private\n */\nBoostRelief.prototype._resolveLayerId = function (divId) {\n var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].name(divId); // ex GPvisibilityPicto_ID_26\n return divName.substring(divName.indexOf(\"_ID_\") + 4); // ex. 26\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (BoostRelief);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQm9vc3RSZWxpZWYuanM/MDhlYyJdLCJuYW1lcyI6WyJsb2dnZXIiLCJMb2dnZXIiLCJnZXRMb2dnZXIiLCJCb29zdFJlbGllZiIsImJyT3B0aW9ucyIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJfdHlwZW9mIiwiRXJyb3IiLCJfaW5pdGlhbGl6ZSIsImNvbnRhaW5lciIsIl9pbml0Q29udGFpbmVyIiwidGFyZ2V0RGl2IiwiZG9jdW1lbnQiLCJnZXRFbGVtZW50QnlJZCIsInRhcmdldCIsIldpZGdldCIsImNhbGwiLCJuYW1lIiwiZWxlbWVudCIsInByb3RvdHlwZSIsIk9iamVjdCIsImNyZWF0ZSIsIlV0aWxzIiwiYXNzaWduIiwiQm9vc3RSZWxpZWZET00iLCJjb25zdHJ1Y3RvciIsInNldEdsb2JlIiwiZ2xvYmUiLCJfZWxlbWVudCIsImhhc0NoaWxkTm9kZXMiLCJyZW1vdmVDaGlsZCIsImxhc3RDaGlsZCIsInBhcmVudE5vZGUiLCJzZXRDb2xsYXBzZWQiLCJjb2xsYXBzZWQiLCJ1bmRlZmluZWQiLCJlcnJvciIsImlzQ29sbGFwc2VkIiwiZ2V0Q29sbGFwc2VkIiwiY29udHJvbERpdiIsIl9hZGRVSUQiLCJzdHlsZSIsImRpc3BsYXkiLCJjaGVja2VkIiwiX3VpZCIsIlNlbGVjdG9ySUQiLCJnZW5lcmF0ZSIsIl9sYXllcnMiLCJfY2FsbGJh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9IG5ldyBpdG93bnMuY29udHJvbC5Cb29zdFJlbGllZih7XG4gKiAgICAgIHNjYWxlIDoge1xuICogICAgICAgICAgbWF4IDogMzAsXG4gKiAgICAgICAgICBzdGVwIDogMlxuICogICAgICB9LFxuICogICAgICBkZWZhdWx0Qm9vc3QgOiA2XG4gKiB9KVxuICovXG5mdW5jdGlvbiBCb29zdFJlbGllZiAoYnJPcHRpb25zKSB7XG4gICAgYnJPcHRpb25zID0gYnJPcHRpb25zIHx8IHt9O1xuICAgIHZhciBvcHRpb25zID0gYnJPcHRpb25zLm9wdGlvbnMgfHwge307XG5cbiAgICBpZiAoISh0aGlzIGluc3RhbmNlb2YgQm9vc3RSZWxpZWYpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJFUlJPUiBDTEFTU19DT05TVFJVQ1RPUlwiKTtcbiAgICB9XG5cbiAgICBpZiAodHlwZW9mIG9wdGlvbnMgIT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1IgV1JPTkdfVFlQRSA6IG9wdGlvbnMgc2hvdWxkIGJlIGFuIG9iamVjdFwiKTtcbiAgICB9XG5cbiAgICB0aGlzLl9pbml0aWFsaXplKCk7XG5cbiAgICB2YXIgY29udGFpbmVyID0gdGhpcy5faW5pdENvbnRhaW5lcihick9wdGlvbnMpO1xuICAgIHZhciB0YXJnZXREaXYgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChvcHRpb25zLnRhcmdldCkgfHwgbnVsbDtcblxuICAgIFdpZGdldC5jYWxsKFxuICAgICAgICB0aGlzLCB7XG4gICAgICAgICAgICBuYW1lIDogXCJCb29zdFJlbGllZlwiLFxuICAgICAgICAgICAgZWxlbWVudCA6IGNvbnRhaW5lcixcbiAgICAgICAgICAgIHRhcmdldCA6IHRhcmdldERpdlxuICAgICAgICB9XG4gICAgKTtcbn1cblxuLypcbiAqIEBsZW5kcyBtb2R1bGU6Qm9vc3RSZWxpZ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GVzIHRoZSBzbGlkZXIgY3Vyc29yXG4gICAgbGF5ZXJSZWxpZWZJbnB1dC52YWx1ZSA9IHJlbGllZlZhbHVlO1xuXG4gICAgLy8gdXBkYXRlcyB0aGUgc2xpZGVyIHRleHRcbiAgICB2YXIgbGF5ZXJSZWxpZWZTcGFuID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQodGhpcy5fYWRkVUlEKFwiR1ByZWxpZWZWYWx1ZVwiKSk7XG4gICAgaWYgKGxheWVyUmVsaWVmU3Bhbikge1xuICAgICAgICBsYXllclJlbGllZlNwYW4uaW5uZXJIVE1MID0gXCJ4XCIgKyByZWxpZWZWYWx1ZTtcbiAgICB9XG59O1xuXG4vKipcbiAqIEdldHMgbGF5ZXIgaWQgZnJvbSBkaXYgaWRcbiAqXG4gKiBAbWV0aG9kIF9yZXNvbHZlTGF5ZXJJZFxuICogQHBhcmFtIHtTdHJpbmd9IGRpdklkIC0gSFRNTCBkaXYgaWRcbiAqIEByZXR1cm5zIHtTdHJpbmd9IGxheWVyIGlkXG4gKiBAcHJpdmF0ZVxuICovXG5Cb29zdFJlbGllZi5wcm90b3R5cGUuX3Jlc29sdmVMYXllcklkID0gZnVuY3Rpb24gKGRpdklkKSB7XG4gICAgdmFyIGRpdk5hbWUgPSBTZWxlY3RvcklELm5hbWUoZGl2SWQpOyAvLyBleCBHUHZpc2liaWxpdHlQaWN0b19JRF8yNlxuICAgIHJldHVybiBkaXZOYW1lLnN1YnN0cmluZyhkaXZOYW1lLmluZGV4T2YoXCJfSURfXCIpICsgNCk7IC8vIGV4LiAyNlxufTtcblxuZXhwb3J0IGRlZmF1bHQgQm9vc3RSZWxpZWY7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/BoostRelief.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/BoostReliefDOM */ \"./src/Common/Controls/BoostReliefDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"BoostRelief\");\n\n/**\n * @classdesc\n * Control to exagerate the elevation\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.BoostRelief\n * @param {Object} brOptions - control options\n * @param {Object} [brOptions.scale] - Defines the scale used to boost the relief\n * @param {Number} [brOptions.scale.min] - Minimum of the scale - 1 by default\n * @param {Number} [brOptions.scale.max] - Maximum of the scale - 50 by default\n * @param {Number} [brOptions.scale.step] - Step of the scale - 1 by default\n * @param {Boolean} [brOptions.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading.\n * @param {Boolean} [brOptions.defaultBoost = 1] - Default boost value applied to the widget and the elevation layers when loaded\n * @example\n * var boostRelief = new itowns.control.BoostRelief({\n * scale : {\n * max : 30,\n * step : 2\n * },\n * defaultBoost : 6\n * })\n */\nfunction BoostRelief(brOptions) {\n brOptions = brOptions || {};\n var options = brOptions.options || {};\n if (!(this instanceof BoostRelief)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer(brOptions);\n var targetDiv = document.getElementById(options.target) || null;\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"BoostRelief\",\n element: container,\n target: targetDiv\n });\n}\n\n/*\n * @lends module:BoostRelief\n */\nBoostRelief.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class BoostReliefDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(BoostRelief.prototype, _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nBoostRelief.prototype.constructor = BoostRelief;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nBoostRelief.prototype.setGlobe = function (globe) {\n // TODO - removing listeners\n // this._globe.removeLayerListener(layers[j], GlobeViewExtended.EVENTS.Relief_PROPERTY_CHANGED, this._callbacks.onReliefLayerCallBack);\n // deletes the layerSwitcher DOM\n if (!globe) {\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nBoostRelief.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"BoostRelief:setCollapsed - missing collapsed parameter\");\n return;\n }\n if (typeof collapsed !== \"boolean\") {\n logger.error(\"BoostRelief:setCollapsed - collapsed parameter is not a boolean\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n var controlDiv = document.getElementById(this._addUID(\"GPBoostReliefListContainer\"));\n if (collapsed) {\n controlDiv.style.display = \"block\";\n document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked = true;\n } else {\n controlDiv.style.display = \"none\";\n document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked = false;\n }\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n * @return {Boolean} is collapsed\n */\nBoostRelief.prototype.getCollapsed = function () {\n return document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize BoostRelief control (called by constructor)\n *\n * @private\n */\nBoostRelief.prototype._initialize = function () {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...)\n this._layers = {};\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} brOptions - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nBoostRelief.prototype._initContainer = function (brOptions) {\n var container = this._createMainContainerElement();\n\n // adds in the main container the layer display selector\n var inputShow = this._createMainBoostReliefShowElement(brOptions.collapsed);\n container.appendChild(inputShow);\n\n // adds the layer list in the main container\n var divA = this._boostReliefListContainer = this._createMainBoostReliefListContainer();\n var boostReliefList = this._createAdvancedToolElement(brOptions);\n divA.appendChild(boostReliefList);\n container.appendChild(divA);\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n if (brOptions.collapsed) {\n divA.style.display = \"block\";\n } else {\n divA.style.display = \"none\";\n }\n return container;\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Changes layer relief on layer relief picto click\n *\n * @method _onChangeLayerRelief\n * @param {Object} e - HTML event\n * @private\n */\n\nBoostRelief.prototype._onChangeLayerRelief = function (e) {\n var reliefValue = parseInt(e.target.value);\n var reliefId = document.getElementById(this._addUID(\"GPreliefValue\"));\n reliefId.innerHTML = \"x\" + reliefValue;\n this._updateLayersRelief(reliefValue);\n};\n\n/**\n * Updates relief values of all elevation layers\n *\n * @method _updateLayerRelief\n * @param {Number} reliefValue - relief value\n * @private\n */\n\nBoostRelief.prototype._updateLayersRelief = function (reliefValue) {\n var globe = this.getGlobe();\n function updateScale(layer, value) {\n layer.scale = value;\n globe.notifyChange(layer);\n }\n // if the scale of a single elevationLayer change, we update the scale of all others\n var elevationLayers = globe.getElevationLayers();\n for (var i = 0; i < elevationLayers.length; i++) {\n updateScale(elevationLayers[i], reliefValue);\n }\n};\n\n/**\n * Updates relief slider and all elevation layers with the given boost value\n *\n * @method changeBoost\n * @param {Number} reliefValue - relief value\n */\n\nBoostRelief.prototype.changeBoost = function (reliefValue) {\n var layerReliefInput = document.getElementById(this._addUID(\"GPreliefValueDiv\"));\n if (!layerReliefInput) {\n logger.error(\"BoostRelief:changeBoost - boostRelief slider not loaded\");\n return;\n }\n\n // the reliefValue given must me in the slider range\n if (reliefValue > layerReliefInput.max) {\n reliefValue = layerReliefInput.max;\n }\n if (reliefValue < layerReliefInput.min) {\n reliefValue = layerReliefInput.min;\n }\n\n // updates the relief of all the elevationlayers\n this._updateLayersRelief(reliefValue);\n\n // updates the slider cursor\n layerReliefInput.value = reliefValue;\n\n // updates the slider text\n var layerReliefSpan = document.getElementById(this._addUID(\"GPreliefValue\"));\n if (layerReliefSpan) {\n layerReliefSpan.innerHTML = \"x\" + reliefValue;\n }\n};\n\n/**\n * Gets layer id from div id\n *\n * @method _resolveLayerId\n * @param {String} divId - HTML div id\n * @returns {String} layer id\n * @private\n */\nBoostRelief.prototype._resolveLayerId = function (divId) {\n var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].name(divId); // ex GPvisibilityPicto_ID_26\n return divName.substring(divName.indexOf(\"_ID_\") + 4); // ex. 26\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (BoostRelief);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQm9vc3RSZWxpZWYuanM/MDhlYyJdLCJuYW1lcyI6WyJsb2dnZXIiLCJMb2dnZXIiLCJnZXRMb2dnZXIiLCJCb29zdFJlbGllZiIsImJyT3B0aW9ucyIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJfdHlwZW9mIiwiRXJyb3IiLCJfaW5pdGlhbGl6ZSIsImNvbnRhaW5lciIsIl9pbml0Q29udGFpbmVyIiwidGFyZ2V0RGl2IiwiZG9jdW1lbnQiLCJnZXRFbGVtZW50QnlJZCIsInRhcmdldCIsIldpZGdldCIsImNhbGwiLCJuYW1lIiwiZWxlbWVudCIsInByb3RvdHlwZSIsIk9iamVjdCIsImNyZWF0ZSIsIlV0aWxzIiwiYXNzaWduIiwiQm9vc3RSZWxpZWZET00iLCJjb25zdHJ1Y3RvciIsInNldEdsb2JlIiwiZ2xvYmUiLCJfZWxlbWVudCIsImhhc0NoaWxkTm9kZXMiLCJyZW1vdmVDaGlsZCIsImxhc3RDaGlsZCIsInBhcmVudE5vZGUiLCJzZXRDb2xsYXBzZWQiLCJjb2xsYXBzZWQiLCJ1bmRlZmluZWQiLCJlcnJvciIsImlzQ29sbGFwc2VkIiwiZ2V0Q29sbGFwc2VkIiwiY29udHJvbERpdiIsIl9hZGRVSUQiLCJzdHlsZSIsImRpc3BsYXkiLCJjaGVja2VkIiwiX3VpZCIsIlNlbGVjdG9ySUQ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ZFxuICogQGV4YW1wbGVcbiAqIHZhciBib29zdFJlbGllZiA9IG5ldyBpdG93bnMuY29udHJvbC5Cb29zdFJlbGllZih7XG4gKiAgICAgIHNjYWxlIDoge1xuICogICAgICAgICAgbWF4IDogMzAsXG4gKiAgICAgICAgICBzdGVwIDogMlxuICogICAgICB9LFxuICogICAgICBkZWZhdWx0Qm9vc3QgOiA2XG4gKiB9KVxuICovXG5mdW5jdGlvbiBCb29zdFJlbGllZiAoYnJPcHRpb25zKSB7XG4gICAgYnJPcHRpb25zID0gYnJPcHRpb25zIHx8IHt9O1xuICAgIHZhciBvcHRpb25zID0gYnJPcHRpb25zLm9wdGlvbnMgfHwge307XG5cbiAgICBpZiAoISh0aGlzIGluc3RhbmNlb2YgQm9vc3RSZWxpZWYpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJFUlJPUiBDTEFTU19DT05TVFJVQ1RPUlwiKTtcbiAgICB9XG5cbiAgICBpZiAodHlwZW9mIG9wdGlvbnMgIT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1IgV1JPTkdfVFlQRSA6IG9wdGlvbnMgc2hvdWxkIGJlIGFuIG9iamVjdFwiKTtcbiAgICB9XG5cbiAgICB0aGlzLl9pbml0aWFsaXplKCk7XG5cbiAgICB2YXIgY29udGFpbmVyID0gdGhpcy5faW5pdENvbnRhaW5lcihick9wdGlvbnMpO1xuICAgIHZhciB0YXJnZXREaXYgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChvcHRpb25zLnRhcmdldCkgfHwgbnVsbDtcblxuICAgIFdpZGdldC5jYWxsKFxuICAgICAgICB0aGlzLCB7XG4gICAgICAgICAgICBuYW1lIDogXCJCb29zdFJlbGllZlwiLFxuICAgICAgICAgICAgZWxlbWVudCA6IGNvbnRhaW5lcixcbiAgICAgICAgICAgIHRhcmdldCA6IHRhcmdldERpdlxuICAgICAgICB9XG4gICAgKTtcbn1cblxu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llZihyZWxpZWZWYWx1ZSk7XG5cbiAgICAvLyB1cGRhdGVzIHRoZSBzbGlkZXIgY3Vyc29yXG4gICAgbGF5ZXJSZWxpZWZJbnB1dC52YWx1ZSA9IHJlbGllZlZhbHVlO1xuXG4gICAgLy8gdXBkYXRlcyB0aGUgc2xpZGVyIHRleHRcbiAgICB2YXIgbGF5ZXJSZWxpZWZTcGFuID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQodGhpcy5fYWRkVUlEKFwiR1ByZWxpZWZWYWx1ZVwiKSk7XG4gICAgaWYgKGxheWVyUmVsaWVmU3Bhbikge1xuICAgICAgICBsYXllclJlbGllZlNwYW4uaW5uZXJIVE1MID0gXCJ4XCIgKyByZWxpZWZWYWx1ZTtcbiAgICB9XG59O1xuXG4vKipcbiAqIEdldHMgbGF5ZXIgaWQgZnJvbSBkaXYgaWRcbiAqXG4gKiBAbWV0aG9kIF9yZXNvbHZlTGF5ZXJJZFxuICogQHBhcmFtIHtTdHJpbmd9IGRpdklkIC0gSFRNTCBkaXYgaWRcbiAqIEByZXR1cm5zIHtTdHJpbmd9IGxheWVyIGlkXG4gKiBAcHJpdmF0ZVxuICovXG5Cb29zdFJlbGllZi5wcm90b3R5cGUuX3Jlc29sdmVMYXllcklkID0gZnVuY3Rpb24gKGRpdklkKSB7XG4gICAgdmFyIGRpdk5hbWUgPSBTZWxlY3RvcklELm5hbWUoZGl2SWQpOyAvLyBleCBHUHZpc2liaWxpdHlQaWN0b19JRF8yNlxuICAgIHJldHVybiBkaXZOYW1lLnN1YnN0cmluZyhkaXZOYW1lLmluZGV4T2YoXCJfSURfXCIpICsgNCk7IC8vIGV4LiAyNlxufTtcblxuZXhwb3J0IGRlZmF1bHQgQm9vc3RSZWxpZWY7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/BoostRelief.js\n"); /***/ }), @@ -1427,7 +1439,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Com /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Controls/BuildingsDOM */ \"./src/Common/Controls/BuildingsDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_4__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display buildings on the map\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.Buildings\n * @param {Object} buildingsOptions - control options\n * @param {String} [buildingsOptions.key = \"essentiels\"] - key to use to adds the buildings layer – “essentiels” by default\n * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT\n * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground\n * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation\n * @param {Integer} [buildingsOptions.minZoom = 15] - minimum level of zoom the buildings are displayed. 15 by default. Lower is the value, lower are the performances.\n * @example\n * var buildings = new itowns.control.Buildings ({\n * MNT : false,\n * buildingsOnGround : false,\n * target : “controlDiv”\n * })\n */\nfunction Buildings(buildingsOptions) {\n var options = buildingsOptions || {};\n if (!(this instanceof Buildings)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n options = this.setOptions(options);\n this._initialize(options);\n var container = this._initContainer(options);\n var targetDiv = document.getElementById(options.target) || null;\n _Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].call(this, {\n name: \"Buildings\",\n element: container,\n target: targetDiv\n });\n}\n\n/*\n * @lends module:Buildings\n */\nBuildings.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {});\n\n// retrieves methods of the common class BuildingsDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assign(Buildings.prototype, _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nBuildings.prototype.constructor = Buildings;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nBuildings.prototype.setGlobe = function (globe) {\n if (!globe) {\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Buildings control (called by constructor)\n *\n * @param {Object} options - control options\n *\n * @private\n */\nBuildings.prototype._initialize = function (options) {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...)\n this._options = options;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nBuildings.prototype._initContainer = function (options) {\n var container = this._createMainContainerElement();\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n return container;\n};\n\n/**\n * Adds the default french ELEVATION.ELEVATIONGRIDCOVERAGE MNT to the globe\n *\n * @method addMNT\n * @param {Object} globe - globeView\n * @private\n */\nBuildings.prototype.addMNT = function (globe) {\n var mntLayer = {\n type: \"elevation\",\n id: \"IGN_MNT_HIGHRES\",\n noDataValue: -99999,\n source: {\n protocol: \"wmts\",\n url: \"https://wxs.ign.fr/altimetrie/geoportail/wmts\",\n name: \"ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES\",\n attribution: [{\n name: \"IGN\",\n attribution: \"IGN Grandes Echelles\",\n url: \"http://www.ign.fr\",\n constraints: [{\n crs: \"EPSG:4326\"\n }]\n }],\n updateStrategy: {\n type: 1,\n options: {\n groups: [3, 7, 11, 14]\n }\n },\n networkOptions: {\n crossOrigin: \"omit\"\n },\n format: \"image/x-bil;bits=32\",\n crs: \"EPSG:4326\",\n tileMatrixSet: \"WGS84G\",\n tileMatrixSetLimits: {\n 6: {\n minTileRow: 13,\n maxTileRow: 36,\n minTileCol: 62,\n maxTileCol: 80\n },\n 7: {\n minTileRow: 27,\n maxTileRow: 73,\n minTileCol: 124,\n maxTileCol: 160\n },\n 8: {\n minTileRow: 55,\n maxTileRow: 146,\n minTileCol: 248,\n maxTileCol: 320\n },\n 9: {\n minTileRow: 110,\n maxTileRow: 292,\n minTileCol: 497,\n maxTileCol: 640\n },\n 10: {\n minTileRow: 221,\n maxTileRow: 585,\n minTileCol: 994,\n maxTileCol: 1281\n },\n 11: {\n minTileRow: 442,\n maxTileRow: 1171,\n minTileCol: 1989,\n maxTileCol: 2563\n },\n 12: {\n minTileRow: 885,\n maxTileRow: 2343,\n minTileCol: 3978,\n maxTileCol: 5126\n },\n 13: {\n minTileRow: 1770,\n maxTileRow: 4687,\n minTileCol: 7957,\n maxTileCol: 10253\n },\n 14: {\n minTileRow: 3540,\n maxTileRow: 9375,\n minTileCol: 15914,\n maxTileCol: 20507\n }\n }\n }\n };\n function createWMTSSourceFromConfig(config) {\n config.source = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"WMTSSource\"](config.source);\n return config;\n }\n ;\n function addElevationLayerFromConfig(config, globe) {\n var layer = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"ElevationLayer\"](config.id, config);\n globe.addLayer(layer);\n }\n ;\n var mntConfig = createWMTSSourceFromConfig(mntLayer);\n addElevationLayerFromConfig(mntConfig, globe);\n};\n\n/**\n * Adds or removes the buildings layer on click\n *\n * @method addBuildings\n * @param {options} options for the buildings control\n */\nBuildings.prototype.addBuildings = function (options) {\n var vectorStyle = \"https://wxs.ign.fr/\" + options.apiKey + \"/static/vectorTiles/styles/PLAN.IGN/standard.json\";\n var layerId = \"VTBuilding\";\n // ---------- DISPLAY VECTOR TILED BUILDING DATA AS 3D MESHES : ----------\n // Define the source of the building data : those are vector tiled data from the geoportail.\n var buildingsSource = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"VectorTilesSource\"]({\n style: vectorStyle,\n // We only want to display buildings related data.\n // We remove some buildings without alti_sol property (it causes graphical)\n filter: function filter(layer) {\n return layer[\"source-layer\"].includes(\"bati_surf\") && !layer[\"filter\"].includes(\"CIMETIERE_SURF\") && !layer[\"filter\"].includes(\"FOOT_SURF\") && !layer[\"filter\"].includes(\"TENNIS_SURF\") && !layer[\"filter\"].includes(\"MULTI_SPORT_SURF\") && layer.paint[\"fill-color\"];\n }\n });\n\n // Defines if the buildings must be displayed on the MNT or at the zero level\n var baseAltitude;\n var extrusionHeight;\n // To extend the extrusion on the ground when altitude is not accurate, we add a delta parameter\n var delta = 10;\n if (options.buildingsOnGround) {\n baseAltitude = 0;\n extrusionHeight = function extrusionHeight(p) {\n return p.hauteur || 0;\n };\n } else {\n baseAltitude = function baseAltitude(p) {\n return p.alti_sol - delta || 0;\n };\n extrusionHeight = function extrusionHeight(p) {\n return p.hauteur + delta || 0;\n };\n }\n\n // Create a FeatureGeometryLayer to support building data.\n var buildingsLayer = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"FeatureGeometryLayer\"](layerId, {\n source: buildingsSource,\n zoom: {\n min: options.minZoom\n },\n accurate: false,\n style: new itowns__WEBPACK_IMPORTED_MODULE_4__[\"Style\"]({\n fill: {\n base_altitude: baseAltitude,\n extrusion_height: extrusionHeight\n }\n })\n });\n this.getGlobe().addLayer(buildingsLayer);\n\n // initial settings for buildings visibility and button\n this.getGlobe().setLayerVisibility(layerId, options.defaultVisibility);\n if (options.defaultVisibility === true) {\n this._toggleBuildingsButton(this.getElement(), \"off\");\n } else {\n this._toggleBuildingsButton(this.getElement(), \"on\");\n }\n};\n\n/**\n * Set the buildings visibility on click\n *\n * @method setBuildingsVisibility\n * @param {Tring} layerId - layer id for the building layer\n */\nBuildings.prototype.setBuildingsVisibility = function (layerId) {\n if (this.getGlobe().getFeatureGeometryLayers()[0].visible === true) {\n this.getGlobe().setLayerVisibility(layerId, false);\n this._toggleBuildingsButton(this.getElement(), \"on\");\n } else {\n this.getGlobe().setLayerVisibility(layerId, true);\n this._toggleBuildingsButton(this.getElement(), \"off\");\n }\n};\n\n/**\n * Set the button picture on click\n *\n * @method _toggleBuildingsButton\n * @param {DOM} element - DOM element of the buildings Widget\n * @param {String} mode - \"on\" or \"off\" to display the deactivated or activated buildings image\n *\n * @private\n */\nBuildings.prototype._toggleBuildingsButton = function (element, mode) {\n if (mode === \"on\") {\n element.lastChild.classList.remove(\"buildingsOff\");\n element.lastChild.classList.add(\"buildingsOn\");\n } else {\n element.lastChild.classList.remove(\"buildingsOn\");\n element.lastChild.classList.add(\"buildingsOff\");\n }\n};\n\n/**\n * onWidgetAdded : function called when globeVewExtended.addwidget is called\n *\n * @method onWidgetAdded\n * @param {Object} widget - buildings widget\n *\n * @private\n */\nBuildings.prototype.onWidgetAdded = function (widget) {\n var widgetOptions = widget.getOptions();\n if (widgetOptions.MNT !== false) {\n this.addMNT(widget.getGlobe());\n }\n this.addBuildings(widgetOptions);\n this.addListener(this.getElement());\n};\n\n/**\n * addListener : adds the clic listener to handle buildings visibility on the given element\n *\n * @param {DOM} element - DOM element where the listener has to be added\n *\n * @private\n */\nBuildings.prototype.addListener = function (element) {\n element.onclick = function () {\n this.setBuildingsVisibility(\"VTBuilding\");\n }.bind(this);\n};\n\n/**\n * setOptions : set the options of the widget\n *\n * @param {Object} options - options to set\n * @returns {Object} buildingOptions - widget options\n * @private\n */\nBuildings.prototype.setOptions = function (options) {\n var buildingsOptions = {};\n buildingsOptions.apiKey = options.key || \"essentiels\";\n buildingsOptions.MNT = options.MNT !== false;\n buildingsOptions.buildingsOnGround = options.buildingsOnGround || false;\n buildingsOptions.defaultVisibility = options.defaultVisibility !== false;\n buildingsOptions.minZoom = options.minZoom || 15;\n // common widget options\n buildingsOptions.target = options.target;\n buildingsOptions.name = options.name;\n buildingsOptions.element = options.element;\n buildingsOptions.position = options.position;\n return buildingsOptions;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Buildings);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQnVpbGRpbmdzLmpzPzhmYWQiXSwibmFtZXMiOlsiQnVpbGRpbmdzIiwiYnVpbGRpbmdzT3B0aW9ucyIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJfdHlwZW9mIiwiRXJyb3IiLCJzZXRPcHRpb25zIiwi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BcImh0dHBzOi8vd3hzLmlnbi5mci9hbHRpbWV0cmllL2dlb3BvcnRhaWwvd210c1wiLFxuICAgICAgICAgICAgbmFtZSA6IFwiRUxFVkFUSU9OLkVMRVZBVElPTkdSSURDT1ZFUkFHRS5ISUdIUkVTXCIsXG4gICAgICAgICAgICBhdHRyaWJ1dGlvbiA6IFt7XG4gICAgICAgICAgICAgICAgbmFtZSA6IFwiSUdOXCIsXG4gICAgICAgICAgICAgICAgYXR0cmlidXRpb24gOiBcIklHTiBHcmFuZGVzIEVjaGVsbGVzXCIsXG4gICAgICAgICAgICAgICAgdXJsIDogXCJodHRwOi8vd3d3Lmlnbi5mclwiLFxuICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzIDogW3tcbiAgICAgICAgICAgICAgICAgICAgY3JzIDogXCJFUFNHOjQzMjZcIlxuICAgICAgICAgICAgICAgIH1dXG4gICAgICAgICAgICB9XSxcbiAgICAgICAgICAgIHVwZGF0ZVN0cmF0ZWd5IDoge1xuICAgICAgICAgICAgICAgIHR5cGUgOiAxLFxuICAgICAgICAgICAgICAgIG9wdGlvbnMgOiB7XG4gICAgICAgICAgICAgICAgICAgIGdyb3VwcyA6IFszLCA3LCAxMSwgMTRdXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5ldHdvcmtPcHRpb25zIDoge1xuICAgICAgICAgICAgICAgIGNyb3NzT3JpZ2luIDogXCJvbWl0XCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmb3JtYXQgOiBcImltYWdlL3gtYmlsO2JpdHM9MzJcIixcbiAgICAgICAgICAgIGNycyA6IFwiRVBTRzo0MzI2XCIsXG4gICAgICAgICAgICB0aWxlTWF0cml4U2V0IDogXCJXR1M4NEdcIixcbiAgICAgICAgICAgIHRpbGVNYXRyaXhTZXRMaW1pdHMgOiB7XG4gICAgICAgICAgICAgICAgNiA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDEzLFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogMzYsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiA2MixcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDgwXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICA3IDoge1xuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlUm93IDogMjcsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVSb3cgOiA3MyxcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDEyNCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDE2MFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgOCA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDU1LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogMTQ2LFxuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlQ29sIDogMjQ4LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogMzIwXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICA5IDoge1xuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlUm93IDogMTEwLFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogMjkyLFxuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlQ29sIDogNDk3LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogNjQwXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAxMCA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDIyMSxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDU4NSxcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDk5NCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDEyODFcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIDExIDoge1xuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlUm93IDogNDQyLFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogMTE3MSxcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDE5ODksXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiAyNTYzXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAxMiA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDg4NSxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDIzNDMsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiAzOTc4LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogNTEyNlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgMTMgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiAxNzcwLFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogNDY4NyxcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDc5NTcsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiAxMDI1M1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgMTQgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiAzNTQwLFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogOTM3NSxcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDE1OTE0LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogMjA1MDdcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gY3JlYXRlV01UU1NvdXJjZUZ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b25zLmVsZW1lbnQgPSBvcHRpb25zLmVsZW1lbnQ7XG4gICAgYnVpbGRpbmdzT3B0aW9ucy5wb3NpdGlvbiA9IG9wdGlvbnMucG9zaXRpb247XG5cbiAgICByZXR1cm4gYnVpbGRpbmdzT3B0aW9ucztcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEJ1aWxkaW5ncztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Buildings.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Controls/BuildingsDOM */ \"./src/Common/Controls/BuildingsDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_4__);\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display buildings on the map\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.Buildings\n * @param {Object} buildingsOptions - control options\n * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT\n * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground\n * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation\n * @param {Integer} [buildingsOptions.minZoom = 15] - minimum level of zoom the buildings are displayed. 15 by default. Lower is the value, lower are the performances.\n * @example\n * var buildings = new itowns.control.Buildings ({\n * MNT : false,\n * buildingsOnGround : false,\n * target : “controlDiv”\n * })\n */\nfunction Buildings(buildingsOptions) {\n var options = buildingsOptions || {};\n if (!(this instanceof Buildings)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n options = this.setOptions(options);\n this._initialize(options);\n var container = this._initContainer(options);\n var targetDiv = document.getElementById(options.target) || null;\n _Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].call(this, {\n name: \"Buildings\",\n element: container,\n target: targetDiv\n });\n}\n\n/*\n * @lends module:Buildings\n */\nBuildings.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {});\n\n// retrieves methods of the common class BuildingsDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assign(Buildings.prototype, _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nBuildings.prototype.constructor = Buildings;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nBuildings.prototype.setGlobe = function (globe) {\n if (!globe) {\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Buildings control (called by constructor)\n *\n * @param {Object} options - control options\n *\n * @private\n */\nBuildings.prototype._initialize = function (options) {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...)\n this._options = options;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nBuildings.prototype._initContainer = function (options) {\n var container = this._createMainContainerElement();\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n return container;\n};\n\n/**\n * Adds the default french ELEVATION.ELEVATIONGRIDCOVERAGE MNT to the globe\n *\n * @method addMNT\n * @param {Object} globe - globeView\n * @private\n */\nBuildings.prototype.addMNT = function (globe) {\n var mntLayer = {\n type: \"elevation\",\n id: \"IGN_MNT_HIGHRES\",\n noDataValue: -99999,\n source: {\n protocol: \"wmts\",\n url: \"https://data.geopf.fr/wmts\",\n name: \"ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES\",\n attribution: [{\n name: \"IGN\",\n attribution: \"IGN Grandes Echelles\",\n url: \"http://www.ign.fr\",\n constraints: [{\n crs: \"EPSG:4326\"\n }]\n }],\n updateStrategy: {\n type: 1,\n options: {\n groups: [3, 7, 11, 14]\n }\n },\n networkOptions: {\n crossOrigin: \"omit\"\n },\n format: \"image/x-bil;bits=32\",\n crs: \"EPSG:4326\",\n tileMatrixSet: \"WGS84G\",\n tileMatrixSetLimits: {\n 6: {\n minTileRow: 13,\n maxTileRow: 36,\n minTileCol: 62,\n maxTileCol: 80\n },\n 7: {\n minTileRow: 27,\n maxTileRow: 73,\n minTileCol: 124,\n maxTileCol: 160\n },\n 8: {\n minTileRow: 55,\n maxTileRow: 146,\n minTileCol: 248,\n maxTileCol: 320\n },\n 9: {\n minTileRow: 110,\n maxTileRow: 292,\n minTileCol: 497,\n maxTileCol: 640\n },\n 10: {\n minTileRow: 221,\n maxTileRow: 585,\n minTileCol: 994,\n maxTileCol: 1281\n },\n 11: {\n minTileRow: 442,\n maxTileRow: 1171,\n minTileCol: 1989,\n maxTileCol: 2563\n },\n 12: {\n minTileRow: 885,\n maxTileRow: 2343,\n minTileCol: 3978,\n maxTileCol: 5126\n },\n 13: {\n minTileRow: 1770,\n maxTileRow: 4687,\n minTileCol: 7957,\n maxTileCol: 10253\n },\n 14: {\n minTileRow: 3540,\n maxTileRow: 9375,\n minTileCol: 15914,\n maxTileCol: 20507\n }\n }\n }\n };\n function createWMTSSourceFromConfig(config) {\n config.source = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"WMTSSource\"](config.source);\n return config;\n }\n ;\n function addElevationLayerFromConfig(config, globe) {\n var layer = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"ElevationLayer\"](config.id, config);\n globe.addLayer(layer);\n }\n ;\n var mntConfig = createWMTSSourceFromConfig(mntLayer);\n addElevationLayerFromConfig(mntConfig, globe);\n};\n\n/**\n * Adds or removes the buildings layer on click\n *\n * @method addBuildings\n * @param {options} options for the buildings control\n */\nBuildings.prototype.addBuildings = function (options) {\n var vectorStyle = \"https://wxs.ign.fr/static/vectorTiles/styles/PLAN.IGN/essentiels/standard.json\";\n var layerId = \"VTBuilding\";\n // ---------- DISPLAY VECTOR TILED BUILDING DATA AS 3D MESHES : ----------\n // Define the source of the building data : those are vector tiled data from the geoportail.\n var buildingsSource = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"VectorTilesSource\"]({\n style: vectorStyle,\n // We only want to display buildings related data.\n // We remove some buildings without alti_sol property (it causes graphical)\n filter: function filter(layer) {\n return layer[\"source-layer\"].includes(\"bati_surf\") && !layer[\"filter\"].includes(\"CIMETIERE_SURF\") && !layer[\"filter\"].includes(\"FOOT_SURF\") && !layer[\"filter\"].includes(\"TENNIS_SURF\") && !layer[\"filter\"].includes(\"MULTI_SPORT_SURF\") && layer.paint[\"fill-color\"];\n }\n });\n\n // Defines if the buildings must be displayed on the MNT or at the zero level\n var baseAltitude;\n var extrusionHeight;\n // To extend the extrusion on the ground when altitude is not accurate, we add a delta parameter\n var delta = 10;\n if (options.buildingsOnGround) {\n baseAltitude = 0;\n extrusionHeight = function extrusionHeight(p) {\n return p.hauteur || 0;\n };\n } else {\n baseAltitude = function baseAltitude(p) {\n return p.alti_sol - delta || 0;\n };\n extrusionHeight = function extrusionHeight(p) {\n return p.hauteur + delta || 0;\n };\n }\n\n // Create a FeatureGeometryLayer to support building data.\n var buildingsLayer = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"FeatureGeometryLayer\"](layerId, {\n source: buildingsSource,\n zoom: {\n min: options.minZoom\n },\n accurate: false,\n style: new itowns__WEBPACK_IMPORTED_MODULE_4__[\"Style\"]({\n fill: {\n base_altitude: baseAltitude,\n extrusion_height: extrusionHeight\n }\n })\n });\n this.getGlobe().addLayer(buildingsLayer);\n\n // initial settings for buildings visibility and button\n this.getGlobe().setLayerVisibility(layerId, options.defaultVisibility);\n if (options.defaultVisibility === true) {\n this._toggleBuildingsButton(this.getElement(), \"off\");\n } else {\n this._toggleBuildingsButton(this.getElement(), \"on\");\n }\n};\n\n/**\n * Set the buildings visibility on click\n *\n * @method setBuildingsVisibility\n * @param {Tring} layerId - layer id for the building layer\n */\nBuildings.prototype.setBuildingsVisibility = function (layerId) {\n if (this.getGlobe().getFeatureGeometryLayers()[0].visible === true) {\n this.getGlobe().setLayerVisibility(layerId, false);\n this._toggleBuildingsButton(this.getElement(), \"on\");\n } else {\n this.getGlobe().setLayerVisibility(layerId, true);\n this._toggleBuildingsButton(this.getElement(), \"off\");\n }\n};\n\n/**\n * Set the button picture on click\n *\n * @method _toggleBuildingsButton\n * @param {DOM} element - DOM element of the buildings Widget\n * @param {String} mode - \"on\" or \"off\" to display the deactivated or activated buildings image\n *\n * @private\n */\nBuildings.prototype._toggleBuildingsButton = function (element, mode) {\n if (mode === \"on\") {\n element.lastChild.classList.remove(\"buildingsOff\");\n element.lastChild.classList.add(\"buildingsOn\");\n } else {\n element.lastChild.classList.remove(\"buildingsOn\");\n element.lastChild.classList.add(\"buildingsOff\");\n }\n};\n\n/**\n * onWidgetAdded : function called when globeVewExtended.addwidget is called\n *\n * @method onWidgetAdded\n * @param {Object} widget - buildings widget\n *\n * @private\n */\nBuildings.prototype.onWidgetAdded = function (widget) {\n var widgetOptions = widget.getOptions();\n if (widgetOptions.MNT !== false) {\n this.addMNT(widget.getGlobe());\n }\n this.addBuildings(widgetOptions);\n this.addListener(this.getElement());\n};\n\n/**\n * addListener : adds the clic listener to handle buildings visibility on the given element\n *\n * @param {DOM} element - DOM element where the listener has to be added\n *\n * @private\n */\nBuildings.prototype.addListener = function (element) {\n element.onclick = function () {\n this.setBuildingsVisibility(\"VTBuilding\");\n }.bind(this);\n};\n\n/**\n * setOptions : set the options of the widget\n *\n * @param {Object} options - options to set\n * @returns {Object} buildingOptions - widget options\n * @private\n */\nBuildings.prototype.setOptions = function (options) {\n var buildingsOptions = {};\n buildingsOptions.MNT = options.MNT !== false;\n buildingsOptions.buildingsOnGround = options.buildingsOnGround || false;\n buildingsOptions.defaultVisibility = options.defaultVisibility !== false;\n buildingsOptions.minZoom = options.minZoom || 15;\n // common widget options\n buildingsOptions.target = options.target;\n buildingsOptions.name = options.name;\n buildingsOptions.element = options.element;\n buildingsOptions.position = options.position;\n return buildingsOptions;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Buildings);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQnVpbGRpbmdzLmpzPzhmYWQiXSwibmFtZXMiOlsiQnVp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LFxuICAgICAgICAgICAgICAgIGF0dHJpYnV0aW9uIDogXCJJR04gR3JhbmRlcyBFY2hlbGxlc1wiLFxuICAgICAgICAgICAgICAgIHVybCA6IFwiaHR0cDovL3d3dy5pZ24uZnJcIixcbiAgICAgICAgICAgICAgICBjb25zdHJhaW50cyA6IFt7XG4gICAgICAgICAgICAgICAgICAgIGNycyA6IFwiRVBTRzo0MzI2XCJcbiAgICAgICAgICAgICAgICB9XVxuICAgICAgICAgICAgfV0sXG4gICAgICAgICAgICB1cGRhdGVTdHJhdGVneSA6IHtcbiAgICAgICAgICAgICAgICB0eXBlIDogMSxcbiAgICAgICAgICAgICAgICBvcHRpb25zIDoge1xuICAgICAgICAgICAgICAgICAgICBncm91cHMgOiBbMywgNywgMTEsIDE0XVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXR3b3JrT3B0aW9ucyA6IHtcbiAgICAgICAgICAgICAgICBjcm9zc09yaWdpbiA6IFwib21pdFwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZm9ybWF0IDogXCJpbWFnZS94LWJpbDtiaXRzPTMyXCIsXG4gICAgICAgICAgICBjcnMgOiBcIkVQU0c6NDMyNlwiLFxuICAgICAgICAgICAgdGlsZU1hdHJpeFNldCA6IFwiV0dTODRHXCIsXG4gICAgICAgICAgICB0aWxlTWF0cml4U2V0TGltaXRzIDoge1xuICAgICAgICAgICAgICAgIDYgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiAxMyxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDM2LFxuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlQ29sIDogNjIsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiA4MFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgNyA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDI3LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogNzMsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiAxNjBcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIDggOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiA1NSxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDE0NixcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDI0OCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDMyMFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgOSA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDExMCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDI5MixcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDQ5NyxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDY0MFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgMTAgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiAyMjEsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVSb3cgOiA1ODUsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiA5OTQsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiAxMjgxXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAxMSA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDQ0MixcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDExNzEsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiAxOTg5LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogMjU2M1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgMTIgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiA4ODUsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVSb3cgOiAyMzQzLFxuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlQ29sIDogMzk3OCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDUxMjZcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIDEzIDoge1xuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlUm93IDogMTc3MCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDQ2ODcsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiA3OTU3LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogMTAyNTNcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIDE0IDoge1xuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlUm93IDogMzU0MCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDkzNzUsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiAxNTkxNCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDIwNTA3XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIGNyZWF0ZVdNVFNTb3VyY2VGcm9tQ29uZmlnIChjb25maWcpIHtcbiAgICAgICAgY29uZmlnLnNvdXJjZSA9IG5ldyBJdFdNVFNTb3VyY2UoY29uZmlnLnNvdXJjZSk7XG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIGFkZEVsZXZhdGlvbkxheWVyRnJvbUNvbmZpZyAoY29uZmlnLCBnbG9iZSkge1x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AqIEByZXR1cm5zIHtPYmplY3R9IGJ1aWxkaW5nT3B0aW9ucyAtIHdpZGdldCBvcHRpb25zXG4gKiBAcHJpdmF0ZVxuICovXG5CdWlsZGluZ3MucHJvdG90eXBlLnNldE9wdGlvbnMgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgIHZhciBidWlsZGluZ3NPcHRpb25zID0ge307XG4gICAgYnVpbGRpbmdzT3B0aW9ucy5NTlQgPSBvcHRpb25zLk1OVCAhPT0gZmFsc2U7XG4gICAgYnVpbGRpbmdzT3B0aW9ucy5idWlsZGluZ3NPbkdyb3VuZCA9IG9wdGlvbnMuYnVpbGRpbmdzT25Hcm91bmQgfHwgZmFsc2U7XG4gICAgYnVpbGRpbmdzT3B0aW9ucy5kZWZhdWx0VmlzaWJpbGl0eSA9IG9wdGlvbnMuZGVmYXVsdFZpc2liaWxpdHkgIT09IGZhbHNlO1xuICAgIGJ1aWxkaW5nc09wdGlvbnMubWluWm9vbSA9IG9wdGlvbnMubWluWm9vbSB8fCAxNTtcbiAgICAvLyBjb21tb24gd2lkZ2V0IG9wdGlvbnNcbiAgICBidWlsZGluZ3NPcHRpb25zLnRhcmdldCA9IG9wdGlvbnMudGFyZ2V0O1xuICAgIGJ1aWxkaW5nc09wdGlvbnMubmFtZSA9IG9wdGlvbnMubmFtZTtcbiAgICBidWlsZGluZ3NPcHRpb25zLmVsZW1lbnQgPSBvcHRpb25zLmVsZW1lbnQ7XG4gICAgYnVpbGRpbmdzT3B0aW9ucy5wb3NpdGlvbiA9IG9wdGlvbnMucG9zaXRpb247XG5cbiAgICByZXR1cm4gYnVpbGRpbmdzT3B0aW9ucztcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEJ1aWxkaW5ncztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Buildings.js\n"); /***/ }), @@ -1439,7 +1451,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Com /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Controls/LayerSwitcherDOM */ \"./src/Common/Controls/LayerSwitcherDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"LayerSwitcher\");\n\n/**\n * @classdesc\n * Control to manage globe layers : their order, visibility and opacity, and display their informations (title, description, legends, metadata...)\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.LayerSwitcher\n * @param {Object} lsOptions - control options\n * @param {Array} [lsOptions.layers] - list of layers to be configured. Each array element is an object, with following properties :\n * @param {String} [lsOptions.layers.id] - ol.layer.Layer layer to be configured (that has been added to globe)\n * @param {Object} [lsOptions.layers.config] - custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties :\n * @param {String} [lsOptions.layers.config.title] - layer alias, to be displayed in widget layer list. E.g. : \"Cartes IGN\"\n * @param {String} [lsOptions.layers.config.description] - layer description, to be displayed on title hover, or in layer information panel.\n * @param {String} [lsOptions.layers.config.quicklookUrl] - link to a quick look image for this layer.\n * @param {Array} [lsOptions.layers.config.legends] - array of layer legends. Each array element is an object, with following properties :\n * - url (String, mandatory) : link to a legend\n * - minScaleDenominator (Number, optional) : min scale denominator for legend validity.\n * @param {Array} [lsOptions.layers.config.metadata] - array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata\n * @param {Object} [lsOptions.options] - Itowns.control.Control options\n * @param {Boolean} [lsOptions.options.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading.\n * @example\n * var layerSwitcher = new itowns.control.LayerSwitcher({\n * layers : [\n * {\n * id : \"myLayer\",\n * config : {\n * title : \"test layer name 1\",\n * description : \"test layer desc 1\",\n * }\n * }\n * ],\n * options : {\n * collapsed : false\n * }\n * ));\n */\nfunction LayerSwitcher(lsOptions) {\n lsOptions = lsOptions || {};\n var options = lsOptions.options || {};\n var layers = lsOptions.layers || [];\n if (!(this instanceof LayerSwitcher)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (!Array.isArray(layers)) {\n throw new Error(\"ERROR WRONG_TYPE : layers should be an array\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options, layers);\n var container = this._initContainer(options);\n // property to save layers conf added after the LS is initialized\n this._addedLayerConf = {};\n _Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].call(this, {\n name: \"LayerSwitcher\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:LayerSwitcher\n */\nLayerSwitcher.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].prototype, {});\n\n// retrieves methods of the common class LayerSwitcherDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].assign(LayerSwitcher.prototype, _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nLayerSwitcher.prototype.constructor = LayerSwitcher;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nLayerSwitcher.prototype.setGlobe = function (globe) {\n var layers;\n if (globe) {\n // in the case the control is added to the globe\n var self = this;\n\n // add options layers to layerlist.\n // (only the layers configurated by the user in the options of the layerSwitcher )\n // the other layers of the map will be added in the setGlobe method\n for (var i = 0; i < this._initLayers.length; i++) {\n // retrieves the layer...\n var layer = null;\n if (this._initLayers[i].id) {\n layer = globe.getLayerById(this._initLayers[i].id);\n }\n if (layer && this._initLayers[i].displayed) {\n // .. and the infos of the configuration if they exist (title, description, legends, quicklook, metadata)\n var conf = this._initLayers[i].config || {};\n var layerOptions = {\n title: conf.title || layer.title || this._initLayers[i].id,\n description: conf.description || null,\n legends: conf.legends || [],\n metadata: conf.metadata || [],\n quicklookUrl: conf.quicklookUrl || null\n };\n if (typeof conf.ipr !== \"undefined\") {\n layerOptions.ipr = conf.ipr;\n }\n if (typeof conf.opacity !== \"undefined\") {\n layerOptions.opacity = conf.opacity;\n }\n if (typeof conf.visibility !== \"undefined\") {\n layerOptions.visibility = conf.visibility;\n }\n this._layers[layer.id] = layerOptions;\n }\n }\n\n // adds the layers\n this._addGlobeLayers(globe);\n\n // adding of listeners\n this._callbacks.onOpacityLayerCallBack = function (e) {\n self._updateLayerOpacity(e.target.id, e[\"new\"].opacity);\n };\n this._callbacks.onVisibilityLayerCallBack = function (e) {\n self._updateLayerVisibility(e.target.id, e[\"new\"].visible);\n };\n\n // At every globe movement, layer switcher may be updated,\n // according to layers on globe, and their range.\n this._callbacks.onChangedViewCallBack = function (e) {\n self._inRangeUpdate(e.colorLayersId);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack);\n // prerender events returns visible layers\n globe.preRenderEventFetchColorLayersDisplayed();\n this._callbacks.onAddedLayerCallBack = function (e) {\n var id = e.layerId;\n if (self) {\n if (!self._layerDisplayedInLayerSwitcher(id)) {\n return;\n }\n var layer = self.getGlobe().getLayerById(id);\n if (layer.type === \"elevation\") {\n return;\n }\n var layerConf = self._getLayerConf(id) || self._addedLayerConf[id];\n if (layerConf) {\n self.addLayer(layer, layerConf);\n } else {\n self.addLayer(layer);\n }\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack);\n this._callbacks.onRemovedLayerCallBack = function (e) {\n var id = e.layerId;\n\n // update the index max and delete the layer from the layerswitcher\n if (self) {\n self.removeLayer(id);\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack);\n this._callbacks.onIndexLayerCallBack = function (e) {\n var arraysEquals = function arraysEquals(a1, a2) {\n if (a1.length !== a2.length) {\n return false;\n }\n for (var i = 0; i < a1.length; ++i) {\n if (a1[i] !== a2[i]) {\n return false;\n }\n }\n return true;\n };\n if (!arraysEquals(e[\"new\"].sequence, e.previous.sequence)) {\n self._updateLayerListContainer();\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack);\n layers = globe.getColorLayers();\n for (var ii = 0; ii < layers.length; ++ii) {\n globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n self._updateLayerVisibility(layers[ii].id, layers[ii].visible);\n self._updateLayerOpacity(layers[ii].id, layers[ii].opacity);\n }\n } else {\n // removes the listeners associated to the deleted layerswitcher\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack);\n layers = this._globe.getColorLayers();\n for (var j = 0; j < layers.length; ++j) {\n this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n }\n // deletes the layerSwitcher DOM\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Adds a new layer to control (when added to globe) or add new layer configuration\n *\n * @param {Object} layer - layer to add to layer switcher\n * @param {Object} [config] - additional options for layer configuration\n * @param {Object} [config.title] - layer title (default is layer identifier)\n * @param {Object} [config.description] - layer description (default is null)\n * @param {Object} [config.legends] - layer legends (default is an empty array)\n * @param {Object} [config.metadata] - layer metadata (default is an empty array)\n * @param {Object} [config.quicklookUrl] - layer quicklookUrl (default is null)\n * @example\n * layerSwitcher.addLayer({\n * layer : gpParcels,\n * config : {\n * title : \"Parcelles cadastrales\",\n * description : \"description de la couche\",\n * quicklookUrl : \"http://quicklookUrl.fr\"\n * }\n * })\n */\nLayerSwitcher.prototype.addLayer = function (layer, config) {\n config = config || {};\n var globe = this.getGlobe();\n if (!layer) {\n logger.error(\"LayerSwitcher:addLayer - missing layer parameter\");\n return;\n }\n var id = layer.id;\n if (id === \"undefined\") {\n logger.error(\"LayerSwitcher:addLayer - configuration cannot be set for \" + layer + \" layer (layer id not found)\");\n return;\n }\n\n // subscription to the events\n globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n\n // make sure layer is in globe layers\n var LayerInGlobe = globe.getLayerById(id);\n if (!LayerInGlobe) {\n logger.error(\"LayerSwitcher:addLayer - configuration cannot be set for \", layer, \" layer (layer is not in globe layers )\");\n return;\n }\n\n // if layer is not already in layers list, add it to control (layers list and container div)\n if (!this._layers[id]) {\n // 1. add layer to layers list\n var layerInfos = this._getLayerInfo(layer) || {};\n var layerOptions = {\n title: config.title || layerInfos._title || id,\n description: config.description || layerInfos._description || null,\n legends: config.legends || layerInfos._legends || [],\n metadata: config.metadata || layerInfos._metadata || [],\n quicklookUrl: config.quicklookUrl || layerInfos._quicklookUrl || null\n };\n if (typeof config.ipr !== \"undefined\") {\n layerOptions.ipr = config.ipr;\n layer.attribution = layerOptions.ipr;\n }\n if (typeof config.opacity !== \"undefined\") {\n layerOptions.opacity = config.opacity;\n layer.opacity = layerOptions.opacity;\n }\n if (typeof config.visibility !== \"undefined\") {\n layerOptions.visibility = config.visibility;\n layer.visible = layerOptions.visibility;\n }\n this._layers[id] = layerOptions;\n\n // creation of the div of the layer which will be added to the layerSwitcher\n this._layers[id].div = this._createLayerDiv(id);\n this._updateLayerListContainer();\n\n // user may also add a new configuration for an already added layer\n } else {\n // add new configuration parameters to layer informations\n for (var prop in config) {\n if (config.hasOwnProperty(prop)) {\n this._layers[id][prop] = config[prop];\n }\n }\n if (typeof config.ipr !== \"undefined\") {\n layer.attribution = config.ipr;\n }\n if (typeof config.opacity !== \"undefined\") {\n layer.opacity = config.opacity;\n }\n if (typeof config.visibility !== \"undefined\") {\n layer.visible = config.visibility;\n }\n // set new title in layer div\n if (config.title) {\n var nameDiv = document.getElementById(this._addUID(\"GPname_ID_\" + id));\n if (nameDiv) {\n nameDiv.innerHTML = config.title;\n // FIXME a ajouter?\n // nameDiv.title = config.description || config.title;\n }\n }\n // add layer info picto if necessary\n var infodiv = document.getElementById(this._addUID(\"GPinfo_ID_\" + id));\n if (!document.getElementById(this._addUID(\"GPinfo_ID_\" + id)) && config.description && (config.legends || config.metadata || config.quicklookUrl)) {\n var advancedTools = document.getElementById(this._addUID(\"GPadvancedTools_ID_\" + id));\n if (advancedTools) {\n advancedTools.appendChild(this._createAdvancedToolInformationElement({\n id: id\n }));\n }\n }\n // close layer info element if open, to update information.\n if (infodiv && infodiv.className === \"GPlayerInfoOpened\") {\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n infodiv.className = \"GPlayerInfo\";\n }\n }\n};\n\n/**\n * Removes a layer from control\n *\n * @param {Object} layerId - layer to remove to layer switcher\n */\nLayerSwitcher.prototype.removeLayer = function (layerId) {\n var layerList = document.getElementById(this._addUID(\"GPlayersList\"));\n // close layer info element if open.\n var infodiv = document.getElementById(this._addUID(\"GPinfo_ID_\" + layerId));\n if (infodiv && infodiv.className === \"GPlayerInfoOpened\") {\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n infodiv.className = \"GPlayerInfo\";\n }\n // remove layer div\n var layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layerId));\n\n // no layerDiv retrieved for VT-label layers\n if (layerDiv) {\n layerList.removeChild(layerDiv);\n }\n\n // removes layer of the layer list\n delete this._layers[layerId];\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nLayerSwitcher.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"LayerSwitcher:setCollapsed - missing collapsed parameter\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n // simulates the panel opening after a click\n if (!isCollapsed) {\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n }\n document.getElementById(this._addUID(\"GPshowLayersList\")).checked = !collapsed;\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n * @return {Boolean} is collapsed\n */\nLayerSwitcher.prototype.getCollapsed = function () {\n return !document.getElementById(this._addUID(\"GPshowLayersList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize LayerSwitcher control (called by constructor)\n *\n * @param {Object} options - Itowns.control.Control options\n * @param {Array} layers - list of layers to be configured. Each array element is an object, with following properties :\n * @private\n */\nLayerSwitcher.prototype._initialize = function (options, layers) {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, opacity, visibility, title, description...)\n this._layers = {};\n\n // div which will contain the divs of the lists\n this._layerListContainer = null;\n\n // callbacks\n this._callbacks = {};\n\n // options\n this._options = options;\n this._initLayers = layers;\n};\n\n/**\n * Returns the layer configuration defined at widget initialization\n *\n * @method _getLayerConf\n * @param {String} layerId - layer id\n * @return {Object} layerConfig - layer configuration\n * @private\n */\nLayerSwitcher.prototype._getLayerConf = function (layerId) {\n for (var i = 0; i < this._initLayers.length; ++i) {\n if (this._initLayers[i].id === layerId) {\n return this._initLayers[i].config;\n }\n }\n return null;\n};\n\n/**\n * Indicates if the layer must be displayed in the layerSwitcher\n *\n * @method _layerDisplayedInLayerSwitcher\n * @param {String} layerId - layer id\n * @return {Boolean} displayed\n * @private\n */\nLayerSwitcher.prototype._layerDisplayedInLayerSwitcher = function (layerId) {\n for (var i = 0; i < this._initLayers.length; ++i) {\n if (this._initLayers[i].id === layerId) {\n return typeof this._initLayers[i].displayed === \"undefined\" || this._initLayers[i].displayed;\n }\n }\n return true;\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nLayerSwitcher.prototype._initContainer = function (options) {\n // creation of the main container\n var container = this._createMainContainerElement();\n\n // adding in the main container\n var input = this._createMainLayersShowElement();\n container.appendChild(input);\n\n // handling of the \"collapsed\" mode\n if (!options.collapsed) {\n input.checked = \"checked\";\n }\n // adds the layer list in the main container\n var divL = this._layerListContainer = this._createMainLayersElement();\n container.appendChild(divL);\n\n // creates the draggable mode\n this._createDraggableElement(divL, this);\n\n // adds the control picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n\n // adds the info panel in the main container\n var divI = this._createMainInfoElement();\n container.appendChild(divI);\n return container;\n};\n\n/**\n * Adds control layers to control main container\n *\n * @method _addGlobeLayers\n * @param {Object} globe - the Itowns.GlobeViewExtended object\n * @private\n */\nLayerSwitcher.prototype._addGlobeLayers = function (globe) {\n // Retrieves the element which contains the different layers\n var elementLayersList;\n var childNodes = this.getElement().childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].id === this._addUID(\"GPlayersList\")) {\n elementLayersList = childNodes[i];\n break;\n }\n }\n // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array)\n var layers = globe.getColorLayers();\n var orderedLayers = layers.sort(function (a, b) {\n return b.sequence - a.sequence;\n });\n\n // loop over all the layers of the map in order to add them to the control layer list (if they are not already added)\n orderedLayers.forEach(function (layer) {\n // adds the map layers to the list\n var id;\n id = layer.id;\n if (!this._layerDisplayedInLayerSwitcher(id)) {\n return;\n }\n var layerConf = this._getLayerConf(id) || this._addedLayerConf[id] || {};\n var layerInfos = this._getLayerInfo(layer) || {};\n if (!this._layers[id]) {\n // if the layer is not yet in the layer list (this._layers), we add it\n var layerOptions = {\n title: layerConf.title || layerInfos._title || id,\n description: layerConf.description || layerInfos._description || null,\n legends: layerConf.legends || layerInfos._legends || [],\n metadata: layerConf.metadata || layerInfos._metadata || [],\n quicklookUrl: layerConf.quicklookUrl || layerInfos._quicklookUrl || null\n };\n this._layers[id] = layerOptions;\n } else {\n var lsLayerConf = this._layers[id];\n if (typeof lsLayerConf.ipr !== \"undefined\") {\n layer.options.attribution = lsLayerConf.ipr;\n }\n if (typeof lsLayerConf.opacity !== \"undefined\") {\n layer.opacity = lsLayerConf.opacity;\n }\n if (typeof lsLayerConf.visibility !== \"undefined\") {\n layer.visible = lsLayerConf.visibility;\n }\n }\n var layerDiv = this._createLayerDiv(id);\n this._layers[id].div = layerDiv;\n elementLayersList.appendChild(layerDiv);\n }, this);\n};\n\n/**\n * creates layer div (to append to control DOM element).\n *\n * @method _createLayerDiv\n * @param {String} layerId - layer id\n * @returns {DOMElement} layer div\n * @private\n */\nLayerSwitcher.prototype._createLayerDiv = function (layerId) {\n var layerOptions = this._layers[layerId];\n var isLegends = layerOptions.legends && layerOptions.legends.length !== 0;\n var isMetadata = layerOptions.metadata && layerOptions.metadata.length !== 0;\n var isQuicklookUrl = layerOptions.quicklookUrl;\n if (isLegends || isMetadata || isQuicklookUrl) {\n layerOptions.displayInformationElement = true;\n }\n\n // adds a specific div in the control for the layer\n layerOptions.id = layerId;\n var layerDiv = this._createContainerLayerElement(layerOptions);\n if (!layerOptions.inRange) {\n layerDiv.classList.add(\"outOfRange\");\n }\n return layerDiv;\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Changes layer opacity on layer opacity picto click\n *\n * @method _onChangeLayerOpacity\n * @param {Object} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onChangeLayerOpacity = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n var opacityValue = e.target.value;\n var opacityId = document.getElementById(this._addUID(\"GPopacityValue_ID_\" + layerID));\n opacityId.innerHTML = opacityValue + \"%\";\n globe.setLayerOpacity(layerID, opacityValue / 100);\n};\n\n/**\n * Updates picto opacity value on layer opacity change\n *\n * @method _updateLayerOpacity\n * @param {String} layerId - layer id\n * @param {Number} opacity - opacity value\n * @private\n */\nLayerSwitcher.prototype._updateLayerOpacity = function (layerId, opacity) {\n if (opacity > 1) {\n opacity = 1;\n }\n if (opacity < 0) {\n opacity = 0;\n }\n var layerOpacityInput = document.getElementById(this._addUID(\"GPopacityValueDiv_ID_\" + layerId));\n if (layerOpacityInput) {\n layerOpacityInput.value = Math.round(opacity * 100);\n }\n var layerOpacitySpan = document.getElementById(this._addUID(\"GPopacityValue_ID_\" + layerId));\n if (layerOpacitySpan) {\n layerOpacitySpan.innerHTML = Math.round(opacity * 100) + \"%\";\n }\n};\n\n/**\n * Changes layer visibility on layer visibility picto click\n *\n * @method _onVisibilityLayerClick\n * @param {Object} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onVisibilityLayerClick = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n globe.setLayerVisibility(layerID, e.target.checked); // update viewer\n};\n\n/**\n * Changes picto visibility on layer visibility change\n *\n * @method _updateLayerVisibility\n * @param {String} layerId - layer id\n * @param {Boolean} visibility - visible if true\n * @private\n */\nLayerSwitcher.prototype._updateLayerVisibility = function (layerId, visibility) {\n var layerVisibilityInput = document.getElementById(this._addUID(\"GPvisibility_ID_\" + layerId));\n if (layerVisibilityInput) {\n layerVisibilityInput.checked = visibility;\n }\n};\n\n/**\n * Opens layer information panel on picto click\n *\n * @method _onOpenLayerInfoClick\n * @param {Event} e - MouseEvent\n * @private\n */\nLayerSwitcher.prototype._onOpenLayerInfoClick = function (e) {\n var layerID = this._resolveLayerId(e.target.id);\n var layerOptions = this._layers[layerID];\n var panel;\n var info;\n\n // Close layer info panel\n var divId = document.getElementById(e.target.id);\n if (divId.className === \"GPlayerInfoOpened\") {\n if (divId.classList !== undefined) {\n divId.classList.remove(\"GPlayerInfoOpened\");\n divId.classList.add(\"GPlayerInfo\");\n }\n panel = document.getElementById(this._addUID(\"GPlayerInfoPanel\"));\n if (panel.classList !== undefined) {\n panel.classList.remove(\"GPpanel\");\n panel.classList.remove(\"GPlayerInfoPanelOpened\");\n panel.classList.add(\"GPlayerInfoPanelClosed\");\n }\n info = document.getElementById(this._addUID(\"GPlayerInfoContent\"));\n panel.removeChild(info);\n return;\n }\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n\n // Open layer info panel\n if (divId.classList !== undefined) {\n divId.classList.remove(\"GPlayerInfo\");\n divId.classList.add(\"GPlayerInfoOpened\");\n }\n panel = document.getElementById(this._addUID(\"GPlayerInfoPanel\"));\n if (panel.classList !== undefined) {\n panel.classList.add(\"GPpanel\");\n panel.classList.remove(\"GPlayerInfoPanelClosed\");\n panel.classList.add(\"GPlayerInfoPanelOpened\");\n }\n info = document.getElementById(this._addUID(\"GPlayerInfoContent\"));\n if (info) {\n panel.removeChild(info);\n }\n\n // on récupère les infos associées au layer pour mettre dynamiquement le contenu du panel d'informations\n var obj = {\n title: layerOptions.title,\n description: layerOptions.description,\n quicklookUrl: layerOptions.quicklookUrl,\n metadata: layerOptions.metadata,\n legends: layerOptions.legends\n };\n var infoLayer = this._createContainerLayerInfoElement(obj);\n panel.appendChild(infoLayer);\n};\n\n/**\n * removes layer from layer switcher and globe on picto click\n *\n * @method _onDropLayerClick\n * @param {Event} e - MouseEvent\n * @private\n */\nLayerSwitcher.prototype._onDropLayerClick = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n // removing the layer will trigger the event listener\n // which will call this.removeLayer and delete the div\n globe.removeLayer(layerID);\n this._updateLayerListContainer();\n};\n\n/**\n * changes layers order on drag and drop\n *\n * @method _onDropLayerClick\n * @param {Event} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onDragAndDropLayerClick = function (e) {\n var globe = this.getGlobe();\n\n // Handling of the indexes : gives the little indexes (lowest layers) to the non-visible layers (displayed: false)\n // when the index of a visible layer changes.\n // Always moves the non-visible layers under the other layers (to not hide them)\n\n if (e.newIndex - e.oldIndex === 0) {\n return;\n }\n var targetIndex = null;\n if (e.newIndex) {\n var layerTargetID = this._resolveLayerId(e.from.childNodes[e.newIndex + (e.newIndex - e.oldIndex < 0 ? 1 : -1)].id);\n targetIndex = globe.getLayerById(layerTargetID).sequence;\n } else {\n targetIndex = globe.getColorLayers().length - 1;\n }\n var layerID = this._resolveLayerId(e.item.id);\n globe.moveLayerToIndex(layerID, targetIndex);\n};\n\n/**\n * Checks layers range\n *\n * @method _inRangeUpdate\n * @param {Array} layersDisplayed - list of displayed layers id\n * @private\n */\nLayerSwitcher.prototype._inRangeUpdate = function (layersDisplayed) {\n for (var layerKey in this._layers) {\n var layer = this._layers[layerKey];\n if (!layer) {\n continue;\n }\n // Check if layer is displayed.\n var layerDiv;\n var bInRange = layersDisplayed.indexOf(layer.id) >= 0;\n if (bInRange && !layer.inRange) {\n layer.inRange = true;\n layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layer.id));\n layerDiv.classList.remove(\"outOfRange\");\n } else if (!bInRange && layer.inRange) {\n layer.inRange = false;\n layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layer.id));\n layerDiv.classList.add(\"outOfRange\");\n }\n }\n};\n\n/**\n * Update the layer list container\n *\n * @method _updateLayerListContainer\n * @private\n */\nLayerSwitcher.prototype._updateLayerListContainer = function () {\n if (this._layerListContainer) {\n var globe = this.getGlobe();\n\n // empty the previous container\n while (this._layerListContainer.firstChild) {\n this._layerListContainer.removeChild(this._layerListContainer.firstChild);\n }\n // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array)..\n var layers = globe.getColorLayers();\n var orderedLayers = layers.sort(function (a, b) {\n return b.sequence - a.sequence;\n });\n // ... and adds the correct div to the different layers, in the zindex decreasing order\n for (var j = 0; j < orderedLayers.length; j++) {\n if (!this._layers[orderedLayers[j].id]) {\n continue;\n }\n // retrieves the div of the layer, stored in the _layers array\n var layerDiv = this._layers[orderedLayers[j].id].div;\n this._layerListContainer.appendChild(layerDiv);\n }\n } else {\n logger.error(\"[Itowns.control.LayerSwitcher] _updateLayerListContainer : layer list container not found to update layers order ?!\");\n }\n};\n\n// ################################################################### //\n// ############################ Utils ################################ //\n// ################################################################### //\n\n/**\n * Gets layer informations : title, description, quicklookurl, legends, metadata\n *\n * @private\n * @memberof LayerSwitcher\n * @method _getLayerInfo\n * @param {Object} layer - the layer object\n * @returns {Object} layerInfo - layer informations\n */\nLayerSwitcher.prototype._getLayerInfo = function (layer) {\n var layerInfo = {};\n if (layer) {\n layerInfo._title = layer.title || null;\n layerInfo._description = layer.description || null;\n layerInfo._quicklookUrl = layer.quicklookUrl || null;\n layerInfo._metadata = layer.metadata || null;\n layerInfo._legends = layer.legends || null;\n }\n return layerInfo;\n};\n\n/**\n * Gets layer id from div id\n *\n * @method _resolveLayerId\n * @param {String} divId - HTML div id\n * @returns {String} layer id\n * @private\n */\nLayerSwitcher.prototype._resolveLayerId = function (divId) {\n var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].name(divId); // ex GPvisibilityPicto_ID_26\n return divName.substring(divName.indexOf(\"_ID_\") + 4); // ex. 26\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerSwitcher);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTGF5ZXJTd2l0Y2hlci5qcz82ODk1Il0sIm5hbWVzIjpbImxvZ2dlciIsIkxvZ2dlciIsImdldExvZ2dlciIsIkxheWVyU3dpdGNoZXIiLCJsc09wdGlvbnMiLCJvcHRpb25zIiwibGF5ZXJzIiwiVHlwZUVycm9yIiwiQXJyYXkiLCJpc0FycmF5IiwiRXJyb3IiLCJfdHlwZW9mIiwiX2luaXRpYWxpemUiLCJjb250YWluZXIiLCJfaW5pdENvbnRhaW5lciIsIl9hZGRlZExheWVyQ29uZiIsIldpZGdldCIsImNhbGwiLCJuYW1lIiwiZWxlbWVudCIsInRhcmdldCIsInBvc2l0aW9uIiwicHJvdG90eXBlIiwiT2JqZWN0IiwiY3JlYXRlIiwiVXRpbHMiLCJhc3NpZ24iLCJMYXllclN3aXRjaGVyRE9NIiwiY29uc3RydWN0b3IiLCJzZXRHbG9iZSIsImdsb2JlIiwic2VsZiIsImkiLCJfaW5pdExheWVycyIsImxlbmd0aCIsImxheWVyIiwiaWQiLCJnZXRMYXllckJ5SWQiLCJkaXNwbGF5ZWQiLCJjb25mIiwiY29uZmlnIiwibGF5ZXJPcHRpb25zIiwidGl0bGUiLCJkZXNjcmlwdGlvbiIsImxlZ2VuZHMiLCJtZXRhZGF0YSIsInF1aWNrbG9va1VybCIsImlwciIsIm9wYWNpdHkiL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uICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdGlvbiA6IGNvbmYuZGVzY3JpcHRpb24gfHwgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbGVnZW5kcyA6IGNvbmYubGVnZW5kcyB8fCBbXSxcbiAgICAgICAgICAgICAgICAgICAgbWV0YWRhdGEgOiBjb25mLm1ldGFkYXRhIHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBjb25mLnF1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvbmYuaXByICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyT3B0aW9ucy5pcHIgPSBjb25mLmlwcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb25mLm9wYWNpdHkgIT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgbGF5ZXJPcHRpb25zLm9wYWNpdHkgPSBjb25mLm9wYWNpdHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY29uZi52aXNpYmlsaXR5ICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyT3B0aW9ucy52aXNpYmlsaXR5ID0gY29uZi52aXNpYmlsaXR5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9sYXllcnNbbGF5ZXIuaWRdID0gbGF5ZXJPcHRpb25zO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gYWRkcyB0aGUgbGF5ZXJzXG4gICAgICAgIHRoaXMuX2FkZEdsb2JlTGF5ZXJzKGdsb2JlKTtcblxuICAgICAgICAvLyBhZGRpbmcgb2YgbGlzdGVuZXJzXG4gICAgICAgIHRoaXMuX2Nhb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mFyIGlkID0gZS5sYXllcklkO1xuICAgICAgICAgICAgaWYgKHNlbGYpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXNlbGYuX2xheWVyRGlzcGxheWVkSW5MYXllclN3aXRjaGVyKGlkKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBsYXllciA9IHNlbGYuZ2V0R2xvYmUoKS5nZXRMYXllckJ5SWQoaWQpO1xuICAgICAgICAgICAgICAgIGlmIChsYXllci50eXBlID09PSBcImVsZXZhdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGxheWVyQ29uZiA9IHNlbGYuX2dldExheWVyQ29uZihpZCkgfHwgc2VsZi5fYWRkZWRMYXllckNvbmZbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChsYXllckNvbmYpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5hZGRMYXllcihsYXllciwgbGF5ZXJDb25mKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZExheWVyKGxheWVyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGdsb2JlLmxpc3RlbihHbG9iZVZpZXdFeHRlbmRlZC5FVkVOVFMuTEFZRVJfQURERUQsIHRoaXMuX2NhbGxiYWNrcy5vbkFkZGVkTGF5ZXJDYWxsQmFjayk7XG5cbiAgICAgICAgdGhpcy5fY2FsbGJhY2tzLm9uUmVtb3ZlZExheWVyQ2FsbEJhY2sgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgdmFyIGlkID0gZS5sYXllcklkO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGluZGV4IG1heCBhbmQgZGVsZXRlIHRoZSBsYXllciBmcm9tIHRoZSBsYXllcnN3aXRjaGVyXG4gICAgICAgICAgICBpZiAoc2VsZikge1xuICAgICAgICAgICAgICAgIHNlbGYucmVtb3ZlTGF5ZXIoaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBnbG9iZS5saXN0ZW4oR2xvYmVWaWV3RXh0ZW5kZWQuRVZFTlRTLkxBWUVSX1JFTU9WRUQsIHRoaXMuX2NhbGxiYWNrcy5vblJlbW92ZWRMYXllckNhbGxCYWNrKTtcblxuICAgICAgICB0aGlzLl9jYWxsYmFja3Mub25JbmRleExheWVyQ2FsbEJhY2sgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgdmFyIGFycmF5c0VxdWFscyA9IGZ1bmN0aW9uIChhMSwgYTIpIHtcbiAgICAgICAgICAgICAgICBpZiAoYTEubGVuZ3RoICE9PSBhMi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGExLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhMVtpXSAhPT0gYTJbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGlmICghYXJyYXlzRXF1YWxzKGUubmV3LnNlcXVlbmNlLCBlLnByZXZpb3VzLnNlcXVlbmNlKSkge1xuICAgICAgICAgICAgICAgIHNlbGYuX3VwZGF0ZUxheWVyTGlzdENvbnRhaW5lcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBnbG9iZS5saXN0ZW4oR2xvYmVWaWV3RXh0ZW5kZWQuRVZFTlRTLkxBWUVSU19PUk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tsb29rVXJsXSAtIGxheWVyIHF1aWNrbG9va1VybCAoZGVmYXVsdCBpcyBudWxsKVxuICogQGV4YW1wbGVcbiAqICAgbGF5ZXJTd2l0Y2hlci5hZGRMYXllcih7XG4gKiAgICAgICBsYXllciA6IGdwUGFyY2VscyxcbiAqICAgICAgIGNvbmZpZyA6IHtcbiAqICAgICAgICAgICB0aXRsZSA6IFwiUGFyY2VsbGVzIGNhZGFzdHJhbGVzXCIsXG4gKiAgICAgICAgICAgZGVzY3JpcHRpb24gOiBcImRlc2NyaXB0aW9uIGRlIGxhIGNvdWNoZVwiLFxuICogICAgICAgICAgIHF1aWNrbG9va1VybCA6IFwiaHR0cDovL3F1aWNrbG9va1VybC5mclwiXG4gKiAgICAgICB9XG4gKiAgIH0pXG4gKi9cbkxheWVyU3dpdGNoZXIucHJvdG90eXBlLmFkZExheWVyID0gZnVuY3Rpb24gKGxheWVyLCBjb25maWcpIHtcbiAgICBjb25maWcgPSBjb25maWcgfHwge307XG4gICAgdmFyIGdsb2JlID0gdGhpcy5nZXRHbG9iZSgpO1xuXG4gICAgaWYgKCFsYXllcikge1xuICAgICAgICBsb2dnZXIuZXJyb3IoXCJMYXllclN3aXRjaGVyOmFkZExheWVyIC0gbWlzc2luZyBsYXllciBwYXJhbWV0ZXJcIik7XG4gICAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICB2YXIgaWQgPSBsYXllci5pZDtcbiAgICBpZiAoaWQgPT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgbG9nZ2VyLmVycm9yKFwiTGF5ZXJTd2l0Y2hlcjphZGRMYXllciAtIGNvbmZpZ3VyYXRpb24gY2Fubm90IGJlIHNldCBmb3IgXCIgKyBsYXllciArIFwiIGxheWVyIChsYXllciBpZCBub3QgZm91bmQpXCIpO1xuICAgICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgLy8gc3Vic2NyaXB0aW9uIHRvIHRoZSBldmVudHNcbiAgICBnbG9iZS5hZGRMYXllckxpc3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5mb3MuX3RpdGxlIHx8IGlkLFxuICAgICAgICAgICAgZGVzY3JpcHRpb24gOiBjb25maWcuZGVzY3JpcHRpb24gfHwgbGF5ZXJJbmZvcy5fZGVzY3JpcHRpb24gfHwgbnVsbCxcbiAgICAgICAgICAgIGxlZ2VuZHMgOiBjb25maWcubGVnZW5kcyB8fCBsYXllckluZm9zLl9sZWdlbmRzIHx8IFtdLFxuICAgICAgICAgICAgbWV0YWRhdGEgOiBjb25maWcubWV0YWRhdGEgfHwgbGF5ZXJJbmZvcy5fbWV0YWRhdGEgfHwgW10sXG4gICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBjb25maWcucXVpY2tsb29rVXJsIHx8IGxheWVySW5mb3MuX3F1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgY29uZmlnLmlwciAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgbGF5ZXJPcHRpb25zLmlwciA9IGNvbmZpZy5pcHI7XG4gICAgICAgICAgICBsYXllci5hdHRyaWJ1dGlvbiA9IGxheWVyT3B0aW9ucy5pcHI7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBjb25maWcub3BhY2l0eSAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgbGF5ZXJPcHRpb25zLm9wYWNpdHkgPSBjb25maWcub3BhY2l0eTtcbiAgICAgICAgICAgIGxheWVyLm9wYWNpdHkgPSBsYXllck9wdGlvbnMub3BhY2l0eTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvbmZpZy52aXNpYmlsaXR5ICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICBsYXllck9wdGlvbnMudmlzaWJpbGl0eSA9IGNvbmZpZy52aXNpYmlsaXR5O1xuICAgICAgICAgICAgbGF5ZXIudmlzaWJsZSA9IGxheWVyT3B0aW9ucy52aXNpYmlsaXR5O1xuICAgICAgICB9XG4g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ICAgICAgICAgIC8vIGlmIHRoZSBsYXllciBpcyBub3QgeWV0IGluIHRoZSBsYXllciBsaXN0ICh0aGlzLl9sYXllcnMpLCB3ZSBhZGQgaXRcbiAgICAgICAgICAgICAgICB2YXIgbGF5ZXJPcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICB0aXRsZSA6IGxheWVyQ29uZi50aXRsZSB8fCBsYXllckluZm9zLl90aXRsZSB8fCBpZCxcbiAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRpb24gOiBsYXllckNvbmYuZGVzY3JpcHRpb24gfHwgbGF5ZXJJbmZvcy5fZGVzY3JpcHRpb24gfHwgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbGVnZW5kcyA6IGxheWVyQ29uZi5sZWdlbmRzIHx8IGxheWVySW5mb3MuX2xlZ2VuZHMgfHwgW10sXG4gICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhIDogbGF5ZXJDb25mLm1ldGFkYXRhIHx8IGxheWVySW5mb3MuX21ldGFkYXRhIHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBsYXllckNvbmYucXVpY2tsb29rVXJsIHx8IGxheWVySW5mb3MuX3F1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB0aGlzLl9sYXllcnNbaWRdID0gbGF5ZXJPcHRpb25zO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgbHNMYXllckNvbmYgPSB0aGlzLl9sYXllcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbHNMYXllckNvbmYuaXByICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyLm9wdGlvbnMuYXR0cmlidXRpb24gPSBsc0xheWVyQ29uZi5pcHI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbH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A9IHt9O1xuICAgIGlmIChsYXllcikge1xuICAgICAgICBsYXllckluZm8uX3RpdGxlID0gbGF5ZXIudGl0bGUgfHwgbnVsbDtcbiAgICAgICAgbGF5ZXJJbmZvLl9kZXNjcmlwdGlvbiA9IGxheWVyLmRlc2NyaXB0aW9uIHx8IG51bGw7XG4gICAgICAgIGxheWVySW5mby5fcXVpY2tsb29rVXJsID0gbGF5ZXIucXVpY2tsb29rVXJsIHx8IG51bGw7XG4gICAgICAgIGxheWVySW5mby5fbWV0YWRhdGEgPSBsYXllci5tZXRhZGF0YSB8fCBudWxsO1xuICAgICAgICBsYXllckluZm8uX2xlZ2VuZHMgPSBsYXllci5sZWdlbmRzIHx8IG51bGw7XG4gICAgfVxuICAgIHJldHVybiBsYXllckluZm87XG59O1xuXG4vKipcbiAqIEdldHMgbGF5ZXIgaWQgZnJvbSBkaXYgaWRcbiAqXG4gKiBAbWV0aG9kIF9yZXNvbHZlTGF5ZXJJZFxuICogQHBhcmFtIHtTdHJpbmd9IGRpdklkIC0gSFRNTCBkaXYgaWRcbiAqIEByZXR1cm5zIHtTdHJpbmd9IGxheWVyIGlkXG4gKiBAcHJpdmF0ZVxuICovXG5MYXllclN3aXRjaGVyLnByb3RvdHlwZS5fcmVzb2x2ZUxheWVySWQgPSBmdW5jdGlvbiAoZGl2SWQpIHtcbiAgICB2YXIgZGl2TmFtZSA9IFNlbGVjdG9ySUQubmFtZShkaXZJZCk7IC8vIGV4IEdQdmlzaWJpbGl0eVBpY3RvX0lEXzI2XG4gICAgcmV0dXJuIGRpdk5hbWUuc3Vic3RyaW5nKGRpdk5hbWUuaW5kZXhPZihcIl9JRF9cIikgKyA0KTsgLy8gZXguIDI2XG59O1xuXG5leHBvcnQgZGVmYXVsdCBMYXllclN3aXRjaGVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/LayerSwitcher.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Controls/LayerSwitcherDOM */ \"./src/Common/Controls/LayerSwitcherDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"LayerSwitcher\");\n\n/**\n * @classdesc\n * Control to manage globe layers : their order, visibility and opacity, and display their informations (title, description, legends, metadata...)\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.LayerSwitcher\n * @param {Object} lsOptions - control options\n * @param {Array} [lsOptions.layers] - list of layers to be configured. Each array element is an object, with following properties :\n * @param {String} [lsOptions.layers.id] - ol.layer.Layer layer to be configured (that has been added to globe)\n * @param {Object} [lsOptions.layers.config] - custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties :\n * @param {String} [lsOptions.layers.config.title] - layer alias, to be displayed in widget layer list. E.g. : \"Cartes IGN\"\n * @param {String} [lsOptions.layers.config.description] - layer description, to be displayed on title hover, or in layer information panel.\n * @param {String} [lsOptions.layers.config.quicklookUrl] - link to a quick look image for this layer.\n * @param {Array} [lsOptions.layers.config.legends] - array of layer legends. Each array element is an object, with following properties :\n * - url (String, mandatory) : link to a legend\n * - minScaleDenominator (Number, optional) : min scale denominator for legend validity.\n * @param {Array} [lsOptions.layers.config.metadata] - array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata\n * @param {Object} [lsOptions.options] - Itowns.control.Control options\n * @param {Boolean} [lsOptions.options.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading.\n * @example\n * var layerSwitcher = new itowns.control.LayerSwitcher({\n * layers : [\n * {\n * id : \"myLayer\",\n * config : {\n * title : \"test layer name 1\",\n * description : \"test layer desc 1\",\n * }\n * }\n * ],\n * options : {\n * collapsed : false\n * }\n * ));\n */\nfunction LayerSwitcher(lsOptions) {\n lsOptions = lsOptions || {};\n var options = lsOptions.options || {};\n var layers = lsOptions.layers || [];\n if (!(this instanceof LayerSwitcher)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (!Array.isArray(layers)) {\n throw new Error(\"ERROR WRONG_TYPE : layers should be an array\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options, layers);\n var container = this._initContainer(options);\n // property to save layers conf added after the LS is initialized\n this._addedLayerConf = {};\n _Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].call(this, {\n name: \"LayerSwitcher\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:LayerSwitcher\n */\nLayerSwitcher.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].prototype, {});\n\n// retrieves methods of the common class LayerSwitcherDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].assign(LayerSwitcher.prototype, _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nLayerSwitcher.prototype.constructor = LayerSwitcher;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nLayerSwitcher.prototype.setGlobe = function (globe) {\n var layers;\n if (globe) {\n // in the case the control is added to the globe\n var self = this;\n\n // add options layers to layerlist.\n // (only the layers configurated by the user in the options of the layerSwitcher )\n // the other layers of the map will be added in the setGlobe method\n for (var i = 0; i < this._initLayers.length; i++) {\n // retrieves the layer...\n var layer = null;\n if (this._initLayers[i].id) {\n layer = globe.getLayerById(this._initLayers[i].id);\n }\n if (layer && this._initLayers[i].displayed) {\n // .. and the infos of the configuration if they exist (title, description, legends, quicklook, metadata)\n var conf = this._initLayers[i].config || {};\n var layerOptions = {\n title: conf.title || layer.title || this._initLayers[i].id,\n description: conf.description || null,\n legends: conf.legends || [],\n metadata: conf.metadata || [],\n quicklookUrl: conf.quicklookUrl || null\n };\n if (typeof conf.ipr !== \"undefined\") {\n layerOptions.ipr = conf.ipr;\n }\n if (typeof conf.opacity !== \"undefined\") {\n layerOptions.opacity = conf.opacity;\n }\n if (typeof conf.visibility !== \"undefined\") {\n layerOptions.visibility = conf.visibility;\n }\n this._layers[layer.id] = layerOptions;\n }\n }\n\n // adds the layers\n this._addGlobeLayers(globe);\n\n // adding of listeners\n this._callbacks.onOpacityLayerCallBack = function (e) {\n self._updateLayerOpacity(e.target.id, e[\"new\"].opacity);\n };\n this._callbacks.onVisibilityLayerCallBack = function (e) {\n self._updateLayerVisibility(e.target.id, e[\"new\"].visible);\n };\n\n // At every globe movement, layer switcher may be updated,\n // according to layers on globe, and their range.\n this._callbacks.onChangedViewCallBack = function (e) {\n self._inRangeUpdate(e.colorLayersId);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack);\n // prerender events returns visible layers\n globe.preRenderEventFetchColorLayersDisplayed();\n this._callbacks.onAddedLayerCallBack = function (e) {\n var id = e.layerId;\n if (self) {\n if (!self._layerDisplayedInLayerSwitcher(id)) {\n return;\n }\n var layer = self.getGlobe().getLayerById(id);\n if (layer.type === \"elevation\") {\n return;\n }\n var layerConf = self._getLayerConf(id) || self._addedLayerConf[id];\n if (layerConf) {\n self.addLayer(layer, layerConf);\n } else {\n self.addLayer(layer);\n }\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack);\n this._callbacks.onRemovedLayerCallBack = function (e) {\n var id = e.layerId;\n\n // update the index max and delete the layer from the layerswitcher\n if (self) {\n self.removeLayer(id);\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack);\n this._callbacks.onIndexLayerCallBack = function (e) {\n var arraysEquals = function arraysEquals(a1, a2) {\n if (a1.length !== a2.length) {\n return false;\n }\n for (var i = 0; i < a1.length; ++i) {\n if (a1[i] !== a2[i]) {\n return false;\n }\n }\n return true;\n };\n if (!arraysEquals(e[\"new\"].sequence, e.previous.sequence)) {\n self._updateLayerListContainer();\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack);\n layers = globe.getColorLayers();\n for (var ii = 0; ii < layers.length; ++ii) {\n globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n self._updateLayerVisibility(layers[ii].id, layers[ii].visible);\n self._updateLayerOpacity(layers[ii].id, layers[ii].opacity);\n }\n } else {\n // removes the listeners associated to the deleted layerswitcher\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack);\n layers = this._globe.getColorLayers();\n for (var j = 0; j < layers.length; ++j) {\n this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n }\n // deletes the layerSwitcher DOM\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Adds a new layer to control (when added to globe) or add new layer configuration\n *\n * @param {Object} layer - layer to add to layer switcher\n * @param {Object} [config] - additional options for layer configuration\n * @param {Object} [config.title] - layer title (default is layer identifier)\n * @param {Object} [config.description] - layer description (default is null)\n * @param {Object} [config.legends] - layer legends (default is an empty array)\n * @param {Object} [config.metadata] - layer metadata (default is an empty array)\n * @param {Object} [config.quicklookUrl] - layer quicklookUrl (default is null)\n * @example\n * layerSwitcher.addLayer({\n * layer : gpParcels,\n * config : {\n * title : \"Parcelles cadastrales\",\n * description : \"description de la couche\",\n * quicklookUrl : \"http://quicklookUrl.fr\"\n * }\n * })\n */\nLayerSwitcher.prototype.addLayer = function (layer, config) {\n config = config || {};\n var globe = this.getGlobe();\n if (!layer) {\n logger.error(\"LayerSwitcher:addLayer - missing layer parameter\");\n return;\n }\n var id = layer.id;\n if (id === \"undefined\") {\n logger.error(\"LayerSwitcher:addLayer - configuration cannot be set for \" + layer + \" layer (layer id not found)\");\n return;\n }\n\n // subscription to the events\n globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n\n // make sure layer is in globe layers\n var LayerInGlobe = globe.getLayerById(id);\n if (!LayerInGlobe) {\n logger.error(\"LayerSwitcher:addLayer - configuration cannot be set for \", layer, \" layer (layer is not in globe layers )\");\n return;\n }\n\n // if layer is not already in layers list, add it to control (layers list and container div)\n if (!this._layers[id]) {\n // 1. add layer to layers list\n var layerInfos = this._getLayerInfo(layer) || {};\n var layerOptions = {\n title: config.title || layerInfos._title || id,\n description: config.description || layerInfos._description || null,\n legends: config.legends || layerInfos._legends || [],\n metadata: config.metadata || layerInfos._metadata || [],\n quicklookUrl: config.quicklookUrl || layerInfos._quicklookUrl || null\n };\n if (typeof config.ipr !== \"undefined\") {\n layerOptions.ipr = config.ipr;\n layer.attribution = layerOptions.ipr;\n }\n if (typeof config.opacity !== \"undefined\") {\n layerOptions.opacity = config.opacity;\n layer.opacity = layerOptions.opacity;\n }\n if (typeof config.visibility !== \"undefined\") {\n layerOptions.visibility = config.visibility;\n layer.visible = layerOptions.visibility;\n }\n this._layers[id] = layerOptions;\n\n // creation of the div of the layer which will be added to the layerSwitcher\n this._layers[id].div = this._createLayerDiv(id);\n this._updateLayerListContainer();\n\n // user may also add a new configuration for an already added layer\n } else {\n // add new configuration parameters to layer informations\n for (var prop in config) {\n if (config.hasOwnProperty(prop)) {\n this._layers[id][prop] = config[prop];\n }\n }\n if (typeof config.ipr !== \"undefined\") {\n layer.attribution = config.ipr;\n }\n if (typeof config.opacity !== \"undefined\") {\n layer.opacity = config.opacity;\n }\n if (typeof config.visibility !== \"undefined\") {\n layer.visible = config.visibility;\n }\n // set new title in layer div\n if (config.title) {\n var nameDiv = document.getElementById(this._addUID(\"GPname_ID_\" + id));\n if (nameDiv) {\n nameDiv.innerHTML = config.title;\n // FIXME a ajouter?\n // nameDiv.title = config.description || config.title;\n }\n }\n // add layer info picto if necessary\n var infodiv = document.getElementById(this._addUID(\"GPinfo_ID_\" + id));\n if (!document.getElementById(this._addUID(\"GPinfo_ID_\" + id)) && config.description && (config.legends || config.metadata || config.quicklookUrl)) {\n var advancedTools = document.getElementById(this._addUID(\"GPadvancedTools_ID_\" + id));\n if (advancedTools) {\n advancedTools.appendChild(this._createAdvancedToolInformationElement({\n id: id\n }));\n }\n }\n // close layer info element if open, to update information.\n if (infodiv && infodiv.className === \"GPlayerInfoOpened\") {\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n infodiv.className = \"GPlayerInfo\";\n }\n }\n};\n\n/**\n * Removes a layer from control\n *\n * @param {Object} layerId - layer to remove to layer switcher\n */\nLayerSwitcher.prototype.removeLayer = function (layerId) {\n var layerList = document.getElementById(this._addUID(\"GPlayersList\"));\n // close layer info element if open.\n var infodiv = document.getElementById(this._addUID(\"GPinfo_ID_\" + layerId));\n if (infodiv && infodiv.className === \"GPlayerInfoOpened\") {\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n infodiv.className = \"GPlayerInfo\";\n }\n // remove layer div\n var layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layerId));\n\n // no layerDiv retrieved for VT-label layers\n if (layerDiv) {\n layerList.removeChild(layerDiv);\n }\n\n // removes layer of the layer list\n delete this._layers[layerId];\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nLayerSwitcher.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"LayerSwitcher:setCollapsed - missing collapsed parameter\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n // simulates the panel opening after a click\n if (!isCollapsed) {\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n }\n document.getElementById(this._addUID(\"GPshowLayersList\")).checked = !collapsed;\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n * @return {Boolean} is collapsed\n */\nLayerSwitcher.prototype.getCollapsed = function () {\n return !document.getElementById(this._addUID(\"GPshowLayersList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize LayerSwitcher control (called by constructor)\n *\n * @param {Object} options - Itowns.control.Control options\n * @param {Array} layers - list of layers to be configured. Each array element is an object, with following properties :\n * @private\n */\nLayerSwitcher.prototype._initialize = function (options, layers) {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, opacity, visibility, title, description...)\n this._layers = {};\n\n // div which will contain the divs of the lists\n this._layerListContainer = null;\n\n // callbacks\n this._callbacks = {};\n\n // options\n this._options = options;\n this._initLayers = layers;\n};\n\n/**\n * Returns the layer configuration defined at widget initialization\n *\n * @method _getLayerConf\n * @param {String} layerId - layer id\n * @return {Object} layerConfig - layer configuration\n * @private\n */\nLayerSwitcher.prototype._getLayerConf = function (layerId) {\n for (var i = 0; i < this._initLayers.length; ++i) {\n if (this._initLayers[i].id === layerId) {\n return this._initLayers[i].config;\n }\n }\n return null;\n};\n\n/**\n * Indicates if the layer must be displayed in the layerSwitcher\n *\n * @method _layerDisplayedInLayerSwitcher\n * @param {String} layerId - layer id\n * @return {Boolean} displayed\n * @private\n */\nLayerSwitcher.prototype._layerDisplayedInLayerSwitcher = function (layerId) {\n for (var i = 0; i < this._initLayers.length; ++i) {\n if (this._initLayers[i].id === layerId) {\n return typeof this._initLayers[i].displayed === \"undefined\" || this._initLayers[i].displayed;\n }\n }\n return true;\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nLayerSwitcher.prototype._initContainer = function (options) {\n // creation of the main container\n var container = this._createMainContainerElement();\n\n // adding in the main container\n var input = this._createMainLayersShowElement();\n container.appendChild(input);\n\n // handling of the \"collapsed\" mode\n if (!options.collapsed) {\n input.checked = \"checked\";\n }\n // adds the layer list in the main container\n var divL = this._layerListContainer = this._createMainLayersElement();\n container.appendChild(divL);\n\n // creates the draggable mode\n this._createDraggableElement(divL, this);\n\n // adds the control picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n\n // adds the info panel in the main container\n var divI = this._createMainInfoElement();\n container.appendChild(divI);\n return container;\n};\n\n/**\n * Adds control layers to control main container\n *\n * @method _addGlobeLayers\n * @param {Object} globe - the Itowns.GlobeViewExtended object\n * @private\n */\nLayerSwitcher.prototype._addGlobeLayers = function (globe) {\n // Retrieves the element which contains the different layers\n var elementLayersList;\n var childNodes = this.getElement().childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].id === this._addUID(\"GPlayersList\")) {\n elementLayersList = childNodes[i];\n break;\n }\n }\n // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array)\n var layers = globe.getColorLayers();\n var orderedLayers = layers.sort(function (a, b) {\n return b.sequence - a.sequence;\n });\n\n // loop over all the layers of the map in order to add them to the control layer list (if they are not already added)\n orderedLayers.forEach(function (layer) {\n // adds the map layers to the list\n var id;\n id = layer.id;\n if (!this._layerDisplayedInLayerSwitcher(id)) {\n return;\n }\n var layerConf = this._getLayerConf(id) || this._addedLayerConf[id] || {};\n var layerInfos = this._getLayerInfo(layer) || {};\n if (!this._layers[id]) {\n // if the layer is not yet in the layer list (this._layers), we add it\n var layerOptions = {\n title: layerConf.title || layerInfos._title || id,\n description: layerConf.description || layerInfos._description || null,\n legends: layerConf.legends || layerInfos._legends || [],\n metadata: layerConf.metadata || layerInfos._metadata || [],\n quicklookUrl: layerConf.quicklookUrl || layerInfos._quicklookUrl || null\n };\n this._layers[id] = layerOptions;\n } else {\n var lsLayerConf = this._layers[id];\n if (typeof lsLayerConf.ipr !== \"undefined\") {\n layer.options.attribution = lsLayerConf.ipr;\n }\n if (typeof lsLayerConf.opacity !== \"undefined\") {\n layer.opacity = lsLayerConf.opacity;\n }\n if (typeof lsLayerConf.visibility !== \"undefined\") {\n layer.visible = lsLayerConf.visibility;\n }\n }\n var layerDiv = this._createLayerDiv(id);\n this._layers[id].div = layerDiv;\n elementLayersList.appendChild(layerDiv);\n }, this);\n};\n\n/**\n * creates layer div (to append to control DOM element).\n *\n * @method _createLayerDiv\n * @param {String} layerId - layer id\n * @returns {DOMElement} layer div\n * @private\n */\nLayerSwitcher.prototype._createLayerDiv = function (layerId) {\n var layerOptions = this._layers[layerId];\n var isLegends = layerOptions.legends && layerOptions.legends.length !== 0;\n var isMetadata = layerOptions.metadata && layerOptions.metadata.length !== 0;\n var isQuicklookUrl = layerOptions.quicklookUrl;\n if (isLegends || isMetadata || isQuicklookUrl) {\n layerOptions.displayInformationElement = true;\n }\n\n // adds a specific div in the control for the layer\n layerOptions.id = layerId;\n var layerDiv = this._createContainerLayerElement(layerOptions);\n if (!layerOptions.inRange) {\n layerDiv.classList.add(\"outOfRange\");\n }\n return layerDiv;\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Changes layer opacity on layer opacity picto click\n *\n * @method _onChangeLayerOpacity\n * @param {Object} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onChangeLayerOpacity = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n var opacityValue = e.target.value;\n var opacityId = document.getElementById(this._addUID(\"GPopacityValue_ID_\" + layerID));\n opacityId.innerHTML = opacityValue + \"%\";\n globe.setLayerOpacity(layerID, opacityValue / 100);\n};\n\n/**\n * Updates picto opacity value on layer opacity change\n *\n * @method _updateLayerOpacity\n * @param {String} layerId - layer id\n * @param {Number} opacity - opacity value\n * @private\n */\nLayerSwitcher.prototype._updateLayerOpacity = function (layerId, opacity) {\n if (opacity > 1) {\n opacity = 1;\n }\n if (opacity < 0) {\n opacity = 0;\n }\n var layerOpacityInput = document.getElementById(this._addUID(\"GPopacityValueDiv_ID_\" + layerId));\n if (layerOpacityInput) {\n layerOpacityInput.value = Math.round(opacity * 100);\n }\n var layerOpacitySpan = document.getElementById(this._addUID(\"GPopacityValue_ID_\" + layerId));\n if (layerOpacitySpan) {\n layerOpacitySpan.innerHTML = Math.round(opacity * 100) + \"%\";\n }\n};\n\n/**\n * Changes layer visibility on layer visibility picto click\n *\n * @method _onVisibilityLayerClick\n * @param {Object} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onVisibilityLayerClick = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n globe.setLayerVisibility(layerID, e.target.checked); // update viewer\n};\n\n/**\n * Changes picto visibility on layer visibility change\n *\n * @method _updateLayerVisibility\n * @param {String} layerId - layer id\n * @param {Boolean} visibility - visible if true\n * @private\n */\nLayerSwitcher.prototype._updateLayerVisibility = function (layerId, visibility) {\n var layerVisibilityInput = document.getElementById(this._addUID(\"GPvisibility_ID_\" + layerId));\n if (layerVisibilityInput) {\n layerVisibilityInput.checked = visibility;\n }\n};\n\n/**\n * Opens layer information panel on picto click\n *\n * @method _onOpenLayerInfoClick\n * @param {Event} e - MouseEvent\n * @private\n */\nLayerSwitcher.prototype._onOpenLayerInfoClick = function (e) {\n var layerID = this._resolveLayerId(e.target.id);\n var layerOptions = this._layers[layerID];\n var panel;\n var info;\n\n // Close layer info panel\n var divId = document.getElementById(e.target.id);\n if (divId.className === \"GPlayerInfoOpened\") {\n if (divId.classList !== undefined) {\n divId.classList.remove(\"GPlayerInfoOpened\");\n divId.classList.add(\"GPlayerInfo\");\n }\n panel = document.getElementById(this._addUID(\"GPlayerInfoPanel\"));\n if (panel.classList !== undefined) {\n panel.classList.remove(\"GPpanel\");\n panel.classList.remove(\"GPlayerInfoPanelOpened\");\n panel.classList.add(\"GPlayerInfoPanelClosed\");\n }\n info = document.getElementById(this._addUID(\"GPlayerInfoContent\"));\n panel.removeChild(info);\n return;\n }\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n\n // Open layer info panel\n if (divId.classList !== undefined) {\n divId.classList.remove(\"GPlayerInfo\");\n divId.classList.add(\"GPlayerInfoOpened\");\n }\n panel = document.getElementById(this._addUID(\"GPlayerInfoPanel\"));\n if (panel.classList !== undefined) {\n panel.classList.add(\"GPpanel\");\n panel.classList.remove(\"GPlayerInfoPanelClosed\");\n panel.classList.add(\"GPlayerInfoPanelOpened\");\n }\n info = document.getElementById(this._addUID(\"GPlayerInfoContent\"));\n if (info) {\n panel.removeChild(info);\n }\n\n // on récupère les infos associées au layer pour mettre dynamiquement le contenu du panel d'informations\n var obj = {\n title: layerOptions.title,\n description: layerOptions.description,\n quicklookUrl: layerOptions.quicklookUrl,\n metadata: layerOptions.metadata,\n legends: layerOptions.legends\n };\n var infoLayer = this._createContainerLayerInfoElement(obj);\n panel.appendChild(infoLayer);\n};\n\n/**\n * removes layer from layer switcher and globe on picto click\n *\n * @method _onDropLayerClick\n * @param {Event} e - MouseEvent\n * @private\n */\nLayerSwitcher.prototype._onDropLayerClick = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n // removing the layer will trigger the event listener\n // which will call this.removeLayer and delete the div\n globe.removeLayer(layerID);\n this._updateLayerListContainer();\n};\n\n/**\n * changes layers order on drag and drop\n *\n * @method _onDropLayerClick\n * @param {Event} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onDragAndDropLayerClick = function (e) {\n var globe = this.getGlobe();\n\n // Handling of the indexes : gives the little indexes (lowest layers) to the non-visible layers (displayed: false)\n // when the index of a visible layer changes.\n // Always moves the non-visible layers under the other layers (to not hide them)\n\n if (e.newIndex - e.oldIndex === 0) {\n return;\n }\n var targetIndex = null;\n if (e.newIndex) {\n var layerTargetID = this._resolveLayerId(e.from.childNodes[e.newIndex + (e.newIndex - e.oldIndex < 0 ? 1 : -1)].id);\n targetIndex = globe.getLayerById(layerTargetID).sequence;\n } else {\n targetIndex = globe.getColorLayers().length - 1;\n }\n var layerID = this._resolveLayerId(e.item.id);\n globe.moveLayerToIndex(layerID, targetIndex);\n};\n\n/**\n * Checks layers range\n *\n * @method _inRangeUpdate\n * @param {Array} layersDisplayed - list of displayed layers id\n * @private\n */\nLayerSwitcher.prototype._inRangeUpdate = function (layersDisplayed) {\n for (var layerKey in this._layers) {\n var layer = this._layers[layerKey];\n if (!layer) {\n continue;\n }\n // Check if layer is displayed.\n var layerDiv;\n var bInRange = layersDisplayed.indexOf(layer.id) >= 0;\n if (bInRange && !layer.inRange) {\n layer.inRange = true;\n layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layer.id));\n layerDiv.classList.remove(\"outOfRange\");\n } else if (!bInRange && layer.inRange) {\n layer.inRange = false;\n layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layer.id));\n layerDiv.classList.add(\"outOfRange\");\n }\n }\n};\n\n/**\n * Update the layer list container\n *\n * @method _updateLayerListContainer\n * @private\n */\nLayerSwitcher.prototype._updateLayerListContainer = function () {\n if (this._layerListContainer) {\n var globe = this.getGlobe();\n\n // empty the previous container\n while (this._layerListContainer.firstChild) {\n this._layerListContainer.removeChild(this._layerListContainer.firstChild);\n }\n // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array)..\n var layers = globe.getColorLayers();\n var orderedLayers = layers.sort(function (a, b) {\n return b.sequence - a.sequence;\n });\n // ... and adds the correct div to the different layers, in the zindex decreasing order\n for (var j = 0; j < orderedLayers.length; j++) {\n if (!this._layers[orderedLayers[j].id]) {\n continue;\n }\n // retrieves the div of the layer, stored in the _layers array\n var layerDiv = this._layers[orderedLayers[j].id].div;\n this._layerListContainer.appendChild(layerDiv);\n }\n } else {\n logger.error(\"[Itowns.control.LayerSwitcher] _updateLayerListContainer : layer list container not found to update layers order ?!\");\n }\n};\n\n// ################################################################### //\n// ############################ Utils ################################ //\n// ################################################################### //\n\n/**\n * Gets layer informations : title, description, quicklookurl, legends, metadata\n *\n * @private\n * @memberof LayerSwitcher\n * @method _getLayerInfo\n * @param {Object} layer - the layer object\n * @returns {Object} layerInfo - layer informations\n */\nLayerSwitcher.prototype._getLayerInfo = function (layer) {\n var layerInfo = {};\n if (layer) {\n layerInfo._title = layer.title || null;\n layerInfo._description = layer.description || null;\n layerInfo._quicklookUrl = layer.quicklookUrl || null;\n layerInfo._metadata = layer.metadata || null;\n layerInfo._legends = layer.legends || null;\n }\n return layerInfo;\n};\n\n/**\n * Gets layer id from div id\n *\n * @method _resolveLayerId\n * @param {String} divId - HTML div id\n * @returns {String} layer id\n * @private\n */\nLayerSwitcher.prototype._resolveLayerId = function (divId) {\n var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].name(divId); // ex GPvisibilityPicto_ID_26\n return divName.substring(divName.indexOf(\"_ID_\") + 4); // ex. 26\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerSwitcher);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTGF5ZXJTd2l0Y2hlci5qcz82ODk1Il0sIm5hbWVzIjpbImxvZ2dlciIsIkxvZ2dlciIsImdldExvZ2dlciIsIkxheWVyU3dpdGNoZXIiLCJsc09wdGlvbnMiLCJvcHRpb25zIiwibGF5ZXJzIiwiVHlwZUVycm9yIiwiQXJyYXkiLCJpc0FycmF5IiwiRXJyb3IiLCJfdHlwZW9mIiwiX2luaXRpYWxpemUiLCJjb250YWluZXIiLCJfaW5pdENvbnRhaW5lciIsIl9hZGRlZExheWVyQ29uZiIsIldpZGdldCIsImNhbGwiLCJuYW1lIiwiZWxlbWVudCIsInRhcmdldCIsInBvc2l0aW9uIiwicHJvdG90eXBlIiwiT2JqZWN0IiwiY3JlYXRlIiwiVXRpbHMiLCJhc3NpZ24iLCJMYXllclN3aXRjaGVyRE9NIiwiY29uc3RydWN0b3IiLCJzZXRHbG9iZSIsImdsb2JlIiwic2VsZiIsImkiLCJfaW5pdExheWVycyIsImxlbmd0aCIsImxheWVyIiwiaWQiLCJnZXRMYXllckJ5SWQiLCJkaXNwbGF5ZWQiLCJjb25mIiwiY29uZmlnIiwibGF5ZXJPcHRpb25zIiwidGl0bGUiLCJkZXNjcmlwdGlvbiIsImxlZ2VuZHMiLCJtZXRhZGF0YSIsInF1aWNrbG9va1VybCIsImlwciIsIm9wYWNpdHkiLCJ2aXNpYmlsaXR5IiwiX2xheWVycyIsIl9hZGRHbG9iZUxheWVycyIsIl9jYWxsYmFja3MiLCJ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CxcbiAgICAgICAgICAgICAgICAgICAgbGVnZW5kcyA6IGNvbmYubGVnZW5kcyB8fCBbXSxcbiAgICAgICAgICAgICAgICAgICAgbWV0YWRhdGEgOiBjb25mLm1ldGFkYXRhIHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBjb25mLnF1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvbmYuaXByICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyT3B0aW9ucy5pcHIgPSBjb25mLmlwcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb25mLm9wYWNpdHkgIT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgbGF5ZXJPcHRpb25zLm9wYWNpdHkgPSBjb25mLm9wYWNpdHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY29uZi52aXNpYmlsaXR5ICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyT3B0aW9ucy52aXNpYmlsaXR5ID0gY29uZi52aXNpYmlsaXR5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9sYXllcnNbbGF5ZXIuaWRdID0gbGF5ZXJPcHRpb25zO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gYWRkcyB0aGUgbGF5ZXJzXG4gICAgICAgIHRoaXMuX2FkZEdsb2JlTGF5ZXJzKGdsb2JlKTtcblxuICAgICAgICAvLyBhZGRpbmcgb2YgbGlzdGVuZXJzXG4gICAgICAgIHRoaXMuX2NhbGxiYWNrcy5vbk9wYWNpdHlMYXllckNhbGxCYWNrID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAg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pZiAoIXNlbGYuX2xheWVyRGlzcGxheWVkSW5MYXllclN3aXRjaGVyKGlkKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBsYXllciA9IHNlbGYuZ2V0R2xvYmUoKS5nZXRMYXllckJ5SWQoaWQpO1xuICAgICAgICAgICAgICAgIGlmIChsYXllci50eXBlID09PSBcImVsZXZhdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGxheWVyQ29uZiA9IHNlbGYuX2dldExheWVyQ29uZihpZCkgfHwgc2VsZi5fYWRkZWRMYXllckNvbmZbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChsYXllckNvbmYpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5hZGRMYXllcihsYXllciwgbGF5ZXJDb25mKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZExheWVyKGxheWVyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGdsb2JlLmxpc3RlbihHbG9iZVZpZXdFeHRlbmRlZC5FVkVOVFMuTEFZRVJfQURERUQsIHRoaXMuX2NhbGxiYWNrcy5vbkFkZGVkTGF5ZXJDYWxsQmFjayk7XG5cbiAgICAgICAgdGhpcy5fY2FsbGJhY2tzLm9uUmVtb3ZlZExheWVyQ2FsbEJhY2sgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgdmFyIGlkID0gZS5sYXllcklkO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGluZGV4IG1heCBhbmQgZGVsZXRlIHRoZSBsYXllciBmcm9tIHRoZSBsYXllcnN3aXRjaGVyXG4gICAgICAgICAgICBpZiAoc2VsZikge1xuICAgICAgICAgICAgICAgIHNlbGYucmVtb3ZlTGF5ZXIoaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBnbG9iZS5saXN0ZW4oR2xvYmVWaWV3RXh0ZW5kZWQuRVZFTlRTLkxBWUVSX1JFTU9WRUQsIHRoaXMuX2NhbGxiYWNrcy5vblJlbW92ZWRMYXllckNhbGxCYWNrKTtcblxuICAgICAgICB0aGlzLl9jYWxsYmFja3Mub25JbmRleExheWVyQ2FsbEJhY2sgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgdmFyIGFycmF5c0VxdWFscyA9IGZ1bmN0aW9uIChhMSwgYTIpIHtcbiAgICAgICAgICAgICAgICBpZiAoYTEubGVuZ3RoICE9PSBhMi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGExLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhMVtpXSAhPT0gYTJbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGlmICghYXJyYXlzRXF1YWxzKGUubmV3LnNlcXVlbmNlLCBlLnByZXZpb3VzLnNlcXVlbmNlKSkge1xuICAgICAgICAgICAgICAgIHNlbGYuX3VwZGF0ZUxheWVyTGlzdENvbnRhaW5lcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBnbG9iZS5saXN0ZW4oR2xvYmVWaWV3RXh0ZW5kZWQuRVZFTlRTLkxBWUVSU19PUkRFUl9DSEFOR0VELCB0aGlzLl9jYWxsYmFja3Mub25JbmRleExheWVyQ2FsbEJhY2spO1xuXG4gICA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pcHRpb24gfHwgbGF5ZXJJbmZvcy5fZGVzY3JpcHRpb24gfHwgbnVsbCxcbiAgICAgICAgICAgIGxlZ2VuZHMgOiBjb25maWcubGVnZW5kcyB8fCBsYXllckluZm9zLl9sZWdlbmRzIHx8IFtdLFxuICAgICAgICAgICAgbWV0YWRhdGEgOiBjb25maWcubWV0YWRhdGEgfHwgbGF5ZXJJbmZvcy5fbWV0YWRhdGEgfHwgW10sXG4gICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBjb25maWcucXVpY2tsb29rVXJsIHx8IGxheWVySW5mb3MuX3F1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgY29uZmlnLmlwciAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgbGF5ZXJPcHRpb25zLmlwciA9IGNvbmZpZy5pcHI7XG4gICAgICAgICAgICBsYXllci5hdHRyaWJ1dGlvbiA9IGxheWVyT3B0aW9ucy5pcHI7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBjb25maWcub3BhY2l0eSAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgbGF5ZXJPcHRpb25zLm9wYWNpdHkgPSBjb25maWcub3BhY2l0eTtcbiAgICAgICAgICAgIGxheWVyLm9wYWNpdHkgPSBsYXllck9wdGlvbnMub3BhY2l0eTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvbmZpZy52aXNpYmlsaXR5ICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICBsYXllck9wdGlvbnMudmlzaWJpbGl0eSA9IGNvbmZpZy52aXNpYmlsaXR5O1xuICAgICAgICAgICAgbGF5ZXIudmlzaWJsZSA9IGxheWVyT3B0aW9ucy52aXNpYmlsaXR5O1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuX2xheWVyc1tpZF0gPSBsYXllck9wdGlvbnM7XG5cbiAgICAgICAgLy8gY3JlY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zLl9sYXllcnMpLCB3ZSBhZGQgaXRcbiAgICAgICAgICAgICAgICB2YXIgbGF5ZXJPcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICB0aXRsZSA6IGxheWVyQ29uZi50aXRsZSB8fCBsYXllckluZm9zLl90aXRsZSB8fCBpZCxcbiAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRpb24gOiBsYXllckNvbmYuZGVzY3JpcHRpb24gfHwgbGF5ZXJJbmZvcy5fZGVzY3JpcHRpb24gfHwgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbGVnZW5kcyA6IGxheWVyQ29uZi5sZWdlbmRzIHx8IGxheWVySW5mb3MuX2xlZ2VuZHMgfHwgW10sXG4gICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhIDogbGF5ZXJDb25mLm1ldGFkYXRhIHx8IGxheWVySW5mb3MuX21ldGFkYXRhIHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBsYXllckNvbmYucXVpY2tsb29rVXJsIHx8IGxheWVySW5mb3MuX3F1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB0aGlzLl9sYXllcnNbaWRdID0gbGF5ZXJPcHRpb25zO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgbHNMYXllckNvbmYgPSB0aGlzLl9sYXllcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbHNMYXllckNvbmYuaXByICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyLm9wdGlvbnMuYXR0cmlidXRpb24gPSBsc0xheWVyQ29uZi5pcHI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbHNMYXllckNvbmYub3BhY2l0eSAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgICAgICAgICBs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bGUgfHwgbnVsbDtcbiAgICAgICAgbGF5ZXJJbmZvLl9kZXNjcmlwdGlvbiA9IGxheWVyLmRlc2NyaXB0aW9uIHx8IG51bGw7XG4gICAgICAgIGxheWVySW5mby5fcXVpY2tsb29rVXJsID0gbGF5ZXIucXVpY2tsb29rVXJsIHx8IG51bGw7XG4gICAgICAgIGxheWVySW5mby5fbWV0YWRhdGEgPSBsYXllci5tZXRhZGF0YSB8fCBudWxsO1xuICAgICAgICBsYXllckluZm8uX2xlZ2VuZHMgPSBsYXllci5sZWdlbmRzIHx8IG51bGw7XG4gICAgfVxuICAgIHJldHVybiBsYXllckluZm87XG59O1xuXG4vKipcbiAqIEdldHMgbGF5ZXIgaWQgZnJvbSBkaXYgaWRcbiAqXG4gKiBAbWV0aG9kIF9yZXNvbHZlTGF5ZXJJZFxuICogQHBhcmFtIHtTdHJpbmd9IGRpdklkIC0gSFRNTCBkaXYgaWRcbiAqIEByZXR1cm5zIHtTdHJpbmd9IGxheWVyIGlkXG4gKiBAcHJpdmF0ZVxuICovXG5MYXllclN3aXRjaGVyLnByb3RvdHlwZS5fcmVzb2x2ZUxheWVySWQgPSBmdW5jdGlvbiAoZGl2SWQpIHtcbiAgICB2YXIgZGl2TmFtZSA9IFNlbGVjdG9ySUQubmFtZShkaXZJZCk7IC8vIGV4IEdQdmlzaWJpbGl0eVBpY3RvX0lEXzI2XG4gICAgcmV0dXJuIGRpdk5hbWUuc3Vic3RyaW5nKGRpdk5hbWUuaW5kZXhPZihcIl9JRF9cIikgKyA0KTsgLy8gZXguIDI2XG59O1xuXG5leHBvcnQgZGVmYXVsdCBMYXllclN3aXRjaGVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/LayerSwitcher.js\n"); /***/ }), @@ -1451,7 +1463,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Glo /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/MiniGlobeDOM */ \"./src/Common/Controls/MiniGlobeDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display the MiniGlobe with itowns\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.MiniGlobe\n * @param {Object} [options] - control options\n * @param {Object} [options.layer] - custom itowns layer to display on the mini globe\n * @example\n * var miniglobe = new itowns.control.MiniGlobe();\n *\n */\nfunction MiniGlobe(options) {\n options = options || {};\n if (!(this instanceof MiniGlobe)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer();\n this._options = options;\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"Overview\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:MiniGlobe\n */\nMiniGlobe.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class MiniGlobeDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(MiniGlobe.prototype, _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nMiniGlobe.prototype.constructor = MiniGlobe;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nMiniGlobe.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var minDistance = 6650000;\n var maxDistance = 30000000;\n var positionOnGlobe = globe.getCenter();\n var miniView = new _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._element, positionOnGlobe, {\n // `limit globe' subdivision level:\n // we're don't need a precise globe model\n // since the mini globe will always be seen from a far point of view (see minDistance above)\n maxSubdivisionLevel: 6,\n sseSubdivisionThreshold: 3,\n // Don't instance default controls since miniview's camera will be synced\n // on the main view's one (see globeView.onAfterRender)\n noControls: true\n });\n miniView.setBackground();\n var updateMiniGlobeHandler = function updateMiniGlobeHandler() {\n // clamp distance camera from globe\n var distanceCamera = globe.getGlobeView().camera.camera3D.position.length();\n var distance = Math.min(Math.max(distanceCamera, minDistance), maxDistance);\n var camera = miniView.getGlobeView().camera.camera3D;\n var cameraTargetPosition = globe.getGlobeView().controls.getCameraTargetPosition();\n // Update target miniview's camera\n camera.position.copy(cameraTargetPosition).setLength(distance);\n camera.lookAt(cameraTargetPosition);\n miniView.notifyChange(camera);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.AFTER_RENDER, updateMiniGlobeHandler);\n if (globe.isInitialized()) {\n updateMiniGlobeHandler();\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, updateMiniGlobeHandler);\n }\n\n /**\n * Add one imagery layer to the miniview (by default, the ortho)\n */\n var miniGlobeLayer = this._options.layer;\n miniView.addLayer(miniGlobeLayer);\n // save as property of the control the globe created for the overview\n this._globeObj = miniView;\n } else if (globe == null) {\n // if globe == null we remove the overview control\n // we delete the overview control DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize MiniGlobe control (called by constructor)\n *\n * @private\n */\nMiniGlobe.prototype._initialize = function () {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._MiniGlobeContainer = null;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @returns {DOMElement} container - widget container\n * @private\n */\nMiniGlobe.prototype._initContainer = function () {\n var container = this._createMainContainerElement();\n return container;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MiniGlobe);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTWluaUdsb2JlLmpzP2UxNTIiXSwibmFtZXMiOlsiTWluaUdsb2JlIiwib3B0aW9ucyIsIlR5cGVFcnJvciIsIl90eXBlb2YiLCJFcnJvciIsIl9pb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6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/MiniGlobe.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/MiniGlobeDOM */ \"./src/Common/Controls/MiniGlobeDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display the MiniGlobe with itowns\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.MiniGlobe\n * @param {Object} [options] - control options\n * @param {Object} [options.layer] - custom itowns layer to display on the mini globe\n * @example\n * var miniglobe = new itowns.control.MiniGlobe();\n *\n */\nfunction MiniGlobe(options) {\n options = options || {};\n if (!(this instanceof MiniGlobe)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer();\n this._options = options;\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"Overview\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:MiniGlobe\n */\nMiniGlobe.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class MiniGlobeDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(MiniGlobe.prototype, _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nMiniGlobe.prototype.constructor = MiniGlobe;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nMiniGlobe.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var minDistance = 6650000;\n var maxDistance = 30000000;\n var positionOnGlobe = globe.getCenter();\n var miniView = new _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._element, positionOnGlobe, {\n // `limit globe' subdivision level:\n // we're don't need a precise globe model\n // since the mini globe will always be seen from a far point of view (see minDistance above)\n maxSubdivisionLevel: 6,\n sseSubdivisionThreshold: 3,\n // Don't instance default controls since miniview's camera will be synced\n // on the main view's one (see globeView.onAfterRender)\n noControls: true\n });\n miniView.setBackground();\n var updateMiniGlobeHandler = function updateMiniGlobeHandler() {\n // clamp distance camera from globe\n var distanceCamera = globe.getGlobeView().camera.camera3D.position.length();\n var distance = Math.min(Math.max(distanceCamera, minDistance), maxDistance);\n var camera = miniView.getGlobeView().camera.camera3D;\n var cameraTargetPosition = globe.getGlobeView().controls.getCameraTargetPosition();\n // Update target miniview's camera\n camera.position.copy(cameraTargetPosition).setLength(distance);\n camera.lookAt(cameraTargetPosition);\n miniView.notifyChange(camera);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.AFTER_RENDER, updateMiniGlobeHandler);\n if (globe.isInitialized()) {\n updateMiniGlobeHandler();\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, updateMiniGlobeHandler);\n }\n\n /**\n * Add one imagery layer to the miniview (by default, the ortho)\n */\n var miniGlobeLayer = this._options.layer;\n miniView.addLayer(miniGlobeLayer);\n // save as property of the control the globe created for the overview\n this._globeObj = miniView;\n } else if (globe == null) {\n // if globe == null we remove the overview control\n // we delete the overview control DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize MiniGlobe control (called by constructor)\n *\n * @private\n */\nMiniGlobe.prototype._initialize = function () {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._MiniGlobeContainer = null;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @returns {DOMElement} container - widget container\n * @private\n */\nMiniGlobe.prototype._initContainer = function () {\n var container = this._createMainContainerElement();\n return container;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MiniGlobe);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTWluaUdsb2JlLmpzP2UxNTIiXSwibmFtZXMiOlsiTWluaUdsb2JlIiwib3B0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BvcnQgZGVmYXVsdCBNaW5pR2xvYmU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/MiniGlobe.js\n"); /***/ }), @@ -1463,7 +1475,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Glo /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! proj4 */ \"./node_modules/proj4/dist/proj4-src.js-exposed\");\n/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(proj4__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Common/Controls/MousePositionDOM */ \"./src/Common/Controls/MousePositionDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\n/* harmony import */ var _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Utils/PositionFormater */ \"./src/Itowns/Controls/Utils/PositionFormater.js\");\n/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../CRS/CRS */ \"./src/Itowns/CRS/CRS.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"MousePosition\");\n\n/**\n * @classdesc\n *\n * MousePosition Control.\n *\n * @constructor\n * @alias itowns.control.MousePosition\n * @extends {itowns.control.Control}\n * @param {Object} options - options for function call.\n * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol)\n * @param {Boolean} [options.collapsed = true] - Specify if MousePosition control should be collapsed at startup. Default is true.\n * @param {Array} [options.systems] - list of projection systems, default are Geographical (\"EPSG:4326\"), Web Mercator (\"EPSG:3857\"), Lambert 93 (\"EPSG:2154\") and extended Lambert 2 (\"EPSG:27572\").\n * Each array element (=system) is an object with following properties :\n * @param {String} options.systems.crs - Proj4 crs alias (from proj4 defs). e.g. : \"EPSG:4326\". Required\n * @param {String} [options.systems.label] - CRS label to be displayed in control. Default is crs code (e.g. \"EPSG:4326\")\n * @param {String} options.systems.type - CRS units type for coordinates conversion : \"Geographical\" or \"Metric\". Default: \"Metric\"\n * @param {Object} [options.systems.geoBBox] - Aera covered by the system (WGS84 coordinates).\n * @param {Number} options.systems.geoBBox.right - Right bound.\n * @param {Number} options.systems.geoBBox.left - Left bound.\n * @param {Number} options.systems.geoBBox.top - Top bound.\n * @param {Number} options.systems.geoBBox.bottom - Bottom bound.\n * @param {Array} [options.units] - list of coordinates units, to be displayed in control units list.\n * Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal), \"RAD\" (radians) and \"GON\" (grades) for geographical coordinates,\n * and \"M\" or \"KM\" for metric coordinates\n * @param {Array} [options.displayAltitude = true] - activate (true) or deactivate (false) the altitude panel. True by default\n * @param {Array} [options.displayCoordinates = true] - activate (true) or deactivate (false) the coordinates panel. True by default\n * @param {Object} [options.altitude] - elevation configuration\n * @param {Object} [options.altitude.serviceOptions] - options of elevation service\n * @param {Number} [options.altitude.responseDelay] - latency for altitude request, 500 ms by default\n * @param {Number} [options.altitude.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default\n * @example\n * var mousePosition = new itowns.control.MousePosition({\n * collapsed : false,\n * displayCoordinates : true,\n * displayAltitude : true,\n * altitude : {\n * triggerDelay : 100,\n * responseDelay : 500,\n * serviceOptions : {}\n * },\n * systems : [\n * {\n * crs : \"EPSG:3857\",\n * label : \"Mercator\",\n * type : \"Metric\"\n * },\n * {\n * crs : \"EPSG:32620\",\n * label : \"UTM 20N (Guadeloupe, Martinique)\",\n * type : \"Metric\",\n * geoBBox : {\n * left: -66.00,\n * bottom : 0.00,\n * right : -60.00,\n * top : 84.00\n * }\n * }\n * ],\n * units : [\"DEC\", \"DMS\"]\n * });\n */\nfunction MousePosition(options) {\n options = options || {};\n if (!(this instanceof MousePosition)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options);\n this._callbacks = {};\n\n // init control DOM container\n var container = this._initContainer(options);\n _Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].call(this, {\n name: \"MousePosition\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n;\n\n/**\n * @lends module:MousePosition\n */\nMousePosition.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].prototype, {});\n_Common_Utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].assign(MousePosition.prototype, _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n\n/**\n * Constructor (alias)\n */\nMousePosition.prototype.constructor = MousePosition;\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nMousePosition.prototype.setGlobe = function (globe) {\n if (globe) {\n // In the case of the adding of a control to the globe\n this._centerElement = this._createMapCenter();\n globe.getTargetElement().appendChild(this._centerElement);\n\n // defines the callback on the map to retrieve the coordinates\n this._callbacks.mouseMove = this.onMouseMove.bind(this);\n\n // valid event for desktop mode\n if (!this.collapsed) {\n if (this._isDesktop) {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n }\n } else if (globe == null) {\n // if globe == null we remove the MP control\n // deletes the listener associated to the mousePosition control\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n // deletes the mousePosition control DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n this._globe.getTargetElement().removeChild(this._centerElement);\n }\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// #################### user interface methods ####################### //\n// ################################################################### //\n\n/**\n * Sets additional projection system\n *\n * @param {Object} system - Projection system defined in the Itowns/CRS/CRS.js class\n * @param {String} system.crs - Proj4 crs alias (from proj4 defs) e.g. \"EPSG:4326\"\n * @param {String} [system.label] - CRS label to be displayed in control. Default is system.crs alias\n * @param {String} [system.type] - CRS units type for coordinates conversion (one of control options.units). Default is \"Metric\"\n */\nMousePosition.prototype.addSystem = function (system) {\n if (_typeof(system) !== \"object\") {\n logger.error(\"MousePosition:addSystem - system parameter should be an object\");\n return;\n }\n if (!system.crs) {\n logger.error(\"crs not defined !\");\n return;\n }\n if (!system.label) {\n logger.warn(\"crs label not defined, use crs code by default.\");\n system.label = system.crs;\n }\n if (!system.type) {\n logger.warn(\"type srs not defined, use 'Metric' by default.\");\n system.type = \"Metric\";\n }\n\n // 1. adds system to control systems\n for (var j = 0; j < this._projectionSystems.length; j++) {\n var obj = this._projectionSystems[j];\n if (system.crs === obj.crs) {\n // warn user\n logger.warn(\"crs '{}' already configured\", obj.crs);\n }\n }\n system.code = this._projectionSystems.length;\n this._projectionSystems.push(system);\n\n // 2. adds system settings option to container (if it was already build)\n var selectSystem = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n if (selectSystem) {\n var option = document.createElement(\"option\");\n option.value = system.code;\n option.text = system.label;\n selectSystem.appendChild(option);\n }\n};\n\n/**\n * Sets additional projection systems\n *\n * @param {Array} systems - Array of system object, with following properties :\n * @param {String} systems.crs - Proj4 CRS alias (from proj4 defs) e.g. \"EPSG:4326\"\n * @param {String} systems.label - CRS label (for coordinates conversion)\n * @param {String} systems.type - CRS units type to be displayed in control (one of control options.units). Default is \"Metric\"\n */\nMousePosition.prototype.addSystems = function (systems) {\n if (!systems) {\n return;\n }\n if (!Array.isArray(systems)) {\n logger.error(\"MousePosition:addSystems - systems parameter should be an array\");\n return;\n }\n for (var i = 0; i < systems.length; i++) {\n this.addSystem(systems[i]);\n }\n};\n\n/**\n * Removes projection system (in case there are several system with same code, only the first one will be removed)\n *\n * @param {String} systemCrs - CRS alias (from proj4 defs)\n */\nMousePosition.prototype.removeSystem = function (systemCrs) {\n if (!systemCrs || typeof systemCrs !== \"string\") {\n logger.error(\"MousePosition:removeSystem - systemCode parameter should be a string\");\n return;\n }\n var systemCode = null;\n // finds system in control projection systems list\n for (var i = 0; i < this._projectionSystems.length; i++) {\n var proj = this._projectionSystems[i];\n if (systemCrs === proj.crs) {\n systemCode = proj.code;\n // removes system from control projection systems list\n this._projectionSystems.splice(i, 1);\n break;\n }\n }\n if (systemCode == null) {\n logger.warn(\"MousePosition:removeSystem - system not found\");\n return;\n }\n\n // re-initialization of codes\n var oldNewCodeGlobe = [];\n for (var ii = 0; ii < this._projectionSystems.length; ii++) {\n oldNewCodeGlobe[Number(this._projectionSystems[ii].code)] = ii;\n this._projectionSystems[ii].code = ii;\n }\n\n // finds system in control container systems list\n var indexChildToRemove = null;\n var systemList = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n for (var j = 0; j < systemList.childNodes.length; j++) {\n if (systemCode === systemList.childNodes[j].value) {\n indexChildToRemove = j;\n continue;\n }\n systemList.childNodes[j].value = oldNewCodeGlobe[Number(systemList.childNodes[j].value)];\n }\n // removes system from control container systems list\n if (indexChildToRemove != null) {\n systemList.removeChild(systemList.childNodes[indexChildToRemove]);\n }\n\n // choose arbitrarily a new current system if needed\n if (this._currentProjectionSystems.code === systemCode) {\n systemList.childNodes[0].setAttribute(\"selected\", \"selected\");\n this._setCurrentSystem(systemList.childNodes[0].value);\n }\n};\n\n/**\n * Sets control units (to be displayed)\n *\n * @param {Array} units - list of all coordinates units, to be displayed in control units list.\n * Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal), \"RAD\" (radians) and \"GON\" (grades) for geographical coordinates,\n * and \"M\" or \"KM\" for metric coordinates\n */\nMousePosition.prototype.setUnits = function (units) {\n if (!units || !Array.isArray(units)) {\n return;\n }\n this.options.units = units;\n this._projectionUnits = {};\n this._initProjectionUnits();\n if (this._currentProjectionType) {\n this._setTypeUnitsPanel(this._currentProjectionType);\n }\n};\n\n/**\n * Sets control altitude options (useless if displayAltitude == false)\n *\n * @param {Object} options - altitude options\n * @param {Object} [options.serviceOptions] - options of elevation service\n * @param {Number} [options.responseDelay] - latency for elevation request, 500 ms by default\n * @param {Number} [options.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default\n */\nMousePosition.prototype.setAltitudeOptions = function (options) {\n if (!options || _typeof(options) !== \"object\") {\n return;\n }\n this.options.altitude.triggerDelay = options.triggerDelay;\n this.options.altitude.responseDelay = options.responseDelay;\n if (options.serviceOptions) {\n for (var opt in options.serviceOptions) {\n if (options.serviceOptions.hasOwnProperty(opt)) {\n this.options.altitude.serviceOptions[opt] = options.serviceOptions[opt];\n }\n }\n }\n};\n\n/**\n * Displays or hides elevation panel\n *\n * @param {Boolean} displayAltitude - true to display elevation panel, false to hide it\n */\nMousePosition.prototype.displayAltitude = function (displayAltitude) {\n if (displayAltitude === undefined) {\n return;\n }\n this.options.displayAltitude = displayAltitude;\n this._setElevationPanel(displayAltitude);\n};\n\n/**\n * Displays or hides coordinates panel\n *\n * @param {Boolean} displayCoordinates - true to display coordinates panel, false to hide it\n */\nMousePosition.prototype.displayCoordinates = function (displayCoordinates) {\n if (displayCoordinates === undefined) {\n return;\n }\n this.options.displayCoordinates = displayCoordinates;\n this._setCoordinatesPanel(displayCoordinates);\n this._setSettingsPanel(displayCoordinates);\n};\n\n/**\n * Collapses or displays control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nMousePosition.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"MousePosition:setCollapsed - missing collapsed parameter\");\n return;\n }\n if (collapsed && this.collapsed || !collapsed && !this.collapsed) {\n return;\n }\n if (!this._isDesktop) {\n document.getElementById(this._addUID(\"GPmapCenter\")).className = collapsed ? \"\" : \"GPmapCenterVisible\";\n }\n // simulates the opening of the panel after a click\n this.onShowMousePositionClick();\n this._showMousePositionContainer.checked = !collapsed;\n};\n\n// ################################################################### //\n// ######################## initialize control ####################### //\n// ################################################################### //\n\n/**\n * Initializes control (called by MousePosition constructor)\n *\n * @method _initialize\n * @param {Object} options - control options (set by user)\n * @private\n */\nMousePosition.prototype._initialize = function (options) {\n // Set default options\n // {Object} control options - set by user or by default\n this.options = options || {};\n this.options.collapsed = options.collapsed !== undefined ? options.collapsed : true;\n /** {Boolean} specify if MousePosition control is collapsed (true) or not (false) */\n this.collapsed = this.options.collapsed;\n this.options.units = options.units || [];\n this.options.displayAltitude = options.displayAltitude !== undefined ? options.displayAltitude : true;\n this.options.displayCoordinates = options.displayCoordinates !== undefined ? options.displayCoordinates : true;\n this.options.systems = options.systems || [];\n if (options.altitude) {\n var altitude = options.altitude;\n this.options.altitude = {\n triggerDelay: altitude.triggerDelay !== undefined ? altitude.triggerDelay : 200,\n responseDelay: altitude.responseDelay !== undefined ? altitude.responseDelay : 500,\n serviceOptions: altitude.serviceOptions || {},\n noDataValue: altitude.noDataValue !== undefined ? altitude.noDataValue : -99999,\n noDataValueTolerance: altitude.noDataValueTolerance !== undefined ? altitude.noDataValueTolerance : 90000\n };\n // on surcharge l'outputFormat pour du json si non spécifié par utilisateur\n this.options.altitude.serviceOptions.outputFormat = altitude.serviceOptions && altitude.serviceOptions.outputFormat ? altitude.serviceOptions.outputFormat : \"json\";\n } else {\n this.options.altitude = {\n triggerDelay: 200,\n responseDelay: 500,\n serviceOptions: {\n outputFormat: \"json\"\n }\n };\n }\n\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__[\"default\"].generate();\n\n // initialization of the projections systems\n this._projectionSystems = [];\n this._initProjectionSystems();\n\n // initialization of the units systems\n this._projectionUnits = {};\n this._initProjectionUnits();\n\n // support detect : desktop or tactile\n this._isDesktop = _Common_Utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].detectSupport();\n\n // implements a timer threshold\n if (this.options.altitude.triggerDelay < 100) {\n this.options.altitude.triggerDelay = 100;\n }\n\n // {Number} timer on movestopped delay (altitude calculation)\n this._timer = this.options.altitude.triggerDelay;\n\n // {Object} Selected projection system\n this._currentProjectionSystems = this._projectionSystems[0];\n\n // {String} Selected projection units typs : Geographical or metric\n this._currentProjectionType = this._projectionSystems[0].type;\n\n // {String} Selected projection unit\n this._currentProjectionUnits = this._projectionUnits[this._currentProjectionType][0].code;\n\n // {Object} Projection units container (DOM Element)\n this._projectionUnitsContainer = null;\n\n // {Object} control panel container (DOM Element)\n this._showMousePositionContainer = null;\n\n // management of the altitude panel display\n if (!this.options.displayAltitude && !this.options.displayCoordinates) {\n // reactivate the display of coordinates, to not display an empty panel\n this.options.displayCoordinates = true;\n }\n};\n\n/**\n * this method is called by the constructor and initialize the projection\n * systems.\n * getting coordinates in the requested projection :\n * see this.onMousePositionProjectionSystemChange()\n *\n * @method _initProjectionSystems\n * @private\n */\nMousePosition.prototype._initProjectionSystems = function () {\n // user has the possibility to modify the list of systems to display\n // Ex. this.options.systems\n\n // available projection systems vy default\n var projectionSystemsByDefault = [{\n label: \"Géographique\",\n crs: \"EPSG:4326\",\n type: \"Geographical\"\n }, {\n label: \"Mercator\",\n crs: \"EPSG:3857\",\n type: \"Metric\"\n }, {\n label: \"Lambert 93\",\n crs: \"EPSG:2154\",\n type: \"Metric\",\n geoBBox: {\n left: -9.86,\n bottom: 41.15,\n right: 10.38,\n top: 51.56\n }\n }, {\n label: \"Lambert II étendu\",\n crs: \"EPSG:27572\",\n type: \"Metric\",\n geoBBox: {\n left: -4.87,\n bottom: 42.33,\n right: 8.23,\n top: 51.14\n }\n }];\n var systems = this.options.systems;\n for (var i = 0; i < systems.length; i++) {\n // definition of a reference system\n var sys = systems[i];\n this.addSystem(sys);\n }\n if (this._projectionSystems.length === 0) {\n // we add the default projection systems\n for (var ii = 0; ii < projectionSystemsByDefault.length; ii++) {\n this.addSystem(projectionSystemsByDefault[ii]);\n }\n }\n};\n\n/**\n * this method is called by the constructor and initialize the units.\n * getting coordinates in the requested units :\n * see this.onMousePositionProjectionUnitsChange()\n *\n * @method _initProjectionUnits\n * @private\n */\nMousePosition.prototype._initProjectionUnits = function () {\n // user has the possibility to modify the list of units to display\n // Ex.\n // this.options.units : [\"DEC\", \"DMS\"]\n\n // available units systems by default\n var projectionUnitsByDefault = {\n Geographical: [{\n code: \"DEC\",\n label: \"degrés décimaux\",\n convert: this._displayDEC\n }, {\n code: \"DMS\",\n label: \"degrés sexagésimaux\",\n convert: this._displayDMS\n }, {\n code: \"RAD\",\n label: \"radians\",\n convert: this._displayRAD\n }, {\n code: \"GON\",\n label: \"grades\",\n convert: this._displayGON\n }],\n Metric: [{\n code: \"M\",\n label: \"mètres\",\n convert: this._displayMeter\n }, {\n code: \"KM\",\n label: \"kilomètres\",\n convert: this._displayKMeter\n }]\n };\n var units = this.options.units;\n for (var type in projectionUnitsByDefault) {\n if (projectionUnitsByDefault.hasOwnProperty(type)) {\n var found = false;\n for (var j = 0; j < projectionUnitsByDefault[type].length; j++) {\n var obj = projectionUnitsByDefault[type][j];\n for (var i = 0; i < units.length; i++) {\n var unit = units[i];\n if (obj.code === unit) {\n found = true;\n if (!this._projectionUnits[type]) {\n this._projectionUnits[type] = [];\n }\n this._projectionUnits[type].push(obj);\n }\n }\n }\n if (!found) {\n this._projectionUnits[type] = projectionUnitsByDefault[type];\n }\n }\n }\n\n // in case of...\n if (_typeof(this._projectionUnits) === \"object\" && Object.keys(this._projectionUnits).length === 0) {\n this._projectionUnits = projectionUnitsByDefault;\n }\n};\n\n// ################################################################### //\n// ######################## methods handle dom ####################### //\n// ################################################################### //\n\n/**\n * Create control main container (called by MousePosition constructor)\n *\n * @method _initContainer\n * @param {Object} options - options\n * @param {Boolean} options.collapsed - Specify if MousePosition control should be collapsed\n * @param {Array} options.displayAltitude - activate (true) or deactivate (false) the altitude panel\n * @param {Array} options.displayCoordinates - activate (true) or deactivate (false) the coordinates panel\n * @returns {DOMElement} container - widget container\n * @private\n */\nMousePosition.prototype._initContainer = function (options) {\n // creates the main container\n var container = this._createMainContainerElement();\n var inputShow = this._showMousePositionContainer = this._createShowMousePositionElement();\n if (!options.collapsed) {\n inputShow.checked = \"checked\";\n }\n container.appendChild(inputShow);\n var picto = this._createShowMousePositionPictoElement(this._isDesktop);\n container.appendChild(picto);\n var panel = this._createMousePositionPanelElement();\n var header = this._createMousePositionPanelHeaderElement();\n panel.appendChild(header);\n var basic = this._createMousePositionPanelBasicElement(options.displayAltitude, options.displayCoordinates);\n panel.appendChild(basic);\n var arraySettings = this._createShowMousePositionSettingsElement(options.displayCoordinates);\n for (var j = 0; j < arraySettings.length; j++) {\n panel.appendChild(arraySettings[j]);\n }\n var settings = this._createMousePositionSettingsElement(options.displayCoordinates);\n var systems = this._projectionSystemsContainer = this._createMousePositionSettingsSystemsElement(this._projectionSystems);\n var units = this._projectionUnitsContainer = this._createMousePositionSettingsUnitsElement(this._projectionUnits[this._currentProjectionType]);\n settings.appendChild(systems);\n settings.appendChild(units);\n panel.appendChild(settings);\n container.appendChild(panel);\n return container;\n};\n\n/**\n * this method is called by this.()\n * and it changes the elevation view panel into the dom.\n *\n * @method _setElevationPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setElevationPanel = function (active) {\n var div = null;\n if (!active) {\n div = document.getElementById(\"GPmousePositionAltitude-\" + this._uid);\n div.style.display = \"none\";\n } else {\n div = document.getElementById(\"GPmousePositionAltitude-\" + this._uid);\n div.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.()\n * and it changes the coordinate view panel into the dom.\n *\n * @method _setCoordinatesPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setCoordinatesPanel = function (active) {\n var div = document.getElementById(\"GPmousePositionCoordinate-\" + this._uid);\n if (!active) {\n div.style.display = \"none\";\n } else {\n div.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.()\n * and it changes the settings view panel into the dom.\n *\n * @method _setSettingsPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setSettingsPanel = function (active) {\n var divPicto = document.getElementById(\"GPshowMousePositionSettingsPicto-\" + this._uid);\n var divPanel = document.getElementById(\"GPmousePositionSettings-\" + this._uid);\n if (!active) {\n divPicto.style.display = \"none\";\n divPanel.style.display = \"none\";\n } else {\n divPicto.style.display = \"\";\n divPanel.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.onMousePositionProjectionSystemChange()\n * when changes to a metric or a geographical units.\n *\n * @method _setTypeUnitsPanel\n * @param {String} type - Geographical or Metric\n * @private\n */\nMousePosition.prototype._setTypeUnitsPanel = function (type) {\n var container = this._projectionUnitsContainer;\n\n // deletes the childNodes\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n var units = this._projectionUnits[type];\n for (var j = 0; j < units.length; j++) {\n var obj = units[j];\n var option = document.createElement(\"option\");\n option.value = obj.code ? obj.code : j;\n option.text = obj.label || j;\n // option.label = obj.label;\n container.appendChild(option);\n }\n\n // the new type of system\n this._currentProjectionType = type;\n // as the system changed, the unit system has to change too !\n this._currentProjectionUnits = this._projectionUnits[type][0].code;\n};\n\n// ################################################################### //\n// ######################## method units convert ##################### //\n// ################################################################### //\n\n/**\n * degreedecimal\n *\n * @method _displayDEC\n * @param {Object} coords - coordinatesobject {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : 48, lng : 2} par exemple\n * @private\n */\nMousePosition.prototype._displayDEC = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].roundToDecimal(coords.lat, 6);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].roundToDecimal(coords.lon, 6);\n return coordinate;\n};\n\n/**\n * degreedecimal2sexagecimal\n *\n * @method _displayDMS\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lng : \"2° 00′ 00″ E\", lat : \"48° 00′ 00″ N\"} par exemple\n * @private\n */\nMousePosition.prototype._displayDMS = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalLatToDMS(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalLongToDMS(coords.lon);\n return coordinate;\n};\n\n/**\n * degreedecimal2radian\n *\n * @method _displayRAD\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : \"0.02837864\", lng : \"0.84300269\"} par exemple\n * @private\n */\nMousePosition.prototype._displayRAD = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToRadian(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToRadian(coords.lon);\n return coordinate;\n};\n\n/**\n * degreedecimal2grade\n *\n * @method _displayGON\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : \"4.09545898\", lng : \"53.68751528\"} par exemple\n * @private\n */\nMousePosition.prototype._displayGON = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToGrade(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToGrade(coords.lon);\n return coordinate;\n};\n\n/**\n * meter\n *\n * @method _displayMeter\n * @param {Object} coords - coords object {lon, lat}\n * @return {Object} coordinate - coordinate object : {x : \"148593.58\", y : \"6176560.95\"} par exemple\n * @private\n */\nMousePosition.prototype._displayMeter = function (coords) {\n // on recoit toujours des coordonnées metriques\n var coordinate = {};\n coordinate.x = coords.lon.toFixed(2);\n coordinate.y = coords.lat.toFixed(2);\n coordinate.unit = \"m\";\n return coordinate;\n};\n\n/**\n * kilometer\n *\n * @method _displayKMeter\n * @param {Object} coords - coords object {lon, lat}\n * @return {Object} coordinate - coordinate object : {x : \"214.96\", y : \"6250.09\"} par exemple\n * @private\n */\nMousePosition.prototype._displayKMeter = function (coords) {\n var coordinate = {};\n coordinate.x = (coords.lon / 1000).toFixed(2);\n coordinate.y = (coords.lat / 1000).toFixed(2);\n coordinate.unit = \"km\";\n return coordinate;\n};\n\n// ################################################################### //\n// ##################### handlers events to control ################## //\n// ################################################################### //\n\n/**\n * this sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method _setCoordinate\n * @param {Array} coords - coordinate object {lon, lat}\n * @private\n */\nMousePosition.prototype._setCoordinate = function (coords) {\n // structure\n // coords\n // {\n // lon: 5,\n // lat : 48\n // }\n //\n // structure for the coordinates depending on the system type :\n // {x:, y:, unit:} or {lng:, lat:} or {lon:, lat:} or {e:, n:, unit:}...\n\n var coord = [];\n var coordinates = {};\n\n // transforms the point in the wanted coords system\n var oSrs = this._currentProjectionSystems;\n var crsProp = oSrs ? oSrs.crs : null;\n if (!crsProp) {\n logger.error(\"system crs not found\");\n return;\n }\n // reproject coordinates from their CRS of origin (WGS84) to the wanted CRS (crsProp)\n if (crsProp !== \"EPSG:4326\") {\n coord = proj4__WEBPACK_IMPORTED_MODULE_0___default()(_CRS_CRS__WEBPACK_IMPORTED_MODULE_9__[\"default\"][crsProp], [coords.lon, coords.lat]);\n // projected values are affected to the coord var\n coordinates.lon = coord[0];\n coordinates.lat = coord[1];\n } else {\n coordinates = coords;\n }\n\n // system type : Geographical or Metric\n\n var type = this._currentProjectionSystems.type;\n\n // checks for a formatting function in the wanted unit\n var convert = null;\n var units = this._projectionUnits[type];\n for (var i = 0; i < units.length; i++) {\n if (units[i].code === this._currentProjectionUnits) {\n convert = units[i].convert;\n break;\n }\n }\n if (!convert || typeof convert !== \"function\") {\n logger.warn(\"coordinates format function not found\");\n return;\n } else {\n coord = convert(coordinates);\n }\n if (!coord || Object.keys(coord).length === 0) {\n return;\n }\n this.GPdisplayCoords(coord);\n};\n\n/**\n * this sends the coordinates to the panel.\n * (cf. this.GPdisplayElevation() into the DOM functions)\n *\n * @method _setElevation\n * @param {Object} coords - Coordinate position object {lon, lat}\n * @private\n */\nMousePosition.prototype._setElevation = function (coords) {\n // management of the timer of the altitude service request\n var delay = this.options.altitude.responseDelay;\n this.GPdisplayElevation(coords, delay);\n};\n\n/**\n * this method is triggered when the mouse or the globe is stopped.\n * (cf. onMouseMove and onGlobeMove)\n *\n * @method onMoveStopped\n * @param {Object} coords - Coordinate position object {lon, lat}\n * @private\n */\nMousePosition.prototype.onMoveStopped = function (coords) {\n this._setElevation(coords);\n};\n\n/**\n * this method is an handler event to control. The event is 'mousemove' on\n * the globe. The handler sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method onMouseMove\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMouseMove = function (e) {\n var self = this;\n var position = this.getGlobe().getCoordinateFromMouseEvent(e);\n if (!position) {\n this.GPdisplayCoords({\n lon: \"---\",\n lat: \"---\"\n });\n this.GPresetElevation();\n return;\n }\n var coordinate = {\n lon: position.x,\n lat: position.y\n };\n this._setCoordinate(coordinate);\n\n // calculation of the altitude after a time limit from the moment where the mouse movement is stopped\n if (this.options.displayAltitude) {\n clearTimeout(this._timer);\n this._timer = setTimeout(function () {\n self.onMoveStopped(coordinate);\n }, this.options.altitude.triggerDelay);\n }\n};\n\n/**\n * this method is an handler event to control. The event is 'moveend' on\n * the globe. The handler sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method onGlobeMove\n * @private\n */\nMousePosition.prototype.onGlobeMove = function () {\n\n // var self = this;\n\n // info: coordinate = [x, y]\n // var coordinate = e.coordinate;\n // if ( !e.map || !e.map.getView() ) {\n // return;\n // }\n // var crs = e.map.getView().getProjection();\n //\n // this._setCoordinate(coordinate, crs);\n //\n // // calcul de l'altitude après un certain délai après l'arrêt du mouvement de la carte\n // clearTimeout(this._timer);\n // this._timer = setTimeout( function () {\n // self.onMoveStopped(coordinate, crs);\n // }, this.options.altitude.triggerDelay);\n};\n\n// ################################################################### //\n// ####################### handlers events to dom #################### //\n// ################################################################### //\n\n/**\n * this method is called by this.GPdisplayElevation() in the dom, and\n * it executes a request to the elevation service.\n *\n * @method onRequestAltitude\n * @param {Object} coordinate - {lat:..., lng:...}\n * @param {Function} callback - function callback\n * @private\n */\nMousePosition.prototype.onRequestAltitude = function (coordinate, callback) {\n // INFORMATION\n // we launch the request to the altitude services\n // we implement callbacks in order to retrieve results or errors\n // from the service.\n // The result is displayed in a DOM element.\n // The error messages are display in the dev console (?)\n\n if (!coordinate || Object.keys(coordinate).length === 0) {\n return;\n }\n\n // if we do not want any altitude calculation, we just stop !\n if (!this.options.displayAltitude) {\n return;\n }\n\n // we retrieve the service options...\n var options = this.options.altitude.serviceOptions || {};\n\n // ... and the coordinates...\n options.zonly = true;\n options.positions = [{\n lon: coordinate.lon,\n lat: coordinate.lat\n }];\n\n // ... and the callbacks\n options.scope = this;\n if (!options.rawResponse) {\n // in the general case\n options.onSuccess = function (results) {\n if (results && Object.keys(results).length) {\n callback.call(this, results.elevations[0].z);\n }\n };\n } else {\n options.onSuccess = function (results) {\n logger.info(\"alti service raw response : \", results);\n };\n }\n options.onFailure = function (error) {\n logger.error(\"[getAltitude] \" + error.message);\n };\n // we use the key \"calcul\"\n options.apiKey = \"calcul\";\n\n // si l'utilisateur a spécifié le paramètre ssl au niveau du control, on s'en sert\n // true par défaut (https)\n if (typeof this.options.ssl === \"boolean\") {\n options.ssl = this.options.ssl;\n }\n geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Services.getAltitude(options);\n};\n\n/**\n * this method is called by event 'click' on 'GPshowMousePositionPicto' tag label\n * (cf. this._createShowMousePositionPictoElement),\n * and toggles event 'mousemove' on globe.\n *\n * @method onShowMousePositionClick\n * @private\n */\nMousePosition.prototype.onShowMousePositionClick = function () {\n // checked : true - panel close\n // checked : false - panel open\n var globe = this.getGlobe();\n this.collapsed = this._showMousePositionContainer.checked;\n\n // event triggered when opening/closing the panel\n // and depending on the mode : desktop or tactile!\n if (this._showMousePositionContainer.checked) {\n // FIXME handle or not mobile case\n if (this._isDesktop) {\n globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n } else {\n // FIXME handle or not mobile case\n if (this._isDesktop) {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n }\n\n // FIXME\n // we handle here the panel display..., but this is not really the good\n // place to do it...\n this._setElevationPanel(this.options.displayAltitude);\n this._setCoordinatesPanel(this.options.displayCoordinates);\n if (!this.options.displayCoordinates) {\n this._setSettingsPanel(false);\n }\n};\n\n/**\n * this method is called by event 'change' on 'GPmousePositionProjectionSystem'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the system projection.\n *\n * @method onMousePositionProjectionSystemChange\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionSystemChange = function (e) {\n var idx = e.target.selectedIndex; // index\n var value = e.target.options[idx].value; // crs\n\n this._setCurrentSystem(value);\n};\n\n/**\n * this method selects the current system projection.\n *\n * @method _setCurrentSystem\n * @param {String} systemCode - inner code (rank in array _projectionSystems)\n * @private\n */\nMousePosition.prototype._setCurrentSystem = function (systemCode) {\n // if we change of system type, we must change the unit type too !\n var type = null;\n for (var i = 0; i < this._projectionSystems.length; ++i) {\n if (this._projectionSystems[i].code === Number(systemCode)) {\n type = this._projectionSystems[i].type;\n break;\n }\n }\n if (!type) {\n logger.log(\"system not found in projection systems container\");\n return;\n }\n if (type !== this._currentProjectionType) {\n this._setTypeUnitsPanel(type);\n }\n\n // registers the current system\n this._currentProjectionSystems = this._projectionSystems[Number(systemCode)];\n\n // simulates a movement in tactile mode to update the results\n if (!this._isDesktop) {\n this.onGlobeMove();\n }\n};\n\n/**\n * this method is called by event 'mouseover' on 'GPmousePositionProjectionSystem'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the system projection whose geoBBox interstects the current view extent.\n *\n * @method onMousePositionProjectionSystemMouseOver\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionSystemMouseOver = function () {\n // globe infos\n var globe = this.getGlobe();\n if (!globe) {\n return;\n }\n var globeExtent = globe.getExtent();\n\n // clear select\n var systemList = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n systemList.innerHTML = \"\";\n var option;\n\n // add systems whose extent intersects the globe extent\n for (var j = 0; j < this._projectionSystems.length; j++) {\n var proj = this._projectionSystems[j];\n if (proj.geoBBox) {\n // bboxes intersection test\n if (globeExtent.west > proj.geoBBox.right || globeExtent.south > proj.geoBBox.top || globeExtent.east < proj.geoBBox.left || globeExtent.north < proj.geoBBox.bottom) {\n if (proj === this._currentProjectionSystems) {\n option = document.createElement(\"option\");\n option.value = proj.code;\n option.text = proj.label || j;\n option.setAttribute(\"selected\", \"selected\");\n option.setAttribute(\"disabled\", \"disabled\");\n systemList.appendChild(option);\n }\n continue; // do not intersect\n }\n }\n\n option = document.createElement(\"option\");\n option.value = proj.code;\n option.text = proj.label || j;\n if (proj === this._currentProjectionSystems) {\n option.setAttribute(\"selected\", \"selected\");\n }\n systemList.appendChild(option);\n }\n};\n\n/**\n * this method is called by event 'change' on 'GPmousePositionProjectionUnits'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the units projection.\n *\n * @method onMousePositionProjectionUnitsChange\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionUnitsChange = function (e) {\n var idx = e.target.selectedIndex;\n var value = e.target.options[idx].value;\n this._currentProjectionUnits = value;\n\n // simulates a movement in tactile mode to update the results\n if (!this._isDesktop) {\n this.onGlobeMove();\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MousePosition);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTW91c2VQb3NpdGlvbi5qcz8wMDlkIl0sIm5hbWVzIjpbImxvZ2dlciIsIkxvZ2dlciIsImdldExvZ2dlciIsIk1vdXNlUG9zaXRpb24iLCJvcHRpb25zIiwiVHlwZUVycm9yIiwiX3R5cGVvZiIsIkVycm9yIiwiX2luaXRpYWxpemUiLCJfY2FsbGJhY2tzIiwiY29udGFpbmVyIiwiX2luaXRDb250YWluZXIiLCJXaWRnZXQiLCJjYWxsIiwibmFtZSIsImVsZW1lbnQiLCJ0YXJnZXQiLCJwb3NpdGlvbiIsInByb3RvdHlwZSIsIk9iamVjdCIsImNyZWF0ZSIsIlV0aWxzIiwiYXNzaWduIiwiTW91c2VQb3NpdGlvbkRPTSIsImNvbnN0cnVjdG9yIiwic2V0R2xvYmUiLCJnbG9iZSIsIl9jZW50ZXJFbGVtZW50IiwiX2NyZWF0ZU1hcENlbnRlciIsImdldFRhcmdldEVsZW1lbnQiLCJhcHBlbmRDaGlsZCIsIm1vdXNlTW92ZSIsIm9uTW91c2VNb3ZlIiwiYmluZCIsImNvbGxhcHNlZCIsIl9pc0Rlc2t0b3AiLCJsaXN0ZW4iLCJHbG9iZVZpZXdFeHRlbmRlZCIsIkVWRU5UUyIsIk1PVVNFX01PVkUiLCJDRU5URVJfQ0hBTkdFRCIsIm9uR2xvYmVNb3ZlIiwiX2dsb2JlIiwiZm9yZ2V0IiwiZ2V0RWxlbWVudCIsImhhc0NoaWxkTm9kZXMiLCJyZW1vdmVDaGlsZCIsImxhc3RDaGlsZCIsInBhcmVudE5vZGUiLCJhZGRTeXN0ZW0iLCJzeXN0ZW0iLCJlcnJvciIsImNycyIsImxhYmVsIiwid2FybiIsInR5cGUiLCJqIiwiX3Byb2plY3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gICB7XG4gKiAgICAgICAgICBjcnMgOiBcIkVQU0c6Mzg1N1wiLFxuICogICAgICAgICAgbGFiZWwgOiBcIk1lcmNhdG9yXCIsXG4gKiAgICAgICAgICB0eXBlIDogXCJNZXRyaWNcIlxuICogICAgICAgIH0sXG4gKiAgICAgICB7XG4gKiAgICAgICAgICBjcnMgOiBcIkVQU0c6MzI2MjBcIixcbiAqICAgICAgICAgIGxhYmVsIDogXCJVVE0gMjBOIChHdWFkZWxvdXBlLCBNYXJ0aW5pcXVlKVwiLFxuICogICAgICAgICAgdHlwZSA6IFwiTWV0cmljXCIsXG4gKiAgICAgICAgICBnZW9CQm94IDoge1xuICogICAgICAgICAgICAgIGxlZnQ6IC02Ni4wMCxcbiAqICAgICAgICAgICAgICBib3R0b20gOiAwLjAwLFxuICogICAgICAgICAgICAgIHJpZ2h0IDogLTYwLjAwLFxuICogICAgICAgICAgICAgIHRvcCA6IDg0LjAwXG4gKiAgICAgICAgICB9XG4gKiAgICAgICAgfVxuICogICAgICBdLFxuICogICAgICB1bml0cyA6IFtcIkRFQ1wiLCBcIkRNU1wiXVxuICogIH0pO1xuICovXG5mdW5jdGlvbiBNb3VzZVBvc2l0aW9uIChvcHRpb25zKSB7XG4gICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XG5cbiAgICBpZiAoISh0aGlzIGluc3RhbmNlb2YgTW91c2VQb3NpdGlvbikpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcIkVSUk9SIENMQVNTX0NPTlNUUlVDVE9SXCIpO1xuICAgIH1cblxuICAgIGlmICh0eXBlb2Ygb3B0aW9ucyAhPT0gXCJvYmplY3RcIikge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUiBXUk9OR19UWVBFIDogb3B0aW9ucyBzaG91bGQgYmUgYW4gb2JqZWN0XCIpO1xuICAgIH1cblxuICAgIHRoaXMuX2luaXRpYWxpemUob3B0aW9ucyk7XG5cbiAgICB0aGlzLl9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l0eSB0byBtb2RpZnkgdGhlIGxpc3Qgb2YgdW5pdHMgdG8gZGlzcGxheVxuICAgIC8vIEV4LlxuICAgIC8vIHRoaXMub3B0aW9ucy51bml0cyA6IFtcIkRFQ1wiLCBcIkRNU1wiXVxuXG4gICAgLy8gYXZhaWxhYmxlIHVuaXRzIHN5c3RlbXMgYnkgZGVmYXVsdFxuICAgIHZhciBwcm9qZWN0aW9uVW5pdHNCeURlZmF1bHQgPSB7XG4gICAgICAgIEdlb2dyYXBoaWNhbCA6IFt7XG4gICAgICAgICAgICBjb2RlIDogXCJERUNcIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJkZWdyw6lzIGTDqWNpbWF1eFwiLFxuICAgICAgICAgICAgY29udmVydCA6IHRoaXMuX2Rpc3BsYXlERUNcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgY29kZSA6IFwiRE1TXCIsXG4gICAgICAgICAgICBsYWJlbCA6IFwiZGVncsOpcyBzZXhhZ8Opc2ltYXV4XCIsXG4gICAgICAgICAgICBjb252ZXJ0IDogdGhpcy5fZGlzcGxheURNU1xuICAgICAgICB9LCB7XG4gICAgICAgICAgICBjb2RlIDogXCJSQURcIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJyYWRpYW5zXCIsXG4gICAgICAgICAgICBjb252ZXJ0IDogdGhpcy5fZGlzcGxheVJBRFxuICAgICAgICB9LCB7XG4gICAgICAgICAgICBjb2RlIDogXCJHT05cIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJncmFkZXNcIixcbiAgICAgICAgICAgIGNvbnZlcnQgOiB0aGlzLl9kaXNwbGF5R09OXG4gICAgICAgIH1dLFxuICAgICAgICBNZXRyaWMgOiBbe1xuICAgICAgICAgICAgY29kZSA6IFwiTVwiLFxuICAgICAgICAgICAgbGFiZWwgOiBcIm3DqHRyZXNcIixcbiAgICAgICAgICAgIGNvbnZlcnQgOiB0aGlzLl9kaXNwbGF5TWV0ZXJcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgY29kZSA6IFwiS01cIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJraWxvbcOodHJlc1wiLFxuICAgICAgICAgICAgY29udmVydCA6IHRoaXMuX2Rpc3BsYXlLTWV0ZXJcbiAgICAgICAgfV1cbiAgICB9O1xuXG4gICAgdmFyIHVuaXRzID0gdGhpcy5vcHRpb25zLnVuaXRzO1xuXG4gICAgZm9yICh2YXIgdHlwZSBpbiBwcm9qZWN0aW9uVW5pdHNCeURlZmF1bHQpIHtcbiAgICAgICAgaWYgKHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdC5oYXNPd25Qcm9wZXJ0eSh0eXBlKSkge1xuICAgICAgICAgICAgdmFyIGZvdW5kID0gZmFsc2U7XG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdFt0eXBlXS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIHZhciBvYmogPSBwcm9qZWN0aW9uVW5pdHNCeURlZmF1bHRbdHlwZV1bal07XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1bml0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdW5pdCA9IHVuaXRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAob2JqLmNvZGUgPT09IHVuaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fcHJvamVjdGlvblVuaXRzW3R5cGVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fcHJvamVjdGlvblVuaXRzW3R5cGVdID0gW107XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9wcm9qZWN0aW9uVW5pdHNbdHlwZV0ucHVzaChvYmopO1xuICAgICAgICAgICAgICAgICAgICB9XG4g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kge1xuICAgICAgICAgICAgICAgIGlmIChwcm9qID09PSB0aGlzLl9jdXJyZW50UHJvamVjdGlvblN5c3RlbXMpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcIm9wdGlvblwiKTtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uLnZhbHVlID0gcHJvai5jb2RlO1xuICAgICAgICAgICAgICAgICAgICBvcHRpb24udGV4dCA9IHByb2oubGFiZWwgfHwgajtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uLnNldEF0dHJpYnV0ZShcInNlbGVjdGVkXCIsIFwic2VsZWN0ZWRcIik7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbi5zZXRBdHRyaWJ1dGUoXCJkaXNhYmxlZFwiLCBcImRpc2FibGVkXCIpO1xuXG4gICAgICAgICAgICAgICAgICAgIHN5c3RlbUxpc3QuYXBwZW5kQ2hpbGQob3B0aW9uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29udGludWU7IC8vIGRvIG5vdCBpbnRlcnNlY3RcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBvcHRpb24gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwib3B0aW9uXCIpO1xuICAgICAgICBvcHRpb24udmFsdWUgPSBwcm9qLmNvZGU7XG4gICAgICAgIG9wdGlvbi50ZXh0ID0gcHJvai5sYWJlbCB8fCBqO1xuICAgICAgICBpZiAocHJvaiA9PT0gdGhpcy5fY3VycmVudFByb2plY3Rpb25TeXN0ZW1zKSB7XG4gICAgICAgICAgICBvcHRpb24uc2V0QXR0cmlidXRlKFwic2VsZWN0ZWRcIiwgXCJzZWxlY3RlZFwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN5c3RlbUxpc3QuYXBwZW5kQ2hpbGQob3B0aW9uKTtcbiAgICB9XG59O1xuXG4vKipcbiAqIHRoaXMgbWV0aG9kIGlzIGNhbGxlZCBieSBldmVudCAnY2hhbmdlJyBvbiAnR1Btb3VzZVBvc2l0aW9uUHJvamVjdGlvblVuaXRzJ1xuICogdGFnIHNlbGVjdCAoY2YuIHRoaXMuX2NyZWF0ZU1vdXNlUG9zaXRpb25TZXR0aW5nc0VsZW1lbnQpLFxuICogYW5kIHNlbGVjdHMgdGhlIHVuaXRzIHByb2plY3Rpb24uXG4gKlxuICogQG1ldGhvZCBvbk1vdXNlUG9zaXRpb25Qcm9qZWN0aW9uVW5pdHNDaGFuZ2VcbiAqIEBwYXJhbSB7T2JqZWN0fSBlIC0gSFRNTEVsZW1lbnRcbiAqIEBwcml2YXRlXG4gKi9cbk1vdXNlUG9zaXRpb24ucHJvdG90eXBlLm9uTW91c2VQb3NpdGlvblByb2plY3Rpb25Vbml0c0NoYW5nZSA9IGZ1bmN0aW9uIChlKSB7XG4gICAgdmFyIGlkeCA9IGUudGFyZ2V0LnNlbGVjdGVkSW5kZXg7XG4gICAgdmFyIHZhbHVlID0gZS50YXJnZXQub3B0aW9uc1tpZHhdLnZhbHVlO1xuXG4gICAgdGhpcy5fY3VycmVudFByb2plY3Rpb25Vbml0cyA9IHZhbHVlO1xuXG4gICAgLy8gc2ltdWxhdGVzIGEgbW92ZW1lbnQgaW4gdGFjdGlsZSBtb2RlIHRvIHVwZGF0ZSB0aGUgcmVzdWx0c1xuICAgIGlmICghdGhpcy5faXNEZXNrdG9wKSB7XG4gICAgICAgIHRoaXMub25HbG9iZU1vdmUoKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBNb3VzZVBvc2l0aW9uO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/MousePosition.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! proj4 */ \"./node_modules/proj4/dist/proj4-src.js-exposed\");\n/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(proj4__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Common/Controls/MousePositionDOM */ \"./src/Common/Controls/MousePositionDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\n/* harmony import */ var _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Utils/PositionFormater */ \"./src/Itowns/Controls/Utils/PositionFormater.js\");\n/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../CRS/CRS */ \"./src/Itowns/CRS/CRS.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"MousePosition\");\n\n/**\n * @classdesc\n *\n * MousePosition Control.\n *\n * @constructor\n * @alias itowns.control.MousePosition\n * @extends {itowns.control.Control}\n * @param {Object} options - options for function call.\n * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol)\n * @param {Boolean} [options.collapsed = true] - Specify if MousePosition control should be collapsed at startup. Default is true.\n * @param {Array} [options.systems] - list of projection systems, default are Geographical (\"EPSG:4326\"), Web Mercator (\"EPSG:3857\"), Lambert 93 (\"EPSG:2154\") and extended Lambert 2 (\"EPSG:27572\").\n * Each array element (=system) is an object with following properties :\n * @param {String} options.systems.crs - Proj4 crs alias (from proj4 defs). e.g. : \"EPSG:4326\". Required\n * @param {String} [options.systems.label] - CRS label to be displayed in control. Default is crs code (e.g. \"EPSG:4326\")\n * @param {String} options.systems.type - CRS units type for coordinates conversion : \"Geographical\" or \"Metric\". Default: \"Metric\"\n * @param {Object} [options.systems.geoBBox] - Aera covered by the system (WGS84 coordinates).\n * @param {Number} options.systems.geoBBox.right - Right bound.\n * @param {Number} options.systems.geoBBox.left - Left bound.\n * @param {Number} options.systems.geoBBox.top - Top bound.\n * @param {Number} options.systems.geoBBox.bottom - Bottom bound.\n * @param {Array} [options.units] - list of coordinates units, to be displayed in control units list.\n * Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal), \"RAD\" (radians) and \"GON\" (grades) for geographical coordinates,\n * and \"M\" or \"KM\" for metric coordinates\n * @param {Array} [options.displayAltitude = true] - activate (true) or deactivate (false) the altitude panel. True by default\n * @param {Array} [options.displayCoordinates = true] - activate (true) or deactivate (false) the coordinates panel. True by default\n * @param {Object} [options.altitude] - elevation configuration\n * @param {Object} [options.altitude.serviceOptions] - options of elevation service\n * @param {Number} [options.altitude.responseDelay] - latency for altitude request, 500 ms by default\n * @param {Number} [options.altitude.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default\n * @example\n * var mousePosition = new itowns.control.MousePosition({\n * collapsed : false,\n * displayCoordinates : true,\n * displayAltitude : true,\n * altitude : {\n * triggerDelay : 100,\n * responseDelay : 500,\n * serviceOptions : {}\n * },\n * systems : [\n * {\n * crs : \"EPSG:3857\",\n * label : \"Mercator\",\n * type : \"Metric\"\n * },\n * {\n * crs : \"EPSG:32620\",\n * label : \"UTM 20N (Guadeloupe, Martinique)\",\n * type : \"Metric\",\n * geoBBox : {\n * left: -66.00,\n * bottom : 0.00,\n * right : -60.00,\n * top : 84.00\n * }\n * }\n * ],\n * units : [\"DEC\", \"DMS\"]\n * });\n */\nfunction MousePosition(options) {\n options = options || {};\n if (!(this instanceof MousePosition)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options);\n this._callbacks = {};\n\n // init control DOM container\n var container = this._initContainer(options);\n _Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].call(this, {\n name: \"MousePosition\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n;\n\n/**\n * @lends module:MousePosition\n */\nMousePosition.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].prototype, {});\n_Common_Utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].assign(MousePosition.prototype, _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n\n/**\n * Constructor (alias)\n */\nMousePosition.prototype.constructor = MousePosition;\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nMousePosition.prototype.setGlobe = function (globe) {\n if (globe) {\n // In the case of the adding of a control to the globe\n this._centerElement = this._createMapCenter();\n globe.getTargetElement().appendChild(this._centerElement);\n\n // defines the callback on the map to retrieve the coordinates\n this._callbacks.mouseMove = this.onMouseMove.bind(this);\n\n // valid event for desktop mode\n if (!this.collapsed) {\n if (this._isDesktop) {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n }\n } else if (globe == null) {\n // if globe == null we remove the MP control\n // deletes the listener associated to the mousePosition control\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n // deletes the mousePosition control DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n this._globe.getTargetElement().removeChild(this._centerElement);\n }\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// #################### user interface methods ####################### //\n// ################################################################### //\n\n/**\n * Sets additional projection system\n *\n * @param {Object} system - Projection system defined in the Itowns/CRS/CRS.js class\n * @param {String} system.crs - Proj4 crs alias (from proj4 defs) e.g. \"EPSG:4326\"\n * @param {String} [system.label] - CRS label to be displayed in control. Default is system.crs alias\n * @param {String} [system.type] - CRS units type for coordinates conversion (one of control options.units). Default is \"Metric\"\n */\nMousePosition.prototype.addSystem = function (system) {\n if (_typeof(system) !== \"object\") {\n logger.error(\"MousePosition:addSystem - system parameter should be an object\");\n return;\n }\n if (!system.crs) {\n logger.error(\"crs not defined !\");\n return;\n }\n if (!system.label) {\n logger.warn(\"crs label not defined, use crs code by default.\");\n system.label = system.crs;\n }\n if (!system.type) {\n logger.warn(\"type srs not defined, use 'Metric' by default.\");\n system.type = \"Metric\";\n }\n\n // 1. adds system to control systems\n for (var j = 0; j < this._projectionSystems.length; j++) {\n var obj = this._projectionSystems[j];\n if (system.crs === obj.crs) {\n // warn user\n logger.warn(\"crs '{}' already configured\", obj.crs);\n }\n }\n system.code = this._projectionSystems.length;\n this._projectionSystems.push(system);\n\n // 2. adds system settings option to container (if it was already build)\n var selectSystem = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n if (selectSystem) {\n var option = document.createElement(\"option\");\n option.value = system.code;\n option.text = system.label;\n selectSystem.appendChild(option);\n }\n};\n\n/**\n * Sets additional projection systems\n *\n * @param {Array} systems - Array of system object, with following properties :\n * @param {String} systems.crs - Proj4 CRS alias (from proj4 defs) e.g. \"EPSG:4326\"\n * @param {String} systems.label - CRS label (for coordinates conversion)\n * @param {String} systems.type - CRS units type to be displayed in control (one of control options.units). Default is \"Metric\"\n */\nMousePosition.prototype.addSystems = function (systems) {\n if (!systems) {\n return;\n }\n if (!Array.isArray(systems)) {\n logger.error(\"MousePosition:addSystems - systems parameter should be an array\");\n return;\n }\n for (var i = 0; i < systems.length; i++) {\n this.addSystem(systems[i]);\n }\n};\n\n/**\n * Removes projection system (in case there are several system with same code, only the first one will be removed)\n *\n * @param {String} systemCrs - CRS alias (from proj4 defs)\n */\nMousePosition.prototype.removeSystem = function (systemCrs) {\n if (!systemCrs || typeof systemCrs !== \"string\") {\n logger.error(\"MousePosition:removeSystem - systemCode parameter should be a string\");\n return;\n }\n var systemCode = null;\n // finds system in control projection systems list\n for (var i = 0; i < this._projectionSystems.length; i++) {\n var proj = this._projectionSystems[i];\n if (systemCrs === proj.crs) {\n systemCode = proj.code;\n // removes system from control projection systems list\n this._projectionSystems.splice(i, 1);\n break;\n }\n }\n if (systemCode == null) {\n logger.warn(\"MousePosition:removeSystem - system not found\");\n return;\n }\n\n // re-initialization of codes\n var oldNewCodeGlobe = [];\n for (var ii = 0; ii < this._projectionSystems.length; ii++) {\n oldNewCodeGlobe[Number(this._projectionSystems[ii].code)] = ii;\n this._projectionSystems[ii].code = ii;\n }\n\n // finds system in control container systems list\n var indexChildToRemove = null;\n var systemList = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n for (var j = 0; j < systemList.childNodes.length; j++) {\n if (systemCode === systemList.childNodes[j].value) {\n indexChildToRemove = j;\n continue;\n }\n systemList.childNodes[j].value = oldNewCodeGlobe[Number(systemList.childNodes[j].value)];\n }\n // removes system from control container systems list\n if (indexChildToRemove != null) {\n systemList.removeChild(systemList.childNodes[indexChildToRemove]);\n }\n\n // choose arbitrarily a new current system if needed\n if (this._currentProjectionSystems.code === systemCode) {\n systemList.childNodes[0].setAttribute(\"selected\", \"selected\");\n this._setCurrentSystem(systemList.childNodes[0].value);\n }\n};\n\n/**\n * Sets control units (to be displayed)\n *\n * @param {Array} units - list of all coordinates units, to be displayed in control units list.\n * Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal), \"RAD\" (radians) and \"GON\" (grades) for geographical coordinates,\n * and \"M\" or \"KM\" for metric coordinates\n */\nMousePosition.prototype.setUnits = function (units) {\n if (!units || !Array.isArray(units)) {\n return;\n }\n this.options.units = units;\n this._projectionUnits = {};\n this._initProjectionUnits();\n if (this._currentProjectionType) {\n this._setTypeUnitsPanel(this._currentProjectionType);\n }\n};\n\n/**\n * Sets control altitude options (useless if displayAltitude == false)\n *\n * @param {Object} options - altitude options\n * @param {Object} [options.serviceOptions] - options of elevation service\n * @param {Number} [options.responseDelay] - latency for elevation request, 500 ms by default\n * @param {Number} [options.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default\n */\nMousePosition.prototype.setAltitudeOptions = function (options) {\n if (!options || _typeof(options) !== \"object\") {\n return;\n }\n this.options.altitude.triggerDelay = options.triggerDelay;\n this.options.altitude.responseDelay = options.responseDelay;\n if (options.serviceOptions) {\n for (var opt in options.serviceOptions) {\n if (options.serviceOptions.hasOwnProperty(opt)) {\n this.options.altitude.serviceOptions[opt] = options.serviceOptions[opt];\n }\n }\n }\n};\n\n/**\n * Displays or hides elevation panel\n *\n * @param {Boolean} displayAltitude - true to display elevation panel, false to hide it\n */\nMousePosition.prototype.displayAltitude = function (displayAltitude) {\n if (displayAltitude === undefined) {\n return;\n }\n this.options.displayAltitude = displayAltitude;\n this._setElevationPanel(displayAltitude);\n};\n\n/**\n * Displays or hides coordinates panel\n *\n * @param {Boolean} displayCoordinates - true to display coordinates panel, false to hide it\n */\nMousePosition.prototype.displayCoordinates = function (displayCoordinates) {\n if (displayCoordinates === undefined) {\n return;\n }\n this.options.displayCoordinates = displayCoordinates;\n this._setCoordinatesPanel(displayCoordinates);\n this._setSettingsPanel(displayCoordinates);\n};\n\n/**\n * Collapses or displays control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nMousePosition.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"MousePosition:setCollapsed - missing collapsed parameter\");\n return;\n }\n if (collapsed && this.collapsed || !collapsed && !this.collapsed) {\n return;\n }\n if (!this._isDesktop) {\n document.getElementById(this._addUID(\"GPmapCenter\")).className = collapsed ? \"\" : \"GPmapCenterVisible\";\n }\n // simulates the opening of the panel after a click\n this.onShowMousePositionClick();\n this._showMousePositionContainer.checked = !collapsed;\n};\n\n// ################################################################### //\n// ######################## initialize control ####################### //\n// ################################################################### //\n\n/**\n * Initializes control (called by MousePosition constructor)\n *\n * @method _initialize\n * @param {Object} options - control options (set by user)\n * @private\n */\nMousePosition.prototype._initialize = function (options) {\n // Set default options\n // {Object} control options - set by user or by default\n this.options = options || {};\n this.options.collapsed = options.collapsed !== undefined ? options.collapsed : true;\n /** {Boolean} specify if MousePosition control is collapsed (true) or not (false) */\n this.collapsed = this.options.collapsed;\n this.options.units = options.units || [];\n this.options.displayAltitude = options.displayAltitude !== undefined ? options.displayAltitude : true;\n this.options.displayCoordinates = options.displayCoordinates !== undefined ? options.displayCoordinates : true;\n this.options.systems = options.systems || [];\n if (options.altitude) {\n var altitude = options.altitude;\n this.options.altitude = {\n triggerDelay: altitude.triggerDelay !== undefined ? altitude.triggerDelay : 200,\n responseDelay: altitude.responseDelay !== undefined ? altitude.responseDelay : 500,\n serviceOptions: altitude.serviceOptions || {},\n noDataValue: altitude.noDataValue !== undefined ? altitude.noDataValue : -99999,\n noDataValueTolerance: altitude.noDataValueTolerance !== undefined ? altitude.noDataValueTolerance : 90000\n };\n // on surcharge l'outputFormat pour du json si non spécifié par utilisateur\n this.options.altitude.serviceOptions.outputFormat = altitude.serviceOptions && altitude.serviceOptions.outputFormat ? altitude.serviceOptions.outputFormat : \"json\";\n } else {\n this.options.altitude = {\n triggerDelay: 200,\n responseDelay: 500,\n serviceOptions: {\n outputFormat: \"json\"\n }\n };\n }\n\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__[\"default\"].generate();\n\n // initialization of the projections systems\n this._projectionSystems = [];\n this._initProjectionSystems();\n\n // initialization of the units systems\n this._projectionUnits = {};\n this._initProjectionUnits();\n\n // support detect : desktop or tactile\n this._isDesktop = _Common_Utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].detectSupport();\n\n // implements a timer threshold\n if (this.options.altitude.triggerDelay < 100) {\n this.options.altitude.triggerDelay = 100;\n }\n\n // {Number} timer on movestopped delay (altitude calculation)\n this._timer = this.options.altitude.triggerDelay;\n\n // {Object} Selected projection system\n this._currentProjectionSystems = this._projectionSystems[0];\n\n // {String} Selected projection units typs : Geographical or metric\n this._currentProjectionType = this._projectionSystems[0].type;\n\n // {String} Selected projection unit\n this._currentProjectionUnits = this._projectionUnits[this._currentProjectionType][0].code;\n\n // {Object} Projection units container (DOM Element)\n this._projectionUnitsContainer = null;\n\n // {Object} control panel container (DOM Element)\n this._showMousePositionContainer = null;\n\n // management of the altitude panel display\n if (!this.options.displayAltitude && !this.options.displayCoordinates) {\n // reactivate the display of coordinates, to not display an empty panel\n this.options.displayCoordinates = true;\n }\n};\n\n/**\n * this method is called by the constructor and initialize the projection\n * systems.\n * getting coordinates in the requested projection :\n * see this.onMousePositionProjectionSystemChange()\n *\n * @method _initProjectionSystems\n * @private\n */\nMousePosition.prototype._initProjectionSystems = function () {\n // user has the possibility to modify the list of systems to display\n // Ex. this.options.systems\n\n // available projection systems vy default\n var projectionSystemsByDefault = [{\n label: \"Géographique\",\n crs: \"EPSG:4326\",\n type: \"Geographical\"\n }, {\n label: \"Mercator\",\n crs: \"EPSG:3857\",\n type: \"Metric\"\n }, {\n label: \"Lambert 93\",\n crs: \"EPSG:2154\",\n type: \"Metric\",\n geoBBox: {\n left: -9.86,\n bottom: 41.15,\n right: 10.38,\n top: 51.56\n }\n }, {\n label: \"Lambert II étendu\",\n crs: \"EPSG:27572\",\n type: \"Metric\",\n geoBBox: {\n left: -4.87,\n bottom: 42.33,\n right: 8.23,\n top: 51.14\n }\n }];\n var systems = this.options.systems;\n for (var i = 0; i < systems.length; i++) {\n // definition of a reference system\n var sys = systems[i];\n this.addSystem(sys);\n }\n if (this._projectionSystems.length === 0) {\n // we add the default projection systems\n for (var ii = 0; ii < projectionSystemsByDefault.length; ii++) {\n this.addSystem(projectionSystemsByDefault[ii]);\n }\n }\n};\n\n/**\n * this method is called by the constructor and initialize the units.\n * getting coordinates in the requested units :\n * see this.onMousePositionProjectionUnitsChange()\n *\n * @method _initProjectionUnits\n * @private\n */\nMousePosition.prototype._initProjectionUnits = function () {\n // user has the possibility to modify the list of units to display\n // Ex.\n // this.options.units : [\"DEC\", \"DMS\"]\n\n // available units systems by default\n var projectionUnitsByDefault = {\n Geographical: [{\n code: \"DEC\",\n label: \"degrés décimaux\",\n convert: this._displayDEC\n }, {\n code: \"DMS\",\n label: \"degrés sexagésimaux\",\n convert: this._displayDMS\n }, {\n code: \"RAD\",\n label: \"radians\",\n convert: this._displayRAD\n }, {\n code: \"GON\",\n label: \"grades\",\n convert: this._displayGON\n }],\n Metric: [{\n code: \"M\",\n label: \"mètres\",\n convert: this._displayMeter\n }, {\n code: \"KM\",\n label: \"kilomètres\",\n convert: this._displayKMeter\n }]\n };\n var units = this.options.units;\n for (var type in projectionUnitsByDefault) {\n if (projectionUnitsByDefault.hasOwnProperty(type)) {\n var found = false;\n for (var j = 0; j < projectionUnitsByDefault[type].length; j++) {\n var obj = projectionUnitsByDefault[type][j];\n for (var i = 0; i < units.length; i++) {\n var unit = units[i];\n if (obj.code === unit) {\n found = true;\n if (!this._projectionUnits[type]) {\n this._projectionUnits[type] = [];\n }\n this._projectionUnits[type].push(obj);\n }\n }\n }\n if (!found) {\n this._projectionUnits[type] = projectionUnitsByDefault[type];\n }\n }\n }\n\n // in case of...\n if (_typeof(this._projectionUnits) === \"object\" && Object.keys(this._projectionUnits).length === 0) {\n this._projectionUnits = projectionUnitsByDefault;\n }\n};\n\n// ################################################################### //\n// ######################## methods handle dom ####################### //\n// ################################################################### //\n\n/**\n * Create control main container (called by MousePosition constructor)\n *\n * @method _initContainer\n * @param {Object} options - options\n * @param {Boolean} options.collapsed - Specify if MousePosition control should be collapsed\n * @param {Array} options.displayAltitude - activate (true) or deactivate (false) the altitude panel\n * @param {Array} options.displayCoordinates - activate (true) or deactivate (false) the coordinates panel\n * @returns {DOMElement} container - widget container\n * @private\n */\nMousePosition.prototype._initContainer = function (options) {\n // creates the main container\n var container = this._createMainContainerElement();\n var inputShow = this._showMousePositionContainer = this._createShowMousePositionElement();\n if (!options.collapsed) {\n inputShow.checked = \"checked\";\n }\n container.appendChild(inputShow);\n var picto = this._createShowMousePositionPictoElement(this._isDesktop);\n container.appendChild(picto);\n var panel = this._createMousePositionPanelElement();\n var header = this._createMousePositionPanelHeaderElement();\n panel.appendChild(header);\n var basic = this._createMousePositionPanelBasicElement(options.displayAltitude, options.displayCoordinates);\n panel.appendChild(basic);\n var arraySettings = this._createShowMousePositionSettingsElement(options.displayCoordinates);\n for (var j = 0; j < arraySettings.length; j++) {\n panel.appendChild(arraySettings[j]);\n }\n var settings = this._createMousePositionSettingsElement(options.displayCoordinates);\n var systems = this._projectionSystemsContainer = this._createMousePositionSettingsSystemsElement(this._projectionSystems);\n var units = this._projectionUnitsContainer = this._createMousePositionSettingsUnitsElement(this._projectionUnits[this._currentProjectionType]);\n settings.appendChild(systems);\n settings.appendChild(units);\n panel.appendChild(settings);\n container.appendChild(panel);\n return container;\n};\n\n/**\n * this method is called by this.()\n * and it changes the elevation view panel into the dom.\n *\n * @method _setElevationPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setElevationPanel = function (active) {\n var div = null;\n if (!active) {\n div = document.getElementById(\"GPmousePositionAltitude-\" + this._uid);\n div.style.display = \"none\";\n } else {\n div = document.getElementById(\"GPmousePositionAltitude-\" + this._uid);\n div.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.()\n * and it changes the coordinate view panel into the dom.\n *\n * @method _setCoordinatesPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setCoordinatesPanel = function (active) {\n var div = document.getElementById(\"GPmousePositionCoordinate-\" + this._uid);\n if (!active) {\n div.style.display = \"none\";\n } else {\n div.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.()\n * and it changes the settings view panel into the dom.\n *\n * @method _setSettingsPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setSettingsPanel = function (active) {\n var divPicto = document.getElementById(\"GPshowMousePositionSettingsPicto-\" + this._uid);\n var divPanel = document.getElementById(\"GPmousePositionSettings-\" + this._uid);\n if (!active) {\n divPicto.style.display = \"none\";\n divPanel.style.display = \"none\";\n } else {\n divPicto.style.display = \"\";\n divPanel.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.onMousePositionProjectionSystemChange()\n * when changes to a metric or a geographical units.\n *\n * @method _setTypeUnitsPanel\n * @param {String} type - Geographical or Metric\n * @private\n */\nMousePosition.prototype._setTypeUnitsPanel = function (type) {\n var container = this._projectionUnitsContainer;\n\n // deletes the childNodes\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n var units = this._projectionUnits[type];\n for (var j = 0; j < units.length; j++) {\n var obj = units[j];\n var option = document.createElement(\"option\");\n option.value = obj.code ? obj.code : j;\n option.text = obj.label || j;\n // option.label = obj.label;\n container.appendChild(option);\n }\n\n // the new type of system\n this._currentProjectionType = type;\n // as the system changed, the unit system has to change too !\n this._currentProjectionUnits = this._projectionUnits[type][0].code;\n};\n\n// ################################################################### //\n// ######################## method units convert ##################### //\n// ################################################################### //\n\n/**\n * degreedecimal\n *\n * @method _displayDEC\n * @param {Object} coords - coordinatesobject {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : 48, lng : 2} par exemple\n * @private\n */\nMousePosition.prototype._displayDEC = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].roundToDecimal(coords.lat, 6);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].roundToDecimal(coords.lon, 6);\n return coordinate;\n};\n\n/**\n * degreedecimal2sexagecimal\n *\n * @method _displayDMS\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lng : \"2° 00′ 00″ E\", lat : \"48° 00′ 00″ N\"} par exemple\n * @private\n */\nMousePosition.prototype._displayDMS = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalLatToDMS(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalLongToDMS(coords.lon);\n return coordinate;\n};\n\n/**\n * degreedecimal2radian\n *\n * @method _displayRAD\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : \"0.02837864\", lng : \"0.84300269\"} par exemple\n * @private\n */\nMousePosition.prototype._displayRAD = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToRadian(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToRadian(coords.lon);\n return coordinate;\n};\n\n/**\n * degreedecimal2grade\n *\n * @method _displayGON\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : \"4.09545898\", lng : \"53.68751528\"} par exemple\n * @private\n */\nMousePosition.prototype._displayGON = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToGrade(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToGrade(coords.lon);\n return coordinate;\n};\n\n/**\n * meter\n *\n * @method _displayMeter\n * @param {Object} coords - coords object {lon, lat}\n * @return {Object} coordinate - coordinate object : {x : \"148593.58\", y : \"6176560.95\"} par exemple\n * @private\n */\nMousePosition.prototype._displayMeter = function (coords) {\n // on recoit toujours des coordonnées metriques\n var coordinate = {};\n coordinate.x = coords.lon.toFixed(2);\n coordinate.y = coords.lat.toFixed(2);\n coordinate.unit = \"m\";\n return coordinate;\n};\n\n/**\n * kilometer\n *\n * @method _displayKMeter\n * @param {Object} coords - coords object {lon, lat}\n * @return {Object} coordinate - coordinate object : {x : \"214.96\", y : \"6250.09\"} par exemple\n * @private\n */\nMousePosition.prototype._displayKMeter = function (coords) {\n var coordinate = {};\n coordinate.x = (coords.lon / 1000).toFixed(2);\n coordinate.y = (coords.lat / 1000).toFixed(2);\n coordinate.unit = \"km\";\n return coordinate;\n};\n\n// ################################################################### //\n// ##################### handlers events to control ################## //\n// ################################################################### //\n\n/**\n * this sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method _setCoordinate\n * @param {Array} coords - coordinate object {lon, lat}\n * @private\n */\nMousePosition.prototype._setCoordinate = function (coords) {\n // structure\n // coords\n // {\n // lon: 5,\n // lat : 48\n // }\n //\n // structure for the coordinates depending on the system type :\n // {x:, y:, unit:} or {lng:, lat:} or {lon:, lat:} or {e:, n:, unit:}...\n\n var coord = [];\n var coordinates = {};\n\n // transforms the point in the wanted coords system\n var oSrs = this._currentProjectionSystems;\n var crsProp = oSrs ? oSrs.crs : null;\n if (!crsProp) {\n logger.error(\"system crs not found\");\n return;\n }\n // reproject coordinates from their CRS of origin (WGS84) to the wanted CRS (crsProp)\n if (crsProp !== \"EPSG:4326\") {\n coord = proj4__WEBPACK_IMPORTED_MODULE_0___default()(_CRS_CRS__WEBPACK_IMPORTED_MODULE_9__[\"default\"][crsProp], [coords.lon, coords.lat]);\n // projected values are affected to the coord var\n coordinates.lon = coord[0];\n coordinates.lat = coord[1];\n } else {\n coordinates = coords;\n }\n\n // system type : Geographical or Metric\n\n var type = this._currentProjectionSystems.type;\n\n // checks for a formatting function in the wanted unit\n var convert = null;\n var units = this._projectionUnits[type];\n for (var i = 0; i < units.length; i++) {\n if (units[i].code === this._currentProjectionUnits) {\n convert = units[i].convert;\n break;\n }\n }\n if (!convert || typeof convert !== \"function\") {\n logger.warn(\"coordinates format function not found\");\n return;\n } else {\n coord = convert(coordinates);\n }\n if (!coord || Object.keys(coord).length === 0) {\n return;\n }\n this.GPdisplayCoords(coord);\n};\n\n/**\n * this sends the coordinates to the panel.\n * (cf. this.GPdisplayElevation() into the DOM functions)\n *\n * @method _setElevation\n * @param {Object} coords - Coordinate position object {lon, lat}\n * @private\n */\nMousePosition.prototype._setElevation = function (coords) {\n // management of the timer of the altitude service request\n var delay = this.options.altitude.responseDelay;\n this.GPdisplayElevation(coords, delay);\n};\n\n/**\n * this method is triggered when the mouse or the globe is stopped.\n * (cf. onMouseMove and onGlobeMove)\n *\n * @method onMoveStopped\n * @param {Object} coords - Coordinate position object {lon, lat}\n * @private\n */\nMousePosition.prototype.onMoveStopped = function (coords) {\n this._setElevation(coords);\n};\n\n/**\n * this method is an handler event to control. The event is 'mousemove' on\n * the globe. The handler sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method onMouseMove\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMouseMove = function (e) {\n var self = this;\n var position = this.getGlobe().getCoordinateFromMouseEvent(e);\n if (!position) {\n this.GPdisplayCoords({\n lon: \"---\",\n lat: \"---\"\n });\n this.GPresetElevation();\n return;\n }\n var coordinate = {\n lon: position.x,\n lat: position.y\n };\n this._setCoordinate(coordinate);\n\n // calculation of the altitude after a time limit from the moment where the mouse movement is stopped\n if (this.options.displayAltitude) {\n clearTimeout(this._timer);\n this._timer = setTimeout(function () {\n self.onMoveStopped(coordinate);\n }, this.options.altitude.triggerDelay);\n }\n};\n\n/**\n * this method is an handler event to control. The event is 'moveend' on\n * the globe. The handler sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method onGlobeMove\n * @private\n */\nMousePosition.prototype.onGlobeMove = function () {\n\n // var self = this;\n\n // info: coordinate = [x, y]\n // var coordinate = e.coordinate;\n // if ( !e.map || !e.map.getView() ) {\n // return;\n // }\n // var crs = e.map.getView().getProjection();\n //\n // this._setCoordinate(coordinate, crs);\n //\n // // calcul de l'altitude après un certain délai après l'arrêt du mouvement de la carte\n // clearTimeout(this._timer);\n // this._timer = setTimeout( function () {\n // self.onMoveStopped(coordinate, crs);\n // }, this.options.altitude.triggerDelay);\n};\n\n// ################################################################### //\n// ####################### handlers events to dom #################### //\n// ################################################################### //\n\n/**\n * this method is called by this.GPdisplayElevation() in the dom, and\n * it executes a request to the elevation service.\n *\n * @method onRequestAltitude\n * @param {Object} coordinate - {lat:..., lng:...}\n * @param {Function} callback - function callback\n * @private\n */\nMousePosition.prototype.onRequestAltitude = function (coordinate, callback) {\n // INFORMATION\n // we launch the request to the altitude services\n // we implement callbacks in order to retrieve results or errors\n // from the service.\n // The result is displayed in a DOM element.\n // The error messages are display in the dev console (?)\n\n if (!coordinate || Object.keys(coordinate).length === 0) {\n return;\n }\n\n // if we do not want any altitude calculation, we just stop !\n if (!this.options.displayAltitude) {\n return;\n }\n\n // we retrieve the service options...\n var options = this.options.altitude.serviceOptions || {};\n\n // ... and the coordinates...\n options.zonly = true;\n options.positions = [{\n lon: coordinate.lon,\n lat: coordinate.lat\n }];\n\n // ... and the callbacks\n options.scope = this;\n if (!options.rawResponse) {\n // in the general case\n options.onSuccess = function (results) {\n if (results && Object.keys(results).length) {\n callback.call(this, results.elevations[0].z);\n }\n };\n } else {\n options.onSuccess = function (results) {\n logger.info(\"alti service raw response : \", results);\n };\n }\n options.onFailure = function (error) {\n logger.error(\"[getAltitude] \" + error.message);\n };\n // we use the key \"calcul\"\n options.apiKey = \"calcul\";\n\n // si l'utilisateur a spécifié le paramètre ssl au niveau du control, on s'en sert\n // true par défaut (https)\n if (typeof this.options.ssl === \"boolean\") {\n options.ssl = this.options.ssl;\n }\n geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Services.getAltitude(options);\n};\n\n/**\n * this method is called by event 'click' on 'GPshowMousePositionPicto' tag label\n * (cf. this._createShowMousePositionPictoElement),\n * and toggles event 'mousemove' on globe.\n *\n * @method onShowMousePositionClick\n * @private\n */\nMousePosition.prototype.onShowMousePositionClick = function () {\n // checked : true - panel close\n // checked : false - panel open\n var globe = this.getGlobe();\n this.collapsed = this._showMousePositionContainer.checked;\n\n // event triggered when opening/closing the panel\n // and depending on the mode : desktop or tactile!\n if (this._showMousePositionContainer.checked) {\n // FIXME handle or not mobile case\n if (this._isDesktop) {\n globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n } else {\n // FIXME handle or not mobile case\n if (this._isDesktop) {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n }\n\n // FIXME\n // we handle here the panel display..., but this is not really the good\n // place to do it...\n this._setElevationPanel(this.options.displayAltitude);\n this._setCoordinatesPanel(this.options.displayCoordinates);\n if (!this.options.displayCoordinates) {\n this._setSettingsPanel(false);\n }\n};\n\n/**\n * this method is called by event 'change' on 'GPmousePositionProjectionSystem'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the system projection.\n *\n * @method onMousePositionProjectionSystemChange\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionSystemChange = function (e) {\n var idx = e.target.selectedIndex; // index\n var value = e.target.options[idx].value; // crs\n\n this._setCurrentSystem(value);\n};\n\n/**\n * this method selects the current system projection.\n *\n * @method _setCurrentSystem\n * @param {String} systemCode - inner code (rank in array _projectionSystems)\n * @private\n */\nMousePosition.prototype._setCurrentSystem = function (systemCode) {\n // if we change of system type, we must change the unit type too !\n var type = null;\n for (var i = 0; i < this._projectionSystems.length; ++i) {\n if (this._projectionSystems[i].code === Number(systemCode)) {\n type = this._projectionSystems[i].type;\n break;\n }\n }\n if (!type) {\n logger.log(\"system not found in projection systems container\");\n return;\n }\n if (type !== this._currentProjectionType) {\n this._setTypeUnitsPanel(type);\n }\n\n // registers the current system\n this._currentProjectionSystems = this._projectionSystems[Number(systemCode)];\n\n // simulates a movement in tactile mode to update the results\n if (!this._isDesktop) {\n this.onGlobeMove();\n }\n};\n\n/**\n * this method is called by event 'mouseover' on 'GPmousePositionProjectionSystem'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the system projection whose geoBBox interstects the current view extent.\n *\n * @method onMousePositionProjectionSystemMouseOver\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionSystemMouseOver = function () {\n // globe infos\n var globe = this.getGlobe();\n if (!globe) {\n return;\n }\n var globeExtent = globe.getExtent();\n\n // clear select\n var systemList = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n systemList.innerHTML = \"\";\n var option;\n\n // add systems whose extent intersects the globe extent\n for (var j = 0; j < this._projectionSystems.length; j++) {\n var proj = this._projectionSystems[j];\n if (proj.geoBBox) {\n // bboxes intersection test\n if (globeExtent.west > proj.geoBBox.right || globeExtent.south > proj.geoBBox.top || globeExtent.east < proj.geoBBox.left || globeExtent.north < proj.geoBBox.bottom) {\n if (proj === this._currentProjectionSystems) {\n option = document.createElement(\"option\");\n option.value = proj.code;\n option.text = proj.label || j;\n option.setAttribute(\"selected\", \"selected\");\n option.setAttribute(\"disabled\", \"disabled\");\n systemList.appendChild(option);\n }\n continue; // do not intersect\n }\n }\n\n option = document.createElement(\"option\");\n option.value = proj.code;\n option.text = proj.label || j;\n if (proj === this._currentProjectionSystems) {\n option.setAttribute(\"selected\", \"selected\");\n }\n systemList.appendChild(option);\n }\n};\n\n/**\n * this method is called by event 'change' on 'GPmousePositionProjectionUnits'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the units projection.\n *\n * @method onMousePositionProjectionUnitsChange\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionUnitsChange = function (e) {\n var idx = e.target.selectedIndex;\n var value = e.target.options[idx].value;\n this._currentProjectionUnits = value;\n\n // simulates a movement in tactile mode to update the results\n if (!this._isDesktop) {\n this.onGlobeMove();\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MousePosition);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTW91c2VQb3NpdGlvbi5qcz8wMDlkIl0sIm5hbWVzIjpbImxvZ2dlciIsIkxvZ2dlciIsImdldExvZ2dlciIsIk1vdXNlUG9zaXRpb24iLCJvcHRpb25zIiwiVHlwZUVycm9yIiwiX3R5cGVvZiIsIkVycm9yIiwiX2luaXRpYWxpemUiLCJfY2FsbGJhY2tzIiwiY29udG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Qm94IDoge1xuICogICAgICAgICAgICAgIGxlZnQ6IC02Ni4wMCxcbiAqICAgICAgICAgICAgICBib3R0b20gOiAwLjAwLFxuICogICAgICAgICAgICAgIHJpZ2h0IDogLTYwLjAwLFxuICogICAgICAgICAgICAgIHRvcCA6IDg0LjAwXG4gKiAgICAgICAgICB9XG4gKiAgICAgICAgfVxuICogICAgICBdLFxuICogICAgICB1bml0cyA6IFtcIkRFQ1wiLCBcIkRNU1wiXVxuICogIH0pO1xuICovXG5mdW5jdGlvbiBNb3VzZVBvc2l0aW9uIChvcHRpb25zKSB7XG4gICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XG5cbiAgICBpZiAoISh0aGlzIGluc3RhbmNlb2YgTW91c2VQb3NpdGlvbikpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcIkVSUk9SIENMQVNTX0NPTlNUUlVDVE9SXCIpO1xuICAgIH1cblxuICAgIGlmICh0eXBlb2Ygb3B0aW9ucyAhPT0gXCJvYmplY3RcIikge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUiBXUk9OR19UWVBFIDogb3B0aW9ucyBzaG91bGQgYmUgYW4gb2JqZWN0XCIpO1xuICAgIH1cblxuICAgIHRoaXMuX2luaXRpYWxpemUob3B0aW9ucyk7XG5cbiAgICB0aGlzLl9jYWxsYmFja3MgPSB7fTtcblxuICAgIC8vIGluaXQgY29udHJvbCBET00gY29udGFpbmVyXG4gICAgdmFyIGNvbnRhaW5lciA9IHRoaXMuX2luaXRDb250YWluZXIob3B0aW9ucyk7XG5cbiAgICBXaWRnZXQuY2FsbChcbiAgICAgICAgdGhpcywge1xuICAgICAgICAgICAgbmFtZSA6IFwiTW91c2VQb3NpdGlvblwiLFxuICAgICAgICAgICAgZWxlbWVudCA6IGNvbnRhaW5lcixcbiAgICAgICAgICAgIHRhcmdldCA6IG9wdGlvbnMudGFyZ2V0LFxuICAgICAgICAgICAgcG9zaXRpb24gOiBvcHRpb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JkZWdyw6lzIGTDqWNpbWF1eFwiLFxuICAgICAgICAgICAgY29udmVydCA6IHRoaXMuX2Rpc3BsYXlERUNcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgY29kZSA6IFwiRE1TXCIsXG4gICAgICAgICAgICBsYWJlbCA6IFwiZGVncsOpcyBzZXhhZ8Opc2ltYXV4XCIsXG4gICAgICAgICAgICBjb252ZXJ0IDogdGhpcy5fZGlzcGxheURNU1xuICAgICAgICB9LCB7XG4gICAgICAgICAgICBjb2RlIDogXCJSQURcIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJyYWRpYW5zXCIsXG4gICAgICAgICAgICBjb252ZXJ0IDogdGhpcy5fZGlzcGxheVJBRFxuICAgICAgICB9LCB7XG4gICAgICAgICAgICBjb2RlIDogXCJHT05cIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJncmFkZXNcIixcbiAgICAgICAgICAgIGNvbnZlcnQgOiB0aGlzLl9kaXNwbGF5R09OXG4gICAgICAgIH1dLFxuICAgICAgICBNZXRyaWMgOiBbe1xuICAgICAgICAgICAgY29kZSA6IFwiTVwiLFxuICAgICAgICAgICAgbGFiZWwgOiBcIm3DqHRyZXNcIixcbiAgICAgICAgICAgIGNvbnZlcnQgOiB0aGlzLl9kaXNwbGF5TWV0ZXJcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgY29kZSA6IFwiS01cIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJraWxvbcOodHJlc1wiLFxuICAgICAgICAgICAgY29udmVydCA6IHRoaXMuX2Rpc3BsYXlLTWV0ZXJcbiAgICAgICAgfV1cbiAgICB9O1xuXG4gICAgdmFyIHVuaXRzID0gdGhpcy5vcHRpb25zLnVuaXRzO1xuXG4gICAgZm9yICh2YXIgdHlwZSBpbiBwcm9qZWN0aW9uVW5pdHNCeURlZmF1bHQpIHtcbiAgICAgICAgaWYgKHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdC5oYXNPd25Qcm9wZXJ0eSh0eXBlKSkge1xuICAgICAgICAgICAgdmFyIGZvdW5kID0gZmFsc2U7XG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdFt0eXBlXS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIHZhciBvYmogPSBwcm9qZWN0aW9uVW5pdHNCeURlZmF1bHRbdHlwZV1bal07XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1bml0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdW5pdCA9IHVuaXRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAob2JqLmNvZGUgPT09IHVuaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fcHJvamVjdGlvblVuaXRzW3R5cGVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fcHJvamVjdGlvblVuaXRzW3R5cGVdID0gW107XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9wcm9qZWN0aW9uVW5pdHNbdHlwZV0ucHVzaChvYmopO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFmb3VuZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3Byb2plY3Rpb25Vbml0c1t0eXBlXSA9IHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdFt0eXBlXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIGluIGNhc2Ugb2YuLi5cbiAgICBpZiAodHlwZW9mIHRoaXMuX3Byb2plY3Rpb25Vbml0cyA9PT0gXCJvYmplY3RcIiAmJiBPYmplY3Qua2V5cyh0aGlzLl9wcm9qZ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0aW9uUHJvamVjdGlvblN5c3RlbVwiKSk7XG4gICAgc3lzdGVtTGlzdC5pbm5lckhUTUwgPSBcIlwiO1xuXG4gICAgdmFyIG9wdGlvbjtcblxuICAgIC8vIGFkZCBzeXN0ZW1zIHdob3NlIGV4dGVudCBpbnRlcnNlY3RzIHRoZSBnbG9iZSBleHRlbnRcbiAgICBmb3IgKHZhciBqID0gMDsgaiA8IHRoaXMuX3Byb2plY3Rpb25TeXN0ZW1zLmxlbmd0aDsgaisrKSB7XG4gICAgICAgIHZhciBwcm9qID0gdGhpcy5fcHJvamVjdGlvblN5c3RlbXNbal07XG4gICAgICAgIGlmIChwcm9qLmdlb0JCb3gpIHtcbiAgICAgICAgICAgIC8vIGJib3hlcyBpbnRlcnNlY3Rpb24gdGVzdFxuICAgICAgICAgICAgaWYgKGdsb2JlRXh0ZW50Lndlc3QgPiBwcm9qLmdlb0JCb3gucmlnaHQgfHxcbiAgICAgICAgICAgICAgICBnbG9iZUV4dGVudC5zb3V0aCA+IHByb2ouZ2VvQkJveC50b3AgfHxcbiAgICAgICAgICAgICAgICBnbG9iZUV4dGVudC5lYXN0IDwgcHJvai5nZW9CQm94LmxlZnQgfHxcbiAgICAgICAgICAgICAgICBnbG9iZUV4dGVudC5ub3J0aCA8IHByb2ouZ2VvQkJveC5ib3R0b21cbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIGlmIChwcm9qID09PSB0aGlzLl9jdXJyZW50UHJvamVjdGlvblN5c3RlbXMpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcIm9wdGlvblwiKTtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uLnZhbHVlID0gcHJvai5jb2RlO1xuICAgICAgICAgICAgICAgICAgICBvcHRpb24udGV4dCA9IHByb2oubGFiZWwgfHwgajtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uLnNldEF0dHJpYnV0ZShcInNlbGVjdGVkXC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EBwcml2YXRlXG4gKi9cbk1vdXNlUG9zaXRpb24ucHJvdG90eXBlLm9uTW91c2VQb3NpdGlvblByb2plY3Rpb25Vbml0c0NoYW5nZSA9IGZ1bmN0aW9uIChlKSB7XG4gICAgdmFyIGlkeCA9IGUudGFyZ2V0LnNlbGVjdGVkSW5kZXg7XG4gICAgdmFyIHZhbHVlID0gZS50YXJnZXQub3B0aW9uc1tpZHhdLnZhbHVlO1xuXG4gICAgdGhpcy5fY3VycmVudFByb2plY3Rpb25Vbml0cyA9IHZhbHVlO1xuXG4gICAgLy8gc2ltdWxhdGVzIGEgbW92ZW1lbnQgaW4gdGFjdGlsZSBtb2RlIHRvIHVwZGF0ZSB0aGUgcmVzdWx0c1xuICAgIGlmICghdGhpcy5faXNEZXNrdG9wKSB7XG4gICAgICAgIHRoaXMub25HbG9iZU1vdmUoKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBNb3VzZVBvc2l0aW9uO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/MousePosition.js\n"); /***/ }), @@ -1475,7 +1487,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var proj /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/ScaleDOM */ \"./src/Common/Controls/ScaleDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display the scalebar with itowns\n *\n * @constructor\n * @alias itowns.control.Scale\n * @extends {itowns.control.Widget}\n * @alias itowns.control.Scale\n * @param {Object} options - widget options\n * @param {String} options.target - HTML target element or HTML target element id\n * @param {String} options.position - \"absolute\" or \"relative\"\n * @example\n * var scale = new itowns.control.Scale();\n *\n */\nfunction Scale(options) {\n if (!(this instanceof Scale)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer();\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"GraphicScale\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:Scale\n */\nScale.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class ScaleDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(Scale.prototype, _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nScale.prototype.constructor = Scale;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nScale.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var self = this;\n /**\n * Definition of the scaleControl callback :\n * when the view is changing, we recalculate the graphic scale\n */\n this._callbacks.onChangedViewCallback = function () {\n var value = globe.pixelsToMeters(200);\n value = Math.floor(value);\n var digit = Math.pow(10, value.toString().length - 1);\n value = Math.round(value / digit) * digit;\n var pix = globe.metersToPixels(value);\n var unit = \"m\";\n if (value >= 1000) {\n value /= 1000;\n unit = \"km\";\n }\n self.getElement().innerHTML = value + \" \" + unit;\n self.getElement().style.width = pix + \"px\";\n };\n // Ajout des listeners\n // initialization\n if (globe.isInitialized()) {\n this._callbacks.onChangedViewCallback();\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback);\n }\n\n // At every globe range movement, scale bar may be updated,\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback);\n } else if (globe == null) {\n // we remove the listeners linked to the scalecontrol which has been deleted\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback);\n\n // if globe == null we remove the scale control\n // delete the scaleControl DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Scale control (called by constructor)\n *\n * @private\n */\nScale.prototype._initialize = function () {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._ScaleContainer = null;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Create control main container\n *\n * @method _initContainer\n * @returns {DOMElement} container - widget container\n * @private\n */\nScale.prototype._initContainer = function () {\n var container = this._createMainContainerElement();\n return container;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Scale);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvU2NhbGUuanM/YzZjMSJdLCJuYW1lcyI6WyJTY2FsZSIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJfdHlwZW9mIiwiRXJyb3IiLCJfaW5pdGlhbGl6ZSIsImNvbnRhaW5lciIsIl9pbml0Q29udGFpbmVyIiwiV2lkZ2V0IiwiY2FsbCIsIm5hbWUiLCJlbGVtZW50IiwidGFyZ2V0IiwicG9zaXRpb24iLCJwcm90b3R5cGUiLCJPYmplY3QiLCJjcmVhdGUiLCJVdGlscyIsImFzc2lnbiIsIlNjYWxlRE9NIiwiY29uc3RydWN0b3IiLCJzZXRHbG9iZSIsImdsb2JlIiwic2VsZiIsIl9jYWxsYmFja3MiLCJvbkNoYW5nZWRWaWV3Q2FsbGJhY2siLCJ2YWx1ZSIsInBpeGVsc1RvTWV0ZXJzIiwiTWF0aCIsImZsb29yIiwiZGlnaXQiLCJwb3ciLCJ0b1N0cmluZyIsImxlbmd0aCIsInJvdW5kIiwicGl4IiwibWV0ZXJzVG9QaXhlbHMiLCJ1bml0IiwiZ2V0RWxlbWVudCIsImlubmVySFRNTCIsInN0eWxlIiwid2lkdGgiLCJpc0luaXRpYWxpemVkIiwibGlzdGVuIiwiR2xvYmVWaWV3RXh0ZW5kZW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fTtcbn07XG5cbi8qKlxuICogQ3JlYXRlIGNvbnRyb2wgbWFpbiBjb250YWluZXJcbiAqXG4gKiBAbWV0aG9kIF9pbml0Q29udGFpbmVyXG4gKiBAcmV0dXJucyB7RE9NRWxlbWVudH0gY29udGFpbmVyIC0gd2lkZ2V0IGNvbnRhaW5lclxuICogQHByaXZhdGVcbiAqL1xuU2NhbGUucHJvdG90eXBlLl9pbml0Q29udGFpbmVyID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBjb250YWluZXIgPSB0aGlzLl9jcmVhdGVNYWluQ29udGFpbmVyRWxlbWVudCgpO1xuXG4gICAgcmV0dXJuIGNvbnRhaW5lcjtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFNjYWxlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Scale.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/ScaleDOM */ \"./src/Common/Controls/ScaleDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display the scalebar with itowns\n *\n * @constructor\n * @alias itowns.control.Scale\n * @extends {itowns.control.Widget}\n * @alias itowns.control.Scale\n * @param {Object} options - widget options\n * @param {String} options.target - HTML target element or HTML target element id\n * @param {String} options.position - \"absolute\" or \"relative\"\n * @example\n * var scale = new itowns.control.Scale();\n *\n */\nfunction Scale(options) {\n if (!(this instanceof Scale)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer();\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"GraphicScale\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:Scale\n */\nScale.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class ScaleDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(Scale.prototype, _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nScale.prototype.constructor = Scale;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nScale.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var self = this;\n /**\n * Definition of the scaleControl callback :\n * when the view is changing, we recalculate the graphic scale\n */\n this._callbacks.onChangedViewCallback = function () {\n var value = globe.pixelsToMeters(200);\n value = Math.floor(value);\n var digit = Math.pow(10, value.toString().length - 1);\n value = Math.round(value / digit) * digit;\n var pix = globe.metersToPixels(value);\n var unit = \"m\";\n if (value >= 1000) {\n value /= 1000;\n unit = \"km\";\n }\n self.getElement().innerHTML = value + \" \" + unit;\n self.getElement().style.width = pix + \"px\";\n };\n // Ajout des listeners\n // initialization\n if (globe.isInitialized()) {\n this._callbacks.onChangedViewCallback();\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback);\n }\n\n // At every globe range movement, scale bar may be updated,\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback);\n } else if (globe == null) {\n // we remove the listeners linked to the scalecontrol which has been deleted\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback);\n\n // if globe == null we remove the scale control\n // delete the scaleControl DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Scale control (called by constructor)\n *\n * @private\n */\nScale.prototype._initialize = function () {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._ScaleContainer = null;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Create control main container\n *\n * @method _initContainer\n * @returns {DOMElement} container - widget container\n * @private\n */\nScale.prototype._initContainer = function () {\n var container = this._createMainContainerElement();\n return container;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Scale);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvU2NhbGUuanM/YzZjMSJdLCJuYW1lcyI6WyJTY2FsZSIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJfdHlwZW9mIiwiRXJyb3IiLCJfaW5pdGlhbGl6ZSIsImNvbnRhaW5lciIsIl9pbml0Q29udGFpbmVyIiwiV2lkZ2V0IiwiY2FsbCIsIm5hbWUiLCJlbGVtZW50IiwidGFyZ2V0IiwicG9zaXRpb24iLCJwcm90b3R5cGUiLCJPYmplY3QiLCJjcmVhdGUiLCJVdGlscyIsImFzc2lnbiIsIlNjYWxlRE9NIiwiY29uc3RydWN0b3IiLCJzZXRHbG9iZSIsImdsb2JlIiwic2VsZiIsIl9jYWxsYmFja3MiLCJvbkNoYW5nZWRWaWV3Q2FsbGJhY2siLCJ2YWx1ZSIsInBpeGVsc1RvTWV0ZXJzIiwiTWF0aCIsImZsb29yIiwiZGlnaXQiLCJwb3ciLCJ0b1N0cmluZyIsImxlbmd0aCIsInJvdW5kIiwicGl4IiwibWV0ZXJzVG9QaXhlbHMiLCJ1bml0IiwiZ2V0RWxlbWVudCIsImlubmVySFRNTCIsInN0eWxlIiwid2lkdGgiLCJpc0luaXRpYWxpemVkIiwibGlzdGVuIiwiR2xvYmVWaWV3RXh0ZW5kZWQiLCJFVkVOVFMiLCJHTE9CRV9JTklUSUFMSVpFRCIsIlJBTkdFX0NIQU5HRUQiLCJfZ2xvYmUiLCJmb3JnZXQiLCJoYXNDaGlsZE5vZGVzIiwicmVtb3ZlQ2hpbGQiLCJsYXN0Q2hpbGQiLCJwYXJlbnROb2RlIiwiX3VpZCIsIlNlbGVjdG9ySUQiLCJnZW5lcmF0ZSIsIl9TY2FsZUNv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q29udGFpbmVyID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBjb250YWluZXIgPSB0aGlzLl9jcmVhdGVNYWluQ29udGFpbmVyRWxlbWVudCgpO1xuXG4gICAgcmV0dXJuIGNvbnRhaW5lcjtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFNjYWxlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Scale.js\n"); /***/ }), @@ -1583,7 +1595,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CSS /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Services\", function() { return Services; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Error\", function() { return Error; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Helper\", function() { return Helper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Protocols\", function() { return Protocols; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesDate\", function() { return servicesDate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesVersion\", function() { return servicesVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtVersion\", function() { return itownsExtVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtDate\", function() { return itownsExtDate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtended\", function() { return Itowns; });\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./package.json\", 1);\n/* harmony import */ var _Common_Styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/Styles */ \"./src/Common/Styles.js\");\n/* harmony import */ var _Styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Styles */ \"./src/Itowns/Styles.js\");\n/* harmony import */ var _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Controls/MousePosition */ \"./src/Itowns/Controls/MousePosition.js\");\n/* harmony import */ var _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Controls/LayerSwitcher */ \"./src/Itowns/Controls/LayerSwitcher.js\");\n/* harmony import */ var _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Controls/BoostRelief */ \"./src/Itowns/Controls/BoostRelief.js\");\n/* harmony import */ var _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Controls/Buildings */ \"./src/Itowns/Controls/Buildings.js\");\n/* harmony import */ var _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Controls/Attributions */ \"./src/Itowns/Controls/Attributions.js\");\n/* harmony import */ var _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Controls/Scale */ \"./src/Itowns/Controls/Scale.js\");\n/* harmony import */ var _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Controls/MiniGlobe */ \"./src/Itowns/Controls/MiniGlobe.js\");\n/* harmony import */ var _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Layer/LayerWMTS */ \"./src/Itowns/Layer/LayerWMTS.js\");\n/* harmony import */ var _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Layer/LayerWMS */ \"./src/Itowns/Layer/LayerWMS.js\");\n/* harmony import */ var _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Layer/LayerElevation */ \"./src/Itowns/Layer/LayerElevation.js\");\n/* harmony import */ var _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Layer/VectorTileLayer */ \"./src/Itowns/Layer/VectorTileLayer.js\");\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CRS/CRS */ \"./src/Itowns/CRS/CRS.js\");\n/* harmony import */ var _Common_Utils_AutoLoadConfig__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../Common/Utils/AutoLoadConfig */ \"./src/Common/Utils/AutoLoadConfig.js\");\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../Common/Utils/LayerUtils */ \"./src/Common/Utils/LayerUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LayerUtils\", function() { return _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../Common/Utils/ProxyUtils */ \"./src/Common/Utils/ProxyUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ProxyUtils\", function() { return _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../Common/Utils/ColorUtils */ \"./src/Common/Utils/ColorUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ColorUtils\", function() { return _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../Common/Utils/MathUtils */ \"./src/Common/Utils/MathUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MathUtils\", function() { return _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Logger\", function() { return _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__[\"default\"]; });\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n/**\n* Global variable Gp.\n*\n* @module Gp\n* @alias Gp\n* @desc\n*\n* This is the global variable that is exposed in the browser environment.\n* Content is composed of constructor, functions and properties...\n*\n* > ColorUtils: (...)\n* > LayerUtils: (...)\n* > MathUtils: (...)\n* > ProxyUtils: (...)\n* > Logger: (...)\n*\n* > itownsExtended: (...)\n*\n* > itownsExtVersion: \"YYYY-MM-DD\"\n* > itownsExtVersion: \"X.X.X\"\n*\n* > Error: (...)\n* > Helper: (...)\n* > Protocols: (...)\n* > Services: (...)\n* > servicesDate: \"YYYY-MM-DD\"\n* > servicesVersion: \"X.X.X\"\n*\n* The following variables are aslo global :\n* - proj4,\n* - itowns\n*/\n\n\n\n// CSS communes aux extensions !\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Autoload...\n\n\n// export des services\n\n\n// reconstruction des ns\nvar Services = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Services;\nvar Error = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Error;\nvar Helper = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Helper;\nvar Protocols = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Protocols;\nvar servicesDate = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].servicesDate;\nvar servicesVersion = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].servicesVersion;\n\n\n// Adds the extensions properties in the namespace\n\n\n\n\n\nfunction deepCopy(source, target) {\n // Implementing Tail Call Elimination\n function tce(source, target) {\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n if (!target.hasOwnProperty(prop)) {\n target[prop] = source[prop];\n } else if (_typeof(source[prop]) === \"object\") {\n tce(source[prop], target[prop]);\n }\n }\n }\n }\n return tce(source, target);\n}\n\n// Adds extensions properties in the namespace\n/** Version */\nvar itownsExtVersion = _package_json__WEBPACK_IMPORTED_MODULE_0__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_0__.version;\n/** Publication date */\nvar itownsExtDate = _package_json__WEBPACK_IMPORTED_MODULE_0__.date;\n\n// creation of the namespace for the itowns extensions\nvar Itowns = {};\nItowns.control = {};\nItowns.control.MousePosition = _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\nItowns.control.LayerSwitcher = _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\nItowns.control.BoostRelief = _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\nItowns.control.Buildings = _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\nItowns.control.Attributions = _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\nItowns.control.Scale = _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\nItowns.control.MiniGlobe = _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\nItowns.layer = {};\nItowns.layer.GeoportalWMTS = _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__[\"default\"];\nItowns.layer.GeoportalWMS = _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\nItowns.layer.GeoportalElevation = _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\nItowns.layer.VectorTileLayer = _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__[\"default\"];\nItowns.CRS = _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__[\"default\"];\nItowns.GlobeViewExtended = _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__[\"default\"];\n\n\n// Expose extensions extended into itowns\nif (window.itowns) {\n // on fusionne les fonctionnalités o\n deepCopy(Itowns, window.itowns);\n deepCopy(window.itowns, Itowns);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvaW5kZXguanM/NGYwYSJdLCJuYW1lcyI6WyJTZXJ2aWNlcyIsIkdwIiwiRXJyb3IiLCJIZWxwZXIiLCJQcm90b2NvbHMiLCJzZXJ2aWNlc0RhdGUiLCJzZXJ2aWNlc1ZlcnNpb24iLCJkZWVwQ29weSIsInNvdXJjZSIsInRhcmdldCIsInRjZSIsInByb3AiLCJoYXNPd25Qcm9wZXJ0eSIsIl90eXBlb2YiLCJpdG93bnNFeHRWZXJzaW9uIiwiUGtnIiwidmVyc2lvbiIsIml0b3duc0V4dERhdGUiLCJkYXRlIiwiSXRvd25zIiwiY29udHJvbCIsIk1vdXNlUG9zaXRpb24iLCJMYXllclN3aXRjaGVyIiwiQm9vc3RSZWxpZWYiLCJCdWlsZGluZ3MiLCJBdHRyaWJ1dGlvb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js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Services\", function() { return Services; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Error\", function() { return Error; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Helper\", function() { return Helper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Protocols\", function() { return Protocols; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesDate\", function() { return servicesDate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesVersion\", function() { return servicesVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtVersion\", function() { return itownsExtVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtDate\", function() { return itownsExtDate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtended\", function() { return Itowns; });\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./package.json\", 1);\n/* harmony import */ var _Common_Styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/Styles */ \"./src/Common/Styles.js\");\n/* harmony import */ var _Styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Styles */ \"./src/Itowns/Styles.js\");\n/* harmony import */ var _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Controls/MousePosition */ \"./src/Itowns/Controls/MousePosition.js\");\n/* harmony import */ var _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Controls/LayerSwitcher */ \"./src/Itowns/Controls/LayerSwitcher.js\");\n/* harmony import */ var _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Controls/BoostRelief */ \"./src/Itowns/Controls/BoostRelief.js\");\n/* harmony import */ var _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Controls/Buildings */ \"./src/Itowns/Controls/Buildings.js\");\n/* harmony import */ var _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Controls/Attributions */ \"./src/Itowns/Controls/Attributions.js\");\n/* harmony import */ var _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Controls/Scale */ \"./src/Itowns/Controls/Scale.js\");\n/* harmony import */ var _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Controls/MiniGlobe */ \"./src/Itowns/Controls/MiniGlobe.js\");\n/* harmony import */ var _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Layer/LayerWMTS */ \"./src/Itowns/Layer/LayerWMTS.js\");\n/* harmony import */ var _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Layer/LayerWMS */ \"./src/Itowns/Layer/LayerWMS.js\");\n/* harmony import */ var _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Layer/LayerElevation */ \"./src/Itowns/Layer/LayerElevation.js\");\n/* harmony import */ var _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Layer/VectorTileLayer */ \"./src/Itowns/Layer/VectorTileLayer.js\");\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CRS/CRS */ \"./src/Itowns/CRS/CRS.js\");\n/* harmony import */ var _Common_Utils_AutoLoadConfig__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../Common/Utils/AutoLoadConfig */ \"./src/Common/Utils/AutoLoadConfig.js\");\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../Common/Utils/LayerUtils */ \"./src/Common/Utils/LayerUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LayerUtils\", function() { return _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../Common/Utils/ProxyUtils */ \"./src/Common/Utils/ProxyUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ProxyUtils\", function() { return _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../Common/Utils/ColorUtils */ \"./src/Common/Utils/ColorUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ColorUtils\", function() { return _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../Common/Utils/MathUtils */ \"./src/Common/Utils/MathUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MathUtils\", function() { return _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Logger\", function() { return _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__[\"default\"]; });\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n* Global variable Gp.\n*\n* @module Gp\n* @alias Gp\n* @desc\n*\n* This is the global variable that is exposed in the browser environment.\n* Content is composed of constructor, functions and properties...\n*\n* > ColorUtils: (...)\n* > LayerUtils: (...)\n* > MathUtils: (...)\n* > ProxyUtils: (...)\n* > Logger: (...)\n*\n* > itownsExtended: (...)\n*\n* > itownsExtVersion: \"YYYY-MM-DD\"\n* > itownsExtVersion: \"X.X.X\"\n*\n* > Error: (...)\n* > Helper: (...)\n* > Protocols: (...)\n* > Services: (...)\n* > servicesDate: \"YYYY-MM-DD\"\n* > servicesVersion: \"X.X.X\"\n*\n* The following variables are aslo global :\n* - proj4,\n* - itowns\n*/\n\n\n\n// CSS communes aux extensions !\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Autoload...\n\n\n// export des services\n\n\n// reconstruction des ns\nvar Services = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Services;\nvar Error = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Error;\nvar Helper = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Helper;\nvar Protocols = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Protocols;\nvar servicesDate = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].servicesDate;\nvar servicesVersion = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].servicesVersion;\n\n\n// Adds the extensions properties in the namespace\n\n\n\n\n\nfunction deepCopy(source, target) {\n // Implementing Tail Call Elimination\n function tce(source, target) {\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n if (!target.hasOwnProperty(prop)) {\n target[prop] = source[prop];\n } else if (_typeof(source[prop]) === \"object\") {\n tce(source[prop], target[prop]);\n }\n }\n }\n }\n return tce(source, target);\n}\n\n// Adds extensions properties in the namespace\n/** Version */\nvar itownsExtVersion = _package_json__WEBPACK_IMPORTED_MODULE_0__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_0__.version;\n/** Publication date */\nvar itownsExtDate = _package_json__WEBPACK_IMPORTED_MODULE_0__.date;\n\n// creation of the namespace for the itowns extensions\nvar Itowns = {};\nItowns.control = {};\nItowns.control.MousePosition = _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\nItowns.control.LayerSwitcher = _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\nItowns.control.BoostRelief = _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\nItowns.control.Buildings = _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\nItowns.control.Attributions = _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\nItowns.control.Scale = _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\nItowns.control.MiniGlobe = _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\nItowns.layer = {};\nItowns.layer.GeoportalWMTS = _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__[\"default\"];\nItowns.layer.GeoportalWMS = _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\nItowns.layer.GeoportalElevation = _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\nItowns.layer.VectorTileLayer = _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__[\"default\"];\nItowns.CRS = _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__[\"default\"];\nItowns.GlobeViewExtended = _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__[\"default\"];\n\n\n// Expose extensions extended into itowns\nif (window.itowns) {\n // on fusionne les fonctionnalités o\n deepCopy(Itowns, window.itowns);\n deepCopy(window.itowns, Itowns);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvaW5kZXguanM/NGYwYSJdLCJuYW1lcyI6WyJTZXJ2aWNlcyIsIkdwIiwiRXJyb3IiLCJIZWxwZXIiLCJQcm90b2NvbHMiLCJzZXJ2aWNlc0RhdGUiLCJzZXJ2aWNlc1ZlcnNpb24iLCJkZWVwQ29weSIsInNvdXJjZSIsInRhcmdldCIsInRjZSIsInByb3AiLCJoYXNPd25Qcm9wZXJ0eSIsIl90eXBlb2YiLCJpdG93bnNFeHRWZXJzaW9uIiwiUGtnIiwidmVyc2lvbiIsIml0b3duc0V4dERhdGUiLCJkYXRlIiwiSXRvd25zIiwiY29udHJvbCIsIk1vdXNlUG9zaXRpb24iLCJMYXllclN3aXRjaGVyIiwiQm9vc3RSZWxpZWYiLCJCdWlsZGluZ3MiLCJBdHRyaWJ1dGlvbnMiLCJTY2FsZSIsIk1pbmlHbG9iZSIsImxheWVyIiwiR2VvcG9ydGFsV01UUyIsIkdlb3BvcnRhbFdNUyIsIkdlb3BvcnRhbEVsZXZhdGlvbiIsIlZlY3RvclRpbGVMYXllciIsIkNSUyIsIkdsb2JlVmlld0V4dGVuZGVkIiwid2luZG93IiwiaXRvd25zIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ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nRhbFdNVFMgPSBHZW9wb3J0YWxXTVRTO1xuSXRvd25zLmxheWVyLkdlb3BvcnRhbFdNUyA9IEdlb3BvcnRhbFdNUztcbkl0b3ducy5sYXllci5HZW9wb3J0YWxFbGV2YXRpb24gPSBHZW9wb3J0YWxFbGV2YXRpb247XG5JdG93bnMubGF5ZXIuVmVjdG9yVGlsZUxheWVyID0gVmVjdG9yVGlsZUxheWVyO1xuSXRvd25zLkNSUyA9IENSUztcbkl0b3ducy5HbG9iZVZpZXdFeHRlbmRlZCA9IEdsb2JlVmlld0V4dGVuZGVkO1xuXG5leHBvcnQge1xuICAgIC8qKiBFeHBvc2UgZXh0ZW5zaW9ucyBleHRlbmRlZCAqL1xuICAgIEl0b3ducyBhcyBpdG93bnNFeHRlbmRlZFxufTtcblxuLy8gRXhwb3NlIGV4dGVuc2lvbnMgZXh0ZW5kZWQgaW50byBpdG93bnNcbmlmICh3aW5kb3cuaXRvd25zKSB7XG4gICAgLy8gb24gZnVzaW9ubmUgbGVzIGZvbmN0aW9ubmFsaXTDqXMgb1xuICAgIGRlZXBDb3B5KEl0b3ducywgd2luZG93Lml0b3ducyk7XG4gICAgZGVlcENvcHkod2luZG93Lml0b3ducywgSXRvd25zKTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/index.js\n"); /***/ }), diff --git a/current/dist/itowns/GpPluginItowns-src.css b/current/dist/itowns/GpPluginItowns-src.css index 0296e4c71..b47ec69ac 100644 --- a/current/dist/itowns/GpPluginItowns-src.css +++ b/current/dist/itowns/GpPluginItowns-src.css @@ -9,8 +9,8 @@ * @copyright copyright (c) IGN * @license CeCILL-B * @author IGN - * @version 2.4.3 - * @date 04/08/2023 + * @version 2.5.0-beta + * @date 21/09/2023 * */ diff --git a/current/dist/itowns/GpPluginItowns-src.js b/current/dist/itowns/GpPluginItowns-src.js index 9b5b519ba..785e968bf 100644 --- a/current/dist/itowns/GpPluginItowns-src.js +++ b/current/dist/itowns/GpPluginItowns-src.js @@ -9,8 +9,8 @@ * @copyright copyright (c) IGN * @license CeCILL-B * @author IGN - * @version 2.4.3 - * @date 04/08/2023 + * @version 2.5.0-beta + * @date 21/09/2023 * */ @@ -80,7 +80,7 @@ exports["Gp"] = factory(require("node-fetch"), require("xmldom"), require("itowns")); else root["Gp"] = factory(root[undefined], root[undefined], root["itowns"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE__47__, __WEBPACK_EXTERNAL_MODULE__48__, __WEBPACK_EXTERNAL_MODULE__93__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE__47__, __WEBPACK_EXTERNAL_MODULE__48__, __WEBPACK_EXTERNAL_MODULE__94__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -187,36 +187,36 @@ var _package_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpac /* harmony import */ var _Common_Styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); /* harmony import */ var _Styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21); /* harmony import */ var _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30); -/* harmony import */ var _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(101); -/* harmony import */ var _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(104); -/* harmony import */ var _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(106); -/* harmony import */ var _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(108); -/* harmony import */ var _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(111); -/* harmony import */ var _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(113); -/* harmony import */ var _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(115); -/* harmony import */ var _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(117); -/* harmony import */ var _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(118); -/* harmony import */ var _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(119); -/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(92); -/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(100); -/* harmony import */ var _Common_Utils_AutoLoadConfig__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(120); +/* harmony import */ var _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(102); +/* harmony import */ var _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(105); +/* harmony import */ var _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(107); +/* harmony import */ var _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(109); +/* harmony import */ var _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(112); +/* harmony import */ var _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(114); +/* harmony import */ var _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(116); +/* harmony import */ var _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(118); +/* harmony import */ var _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(119); +/* harmony import */ var _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(120); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(93); +/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(101); +/* harmony import */ var _Common_Utils_AutoLoadConfig__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(121); /* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36); -/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(109); +/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(110); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LayerUtils", function() { return _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__["default"]; }); -/* harmony import */ var _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(121); +/* harmony import */ var _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(122); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProxyUtils", function() { return _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__["default"]; }); -/* harmony import */ var _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(122); +/* harmony import */ var _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(123); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorUtils", function() { return _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__["default"]; }); -/* harmony import */ var _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(123); +/* harmony import */ var _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(124); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MathUtils", function() { return _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__["default"]; }); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(34); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__["default"]; }); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /** * Global variable Gp. * @@ -342,7 +342,7 @@ if (window.itowns) { /* 1 */ /***/ (function(module) { -module.exports = JSON.parse("{\"name\":\"geoportal-extensions\",\"description\":\"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries\",\"version\":\"2.8.4\",\"date\":\"04/08/2023\",\"leafletExtName\":\"French Geoportal Extension for Leaflet\",\"leafletExtVersion\":\"2.3.3\",\"olExtName\":\"French Geoportal Extension for OpenLayers\",\"olExtVersion\":\"3.3.3\",\"itownsExtName\":\"French Geoportal Extension for Itowns\",\"itownsExtVersion\":\"2.4.3\",\"main\":\"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js\",\"types\":\"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts\",\"module\":\"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js\",\"directories\":{},\"scripts\":{\"setup\":\"npm install\",\"clean\":\"echo \\\"Warning: target not yet implemented!\\\" && exit 0\",\"eslint\":\"eslint src/\",\"test\":\"npm run test:serve\",\"test:serve\":\"cd test && webpack-dev-server --hot --config webpack.test.serve.js\",\"sample\":\"npm run sample:serve\",\"sample:serve\":\"npm run sample:ol:serve\",\"sample:itowns:serve\":\"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path '/dist/itowns/' --port 9001 --open\",\"sample:leaflet:serve\":\"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path '/dist/leaflet/' --port 9001 --open\",\"sample:ol:serve\":\"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path '/dist/openlayers/' --port 9001 --open\",\"generate-types:ol\":\"npx tsc -p build/types/tsconfig-openlayers.json\",\"generate-types:leaflet\":\"npx tsc -p build/types/tsconfig-leaflet.json\",\"generate-types:itowns\":\"npx tsc -p build/types/tsconfig-itowns.json\",\"generate-jsdoc:ol\":\"jsdoc -c build/jsdoc/jsdoc-openlayers.json\",\"generate-jsdoc:leaflet\":\"jsdoc -c build/jsdoc/jsdoc-leaflet.json\",\"generate-jsdoc:itowns\":\"jsdoc -c build/jsdoc/jsdoc-itowns.json\",\"doc\":\"npm run doc:serve\",\"doc:serve\":\"npm run doc:ol:serve\",\"doc:itowns:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open\",\"doc:leaflet:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open\",\"doc:ol:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open\",\"build:dev\":\"npm-run-all --print-label --print-name build:*:dev\",\"build:prod\":\"npm-run-all --print-label --print-name build:*:prod\",\"build:src\":\"npm-run-all --print-label --print-name build:*:src\",\"build\":\"npm-run-all --print-label --print-name build:*:*\",\"build:itowns\":\"npm-run-all --print-label --print-name build:itowns:*\",\"build:itowns:dev\":\"webpack --config build/webpack/webpack.config.itowns --mode=development\",\"build:itowns:prod\":\"webpack --config build/webpack/webpack.config.itowns --mode=production\",\"build:itowns:src\":\"webpack --config build/webpack/webpack.config.itowns --mode=none\",\"build:ol\":\"npm-run-all --print-label --print-name build:ol:*\",\"build:ol:dev\":\"webpack --config build/webpack/webpack.config.openlayers --mode=development\",\"build:ol:prod\":\"webpack --config build/webpack/webpack.config.openlayers --mode=production\",\"build:ol:src\":\"webpack --config build/webpack/webpack.config.openlayers --mode=none\",\"build:leaflet\":\"npm-run-all --print-label --print-name build:leaflet:*\",\"build:leaflet:dev\":\"webpack --config build/webpack/webpack.config.leaflet --mode=development\",\"build:leaflet:prod\":\"webpack --config build/webpack/webpack.config.leaflet --mode=production\",\"build:leaflet:src\":\"webpack --config build/webpack/webpack.config.leaflet --mode=none\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/IGNF/geoportal-extensions.git\"},\"author\":\"IGNF\",\"keywords\":[\"geoportail\",\"javascript\",\"OpenLayers\",\"Leaflet\",\"Itowns\",\"3D\"],\"license\":\"CECILL-B\",\"bugs\":{\"url\":\"https://github.com/IGNF/geoportal-extensions/issues\"},\"homepage\":\"https://github.com/IGNF/geoportal-extensions#readme\",\"dependencies\":{\"@mapbox/mapbox-gl-style-spec\":\"13.20.1\",\"eventbusjs\":\"0.2.0\",\"geoportal-access-lib\":\"3.3.3\",\"itowns\":\"2.38.2\",\"leaflet\":\"1.7.1\",\"leaflet-draw\":\"1.0.4\",\"loglevel\":\"^1.6.7\",\"markdown-toc\":\"^1.2.0\",\"ol\":\"6.9.0\",\"ol-mapbox-style\":\"6.7.0\",\"proj4\":\"2.7.5\",\"proj4leaflet\":\"1.0.2\",\"sortablejs\":\"1.14.0\",\"three\":\"0.137.5\",\"typescript\":\"^4.5.5\",\"whatwg-fetch\":\"3.0.0\"},\"devDependencies\":{\"@babel/core\":\"^7.4.4\",\"@babel/plugin-transform-template-literals\":\"^7.7.4\",\"@babel/preset-env\":\"^7.4.4\",\"babel-loader\":\"^8.0.5\",\"chai\":\"^4.2.0\",\"chalk\":\"^4.0.0\",\"clean-webpack-plugin\":\"^3.0.0\",\"copy-webpack-plugin\":\"^5.0.3\",\"core-js\":\"^3.6.4\",\"css-loader\":\"^3.4.2\",\"eslint\":\"^6.8.0\",\"eslint-config-standard\":\"^14.1.1\",\"eslint-loader\":\"^4.0.0\",\"eslint-plugin-import\":\"^2.17.2\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.1.1\",\"eslint-plugin-standard\":\"^4.0.0\",\"exports-loader\":\"^0.7.0\",\"expose-loader\":\"^0.7.5\",\"fs-extra\":\"^9.0.0\",\"handlebars\":\"^4.7.5\",\"handlebars-layouts\":\"^3.1.4\",\"html-webpack-plugin\":\"^4.0.4\",\"jsdoc-webpack-plugin\":\"^0.3.0\",\"mini-css-extract-plugin\":\"^0.9.0\",\"mocha\":\"^7.1.1\",\"mocha-loader\":\"^5.0.0\",\"npm-run-all\":\"^4.1.5\",\"optimize-css-assets-webpack-plugin\":\"^5.0.1\",\"path\":\"^0.12.7\",\"replace-bundle-webpack-plugin\":\"^1.0.0\",\"requirejs\":\"^2.3.6\",\"responsive-loader\":\"^1.2.0\",\"speed-measure-webpack-plugin\":\"^1.3.0\",\"string-template\":\"^1.0.0\",\"style-loader\":\"^1.1.3\",\"terser-webpack-plugin\":\"^2.0.0\",\"url-loader\":\"^4.0.0\",\"webpack\":\"^4.30.0\",\"webpack-cli\":\"^3.3.1\",\"webpack-dev-server\":\"^3.3.1\",\"webpack-node-externals\":\"^1.7.2\"}}"); +module.exports = JSON.parse("{\"name\":\"geoportal-extensions\",\"description\":\"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries\",\"version\":\"2.9.0\",\"date\":\"21/09/2023\",\"leafletExtName\":\"French Geoportal Extension for Leaflet\",\"leafletExtVersion\":\"2.4.0-beta\",\"olExtName\":\"French Geoportal Extension for OpenLayers\",\"olExtVersion\":\"3.4.0-beta\",\"itownsExtName\":\"French Geoportal Extension for Itowns\",\"itownsExtVersion\":\"2.5.0-beta\",\"main\":\"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js\",\"types\":\"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts\",\"module\":\"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js\",\"directories\":{},\"scripts\":{\"setup\":\"npm install\",\"clean\":\"echo \\\"Warning: target not yet implemented!\\\" && exit 0\",\"eslint\":\"eslint src/\",\"test\":\"npm run test:serve\",\"test:serve\":\"cd test && webpack-dev-server --hot --config webpack.test.serve.js\",\"sample\":\"npm run sample:serve\",\"sample:serve\":\"npm run sample:ol:serve\",\"sample:itowns:serve\":\"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path '/dist/itowns/' --port 9001 --open\",\"sample:leaflet:serve\":\"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path '/dist/leaflet/' --port 9001 --open\",\"sample:ol:serve\":\"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path '/dist/openlayers/' --port 9001 --open\",\"generate-types:ol\":\"npx tsc -p build/types/tsconfig-openlayers.json\",\"generate-types:leaflet\":\"npx tsc -p build/types/tsconfig-leaflet.json\",\"generate-types:itowns\":\"npx tsc -p build/types/tsconfig-itowns.json\",\"generate-jsdoc:ol\":\"jsdoc -c build/jsdoc/jsdoc-openlayers.json\",\"generate-jsdoc:leaflet\":\"jsdoc -c build/jsdoc/jsdoc-leaflet.json\",\"generate-jsdoc:itowns\":\"jsdoc -c build/jsdoc/jsdoc-itowns.json\",\"doc\":\"npm run doc:serve\",\"doc:serve\":\"npm run doc:ol:serve\",\"doc:itowns:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open\",\"doc:leaflet:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open\",\"doc:ol:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open\",\"build:dev\":\"npm-run-all --print-label --print-name build:*:dev\",\"build:prod\":\"npm-run-all --print-label --print-name build:*:prod\",\"build:src\":\"npm-run-all --print-label --print-name build:*:src\",\"build\":\"npm-run-all --print-label --print-name build:*:*\",\"build:itowns\":\"npm-run-all --print-label --print-name build:itowns:*\",\"build:itowns:dev\":\"webpack --config build/webpack/webpack.config.itowns --mode=development\",\"build:itowns:prod\":\"webpack --config build/webpack/webpack.config.itowns --mode=production\",\"build:itowns:src\":\"webpack --config build/webpack/webpack.config.itowns --mode=none\",\"build:ol\":\"npm-run-all --print-label --print-name build:ol:*\",\"build:ol:dev\":\"webpack --config build/webpack/webpack.config.openlayers --mode=development\",\"build:ol:prod\":\"webpack --config build/webpack/webpack.config.openlayers --mode=production\",\"build:ol:src\":\"webpack --config build/webpack/webpack.config.openlayers --mode=none\",\"build:leaflet\":\"npm-run-all --print-label --print-name build:leaflet:*\",\"build:leaflet:dev\":\"webpack --config build/webpack/webpack.config.leaflet --mode=development\",\"build:leaflet:prod\":\"webpack --config build/webpack/webpack.config.leaflet --mode=production\",\"build:leaflet:src\":\"webpack --config build/webpack/webpack.config.leaflet --mode=none\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/IGNF/geoportal-extensions.git\"},\"author\":\"IGNF\",\"keywords\":[\"geoportail\",\"javascript\",\"OpenLayers\",\"Leaflet\",\"Itowns\",\"3D\"],\"license\":\"CECILL-B\",\"bugs\":{\"url\":\"https://github.com/IGNF/geoportal-extensions/issues\"},\"homepage\":\"https://github.com/IGNF/geoportal-extensions#readme\",\"dependencies\":{\"@mapbox/mapbox-gl-style-spec\":\"13.20.1\",\"eventbusjs\":\"0.2.0\",\"geoportal-access-lib\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"itowns\":\"2.38.2\",\"leaflet\":\"1.7.1\",\"leaflet-draw\":\"1.0.4\",\"loglevel\":\"^1.6.7\",\"markdown-toc\":\"^1.2.0\",\"ol\":\"6.9.0\",\"ol-mapbox-style\":\"6.7.0\",\"proj4\":\"2.7.5\",\"proj4leaflet\":\"1.0.2\",\"sortablejs\":\"1.14.0\",\"three\":\"0.137.5\",\"typescript\":\"^4.5.5\",\"whatwg-fetch\":\"3.0.0\"},\"devDependencies\":{\"@babel/core\":\"^7.4.4\",\"@babel/plugin-transform-template-literals\":\"^7.7.4\",\"@babel/preset-env\":\"^7.4.4\",\"babel-loader\":\"^8.0.5\",\"chai\":\"^4.2.0\",\"chalk\":\"^4.0.0\",\"clean-webpack-plugin\":\"^3.0.0\",\"copy-webpack-plugin\":\"^5.0.3\",\"core-js\":\"^3.6.4\",\"css-loader\":\"^3.4.2\",\"eslint\":\"^6.8.0\",\"eslint-config-standard\":\"^14.1.1\",\"eslint-loader\":\"^4.0.0\",\"eslint-plugin-import\":\"^2.17.2\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.1.1\",\"eslint-plugin-standard\":\"^4.0.0\",\"exports-loader\":\"^0.7.0\",\"expose-loader\":\"^0.7.5\",\"fs-extra\":\"^9.0.0\",\"handlebars\":\"^4.7.5\",\"handlebars-layouts\":\"^3.1.4\",\"html-webpack-plugin\":\"^4.0.4\",\"jsdoc-webpack-plugin\":\"^0.3.0\",\"mini-css-extract-plugin\":\"^0.9.0\",\"mocha\":\"^7.1.1\",\"mocha-loader\":\"^5.0.0\",\"npm-run-all\":\"^4.1.5\",\"optimize-css-assets-webpack-plugin\":\"^5.0.1\",\"path\":\"^0.12.7\",\"replace-bundle-webpack-plugin\":\"^1.0.0\",\"requirejs\":\"^2.3.6\",\"responsive-loader\":\"^1.2.0\",\"speed-measure-webpack-plugin\":\"^1.3.0\",\"string-template\":\"^1.0.0\",\"style-loader\":\"^1.1.3\",\"terser-webpack-plugin\":\"^2.0.0\",\"url-loader\":\"^4.0.0\",\"webpack\":\"^4.30.0\",\"webpack-cli\":\"^3.3.1\",\"webpack-dev-server\":\"^3.3.1\",\"webpack-node-externals\":\"^1.7.2\"}}"); /***/ }), /* 2 */ @@ -602,14 +602,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(proj4__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); /* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36); -/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95); -/* harmony import */ var _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96); -/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97); -/* harmony import */ var _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99); -/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(100); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98); +/* harmony import */ var _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(100); +/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(101); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -9402,11 +9402,11 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Services_DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); /* harmony import */ var _Services_Alti_Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65); /* harmony import */ var _Services_Alti_Response_model_Elevation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66); -/* harmony import */ var _Services_AutoComplete_Response_model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78); -/* harmony import */ var _Services_AutoComplete_Response_model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79); -/* harmony import */ var _Services_ProcessIsoCurve_Response_model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91); -/* harmony import */ var _Services_Route_Response_model_RouteResponse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85); -/* harmony import */ var _Services_Route_Response_model_RouteInstruction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(86); +/* harmony import */ var _Services_AutoComplete_Response_model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79); +/* harmony import */ var _Services_AutoComplete_Response_model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80); +/* harmony import */ var _Services_ProcessIsoCurve_Response_model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(92); +/* harmony import */ var _Services_Route_Response_model_RouteResponse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(86); +/* harmony import */ var _Services_Route_Response_model_RouteInstruction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(87); /* harmony import */ var _Services_Config_Config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(38); /* harmony import */ var _Protocols_XHR__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(44); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(50); @@ -9532,11 +9532,11 @@ Gp.Helper = _Utils_Helper__WEBPACK_IMPORTED_MODULE_12__["default"]; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Config_Config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38); /* harmony import */ var _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54); -/* harmony import */ var _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67); -/* harmony import */ var _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75); -/* harmony import */ var _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(76); -/* harmony import */ var _Route_Route__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80); -/* harmony import */ var _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(87); +/* harmony import */ var _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68); +/* harmony import */ var _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76); +/* harmony import */ var _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(77); +/* harmony import */ var _Route_Route__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81); +/* harmony import */ var _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(88); /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "point|circle|bbox" }] */ /** @@ -9594,7 +9594,7 @@ var Services = { * @param {String} [options.contentType="application/xml"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing. * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing. - * @param {String} [options.api='REST'] - What API to use for interacting with underlying web service : 'REST' or 'WPS'. Only use if you know what you are doing. + * @param {String} [options.api='REST'] - What API to use for interacting with underlying web service : 'REST'. Only use if you know what you are doing. * @param {String} [options.outputFormat='xml'] - Output format for underlying web service response : 'xml' or 'json'. Only use if you know what you are doing. */ getAltitude : function (options) { @@ -9891,7 +9891,8 @@ function Config (options) { throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "onSuccess()")); } if (!options.apiKey && !options.customConfigFile) { - throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "apiKey", "customConfigFile")); + // si pas de thème spécifié, on récupère toutes les ressources possibles dans l'objet Config + options.apiKey = "full"; } this.options = {}; this.options.onSuccess = options.onSuccess; @@ -10448,20 +10449,21 @@ function CommonService (options) { throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__["default"].getMessage("PARAM_MISSING", "onSuccess()")); } + /* FIXME traitement au niveau de chaque composant pour tester service WXS / GPF // gestion de l'url du service par defaut if (!this.options.serverUrl) { // INFO // gestion de l'url du service par defaut pour les services qui ne possèdent qu'une seul url par defaut // les cas particuliers des services avec plusieurs urls (ex. Alti) devront être traité dans la classe du composant // donc si l'url n'est pas renseignée, il faut utiliser les urls par defaut - _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__["default"].ssl = this.options.ssl; - var urlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__["default"][this.CLASSNAME].url("calcul"); + DefaultUrlService.ssl = this.options.ssl; + var urlByDefault = DefaultUrlService[this.CLASSNAME].url("calcul"); if (typeof urlByDefault === "string") { this.options.serverUrl = urlByDefault; } else { this.logger.trace("URL par defaut à determiner au niveau du composant..."); } - } + }*/ // FIXME nettoyage des KVP dans l'url du service // if (this.options.serverUrl) { @@ -10641,7 +10643,8 @@ CommonService.prototype = { // INFO : acces au numero de version de package.conf aprés compilation ! if (this.CLASSNAME !== "Geocode" && this.CLASSNAME !== "ReverseGeocode" && this.CLASSNAME !== "AutoComplete") { this.options.serverUrl = _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__["default"].normalyzeUrl(this.options.serverUrl, { - "gp-access-lib" : _package_json__WEBPACK_IMPORTED_MODULE_6__.version + "gp-access-lib" : _package_json__WEBPACK_IMPORTED_MODULE_6__.version, + apiKey : this.options.apiKey || "calcul" }, false); } @@ -13212,7 +13215,6 @@ __webpack_require__.r(__webpack_exports__); // DefaultUrlService.Alti.url(key)[elevation-xml] // DefaultUrlService.Alti.url(key)[profil-json] // DefaultUrlService.Alti.url(key)[profil-xml] -// DefaultUrlService.Alti.url(key)[wps] // DefaultUrlService.ProcessIsoCurve.url(key) // DefaultUrlService.AutoComplete.url(key) // DefaultUrlService.ReverseGeocode.url(key) @@ -13230,7 +13232,6 @@ __webpack_require__.r(__webpack_exports__); // -> http://wxs.ign.fr/calcul/alti/rest/elevation.xml // -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.json // -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.xml -// -> http://wxs.ign.fr/calcul/alti/wps // // ssl by default. // @@ -13257,11 +13258,10 @@ var DefaultUrlService = { /** * base url of services (ssl protocol management) - * @param {String} key - key * @param {String} path - path * @returns {String} url */ - url : function (key, path) { + url : function (path) { // comportement par défaut => https // sinon, il est fixé par l'option 'ssl' (false => http) var _protocol; @@ -13271,7 +13271,25 @@ var DefaultUrlService = { _protocol = "https://"; } - return _protocol + HOSTNAME.concat("/", key, path); + return _protocol + HOSTNAME + path; + }, + + /** + * base new-url of services (ssl protocol management) + * @param {String} path - path + * @returns {String} url + */ + newUrl : function (path, hostname) { + // comportement par défaut => https + // sinon, il est fixé par l'option 'ssl' (false => http) + var _protocol; + if (DefaultUrlService.ssl === false) { + _protocol = "http://"; + } else { + _protocol = "https://"; + } + + return _protocol + hostname + path; }, /** @@ -13281,29 +13299,41 @@ var DefaultUrlService = { * @property {Function} url (key) - Returns elevation service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols ("elevation-json", "elevation-xml", "profil-json" or "profil-xml"). */ Alti : { + new_key : { + // rest + "elevation-json" : "/altimetrie/1.0/calcul/alti/rest/elevation.json", + "elevation-xml" : "/altimetrie/1.0/calcul/alti/rest/elevation.xml", + "profil-json" : "/altimetrie/1.0/calcul/alti/rest/elevationLine.json", + "profil-xml" : "/altimetrie/1.0/calcul/alti/rest/elevationLine.xml" + }, _key : { // rest - "elevation-json" : "/alti/rest/elevation.json", - "elevation-xml" : "/alti/rest/elevation.xml", - "profil-json" : "/alti/rest/elevationLine.json", - "profil-xml" : "/alti/rest/elevationLine.xml", + "elevation-json" : "/calcul/alti/rest/elevation.json", + "elevation-xml" : "/calcul/alti/rest/elevation.xml", + "profil-json" : "/calcul/alti/rest/elevationLine.json", + "profil-xml" : "/calcul/alti/rest/elevationLine.xml", // other wps : "/alti/wps" }, /** - * url + * newurl from geoplateforme service * @param {String} key - key * @returns {String} url */ - url : function (key) { + newUrl : function () { + return; + }, + /** + * url from wxs service + * @returns {String} url + */ + url : function () { return { // rest - "elevation-json" : DefaultUrlService.url(key, this._key["elevation-json"]), - "elevation-xml" : DefaultUrlService.url(key, this._key["elevation-xml"]), - "profil-json" : DefaultUrlService.url(key, this._key["profil-json"]), - "profil-xml" : DefaultUrlService.url(key, this._key["profil-xml"]), - // other - wps : DefaultUrlService.url(key, this._key["wps"]) + "elevation-json" : DefaultUrlService.url(this._key["elevation-json"]), + "elevation-xml" : DefaultUrlService.url(this._key["elevation-xml"]), + "profil-json" : DefaultUrlService.url(this._key["profil-json"]), + "profil-xml" : DefaultUrlService.url(this._key["profil-xml"]) }; } }, @@ -13314,14 +13344,25 @@ var DefaultUrlService = { * @property {Function} url (key) - Returns isocurve service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols ("iso-json" or "iso-xml"). */ ProcessIsoCurve : { - _key : "/geoportail/isochrone/rest/1.0.0/isochrone", + + new_key : "/itineraire/isochrone", + + _key : "/calcul/geoportail/isochrone/rest/1.0.0/isochrone", + /** - * url - * @param {String} key - key + * url from geoplateforme service * @returns {String} url */ - url : function (key) { - return DefaultUrlService.url(key, this._key); + newUrl : function () { + return; + }, + + /** + * url from wxs service + * @returns {String} url + */ + url : function () { + return DefaultUrlService.url(this._key); } }, /** @@ -13331,7 +13372,7 @@ var DefaultUrlService = { * @property {Function} url (key) - Returns config service default urls with or without geoportal access key given as a parameter. */ Config : { - _key : "https://raw.githubusercontent.com/IGNF/geoportal-configuration/main/dist/", + _key : "https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/dist/", /** * url * @param {String} key - key @@ -13357,14 +13398,24 @@ var DefaultUrlService = { * @property {Function} url (key) - Returns autocomplete service default urls with or without geoportal access key given as a parameter. The result is a String. */ AutoComplete : { - _key : "/ols/apis/completion", + new_key : "/completion", + + _key : "/calcul/geoportail/geocodage/rest/0.1/completion", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + /** * url - * @param {String} key - key * @returns {String} url */ url : function (key) { - return DefaultUrlService.url(key, this._key); + return DefaultUrlService.url(this._key); } }, /** @@ -13374,14 +13425,24 @@ var DefaultUrlService = { * @property {Function} url (key) - Returns reverse geocoding service default urls with or without geoportal access key given as a parameter. The result is a String. */ ReverseGeocode : { - _key : "/geoportail/ols", + new_key : "/reverse", + + _key : "/calcul/geoportail/geocodage/rest/0.1/reverse", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + /** * url - * @param {String} key - key * @returns {String} url */ - url : function (key) { - return DefaultUrlService.url(key, this._key); + url : function () { + return DefaultUrlService.url(this._key); } }, /** @@ -13391,14 +13452,24 @@ var DefaultUrlService = { * @property {Function} url (key) - Returns geocoding service default urls with or without geoportal access key given as a parameter. The result is a String. */ Geocode : { - _key : "/geoportail/ols", + new_key : "/search", + + _key : "/calcul/geoportail/geocodage/rest/0.1/search", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + /** * url - * @param {String} key - key * @returns {String} url */ - url : function (key) { - return DefaultUrlService.url(key, this._key); + url : function () { + return DefaultUrlService.url(this._key); } }, /** @@ -13408,14 +13479,24 @@ var DefaultUrlService = { * @property {Function} url (key) - Returns routing service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols. */ Route : { - _key : "/geoportail/itineraire/rest/1.0.0/route", + new_key : "/itineraire/route", + + _key : "/calcul/geoportail/itineraire/rest/1.0.0/route", + /** - * url - * @param {String} key - key + * url from geoplateforme service * @returns {String} url */ - url : function (key) { - return DefaultUrlService.url(key, this._key); + newUrl : function () { + return; + }, + + /** + * url from wxs service + * @returns {String} url + */ + url : function () { + return DefaultUrlService.url(this._key); } } }; @@ -13427,7 +13508,7 @@ var DefaultUrlService = { /* 52 */ /***/ (function(module) { -module.exports = JSON.parse("{\"_from\":\"geoportal-access-lib@3.3.3\",\"_id\":\"geoportal-access-lib@3.3.3\",\"_inBundle\":false,\"_integrity\":\"sha512-1S8B84yaU8JrkSxLXVFxqjkL4MMs1RNJwdQQMGjAoH/fXPr3CleoEaoG7z14HgVlWCvdYYqAqQuL6qGVCrlmXQ==\",\"_location\":\"/geoportal-access-lib\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"geoportal-access-lib@3.3.3\",\"name\":\"geoportal-access-lib\",\"escapedName\":\"geoportal-access-lib\",\"rawSpec\":\"3.3.3\",\"saveSpec\":null,\"fetchSpec\":\"3.3.3\"},\"_requiredBy\":[\"/\"],\"_resolved\":\"https://registry.npmjs.org/geoportal-access-lib/-/geoportal-access-lib-3.3.3.tgz\",\"_shasum\":\"33b1dc313ca8aeadd0adebf3bca4ef75ea48c50b\",\"_spec\":\"geoportal-access-lib@3.3.3\",\"_where\":\"/home/runner/work/geoportal-extensions/geoportal-extensions\",\"author\":{\"name\":\"IGNF\"},\"bugs\":{\"url\":\"https://github.com/IGNF/geoportal-access-lib/issues\"},\"bundleDependencies\":false,\"date\":\"02/08/2023\",\"dependencies\":{\"es6-promise\":\"^4.2.4\",\"node-fetch\":\"^2.6.1\",\"xmldom\":\"^0.1.27\"},\"deprecated\":false,\"description\":\"French Geoportal resources access library\",\"devDependencies\":{\"@babel/core\":\"^7.12.10\",\"@babel/plugin-transform-template-literals\":\"^7.12.1\",\"@babel/preset-env\":\"^7.12.11\",\"babel-loader\":\"^8.2.2\",\"chai\":\"^4.1.2\",\"clean-webpack-plugin\":\"^3.0.0\",\"copy-webpack-plugin\":\"^5.1.2\",\"eslint\":\"^7.18.0\",\"eslint-config-standard\":\"^16.0.2\",\"eslint-loader\":\"^4.0.2\",\"eslint-plugin-import\":\"^2.22.1\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.2.1\",\"eslint-plugin-standard\":\"^5.0.0\",\"glob\":\"^7.1.2\",\"handlebars-layouts\":\"^3.1.4\",\"handlebars-webpack-plugin\":\"^1.4.1\",\"html-webpack-plugin\":\"^4.5.1\",\"istanbul-instrumenter-loader\":\"^3.0.1\",\"jsdoc-webpack-plugin\":\"^0.3.0\",\"loglevel\":\"^1.6.1\",\"mocha\":\"^7.2.0\",\"mocha-loader\":\"^5.1.5\",\"mocha-webpack\":\"^2.0.0-beta.0\",\"mochawesome\":\"^6.2.1\",\"nyc\":\"^15.1.0\",\"path\":\"^0.12.7\",\"replace-bundle-webpack-plugin\":\"^1.0.0\",\"sinon\":\"^9.2.4\",\"sinon-es6\":\"0.0.3\",\"speed-measure-webpack-plugin\":\"^1.4.2\",\"string-template\":\"^1.0.0\",\"terser-webpack-plugin\":\"^2.3.8\",\"webpack\":\"^4.46.0\",\"webpack-cli\":\"^3.3.12\",\"webpack-dev-server\":\"^3.11.2\",\"webpack-node-externals\":\"^2.5.2\",\"webpack-shell-plugin\":\"^0.5.0\"},\"homepage\":\"https://github.com/IGNF/geoportal-access-lib#readme\",\"keywords\":[\"geoportail\",\"webservice\",\"javascript\",\"es6\"],\"license\":\"CECILL-B\",\"main\":\"dist/GpServices-src.js\",\"module\":\"src/Gp.js\",\"name\":\"geoportal-access-lib\",\"nyc\":{\"include\":[\"src/**/*.js\"],\"instrument\":false,\"sourceMap\":false},\"optionalDependencies\":{},\"peerDependencies\":{},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/IGNF/geoportal-access-lib.git\"},\"scripts\":{\"build\":\"webpack --mode=none\",\"build:dev\":\"webpack --mode=development\",\"build:prod\":\"webpack --mode=production\",\"clean\":\"echo \\\"Warning: no yet implemented!\\\" && exit 0\",\"cover\":\"nyc --reporter=lcov --reporter=text npm run test\",\"doc\":\"npm run doc:serve\",\"doc:serve\":\"webpack-dev-server --content-base jsdoc --port 9001 --open\",\"eslint\":\"eslint src/\",\"sample\":\"npm run sample:serve\",\"sample:serve\":\"webpack-dev-server --mode=none --open-page samples/index-src.html --https --content-base . --output-public-path '/dist/' --port 9001 --open\",\"sample:serve:dev\":\"webpack-dev-server --mode=development --open-page samples/index-map.html --content-base . --output-public-path '/dist/' --port 9001 --open\",\"sample:serve:prod\":\"webpack-dev-server --mode=production --open-page samples/index-prod.html --content-base . --output-public-path '/dist/' --port 9001 --open\",\"setup\":\"npm install\",\"test\":\"mocha-webpack --reporter mochawesome --reporter-options reportDir=test-report,reportFilename=index --webpack-config ./test/webpack/webpack.test.js --glob \\\"test_*.js\\\" test/spec/\",\"test:end-to-end:serve\":\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.js\",\"test:end-to-end:serve:docker\":\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.docker.js\",\"test:serve\":\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.js\",\"test:serve:docker\":\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.docker.js\"},\"version\":\"3.3.3\"}"); +module.exports = JSON.parse("{\"_from\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"_id\":\"geoportal-access-lib@3.4.0-beta\",\"_inBundle\":false,\"_integrity\":\"sha512-gphFcmz76I5nDU8c5HS1X/afidc1hZMNKVESfzr212WyMpVCNbQhImVlLJakAlffXMCkNb40bVZnehKlKvD+9w==\",\"_location\":\"/geoportal-access-lib\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"remote\",\"raw\":\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"name\":\"geoportal-access-lib\",\"escapedName\":\"geoportal-access-lib\",\"rawSpec\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"saveSpec\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"fetchSpec\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\"},\"_requiredBy\":[\"/\"],\"_resolved\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"_shasum\":\"4972f1314445354d85baad4d3b0e59f0be27ab82\",\"_spec\":\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"_where\":\"/home/runner/work/geoportal-extensions/geoportal-extensions\",\"author\":{\"name\":\"IGNF\"},\"bugs\":{\"url\":\"https://github.com/IGNF/geoportal-access-lib/issues\"},\"bundleDependencies\":[],\"date\":\"21/09/2023\",\"dependencies\":{\"es6-promise\":\"^4.2.4\",\"node-fetch\":\"^2.6.1\",\"xmldom\":\"^0.1.27\"},\"deprecated\":false,\"description\":\"French Geoportal resources access library\",\"devDependencies\":{\"@babel/core\":\"^7.12.10\",\"@babel/plugin-transform-template-literals\":\"^7.12.1\",\"@babel/preset-env\":\"^7.12.11\",\"babel-loader\":\"^8.2.2\",\"chai\":\"^4.1.2\",\"clean-webpack-plugin\":\"^3.0.0\",\"copy-webpack-plugin\":\"^5.1.2\",\"eslint\":\"^7.18.0\",\"eslint-config-standard\":\"^16.0.2\",\"eslint-loader\":\"^4.0.2\",\"eslint-plugin-import\":\"^2.22.1\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.2.1\",\"eslint-plugin-standard\":\"^5.0.0\",\"glob\":\"^7.1.2\",\"handlebars-layouts\":\"^3.1.4\",\"handlebars-webpack-plugin\":\"^1.4.1\",\"html-webpack-plugin\":\"^4.5.1\",\"istanbul-instrumenter-loader\":\"^3.0.1\",\"jsdoc-webpack-plugin\":\"^0.3.0\",\"loglevel\":\"^1.6.1\",\"mocha\":\"^7.2.0\",\"mocha-loader\":\"^5.1.5\",\"mocha-webpack\":\"^2.0.0-beta.0\",\"mochawesome\":\"^6.2.1\",\"nyc\":\"^15.1.0\",\"path\":\"^0.12.7\",\"replace-bundle-webpack-plugin\":\"^1.0.0\",\"sinon\":\"^9.2.4\",\"sinon-es6\":\"0.0.3\",\"speed-measure-webpack-plugin\":\"^1.4.2\",\"string-template\":\"^1.0.0\",\"terser-webpack-plugin\":\"^2.3.8\",\"webpack\":\"^4.46.0\",\"webpack-cli\":\"^3.3.12\",\"webpack-dev-server\":\"^3.11.2\",\"webpack-node-externals\":\"^2.5.2\",\"webpack-shell-plugin\":\"^0.5.0\"},\"homepage\":\"https://github.com/IGNF/geoportal-access-lib#readme\",\"keywords\":[\"geoportail\",\"webservice\",\"javascript\",\"es6\"],\"license\":\"CECILL-B\",\"main\":\"dist/GpServices-src.js\",\"module\":\"src/Gp.js\",\"name\":\"geoportal-access-lib\",\"nyc\":{\"include\":[\"src/**/*.js\"],\"instrument\":false,\"sourceMap\":false},\"optionalDependencies\":{},\"peerDependencies\":{},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/IGNF/geoportal-access-lib.git\"},\"scripts\":{\"build\":\"webpack --mode=none\",\"build:dev\":\"webpack --mode=development\",\"build:prod\":\"webpack --mode=production\",\"clean\":\"echo \\\"Warning: no yet implemented!\\\" && exit 0\",\"cover\":\"nyc --reporter=lcov --reporter=text npm run test\",\"doc\":\"npm run doc:serve\",\"doc:serve\":\"webpack-dev-server --content-base jsdoc --port 9001 --open\",\"eslint\":\"eslint src/\",\"sample\":\"npm run sample:serve\",\"sample:serve\":\"webpack-dev-server --mode=none --open-page samples/index-src.html --https --content-base . --output-public-path '/dist/' --port 9001 --open\",\"sample:serve:dev\":\"webpack-dev-server --mode=development --open-page samples/index-map.html --content-base . --output-public-path '/dist/' --port 9001 --open\",\"sample:serve:prod\":\"webpack-dev-server --mode=production --open-page samples/index-prod.html --content-base . --output-public-path '/dist/' --port 9001 --open\",\"setup\":\"npm install\",\"test\":\"mocha-webpack --reporter mochawesome --reporter-options reportDir=test-report,reportFilename=index --webpack-config ./test/webpack/webpack.test.js --glob \\\"test_*.js\\\" test/spec/\",\"test:end-to-end:serve\":\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.js\",\"test:end-to-end:serve:docker\":\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.docker.js\",\"test:serve\":\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.js\",\"test:serve:docker\":\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.docker.js\"},\"version\":\"3.4.0-beta\"}"); /***/ }), /* 53 */ @@ -13634,7 +13715,7 @@ ConfigInterface.prototype = { const wmsTypeRegex = /\/v\//; // WMS vector style always empty (not in getCap) if (wmsTypeRegex.test(params.url)) { - params.styles = ""; + params.styles = " "; } else { // WMS raster style is defined in getCap params.styles = layerConf.styles[0].name; @@ -13819,6 +13900,8 @@ __webpack_require__.r(__webpack_exports__); * @param {Boolean} [options.zonly] - Permet de ne récupérer que les altitudes en sortie s'il vaut 'true'. * Vaut 'false' par défaut. * + * @param {String} [options.resource] - Resource utilisée pour réaliser le calcul. + * * @example * var options = { * apiKey : null, @@ -13836,7 +13919,8 @@ __webpack_require__.r(__webpack_exports__); * outputFormat : 'json' // json|xml * sampling : 3, * api : 'REST', // REST|WPS - * zonly : false // false|true + * zonly : false // false|true, + * resource : "resource-par-defaut" * }; * */ @@ -13875,6 +13959,9 @@ function Alti (options) { // format de réponse du service : "json" ou "xml" (valeur par défaut), en minuscule ! this.options.outputFormat = (typeof options.outputFormat === "string") ? options.outputFormat.toLowerCase() : "xml"; + // ressource utilisée pour le calcul altimétrique + this.options.resource = options.resource || "rge_alti_corse2a_float32_zip_lamb93"; + // sampling this.options.sampling = options.sampling || null; @@ -13889,12 +13976,21 @@ function Alti (options) { // param. zonly this.options.zonly = options.zonly || false; + // param. measures + this.options.measures = options.measures || false; + // gestion de l'url du service par defaut // si l'url n'est pas renseignée, il faut utiliser les urls par defaut // en fonction du type d'api, REST ou WPS, du format de reponse demandé (outputFormat) // ainsi que sur le type de service (profil ou elevation) if (!this.options.serverUrl) { - var lstUrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Alti.url("calcul"); + // Code commenté pour Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti + /* var lstUrlByDefault = DefaultUrlService.Alti.newUrl(); + if (this.options.oldAltiService) { + lstUrlByDefault = DefaultUrlService.Alti.url(); + }*/ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti + var lstUrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Alti.url(); var urlFound = null; switch (this.options.api) { case "WPS": @@ -13966,11 +14062,13 @@ Alti.prototype.buildRequest = function (error, success) { onError : error, scope : this, // spécifique au service : + resource : this.options.resource, positions : this.options.positions, outputFormat : this.options.outputFormat, sampling : this.options.sampling, api : this.options.api, - zonly : this.options.zonly + zonly : this.options.zonly, + measures : this.options.measures }; _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); @@ -14077,7 +14175,8 @@ var AltiRequestFactory = { crs : null, // par defaut format : null, // (only to POST) sampling : null, // (only use by Profil) - zonly : null // (only use by Elevation) + zonly : null, // (only use by Elevation) + measures : null // (only use by Elevation) } }; @@ -14086,6 +14185,8 @@ var AltiRequestFactory = { settings.param.format = options.outputFormat; settings.param.sampling = options.sampling; settings.param.zonly = options.zonly; + settings.param.measures = options.measures; + settings.param.resource = options.resource; // gestion des callback var bOnError = !!(options.onError !== null && typeof options.onError === "function"); // cast variable to boolean @@ -14176,7 +14277,9 @@ __webpack_require__.r(__webpack_exports__); * @param {Boolean} options.param.indent - false|true * @param {String} options.param.crs - 'CRS:84' * @param {String} options.param.sampling - 3 + * @param {String} options.param.resource - 'rge_alti_corse2a_float32_zip_lamb93' * @param {Boolean} options.param.zonly - false|true + * @param {Boolean} options.param.measures - false|true * @param {String} options.param.format - "JSON|XML" * @param {String} options.type - "Profil|Elevation" * @param {String} options.method - GET|POST @@ -14197,6 +14300,7 @@ __webpack_require__.r(__webpack_exports__); * format : 'json', // par defaut (only to POST) * sampling : 3 , // par defaut (only use by Profil) * zonly : false // par defaut (only use by Elevation) + * measures : false // par defaut (only use by Elevation) * } * }; * @@ -14273,7 +14377,7 @@ AltiRequestREST.prototype = { template : { get : { // FIXME on retire le param 'delimiter' : &delimiter='__DELIMITER__' - value : "lon=__LON__&lat=__LAT__&indent=__INDENT__&crs='__CRS__'", + value : "lon=__LON__&lat=__LAT__&indent=__INDENT__&crs='__CRS__'&resource=__RESOURCE__&measures=__MEASURES__", input : { point : "&zonly=__ZONLY__", profil : "&sampling=__SAMPLING__" @@ -14284,9 +14388,11 @@ AltiRequestREST.prototype = { value : "lon=__LON__\n" + "lat=__LAT__\n" + "indent=__INDENT__\n" + - "crs='__CRS__'\n", + "crs='__CRS__'\n" + + "resource='__RESOURCE__'\n" + + "measures='__MEASURES__'\n", input : { - point : "zonly=__ZONLY__", + point : "zonly=__ZONLY__\n", profil : "sampling=__SAMPLING__" } } @@ -14316,6 +14422,8 @@ AltiRequestREST.prototype = { // template = template.replace(/__DELIMITER__/g, this.DataObject.delimiter); template = template.replace(/__INDENT__/g, this.DataObject.indent); template = template.replace(/__CRS__/g, this.DataObject.crs); + template = template.replace(/__RESOURCE__/g, this.DataObject.resource); + template = template.replace(/__MEASURES__/g, this.DataObject.measures); // ajout + template = template + this.__addDataInputs(); @@ -14347,7 +14455,7 @@ AltiRequestREST.prototype = { var tmpl = null; if (this.DataObject.CLASSNAME === "AltiElevationRequest") { tmpl = myTemplate.input.point; - return tmpl.replace(/__ZONLY__/g, this.DataObject.zonly); + return tmpl.replace(/__ZONLY__/g, this.DataObject.zonly.toString()); } else if (this.DataObject.CLASSNAME === "AltiProfilRequest") { tmpl = myTemplate.input.profil; return tmpl.replace(/__SAMPLING__/g, this.DataObject.sampling); @@ -14467,6 +14575,10 @@ AltiElevationRequest.prototype.getData = function () { k : "format", v : this.format }); + map.push({ + k : "resource", + v : this.resource + }); return map; }; @@ -14542,6 +14654,17 @@ function AltiRequest (options) { * Par defaut, "json". */ this.format = this.options.format || "json"; + + /* + * Ressource utilisée + */ + this.resource = this.options.resource; + + /** + * Réponse détaillée (source & accuracy) + * true|false + */ + this.measures = this.options.measures || false; } /** @@ -14797,6 +14920,10 @@ AltiProfilRequest.prototype.getData = function () { k : "format", v : this.format }); + map.push({ + k : "resource", + v : this.resource + }); return map; }; @@ -15383,6 +15510,9 @@ var AltiResponseFactory = { if (elevations[i].acc) { elevation.acc = elevations[i].acc; } + if (elevations[i].measures) { + elevation.measures = elevations[i].measures; + } } else if (typeof elevations[i] === "number") { // elevations[i] est un nombre, dans le cas de zonly=true notamment elevation.z = elevations[i]; @@ -15822,6 +15952,7 @@ function __getAttributes (node) { __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65); /* harmony import */ var _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66); +/* harmony import */ var _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67); /** * Fonction retournant un objet contenant des clés de lecture (readers) @@ -15839,6 +15970,7 @@ __webpack_require__.r(__webpack_exports__); + /** * * Objet AltiResponseReader @@ -15855,7 +15987,7 @@ __webpack_require__.r(__webpack_exports__); * du service alti, correspondant logiquement à la racine du document * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée) * - * @property {Method} AltiResponseReader.READERS.elevation - ecture d'un noeud "elevation" de la réponse xml du service alti. + * @property {Method} AltiResponseReader.READERS.elevation - Lecture d'un noeud "elevation" de la réponse xml du service alti. * (contient un ou 4 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, et acc) * * @property {Method} AltiResponseReader.READERS.lat - Lecture d'un noeud "lat" de la réponse xml du service alti. @@ -15870,6 +16002,15 @@ __webpack_require__.r(__webpack_exports__); * @property {Method} AltiResponseReader.READERS.acc - Lecture d'un noeud "acc" de la réponse xml du service alti. * (contient une valeur de précision, qui est un flottant) * + * @property {Method} AltiResponseReader.READERS.measures - Lecture d'un noeud "measures" de la réponse xml du service alti. + * (contient une valeur de précision, qui est un flottant) + * + * @property {Method} AltiResponseReader.READERS.source_name - Lecture d'un noeud "source_name" de la réponse xml du service alti. + * (pour remplir l'éventuel objet measure) + * + * @property {Method} AltiResponseReader.READERS.source_mesure - Lecture d'un noeud "source_mesure" de la réponse xml du service alti. + * (pour remplir l'éventuel objet measure) + * * @property {Method} AltiResponseReader.READERS.exceptionreport - Lecture d'un noeud "ExceptionReport" de la réponse xml du service alti. * * @property {Method} AltiResponseReader.READERS.exception - Lecture d'un noeud "Exception" de la réponse xml du service alti. @@ -15915,9 +16056,9 @@ AltiResponseReader.READERS = { /** * Lecture d'un noeud "elevation" de la réponse xml du service alti. - * (contient un ou 4 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, et acc) + * (contient un ou 5 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, acc et measures) * - * @param {DOMElement} node - noeud elevation à lire pour récupérer les informations de l'élévation retournée (z [, lon, lat, acc]) + * @param {DOMElement} node - noeud elevation à lire pour récupérer les informations de l'élévation retournée (z [, lon, lat, acc, measures]) * @return {Array} elevationResponse - format de la réponse en sortie, instance de AltiResponse * @static * @memberof AltiResponseReader @@ -15980,19 +16121,19 @@ AltiResponseReader.READERS = { * (contient une valeur d'altitude, qui est un flottant) * * @param {DOMElement} node - noeud à lire pour récupérer l'altitude - * @param {Object} elevation - objet dans lequel stocker l'altitude retournée + * @param {Object} elevationObject - objet dans lequel stocker l'altitude retournée : elevation ou measure * @static * @memberof AltiResponseReader */ - z : function (node, elevation) { + z : function (node, elevationObject) { var textNode = node.firstChild; if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE - if (elevation) { - elevation.z = parseFloat(textNode.nodeValue); + if (elevationObject) { + elevationObject.z = parseFloat(textNode.nodeValue); } else { - elevation = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__["default"](); - elevation.z = parseFloat(textNode.nodeValue); - return elevation; + elevationObject = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__["default"](); + elevationObject.z = parseFloat(textNode.nodeValue); + return elevationObject; } } else { throw new Error("Erreur dans la lecture de la réponse du service : altitude attendue mais absente"); @@ -16004,19 +16145,88 @@ AltiResponseReader.READERS = { * (contient une valeur de précision, qui est un flottant) * * @param {DOMElement} node - noeud à lire pour récupérer la précision - * @param {Object} elevation - objet dans lequel stocker la précision retournée + * @param {Object} elevationObject - objet dans lequel stocker la précision retournée : elevation ou measure * @static * @memberof AltiResponseReader */ - acc : function (node, elevation) { + acc : function (node, elevationObject) { var textNode = node.firstChild; if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE - elevation.acc = parseFloat(textNode.nodeValue); + elevationObject.acc = parseFloat(textNode.nodeValue); } else { throw new Error("Erreur dans la lecture de la réponse du service : précision (acc) attendue mais absente"); } }, + /** + * Lecture d'un noeud "source_name" de la réponse xml du service alti. + * (contient le nom de la source, qui est un string) + * + * @param {DOMElement} node - noeud à lire pour récupérer la précision + * @param {Object} measure - objet dans lequel stocker le nom de la source retourné + * @static + * @memberof AltiResponseReader + */ + source_name : function (node, measure) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + measure.source_name = textNode.nodeValue; + } else { + throw new Error("Erreur dans la lecture de la réponse du service : source_name attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "source_measure" de la réponse xml du service alti. + * (contient le nom de la mesure, qui est un string) + * + * @param {DOMElement} node - noeud à lire pour récupérer la précision + * @param {Object} measure - objet dans lequel stocker le nom de la source retourné + * @static + * @memberof AltiResponseReader + */ + source_measure : function (node, measure) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + measure.source_measure = textNode.nodeValue; + } else { + throw new Error("Erreur dans la lecture de la réponse du service : source_measure attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "measures" et de ses enfants "measure" de la réponse xml du service alti. + * (contient une valeur de précision, qui est un flottant) + * + * @param {DOMElement} node - noeud à lire pour récupérer la précision + * @param {Object} elevation - objet dans lequel stocker la précision retournée + * @static + * @memberof AltiResponseReader + */ + measures : function (node, elevation) { + elevation.measures = []; + var measure; + if (node.hasChildNodes()) { + var children = node.childNodes; + var measureNode; + var measureChildren; + for (var i = 0; i < children.length; i++) { + measure = new _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__["default"](); + measureNode = children[i]; + measureChildren = measureNode.childNodes; + for (var j = 0; j < measureChildren.length; j++) { + if (AltiResponseReader.READERS[measureChildren[j].nodeName]) { + // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir. + AltiResponseReader.READERS[measureChildren[j].nodeName](measureChildren[j], measure); + } else { + throw new Error("Erreur dans la lecture de la réponse du service : measures attendues mais absentes"); + } + } + elevation.measures.push(measure); + } + } + }, + /** * Lecture d'un noeud "ExceptionReport" de la réponse xml du service alti. * @@ -16206,14 +16416,54 @@ Elevation.prototype = { /* 67 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Single measure object returned by underlying web service if measures = true and zonly = false + * + * @property {String} source_name - Name of the source + * @property {String} source_measure - Name of the measure + * @property {Float} z - Point elevation. + * @property {Float} acc - Accuracy of elevation for this point. (only if zonly=false) + * + * @namespace + * @alias Gp.Services.Alti.Measure + */ +function Measure () { + if (!(this instanceof Measure)) { + throw new TypeError("Measure constructor cannot be called as a function."); + } + + this.source_name = null; + this.source_measure = null; + this.z = null; + this.acc = null; +} + +Measure.prototype = { + + constructor : Measure + +}; + +/* harmony default export */ __webpack_exports__["default"] = (Measure); + + +/***/ }), +/* 68 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); -/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68); -/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); +/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69); +/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(72); + @@ -16298,7 +16548,15 @@ function Geocode (options_) { this.logger.trace("[Constructeur Geocode (options)]"); var options = this.patchOptionConvertor(options_); - options.serverUrl = options.serverUrl || "https://wxs.ign.fr/calcul/geoportail/geocodage/rest/0.1/search"; + if (!options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage + /* options.serverUrl = DefaultUrlService.Geocode.newUrl(); + if (options.oldGeocodeService) { + options.serverUrl = DefaultUrlService.Geocode.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage + options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Geocode.url(); + } // appel du constructeur par heritage _CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this, [options]); @@ -16443,7 +16701,7 @@ Geocode.prototype.buildRequest = function (error, success) { filters : this.options.filters }; - this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__["default"].build(options); + this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); // on teste si la requete a bien été construite ! (!this.request) @@ -16482,7 +16740,7 @@ Geocode.prototype.analyzeResponse = function (error, success) { scope : this }; - _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); + _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__["default"].build(options); } else { error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); } @@ -16492,13 +16750,13 @@ Geocode.prototype.analyzeResponse = function (error, success) { /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); -/* harmony import */ var _GeocodeRequestREST__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69); +/* harmony import */ var _GeocodeRequestREST__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70); @@ -16556,14 +16814,14 @@ var GeocodeRequestFactory = { /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); -/* harmony import */ var _model_GeocodeParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70); +/* harmony import */ var _model_GeocodeParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71); @@ -16654,7 +16912,7 @@ GeocodeRequestREST.prototype = { /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -16838,14 +17096,14 @@ GeocodeParamREST.prototype.getParams = function () { /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); -/* harmony import */ var _Formats_GeocodeResponseParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72); +/* harmony import */ var _Formats_GeocodeResponseParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73); /** * Factory pour générer une reponse JSON à partir d'un XML * (Factory) @@ -16935,15 +17193,15 @@ var GeocodeReponseFactory = { /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50); -/* harmony import */ var _Response_model_GeocodeResponse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73); -/* harmony import */ var _Response_model_GeocodedLocation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74); +/* harmony import */ var _Response_model_GeocodeResponse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74); +/* harmony import */ var _Response_model_GeocodedLocation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75); // import Logger from "../../../Utils/LoggerByDefault"; @@ -17081,7 +17339,7 @@ function _parseError (error) { /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -17113,7 +17371,7 @@ GeocodeResponse.prototype = { /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -17198,7 +17456,7 @@ GeocodedLocation.prototype = { /***/ }), -/* 75 */ +/* 76 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -17207,8 +17465,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); -/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68); -/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); +/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69); +/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(72); + @@ -17298,7 +17558,15 @@ function ReverseGeocode (options_) { this.logger.trace("[Constructeur ReverseGeocode (options)]"); var options = this.patchOptionConvertor(options_); - options.serverUrl = options.serverUrl || "https://wxs.ign.fr/calcul/geoportail/geocodage/rest/0.1/reverse"; + if (!options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse + /* options.serverUrl = DefaultUrlService.ReverseGeocode.newUrl(); + if (options.oldReverseService) { + options.serverUrl = DefaultUrlService.ReverseGeocode.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse + options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].ReverseGeocode.url(); + } // appel du constructeur par heritage _CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this, [options]); @@ -17455,7 +17723,7 @@ ReverseGeocode.prototype.buildRequest = function (error, success) { filters : this.options.filters }; - this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_4__["default"].build(options); + this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); // on teste si la requete a bien été construite ! (!this.request) @@ -17480,7 +17748,7 @@ ReverseGeocode.prototype.analyzeResponse = function (error, success) { scope : this }; - _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); + _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__["default"].build(options); } else { error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); } @@ -17547,17 +17815,19 @@ ReverseGeocode.geoEPSG = ["EPSG:4326"]; /***/ }), -/* 76 */ +/* 77 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41); -/* harmony import */ var _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77); -/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39); -/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(40); -/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42); -/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); +/* harmony import */ var _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(40); +/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50); + @@ -17619,7 +17889,7 @@ __webpack_require__.r(__webpack_exports__); */ function AutoComplete (options_) { if (!(this instanceof AutoComplete)) { - throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__["default"].getMessage("CLASS_CONSTRUCTOR", "AutoComplete")); + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("CLASS_CONSTRUCTOR", "AutoComplete")); } /** @@ -17628,17 +17898,26 @@ function AutoComplete (options_) { */ this.CLASSNAME = "AutoComplete"; - this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_2__["default"].getLogger("Gp.Services.AutoComplete"); + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__["default"].getLogger("Gp.Services.AutoComplete"); this.logger.trace("[Constructeur AutoComplete (options)]"); var options = this.patchOptionConvertor(options_); - options.serverUrl = options.serverUrl || "https://wxs.ign.fr/calcul/geoportail/geocodage/rest/0.1/completion"; + + if (!options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocomplétion + /* options.serverUrl = DefaultUrlService.AutoComplete.newUrl(); + if (options.oldAutocompleteService) { + options.serverUrl = DefaultUrlService.AutoComplete.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocompletion + options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__["default"].AutoComplete.url(); + } // appel du constructeur par heritage _CommonService__WEBPACK_IMPORTED_MODULE_0__["default"].apply(this, arguments); if (!options.text) { - throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__["default"].getMessage("PARAM_MISSING", "text")); + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("PARAM_MISSING", "text")); } // ajout des options spécifiques au service @@ -17742,7 +18021,7 @@ AutoComplete.prototype.buildRequest = function (error, success) { } // normalisation de la requete avec param KPV - this.request = _Utils_Helper__WEBPACK_IMPORTED_MODULE_4__["default"].normalyzeParameters({ + this.request = _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__["default"].normalyzeParameters({ text : encodeURIComponent(this.options.text), type : type, terr : territory, @@ -17750,7 +18029,7 @@ AutoComplete.prototype.buildRequest = function (error, success) { }); (!this.request) - ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_5__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__["default"].getMessage("SERVICE_REQUEST_BUILD"))) + ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("SERVICE_REQUEST_BUILD"))) : success.call(this, this.request); }; @@ -17771,9 +18050,9 @@ AutoComplete.prototype.analyzeResponse = function (error, success) { scope : this }; - _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_1__["default"].build(options); + _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__["default"].build(options); } else { - error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_5__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_3__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); } }; @@ -17781,7 +18060,7 @@ AutoComplete.prototype.analyzeResponse = function (error, success) { /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -17789,8 +18068,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); -/* harmony import */ var _model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78); -/* harmony import */ var _model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79); +/* harmony import */ var _model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79); +/* harmony import */ var _model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80); /** * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON * (Factory) @@ -17936,7 +18215,7 @@ var AutoCompleteResponseFactory = { /***/ }), -/* 78 */ +/* 79 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -17967,7 +18246,7 @@ AutoCompleteResponse.prototype = { /***/ }), -/* 79 */ +/* 80 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18098,7 +18377,7 @@ SuggestedLocation.prototype = { /***/ }), -/* 80 */ +/* 81 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18108,8 +18387,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); /* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); -/* harmony import */ var _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81); -/* harmony import */ var _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(84); +/* harmony import */ var _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82); +/* harmony import */ var _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85); @@ -18343,7 +18622,14 @@ function Route (options) { // gestion de l'url du service par defaut // si l'url n'est pas renseignée, il faut utiliser les urls par defaut if (!this.options.serverUrl) { - var UrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Route.url("calcul"); + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire + /* var UrlByDefault = DefaultUrlService.Route.newUrl(); + if (this.options.oldRouteService) { + UrlByDefault = DefaultUrlService.Route.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire + var UrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Route.url(); + if (!UrlByDefault) { throw new Error("Url by default not found !"); } @@ -18434,14 +18720,14 @@ Route.prototype.analyzeResponse = function (error, success) { /***/ }), -/* 81 */ +/* 82 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50); -/* harmony import */ var _RouteRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82); +/* harmony import */ var _RouteRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83); @@ -18531,14 +18817,14 @@ var RouteRequestFactory = { /***/ }), -/* 82 */ +/* 83 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); -/* harmony import */ var _model_RouteParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83); +/* harmony import */ var _model_RouteParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84); @@ -18644,7 +18930,7 @@ RouteRequestREST.prototype = { /***/ }), -/* 83 */ +/* 84 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18895,7 +19181,7 @@ RouteParamREST.prototype.getParams = function () { /***/ }), -/* 84 */ +/* 85 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18903,8 +19189,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); -/* harmony import */ var _model_RouteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85); -/* harmony import */ var _model_RouteInstruction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86); +/* harmony import */ var _model_RouteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86); +/* harmony import */ var _model_RouteInstruction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(87); @@ -19155,7 +19441,7 @@ var RouteResponseFactory = { /***/ }), -/* 85 */ +/* 86 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19203,7 +19489,7 @@ RouteResponse.prototype = { /***/ }), -/* 86 */ +/* 87 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19259,7 +19545,7 @@ RouteInstruction.prototype = { /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19269,8 +19555,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); /* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); -/* harmony import */ var _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88); -/* harmony import */ var _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(90); +/* harmony import */ var _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89); +/* harmony import */ var _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91); @@ -19519,7 +19805,13 @@ function ProcessIsoCurve (options) { // gestion de l'url du service par defaut // si l'url n'est pas renseignée, il faut utiliser les urls par defaut if (!this.options.serverUrl) { - var urlFound = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].ProcessIsoCurve.url("calcul"); + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone + /* var urlFound = DefaultUrlService.ProcessIsoCurve.newUrl(); + if (this.options.oldIsoService) { + urlFound = DefaultUrlService.ProcessIsoCurve.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone + var urlFound = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].ProcessIsoCurve.url(); if (!urlFound) { throw new Error("Url by default not found !"); } @@ -19591,14 +19883,14 @@ ProcessIsoCurve.prototype.analyzeResponse = function (onError, onSuccess) { /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); -/* harmony import */ var _model_ProcessIsoCurveParam__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(89); +/* harmony import */ var _model_ProcessIsoCurveParam__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90); @@ -19792,7 +20084,7 @@ ProcessIsoCurveRequest.prototype = { /***/ }), -/* 89 */ +/* 90 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20003,7 +20295,7 @@ ProcessIsoCurveParam.prototype.getParams = function () { /***/ }), -/* 90 */ +/* 91 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20011,7 +20303,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); /* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); /* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); -/* harmony import */ var _model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91); +/* harmony import */ var _model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92); @@ -20121,7 +20413,7 @@ var ProcessIsoCurveResponseFactory = { /***/ }), -/* 91 */ +/* 92 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20174,13 +20466,13 @@ ProcessIsoCurveResponse.prototype = { /***/ }), -/* 92 */ +/* 93 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); -/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); /* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_1__); @@ -21024,18 +21316,18 @@ GlobeViewExtended.prototype._fromItownsCoords = function (itownsCoord) { /* harmony default export */ __webpack_exports__["default"] = (GlobeViewExtended); /***/ }), -/* 93 */ +/* 94 */ /***/ (function(module, exports) { -module.exports = __WEBPACK_EXTERNAL_MODULE__93__; +module.exports = __WEBPACK_EXTERNAL_MODULE__94__; /***/ }), -/* 94 */ +/* 95 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /** * @module Utils * @alias Gp.olUtils @@ -21123,7 +21415,7 @@ var Utils = { /* harmony default export */ __webpack_exports__["default"] = (Utils); /***/ }), -/* 95 */ +/* 96 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21206,12 +21498,12 @@ var SelectorID = { /* harmony default export */ __webpack_exports__["default"] = (SelectorID); /***/ }), -/* 96 */ +/* 97 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var MousePositionDOM = { /** * Add uuid to the tag ID @@ -22056,12 +22348,12 @@ var MousePositionDOM = { /* harmony default export */ __webpack_exports__["default"] = (MousePositionDOM); /***/ }), -/* 97 */ +/* 98 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); // import { THREE } from "itowns"; @@ -22208,7 +22500,7 @@ Widget.prototype.setOptions = function setOptions(options) { /* harmony default export */ __webpack_exports__["default"] = (Widget); /***/ }), -/* 98 */ +/* 99 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -73100,7 +73392,7 @@ if ( typeof window !== 'undefined' ) { /***/ }), -/* 99 */ +/* 100 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -73177,7 +73469,7 @@ var PositionFormater = { /* harmony default export */ __webpack_exports__["default"] = (PositionFormater); /***/ }), -/* 100 */ +/* 101 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -73362,18 +73654,18 @@ var CRS = { /* harmony default export */ __webpack_exports__["default"] = (CRS); /***/ }), -/* 101 */ +/* 102 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95); -/* harmony import */ var _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(102); -/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(103); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -74242,12 +74534,12 @@ LayerSwitcher.prototype._resolveLayerId = function (divId) { /* harmony default export */ __webpack_exports__["default"] = (LayerSwitcher); /***/ }), -/* 102 */ +/* 103 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(103); +/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(104); var LayerSwitcherDOM = { /** @@ -74843,7 +75135,7 @@ var LayerSwitcherDOM = { /* harmony default export */ __webpack_exports__["default"] = (LayerSwitcherDOM); /***/ }), -/* 103 */ +/* 104 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -78627,17 +78919,17 @@ Sortable.mount(Remove, Revert); /***/ }), -/* 104 */ +/* 105 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95); -/* harmony import */ var _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(105); -/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(106); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -78904,7 +79196,7 @@ BoostRelief.prototype._resolveLayerId = function (divId) { /* harmony default export */ __webpack_exports__["default"] = (BoostRelief); /***/ }), -/* 105 */ +/* 106 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -79119,18 +79411,18 @@ var BoostReliefDOM = { /* harmony default export */ __webpack_exports__["default"] = (BoostReliefDOM); /***/ }), -/* 106 */ +/* 107 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); -/* harmony import */ var _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(107); -/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97); -/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(108); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(98); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94); /* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_4__); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -79145,7 +79437,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = * @extends {itowns.control.Widget} * @alias itowns.control.Buildings * @param {Object} buildingsOptions - control options - * @param {String} [buildingsOptions.key = "essentiels"] - key to use to adds the buildings layer – “essentiels” by default * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation @@ -79264,7 +79555,7 @@ Buildings.prototype.addMNT = function (globe) { noDataValue: -99999, source: { protocol: "wmts", - url: "https://wxs.ign.fr/altimetrie/geoportail/wmts", + url: "https://data.geopf.fr/wmts", name: "ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES", attribution: [{ name: "IGN", @@ -79365,7 +79656,7 @@ Buildings.prototype.addMNT = function (globe) { * @param {options} options for the buildings control */ Buildings.prototype.addBuildings = function (options) { - var vectorStyle = "https://wxs.ign.fr/" + options.apiKey + "/static/vectorTiles/styles/PLAN.IGN/standard.json"; + var vectorStyle = "https://wxs.ign.fr/static/vectorTiles/styles/PLAN.IGN/essentiels/standard.json"; var layerId = "VTBuilding"; // ---------- DISPLAY VECTOR TILED BUILDING DATA AS 3D MESHES : ---------- // Define the source of the building data : those are vector tiled data from the geoportail. @@ -79496,7 +79787,6 @@ Buildings.prototype.addListener = function (element) { */ Buildings.prototype.setOptions = function (options) { var buildingsOptions = {}; - buildingsOptions.apiKey = options.key || "essentiels"; buildingsOptions.MNT = options.MNT !== false; buildingsOptions.buildingsOnGround = options.buildingsOnGround || false; buildingsOptions.defaultVisibility = options.defaultVisibility !== false; @@ -79511,7 +79801,7 @@ Buildings.prototype.setOptions = function (options) { /* harmony default export */ __webpack_exports__["default"] = (Buildings); /***/ }), -/* 107 */ +/* 108 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -79558,19 +79848,19 @@ var BuildingsDOM = { /* harmony default export */ __webpack_exports__["default"] = (BuildingsDOM); /***/ }), -/* 108 */ +/* 109 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95); -/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(109); -/* harmony import */ var _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(110); -/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96); +/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(110); +/* harmony import */ var _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(111); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -79893,7 +80183,7 @@ Attributions.prototype._resolutionsWGS84 = { /* harmony default export */ __webpack_exports__["default"] = (Attributions); /***/ }), -/* 109 */ +/* 110 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -80201,7 +80491,7 @@ var LayerUtils = { /* harmony default export */ __webpack_exports__["default"] = (LayerUtils); /***/ }), -/* 110 */ +/* 111 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -80290,17 +80580,17 @@ var AttributionDOM = { /* harmony default export */ __webpack_exports__["default"] = (AttributionDOM); /***/ }), -/* 111 */ +/* 112 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95); -/* harmony import */ var _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(112); -/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(113); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -80448,7 +80738,7 @@ Scale.prototype._initContainer = function () { /* harmony default export */ __webpack_exports__["default"] = (Scale); /***/ }), -/* 112 */ +/* 113 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -80478,17 +80768,17 @@ var ScaleDOM = { /* harmony default export */ __webpack_exports__["default"] = (ScaleDOM); /***/ }), -/* 113 */ +/* 114 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95); -/* harmony import */ var _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(114); -/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(115); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -80642,7 +80932,7 @@ MiniGlobe.prototype._initContainer = function () { /* harmony default export */ __webpack_exports__["default"] = (MiniGlobe); /***/ }), -/* 114 */ +/* 115 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -80674,18 +80964,18 @@ var MiniGlobeDOM = { /* harmony default export */ __webpack_exports__["default"] = (MiniGlobeDOM); /***/ }), -/* 115 */ +/* 116 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(116); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(117); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); var _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(1, 1); -/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94); /* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__); @@ -80818,7 +81108,7 @@ LayerWMTS.prototype.constructor = LayerWMTS; /* harmony default export */ __webpack_exports__["default"] = (LayerWMTS); /***/ }), -/* 116 */ +/* 117 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -80862,18 +81152,18 @@ var Config = { /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32))) /***/ }), -/* 117 */ +/* 118 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(116); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(117); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); var _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(1, 1); -/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94); /* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__); @@ -81004,18 +81294,18 @@ LayerWMS.prototype.constructor = LayerWMS; /* harmony default export */ __webpack_exports__["default"] = (LayerWMS); /***/ }), -/* 118 */ +/* 119 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); -/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); -/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(116); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(117); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); var _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(1, 1); -/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94); /* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__); /* globals self */ @@ -81147,14 +81437,14 @@ LayerElevation.prototype.constructor = LayerElevation; /* harmony default export */ __webpack_exports__["default"] = (LayerElevation); /***/ }), -/* 119 */ +/* 120 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); -/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(116); -/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(117); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94); /* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_2__); @@ -81237,7 +81527,7 @@ VectorTileLayer.prototype.constructor = VectorTileLayer; /* harmony default export */ __webpack_exports__["default"] = (VectorTileLayer); /***/ }), -/* 120 */ +/* 121 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -81287,7 +81577,7 @@ __webpack_require__.r(__webpack_exports__); })(); /***/ }), -/* 121 */ +/* 122 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -81339,7 +81629,7 @@ var ProxyUtils = { /* harmony default export */ __webpack_exports__["default"] = (ProxyUtils); /***/ }), -/* 122 */ +/* 123 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -81516,7 +81806,7 @@ var ColorUtils = { /* harmony default export */ __webpack_exports__["default"] = (ColorUtils); /***/ }), -/* 123 */ +/* 124 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; diff --git a/current/dist/itowns/GpPluginItowns.css b/current/dist/itowns/GpPluginItowns.css index fab87a7b0..8e955b651 100644 --- a/current/dist/itowns/GpPluginItowns.css +++ b/current/dist/itowns/GpPluginItowns.css @@ -9,8 +9,8 @@ * @copyright copyright (c) IGN * @license CeCILL-B * @author IGN - * @version 2.4.3 - * @date 04/08/2023 + * @version 2.5.0-beta + * @date 21/09/2023 * */ diff --git a/current/dist/itowns/GpPluginItowns.js b/current/dist/itowns/GpPluginItowns.js index 220b2c028..9094d27f9 100644 --- a/current/dist/itowns/GpPluginItowns.js +++ b/current/dist/itowns/GpPluginItowns.js @@ -9,8 +9,8 @@ * @copyright copyright (c) IGN * @license CeCILL-B * @author IGN - * @version 2.4.3 - * @date 04/08/2023 + * @version 2.5.0-beta + * @date 21/09/2023 * */ /*! @@ -67,17 +67,17 @@ * See https://raw.githubusercontent.com/proj4js/proj4js/master/LICENSE.md * @version 2.7.5 */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("itowns"),require("node-fetch"),require("xmldom")):"function"==typeof define&&define.amd?define("Gp",["itowns","require","require"],e):"object"==typeof exports?exports.Gp=e(require("itowns"),require("node-fetch"),require("xmldom")):t.Gp=e(t.itowns,t[void 0],t[void 0])}(this,(function(t,e,i){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=38)}([function(e,i){e.exports=t},function(t,e,i){"use strict";(function(t){var i={configuration:{},isConfigLoaded:function(){if(this.configuration&&0!==Object.keys(this.configuration).length)return!0;var e="undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==t?t:{};return!!(e.Gp&&e.Gp.Config&&e.Gp.Config.layers&&0!==Object.keys(e.Gp.Config.layers).length)&&(this.configuration=e.Gp.Config,!0)}};e.a=i}).call(this,i(5))},function(t){t.exports=JSON.parse('{"name":"geoportal-extensions","description":"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries","version":"2.8.4","date":"04/08/2023","leafletExtName":"French Geoportal Extension for Leaflet","leafletExtVersion":"2.3.3","olExtName":"French Geoportal Extension for OpenLayers","olExtVersion":"3.3.3","itownsExtName":"French Geoportal Extension for Itowns","itownsExtVersion":"2.4.3","main":"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js","types":"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts","module":"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js","directories":{},"scripts":{"setup":"npm install","clean":"echo \\"Warning: target not yet implemented!\\" && exit 0","eslint":"eslint src/","test":"npm run test:serve","test:serve":"cd test && webpack-dev-server --hot --config webpack.test.serve.js","sample":"npm run sample:serve","sample:serve":"npm run sample:ol:serve","sample:itowns:serve":"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path \'/dist/itowns/\' --port 9001 --open","sample:leaflet:serve":"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path \'/dist/leaflet/\' --port 9001 --open","sample:ol:serve":"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path \'/dist/openlayers/\' --port 9001 --open","generate-types:ol":"npx tsc -p build/types/tsconfig-openlayers.json","generate-types:leaflet":"npx tsc -p build/types/tsconfig-leaflet.json","generate-types:itowns":"npx tsc -p build/types/tsconfig-itowns.json","generate-jsdoc:ol":"jsdoc -c build/jsdoc/jsdoc-openlayers.json","generate-jsdoc:leaflet":"jsdoc -c build/jsdoc/jsdoc-leaflet.json","generate-jsdoc:itowns":"jsdoc -c build/jsdoc/jsdoc-itowns.json","doc":"npm run doc:serve","doc:serve":"npm run doc:ol:serve","doc:itowns:serve":"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open","doc:leaflet:serve":"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open","doc:ol:serve":"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open","build:dev":"npm-run-all --print-label --print-name build:*:dev","build:prod":"npm-run-all --print-label --print-name build:*:prod","build:src":"npm-run-all --print-label --print-name build:*:src","build":"npm-run-all --print-label --print-name build:*:*","build:itowns":"npm-run-all --print-label --print-name build:itowns:*","build:itowns:dev":"webpack --config build/webpack/webpack.config.itowns --mode=development","build:itowns:prod":"webpack --config build/webpack/webpack.config.itowns --mode=production","build:itowns:src":"webpack --config build/webpack/webpack.config.itowns --mode=none","build:ol":"npm-run-all --print-label --print-name build:ol:*","build:ol:dev":"webpack --config build/webpack/webpack.config.openlayers --mode=development","build:ol:prod":"webpack --config build/webpack/webpack.config.openlayers --mode=production","build:ol:src":"webpack --config build/webpack/webpack.config.openlayers --mode=none","build:leaflet":"npm-run-all --print-label --print-name build:leaflet:*","build:leaflet:dev":"webpack --config build/webpack/webpack.config.leaflet --mode=development","build:leaflet:prod":"webpack --config build/webpack/webpack.config.leaflet --mode=production","build:leaflet:src":"webpack --config build/webpack/webpack.config.leaflet --mode=none"},"repository":{"type":"git","url":"https://github.com/IGNF/geoportal-extensions.git"},"author":"IGNF","keywords":["geoportail","javascript","OpenLayers","Leaflet","Itowns","3D"],"license":"CECILL-B","bugs":{"url":"https://github.com/IGNF/geoportal-extensions/issues"},"homepage":"https://github.com/IGNF/geoportal-extensions#readme","dependencies":{"@mapbox/mapbox-gl-style-spec":"13.20.1","eventbusjs":"0.2.0","geoportal-access-lib":"3.3.3","itowns":"2.38.2","leaflet":"1.7.1","leaflet-draw":"1.0.4","loglevel":"^1.6.7","markdown-toc":"^1.2.0","ol":"6.9.0","ol-mapbox-style":"6.7.0","proj4":"2.7.5","proj4leaflet":"1.0.2","sortablejs":"1.14.0","three":"0.137.5","typescript":"^4.5.5","whatwg-fetch":"3.0.0"},"devDependencies":{"@babel/core":"^7.4.4","@babel/plugin-transform-template-literals":"^7.7.4","@babel/preset-env":"^7.4.4","babel-loader":"^8.0.5","chai":"^4.2.0","chalk":"^4.0.0","clean-webpack-plugin":"^3.0.0","copy-webpack-plugin":"^5.0.3","core-js":"^3.6.4","css-loader":"^3.4.2","eslint":"^6.8.0","eslint-config-standard":"^14.1.1","eslint-loader":"^4.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0","exports-loader":"^0.7.0","expose-loader":"^0.7.5","fs-extra":"^9.0.0","handlebars":"^4.7.5","handlebars-layouts":"^3.1.4","html-webpack-plugin":"^4.0.4","jsdoc-webpack-plugin":"^0.3.0","mini-css-extract-plugin":"^0.9.0","mocha":"^7.1.1","mocha-loader":"^5.0.0","npm-run-all":"^4.1.5","optimize-css-assets-webpack-plugin":"^5.0.1","path":"^0.12.7","replace-bundle-webpack-plugin":"^1.0.0","requirejs":"^2.3.6","responsive-loader":"^1.2.0","speed-measure-webpack-plugin":"^1.3.0","string-template":"^1.0.0","style-loader":"^1.1.3","terser-webpack-plugin":"^2.0.0","url-loader":"^4.0.0","webpack":"^4.30.0","webpack-cli":"^3.3.1","webpack-dev-server":"^3.3.1","webpack-node-externals":"^1.7.2"}}')},function(t,e,i){var n,r;!function(s,o){"use strict";void 0===(r="function"==typeof(n=function(){var t=function(){},e="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function n(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(e){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function r(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(i){return"debug"===i&&(i="log"),"undefined"!=typeof console&&("trace"===i&&e?r:void 0!==console[i]?n(console,i):void 0!==console.log?n(console,"log"):t)}function o(e,n){for(var r=0;r=0&&e<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(r=e,!1!==n&&function(t){var e=(i[t]||"silent").toUpperCase();if("undefined"!=typeof window&&a){try{return void(window.localStorage[a]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(t){}}}(e),o.call(s,e,t),"undefined"==typeof console&&e=0&&e<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(r=e,!1!==n&&function(t){var e=(i[t]||"silent").toUpperCase();if("undefined"!=typeof window&&a){try{return void(window.localStorage[a]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(t){}}}(e),o.call(s,e,t),"undefined"==typeof console&&e=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},v.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(m.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},v.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},v.prototype.number=function(t){if(!g.test(t)){if(m.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},v.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},v.prototype.keyword=function(t){if(f.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!m.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},v.prototype.neutral=function(t){if(p.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(g.test(t))return this.word=t,void(this.state=3);if(!m.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},v.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(r),r};function M(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?M[t]=u(arguments[1]):M[t]=b(arguments[1]):M[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?M.apply(e,t):M(t)}));if("string"==typeof t){if(t in M)return M[t]}else"EPSG"in t?M["EPSG:"+t.EPSG]=t:"ESRI"in t?M["ESRI:"+t.ESRI]=t:"IAU2000"in t?M["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(M);var w=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],E=["3857","900913","3785","102113"];function S(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in M}(t))return M[t];if(function(t){return w.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=b(t);if(function(t){var e=c(t,"authority");if(e){var i=c(e,"epsg");return i&&E.indexOf(i)>-1}}(e))return M["EPSG:3857"];var i=function(t){var e=c(t,"extension");if(e)return c(e,"proj4")}(e);return i?u(i):e}return function(t){return"+"===t[0]}(t)?u(t):void 0}var T=function(t,e){var i,n;if(t=t||{},!e)return t;for(n in e)void 0!==(i=e[n])&&(t[n]=i);return t},C=function(t,e,i){var n=t*e;return i/Math.sqrt(1-n*n)},P=function(t){return t<0?-1:1},R=function(t){return Math.abs(t)<=o?t:t-P(t)*s},A=function(t,i,n){var r=t*n,s=.5*t;return r=Math.pow((1-r)/(1+r),s),Math.tan(.5*(e-i))/r},L=function(t,i){for(var n,r,s=.5*t,o=e-2*Math.atan(i),a=0;a<=15;a++)if(n=t*Math.sin(o),o+=r=e-2*Math.atan(i*Math.pow((1-n)/(1+n),s))-o,Math.abs(r)<=1e-10)return o;return-9999};function I(t){return t}var D=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var i,s,o=t.x,a=t.y;if(a*n>90&&a*n<-90&&o*n>180&&o*n<-180)return null;if(Math.abs(Math.abs(a)-e)<=1e-10)return null;if(this.sphere)i=this.x0+this.a*this.k0*R(o-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(r+.5*a));else{var l=Math.sin(a),h=A(this.e,a,l);i=this.x0+this.a*this.k0*R(o-this.long0),s=this.y0-this.a*this.k0*Math.log(h)}return t.x=i,t.y=s,t},inverse:function(t){var i,n,r=t.x-this.x0,s=t.y-this.y0;if(this.sphere)n=e-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var o=Math.exp(-s/(this.a*this.k0));if(-9999===(n=L(this.e,o)))return null}return i=R(this.long0+r/(this.a*this.k0)),t.x=i,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:I,inverse:I,names:["longlat","identity"]}],N={},O=[];function G(t,e){var i=O.length;return t.names?(O[i]=t,t.names.forEach((function(t){N[t.toLowerCase()]=i})),this):(console.log(e),!0)}var k={start:function(){D.forEach(G)},add:G,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==N[e]&&O[N[e]]?O[N[e]]:void 0}},U={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},B=U.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};U.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var z={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},F={};function V(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:F[t]||null,isNull:!1}}function H(t){return t/3600*Math.PI/180}function W(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function j(t){return t.map((function(t){return[H(t.longitudeShift),H(t.latitudeShift)]}))}function q(t,e,i){return{name:W(t,e+8,e+16).trim(),parent:W(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function X(t,e,i,n){for(var r=e+176,s=[],o=0;o3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=2,l.datum_params[3]*=t,l.datum_params[4]*=t,l.datum_params[5]*=t,l.datum_params[6]=l.datum_params[6]/1e6+1))),a&&(l.datum_type=3,l.grids=a),l.a=n,l.b=r,l.es=s,l.ep2=o,l}(n.datumCode,n.datum_params,f.a,f.b,m.es,m.ep2,g);T(this,n),T(this,r),this.a=f.a,this.b=f.b,this.rf=f.rf,this.sphere=f.sphere,this.es=m.es,this.e=m.e,this.ep2=m.ep2,this.datum=v,this.init(),i(null,this)}else i(e)}else i(e)}function J(t,i,n){var r,s,o,a,l=t.x,h=t.y,c=t.z?t.z:0;if(h<-e&&h>-1.001*e)h=-e;else if(h>e&&h<1.001*e)h=e;else{if(h<-e)return{x:-1/0,y:-1/0,z:t.z};if(h>e)return{x:1/0,y:1/0,z:t.z}}return l>Math.PI&&(l-=2*Math.PI),s=Math.sin(h),a=Math.cos(h),o=s*s,{x:((r=n/Math.sqrt(1-i*o))+c)*a*Math.cos(l),y:(r+c)*a*Math.sin(l),z:(r*(1-i)+c)*s}}function Z(t,e,i,n){var r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_=t.x,x=t.y,b=t.z?t.z:0;if(r=Math.sqrt(_*_+x*x),s=Math.sqrt(_*_+x*x+b*b),r/i<1e-12){if(v=0,s/i<1e-12)return y=-n,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(x,_);o=b/s,u=(a=r/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),d=o*l,g=0;do{g++,h=e*(c=i/Math.sqrt(1-e*d*d))/(c+(y=r*u+b*d-c*(1-e*d*d))),m=(f=o*(l=1/Math.sqrt(1-h*(2-h)*a*a)))*u-(p=a*(1-h)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(f/Math.abs(p)),z:y}}function K(t){return 1===t||2===t}Y.projections=k,Y.projections.start();var Q=function(t,e,i){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return i;if(5===t.datum_type||5===e.datum_type)return i;var n=t.a,r=t.es;if(3===t.datum_type){if(0!==$(t,!1,i))return;n=6378137,r=.0066943799901413165}var s=e.a,o=e.b,a=e.es;return 3===e.datum_type&&(s=6378137,o=6356752.314,a=.0066943799901413165),r!==a||n!==s||K(t.datum_type)||K(e.datum_type)?(i=J(i,r,n),K(t.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+a*t.z)+n,y:h*(l*t.x+t.y-o*t.z)+r,z:h*(-a*t.x+o*t.y+t.z)+s}}}(i,t.datum_type,t.datum_params)),K(e.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6],c=(t.x-n)/h,u=(t.y-r)/h,d=(t.z-s)/h;return{x:c+l*u-a*d,y:-l*c+u+o*d,z:a*c-o*u+d}}}(i,e.datum_type,e.datum_params)),i=Z(i,a,s,o),3!==e.datum_type||0===$(e,!0,i)?i:void 0):i};function $(t,e,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},s={x:Number.NaN,y:Number.NaN},o=[],a=0;ar.y||u>r.x||f1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=R(s.x+i.ll[0]),n.y=s.y+i.ll[1]}else isNaN(s.x)||(n.x=t.x+s.x,n.y=t.y+s.y);return n}function et(t,e){var i,n={x:t.x/e.del[0],y:t.y/e.del[1]},r=Math.floor(n.x),s=Math.floor(n.y),o=n.x-1*r,a=n.y-1*s,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;i=s*e.lim[0]+r;var h=e.cvs[i][0],c=e.cvs[i][1];i++;var u=e.cvs[i][0],d=e.cvs[i][1];i+=e.lim[0];var p=e.cvs[i][0],f=e.cvs[i][1];i--;var m=e.cvs[i][0],g=e.cvs[i][1],v=o*a,y=o*(1-a),_=(1-o)*(1-a),x=(1-o)*a;return l.x=_*h+y*u+x*m+v*p,l.y=_*c+y*d+x*g+v*f,l}var it=function(t,e,i){var n,r,s,o=i.x,a=i.y,l=i.z||0,h={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==i.z)switch(0===s?(n=o,r=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(n=a,r=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(n=l,r="z"),t.axis[s]){case"e":h[r]=n;break;case"w":h[r]=-n;break;case"n":h[r]=n;break;case"s":h[r]=-n;break;case"u":void 0!==i[r]&&(h.z=n);break;case"d":void 0!==i[r]&&(h.z=-n);break;default:return null}return h},nt=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function rt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function st(t,e,r,s){var o;if(Array.isArray(r)&&(r=nt(r)),function(t){rt(t.x),rt(t.y)}(r),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(r=st(t,o=new Y("WGS84"),r,s),t=o),s&&"enu"!==t.axis&&(r=it(t,!1,r)),"longlat"===t.projName)r={x:r.x*i,y:r.y*i,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=Q(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*n,y:r.y*n,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),s&&"enu"!==e.axis?it(e,!0,r):r}var ot=Y("WGS84");function at(t,e,i,n){var r,s,o;return Array.isArray(i)?(r=st(t,e,i,n)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(i.splice(3)):[r.x,r.y,i[2]].concat(i.splice(3)):[r.x,r.y].concat(i.splice(2)):[r.x,r.y]):(s=st(t,e,i,n),2===(o=Object.keys(i)).length||o.forEach((function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;s[n]=i[n]})),s)}function lt(t){return t instanceof Y?t:t.oProj?t.oProj:Y(t)}function ht(t,e,i){t=lt(t);var n,r=!1;return void 0===e?(e=t,t=ot,r=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=ot,r=!0),e=lt(e),i?at(t,e,i):(n={forward:function(i,n){return at(t,e,i,n)},inverse:function(i,n){return at(e,t,i,n)}},r&&(n.oProj=e),n)}var ct=65,ut=73,dt=79,pt={forward:ft,inverse:function(t){var e=yt(xt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:mt};function ft(t,e){return e=e||5,function(t,e){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g="00000"+t.easting,v="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,u=t.northing,d=t.zoneNumber,p=_t(d),f=Math.floor(c/1e5),m=Math.floor(u/1e5)%20,i=f,n=m,s="AJSAJS".charCodeAt(r=p-1),o="AFAFAF".charCodeAt(r),h=!1,(a=s+i-1)>90&&(a=a-90+ct-1,h=!0),(a===ut||sut||(a>ut||sdt||(a>dt||s90&&(a=a-90+ct-1),(l=o+n)>86?(l=l-86+ct-1,h=!0):h=!1,(l===ut||out||(l>ut||odt||(l>dt||o86&&(l=l-86+ct-1),String.fromCharCode(a)+String.fromCharCode(l))+g.substr(g.length-5,e)+v.substr(v.length-5,e)}(function(t){var e,i,n,r,s,o,a,l=t.lat,h=t.lon,c=6378137,u=gt(l),d=gt(h);a=Math.floor((h+180)/6)+1,180===h&&(a=60),l>=56&&l<64&&h>=3&&h<12&&(a=32),l>=72&&l<84&&(h>=0&&h<9?a=31:h>=9&&h<21?a=33:h>=21&&h<33?a=35:h>=33&&h<42&&(a=37)),o=gt(6*(a-1)-180+3),e=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),n=.006739496752268451*Math.cos(u)*Math.cos(u),r=Math.cos(u)*(d-o),s=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p,f,m=.9996*e*(r+(1-i+n)*r*r*r/6+(5-18*i+i*i+72*n-.39089081163157013)*r*r*r*r*r/120)+5e5,g=.9996*(s+e*Math.tan(u)*(r*r/2+(5-i+9*n+4*n*n)*r*r*r*r/24+(61-58*i+i*i+600*n-2.2240339282485886)*r*r*r*r*r*r/720));return l<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(m),zoneNumber:a,zoneLetter:(p=l,f="Z",84>=p&&p>=72?f="X":72>p&&p>=64?f="W":64>p&&p>=56?f="V":56>p&&p>=48?f="U":48>p&&p>=40?f="T":40>p&&p>=32?f="S":32>p&&p>=24?f="R":24>p&&p>=16?f="Q":16>p&&p>=8?f="P":8>p&&p>=0?f="N":0>p&&p>=-8?f="M":-8>p&&p>=-16?f="L":-16>p&&p>=-24?f="K":-24>p&&p>=-32?f="J":-32>p&&p>=-40?f="H":-40>p&&p>=-48?f="G":-48>p&&p>=-56?f="F":-56>p&&p>=-64?f="E":-64>p&&p>=-72?f="D":-72>p&&p>=-80&&(f="C"),f)}}({lat:t[1],lon:t[0]}),e)}function mt(t){var e=yt(xt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function gt(t){return t*(Math.PI/180)}function vt(t){return t/Math.PI*180}function yt(t){var e=t.northing,i=t.easting,n=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var s,o,a,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,g=e;n<"N"&&(g-=1e7),c=6*(r-1)-180+3,d=(u=g/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),s=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),a=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*s);var v=d-s*Math.tan(d)/l*(h*h/2-(5+3*o+10*a-4*a*a-.06065547077041606)*h*h*h*h/24+(61+90*o+298*a+45*o*o-1.6983531815716497-3*a*a)*h*h*h*h*h*h/720);v=vt(v);var y,_=(h-(1+2*o+a)*h*h*h/6+(5-2*a+28*o-3*a*a+.05391597401814761+24*o*o)*h*h*h*h*h/120)/Math.cos(d);if(_=c+vt(_),t.accuracy){var x=yt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:x.lat,right:x.lon,bottom:v,left:_}}else y={lat:v,lon:_};return y}function _t(t){var e=t%6;return 0===e&&(e=6),e}function xt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,n=null,r="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;r+=e,s++}var o=parseInt(r,10);if(0===s||s+3>i)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;n=t.substring(s,s+=2);for(var l=_t(o),h=function(t,e){for(var i="AJSAJS".charCodeAt(e-1),n=1e5,r=!1;i!==t.charCodeAt(0);){if(++i===ut&&i++,i===dt&&i++,i>90){if(r)throw"Bad character: "+t;i=ct,r=!0}n+=1e5}return n}(n.charAt(0),l),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i="AFAFAF".charCodeAt(e-1),n=0,r=!1;i!==t.charCodeAt(0);){if(++i===ut&&i++,i===dt&&i++,i>86){if(r)throw"Bad character: "+t;i=ct,r=!0}n+=1e5}return n}(n.charAt(1),l);c0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),v=parseFloat(f)*d),{easting:g+h,northing:v+c,zoneLetter:a,zoneNumber:o,accuracy:d}}function bt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Mt(t,e,i){if(!(this instanceof Mt))return new Mt(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Mt.fromMGRS=function(t){return new Mt(mt(t))},Mt.prototype.toMGRS=function(t){return ft([this.x,this.y],t)};var wt=.01068115234375,Et=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*wt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*wt)));var i=t*t;return e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,e[3]=i*(.3645833333333333-.005696614583333333*t),e[4]=i*t*.3076171875,e},St=function(t,e,i,n){return i*=e,e*=e,n[0]*t-i*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))},Tt=function(t,e,i){for(var n=1/(1-e),r=t,s=20;s;--s){var o=Math.sin(r),a=1-e*o*o;if(r-=a=(St(r,o,Math.cos(r),i)-t)*(a*Math.sqrt(a))*n,Math.abs(a)<1e-10)return r}return r},Ct={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Et(this.es),this.ml0=St(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,i,n,r=t.x,s=t.y,o=R(r-this.long0),a=Math.sin(s),l=Math.cos(s);if(this.es){var h=l*o,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>1e-10?Math.tan(s):0,f=Math.pow(p,2),m=Math.pow(f,2);e=1-this.es*Math.pow(a,2),h/=Math.sqrt(e);var g=St(s,a,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+m+14*u-58*f*u+c/42*(61+179*m-m*f-479*f)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+a*o*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+m-58*f+270*u-330*f*u+c/56*(1385+543*m-m*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,n=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(n))>=1){if(v-1>1e-10)return 93;n=0}else n=Math.acos(n);s<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=i,t.y=n,t},inverse:function(t){var i,n,r,s,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(i=this.ml0+a/this.k0,n=Tt(i,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,u=this.ep2*Math.pow(h,2),d=Math.pow(u,2),p=Math.pow(c,2),f=Math.pow(p,2);i=1-this.es*Math.pow(l,2);var m=o*Math.sqrt(i)/this.k0,g=Math.pow(m,2);r=n-(i*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*u*p+u-4*d-g/30*(61+90*p-252*u*p+45*f+46*u-g/56*(1385+3633*p+4095*f+1574*f*p)))),s=R(this.long0+m*(1-g/6*(1+2*p+u-g/20*(5+28*p+24*f+8*u*p+6*u-g/42*(61+662*p+1320*f+720*f*p))))/h)}else r=e*P(a),s=0;else{var v=Math.exp(o/this.k0),y=.5*(v-1/v),_=this.lat0+a/this.k0,x=Math.cos(_);i=Math.sqrt((1-Math.pow(x,2))/(1+Math.pow(y,2))),r=Math.asin(i),a<0&&(r=-r),s=0===y&&0===x?0:R(Math.atan2(y,x)+this.long0)}return t.x=s,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Pt=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Rt=function(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),n=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(n,2))},At=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}(e*(1+e/(Rt(1,e)+1))),t<0?-e:e},Lt=function(t,e){for(var i,n=2*Math.cos(2*e),r=t.length-1,s=t[r],o=0;--r>=0;)i=n*s-o+t[r],o=s,s=i;return e+i*Math.sin(2*e)},It=function(t,e,i){for(var n,r,s=Math.sin(e),o=Math.cos(e),a=Pt(i),l=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(i),h=2*o*l,c=-2*s*a,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)n=f,r=p,d=h*(f=d)-n-c*(p=m)+t[u],m=c*f-r+h*p;return[(h=s*l)*d-(c=o*a)*m,h*m+c*d]},Dt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ct.init.apply(this),this.forward=Ct.forward,this.inverse=Ct.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),i*=e,this.cgb[1]=i*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i*=e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),i*=e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(e*(-24832/14175)-2.4)),i*=e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i*=e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),i*=e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i*=e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i*=e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i*=e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var n=Lt(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var i,n=2*Math.cos(e),r=t.length-1,s=t[r],o=0;--r>=0;)i=n*s-o+t[r],o=s,s=i;return Math.sin(e)*i}(this.gtu,2*n))},forward:function(t){var e=R(t.x-this.long0),i=t.y;i=Lt(this.cbg,i);var n=Math.sin(i),r=Math.cos(i),s=Math.sin(e),o=Math.cos(e);i=Math.atan2(n,o*r),e=Math.atan2(s*r,Rt(n,r*o)),e=At(Math.tan(e));var a,l,h=It(this.gtu,2*i,2*e);return i+=h[0],e+=h[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,i,n=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(r=(r-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var s=It(this.utg,2*r,2*n);r+=s[0],n+=s[1],n=Math.atan(Pt(n));var o=Math.sin(r),a=Math.cos(r),l=Math.sin(n),h=Math.cos(n);r=Math.atan2(o*h,Rt(l,h*a)),n=Math.atan2(l,h*a),e=R(n+this.long0),i=Lt(this.cgb,r)}else e=1/0,i=1/0;return t.x=e,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Nt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(R(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*i,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Dt.init.apply(this),this.forward=Dt.forward,this.inverse=Dt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},Ot=function(t,e){return Math.pow((1-t)/(1+t),e)},Gt={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+r)/(Math.pow(Math.tan(.5*this.lat0+r),this.C)*Ot(this.e*t,this.ratexp))},forward:function(t){var i=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+r),this.C)*Ot(this.e*Math.sin(n),this.ratexp))-e,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,n=t.y,s=Math.pow(Math.tan(.5*n+r)/this.K,1/this.C),o=20;o>0&&(n=2*Math.atan(s*Ot(this.e*Math.sin(t.y),-.5*this.e))-e,!(Math.abs(n-t.y)<1e-14));--o)t.y=n;return o?(t.x=i,t.y=n,t):null},names:["gauss"]},kt={init:function(){Gt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,i,n,r;return t.x=R(t.x-this.long0),Gt.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),n=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*n),t.x=r*i*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*i*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,i,n,r,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),i=Math.cos(o),r=Math.asin(i*this.sinc0+t.y*e*this.cosc0/s),n=Math.atan2(t.x*e,s*this.cosc0*i-t.y*this.sinc0*e)}else r=this.phic0,n=0;return t.x=n,t.y=r,Gt.inverse.apply(this,[t]),t.x=R(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Ut={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+P(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/A(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=C(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-e,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,n,r,s,o,a,l=t.x,h=t.y,c=Math.sin(h),u=Math.cos(h),d=R(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=1e-10&&Math.abs(h+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(d)),t.x=this.a*i*u*Math.sin(d)+this.x0,t.y=this.a*i*(this.coslat0*c-this.sinlat0*u*Math.cos(d))+this.y0,t):(n=2*Math.atan(this.ssfn_(h,c,this.e))-e,s=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(o=A(this.e,h*this.con,this.con*c),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(l-this.long0),t.y=this.y0-this.con*a*Math.cos(l-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(i=2*this.a*this.k0/(1+s*Math.cos(d)),t.y=i*r):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*s*Math.cos(d))),t.y=i*(this.cosX0*r-this.sinX0*s*Math.cos(d))+this.y0),t.x=i*s*Math.sin(d)+this.x0,t))},inverse:function(t){var i,n,r,s,o;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var l=2*Math.atan(a/(2*this.a*this.k0));return i=this.long0,n=this.lat0,a<=1e-10?(t.x=i,t.y=n,t):(n=Math.asin(Math.cos(l)*this.sinlat0+t.y*Math.sin(l)*this.coslat0/a),i=Math.abs(this.coslat0)<1e-10?this.lat0>0?R(this.long0+Math.atan2(t.x,-1*t.y)):R(this.long0+Math.atan2(t.x,t.y)):R(this.long0+Math.atan2(t.x*Math.sin(l),a*this.coslat0*Math.cos(l)-t.y*this.sinlat0*Math.sin(l))),t.x=i,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return n=this.lat0,i=this.long0,t.x=i,t.y=n,t;t.x*=this.con,t.y*=this.con,r=a*this.cons/(2*this.a*this.k0),n=this.con*L(this.e,r),i=this.con*R(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,a<=1e-10?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+t.y*Math.sin(s)*this.cosX0/a),i=R(this.long0+Math.atan2(t.x*Math.sin(s),a*this.cosX0*Math.cos(s)-t.y*this.sinX0*Math.sin(s)))),n=-1*L(this.e,Math.tan(.5*(e+o)));return t.x=i,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,i,n){return i*=n,Math.tan(.5*(e+t))*Math.pow((1-i)/(1+i),.5*n)}},Bt={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,n=1/this.rf,r=2*n-Math.pow(n,2),s=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+i)+this.K,r=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,i=t.y-this.y0,n=e/this.R,r=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(r))),a=this.lambda0+o/this.alpha,l=0,h=s,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=h,t},names:["somerc"]},zt={init:function(){var t,n,o,a,l,h,c,u,d,p,f,m,g,v=0,y=0,_=0,x=0,b=0,M=0,w=0;this.no_off=(g="object"==typeof(m=this).PROJECTION?Object.keys(m.PROJECTION)[0]:m.PROJECTION,"no_uoff"in m||"no_off"in m||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var E=!1;"alpha"in this&&(E=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),E&&(w=this.alpha),S&&(v=this.rectified_grid_angle*i),E||S)y=this.longc;else if(_=this.long1,b=this.lat1,x=this.long2,M=this.lat2,Math.abs(b-M)<=1e-7||(t=Math.abs(b))<=1e-7||Math.abs(t-e)<=1e-7||Math.abs(Math.abs(this.lat0)-e)<=1e-7||Math.abs(Math.abs(M)-e)<=1e-7)throw new Error;var T=1-this.es;n=Math.sqrt(T),Math.abs(this.lat0)>1e-10?(u=Math.sin(this.lat0),o=Math.cos(this.lat0),t=1-this.es*u*u,this.B=o*o,this.B=Math.sqrt(1+this.es*this.B*this.B/T),this.A=this.B*this.k0*n/t,(l=(a=this.B*n/(o*Math.sqrt(t)))*a-1)<=0?l=0:(l=Math.sqrt(l),this.lat0<0&&(l=-l)),this.E=l+=a,this.E*=Math.pow(A(this.e,this.lat0,u),this.B)):(this.B=1/n,this.A=this.k0,this.E=a=l=1),E||S?(E?(f=Math.asin(Math.sin(w)/a),S||(v=w)):(f=v,w=Math.asin(a*Math.sin(f))),this.lam0=y-Math.asin(.5*(l-1/l)*Math.tan(f))/this.B):(h=Math.pow(A(this.e,b,Math.sin(b)),this.B),c=Math.pow(A(this.e,M,Math.sin(M)),this.B),l=this.E/h,d=(c-h)/(c+h),p=((p=this.E*this.E)-c*h)/(p+c*h),(t=_-x)<-Math.pi?x-=s:t>Math.pi&&(x+=s),this.lam0=R(.5*(_+x)-Math.atan(p*Math.tan(.5*this.B*(_-x))/d)/this.B),f=Math.atan(2*Math.sin(this.B*R(_-this.lam0))/(l-1/l)),v=w=Math.asin(a*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(w))),this.lat0<0&&(this.u_0=-this.u_0)),l=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(r-l)),this.v_pole_s=this.ArB*Math.log(Math.tan(r+l))},forward:function(t){var i,n,r,s,o,a,l,h,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-e)>1e-10){if(i=.5*((o=this.E/Math.pow(A(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/o)),n=.5*(o+a),s=Math.sin(this.B*t.x),r=(i*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;h=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*t.x),l=Math.abs(a)<1e-7?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+s*this.singam,a)}else h=t.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(c.x=l,c.y=h):(l-=this.u_0,c.x=h*this.cosrot+l*this.sinrot,c.y=l*this.cosrot-h*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var i,n,r,s,o,a,l,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,i=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=.5*((r=Math.exp(-this.BrA*n))-1/r),o=.5*(r+1/r),l=((a=Math.sin(this.BrA*i))*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(l)-1)<1e-10)h.x=0,h.y=l<0?-e:e;else{if(h.y=this.E/Math.sqrt((1+l)/(1-l)),h.y=L(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(s*this.cosgam-a*this.singam,Math.cos(this.BrA*i))}return h.x+=this.lam0,h},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Ft={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),n=C(this.e,e,i),r=A(this.e,this.lat1,e),s=Math.sin(this.lat2),o=Math.cos(this.lat2),a=C(this.e,s,o),l=A(this.e,this.lat2,s),h=A(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(n/a)/Math.log(r/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=P(n)*(e-2e-10));var r,s,o=Math.abs(Math.abs(n)-e);if(o>1e-10)r=A(this.e,n,Math.sin(n)),s=this.a*this.f0*Math.pow(r,this.ns);else{if((o=n*this.ns)<=0)return null;s=0}var a=this.ns*R(i-this.long0);return t.x=this.k0*(s*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,t},inverse:function(t){var i,n,r,s,o,a=(t.x-this.x0)/this.k0,l=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(a*a+l*l),n=1):(i=-Math.sqrt(a*a+l*l),n=-1);var h=0;if(0!==i&&(h=Math.atan2(n*a,n*l)),0!==i||this.ns>0){if(n=1/this.ns,r=Math.pow(i/(this.a*this.f0),n),-9999===(s=L(this.e,r)))return null}else s=-e;return o=R(h/this.ns+this.long0),t.x=o,t.y=s,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"]},Vt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y,c=R(l-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),n=-c*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),s=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(r)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,i,n,r,s,o,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),i=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(e)),t.x=this.long0-i/this.alfa,o=e,a=0;var h=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(a=1),o=t.y,h+=1}while(0===a&&h<15);return h>=15?null:t},names:["Krovak","krovak"]},Ht=function(t,e,i,n,r){return t*r-e*Math.sin(2*r)+i*Math.sin(4*r)-n*Math.sin(6*r)},Wt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},jt=function(t){return.375*t*(1+.25*t*(1+.46875*t))},qt=function(t){return.05859375*t*t*(1+.75*t)},Xt=function(t){return t*t*t*(35/3072)},Yt=function(t,e,i){var n=e*i;return t/Math.sqrt(1-n*n)},Jt=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e},$t={init:function(){var t,i=Math.abs(this.lat0);if(Math.abs(i-e)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Qt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,i=[];return i[0]=.3333333333333333*t,e=t*t,i[0]+=.17222222222222222*e,i[1]=.06388888888888888*e,e*=t,i[0]+=.10257936507936508*e,i[1]+=.0664021164021164*e,i[2]=.016415012942191543*e,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Qt(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,n,s,o,a,l,h,c,u,d,p=t.x,f=t.y;if(p=R(p-this.long0),this.sphere){if(a=Math.sin(f),d=Math.cos(f),s=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+d*s:1+this.sinph0*a+this.cosph0*d*s)<=1e-10)return null;i=(n=Math.sqrt(2/n))*d*Math.sin(p),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*d*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(f+this.lat0)<1e-10)return null;n=r-.5*f,i=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(p),n*=s}}else{switch(h=0,c=0,u=0,s=Math.cos(p),o=Math.sin(p),a=Math.sin(f),l=Qt(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(h=l/this.qp,c=Math.sqrt(1-h*h)),this.mode){case this.OBLIQ:u=1+this.sinb1*h+this.cosb1*c*s;break;case this.EQUIT:u=1+c*s;break;case this.N_POLE:u=e+f,l=this.qp-l;break;case this.S_POLE:u=f-e,l=this.qp+l}if(Math.abs(u)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),n=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*h-this.sinb1*c*s):(u=Math.sqrt(2/(1+c*s)))*h*this.ymf,i=this.xmf*u*c*o;break;case this.N_POLE:case this.S_POLE:l>=0?(i=(u=Math.sqrt(l))*o,n=s*(this.mode===this.S_POLE?u:-u)):i=n=0}}return t.x=this.a*i+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,n,r,s,o,a,l,h,c,u,d=t.x/this.a,p=t.y/this.a;if(this.sphere){var f,m=0,g=0;if((n=.5*(f=Math.sqrt(d*d+p*p)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(n),m=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(f)<=1e-10?0:Math.asin(p*g/f),d*=g,p=m*f;break;case this.OBLIQ:n=Math.abs(f)<=1e-10?this.lat0:Math.asin(m*this.sinph0+p*g*this.cosph0/f),d*=g*this.cosph0,p=(m-Math.sin(n)*this.sinph0)*f;break;case this.N_POLE:p=-p,n=e-n;break;case this.S_POLE:n-=e}i=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,p):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,p*=this.dd,(a=Math.sqrt(d*d+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;s=2*Math.asin(.5*a/this.rq),r=Math.cos(s),d*=s=Math.sin(s),this.mode===this.OBLIQ?(l=r*this.sinb1+p*s*this.cosb1/a,o=this.qp*l,p=a*this.cosb1*r-p*this.sinb1*s):(l=p*s/a,o=this.qp*l,p=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(o=d*d+p*p))return t.x=this.long0,t.y=this.lat0,t;l=1-o/this.qp,this.mode===this.S_POLE&&(l=-l)}i=Math.atan2(d,p),h=Math.asin(l),c=this.apa,u=h+h,n=h+c[0]*Math.sin(u)+c[1]*Math.sin(u+u)+c[2]*Math.sin(u+u+u)}return t.x=R(this.long0+i),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},te=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)},ee={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=C(this.e3,this.sin_po,this.cos_po),this.qs1=Qt(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=C(this.e3,this.sin_po,this.cos_po),this.qs2=Qt(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Qt(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var n=Qt(this.e3,this.sin_phi,this.cos_phi),r=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*R(e-this.long0),o=r*Math.sin(s)+this.x0,a=this.rh-r*Math.cos(s)+this.y0;return t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),r=0,0!==e&&(r=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(i=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,i)),s=R(r/this.ns0+this.long0),t.x=s,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var i,n,r,s,o=te(.5*e);if(t<1e-10)return o;for(var a=t*t,l=1;l<=25;l++)if(o+=s=.5*(r=1-(n=t*(i=Math.sin(o)))*n)*r/Math.cos(o)*(e/(1-a)-i/r+.5/t*Math.log((1-n)/(1+n))),Math.abs(s)<=1e-7)return o;return null}},ie={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y;return n=R(l-this.long0),e=Math.sin(h),i=Math.cos(h),r=Math.cos(n),(s=this.sin_p14*e+this.cos_p14*i*r)>0||Math.abs(s)<=1e-10?(o=this.x0+1*this.a*i*Math.sin(n)/s,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*r)/s):(o=this.x0+this.infinity_dist*i*Math.sin(n),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*r)),t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),i=Math.sin(r),n=Math.cos(r),o=te(n*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i),s=R(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t},names:["gnom"]},ne={init:function(){this.sphere||(this.k0=C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,i,n=t.x,r=t.y,s=R(n-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var o=Qt(this.e,Math.sin(r));e=this.x0+this.a*this.k0*s,i=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=i,t},inverse:function(t){var i,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=R(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,i){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-n)<1e-6)return i<0?-1*e:e;for(var r,s,o,a,l=Math.asin(.5*i),h=0;h<30;h++)if(s=Math.sin(l),o=Math.cos(l),a=t*s,l+=r=Math.pow(1-a*a,2)/(2*o)*(i/(1-t*t)-s/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return l;return NaN}(this.e,2*t.y*this.k0/this.a),i=R(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=n,t},names:["cea"]},re={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,i=t.y,n=R(e-this.long0),r=Jt(i-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*r,t},inverse:function(t){var e=t.x,i=t.y;return t.x=R(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Jt(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},se={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wt(this.es),this.e1=jt(this.es),this.e2=qt(this.es),this.e3=Xt(this.es),this.ml0=this.a*Ht(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,n,r=t.x,s=t.y,o=R(r-this.long0);if(n=o*Math.sin(s),this.sphere)Math.abs(s)<=1e-10?(e=this.a*o,i=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(s),i=this.a*(Jt(s-this.lat0)+(1-Math.cos(n))/Math.tan(s)));else if(Math.abs(s)<=1e-10)e=this.a*o,i=-1*this.ml0;else{var a=Yt(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(n),i=this.a*Ht(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(n))}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){var e,i,n,r,s,o,a,l,h;if(n=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=1e-10)e=R(n/this.a+this.long0),i=0;else{var c;for(o=this.lat0+r/this.a,a=n*n/this.a/this.a+o*o,l=o,s=20;s;--s)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+a)*c)/((l-o)/c-1),Math.abs(h)<=1e-10){i=l;break}e=R(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(r+this.ml0)<=1e-10)i=0,e=R(this.long0+n/this.a);else{var u,d,p,f,m;for(o=(this.ml0+r)/this.a,a=n*n/this.a/this.a+o*o,l=o,s=20;s;--s)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*Ht(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(o*(u*(f=d/this.a)+1)-f-.5*u*(f*f+a))/(this.es*Math.sin(2*l)*(f*f+a-2*o*f)/(4*u)+(o-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=1e-10){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=R(this.long0+Math.asin(n*u/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},names:["Polyconic","poly"]},oe={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var i,n=e.x,r=e.y-this.lat0,s=n-this.long0,o=r/t*1e-5,a=s,l=1,h=0;for(i=1;i<=10;i++)l*=o,h+=this.A[i]*l;var c,u=h,d=a,p=1,f=0,m=0,g=0;for(i=1;i<=6;i++)c=f*u+p*d,p=p*u-f*d,f=c,m=m+this.B_re[i]*p-this.B_im[i]*f,g=g+this.B_im[i]*p+this.B_re[i]*f;return e.x=g*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var i,n,r=e.x,s=e.y,o=r-this.x0,a=(s-this.y0)/this.a,l=o/this.a,h=1,c=0,u=0,d=0;for(i=1;i<=6;i++)n=c*a+h*l,h=h*a-c*l,c=n,u=u+this.C_re[i]*h-this.C_im[i]*c,d=d+this.C_im[i]*h+this.C_re[i]*c;for(var p=0;p.999999999999&&(i=.999999999999),e=Math.asin(i);var n=R(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var r=Math.asin(i);return t.x=n,t.y=r,t},names:["Mollweide","moll"]},ce={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wt(this.es),this.e1=jt(this.es),this.e2=qt(this.es),this.e3=Xt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=C(this.e,this.sinphi,this.cosphi),this.ml1=Ht(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=C(this.e,this.sinphi,this.cosphi),this.ml2=Ht(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Ht(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,i=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var r=Ht(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-r)}var s=this.ns*R(i-this.long0),o=this.x0+e*Math.sin(s),a=this.y0+this.rh-e*Math.cos(s);return t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(0!==i&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return r=R(this.long0+s/this.ns),n=Jt(this.g-i/this.a),t.x=r,t.y=n,t;var o=this.g-i/this.a;return n=Zt(o,this.e0,this.e1,this.e2,this.e3),r=R(this.long0+s/this.ns),t.x=r,t.y=n,t},names:["Equidistant_Conic","eqdc"]},ue={init:function(){this.R=this.a},forward:function(t){var i,n,r=t.x,s=t.y,o=R(r-this.long0);Math.abs(s)<=1e-10&&(i=this.x0+this.R*o,n=this.y0);var a=te(2*Math.abs(s/Math.PI));(Math.abs(o)<=1e-10||Math.abs(Math.abs(s)-e)<=1e-10)&&(i=this.x0,n=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var l=.5*Math.abs(Math.PI/o-o/Math.PI),h=l*l,c=Math.sin(a),u=Math.cos(a),d=u/(c+u-1),p=d*d,f=d*(2/c-1),m=f*f,g=Math.PI*this.R*(l*(d-m)+Math.sqrt(h*(d-m)*(d-m)-(m+h)*(p-m)))/(m+h);o<0&&(g=-g),i=this.x0+g;var v=h+d;return g=Math.PI*this.R*(f*v-l*Math.sqrt((m+h)*(h+1)-v*v))/(m+h),n=s>=0?this.y0+g:this.y0-g,t.x=i,t.y=n,t},inverse:function(t){var e,i,n,r,s,o,a,l,h,c,u,d;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(n=t.x/u)*n+(r=t.y/u)*r,u=3*(r*r/(l=-2*(o=-Math.abs(r)*(1+s))+1+2*r*r+s*s)+(2*(a=o-2*r*r+n*n)*a*a/l/l/l-9*o*a/l/l)/27)/(h=(o-a*a/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=t.y>=0?(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(n)<1e-10?this.long0:R(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(n*n-r*r)+s*s))/2/n),t.x=e,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},de={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_,x,b,M,w,E=t.x,S=t.y,T=Math.sin(t.y),C=Math.cos(t.y),P=R(E-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(e-S)*Math.sin(P),t.y=this.y0-this.a*(e-S)*Math.cos(P),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(e+S)*Math.sin(P),t.y=this.y0+this.a*(e+S)*Math.cos(P),t):(_=this.sin_p12*T+this.cos_p12*C*Math.cos(P),y=(v=Math.acos(_))?v/Math.sin(v):1,t.x=this.x0+this.a*y*C*Math.sin(P),t.y=this.y0+this.a*y*(this.cos_p12*T-this.sin_p12*C*Math.cos(P)),t):(i=Wt(this.es),n=jt(this.es),r=qt(this.es),s=Xt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(o=this.a*Ht(i,n,r,s,e),a=this.a*Ht(i,n,r,s,S),t.x=this.x0+(o-a)*Math.sin(P),t.y=this.y0-(o-a)*Math.cos(P),t):Math.abs(this.sin_p12+1)<=1e-10?(o=this.a*Ht(i,n,r,s,e),a=this.a*Ht(i,n,r,s,S),t.x=this.x0+(o+a)*Math.sin(P),t.y=this.y0+(o+a)*Math.cos(P),t):(l=T/C,h=Yt(this.a,this.e,this.sin_p12),c=Yt(this.a,this.e,T),u=Math.atan((1-this.es)*l+this.es*h*this.sin_p12/(c*C)),x=0===(d=Math.atan2(Math.sin(P),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(P)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(d)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(P)*Math.cos(u)/Math.sin(d)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),v=h*x*(1-(b=x*x)*(g=(f=this.e*this.cos_p12*Math.cos(d)/Math.sqrt(1-this.es))*f)*(1-g)/6+(M=b*x)/8*(m=p*f)*(1-2*g)+(w=M*x)/120*(g*(4-7*g)-3*p*p*(1-7*g))-w*x/48*m),t.x=this.x0+v*Math.sin(d),t.y=this.y0+v*Math.cos(d),t))},inverse:function(t){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_,x,b,M,w,E;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*e*this.a)return;return n=i/this.a,r=Math.sin(n),s=Math.cos(n),o=this.long0,Math.abs(i)<=1e-10?a=this.lat0:(a=te(s*this.sin_p12+t.y*r*this.cos_p12/i),l=Math.abs(this.lat0)-e,o=Math.abs(l)<=1e-10?this.lat0>=0?R(this.long0+Math.atan2(t.x,-t.y)):R(this.long0-Math.atan2(-t.x,t.y)):R(this.long0+Math.atan2(t.x*r,i*this.cos_p12*s-t.y*this.sin_p12*r))),t.x=o,t.y=a,t}return h=Wt(this.es),c=jt(this.es),u=qt(this.es),d=Xt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*Ht(h,c,u,d,e),i=Math.sqrt(t.x*t.x+t.y*t.y),a=Zt((p-i)/this.a,h,c,u,d),o=R(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*Ht(h,c,u,d,e),i=Math.sqrt(t.x*t.x+t.y*t.y),a=Zt((i-p)/this.a,h,c,u,d),o=R(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),g=Math.atan2(t.x,t.y),f=Yt(this.a,this.e,this.sin_p12),v=Math.cos(g),_=-(y=this.e*this.cos_p12*v)*y/(1-this.es),x=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),w=1-_*(M=(b=i/f)-_*(1+_)*Math.pow(b,3)/6-x*(1+3*_)*Math.pow(b,4)/24)*M/2-b*M*M*M/6,m=Math.asin(this.sin_p12*Math.cos(M)+this.cos_p12*Math.sin(M)*v),o=R(this.long0+Math.asin(Math.sin(g)*Math.sin(M)/Math.cos(m))),E=Math.sin(m),a=Math.atan2((E-this.es*w*this.sin_p12)*Math.tan(m),E*(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]},pe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y;return n=R(l-this.long0),e=Math.sin(h),i=Math.cos(h),r=Math.cos(n),((s=this.sin_p14*e+this.cos_p14*i*r)>0||Math.abs(s)<=1e-10)&&(o=1*this.a*i*Math.sin(n),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*r)),t.x=o,t.y=a,t},inverse:function(t){var i,n,r,s,o,a,l;return t.x-=this.x0,t.y-=this.y0,i=Math.sqrt(t.x*t.x+t.y*t.y),n=te(i/this.a),r=Math.sin(n),s=Math.cos(n),a=this.long0,Math.abs(i)<=1e-10?(l=this.lat0,t.x=a,t.y=l,t):(l=te(s*this.sin_p14+t.y*r*this.cos_p14/i),o=Math.abs(this.lat0)-e,Math.abs(o)<=1e-10?(a=this.lat0>=0?R(this.long0+Math.atan2(t.x,-t.y)):R(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=l,t):(a=R(this.long0+Math.atan2(t.x*r,i*this.cos_p14*s-t.y*this.sin_p14*r)),t.x=a,t.y=l,t))},names:["ortho"]},fe=1,me=2,ge=3,ve=4,ye=5,_e=6,xe=1,be=2,Me=3,we=4;function Ee(t,i,n,s){var a;return t<1e-10?(s.value=xe,a=0):(a=Math.atan2(i,n),Math.abs(a)<=r?s.value=xe:a>r&&a<=e+r?(s.value=be,a-=e):a>e+r||a<=-(e+r)?(s.value=Me,a=a>=0?a-o:a+o):(s.value=we,a+=e)),a}function Se(t,e){var i=t+e;return i<-o?i+=s:i>+o&&(i-=s),i}var Te,Ce={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=e-r/2?this.face=ye:this.lat0<=-(e-r/2)?this.face=_e:Math.abs(this.long0)<=r?this.face=fe:Math.abs(this.long0)<=e+r?this.face=this.long0>0?me:ve:this.face=ge,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,n,s,a,l,h,c={x:0,y:0},u={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===ye)a=e-i,n>=r&&n<=e+r?(u.value=xe,s=n-e):n>e+r||n<=-(e+r)?(u.value=be,s=n>0?n-o:n+o):n>-(e+r)&&n<=-r?(u.value=Me,s=n+e):(u.value=we,s=n);else if(this.face===_e)a=e+i,n>=r&&n<=e+r?(u.value=xe,s=-n+e):n=-r?(u.value=be,s=-n):n<-r&&n>=-(e+r)?(u.value=Me,s=-n-e):(u.value=we,s=n>0?-n+o:-n-o);else{var d,p,f,m,g,v;this.face===me?n=Se(n,+e):this.face===ge?n=Se(n,+o):this.face===ve&&(n=Se(n,-e)),m=Math.sin(i),g=Math.cos(i),v=Math.sin(n),d=g*Math.cos(n),p=g*v,f=m,this.face===fe?s=Ee(a=Math.acos(d),f,p,u):this.face===me?s=Ee(a=Math.acos(p),f,-d,u):this.face===ge?s=Ee(a=Math.acos(-d),f,-p,u):this.face===ve?s=Ee(a=Math.acos(-p),f,d,u):(a=s=0,u.value=xe)}return h=Math.atan(12/o*(s+Math.acos(Math.sin(s)*Math.cos(r))-e)),l=Math.sqrt((1-Math.cos(a))/(Math.cos(h)*Math.cos(h))/(1-Math.cos(Math.atan(1/Math.cos(s))))),u.value===be?h+=e:u.value===Me?h+=o:u.value===we&&(h+=1.5*o),c.x=l*Math.cos(h),c.y=l*Math.sin(h),c.x=c.x*this.a+this.x0,c.y=c.y*this.a+this.y0,t.x=c.x,t.y=c.y,t},inverse:function(t){var i,n,r,s,a,l,h,c,u,d,p,f,m={lam:0,phi:0},g={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?g.value=xe:t.y>=0&&t.y>=Math.abs(t.x)?(g.value=be,i-=e):t.x<0&&-t.x>=Math.abs(t.y)?(g.value=Me,i=i<0?i+o:i-o):(g.value=we,i+=e),u=o/12*Math.tan(i),a=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),l=Math.atan(a),(h=1-(r=Math.cos(i))*r*(s=Math.tan(n))*s*(1-Math.cos(Math.atan(1/Math.cos(l)))))<-1?h=-1:h>1&&(h=1),this.face===ye)c=Math.acos(h),m.phi=e-c,g.value===xe?m.lam=l+e:g.value===be?m.lam=l<0?l+o:l-o:g.value===Me?m.lam=l-e:m.lam=l;else if(this.face===_e)c=Math.acos(h),m.phi=c-e,g.value===xe?m.lam=-l+e:g.value===be?m.lam=-l:g.value===Me?m.lam=-l-e:m.lam=l<0?-l-o:-l+o;else{var v,y,_;u=(v=h)*v,y=(u+=(_=u>=1?0:Math.sqrt(1-u)*Math.sin(l))*_)>=1?0:Math.sqrt(1-u),g.value===be?(u=y,y=-_,_=u):g.value===Me?(y=-y,_=-_):g.value===we&&(u=y,y=_,_=-u),this.face===me?(u=v,v=-y,y=u):this.face===ge?(v=-v,y=-y):this.face===ve&&(u=v,v=y,y=-u),m.phi=Math.acos(-_)-e,m.lam=Math.atan2(y,v),this.face===me?m.lam=Se(m.lam,-e):this.face===ge?m.lam=Se(m.lam,-o):this.face===ve&&(m.lam=Se(m.lam,+e))}return 0!==this.es&&(d=m.phi<0?1:0,p=Math.tan(m.phi),f=this.b/Math.sqrt(p*p+this.one_minus_f_squared),m.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),d&&(m.phi=-m.phi)),m.lam+=this.long0,t.x=m.lam,t.y=m.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Pe=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Re=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ae=n/5,Le=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},Ie={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=R(t.x-this.long0),i=Math.abs(t.y),r=Math.floor(i*Ae);r<0?r=0:r>=18&&(r=17);var s={x:Le(Pe[r],i=n*(i-.08726646259971647*r))*e,y:Le(Re[r],i)};return t.y<0&&(s.y=-s.y),s.x=s.x*this.a*.8487+this.x0,s.y=s.y*this.a*1.3523+this.y0,s},inverse:function(t){var n={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(n.y>=1)n.x/=Pe[18][0],n.y=t.y<0?-e:e;else{var r=Math.floor(18*n.y);for(r<0?r=0:r>=18&&(r=17);;)if(Re[r][0]>n.y)--r;else{if(!(Re[r+1][0]<=n.y))break;++r}var s=Re[r],o=5*(n.y-s[0])/(Re[r+1][0]-s[0]);o=function(t,e,i,n){for(var r=e;n;--n){var s=t(r);if(r-=s,Math.abs(s)1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=function(t,e,i){for(var n=[],r=0;r1)for(var i=1;i0?s.replace("%var%",r.join(" - ")):s.replace("%var%","%var% (not specified)")}catch(t){}return s}},u={normalyzeParameters:function(t){var e=null;if(t){var i=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r||(r=""),i.push(n+"="+r)}e=i.join("&")}return e},normalyzeUrl:function(t,e,i){var n=t;if(t){var r=t.indexOf("?");-1===r&&(n+="?"),-1!==r&&r!==t.length-1&&(n+="&")}return e&&(n+="string"==typeof e?e:this.normalyzeParameters(e)),i&&(n=encodeURIComponent(n)),n},indent:function(t,e){return new Array((t||0)+1).join("\t")+e}},d=i(9),p=i.n(d),f={call:function(t){var e=h.getLogger("XHR");if(e.trace("[XHR::call()]"),p.a.polyfill(),!t.url)throw new Error("missing parameter : url is not defined !");if(!t.method)throw new Error("missing parameter : method is not defined !");t.format||(t.format="text");var i={};switch(i.url=t.url,i.data=t.data?t.data:null,i.method=t.method,i.timeOut=t.timeOut||0,i.scope=t.scope||this,i.proxy=t.proxy||null,i.content=t.content||null,i.headers=t.headers||{referer:"http://localhost"},t.method){case"DELETE":case"GET":break;case"PUT":case"POST":i.content=t.content?t.content:"application/x-www-form-urlencoded",i.headers=t.headers?t.headers:{referer:"http://localhost"};break;case"HEAD":case"OPTIONS":throw new Error("HTTP method not yet supported !");default:throw new Error("HTTP method unknown !")}switch(t.format){case"text":this.__call(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;case"json":this.__callJSON(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;case"xml":this.__callXML(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;default:throw new Error("This output Format is not yet supported !")}},__call:function(t){var e=h.getLogger("XHR");return e.trace("[XHR::__call()]"),new Promise((function(n,r){var s="POST"===t.method||"PUT"===t.method?1:0;t.data&&("object"==typeof t.data&&Object.keys(t.data).length||"string"==typeof t.data&&t.data.length)&&!s&&("Geocode"===t.scope.CLASSNAME||"ReverseGeocode"===t.scope.CLASSNAME?t.url=t.url+t.data:t.url=u.normalyzeUrl(t.url,t.data)),e.trace("URL = ",t.url);var o=null;if("undefined"==typeof window){var a=i(6),l={headers:{Referer:"https://localhost"}};return t.data&&"string"==typeof t.data&&s&&(l={method:t.method,body:t.data,headers:{"Content-Type":t.content,Referer:"https://localhost"}}),a(t.url,l).then((function(t){if(t.ok)n(t.text());else{var e="Errors Occured on Http Request (status : '"+t.statusText+"' | url : '"+t.url+"')",i=t.status;r({message:e,status:i})}})).catch((function(t){r({message:t,status:-1})}))}if(window.XMLHttpRequest){e.trace("XMLHttpRequest"),(o=new XMLHttpRequest).open(t.method,t.url,!0),o.overrideMimeType=t.content;var h=null;t.timeOut>0&&(e.trace("XHR - TimeOut actif !"),h=window.setTimeout((function(){r({message:"TimeOut Occured on Http Request with XMLHttpRequest !",status:-1})}),t.timeOut)),s&&(e.trace("data = ",t.data),o.setRequestHeader("Content-type",t.content)),o.onerror=function(t){console.log(t),r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},o.ontimeout=function(t){console.log(t),r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},o.onreadystatechange=function(t){if(4===o.readyState)if(200===o.status)window.clearTimeout(h),n(o.response);else{var e="Errors Occured on Http Request (status : '"+t.target.statusText+"' | url : '"+t.target.responseURL+"' | response : '"+t.target.response+"')",i=t.target.status;r({message:e,status:i})}};var c=t.data&&s?t.data:null;o.send(c)}else{if(!window.XDomainRequest)throw new Error("CORS not supported");e.trace("XDomainRequest"),(o=new XDomainRequest).open(t.method,t.url),o.overrideMimeType=t.content,t.timeOut>0&&(o.timeout=t.timeout,e.trace("XHR - TimeOut actif !")),s&&o.setRequestHeader("Content-type",t.content),o.onerror=function(){r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},o.ontimeout=function(){r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},o.onload=function(t){if(200===o.status)n(o.responseText);else{var e="Errors Occured on Http Request (status : '"+t.target.statusText+"' | url : '"+t.target.responseURL+"')",i=t.target.status;r({message:e,status:i})}};var d=t.data&&s?t.data:null;o.send(d)}}))},__callJSON:function(t){return this.__call(t).then(JSON.parse).catch((function(e){console.log("_callJSON failed on : ",t.url,e)}))},__callXML:function(t){return this.__call(t).then((function(t){var e;"undefined"==typeof window?e=(new(0,i(7).DOMParser)).parseFromString(t,"text/xml"):window.DOMParser?e=(new window.DOMParser).parseFromString(t,"text/xml"):((e=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,e.loadXML(t));return e})).catch((function(e){console.log("__callXML failed on : ",t.url,e)}))}},m={uuid:(n=Math.floor(Date.now()),function(){return n++}),call:function(t){var e=h.getLogger("JSONP");if(e.trace("[JSONP::call ()]"),!t)throw e.error("missing parameter : options !"),new Error("missing parameter : options !");if(!t.url)throw e.error("missing parameter : options.url !"),new Error("missing parameter : options.url !");if(t.timeOut||(e.info("setting 'options.timeOut' default value"),t.timeOut=0),!t.onResponse)throw e.error("missing parameter : options.onResponse !"),new Error("missing parameter : options.onResponse !");var i="string"==typeof t.callbackSuffix?t.callbackSuffix:this.uuid(),n=!1,r=!1,s=t.url.indexOf("callback=");if(-1!==s){n=!0;var o=t.url.indexOf("&",s);-1===o&&(o=t.url.length);var a=t.url.substring(s+9,o);a&&(r=!0,t.callbackName=a,e.info("setting 'options.callbackName' value ("+t.callbackName+") from 'options.url' parameter"))}if(!n){var l=t.url.indexOf("?");-1===l?t.url=t.url+"?callback=":l===t.url.length?t.url=t.url+"callback=":t.url=t.url+"&callback=",e.info("setting callback default key in 'options.url' : "+t.url)}var c=!!t.callbackName||r;if(r||(t.callbackName||(e.info("setting 'options.callbackName' default value"),t.callbackName="callback",(i||""===i)&&(t.callbackName+=i)),t.url=t.url.replace("callback=","callback="+t.callbackName),e.info("setting callback function name in 'options.url' : "+t.url)),t.onTimeOut||(e.info("setting 'options.onTimeOut' default value"),t.onTimeOut=function(){console.log("TimeOut while invoking url : "+t.url)}),!c){var u=this,d=null;t.timeOut>0&&(d=window.setTimeout((function(){window[t.callbackName]=function(){},t.onTimeOut(),u._deleteScript(i)}),t.timeOut)),window[t.callbackName]=function(e){window.clearTimeout(d),t.onResponse(e),u._deleteScript(i)}}this._createScript(i,t.url)},_createScript:function(t,e){var i,n=document.getElementById("results"+t);(i=document.createElement("script")).setAttribute("type","text/javascript"),i.setAttribute("src",e),i.setAttribute("charset","UTF-8"),i.setAttribute("id","results"+t),i.setAttribute("async","true");var r=document.documentElement||document.getElementsByTagName("head")[0];null===n?r.appendChild(i):r.replaceChild(i,n)},_deleteScript:function(t){var e=document.getElementById("results"+t);if(e){var i=e.parentNode||document.documentElement;if(!i)return;i.removeChild(e)}}},g={send:function(t){var e=t||{method:"GET",protocol:"XHR",timeOut:0,format:null,wrap:!0,nocache:!0,output:"json",callback:null,callbackSuffix:null};if("undefined"!=typeof window||"JSONP"!==t.protocol){if("XHR"===t.protocol||"json"===t.format?e.wrap=!1:"JSONP"===t.protocol&&"xml"===t.format&&(e.wrap=!0),e.callback=null,e.output=e.wrap?"json":null,e.wrap){var i={};i.output=e.output,i.callback=e.callback,delete i.callback,e.url=u.normalyzeUrl(t.url,i)}switch(e.protocol){case"XHR":"GET"===t.method&&t.nocache&&(e.url=u.normalyzeUrl(e.url,{t:(new Date).getTime()})),f.call(e);break;case"JSONP":e.data&&(e.url=u.normalyzeUrl(e.url,e.data)),m.call(e);break;default:throw new Error("protocol not supported (XHR|JSONP) !")}}else console.log("Value (s) for parameter (s) 'protocol=JSONP (instead use XHR)' not supported to NodeJS")}};function v(t){if(!(this instanceof v))throw new TypeError("ErrorService constructor cannot be called as a function.");var e=t;"string"==typeof t||t instanceof String?(this.message=t,this.status=-1,this.type=v.TYPE_UNKERR):(this.message=e.message||"undefined!?",this.type=e.type,this.status=e.status||-1),this.name="ErrorService",this.stack=(new Error).stack}v.TYPE_SRVERR="SERVICE_ERROR",v.TYPE_USEERR="USAGE_ERROR",v.TYPE_UNKERR="UNKNOWN_ERROR",v.prototype=Object.create(Error.prototype,{constructor:{value:v,writable:!0,configurable:!0}});var y=v,_={ssl:!0,url:function(t,e){return(!1===_.ssl?"http://":"https://")+"wxs.ign.fr".concat("/",t,e)},Alti:{_key:{"elevation-json":"/alti/rest/elevation.json","elevation-xml":"/alti/rest/elevation.xml","profil-json":"/alti/rest/elevationLine.json","profil-xml":"/alti/rest/elevationLine.xml",wps:"/alti/wps"},url:function(t){return{"elevation-json":_.url(t,this._key["elevation-json"]),"elevation-xml":_.url(t,this._key["elevation-xml"]),"profil-json":_.url(t,this._key["profil-json"]),"profil-xml":_.url(t,this._key["profil-xml"]),wps:_.url(t,this._key.wps)}}},ProcessIsoCurve:{_key:"/geoportail/isochrone/rest/1.0.0/isochrone",url:function(t){return _.url(t,this._key)}},Config:{_key:"https://raw.githubusercontent.com/IGNF/geoportal-configuration/main/dist/",url:function(t){Array.isArray(t)||(t=t.split(","));for(var e=[],i=0;in(t,{credentials:"same-origin"}).then(t=>{if(t.ok)return t.json().then(t=>t).catch(t=>{throw new Error("Exception Json : "+t)});throw new Error("Exception HTTP : "+t.status+" (status code) !")}).catch(t=>new Promise((e,i)=>{i(t)})),o=[];for(let t=0;t{if(!t)throw new Error("results config empty !?");t.forEach(t=>{this.listConfigResults.push(t)})}).then(()=>{e.call(this,this.listConfigResults)}).catch(e=>{t.call(this,e)})},P=function(t,e){this.listConfigResults=[];for(var i=0;ie||t__IDENTIFIER__\x3c!-- __DATAINPUTS__ --\x3e__RAWDATAOUTPUT__',input:"__KEY____DATA__"}},namespaceByDefault:function(){return['xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"','xmlns="http://www.opengis.net/wps/1.0.0"','xmlns:wfs="http://www.opengis.net/wfs"','xmlns:wps="http://www.opengis.net/wps/1.0.0"','xmlns:ows="http://www.opengis.net/ows/1.1"','xmlns:gml="http://www.opengis.net/gml"','xmlns:ogc="http://www.opengis.net/ogc"','xmlns:wcs="http://www.opengis.net/wcs/1.1.1"','xmlns:xlink="http://www.w3.org/1999/xlink"'].join(" ")},schemaLocationByDefault:function(){return'xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"'},processRequestString:function(){this.logger.trace("WPS::processRequestString ()");var t="";if("POST"===this.method)t=this.template.post.value;else{if("GET"!==this.method)return this.logger.error("No other method supported by the service !"),!1;t=this.template.get.value}return t=(t=(t=(t=(t=t.replace(/__SERVICE__/g,this.paramservice)).replace(/__VERSION__/g,this.paramversion)).replace(/__RAWDATAOUTPUT__/g,this.paramrawdataoutput)).replace(/__IDENTIFIER__/g,this.paramidentifier)).replace(/__REQUEST__/g,this.paramrequest),"POST"===this.method&&(t=(t=t.replace(/__NAMESPACE__/g,this.namespaceByDefault)).replace(/__SCHEMALOCATION__/g,this.schemaLocationByDefault)),(t=t.replace(//g,this.__addDataInputs()))?(this.requestString=t,this.logger.trace("traduction tmpl",t),!0):(this.logger.warn("traduction tmpl : empty request !?"),!1)},__addDataInputs:function(){this.logger.trace("WPS::__addDataInputs ()");for(var t,e="GET"===this.method?this.template.get.input:this.template.post.input,i="GET"===this.method?";":"",n="",r=this,s=this.DataObject.getData(),o=0;o0)for(var o=n.getElementsByTagName("parsererror"),a=0;a0){var n=function(t){if(t.attributes.length>0){for(var e={},i=t.attributes,n=0;n0?e.index=e.filters.type[0]:e.index=e.filters.type),delete e.filters.type),e.filters.bbox&&(this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"),delete e.filters.bbox)),delete e.filterOptions),e.position&&(e.position.x&&(this.logger.warn("The parameter 'position.x' is deprecated"),e.position.lon||(e.position.lon=e.position.x),delete e.position.x),e.position.y&&(this.logger.warn("The parameter 'position.y' is deprecated"),e.position.lat||(e.position.lat=e.position.y),delete e.position.y)),e.returnFreeForm&&(this.logger.warn("The parameter 'returnFreeForm' is deprecated"),delete e.returnFreeForm),e.srs&&(this.logger.warn("The parameter 'srs' is deprecated"),delete e.srs),e},pt.prototype.buildRequest=function(t,e){var i={httpMethod:this.options.httpMethod,geocodeMethod:"search",query:this.options.query,index:this.options.index,returnTrueGeometry:this.options.returnTrueGeometry,position:this.options.position,maxResp:this.options.maximumResponses,filters:this.options.filters};this.request=rt.build(i),this.request?e.call(this,this.request):t.call(this,new y(c.getMessage("SERVICE_REQUEST_BUILD")))},pt.prototype.analyzeResponse=function(t,e){if(this.response){var i={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:e,scope:this};dt.build(i)}else t.call(this,new y(c.getMessage("SERVICE_RESPONSE_EMPTY")))};var ft=pt;function mt(t){if(!(this instanceof mt))throw new TypeError(c.getMessage("CLASS_CONSTRUCTOR","ReverseGeocode"));this.CLASSNAME="ReverseGeocode",this.logger=h.getLogger("Gp.Services.ReverseGeocode"),this.logger.trace("[Constructeur ReverseGeocode (options)]");var e=this.patchOptionConvertor(t);if(e.serverUrl=e.serverUrl||"https://wxs.ign.fr/calcul/geoportail/geocodage/rest/0.1/reverse",w.apply(this,[e]),e.searchGeometry)this.options.searchGeometry=e.searchGeometry;else if(!e.position)throw new Error(c.getMessage("PARAM_MISSING","searchGeometry"));if(e.index||(this.options.index=e.index="StreetAddress"),e.filters)for(var i=Object.keys(e.filters),n=0;n0?e.index=e.filterOptions.type[0]:e.index=e.filterOptions.type),delete e.filterOptions.type),e.filterOptions.bbox&&(this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"),e.searchGeometry||(e.searchGeometry=this.bbox2Json(e.filterOptions.bbox)),delete e.filterOptions.bbox),e.filterOptions.circle&&(this.logger.warn("The parameter 'filterOptions.circle' is deprecated"),e.searchGeometry||(e.searchGeometry=this.circle2Json(e.filterOptions.circle)),delete e.filterOptions.circle),e.filterOptions.polygon&&(this.logger.warn("The parameter 'filterOptions.polygon' is deprecated"),e.searchGeometry||(e.searchGeometry=this.polygon2Json(e.filterOptions.polygon)),delete e.filterOptions.polygon),!e.filters&&Object.keys(e.filterOptions).length>0&&(e.filters=e.filterOptions),delete e.filterOptions),e.position&&(e.position.x&&(this.logger.warn("The parameter 'position.x' is deprecated"),e.position.lon||(e.position.lon=e.position.x),delete e.position.x),e.position.y&&(this.logger.warn("The parameter 'position.y' is deprecated"),e.position.lat||(e.position.lat=e.position.y),delete e.position.y)),e.srs&&(this.logger.warn("The parameter 'srs' is deprecated"),delete e.srs),e},mt.prototype.buildRequest=function(t,e){var i={httpMethod:this.options.httpMethod,geocodeMethod:"reverse",searchGeometry:this.options.searchGeometry,index:this.options.index,position:this.options.position,returnTrueGeometry:this.options.returnTrueGeometry,maxResp:this.options.maximumResponses,filters:this.options.filters};this.request=rt.build(i),this.request?e.call(this,this.request):t.call(this,new y(c.getMessage("SERVICE_REQUEST_BUILD")))},mt.prototype.analyzeResponse=function(t,e){if(this.response){var i={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:e,scope:this};dt.build(i)}else t.call(this,new y(c.getMessage("SERVICE_RESPONSE_EMPTY")))},mt.prototype.bbox2Json=function(t){return{type:"Polygon",coordinates:[[[t.left,t.top],[t.right,t.top],[t.right,t.bottom],[t.left,t.bottom],[t.left,t.top]]]}},mt.prototype.circle2Json=function(t){return{type:"Circle",radius:t.radius,coordinates:[t.x,t.y]}},mt.prototype.polygon2Json=function(t){for(var e={type:"Polygon",coordinates:[[]]},i=0;i=s&&r<=o},_checkDMSDegrees:function(t,e){if(isNaN(e.value))return!1;var i=parseFloat(e.value);if((0|i)!==i)return!1;var n=Number(e.dataset.min),r=Number(e.dataset.max);if(ir)return!1;var s=document.getElementById(this._addUID("GPmousePosition"+t+"Minutes")),o=document.getElementById(this._addUID("GPmousePosition"+t+"Seconds"));return i>=r?(s.dataset.max=0,o.dataset.max=0):(s.dataset.max=59,o.dataset.max=59.9999),!0},GPdisplayCoords:function(t){if(t){var e=document.getElementById(this._addUID("GPmousePositionLonLabel")),i=document.getElementById(this._addUID("GPmousePositionLatLabel"));if(t.x||t.y?(i.innerHTML="X : ",e.innerHTML="Y : "):t.e||t.n?(i.innerHTML="E : ",e.innerHTML="N : "):(i.innerHTML="Latitude : ",e.innerHTML="Longitude : "),"object"===re(t.lat)&&"object"===re(t.lng)){var n={lng:"Lon",lat:"Lat"},r=["Degrees","Minutes","Seconds"];for(var s in n)for(var o=0;o>8&255]+ae[t>>16&255]+ae[t>>24&255]+"-"+ae[255&e]+ae[e>>8&255]+"-"+ae[e>>16&15|64]+ae[e>>24&255]+"-"+ae[63&i|128]+ae[i>>8&255]+"-"+ae[i>>16&255]+ae[i>>24&255]+ae[255&n]+ae[n>>8&255]+ae[n>>16&255]+ae[n>>24&255]).toUpperCase()}function ue(t,e,i){return Math.max(e,Math.min(i,t))}function de(t,e){return(t%e+e)%e}function pe(t,e,i){return(1-i)*t+i*e}function fe(t){return 0==(t&t-1)&&0!==t}function me(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}class ge{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}ge.prototype.isVector2=!0;class ve{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,l){const h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=r,h[5]=a,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],h=i[4],c=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],_=n[7],x=n[2],b=n[5],M=n[8];return r[0]=s*f+o*v+a*x,r[3]=s*m+o*y+a*b,r[6]=s*g+o*_+a*M,r[1]=l*f+h*v+c*x,r[4]=l*m+h*y+c*b,r[7]=l*g+h*_+c*M,r[2]=u*f+d*v+p*x,r[5]=u*m+d*y+p*b,r[8]=u*g+d*_+p*M,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8];return e*s*h-e*o*l-i*r*h+i*o*a+n*r*l-n*s*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8],c=h*s-o*l,u=o*a-h*r,d=l*r-s*a,p=e*c+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=c*f,t[1]=(n*l-h*i)*f,t[2]=(o*i-n*s)*f,t[3]=u*f,t[4]=(h*e-n*a)*f,t[5]=(n*r-o*e)*f,t[6]=d*f,t[7]=(i*a-l*e)*f,t[8]=(s*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,s,o){const a=Math.cos(r),l=Math.sin(r);return this.set(i*a,i*l,-i*(a*s+l*o)+s+t,-n*l,n*a,-n*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],s=n[3],o=n[6],a=n[1],l=n[4],h=n[7];return n[0]=e*r+i*a,n[3]=e*s+i*l,n[6]=e*o+i*h,n[1]=-i*r+e*a,n[4]=-i*s+e*l,n[7]=-i*o+e*h,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}function ye(t){for(let e=t.length-1;e>=0;--e)if(t[e]>65535)return!0;return!1}ve.prototype.isMatrix3=!0;Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function _e(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const xe={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},be={h:0,s:0,l:0},Me={h:0,s:0,l:0};function we(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function Ee(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Se(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Te{constructor(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=de(t,1),e=ue(e,0,1),i=ue(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=we(r,n,t+1/3),this.g=we(r,n,t),this.b=we(r,n,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=xe[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Ee(t.r),this.g=Ee(t.g),this.b=Ee(t.b),this}copyLinearToSRGB(t){return this.r=Se(t.r),this.g=Se(t.g),this.b=Se(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),s=Math.min(e,i,n);let o,a;const l=(s+r)/2;if(s===r)o=0,a=0;else{const t=r-s;switch(a=l<=.5?t/(r+s):t/(2-r-s),r){case e:o=(i-n)/t+(i2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=_e("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&this.version++}}function Le(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Pe.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Ae.DEFAULT_IMAGE=void 0,Ae.DEFAULT_MAPPING=300,Ae.prototype.isTexture=!0;class Ie{constructor(t=0,e=0,i=0,n=1){this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const s=t.elements,o=s[0],a=s[4],l=s[8],h=s[1],c=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-h)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(a+h)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(o+1)/2,s=(c+1)/2,m=(f+1)/2,g=(a+h)/4,v=(l+d)/4,y=(u+p)/4;return t>s&&t>m?t<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=g/i,r=v/i):s>m?s<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(s),i=g/n,r=y/n):m<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(m),i=v/r,n=y/r),this.set(i,n,r,e),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(h-a)*(h-a));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(h-a)/m,this.w=Math.acos((o+c+f-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}Ie.prototype.isVector4=!0;class De extends oe{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Ie(0,0,t,e),this.scissorTest=!1,this.viewport=new Ie(0,0,t,e),this.texture=new Ae(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:1006,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Object.assign({},t.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}De.prototype.isWebGLRenderTarget=!0;(class extends De{constructor(t,e,i){super(t,e);const n=this.texture;this.texture=[];for(let t=0;t=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,o=Math.sin(o*s)/r}const r=o*i;if(a=a*t+u*r,l=l*t+d*r,h=h*t+p*r,c=c*t+f*r,t===1-o){const t=1/Math.sqrt(a*a+l*l+h*h+c*c);a*=t,l*=t,h*=t,c*=t}}t[e]=a,t[e+1]=l,t[e+2]=h,t[e+3]=c}static multiplyQuaternionsFlat(t,e,i,n,r,s){const o=i[n],a=i[n+1],l=i[n+2],h=i[n+3],c=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=o*p+h*c+a*d-l*u,t[e+1]=a*p+h*u+l*c-o*d,t[e+2]=l*p+h*d+o*u-a*c,t[e+3]=h*p-o*c-a*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,s=t._order,o=Math.cos,a=Math.sin,l=o(i/2),h=o(n/2),c=o(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(s){case"XYZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"YXZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"ZXY":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"ZYX":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"YZX":this._x=u*h*c+l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c-u*d*p;break;case"XZY":this._x=u*h*c-l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],o=e[5],a=e[9],l=e[2],h=e[6],c=e[10],u=i+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(h-a)*t,this._y=(r-l)*t,this._z=(s-n)*t}else if(i>o&&i>c){const t=2*Math.sqrt(1+i-o-c);this._w=(h-a)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+l)/t}else if(o>c){const t=2*Math.sqrt(1+o-i-c);this._w=(r-l)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(a+h)/t}else{const t=2*Math.sqrt(1+c-i-o);this._w=(s-n)/t,this._x=(r+l)/t,this._y=(a+h)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ue(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,s=t._w,o=e._x,a=e._y,l=e._z,h=e._w;return this._x=i*h+s*o+n*l-r*a,this._y=n*h+s*a+r*o-i*l,this._z=r*h+s*l+i*a-n*o,this._w=s*h-i*o-n*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,s=this._w;let o=s*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),h=Math.atan2(l,o),c=Math.sin((1-e)*h)/l,u=Math.sin(e*h)/l;return this._w=s*c+this._w*u,this._x=i*c+this._x*u,this._y=n*c+this._y*u,this._z=r*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Oe.prototype.isQuaternion=!0;class Ge{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ue.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ue.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,l=a*e+s*n-o*i,h=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=l*a+u*-r+h*-o-c*-s,this.y=h*a+u*-s+c*-r-l*-o,this.z=c*a+u*-o+l*-s-h*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return ke.copy(this).projectOnVector(t),this.sub(ke)}reflect(t){return this.sub(ke.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ue(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}Ge.prototype.isVector3=!0;const ke=new Ge,Ue=new Oe;class Be{constructor(t=new Ge(1/0,1/0,1/0),e=new Ge(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.length;ar&&(r=l),h>s&&(s=h),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.count;ar&&(r=l),h>s&&(s=h),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Fe),Fe.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Je),Ze.subVectors(this.max,Je),He.subVectors(t.a,Je),We.subVectors(t.b,Je),je.subVectors(t.c,Je),qe.subVectors(We,He),Xe.subVectors(je,We),Ye.subVectors(He,je);let e=[0,-qe.z,qe.y,0,-Xe.z,Xe.y,0,-Ye.z,Ye.y,qe.z,0,-qe.x,Xe.z,0,-Xe.x,Ye.z,0,-Ye.x,-qe.y,qe.x,0,-Xe.y,Xe.x,0,-Ye.y,Ye.x,0];return!!$e(e,He,We,je,Ze)&&(e=[1,0,0,0,1,0,0,0,1],!!$e(e,He,We,je,Ze)&&(Ke.crossVectors(qe,Xe),e=[Ke.x,Ke.y,Ke.z],$e(e,He,We,je,Ze)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Fe.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Fe).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(ze[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ze[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ze[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ze[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ze[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ze[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ze[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ze[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ze)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}Be.prototype.isBox3=!0;const ze=[new Ge,new Ge,new Ge,new Ge,new Ge,new Ge,new Ge,new Ge],Fe=new Ge,Ve=new Be,He=new Ge,We=new Ge,je=new Ge,qe=new Ge,Xe=new Ge,Ye=new Ge,Je=new Ge,Ze=new Ge,Ke=new Ge,Qe=new Ge;function $e(t,e,i,n,r){for(let s=0,o=t.length-3;s<=o;s+=3){Qe.fromArray(t,s);const o=r.x*Math.abs(Qe.x)+r.y*Math.abs(Qe.y)+r.z*Math.abs(Qe.z),a=e.dot(Qe),l=i.dot(Qe),h=n.dot(Qe);if(Math.max(-Math.max(a,l,h),Math.min(a,l,h))>o)return!1}return!0}const ti=new Be,ei=new Ge,ii=new Ge,ni=new Ge;class ri{constructor(t=new Ge,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):ti.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){ni.subVectors(t,this.center);const e=ni.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.add(ni.multiplyScalar(i/t)),this.radius+=i}return this}union(t){return!0===this.center.equals(t.center)?ii.set(0,0,1).multiplyScalar(t.radius):ii.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(ei.copy(t.center).add(ii)),this.expandByPoint(ei.copy(t.center).sub(ii)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const si=new Ge,oi=new Ge,ai=new Ge,li=new Ge,hi=new Ge,ci=new Ge,ui=new Ge;class di{constructor(t=new Ge,e=new Ge(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,si)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=si.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(si.copy(this.direction).multiplyScalar(e).add(this.origin),si.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){oi.copy(t).add(e).multiplyScalar(.5),ai.copy(e).sub(t).normalize(),li.copy(this.origin).sub(oi);const r=.5*t.distanceTo(e),s=-this.direction.dot(ai),o=li.dot(this.direction),a=-li.dot(ai),l=li.lengthSq(),h=Math.abs(1-s*s);let c,u,d,p;if(h>0)if(c=s*a-o,u=s*o-a,p=r*h,c>=0)if(u>=-p)if(u<=p){const t=1/h;c*=t,u*=t,d=c*(c+s*u+2*o)+u*(s*c+u+2*a)+l}else u=r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;else u=-r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;else u<=-p?(c=Math.max(0,-(-s*r+o)),u=c>0?-r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+l):u<=p?(c=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(c=Math.max(0,-(s*r+o)),u=c>0?r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+l);else u=s>0?-r:r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(c).add(this.origin),n&&n.copy(ai).multiplyScalar(u).add(oi),d}intersectSphere(t,e){si.subVectors(t.center,this.origin);const i=si.dot(this.direction),n=si.dot(si)-i*i,r=t.radius*t.radius;if(n>r)return null;const s=Math.sqrt(r-n),o=i-s,a=i+s;return o<0&&a<0?null:o<0?this.at(a,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,o,a;const l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),h>=0?(r=(t.min.y-u.y)*h,s=(t.max.y-u.y)*h):(r=(t.max.y-u.y)*h,s=(t.min.y-u.y)*h),i>s||r>n?null:((r>i||i!=i)&&(i=r),(s=0?(o=(t.min.z-u.z)*c,a=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,a=(t.min.z-u.z)*c),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,si)}intersectTriangle(t,e,i,n,r){hi.subVectors(e,t),ci.subVectors(i,t),ui.crossVectors(hi,ci);let s,o=this.direction.dot(ui);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}li.subVectors(this.origin,t);const a=s*this.direction.dot(ci.crossVectors(li,ci));if(a<0)return null;const l=s*this.direction.dot(hi.cross(li));if(l<0)return null;if(a+l>o)return null;const h=-s*li.dot(ui);return h<0?null:this.at(h/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class pi{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 pi).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/fi.setFromMatrixColumn(t,0).length(),r=1/fi.setFromMatrixColumn(t,1).length(),s=1/fi.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),l=Math.sin(n),h=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){const t=s*h,i=s*c,n=o*h,r=o*c;e[0]=a*h,e[4]=-a*c,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-o*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*h,i=a*c,n=l*h,r=l*c;e[0]=t+r*o,e[4]=n*o-i,e[8]=s*l,e[1]=s*c,e[5]=s*h,e[9]=-o,e[2]=i*o-n,e[6]=r+t*o,e[10]=s*a}else if("ZXY"===t.order){const t=a*h,i=a*c,n=l*h,r=l*c;e[0]=t-r*o,e[4]=-s*c,e[8]=n+i*o,e[1]=i+n*o,e[5]=s*h,e[9]=r-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*h,i=s*c,n=o*h,r=o*c;e[0]=a*h,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*c,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*h,e[4]=r-t*c,e[8]=n*c+i,e[1]=c,e[5]=s*h,e[9]=-o*h,e[2]=-l*h,e[6]=i*c+n,e[10]=t-r*c}else if("XZY"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*h,e[4]=-c,e[8]=l*h,e[1]=t*c+r,e[5]=s*h,e[9]=i*c-n,e[2]=n*c-i,e[6]=o*h,e[10]=r*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(gi,t,vi)}lookAt(t,e,i){const n=this.elements;return xi.subVectors(t,e),0===xi.lengthSq()&&(xi.z=1),xi.normalize(),yi.crossVectors(i,xi),0===yi.lengthSq()&&(1===Math.abs(i.z)?xi.x+=1e-4:xi.z+=1e-4,xi.normalize(),yi.crossVectors(i,xi)),yi.normalize(),_i.crossVectors(xi,yi),n[0]=yi.x,n[4]=_i.x,n[8]=xi.x,n[1]=yi.y,n[5]=_i.y,n[9]=xi.y,n[2]=yi.z,n[6]=_i.z,n[10]=xi.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[4],a=i[8],l=i[12],h=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],_=i[11],x=i[15],b=n[0],M=n[4],w=n[8],E=n[12],S=n[1],T=n[5],C=n[9],P=n[13],R=n[2],A=n[6],L=n[10],I=n[14],D=n[3],N=n[7],O=n[11],G=n[15];return r[0]=s*b+o*S+a*R+l*D,r[4]=s*M+o*T+a*A+l*N,r[8]=s*w+o*C+a*L+l*O,r[12]=s*E+o*P+a*I+l*G,r[1]=h*b+c*S+u*R+d*D,r[5]=h*M+c*T+u*A+d*N,r[9]=h*w+c*C+u*L+d*O,r[13]=h*E+c*P+u*I+d*G,r[2]=p*b+f*S+m*R+g*D,r[6]=p*M+f*T+m*A+g*N,r[10]=p*w+f*C+m*L+g*O,r[14]=p*E+f*P+m*I+g*G,r[3]=v*b+y*S+_*R+x*D,r[7]=v*M+y*T+_*A+x*N,r[11]=v*w+y*C+_*L+x*O,r[15]=v*E+y*P+_*I+x*G,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],o=t[5],a=t[9],l=t[13],h=t[2],c=t[6],u=t[10],d=t[14];return t[3]*(+r*a*c-n*l*c-r*o*u+i*l*u+n*o*d-i*a*d)+t[7]*(+e*a*d-e*l*u+r*s*u-n*s*d+n*l*h-r*a*h)+t[11]*(+e*l*c-e*o*d-r*s*c+i*s*d+r*o*h-i*l*h)+t[15]*(-n*o*h-e*a*c+e*o*u+n*s*c-i*s*u+i*a*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=c*m*l-f*u*l+f*a*d-o*m*d-c*a*g+o*u*g,y=p*u*l-h*m*l-p*a*d+s*m*d+h*a*g-s*u*g,_=h*f*l-p*c*l+p*o*d-s*f*d-h*o*g+s*c*g,x=p*c*a-h*f*a-p*o*u+s*f*u+h*o*m-s*c*m,b=e*v+i*y+n*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/b;return t[0]=v*M,t[1]=(f*u*r-c*m*r-f*n*d+i*m*d+c*n*g-i*u*g)*M,t[2]=(o*m*r-f*a*r+f*n*l-i*m*l-o*n*g+i*a*g)*M,t[3]=(c*a*r-o*u*r-c*n*l+i*u*l+o*n*d-i*a*d)*M,t[4]=y*M,t[5]=(h*m*r-p*u*r+p*n*d-e*m*d-h*n*g+e*u*g)*M,t[6]=(p*a*r-s*m*r-p*n*l+e*m*l+s*n*g-e*a*g)*M,t[7]=(s*u*r-h*a*r+h*n*l-e*u*l-s*n*d+e*a*d)*M,t[8]=_*M,t[9]=(p*c*r-h*f*r-p*i*d+e*f*d+h*i*g-e*c*g)*M,t[10]=(s*f*r-p*o*r+p*i*l-e*f*l-s*i*g+e*o*g)*M,t[11]=(h*o*r-s*c*r-h*i*l+e*c*l+s*i*d-e*o*d)*M,t[12]=x*M,t[13]=(h*f*n-p*c*n+p*i*u-e*f*u-h*i*m+e*c*m)*M,t[14]=(p*o*n-s*f*n-p*i*a+e*f*a+s*i*m-e*o*m)*M,t[15]=(s*c*n-h*o*n+h*i*a-e*c*a-s*i*u+e*o*u)*M,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,l=r*s,h=r*o;return this.set(l*s+i,l*o-n*a,l*a+n*o,0,l*o+n*a,h*o+i,h*a-n*s,0,l*a-n*o,h*a+n*s,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,s){return this.set(1,i,r,0,t,1,s,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,s=e._y,o=e._z,a=e._w,l=r+r,h=s+s,c=o+o,u=r*l,d=r*h,p=r*c,f=s*h,m=s*c,g=o*c,v=a*l,y=a*h,_=a*c,x=i.x,b=i.y,M=i.z;return n[0]=(1-(f+g))*x,n[1]=(d+_)*x,n[2]=(p-y)*x,n[3]=0,n[4]=(d-_)*b,n[5]=(1-(u+g))*b,n[6]=(m+v)*b,n[7]=0,n[8]=(p+y)*M,n[9]=(m-v)*M,n[10]=(1-(u+f))*M,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=fi.set(n[0],n[1],n[2]).length();const s=fi.set(n[4],n[5],n[6]).length(),o=fi.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],mi.copy(this);const a=1/r,l=1/s,h=1/o;return mi.elements[0]*=a,mi.elements[1]*=a,mi.elements[2]*=a,mi.elements[4]*=l,mi.elements[5]*=l,mi.elements[6]*=l,mi.elements[8]*=h,mi.elements[9]*=h,mi.elements[10]*=h,e.setFromRotationMatrix(mi),i.x=r,i.y=s,i.z=o,this}makePerspective(t,e,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(e-t),l=2*r/(i-n),h=(e+t)/(e-t),c=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,n,r,s){const o=this.elements,a=1/(e-t),l=1/(i-n),h=1/(s-r),c=(e+t)*a,u=(i+n)*l,d=(s+r)*h;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}pi.prototype.isMatrix4=!0;const fi=new Ge,mi=new pi,gi=new Ge(0,0,0),vi=new Ge(1,1,1),yi=new Ge,_i=new Ge,xi=new Ge,bi=new pi,Mi=new Oe;class wi{constructor(t=0,e=0,i=0,n=wi.DefaultOrder){this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,r=n[0],s=n[4],o=n[8],a=n[1],l=n[5],h=n[9],c=n[2],u=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(ue(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-ue(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-c,r),this._z=0);break;case"ZXY":this._x=Math.asin(ue(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-ue(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(ue(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-c,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-ue(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return bi.makeRotationFromQuaternion(t),this.setFromRotationMatrix(bi,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Mi.setFromEuler(this),this.setFromQuaternion(Mi,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new Ge(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}wi.prototype.isEuler=!0,wi.DefaultOrder="XYZ",wi.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Ei{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0){n.children=[];for(let e=0;e0){n.animations=[];for(let e=0;e0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),o.length>0&&(i.images=o),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h)}return i.object=n,i;function s(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){Bi.subVectors(n,e),zi.subVectors(i,e),Fi.subVectors(t,e);const s=Bi.dot(Bi),o=Bi.dot(zi),a=Bi.dot(Fi),l=zi.dot(zi),h=zi.dot(Fi),c=s*l-o*o;if(0===c)return r.set(-2,-1,-1);const u=1/c,d=(l*a-o*h)*u,p=(s*h-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,Vi),Vi.x>=0&&Vi.y>=0&&Vi.x+Vi.y<=1}static getUV(t,e,i,n,r,s,o,a){return this.getBarycoord(t,e,i,n,Vi),a.set(0,0),a.addScaledVector(r,Vi.x),a.addScaledVector(s,Vi.y),a.addScaledVector(o,Vi.z),a}static isFrontFacing(t,e,i,n){return Bi.subVectors(i,e),zi.subVectors(t,e),Bi.cross(zi).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Bi.subVectors(this.c,this.b),zi.subVectors(this.a,this.b),.5*Bi.cross(zi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Ji.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Ji.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return Ji.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return Ji.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Ji.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,n=this.b,r=this.c;let s,o;Hi.subVectors(n,i),Wi.subVectors(r,i),qi.subVectors(t,i);const a=Hi.dot(qi),l=Wi.dot(qi);if(a<=0&&l<=0)return e.copy(i);Xi.subVectors(t,n);const h=Hi.dot(Xi),c=Wi.dot(Xi);if(h>=0&&c<=h)return e.copy(n);const u=a*c-h*l;if(u<=0&&a>=0&&h<=0)return s=a/(a-h),e.copy(i).addScaledVector(Hi,s);Yi.subVectors(t,r);const d=Hi.dot(Yi),p=Wi.dot(Yi);if(p>=0&&d<=p)return e.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(i).addScaledVector(Wi,o);const m=h*p-d*c;if(m<=0&&c-h>=0&&d-p>=0)return ji.subVectors(r,n),o=(c-h)/(c-h+(d-p)),e.copy(n).addScaledVector(ji,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(i).addScaledVector(Hi,s).addScaledVector(Wi,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Zi=0;class Ki extends oe{constructor(){super(),Object.defineProperty(this,"id",{value:Zi++}),this.uuid=ce(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}Ki.prototype.isMaterial=!0;class Qi extends Ki{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Te(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.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Qi.prototype.isMeshBasicMaterial=!0;const $i=new Ge,tn=new ge;class en{constructor(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),gn.copy(i.boundingSphere),gn.applyMatrix4(r),!1===t.ray.intersectsSphere(gn))return;if(fn.copy(r).invert(),mn.copy(t.ray).applyMatrix4(fn),null!==i.boundingBox&&!1===mn.intersectsBox(i.boundingBox))return;let s;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative,h=i.attributes.uv,c=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=u.length;ii.far?null:{distance:h,point:An.clone(),object:t}}(t,e,i,n,vn,yn,_n,Rn);if(p){a&&(Tn.fromBufferAttribute(a,h),Cn.fromBufferAttribute(a,c),Pn.fromBufferAttribute(a,u),p.uv=Ji.getUV(Rn,vn,yn,_n,Tn,Cn,Pn,new ge)),l&&(Tn.fromBufferAttribute(l,h),Cn.fromBufferAttribute(l,c),Pn.fromBufferAttribute(l,u),p.uv2=Ji.getUV(Rn,vn,yn,_n,Tn,Cn,Pn,new ge));const t={a:h,b:c,c:u,normal:new Ge,materialIndex:0};Ji.getNormal(vn,yn,_n,t.normal),p.face=t}return p}Ln.prototype.isMesh=!0;class Dn extends pn{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const o=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const a=[],l=[],h=[],c=[];let u=0,d=0;function p(t,e,i,n,r,s,p,f,m,g,v){const y=s/m,_=p/g,x=s/2,b=p/2,M=f/2,w=m+1,E=g+1;let S=0,T=0;const C=new Ge;for(let s=0;s0?1:-1,h.push(C.x,C.y,C.z),c.push(a/m),c.push(1-s/g),S+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}kn.prototype.isShaderMaterial=!0;class Un extends Ui{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new pi,this.projectionMatrix=new pi,this.projectionMatrixInverse=new pi}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Un.prototype.isCamera=!0;class Bn extends Un{constructor(t=50,e=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*he*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*le*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*he*Math.atan(Math.tan(.5*le*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,n,r,s){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*le*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/o,n*=s.width/t,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}Bn.prototype.isPerspectiveCamera=!0;class zn extends Ui{constructor(t,e,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new Bn(90,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new Ge(1,0,0)),this.add(n);const r=new Bn(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Ge(-1,0,0)),this.add(r);const s=new Bn(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ge(0,1,0)),this.add(s);const o=new Bn(90,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Ge(0,-1,0)),this.add(o);const a=new Bn(90,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Ge(0,0,1)),this.add(a);const l=new Bn(90,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ge(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,s,o,a,l]=this.children,h=t.xr.enabled,c=t.getRenderTarget();t.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(c),t.xr.enabled=h,i.texture.needsPMREMUpdate=!0}}class Fn extends Ae{constructor(t,e,i,n,r,s,o,a,l,h){super(t=void 0!==t?t:[],e=void 0!==e?e:301,i,n,r,s,o,a,l,h),this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}Fn.prototype.isCubeTexture=!0;class Vn extends De{constructor(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),super(t,t,e),e=e||{},this.texture=new Fn(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:1006}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=1023,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={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 \n\t\t\t\t\t#include \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 \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"},n=new Dn(5,5,5),r=new kn({name:"CubemapFromEquirect",uniforms:Nn(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Ln(n,r),o=e.minFilter;1008===e.minFilter&&(e.minFilter=1006);return new zn(1,10,this).update(t,s),e.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}Vn.prototype.isWebGLCubeRenderTarget=!0;const Hn=new Ge,Wn=new Ge,jn=new ve;class qn{constructor(t=new Ge(1,0,0),e=0){this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=Hn.subVectors(i,e).cross(Wn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta(Hn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||jn.getNormalMatrix(t),n=this.coplanarPoint(Hn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}qn.prototype.isPlane=!0;const Xn=new ri,Yn=new Ge;class Jn{constructor(t=new qn,e=new qn,i=new qn,n=new qn,r=new qn,s=new qn){this.planes=[t,e,i,n,r,s]}set(t,e,i,n,r,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6],c=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,c-a,f-u,y-m).normalize(),e[1].setComponents(o+n,c+a,f+u,y+m).normalize(),e[2].setComponents(o+r,c+l,f+d,y+g).normalize(),e[3].setComponents(o-r,c-l,f-d,y-g).normalize(),e[4].setComponents(o-s,c-h,f-p,y-v).normalize(),e[5].setComponents(o+s,c+h,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Xn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Xn)}intersectsSprite(t){return Xn.center.set(0,0,0),Xn.radius=.7071067811865476,Xn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Xn)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)0?t.max.x:t.min.x,Yn.y=n.normal.y>0?t.max.y:t.min.y,Yn.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Yn)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Zn(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function Kn(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version 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}\nfloat 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}\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",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + 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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\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 )\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 )\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",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; }\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 color ) { return dot( color, vec3( 0.3333 ) ); }\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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\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}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\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}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.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\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\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\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\treturn texture2D( envMap, uv ).rgb;\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + 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 ), m0, cubeUV_maxMipLevel );\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_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 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, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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\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 )\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 )\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:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#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\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\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\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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 GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\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( ( ior - 1.0 ) / ( 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, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\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}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\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:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\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, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\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#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\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\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_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\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, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).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( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\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 OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( 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( 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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - 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_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, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#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 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\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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 shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\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 shadow;\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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#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 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 mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\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.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.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ 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.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\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\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, vUv );\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 toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( 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}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\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\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 framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\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 ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\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;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \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 \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 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 SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},tr={common:{diffuse:{value:new Te(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new ve},uv2Transform:{value:new ve},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Te(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Te(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ve}},sprite:{diffuse:{value:new Te(16777215)},opacity:{value:1},center:{value:new ge(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ve}}},er={basic:{uniforms:On([tr.common,tr.specularmap,tr.envmap,tr.aomap,tr.lightmap,tr.fog]),vertexShader:$n.meshbasic_vert,fragmentShader:$n.meshbasic_frag},lambert:{uniforms:On([tr.common,tr.specularmap,tr.envmap,tr.aomap,tr.lightmap,tr.emissivemap,tr.fog,tr.lights,{emissive:{value:new Te(0)}}]),vertexShader:$n.meshlambert_vert,fragmentShader:$n.meshlambert_frag},phong:{uniforms:On([tr.common,tr.specularmap,tr.envmap,tr.aomap,tr.lightmap,tr.emissivemap,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.fog,tr.lights,{emissive:{value:new Te(0)},specular:{value:new Te(1118481)},shininess:{value:30}}]),vertexShader:$n.meshphong_vert,fragmentShader:$n.meshphong_frag},standard:{uniforms:On([tr.common,tr.envmap,tr.aomap,tr.lightmap,tr.emissivemap,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.roughnessmap,tr.metalnessmap,tr.fog,tr.lights,{emissive:{value:new Te(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:$n.meshphysical_vert,fragmentShader:$n.meshphysical_frag},toon:{uniforms:On([tr.common,tr.aomap,tr.lightmap,tr.emissivemap,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.gradientmap,tr.fog,tr.lights,{emissive:{value:new Te(0)}}]),vertexShader:$n.meshtoon_vert,fragmentShader:$n.meshtoon_frag},matcap:{uniforms:On([tr.common,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.fog,{matcap:{value:null}}]),vertexShader:$n.meshmatcap_vert,fragmentShader:$n.meshmatcap_frag},points:{uniforms:On([tr.points,tr.fog]),vertexShader:$n.points_vert,fragmentShader:$n.points_frag},dashed:{uniforms:On([tr.common,tr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:$n.linedashed_vert,fragmentShader:$n.linedashed_frag},depth:{uniforms:On([tr.common,tr.displacementmap]),vertexShader:$n.depth_vert,fragmentShader:$n.depth_frag},normal:{uniforms:On([tr.common,tr.bumpmap,tr.normalmap,tr.displacementmap,{opacity:{value:1}}]),vertexShader:$n.meshnormal_vert,fragmentShader:$n.meshnormal_frag},sprite:{uniforms:On([tr.sprite,tr.fog]),vertexShader:$n.sprite_vert,fragmentShader:$n.sprite_frag},background:{uniforms:{uvTransform:{value:new ve},t2D:{value:null}},vertexShader:$n.background_vert,fragmentShader:$n.background_frag},cube:{uniforms:On([tr.envmap,{opacity:{value:1}}]),vertexShader:$n.cube_vert,fragmentShader:$n.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:$n.equirect_vert,fragmentShader:$n.equirect_frag},distanceRGBA:{uniforms:On([tr.common,tr.displacementmap,{referencePosition:{value:new Ge},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:$n.distanceRGBA_vert,fragmentShader:$n.distanceRGBA_frag},shadow:{uniforms:On([tr.lights,tr.fog,{color:{value:new Te(0)},opacity:{value:1}}]),vertexShader:$n.shadow_vert,fragmentShader:$n.shadow_frag}};function ir(t,e,i,n,r,s){const o=new Te(0);let a,l,h=!0===r?0:1,c=null,u=0,d=null;function p(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,s)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),h=e,p(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,p(o,h)},render:function(i,r){let s=!1,f=!0===r.isScene?r.background:null;f&&f.isTexture&&(f=e.get(f));const m=t.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(f=null),null===f?p(o,h):f&&f.isColor&&(p(f,1),s=!0),(t.autoClear||s)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||306===f.mapping)?(void 0===l&&(l=new Ln(new Dn(1,1,1),new kn({name:"BackgroundCubeMaterial",uniforms:Nn(er.cube.uniforms),vertexShader:er.cube.vertexShader,fragmentShader:er.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=f,l.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,c===f&&u===f.version&&d===t.toneMapping||(l.material.needsUpdate=!0,c=f,u=f.version,d=t.toneMapping),i.unshift(l,l.geometry,l.material,0,0,null)):f&&f.isTexture&&(void 0===a&&(a=new Ln(new Qn(2,2),new kn({name:"BackgroundMaterial",uniforms:Nn(er.background.uniforms),vertexShader:er.background.vertexShader,fragmentShader:er.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),a.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&u===f.version&&d===t.toneMapping||(a.material.needsUpdate=!0,c=f,u=f.version,d=t.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null))}}}function nr(t,e,i,n){const r=t.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},l=d(null);let h=l;function c(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function u(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function d(t){const e=[],i=[],n=[];for(let t=0;t=0){let s=l[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const e=s.normalized,o=s.itemSize,l=i.get(s);if(void 0===l)continue;const h=l.buffer,c=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,l=i.stride,d=s.offset;if(i&&i.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==i.precision?i.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),h=!0===i.logarithmicDepthBuffer,c=t.getParameter(34930),u=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),y=u>0,_=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:h,maxTextures:c,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:y&&_,maxSamples:s?t.getParameter(36183):0}}function or(t){const e=this;let i=null,n=0,r=!1,s=!1;const o=new qn,a=new ve,l={value:null,needsUpdate:!1};function h(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,i,n,r){const s=null!==t?t.length:0;let h=null;if(0!==s){if(h=l.value,!0!==r||null===h){const e=n+4*s,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===h||h.length0){const o=new Vn(s.height/2);return o.fromEquirectangularTexture(t,r),e.set(r,o),r.addEventListener("dispose",n),i(o.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}er.physical={uniforms:On([er.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ge(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Te(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Te(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Te(1,1,1)},specularColorMap:{value:null}}]),vertexShader:$n.meshphysical_vert,fragmentShader:$n.meshphysical_frag};class lr extends Un{constructor(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,s){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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,s=i+t,o=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}lr.prototype.isOrthographicCamera=!0;class hr extends kn{constructor(t){super(t),this.type="RawShaderMaterial"}}hr.prototype.isRawShaderMaterial=!0;const cr=Math.pow(2,8),ur=[.125,.215,.35,.446,.526,.582],dr=5+ur.length,pr=new lr,{_lodPlanes:fr,_sizeLods:mr,_sigmas:gr}=wr(),vr=new Te;let yr=null;const _r=(1+Math.sqrt(5))/2,xr=1/_r,br=[new Ge(1,1,1),new Ge(-1,1,1),new Ge(1,1,-1),new Ge(-1,1,-1),new Ge(0,_r,xr),new Ge(0,_r,-xr),new Ge(xr,0,_r),new Ge(-xr,0,_r),new Ge(_r,xr,0),new Ge(-_r,xr,0)];class Mr{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const e=new Float32Array(t),i=new Ge(0,1,0);return new hr({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Pr(),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 \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})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){yr=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=Cr(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=Tr(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t2?cr:0,cr,cr),a.setRenderTarget(n),d&&a.render(u,r),a.render(t,r)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=h,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const i=this._renderer,n=301===t.mapping||302===t.mapping;n?(null===this._cubemapShader&&(this._cubemapShader=Cr()),this._cubemapShader.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectShader&&(this._equirectShader=Tr());const r=n?this._cubemapShader:this._equirectShader,s=new Ln(fr[0],r),o=r.uniforms;o.envMap.value=t,n||o.texelSize.value.set(1/t.image.width,1/t.image.height),Sr(e,0,0,3*cr,2*cr),i.setRenderTarget(e),i.render(s,pr)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,i=Math.exp(-e*e/2);m.push(i),0===t?g+=i:t4?n-8+4:0),3*v,2*v),a.setRenderTarget(e),a.render(h,pr)}}function wr(){const t=[],e=[],i=[];let n=8;for(let r=0;r4?o=ur[r-8+4-1]:0===r&&(o=0),i.push(o);const a=1/(s-1),l=-a/2,h=1+a/2,c=[l,l,h,l,h,h,l,l,h,h,l,h],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,p*d*t),v.set(c,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const _=new pn;_.setAttribute("position",new en(g,p)),_.setAttribute("uv",new en(v,f)),_.setAttribute("faceIndex",new en(y,m)),t.push(_),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function Er(t){const e=new De(3*cr,3*cr,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Sr(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Tr(){const t=new ge(1,1);return new hr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:t}},vertexShader:Pr(),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 vec2 texelSize;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = texture2D ( envMap, uv ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Cr(){return new hr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Pr(),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 Pr(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\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 Rr(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,o=303===s||304===s,a=301===s||302===s;if(o||a){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let n=e.get(r);return null===i&&(i=new Mr(t)),n=o?i.fromEquirectangular(r,n):i.fromCubemap(r,n),e.set(r,n),n.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let i=0;i<6;i++)void 0!==t[i]&&e++;return 6===e}(s)){null===i&&(i=new Mr(t));const s=o?i.fromEquirectangular(r):i.fromCubemap(r);return e.set(r,s),r.addEventListener("dispose",n),s.texture}return null}}}return r},dispose:function(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function Ar(t){const e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Lr(t,e,i,n){const r={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",o),delete r[a.id];const l=s.get(a);l&&(e.remove(l),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],n=t.index,r=t.attributes.position;let o=0;if(null!==n){const t=n.array;o=n.version;for(let e=0,n=t.length;ee.maxTextureSize&&(u=Math.ceil(c/e.maxTextureSize),c=e.maxTextureSize);const d=new Float32Array(c*u*4*n),p=new Nr(d,c,u,n);p.format=1023,p.type=1015,p.needsUpdate=!0;const f=4*l;for(let e=0;e0)return t;const r=e*i;let s=jr[r];if(void 0===s&&(s=new Float32Array(r),jr[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function Kr(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i/gm;function to(t){return t.replace($s,eo)}function eo(t,e){const i=$n[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return to(i)}const io=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,no=/#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 ro(t){return t.replace(no,oo).replace(io,so)}function so(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),oo(t,e,i,n)}function oo(t,e,i,n){let r="";for(let t=parseInt(e);t0&&(m+="\n"),g=[d,p].filter(Zs).join("\n"),g.length>0&&(g+="\n")):(m=[ao(i),"#define SHADER_NAME "+i.shaderName,p,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Zs).join("\n"),g=[d,ao(i),"#define SHADER_NAME "+i.shaderName,p,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.envMap?"#define "+c:"",i.envMap?"#define "+u:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?$n.tonemapping_pars_fragment:"",0!==i.toneMapping?Js("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.transparent?"":"#define OPAQUE",$n.encodings_pars_fragment,Ys("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Zs).join("\n")),o=to(o),o=Ks(o,i),o=Qs(o,i),a=to(a),a=Ks(a,i),a=Qs(a,i),o=ro(o),a=ro(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(v="#version 300 es\n",m=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#define varying in","300 es"===i.glslVersion?"":"layout(location = 0) out highp vec4 pc_fragColor;","300 es"===i.glslVersion?"":"#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"+g);const y=v+g+a,_=js(r,35633,v+m+o),x=js(r,35632,y);if(r.attachShader(f,_),r.attachShader(f,x),void 0!==i.index0AttributeName?r.bindAttribLocation(f,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(f,0,"position"),r.linkProgram(f),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(f).trim(),e=r.getShaderInfoLog(_).trim(),i=r.getShaderInfoLog(x).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(f,35714)){n=!1;const e=Xs(r,_,"vertex"),i=Xs(r,x,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:m},fragmentShader:{log:i,prefix:g}})}let b,M;return r.deleteShader(_),r.deleteShader(x),this.getUniforms=function(){return void 0===b&&(b=new Ws(r,f)),b},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r0,A=s.clearcoat>0;return{isWebGL2:c,shaderID:M,shaderName:s.type,vertexShader:E,fragmentShader:S,defines:s.defines,customVertexShaderID:T,customFragmentShaderID:C,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:f,outputEncoding:null===P?t.outputEncoding:!0===P.isXRRenderTarget?P.texture.encoding:3e3,map:!!s.map,matcap:!!s.matcap,envMap:!!b,envMapMode:b&&b.mapping,envMapCubeUV:!!b&&(306===b.mapping||307===b.mapping),lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:1===s.normalMapType,tangentSpaceNormalMap:0===s.normalMapType,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&3001===s.map.encoding,clearcoat:A,clearcoatMap:A&&!!s.clearcoatMap,clearcoatRoughnessMap:A&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:A&&!!s.clearcoatNormalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,transparent:s.transparent,alphaMap:!!s.alphaMap,alphaTest:R,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!y.geometry&&!!y.geometry.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!y.geometry&&!!y.geometry.attributes.color&&4===y.geometry.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!_,useFog:s.fog,fogExp2:_&&_.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===y.isSkinnedMesh&&w>0,maxBones:w,useVertexTexture:d,morphTargets:!!y.geometry&&!!y.geometry.morphAttributes.position,morphNormals:!!y.geometry&&!!y.geometry.morphAttributes.normal,morphTargetsCount:y.geometry&&y.geometry.morphAttributes.position?y.geometry.morphAttributes.position.length:0,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,depthPacking:void 0!==s.depthPacking&&s.depthPacking,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.maxBones),t.push(e.morphTargetsCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection)}(i,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0);e.supportsVertexTextures&&a.enable(1);e.instancing&&a.enable(2);e.instancingColor&&a.enable(3);e.map&&a.enable(4);e.matcap&&a.enable(5);e.envMap&&a.enable(6);e.envMapCubeUV&&a.enable(7);e.lightMap&&a.enable(8);e.aoMap&&a.enable(9);e.emissiveMap&&a.enable(10);e.bumpMap&&a.enable(11);e.normalMap&&a.enable(12);e.objectSpaceNormalMap&&a.enable(13);e.tangentSpaceNormalMap&&a.enable(14);e.clearcoat&&a.enable(15);e.clearcoatMap&&a.enable(16);e.clearcoatRoughnessMap&&a.enable(17);e.clearcoatNormalMap&&a.enable(18);e.displacementMap&&a.enable(19);e.specularMap&&a.enable(20);e.roughnessMap&&a.enable(21);e.metalnessMap&&a.enable(22);e.gradientMap&&a.enable(23);e.alphaMap&&a.enable(24);e.alphaTest&&a.enable(25);e.vertexColors&&a.enable(26);e.vertexAlphas&&a.enable(27);e.vertexUvs&&a.enable(28);e.vertexTangents&&a.enable(29);e.uvsVertexOnly&&a.enable(30);e.fog&&a.enable(31);t.push(a.mask),a.disableAll(),e.useFog&&a.enable(0);e.flatShading&&a.enable(1);e.logarithmicDepthBuffer&&a.enable(2);e.skinning&&a.enable(3);e.useVertexTexture&&a.enable(4);e.morphTargets&&a.enable(5);e.morphNormals&&a.enable(6);e.premultipliedAlpha&&a.enable(7);e.shadowMapEnabled&&a.enable(8);e.physicallyCorrectLights&&a.enable(9);e.doubleSided&&a.enable(10);e.flipSided&&a.enable(11);e.depthPacking&&a.enable(12);e.dithering&&a.enable(13);e.specularIntensityMap&&a.enable(14);e.specularColorMap&&a.enable(15);e.transmission&&a.enable(16);e.transmissionMap&&a.enable(17);e.thicknessMap&&a.enable(18);e.sheen&&a.enable(19);e.sheenColorMap&&a.enable(20);e.sheenRoughnessMap&&a.enable(21);e.decodeVideoTexture&&a.enable(22);e.transparent&&a.enable(23);t.push(a.mask)}(i,e),i.push(t.outputEncoding)),i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=g[t.type];let i;if(e){const t=er[e];i=Gn.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=h.length;t0?n.push(c):!0===o.transparent?r.push(c):i.push(c)},unshift:function(t,e,o,a,l,h){const c=s(t,e,o,a,l,h);o.transmission>0?n.unshift(c):!0===o.transparent?r.unshift(c):i.unshift(c)},finish:function(){for(let i=e,n=t.length;i1&&i.sort(t||mo),n.length>1&&n.sort(e||go),r.length>1&&r.sort(e||go)}}}function yo(){let t=new WeakMap;return{get:function(e,i){let n;return!1===t.has(e)?(n=new vo,t.set(e,[n])):i>=t.get(e).length?(n=new vo,t.get(e).push(n)):n=t.get(e)[i],n},dispose:function(){t=new WeakMap}}}function _o(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new Ge,color:new Te};break;case"SpotLight":i={position:new Ge,direction:new Ge,color:new Te,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ge,color:new Te,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ge,skyColor:new Te,groundColor:new Te};break;case"RectAreaLight":i={color:new Te,position:new Ge,halfWidth:new Ge,halfHeight:new Ge}}return t[e.id]=i,i}}}let xo=0;function bo(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Mo(t,e){const i=new _o,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new Ge);const s=new Ge,o=new pi,a=new pi;return{setup:function(s,o){let a=0,l=0,h=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let c=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0;s.sort(bo);const y=!0!==o?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=tr.LTC_FLOAT_1,r.rectAreaLTC2=tr.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=tr.LTC_HALF_1,r.rectAreaLTC2=tr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=h;const _=r.hash;_.directionalLength===c&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===p&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===v||(r.directional.length=c,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,_.directionalLength=c,_.pointLength=u,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=v,r.version=xo++)},setupView:function(t,e){let i=0,n=0,l=0,h=0,c=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=i.get(n).length?(s=new wo(t,e),i.get(n).push(s)):s=i.get(n)[r],s},dispose:function(){i=new WeakMap}}}class So extends Ki{constructor(t){super(),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.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}So.prototype.isMeshDepthMaterial=!0;class To extends Ki{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new Ge,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}To.prototype.isMeshDistanceMaterial=!0;function Co(t,e,i){let n=new Jn;const r=new ge,s=new ge,o=new Ie,a=new So({depthPacking:3201}),l=new To,h={},c=i.maxTextureSize,u={0:1,1:0,2:2},d=new kn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ge},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 \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}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const f=new pn;f.setAttribute("position",new en(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Ln(f,d),g=this;function v(i,n){const r=e.update(m);d.defines.VSM_SAMPLES!==i.blurSamples&&(d.defines.VSM_SAMPLES=i.blurSamples,p.defines.VSM_SAMPLES=i.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,d,m,null),p.uniforms.shadow_pass.value=i.mapPass.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,p,m,null)}function y(e,i,n,r,s,o,c){let d=null;const p=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(d=void 0!==p?p:!0===r.isPointLight?l:a,t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const t=d.uuid,e=n.uuid;let i=h[t];void 0===i&&(i={},h[t]=i);let r=i[e];void 0===r&&(r=d.clone(),i[e]=r),d=r}return d.visible=n.visible,d.wireframe=n.wireframe,d.side=3===c?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],d.alphaMap=n.alphaMap,d.alphaTest=n.alphaTest,d.clipShadows=n.clipShadows,d.clippingPlanes=n.clippingPlanes,d.clipIntersection=n.clipIntersection,d.displacementMap=n.displacementMap,d.displacementScale=n.displacementScale,d.displacementBias=n.displacementBias,d.wireframeLinewidth=n.wireframeLinewidth,d.linewidth=n.linewidth,!0===r.isPointLight&&!0===d.isMeshDistanceMaterial&&(d.referencePosition.setFromMatrixPosition(r.matrixWorld),d.nearDistance=s,d.farDistance=o),d}function _(i,r,s,o,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===a)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,h=e.length;lc||r.y>c)&&(r.x>c&&(s.x=Math.floor(c/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>c&&(s.y=Math.floor(c/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const t={minFilter:1006,magFilter:1006,format:1023};u.map=new De(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.mapPass=new De(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:1003,magFilter:1003,format:1023};u.map=new De(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const f=u.getViewportCount();for(let t=0;t=1):-1!==R.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),C=P>=2);let A=null,L={};const I=t.getParameter(3088),D=t.getParameter(2978),N=(new Ie).fromArray(I),O=(new Ie).fromArray(D);function G(e,i,n){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;en||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?me:Math.floor,s=n(r*t.width),o=n(r*t.height);void 0===f&&(f=g(s,o));const a=i?g(s,o):f;a.width=s,a.height=o;return a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return fe(t.width)&&fe(t.height)}function _(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function x(e){t.generateMipmap(e)}function b(i,n,r,s,o=!1){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let l=n;return 6403===n&&(5126===r&&(l=33326),5131===r&&(l=33325),5121===r&&(l=33321)),33319===n&&(5126===r&&(l=33328),5131===r&&(l=33327),5121===r&&(l=33323)),6408===n&&(5126===r&&(l=34836),5131===r&&(l=34842),5121===r&&(l=3001===s&&!1===o?35907:32856),32819===r&&(l=32854),32820===r&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||e.get("EXT_color_buffer_float"),l}function M(t,e,i){return!0===_(t,i)||t.isFramebufferTexture&&1003!==t.minFilter&&1006!==t.minFilter?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function w(t){return 1003===t||1004===t||1005===t?9728:9729}function E(e){const i=e.target;i.removeEventListener("dispose",E),function(e){const i=n.get(e);if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture),n.remove(e)}(i),i.isVideoTexture&&p.delete(i),o.memory.textures--}function S(e){const i=e.target;i.removeEventListener("dispose",S),function(e){const i=e.texture,r=n.get(e),s=n.get(i);if(!e)return;void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void D(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function P(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?function(e,n,r){if(6!==n.image.length)return;I(e,n),i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const o=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),l=n.image[0]&&n.image[0].isDataTexture,c=[];for(let t=0;t<6;t++)c[t]=o||l?l?n.image[t].image:n.image[t]:v(n.image[t],!1,!0,h),c[t]=U(n,c[t]);const u=c[0],d=y(u)||a,p=s.convert(n.format,n.encoding),f=s.convert(n.type),m=b(n.internalFormat,p,f,n.encoding),g=a&&!0!==n.isVideoTexture,w=void 0===e.__version;let E,S=M(n,u,d);if(L(34067,n,d),o){g&&w&&i.texStorage2D(34067,S,m,u.width,u.height);for(let t=0;t<6;t++){E=c[t].mipmaps;for(let e=0;e0&&S++,i.texStorage2D(34067,S,m,c[0].width,c[0].height));for(let t=0;t<6;t++)if(l){g?i.texSubImage2D(34069+t,0,0,0,c[t].width,c[t].height,p,f,c[t].data):i.texImage2D(34069+t,0,m,c[t].width,c[t].height,0,p,f,c[t].data);for(let e=0;e1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function I(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",E),e.__webglTexture=t.createTexture(),o.memory.textures++)}function D(e,n,r){let o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),I(e,n),i.activeTexture(33984+r),i.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const l=function(t){return!a&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(n)&&!1===y(n.image);let h=v(n.image,l,!1,c);h=U(n,h);const u=y(h)||a,d=s.convert(n.format,n.encoding);let p,f=s.convert(n.type),m=b(n.internalFormat,d,f,n.encoding,n.isVideoTexture);L(o,n,u);const g=n.mipmaps,w=a&&!0!==n.isVideoTexture,E=void 0===e.__version,S=M(n,h,u);if(n.isDepthTexture)m=6402,a?m=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===m&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,f=s.convert(n.type)),1027===n.format&&6402===m&&(m=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,f=s.convert(n.type))),w&&E?i.texStorage2D(3553,1,m,h.width,h.height):i.texImage2D(3553,0,m,h.width,h.height,0,d,f,null);else if(n.isDataTexture)if(g.length>0&&u){w&&E&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t0&&u){w&&E&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),T+=1,t},this.resetTextureUnits=function(){T=0},this.setTexture2D=C,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?D(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?D(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=P,this.rebindTextures=function(t,e,i){const r=n.get(t);void 0!==e&&N(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==i&&G(t)},this.setupRenderTarget=function(e){const l=e.texture,h=n.get(e),c=n.get(l);e.addEventListener("dispose",S),!0!==e.isWebGLMultipleRenderTargets&&(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=l.version,o.memory.textures++);const u=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=l.isDataTexture3D||l.isDataTexture2DArray,f=y(e)||a;if(u){h.__webglFramebuffer=[];for(let e=0;e<6;e++)h.__webglFramebuffer[e]=t.createFramebuffer()}else if(h.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){const i=e.texture;for(let e=0,r=i.length;ea+h?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=a-h&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}class Oo extends Ae{constructor(t,e,i,n,r,s,o,a,l,h){if(1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),super(null,n,r,s,o,a,h,i,l),this.image={width:t,height:e},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==a?a:1003,this.flipY=!1,this.generateMipmaps=!1}}Oo.prototype.isDepthTexture=!0;class Go extends oe{constructor(t,e){super();const i=this;let n=null,r=1,s=null,o="local-floor";const a=t.extensions.has("WEBGL_multisampled_render_to_texture");let l=null,h=null,c=null,u=null,d=!1,p=null;const f=e.getContextAttributes();let m=null,g=null;const v=[],y=new Map,_=new Bn;_.layers.enable(1),_.viewport=new Ie;const x=new Bn;x.layers.enable(2),x.viewport=new Ie;const b=[_,x],M=new Lo;M.layers.enable(1),M.layers.enable(2);let w=null,E=null;function S(t){const e=y.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function T(){y.forEach((function(t,e){t.disconnect(e)})),y.clear(),w=null,E=null,t.setRenderTarget(m),u=null,c=null,h=null,n=null,g=null,I.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function C(t){const e=n.inputSources;for(let t=0;t0&&(e.alphaTest.value=i.alphaTest);const n=t.get(i).envMap;let r,s;n&&(e.envMap.value=n,e.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap?r=i.emissiveMap:i.clearcoatMap?r=i.clearcoatMap:i.clearcoatNormalMap?r=i.clearcoatNormalMap:i.clearcoatRoughnessMap?r=i.clearcoatRoughnessMap:i.specularIntensityMap?r=i.specularIntensityMap:i.specularColorMap?r=i.specularColorMap:i.transmissionMap?r=i.transmissionMap:i.thicknessMap?r=i.thicknessMap:i.sheenColorMap?r=i.sheenColorMap:i.sheenRoughnessMap&&(r=i.sheenRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),i.aoMap?s=i.aoMap:i.lightMap&&(s=i.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uv2Transform.value.copy(s.matrix))}function i(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,s,o){n.isMeshBasicMaterial?e(t,n):n.isMeshLambertMaterial?(e(t,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,n)):n.isMeshToonMaterial?(e(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshPhongMaterial?(e(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshStandardMaterial?(e(t,n),n.isMeshPhysicalMaterial?function(t,e,n){i(t,e),t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap);e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}(t,n,o):i(t,n)):n.isMeshMatcapMaterial?(e(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDepthMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDistanceMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?(e(t,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,s):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Uo(t={}){const e=void 0!==t.canvas?t.canvas:function(){const t=_e("canvas");return t.style.display="block",t}(),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,s=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,h=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let u=null,d=null;const p=[],f=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const m=this;let g=!1,v=0,y=0,_=null,x=-1,b=null;const M=new Ie,w=new Ie;let E=null,S=e.width,T=e.height,C=1,P=null,R=null;const A=new Ie(0,0,S,T),L=new Ie(0,0,S,T);let I=!1;const D=new Jn;let N=!1,O=!1,G=null;const k=new pi,U=new Ge,B={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function z(){return null===_?C:1}let F,V,H,W,j,q,X,Y,J,Z,K,Q,$,tt,et,it,nt,rt,st,ot,at,lt,ht,ct=i;function ut(t,i){for(let n=0;n0&&function(t,e,i){if(null===G){const t=!0===o&&!0===V.isWebGL2;G=new(t?Ne:De)(1024,1024,{generateMipmaps:!0,type:null!==lt.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001,useRenderToTexture:F.has("WEBGL_multisampled_render_to_texture")})}const n=m.getRenderTarget();m.setRenderTarget(G),m.clear();const r=m.toneMapping;m.toneMapping=0,Mt(t,e,i),m.toneMapping=r,q.updateMultisampleRenderTarget(G),q.updateRenderTargetMipmap(G),m.setRenderTarget(n)}(r,e,i),n&&H.viewport(M.copy(n)),r.length>0&&Mt(r,e,i),s.length>0&&Mt(s,e,i),a.length>0&&Mt(a,e,i)}function Mt(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?f[f.length-1]:null,p.pop(),u=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return _},this.setRenderTargetTextures=function(t,e,i){j.get(t.texture).__webglTexture=e,j.get(t.depthTexture).__webglTexture=i;const n=j.get(t);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||t.useRenderToTexture&&(console.warn("render-to-texture extension was disabled because an external texture was provided"),t.useRenderToTexture=!1,t.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(t,e){const i=j.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){_=t,v=e,y=i;let n=!0;if(t){const e=j.get(t);void 0!==e.__useDefaultFramebuffer?(H.bindFramebuffer(36160,null),n=!1):void 0===e.__webglFramebuffer?q.setupRenderTarget(t):e.__hasExternalTextures&&q.rebindTextures(t,j.get(t.texture).__webglTexture,j.get(t.depthTexture).__webglTexture)}let r=null,s=!1,o=!1;if(t){const i=t.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(o=!0);const n=j.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=n[e],s=!0):r=t.useRenderbuffer?j.get(t).__webglMultisampledFramebuffer:n,M.copy(t.viewport),w.copy(t.scissor),E=t.scissorTest}else M.copy(A).multiplyScalar(C).floor(),w.copy(L).multiplyScalar(C).floor(),E=I;if(H.bindFramebuffer(36160,r)&&V.drawBuffers&&n&&H.drawBuffers(t,r),H.viewport(M),H.scissor(w),H.setScissorTest(E),s){const n=j.get(t.texture);ct.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(o){const n=j.get(t.texture),r=e||0;ct.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}x=-1},this.readRenderTargetPixels=function(t,e,i,n,r,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=j.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){H.bindFramebuffer(36160,a);try{const o=t.texture,a=o.format,l=o.type;if(1023!==a&<.convert(a)!==ct.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=1016===l&&(F.has("EXT_color_buffer_half_float")||V.isWebGL2&&F.has("EXT_color_buffer_float"));if(!(1009===l||lt.convert(l)===ct.getParameter(35738)||1015===l&&(V.isWebGL2||F.has("OES_texture_float")||F.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ct.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&ct.readPixels(e,i,n,r,lt.convert(a),lt.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const t=null!==_?j.get(_).__webglFramebuffer:null;H.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){if(!0!==e.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n);q.setTexture2D(e,0),ct.copyTexSubImage2D(3553,i,0,0,t.x,t.y,r,s),H.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,o=lt.convert(i.format),a=lt.convert(i.type);q.setTexture2D(i,0),ct.pixelStorei(37440,i.flipY),ct.pixelStorei(37441,i.premultiplyAlpha),ct.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?ct.texSubImage2D(3553,n,t.x,t.y,r,s,o,a,e.image.data):e.isCompressedTexture?ct.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):ct.texSubImage2D(3553,n,t.x,t.y,o,a,e.image),0===n&&i.generateMipmaps&&ct.generateMipmap(3553),H.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(m.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=lt.convert(n.format),h=lt.convert(n.type);let c;if(n.isDataTexture3D)q.setTexture3D(n,0),c=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");q.setTexture2DArray(n,0),c=35866}ct.pixelStorei(37440,n.flipY),ct.pixelStorei(37441,n.premultiplyAlpha),ct.pixelStorei(3317,n.unpackAlignment);const u=ct.getParameter(3314),d=ct.getParameter(32878),p=ct.getParameter(3316),f=ct.getParameter(3315),g=ct.getParameter(32877),v=i.isCompressedTexture?i.mipmaps[0]:i.image;ct.pixelStorei(3314,v.width),ct.pixelStorei(32878,v.height),ct.pixelStorei(3316,t.min.x),ct.pixelStorei(3315,t.min.y),ct.pixelStorei(32877,t.min.z),i.isDataTexture||i.isDataTexture3D?ct.texSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,h,v.data):i.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ct.compressedTexSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,v.data)):ct.texSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,h,v),ct.pixelStorei(3314,u),ct.pixelStorei(32878,d),ct.pixelStorei(3316,p),ct.pixelStorei(3315,f),ct.pixelStorei(32877,g),0===r&&n.generateMipmaps&&ct.generateMipmap(c),H.unbindTexture()},this.initTexture=function(t){q.setTexture2D(t,0),H.unbindTexture()},this.resetState=function(){v=0,y=0,_=null,H.reset(),ht.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Uo.prototype.isWebGLRenderer=!0;(class extends Uo{}).prototype.isWebGL1Renderer=!0;class Bo{constructor(t,e=25e-5){this.name="",this.color=new Te(t),this.density=e}clone(){return new Bo(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Bo.prototype.isFogExp2=!0;class zo{constructor(t,e=1,i=1e3){this.name="",this.color=new Te(t),this.near=e,this.far=i}clone(){return new zo(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}zo.prototype.isFog=!0;class Fo extends Ui{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}Fo.prototype.isScene=!0;class Vo{constructor(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ce()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;nt.far||e.push({distance:a,point:Xo.clone(),uv:Ji.getUV(Xo,$o,ta,ea,ia,na,ra,new ge),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function oa(t,e,i,n,r,s){Zo.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(Ko.x=s*Zo.x-r*Zo.y,Ko.y=r*Zo.x+s*Zo.y):Ko.copy(Zo),t.copy(e),t.x+=Ko.x,t.y+=Ko.y,t.applyMatrix4(Qo)}sa.prototype.isSprite=!0;const aa=new Ge,la=new Ie,ha=new Ie,ca=new Ge,ua=new pi;class da extends Ln{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new pi,this.bindMatrixInverse=new pi}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Ie,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;ia)continue;u.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(u);dt.far||e.push({distance:d,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,s.start),n=Math.min(r.count,s.start+s.count)-1;ia)continue;u.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(u);nt.far||e.push({distance:n,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Ca.prototype.isLine=!0;const Pa=new Ge,Ra=new Ge;class Aa extends Ca{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Ua(t,e,i,n,r,s,o){const a=Na.distanceSqToPoint(t);if(ar.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:o})}}ka.prototype.isPoints=!0;(class extends Ae{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.minFilter=void 0!==s?s:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){h.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}).prototype.isVideoTexture=!0;(class extends Ae{constructor(t,e,i){super({width:t,height:e}),this.format=i,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}).prototype.isFramebufferTexture=!0;class Ba extends Ae{constructor(t,e,i,n,r,s,o,a,l,h,c,u){super(null,s,o,a,l,h,n,r,c,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}Ba.prototype.isCompressedTexture=!0;(class extends Ae{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.needsUpdate=!0}}).prototype.isCanvasTexture=!0;new Ge,new Ge,new Ge,new Ji;class za{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let n=0;const r=i.length;let s;s=e||t*i[r-1];let o,a=0,l=r-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=i[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,i[n]===s)return n/(r-1);const h=i[n];return(n+(s-h)/(i[n+1]-h))/(r-1)}getTangent(t,e){let i=t-1e-4,n=t+1e-4;i<0&&(i=0),n>1&&(n=1);const r=this.getPoint(i),s=this.getPoint(n),o=e||(r.isVector2?new ge:new Ge);return o.copy(s).sub(r).normalize(),o}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new Ge,n=[],r=[],s=[],o=new Ge,a=new pi;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new Ge)}r[0]=new Ge,s[0]=new Ge;let l=Number.MAX_VALUE;const h=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);h<=l&&(l=h,i.set(1,0,0)),c<=l&&(l=c,i.set(0,1,0)),u<=l&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(ue(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(ue(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(o.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Fa extends za{constructor(t=0,e=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const i=e||new ge,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)n;)r-=n;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===h&&l===r-1&&(l=r-2,h=1),this.closed||l>0?o=n[(l-1)%r]:(Wa.subVectors(n[0],n[1]).add(n[0]),o=Wa);const c=n[l%r],u=n[(l+1)%r];if(this.closed||l+2n.length-2?n.length-1:s+1],c=n[s>n.length-3?n.length-1:s+2];return i.set(Ja(o,a.x,l.x,h.x,c.x),Ja(o,a.y,l.y,h.y,c.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){const t=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-t/o;return s.getPointAt(a,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class al extends ol{constructor(t){super(t),this.uuid=ce(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,n=this.holes.length;i80*i){a=h=t[0],l=c=t[1];for(let e=i;eh&&(h=u),d>c&&(c=d);p=Math.max(h-a,c-l),p=0!==p?1/p:0}return ul(s,o,i,a,l,p),o};function hl(t,e,i,n,r){let s,o;if(r===function(t,e,i,n){let r=0;for(let s=e,o=i-n;s0)for(s=e;s=e;s-=n)o=Al(s,t[s],t[s+1],o);return o&&El(o,o.next)&&(Ll(o),o=o.next),o}function cl(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!El(n,n.next)&&0!==wl(n.prev,n,n.next))n=n.next;else{if(Ll(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function ul(t,e,i,n,r,s,o){if(!t)return;!o&&s&&function(t,e,i,n){let r=t;do{null===r.z&&(r.z=_l(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,s,o,a,l,h=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(o>1)}(r)}(t,n,r,s);let a,l,h=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?pl(t,n,r,s):dl(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),Ll(t),t=l.next,h=l.next;else if((t=l)===h){o?1===o?ul(t=fl(cl(t),e,i),e,i,n,r,s,2):2===o&&ml(t,e,i,n,r,s):ul(cl(t),e,i,n,r,s,1);break}}function dl(t){const e=t.prev,i=t,n=t.next;if(wl(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(bl(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&wl(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function pl(t,e,i,n){const r=t.prev,s=t,o=t.next;if(wl(r,s,o)>=0)return!1;const a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=_l(a,l,e,i,n),d=_l(h,c,e,i,n);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&bl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&wl(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&bl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&wl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&bl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&wl(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&bl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&wl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function fl(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!El(r,s)&&Sl(r,n,n.next,s)&&Pl(r,s)&&Pl(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),Ll(n),Ll(n.next),n=t=s),n=n.next}while(n!==t);return cl(n)}function ml(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&Ml(o,t)){let a=Rl(o,t);return o=cl(o,o.next),a=cl(a,a.next),ul(o,e,i,n,r,s),void ul(a,e,i,n,r,s)}t=t.next}o=o.next}while(o!==t)}function gl(t,e){return t.x-e.x}function vl(t,e){if(e=function(t,e){let i=e;const n=t.x,r=t.y;let s,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o){if(o=t,t===n){if(r===i.y)return i;if(r===i.next.y)return i.next}s=i.x=i.x&&i.x>=l&&n!==i.x&&bl(rs.x||i.x===s.x&&yl(s,i)))&&(s=i,u=c)),i=i.next}while(i!==a);return s}(t,e)){const i=Rl(e,t);cl(e,e.next),cl(i,i.next)}}function yl(t,e){return wl(t.prev,t,e.prev)<0&&wl(e.next,t,t.next)<0}function _l(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function xl(t){let e=t,i=t;do{(e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function Ml(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Sl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Pl(t,e)&&Pl(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(wl(t.prev,t,e.prev)||wl(t,e.prev,e))||El(t,e)&&wl(t.prev,t,t.next)>0&&wl(e.prev,e,e.next)>0)}function wl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function El(t,e){return t.x===e.x&&t.y===e.y}function Sl(t,e,i,n){const r=Cl(wl(t,e,i)),s=Cl(wl(t,e,n)),o=Cl(wl(i,n,t)),a=Cl(wl(i,n,e));return r!==s&&o!==a||(!(0!==r||!Tl(t,i,e))||(!(0!==s||!Tl(t,n,e))||(!(0!==o||!Tl(i,t,n))||!(0!==a||!Tl(i,e,n)))))}function Tl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Cl(t){return t>0?1:t<0?-1:0}function Pl(t,e){return wl(t.prev,t,t.next)<0?wl(t,e,t.next)>=0&&wl(t,t.prev,e)>=0:wl(t,e,t.prev)<0||wl(t,t.next,e)<0}function Rl(t,e){const i=new Il(t.i,t.x,t.y),n=new Il(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Al(t,e,i,n){const r=new Il(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Ll(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Il(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Dl{static area(t){const e=t.length;let i=0;for(let n=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function Ol(t,e){for(let i=0;iNumber.EPSILON){const u=Math.sqrt(c),d=Math.sqrt(l*l+h*h),p=e.x-a/u,f=e.y+o/u,m=((i.x-h/d-p)*h-(i.y+l/d-f)*l)/(o*h-a*l);n=p+o*m-t.x,r=f+a*m-t.y;const g=n*n+r*r;if(g<=2)return new ge(n,r);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(h)&&(t=!0),t?(n=-a,r=o,s=Math.sqrt(c)):(n=o,r=a,s=Math.sqrt(c/2))}return new ge(n/s,r/s)}const L=[];for(let t=0,e=T.length,i=e-1,n=t+1;t=0;t--){const e=t/p,i=c*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=T.length;t=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}Fl.prototype.isMeshPhysicalMaterial=!0;class Vl extends Ki{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Te(16777215),this.specular=new Te(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Te(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this}}Vl.prototype.isMeshPhongMaterial=!0;class Hl extends Ki{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Te(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Te(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Hl.prototype.isMeshToonMaterial=!0;class Wl extends Ki{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}Wl.prototype.isMeshNormalMaterial=!0;class jl extends Ki{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Te(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Te(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}jl.prototype.isMeshLambertMaterial=!0;class ql extends Ki{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Te(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this}}ql.prototype.isMeshMatcapMaterial=!0;class Xl extends ba{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}Xl.prototype.isLineDashedMaterial=!0;const Yl={arraySlice:function(t,e,i){return Yl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let s=0,o=0;o!==n;++s){const n=i[s]*e;for(let i=0;i!==e;++i)r[o++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(e.push(s.time),i.push.apply(i,o)),s=t[r++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(e.push(s.time),o.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(e.push(s.time),i.push(o)),s=t[r++]}while(void 0!==s)},subclip:function(t,e,i,n,r=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t=n)){l.push(e.times[t]);for(let i=0;is.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=n.times[u]){const t=u*l+a,e=t+l-a;d=Yl.arraySlice(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=l-a;t.evaluate(s),d=Yl.arraySlice(t.resultBuffer,e,i)}if("quaternion"===r){(new Oe).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let t=0;t=r)break t;{const o=e[1];t=r)break e}s=i,i=0}}for(;i>>1;te;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Yl.arraySlice(i,r,s),this.values=Yl.arraySlice(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&Yl.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=Yl.arraySlice(this.times),e=Yl.arraySlice(this.values),i=this.getValueSize(),n=2302===this.getInterpolation(),r=t.length-1;let s=1;for(let o=1;o0){t[s]=t[r];for(let t=r*i,n=s*i,o=0;o!==i;++o)e[n+o]=e[t+o];++s}return s!==t.length?(this.times=Yl.arraySlice(t,0,s),this.values=Yl.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=Yl.arraySlice(this.times,0),e=Yl.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}$l.prototype.TimeBufferType=Float32Array,$l.prototype.ValueBufferType=Float32Array,$l.prototype.DefaultInterpolation=2301;class th extends $l{}th.prototype.ValueTypeName="bool",th.prototype.ValueBufferType=Array,th.prototype.DefaultInterpolation=2300,th.prototype.InterpolantFactoryMethodLinear=void 0,th.prototype.InterpolantFactoryMethodSmooth=void 0;class eh extends $l{}eh.prototype.ValueTypeName="color";class ih extends $l{}ih.prototype.ValueTypeName="number";class nh extends Jl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-e)/(n-e);let l=t*o;for(let t=l+o;l!==t;l+=4)Oe.slerpFlat(r,0,s,l-o,s,l,a);return r}}class rh extends $l{InterpolantFactoryMethodLinear(t){return new nh(this.times,this.values,this.getValueSize(),t)}}rh.prototype.ValueTypeName="quaternion",rh.prototype.DefaultInterpolation=2301,rh.prototype.InterpolantFactoryMethodSmooth=void 0;class sh extends $l{}sh.prototype.ValueTypeName="string",sh.prototype.ValueBufferType=Array,sh.prototype.DefaultInterpolation=2300,sh.prototype.InterpolantFactoryMethodLinear=void 0,sh.prototype.InterpolantFactoryMethodSmooth=void 0;class oh extends $l{}oh.prototype.ValueTypeName="vector";class ah{constructor(t,e=-1,i,n=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=ce(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(lh(i[t]).scale(n));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push($l.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],o=[];Yl.flattenJSON(i,s,o,n),0!==s.length&&r.push(new t(e,s,o))}},n=[],r=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==ph[t])return void ph[t].push({onLoad:e,onProgress:i,onError:n});ph[t]=[],ph[t].push({onLoad:e,onProgress:i,onError:n});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body.getReader)return e;const i=ph[t],n=e.body.getReader(),r=e.headers.get("Content-Length"),s=r?parseInt(r):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){n.read().then(({done:n,value:r})=>{if(n)t.close();else{a+=r.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=i.length;t{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,o));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then(t=>n.decode(t))}}}).then(e=>{hh.add(t,e);const i=ph[t];delete ph[t];for(let t=0,n=i.length;t{const i=ph[t];if(void 0===i)throw this.manager.itemError(t),e;delete ph[t];for(let t=0,n=i.length;t{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class mh extends dh{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=hh.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const o=_e("img");function a(){h(),hh.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){h(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class gh extends dh{constructor(t){super(t)}load(t,e,i,n){const r=new Fn,s=new mh(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(i){s.load(t[i],(function(t){r.images[i]=t,o++,6===o&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(let e=0;e0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){o.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){Oe.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){const s=this._workIndex*r;Oe.multiplyQuaternionsFlat(t,s,t,e,t,i),Oe.slerpFlat(t,e,t,e,t,s,n)}_lerp(t,e,i,n,r){const s=1-n;for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]*s+t[i+o]*n}}_lerpAdditive(t,e,i,n,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[i+s]*n}}}const Wh=new RegExp("[\\[\\]\\.:\\/]","g"),jh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",qh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Xh=/(WCOD+)?/.source.replace("WCOD",jh),Yh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Jh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Zh=new RegExp("^"+qh+Xh+Yh+Jh+"$"),Kh=["material","materials","bones"];class Qh{constructor(t,e,i){this.path=e,this.parsedPath=i||Qh.parseTrackName(e),this.node=Qh.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new Qh.Composite(t,e,i):new Qh(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Wh,"")}static parseTrackName(t){const e=Zh.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==Kh.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n=r){const s=r++,h=t[s];e[h.uuid]=l,t[l]=h,e[a]=s,t[s]=o;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[l];e[l]=n,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,h=this.nCachedObjects_,c=new Array(l);n=r.length,i[t]=n,s.push(t),o.push(e),r.push(c);for(let i=h,n=a.length;i!==n;++i){const n=a[i];c[i]=new Qh(n,t,e)}return c}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=i,s[i]=a,s.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}}).prototype.isAnimationObjectGroup=!0;class $h{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:2400,endingEnd:2400};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,a[1]=r+i,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case 2500:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=2202===i;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}(class extends oe{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,s=t._propertyBindings,o=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let h=l[a];void 0===h&&(h={},l[a]=h);for(let t=0;t!==r;++t){const r=n[t],l=r.name;let c=h[l];if(void 0!==c)++c.referenceCount,s[t]=c;else{if(c=s[t],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,a,l));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;c=new Hh(Qh.create(i,l,n),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,a,l),s[t]=c}o[t].resultBuffer=c.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==i;++o){e[o]._update(n,t,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return ec.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}ic.prototype.isBox2=!0;const nc=new Ge,rc=new Ge;const sc=new Ge,oc=new pi,ac=new pi;const lc=new Float32Array(1);new Int32Array(lc.buffer);za.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(za.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},ol.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},class extends Aa{constructor(t=10,e=10,i=4473924,n=8947848){i=new Te(i),n=new Te(n);const r=e/2,s=t/e,o=t/2,a=[],l=[];for(let t=0,h=0,c=-o;t<=e;t++,c+=s){a.push(-o,0,c,o,0,c),a.push(c,0,-o,c,0,o);const e=t===r?i:n;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}const h=new pn;h.setAttribute("position",new sn(a,3)),h.setAttribute("color",new sn(l,3));super(h,new ba({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Aa{constructor(t){const e=function t(e){const i=[];e&&e.isBone&&i.push(e);for(let n=0;ns.geoBBox.right||i.south>s.geoBBox.top||i.east=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},v.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(m.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},v.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},v.prototype.number=function(t){if(!g.test(t)){if(m.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},v.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},v.prototype.keyword=function(t){if(f.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!m.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},v.prototype.neutral=function(t){if(p.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(g.test(t))return this.word=t,void(this.state=3);if(!m.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},v.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(r),r};function M(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?M[t]=u(arguments[1]):M[t]=b(arguments[1]):M[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?M.apply(e,t):M(t)}));if("string"==typeof t){if(t in M)return M[t]}else"EPSG"in t?M["EPSG:"+t.EPSG]=t:"ESRI"in t?M["ESRI:"+t.ESRI]=t:"IAU2000"in t?M["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(M);var w=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],E=["3857","900913","3785","102113"];function S(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in M}(t))return M[t];if(function(t){return w.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=b(t);if(function(t){var e=c(t,"authority");if(e){var i=c(e,"epsg");return i&&E.indexOf(i)>-1}}(e))return M["EPSG:3857"];var i=function(t){var e=c(t,"extension");if(e)return c(e,"proj4")}(e);return i?u(i):e}return function(t){return"+"===t[0]}(t)?u(t):void 0}var T=function(t,e){var i,n;if(t=t||{},!e)return t;for(n in e)void 0!==(i=e[n])&&(t[n]=i);return t},C=function(t,e,i){var n=t*e;return i/Math.sqrt(1-n*n)},P=function(t){return t<0?-1:1},R=function(t){return Math.abs(t)<=o?t:t-P(t)*s},A=function(t,i,n){var r=t*n,s=.5*t;return r=Math.pow((1-r)/(1+r),s),Math.tan(.5*(e-i))/r},L=function(t,i){for(var n,r,s=.5*t,o=e-2*Math.atan(i),a=0;a<=15;a++)if(n=t*Math.sin(o),o+=r=e-2*Math.atan(i*Math.pow((1-n)/(1+n),s))-o,Math.abs(r)<=1e-10)return o;return-9999};function I(t){return t}var D=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var i,s,o=t.x,a=t.y;if(a*n>90&&a*n<-90&&o*n>180&&o*n<-180)return null;if(Math.abs(Math.abs(a)-e)<=1e-10)return null;if(this.sphere)i=this.x0+this.a*this.k0*R(o-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(r+.5*a));else{var l=Math.sin(a),h=A(this.e,a,l);i=this.x0+this.a*this.k0*R(o-this.long0),s=this.y0-this.a*this.k0*Math.log(h)}return t.x=i,t.y=s,t},inverse:function(t){var i,n,r=t.x-this.x0,s=t.y-this.y0;if(this.sphere)n=e-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var o=Math.exp(-s/(this.a*this.k0));if(-9999===(n=L(this.e,o)))return null}return i=R(this.long0+r/(this.a*this.k0)),t.x=i,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:I,inverse:I,names:["longlat","identity"]}],N={},O=[];function G(t,e){var i=O.length;return t.names?(O[i]=t,t.names.forEach((function(t){N[t.toLowerCase()]=i})),this):(console.log(e),!0)}var k={start:function(){D.forEach(G)},add:G,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==N[e]&&O[N[e]]?O[N[e]]:void 0}},U={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},B=U.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};U.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var z={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},F={};function V(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:F[t]||null,isNull:!1}}function H(t){return t/3600*Math.PI/180}function W(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function j(t){return t.map((function(t){return[H(t.longitudeShift),H(t.latitudeShift)]}))}function q(t,e,i){return{name:W(t,e+8,e+16).trim(),parent:W(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function X(t,e,i,n){for(var r=e+176,s=[],o=0;o3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=2,l.datum_params[3]*=t,l.datum_params[4]*=t,l.datum_params[5]*=t,l.datum_params[6]=l.datum_params[6]/1e6+1))),a&&(l.datum_type=3,l.grids=a),l.a=n,l.b=r,l.es=s,l.ep2=o,l}(n.datumCode,n.datum_params,f.a,f.b,m.es,m.ep2,g);T(this,n),T(this,r),this.a=f.a,this.b=f.b,this.rf=f.rf,this.sphere=f.sphere,this.es=m.es,this.e=m.e,this.ep2=m.ep2,this.datum=v,this.init(),i(null,this)}else i(e)}else i(e)}function J(t,i,n){var r,s,o,a,l=t.x,h=t.y,c=t.z?t.z:0;if(h<-e&&h>-1.001*e)h=-e;else if(h>e&&h<1.001*e)h=e;else{if(h<-e)return{x:-1/0,y:-1/0,z:t.z};if(h>e)return{x:1/0,y:1/0,z:t.z}}return l>Math.PI&&(l-=2*Math.PI),s=Math.sin(h),a=Math.cos(h),o=s*s,{x:((r=n/Math.sqrt(1-i*o))+c)*a*Math.cos(l),y:(r+c)*a*Math.sin(l),z:(r*(1-i)+c)*s}}function Z(t,e,i,n){var r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_=t.x,x=t.y,b=t.z?t.z:0;if(r=Math.sqrt(_*_+x*x),s=Math.sqrt(_*_+x*x+b*b),r/i<1e-12){if(v=0,s/i<1e-12)return y=-n,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(x,_);o=b/s,u=(a=r/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),d=o*l,g=0;do{g++,h=e*(c=i/Math.sqrt(1-e*d*d))/(c+(y=r*u+b*d-c*(1-e*d*d))),m=(f=o*(l=1/Math.sqrt(1-h*(2-h)*a*a)))*u-(p=a*(1-h)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(f/Math.abs(p)),z:y}}function K(t){return 1===t||2===t}Y.projections=k,Y.projections.start();var Q=function(t,e,i){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return i;if(5===t.datum_type||5===e.datum_type)return i;var n=t.a,r=t.es;if(3===t.datum_type){if(0!==$(t,!1,i))return;n=6378137,r=.0066943799901413165}var s=e.a,o=e.b,a=e.es;return 3===e.datum_type&&(s=6378137,o=6356752.314,a=.0066943799901413165),r!==a||n!==s||K(t.datum_type)||K(e.datum_type)?(i=J(i,r,n),K(t.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+a*t.z)+n,y:h*(l*t.x+t.y-o*t.z)+r,z:h*(-a*t.x+o*t.y+t.z)+s}}}(i,t.datum_type,t.datum_params)),K(e.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6],c=(t.x-n)/h,u=(t.y-r)/h,d=(t.z-s)/h;return{x:c+l*u-a*d,y:-l*c+u+o*d,z:a*c-o*u+d}}}(i,e.datum_type,e.datum_params)),i=Z(i,a,s,o),3!==e.datum_type||0===$(e,!0,i)?i:void 0):i};function $(t,e,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},s={x:Number.NaN,y:Number.NaN},o=[],a=0;ar.y||u>r.x||f1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=R(s.x+i.ll[0]),n.y=s.y+i.ll[1]}else isNaN(s.x)||(n.x=t.x+s.x,n.y=t.y+s.y);return n}function et(t,e){var i,n={x:t.x/e.del[0],y:t.y/e.del[1]},r=Math.floor(n.x),s=Math.floor(n.y),o=n.x-1*r,a=n.y-1*s,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;i=s*e.lim[0]+r;var h=e.cvs[i][0],c=e.cvs[i][1];i++;var u=e.cvs[i][0],d=e.cvs[i][1];i+=e.lim[0];var p=e.cvs[i][0],f=e.cvs[i][1];i--;var m=e.cvs[i][0],g=e.cvs[i][1],v=o*a,y=o*(1-a),_=(1-o)*(1-a),x=(1-o)*a;return l.x=_*h+y*u+x*m+v*p,l.y=_*c+y*d+x*g+v*f,l}var it=function(t,e,i){var n,r,s,o=i.x,a=i.y,l=i.z||0,h={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==i.z)switch(0===s?(n=o,r=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(n=a,r=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(n=l,r="z"),t.axis[s]){case"e":h[r]=n;break;case"w":h[r]=-n;break;case"n":h[r]=n;break;case"s":h[r]=-n;break;case"u":void 0!==i[r]&&(h.z=n);break;case"d":void 0!==i[r]&&(h.z=-n);break;default:return null}return h},nt=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function rt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function st(t,e,r,s){var o;if(Array.isArray(r)&&(r=nt(r)),function(t){rt(t.x),rt(t.y)}(r),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(r=st(t,o=new Y("WGS84"),r,s),t=o),s&&"enu"!==t.axis&&(r=it(t,!1,r)),"longlat"===t.projName)r={x:r.x*i,y:r.y*i,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=Q(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*n,y:r.y*n,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),s&&"enu"!==e.axis?it(e,!0,r):r}var ot=Y("WGS84");function at(t,e,i,n){var r,s,o;return Array.isArray(i)?(r=st(t,e,i,n)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(i.splice(3)):[r.x,r.y,i[2]].concat(i.splice(3)):[r.x,r.y].concat(i.splice(2)):[r.x,r.y]):(s=st(t,e,i,n),2===(o=Object.keys(i)).length||o.forEach((function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;s[n]=i[n]})),s)}function lt(t){return t instanceof Y?t:t.oProj?t.oProj:Y(t)}function ht(t,e,i){t=lt(t);var n,r=!1;return void 0===e?(e=t,t=ot,r=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=ot,r=!0),e=lt(e),i?at(t,e,i):(n={forward:function(i,n){return at(t,e,i,n)},inverse:function(i,n){return at(e,t,i,n)}},r&&(n.oProj=e),n)}var ct=65,ut=73,dt=79,pt={forward:ft,inverse:function(t){var e=yt(xt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:mt};function ft(t,e){return e=e||5,function(t,e){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g="00000"+t.easting,v="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,u=t.northing,d=t.zoneNumber,p=_t(d),f=Math.floor(c/1e5),m=Math.floor(u/1e5)%20,i=f,n=m,s="AJSAJS".charCodeAt(r=p-1),o="AFAFAF".charCodeAt(r),h=!1,(a=s+i-1)>90&&(a=a-90+ct-1,h=!0),(a===ut||sut||(a>ut||sdt||(a>dt||s90&&(a=a-90+ct-1),(l=o+n)>86?(l=l-86+ct-1,h=!0):h=!1,(l===ut||out||(l>ut||odt||(l>dt||o86&&(l=l-86+ct-1),String.fromCharCode(a)+String.fromCharCode(l))+g.substr(g.length-5,e)+v.substr(v.length-5,e)}(function(t){var e,i,n,r,s,o,a,l=t.lat,h=t.lon,c=6378137,u=gt(l),d=gt(h);a=Math.floor((h+180)/6)+1,180===h&&(a=60),l>=56&&l<64&&h>=3&&h<12&&(a=32),l>=72&&l<84&&(h>=0&&h<9?a=31:h>=9&&h<21?a=33:h>=21&&h<33?a=35:h>=33&&h<42&&(a=37)),o=gt(6*(a-1)-180+3),e=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),n=.006739496752268451*Math.cos(u)*Math.cos(u),r=Math.cos(u)*(d-o),s=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p,f,m=.9996*e*(r+(1-i+n)*r*r*r/6+(5-18*i+i*i+72*n-.39089081163157013)*r*r*r*r*r/120)+5e5,g=.9996*(s+e*Math.tan(u)*(r*r/2+(5-i+9*n+4*n*n)*r*r*r*r/24+(61-58*i+i*i+600*n-2.2240339282485886)*r*r*r*r*r*r/720));return l<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(m),zoneNumber:a,zoneLetter:(p=l,f="Z",84>=p&&p>=72?f="X":72>p&&p>=64?f="W":64>p&&p>=56?f="V":56>p&&p>=48?f="U":48>p&&p>=40?f="T":40>p&&p>=32?f="S":32>p&&p>=24?f="R":24>p&&p>=16?f="Q":16>p&&p>=8?f="P":8>p&&p>=0?f="N":0>p&&p>=-8?f="M":-8>p&&p>=-16?f="L":-16>p&&p>=-24?f="K":-24>p&&p>=-32?f="J":-32>p&&p>=-40?f="H":-40>p&&p>=-48?f="G":-48>p&&p>=-56?f="F":-56>p&&p>=-64?f="E":-64>p&&p>=-72?f="D":-72>p&&p>=-80&&(f="C"),f)}}({lat:t[1],lon:t[0]}),e)}function mt(t){var e=yt(xt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function gt(t){return t*(Math.PI/180)}function vt(t){return t/Math.PI*180}function yt(t){var e=t.northing,i=t.easting,n=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var s,o,a,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,g=e;n<"N"&&(g-=1e7),c=6*(r-1)-180+3,d=(u=g/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),s=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),a=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*s);var v=d-s*Math.tan(d)/l*(h*h/2-(5+3*o+10*a-4*a*a-.06065547077041606)*h*h*h*h/24+(61+90*o+298*a+45*o*o-1.6983531815716497-3*a*a)*h*h*h*h*h*h/720);v=vt(v);var y,_=(h-(1+2*o+a)*h*h*h/6+(5-2*a+28*o-3*a*a+.05391597401814761+24*o*o)*h*h*h*h*h/120)/Math.cos(d);if(_=c+vt(_),t.accuracy){var x=yt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:x.lat,right:x.lon,bottom:v,left:_}}else y={lat:v,lon:_};return y}function _t(t){var e=t%6;return 0===e&&(e=6),e}function xt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,n=null,r="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;r+=e,s++}var o=parseInt(r,10);if(0===s||s+3>i)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;n=t.substring(s,s+=2);for(var l=_t(o),h=function(t,e){for(var i="AJSAJS".charCodeAt(e-1),n=1e5,r=!1;i!==t.charCodeAt(0);){if(++i===ut&&i++,i===dt&&i++,i>90){if(r)throw"Bad character: "+t;i=ct,r=!0}n+=1e5}return n}(n.charAt(0),l),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i="AFAFAF".charCodeAt(e-1),n=0,r=!1;i!==t.charCodeAt(0);){if(++i===ut&&i++,i===dt&&i++,i>86){if(r)throw"Bad character: "+t;i=ct,r=!0}n+=1e5}return n}(n.charAt(1),l);c0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),v=parseFloat(f)*d),{easting:g+h,northing:v+c,zoneLetter:a,zoneNumber:o,accuracy:d}}function bt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Mt(t,e,i){if(!(this instanceof Mt))return new Mt(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Mt.fromMGRS=function(t){return new Mt(mt(t))},Mt.prototype.toMGRS=function(t){return ft([this.x,this.y],t)};var wt=.01068115234375,Et=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*wt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*wt)));var i=t*t;return e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,e[3]=i*(.3645833333333333-.005696614583333333*t),e[4]=i*t*.3076171875,e},St=function(t,e,i,n){return i*=e,e*=e,n[0]*t-i*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))},Tt=function(t,e,i){for(var n=1/(1-e),r=t,s=20;s;--s){var o=Math.sin(r),a=1-e*o*o;if(r-=a=(St(r,o,Math.cos(r),i)-t)*(a*Math.sqrt(a))*n,Math.abs(a)<1e-10)return r}return r},Ct={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Et(this.es),this.ml0=St(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,i,n,r=t.x,s=t.y,o=R(r-this.long0),a=Math.sin(s),l=Math.cos(s);if(this.es){var h=l*o,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>1e-10?Math.tan(s):0,f=Math.pow(p,2),m=Math.pow(f,2);e=1-this.es*Math.pow(a,2),h/=Math.sqrt(e);var g=St(s,a,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+m+14*u-58*f*u+c/42*(61+179*m-m*f-479*f)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+a*o*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+m-58*f+270*u-330*f*u+c/56*(1385+543*m-m*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,n=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(n))>=1){if(v-1>1e-10)return 93;n=0}else n=Math.acos(n);s<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=i,t.y=n,t},inverse:function(t){var i,n,r,s,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(i=this.ml0+a/this.k0,n=Tt(i,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,u=this.ep2*Math.pow(h,2),d=Math.pow(u,2),p=Math.pow(c,2),f=Math.pow(p,2);i=1-this.es*Math.pow(l,2);var m=o*Math.sqrt(i)/this.k0,g=Math.pow(m,2);r=n-(i*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*u*p+u-4*d-g/30*(61+90*p-252*u*p+45*f+46*u-g/56*(1385+3633*p+4095*f+1574*f*p)))),s=R(this.long0+m*(1-g/6*(1+2*p+u-g/20*(5+28*p+24*f+8*u*p+6*u-g/42*(61+662*p+1320*f+720*f*p))))/h)}else r=e*P(a),s=0;else{var v=Math.exp(o/this.k0),y=.5*(v-1/v),_=this.lat0+a/this.k0,x=Math.cos(_);i=Math.sqrt((1-Math.pow(x,2))/(1+Math.pow(y,2))),r=Math.asin(i),a<0&&(r=-r),s=0===y&&0===x?0:R(Math.atan2(y,x)+this.long0)}return t.x=s,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Pt=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Rt=function(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),n=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(n,2))},At=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}(e*(1+e/(Rt(1,e)+1))),t<0?-e:e},Lt=function(t,e){for(var i,n=2*Math.cos(2*e),r=t.length-1,s=t[r],o=0;--r>=0;)i=n*s-o+t[r],o=s,s=i;return e+i*Math.sin(2*e)},It=function(t,e,i){for(var n,r,s=Math.sin(e),o=Math.cos(e),a=Pt(i),l=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(i),h=2*o*l,c=-2*s*a,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)n=f,r=p,d=h*(f=d)-n-c*(p=m)+t[u],m=c*f-r+h*p;return[(h=s*l)*d-(c=o*a)*m,h*m+c*d]},Dt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ct.init.apply(this),this.forward=Ct.forward,this.inverse=Ct.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),i*=e,this.cgb[1]=i*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i*=e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),i*=e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(e*(-24832/14175)-2.4)),i*=e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i*=e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),i*=e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i*=e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i*=e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i*=e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var n=Lt(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var i,n=2*Math.cos(e),r=t.length-1,s=t[r],o=0;--r>=0;)i=n*s-o+t[r],o=s,s=i;return Math.sin(e)*i}(this.gtu,2*n))},forward:function(t){var e=R(t.x-this.long0),i=t.y;i=Lt(this.cbg,i);var n=Math.sin(i),r=Math.cos(i),s=Math.sin(e),o=Math.cos(e);i=Math.atan2(n,o*r),e=Math.atan2(s*r,Rt(n,r*o)),e=At(Math.tan(e));var a,l,h=It(this.gtu,2*i,2*e);return i+=h[0],e+=h[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,i,n=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(r=(r-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var s=It(this.utg,2*r,2*n);r+=s[0],n+=s[1],n=Math.atan(Pt(n));var o=Math.sin(r),a=Math.cos(r),l=Math.sin(n),h=Math.cos(n);r=Math.atan2(o*h,Rt(l,h*a)),n=Math.atan2(l,h*a),e=R(n+this.long0),i=Lt(this.cgb,r)}else e=1/0,i=1/0;return t.x=e,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Nt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(R(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*i,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Dt.init.apply(this),this.forward=Dt.forward,this.inverse=Dt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},Ot=function(t,e){return Math.pow((1-t)/(1+t),e)},Gt={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+r)/(Math.pow(Math.tan(.5*this.lat0+r),this.C)*Ot(this.e*t,this.ratexp))},forward:function(t){var i=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+r),this.C)*Ot(this.e*Math.sin(n),this.ratexp))-e,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,n=t.y,s=Math.pow(Math.tan(.5*n+r)/this.K,1/this.C),o=20;o>0&&(n=2*Math.atan(s*Ot(this.e*Math.sin(t.y),-.5*this.e))-e,!(Math.abs(n-t.y)<1e-14));--o)t.y=n;return o?(t.x=i,t.y=n,t):null},names:["gauss"]},kt={init:function(){Gt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,i,n,r;return t.x=R(t.x-this.long0),Gt.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),n=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*n),t.x=r*i*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*i*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,i,n,r,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),i=Math.cos(o),r=Math.asin(i*this.sinc0+t.y*e*this.cosc0/s),n=Math.atan2(t.x*e,s*this.cosc0*i-t.y*this.sinc0*e)}else r=this.phic0,n=0;return t.x=n,t.y=r,Gt.inverse.apply(this,[t]),t.x=R(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Ut={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+P(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/A(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=C(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-e,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,n,r,s,o,a,l=t.x,h=t.y,c=Math.sin(h),u=Math.cos(h),d=R(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=1e-10&&Math.abs(h+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(d)),t.x=this.a*i*u*Math.sin(d)+this.x0,t.y=this.a*i*(this.coslat0*c-this.sinlat0*u*Math.cos(d))+this.y0,t):(n=2*Math.atan(this.ssfn_(h,c,this.e))-e,s=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(o=A(this.e,h*this.con,this.con*c),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(l-this.long0),t.y=this.y0-this.con*a*Math.cos(l-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(i=2*this.a*this.k0/(1+s*Math.cos(d)),t.y=i*r):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*s*Math.cos(d))),t.y=i*(this.cosX0*r-this.sinX0*s*Math.cos(d))+this.y0),t.x=i*s*Math.sin(d)+this.x0,t))},inverse:function(t){var i,n,r,s,o;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var l=2*Math.atan(a/(2*this.a*this.k0));return i=this.long0,n=this.lat0,a<=1e-10?(t.x=i,t.y=n,t):(n=Math.asin(Math.cos(l)*this.sinlat0+t.y*Math.sin(l)*this.coslat0/a),i=Math.abs(this.coslat0)<1e-10?this.lat0>0?R(this.long0+Math.atan2(t.x,-1*t.y)):R(this.long0+Math.atan2(t.x,t.y)):R(this.long0+Math.atan2(t.x*Math.sin(l),a*this.coslat0*Math.cos(l)-t.y*this.sinlat0*Math.sin(l))),t.x=i,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return n=this.lat0,i=this.long0,t.x=i,t.y=n,t;t.x*=this.con,t.y*=this.con,r=a*this.cons/(2*this.a*this.k0),n=this.con*L(this.e,r),i=this.con*R(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,a<=1e-10?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+t.y*Math.sin(s)*this.cosX0/a),i=R(this.long0+Math.atan2(t.x*Math.sin(s),a*this.cosX0*Math.cos(s)-t.y*this.sinX0*Math.sin(s)))),n=-1*L(this.e,Math.tan(.5*(e+o)));return t.x=i,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,i,n){return i*=n,Math.tan(.5*(e+t))*Math.pow((1-i)/(1+i),.5*n)}},Bt={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,n=1/this.rf,r=2*n-Math.pow(n,2),s=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+i)+this.K,r=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,i=t.y-this.y0,n=e/this.R,r=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(r))),a=this.lambda0+o/this.alpha,l=0,h=s,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=h,t},names:["somerc"]},zt={init:function(){var t,n,o,a,l,h,c,u,d,p,f,m,g,v=0,y=0,_=0,x=0,b=0,M=0,w=0;this.no_off=(g="object"==typeof(m=this).PROJECTION?Object.keys(m.PROJECTION)[0]:m.PROJECTION,"no_uoff"in m||"no_off"in m||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var E=!1;"alpha"in this&&(E=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),E&&(w=this.alpha),S&&(v=this.rectified_grid_angle*i),E||S)y=this.longc;else if(_=this.long1,b=this.lat1,x=this.long2,M=this.lat2,Math.abs(b-M)<=1e-7||(t=Math.abs(b))<=1e-7||Math.abs(t-e)<=1e-7||Math.abs(Math.abs(this.lat0)-e)<=1e-7||Math.abs(Math.abs(M)-e)<=1e-7)throw new Error;var T=1-this.es;n=Math.sqrt(T),Math.abs(this.lat0)>1e-10?(u=Math.sin(this.lat0),o=Math.cos(this.lat0),t=1-this.es*u*u,this.B=o*o,this.B=Math.sqrt(1+this.es*this.B*this.B/T),this.A=this.B*this.k0*n/t,(l=(a=this.B*n/(o*Math.sqrt(t)))*a-1)<=0?l=0:(l=Math.sqrt(l),this.lat0<0&&(l=-l)),this.E=l+=a,this.E*=Math.pow(A(this.e,this.lat0,u),this.B)):(this.B=1/n,this.A=this.k0,this.E=a=l=1),E||S?(E?(f=Math.asin(Math.sin(w)/a),S||(v=w)):(f=v,w=Math.asin(a*Math.sin(f))),this.lam0=y-Math.asin(.5*(l-1/l)*Math.tan(f))/this.B):(h=Math.pow(A(this.e,b,Math.sin(b)),this.B),c=Math.pow(A(this.e,M,Math.sin(M)),this.B),l=this.E/h,d=(c-h)/(c+h),p=((p=this.E*this.E)-c*h)/(p+c*h),(t=_-x)<-Math.pi?x-=s:t>Math.pi&&(x+=s),this.lam0=R(.5*(_+x)-Math.atan(p*Math.tan(.5*this.B*(_-x))/d)/this.B),f=Math.atan(2*Math.sin(this.B*R(_-this.lam0))/(l-1/l)),v=w=Math.asin(a*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(w))),this.lat0<0&&(this.u_0=-this.u_0)),l=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(r-l)),this.v_pole_s=this.ArB*Math.log(Math.tan(r+l))},forward:function(t){var i,n,r,s,o,a,l,h,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-e)>1e-10){if(i=.5*((o=this.E/Math.pow(A(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/o)),n=.5*(o+a),s=Math.sin(this.B*t.x),r=(i*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;h=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*t.x),l=Math.abs(a)<1e-7?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+s*this.singam,a)}else h=t.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(c.x=l,c.y=h):(l-=this.u_0,c.x=h*this.cosrot+l*this.sinrot,c.y=l*this.cosrot-h*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var i,n,r,s,o,a,l,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,i=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=.5*((r=Math.exp(-this.BrA*n))-1/r),o=.5*(r+1/r),l=((a=Math.sin(this.BrA*i))*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(l)-1)<1e-10)h.x=0,h.y=l<0?-e:e;else{if(h.y=this.E/Math.sqrt((1+l)/(1-l)),h.y=L(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(s*this.cosgam-a*this.singam,Math.cos(this.BrA*i))}return h.x+=this.lam0,h},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Ft={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),n=C(this.e,e,i),r=A(this.e,this.lat1,e),s=Math.sin(this.lat2),o=Math.cos(this.lat2),a=C(this.e,s,o),l=A(this.e,this.lat2,s),h=A(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(n/a)/Math.log(r/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=P(n)*(e-2e-10));var r,s,o=Math.abs(Math.abs(n)-e);if(o>1e-10)r=A(this.e,n,Math.sin(n)),s=this.a*this.f0*Math.pow(r,this.ns);else{if((o=n*this.ns)<=0)return null;s=0}var a=this.ns*R(i-this.long0);return t.x=this.k0*(s*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,t},inverse:function(t){var i,n,r,s,o,a=(t.x-this.x0)/this.k0,l=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(a*a+l*l),n=1):(i=-Math.sqrt(a*a+l*l),n=-1);var h=0;if(0!==i&&(h=Math.atan2(n*a,n*l)),0!==i||this.ns>0){if(n=1/this.ns,r=Math.pow(i/(this.a*this.f0),n),-9999===(s=L(this.e,r)))return null}else s=-e;return o=R(h/this.ns+this.long0),t.x=o,t.y=s,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"]},Vt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y,c=R(l-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),n=-c*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),s=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(r)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,i,n,r,s,o,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),i=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(e)),t.x=this.long0-i/this.alfa,o=e,a=0;var h=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(a=1),o=t.y,h+=1}while(0===a&&h<15);return h>=15?null:t},names:["Krovak","krovak"]},Ht=function(t,e,i,n,r){return t*r-e*Math.sin(2*r)+i*Math.sin(4*r)-n*Math.sin(6*r)},Wt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},jt=function(t){return.375*t*(1+.25*t*(1+.46875*t))},qt=function(t){return.05859375*t*t*(1+.75*t)},Xt=function(t){return t*t*t*(35/3072)},Yt=function(t,e,i){var n=e*i;return t/Math.sqrt(1-n*n)},Jt=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e},$t={init:function(){var t,i=Math.abs(this.lat0);if(Math.abs(i-e)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Qt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,i=[];return i[0]=.3333333333333333*t,e=t*t,i[0]+=.17222222222222222*e,i[1]=.06388888888888888*e,e*=t,i[0]+=.10257936507936508*e,i[1]+=.0664021164021164*e,i[2]=.016415012942191543*e,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Qt(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,n,s,o,a,l,h,c,u,d,p=t.x,f=t.y;if(p=R(p-this.long0),this.sphere){if(a=Math.sin(f),d=Math.cos(f),s=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+d*s:1+this.sinph0*a+this.cosph0*d*s)<=1e-10)return null;i=(n=Math.sqrt(2/n))*d*Math.sin(p),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*d*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(f+this.lat0)<1e-10)return null;n=r-.5*f,i=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(p),n*=s}}else{switch(h=0,c=0,u=0,s=Math.cos(p),o=Math.sin(p),a=Math.sin(f),l=Qt(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(h=l/this.qp,c=Math.sqrt(1-h*h)),this.mode){case this.OBLIQ:u=1+this.sinb1*h+this.cosb1*c*s;break;case this.EQUIT:u=1+c*s;break;case this.N_POLE:u=e+f,l=this.qp-l;break;case this.S_POLE:u=f-e,l=this.qp+l}if(Math.abs(u)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),n=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*h-this.sinb1*c*s):(u=Math.sqrt(2/(1+c*s)))*h*this.ymf,i=this.xmf*u*c*o;break;case this.N_POLE:case this.S_POLE:l>=0?(i=(u=Math.sqrt(l))*o,n=s*(this.mode===this.S_POLE?u:-u)):i=n=0}}return t.x=this.a*i+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,n,r,s,o,a,l,h,c,u,d=t.x/this.a,p=t.y/this.a;if(this.sphere){var f,m=0,g=0;if((n=.5*(f=Math.sqrt(d*d+p*p)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(n),m=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(f)<=1e-10?0:Math.asin(p*g/f),d*=g,p=m*f;break;case this.OBLIQ:n=Math.abs(f)<=1e-10?this.lat0:Math.asin(m*this.sinph0+p*g*this.cosph0/f),d*=g*this.cosph0,p=(m-Math.sin(n)*this.sinph0)*f;break;case this.N_POLE:p=-p,n=e-n;break;case this.S_POLE:n-=e}i=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,p):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,p*=this.dd,(a=Math.sqrt(d*d+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;s=2*Math.asin(.5*a/this.rq),r=Math.cos(s),d*=s=Math.sin(s),this.mode===this.OBLIQ?(l=r*this.sinb1+p*s*this.cosb1/a,o=this.qp*l,p=a*this.cosb1*r-p*this.sinb1*s):(l=p*s/a,o=this.qp*l,p=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(o=d*d+p*p))return t.x=this.long0,t.y=this.lat0,t;l=1-o/this.qp,this.mode===this.S_POLE&&(l=-l)}i=Math.atan2(d,p),h=Math.asin(l),c=this.apa,u=h+h,n=h+c[0]*Math.sin(u)+c[1]*Math.sin(u+u)+c[2]*Math.sin(u+u+u)}return t.x=R(this.long0+i),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},te=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)},ee={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=C(this.e3,this.sin_po,this.cos_po),this.qs1=Qt(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=C(this.e3,this.sin_po,this.cos_po),this.qs2=Qt(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Qt(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var n=Qt(this.e3,this.sin_phi,this.cos_phi),r=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*R(e-this.long0),o=r*Math.sin(s)+this.x0,a=this.rh-r*Math.cos(s)+this.y0;return t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),r=0,0!==e&&(r=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(i=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,i)),s=R(r/this.ns0+this.long0),t.x=s,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var i,n,r,s,o=te(.5*e);if(t<1e-10)return o;for(var a=t*t,l=1;l<=25;l++)if(o+=s=.5*(r=1-(n=t*(i=Math.sin(o)))*n)*r/Math.cos(o)*(e/(1-a)-i/r+.5/t*Math.log((1-n)/(1+n))),Math.abs(s)<=1e-7)return o;return null}},ie={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y;return n=R(l-this.long0),e=Math.sin(h),i=Math.cos(h),r=Math.cos(n),(s=this.sin_p14*e+this.cos_p14*i*r)>0||Math.abs(s)<=1e-10?(o=this.x0+1*this.a*i*Math.sin(n)/s,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*r)/s):(o=this.x0+this.infinity_dist*i*Math.sin(n),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*r)),t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),i=Math.sin(r),n=Math.cos(r),o=te(n*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i),s=R(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t},names:["gnom"]},ne={init:function(){this.sphere||(this.k0=C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,i,n=t.x,r=t.y,s=R(n-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var o=Qt(this.e,Math.sin(r));e=this.x0+this.a*this.k0*s,i=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=i,t},inverse:function(t){var i,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=R(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,i){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-n)<1e-6)return i<0?-1*e:e;for(var r,s,o,a,l=Math.asin(.5*i),h=0;h<30;h++)if(s=Math.sin(l),o=Math.cos(l),a=t*s,l+=r=Math.pow(1-a*a,2)/(2*o)*(i/(1-t*t)-s/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return l;return NaN}(this.e,2*t.y*this.k0/this.a),i=R(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=n,t},names:["cea"]},re={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,i=t.y,n=R(e-this.long0),r=Jt(i-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*r,t},inverse:function(t){var e=t.x,i=t.y;return t.x=R(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Jt(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},se={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wt(this.es),this.e1=jt(this.es),this.e2=qt(this.es),this.e3=Xt(this.es),this.ml0=this.a*Ht(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,n,r=t.x,s=t.y,o=R(r-this.long0);if(n=o*Math.sin(s),this.sphere)Math.abs(s)<=1e-10?(e=this.a*o,i=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(s),i=this.a*(Jt(s-this.lat0)+(1-Math.cos(n))/Math.tan(s)));else if(Math.abs(s)<=1e-10)e=this.a*o,i=-1*this.ml0;else{var a=Yt(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(n),i=this.a*Ht(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(n))}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){var e,i,n,r,s,o,a,l,h;if(n=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=1e-10)e=R(n/this.a+this.long0),i=0;else{var c;for(o=this.lat0+r/this.a,a=n*n/this.a/this.a+o*o,l=o,s=20;s;--s)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+a)*c)/((l-o)/c-1),Math.abs(h)<=1e-10){i=l;break}e=R(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(r+this.ml0)<=1e-10)i=0,e=R(this.long0+n/this.a);else{var u,d,p,f,m;for(o=(this.ml0+r)/this.a,a=n*n/this.a/this.a+o*o,l=o,s=20;s;--s)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*Ht(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(o*(u*(f=d/this.a)+1)-f-.5*u*(f*f+a))/(this.es*Math.sin(2*l)*(f*f+a-2*o*f)/(4*u)+(o-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=1e-10){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=R(this.long0+Math.asin(n*u/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},names:["Polyconic","poly"]},oe={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var i,n=e.x,r=e.y-this.lat0,s=n-this.long0,o=r/t*1e-5,a=s,l=1,h=0;for(i=1;i<=10;i++)l*=o,h+=this.A[i]*l;var c,u=h,d=a,p=1,f=0,m=0,g=0;for(i=1;i<=6;i++)c=f*u+p*d,p=p*u-f*d,f=c,m=m+this.B_re[i]*p-this.B_im[i]*f,g=g+this.B_im[i]*p+this.B_re[i]*f;return e.x=g*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var i,n,r=e.x,s=e.y,o=r-this.x0,a=(s-this.y0)/this.a,l=o/this.a,h=1,c=0,u=0,d=0;for(i=1;i<=6;i++)n=c*a+h*l,h=h*a-c*l,c=n,u=u+this.C_re[i]*h-this.C_im[i]*c,d=d+this.C_im[i]*h+this.C_re[i]*c;for(var p=0;p.999999999999&&(i=.999999999999),e=Math.asin(i);var n=R(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var r=Math.asin(i);return t.x=n,t.y=r,t},names:["Mollweide","moll"]},ce={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wt(this.es),this.e1=jt(this.es),this.e2=qt(this.es),this.e3=Xt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=C(this.e,this.sinphi,this.cosphi),this.ml1=Ht(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=C(this.e,this.sinphi,this.cosphi),this.ml2=Ht(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Ht(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,i=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var r=Ht(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-r)}var s=this.ns*R(i-this.long0),o=this.x0+e*Math.sin(s),a=this.y0+this.rh-e*Math.cos(s);return t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(0!==i&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return r=R(this.long0+s/this.ns),n=Jt(this.g-i/this.a),t.x=r,t.y=n,t;var o=this.g-i/this.a;return n=Zt(o,this.e0,this.e1,this.e2,this.e3),r=R(this.long0+s/this.ns),t.x=r,t.y=n,t},names:["Equidistant_Conic","eqdc"]},ue={init:function(){this.R=this.a},forward:function(t){var i,n,r=t.x,s=t.y,o=R(r-this.long0);Math.abs(s)<=1e-10&&(i=this.x0+this.R*o,n=this.y0);var a=te(2*Math.abs(s/Math.PI));(Math.abs(o)<=1e-10||Math.abs(Math.abs(s)-e)<=1e-10)&&(i=this.x0,n=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var l=.5*Math.abs(Math.PI/o-o/Math.PI),h=l*l,c=Math.sin(a),u=Math.cos(a),d=u/(c+u-1),p=d*d,f=d*(2/c-1),m=f*f,g=Math.PI*this.R*(l*(d-m)+Math.sqrt(h*(d-m)*(d-m)-(m+h)*(p-m)))/(m+h);o<0&&(g=-g),i=this.x0+g;var v=h+d;return g=Math.PI*this.R*(f*v-l*Math.sqrt((m+h)*(h+1)-v*v))/(m+h),n=s>=0?this.y0+g:this.y0-g,t.x=i,t.y=n,t},inverse:function(t){var e,i,n,r,s,o,a,l,h,c,u,d;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(n=t.x/u)*n+(r=t.y/u)*r,u=3*(r*r/(l=-2*(o=-Math.abs(r)*(1+s))+1+2*r*r+s*s)+(2*(a=o-2*r*r+n*n)*a*a/l/l/l-9*o*a/l/l)/27)/(h=(o-a*a/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=t.y>=0?(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(n)<1e-10?this.long0:R(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(n*n-r*r)+s*s))/2/n),t.x=e,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},de={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_,x,b,M,w,E=t.x,S=t.y,T=Math.sin(t.y),C=Math.cos(t.y),P=R(E-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(e-S)*Math.sin(P),t.y=this.y0-this.a*(e-S)*Math.cos(P),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(e+S)*Math.sin(P),t.y=this.y0+this.a*(e+S)*Math.cos(P),t):(_=this.sin_p12*T+this.cos_p12*C*Math.cos(P),y=(v=Math.acos(_))?v/Math.sin(v):1,t.x=this.x0+this.a*y*C*Math.sin(P),t.y=this.y0+this.a*y*(this.cos_p12*T-this.sin_p12*C*Math.cos(P)),t):(i=Wt(this.es),n=jt(this.es),r=qt(this.es),s=Xt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(o=this.a*Ht(i,n,r,s,e),a=this.a*Ht(i,n,r,s,S),t.x=this.x0+(o-a)*Math.sin(P),t.y=this.y0-(o-a)*Math.cos(P),t):Math.abs(this.sin_p12+1)<=1e-10?(o=this.a*Ht(i,n,r,s,e),a=this.a*Ht(i,n,r,s,S),t.x=this.x0+(o+a)*Math.sin(P),t.y=this.y0+(o+a)*Math.cos(P),t):(l=T/C,h=Yt(this.a,this.e,this.sin_p12),c=Yt(this.a,this.e,T),u=Math.atan((1-this.es)*l+this.es*h*this.sin_p12/(c*C)),x=0===(d=Math.atan2(Math.sin(P),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(P)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(d)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(P)*Math.cos(u)/Math.sin(d)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),v=h*x*(1-(b=x*x)*(g=(f=this.e*this.cos_p12*Math.cos(d)/Math.sqrt(1-this.es))*f)*(1-g)/6+(M=b*x)/8*(m=p*f)*(1-2*g)+(w=M*x)/120*(g*(4-7*g)-3*p*p*(1-7*g))-w*x/48*m),t.x=this.x0+v*Math.sin(d),t.y=this.y0+v*Math.cos(d),t))},inverse:function(t){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_,x,b,M,w,E;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*e*this.a)return;return n=i/this.a,r=Math.sin(n),s=Math.cos(n),o=this.long0,Math.abs(i)<=1e-10?a=this.lat0:(a=te(s*this.sin_p12+t.y*r*this.cos_p12/i),l=Math.abs(this.lat0)-e,o=Math.abs(l)<=1e-10?this.lat0>=0?R(this.long0+Math.atan2(t.x,-t.y)):R(this.long0-Math.atan2(-t.x,t.y)):R(this.long0+Math.atan2(t.x*r,i*this.cos_p12*s-t.y*this.sin_p12*r))),t.x=o,t.y=a,t}return h=Wt(this.es),c=jt(this.es),u=qt(this.es),d=Xt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*Ht(h,c,u,d,e),i=Math.sqrt(t.x*t.x+t.y*t.y),a=Zt((p-i)/this.a,h,c,u,d),o=R(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*Ht(h,c,u,d,e),i=Math.sqrt(t.x*t.x+t.y*t.y),a=Zt((i-p)/this.a,h,c,u,d),o=R(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),g=Math.atan2(t.x,t.y),f=Yt(this.a,this.e,this.sin_p12),v=Math.cos(g),_=-(y=this.e*this.cos_p12*v)*y/(1-this.es),x=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),w=1-_*(M=(b=i/f)-_*(1+_)*Math.pow(b,3)/6-x*(1+3*_)*Math.pow(b,4)/24)*M/2-b*M*M*M/6,m=Math.asin(this.sin_p12*Math.cos(M)+this.cos_p12*Math.sin(M)*v),o=R(this.long0+Math.asin(Math.sin(g)*Math.sin(M)/Math.cos(m))),E=Math.sin(m),a=Math.atan2((E-this.es*w*this.sin_p12)*Math.tan(m),E*(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]},pe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y;return n=R(l-this.long0),e=Math.sin(h),i=Math.cos(h),r=Math.cos(n),((s=this.sin_p14*e+this.cos_p14*i*r)>0||Math.abs(s)<=1e-10)&&(o=1*this.a*i*Math.sin(n),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*r)),t.x=o,t.y=a,t},inverse:function(t){var i,n,r,s,o,a,l;return t.x-=this.x0,t.y-=this.y0,i=Math.sqrt(t.x*t.x+t.y*t.y),n=te(i/this.a),r=Math.sin(n),s=Math.cos(n),a=this.long0,Math.abs(i)<=1e-10?(l=this.lat0,t.x=a,t.y=l,t):(l=te(s*this.sin_p14+t.y*r*this.cos_p14/i),o=Math.abs(this.lat0)-e,Math.abs(o)<=1e-10?(a=this.lat0>=0?R(this.long0+Math.atan2(t.x,-t.y)):R(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=l,t):(a=R(this.long0+Math.atan2(t.x*r,i*this.cos_p14*s-t.y*this.sin_p14*r)),t.x=a,t.y=l,t))},names:["ortho"]},fe=1,me=2,ge=3,ve=4,ye=5,_e=6,xe=1,be=2,Me=3,we=4;function Ee(t,i,n,s){var a;return t<1e-10?(s.value=xe,a=0):(a=Math.atan2(i,n),Math.abs(a)<=r?s.value=xe:a>r&&a<=e+r?(s.value=be,a-=e):a>e+r||a<=-(e+r)?(s.value=Me,a=a>=0?a-o:a+o):(s.value=we,a+=e)),a}function Se(t,e){var i=t+e;return i<-o?i+=s:i>+o&&(i-=s),i}var Te,Ce={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=e-r/2?this.face=ye:this.lat0<=-(e-r/2)?this.face=_e:Math.abs(this.long0)<=r?this.face=fe:Math.abs(this.long0)<=e+r?this.face=this.long0>0?me:ve:this.face=ge,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,n,s,a,l,h,c={x:0,y:0},u={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===ye)a=e-i,n>=r&&n<=e+r?(u.value=xe,s=n-e):n>e+r||n<=-(e+r)?(u.value=be,s=n>0?n-o:n+o):n>-(e+r)&&n<=-r?(u.value=Me,s=n+e):(u.value=we,s=n);else if(this.face===_e)a=e+i,n>=r&&n<=e+r?(u.value=xe,s=-n+e):n=-r?(u.value=be,s=-n):n<-r&&n>=-(e+r)?(u.value=Me,s=-n-e):(u.value=we,s=n>0?-n+o:-n-o);else{var d,p,f,m,g,v;this.face===me?n=Se(n,+e):this.face===ge?n=Se(n,+o):this.face===ve&&(n=Se(n,-e)),m=Math.sin(i),g=Math.cos(i),v=Math.sin(n),d=g*Math.cos(n),p=g*v,f=m,this.face===fe?s=Ee(a=Math.acos(d),f,p,u):this.face===me?s=Ee(a=Math.acos(p),f,-d,u):this.face===ge?s=Ee(a=Math.acos(-d),f,-p,u):this.face===ve?s=Ee(a=Math.acos(-p),f,d,u):(a=s=0,u.value=xe)}return h=Math.atan(12/o*(s+Math.acos(Math.sin(s)*Math.cos(r))-e)),l=Math.sqrt((1-Math.cos(a))/(Math.cos(h)*Math.cos(h))/(1-Math.cos(Math.atan(1/Math.cos(s))))),u.value===be?h+=e:u.value===Me?h+=o:u.value===we&&(h+=1.5*o),c.x=l*Math.cos(h),c.y=l*Math.sin(h),c.x=c.x*this.a+this.x0,c.y=c.y*this.a+this.y0,t.x=c.x,t.y=c.y,t},inverse:function(t){var i,n,r,s,a,l,h,c,u,d,p,f,m={lam:0,phi:0},g={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?g.value=xe:t.y>=0&&t.y>=Math.abs(t.x)?(g.value=be,i-=e):t.x<0&&-t.x>=Math.abs(t.y)?(g.value=Me,i=i<0?i+o:i-o):(g.value=we,i+=e),u=o/12*Math.tan(i),a=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),l=Math.atan(a),(h=1-(r=Math.cos(i))*r*(s=Math.tan(n))*s*(1-Math.cos(Math.atan(1/Math.cos(l)))))<-1?h=-1:h>1&&(h=1),this.face===ye)c=Math.acos(h),m.phi=e-c,g.value===xe?m.lam=l+e:g.value===be?m.lam=l<0?l+o:l-o:g.value===Me?m.lam=l-e:m.lam=l;else if(this.face===_e)c=Math.acos(h),m.phi=c-e,g.value===xe?m.lam=-l+e:g.value===be?m.lam=-l:g.value===Me?m.lam=-l-e:m.lam=l<0?-l-o:-l+o;else{var v,y,_;u=(v=h)*v,y=(u+=(_=u>=1?0:Math.sqrt(1-u)*Math.sin(l))*_)>=1?0:Math.sqrt(1-u),g.value===be?(u=y,y=-_,_=u):g.value===Me?(y=-y,_=-_):g.value===we&&(u=y,y=_,_=-u),this.face===me?(u=v,v=-y,y=u):this.face===ge?(v=-v,y=-y):this.face===ve&&(u=v,v=y,y=-u),m.phi=Math.acos(-_)-e,m.lam=Math.atan2(y,v),this.face===me?m.lam=Se(m.lam,-e):this.face===ge?m.lam=Se(m.lam,-o):this.face===ve&&(m.lam=Se(m.lam,+e))}return 0!==this.es&&(d=m.phi<0?1:0,p=Math.tan(m.phi),f=this.b/Math.sqrt(p*p+this.one_minus_f_squared),m.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),d&&(m.phi=-m.phi)),m.lam+=this.long0,t.x=m.lam,t.y=m.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Pe=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Re=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ae=n/5,Le=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},Ie={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=R(t.x-this.long0),i=Math.abs(t.y),r=Math.floor(i*Ae);r<0?r=0:r>=18&&(r=17);var s={x:Le(Pe[r],i=n*(i-.08726646259971647*r))*e,y:Le(Re[r],i)};return t.y<0&&(s.y=-s.y),s.x=s.x*this.a*.8487+this.x0,s.y=s.y*this.a*1.3523+this.y0,s},inverse:function(t){var n={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(n.y>=1)n.x/=Pe[18][0],n.y=t.y<0?-e:e;else{var r=Math.floor(18*n.y);for(r<0?r=0:r>=18&&(r=17);;)if(Re[r][0]>n.y)--r;else{if(!(Re[r+1][0]<=n.y))break;++r}var s=Re[r],o=5*(n.y-s[0])/(Re[r+1][0]-s[0]);o=function(t,e,i,n){for(var r=e;n;--n){var s=t(r);if(r-=s,Math.abs(s)1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=function(t,e,i){for(var n=[],r=0;r1)for(var i=1;i0?s.replace("%var%",r.join(" - ")):s.replace("%var%","%var% (not specified)")}catch(t){}return s}},u={normalyzeParameters:function(t){var e=null;if(t){var i=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r||(r=""),i.push(n+"="+r)}e=i.join("&")}return e},normalyzeUrl:function(t,e,i){var n=t;if(t){var r=t.indexOf("?");-1===r&&(n+="?"),-1!==r&&r!==t.length-1&&(n+="&")}return e&&(n+="string"==typeof e?e:this.normalyzeParameters(e)),i&&(n=encodeURIComponent(n)),n},indent:function(t,e){return new Array((t||0)+1).join("\t")+e}},d=i(9),p=i.n(d),f={call:function(t){var e=h.getLogger("XHR");if(e.trace("[XHR::call()]"),p.a.polyfill(),!t.url)throw new Error("missing parameter : url is not defined !");if(!t.method)throw new Error("missing parameter : method is not defined !");t.format||(t.format="text");var i={};switch(i.url=t.url,i.data=t.data?t.data:null,i.method=t.method,i.timeOut=t.timeOut||0,i.scope=t.scope||this,i.proxy=t.proxy||null,i.content=t.content||null,i.headers=t.headers||{referer:"http://localhost"},t.method){case"DELETE":case"GET":break;case"PUT":case"POST":i.content=t.content?t.content:"application/x-www-form-urlencoded",i.headers=t.headers?t.headers:{referer:"http://localhost"};break;case"HEAD":case"OPTIONS":throw new Error("HTTP method not yet supported !");default:throw new Error("HTTP method unknown !")}switch(t.format){case"text":this.__call(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;case"json":this.__callJSON(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;case"xml":this.__callXML(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;default:throw new Error("This output Format is not yet supported !")}},__call:function(t){var e=h.getLogger("XHR");return e.trace("[XHR::__call()]"),new Promise((function(n,r){var s="POST"===t.method||"PUT"===t.method?1:0;t.data&&("object"==typeof t.data&&Object.keys(t.data).length||"string"==typeof t.data&&t.data.length)&&!s&&("Geocode"===t.scope.CLASSNAME||"ReverseGeocode"===t.scope.CLASSNAME?t.url=t.url+t.data:t.url=u.normalyzeUrl(t.url,t.data)),e.trace("URL = ",t.url);var o=null;if("undefined"==typeof window){var a=i(6),l={headers:{Referer:"https://localhost"}};return t.data&&"string"==typeof t.data&&s&&(l={method:t.method,body:t.data,headers:{"Content-Type":t.content,Referer:"https://localhost"}}),a(t.url,l).then((function(t){if(t.ok)n(t.text());else{var e="Errors Occured on Http Request (status : '"+t.statusText+"' | url : '"+t.url+"')",i=t.status;r({message:e,status:i})}})).catch((function(t){r({message:t,status:-1})}))}if(window.XMLHttpRequest){e.trace("XMLHttpRequest"),(o=new XMLHttpRequest).open(t.method,t.url,!0),o.overrideMimeType=t.content;var h=null;t.timeOut>0&&(e.trace("XHR - TimeOut actif !"),h=window.setTimeout((function(){r({message:"TimeOut Occured on Http Request with XMLHttpRequest !",status:-1})}),t.timeOut)),s&&(e.trace("data = ",t.data),o.setRequestHeader("Content-type",t.content)),o.onerror=function(t){console.log(t),r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},o.ontimeout=function(t){console.log(t),r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},o.onreadystatechange=function(t){if(4===o.readyState)if(200===o.status)window.clearTimeout(h),n(o.response);else{var e="Errors Occured on Http Request (status : '"+t.target.statusText+"' | url : '"+t.target.responseURL+"' | response : '"+t.target.response+"')",i=t.target.status;r({message:e,status:i})}};var c=t.data&&s?t.data:null;o.send(c)}else{if(!window.XDomainRequest)throw new Error("CORS not supported");e.trace("XDomainRequest"),(o=new XDomainRequest).open(t.method,t.url),o.overrideMimeType=t.content,t.timeOut>0&&(o.timeout=t.timeout,e.trace("XHR - TimeOut actif !")),s&&o.setRequestHeader("Content-type",t.content),o.onerror=function(){r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},o.ontimeout=function(){r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},o.onload=function(t){if(200===o.status)n(o.responseText);else{var e="Errors Occured on Http Request (status : '"+t.target.statusText+"' | url : '"+t.target.responseURL+"')",i=t.target.status;r({message:e,status:i})}};var d=t.data&&s?t.data:null;o.send(d)}}))},__callJSON:function(t){return this.__call(t).then(JSON.parse).catch((function(e){console.log("_callJSON failed on : ",t.url,e)}))},__callXML:function(t){return this.__call(t).then((function(t){var e;"undefined"==typeof window?e=(new(0,i(7).DOMParser)).parseFromString(t,"text/xml"):window.DOMParser?e=(new window.DOMParser).parseFromString(t,"text/xml"):((e=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,e.loadXML(t));return e})).catch((function(e){console.log("__callXML failed on : ",t.url,e)}))}},m={uuid:(n=Math.floor(Date.now()),function(){return n++}),call:function(t){var e=h.getLogger("JSONP");if(e.trace("[JSONP::call ()]"),!t)throw e.error("missing parameter : options !"),new Error("missing parameter : options !");if(!t.url)throw e.error("missing parameter : options.url !"),new Error("missing parameter : options.url !");if(t.timeOut||(e.info("setting 'options.timeOut' default value"),t.timeOut=0),!t.onResponse)throw e.error("missing parameter : options.onResponse !"),new Error("missing parameter : options.onResponse !");var i="string"==typeof t.callbackSuffix?t.callbackSuffix:this.uuid(),n=!1,r=!1,s=t.url.indexOf("callback=");if(-1!==s){n=!0;var o=t.url.indexOf("&",s);-1===o&&(o=t.url.length);var a=t.url.substring(s+9,o);a&&(r=!0,t.callbackName=a,e.info("setting 'options.callbackName' value ("+t.callbackName+") from 'options.url' parameter"))}if(!n){var l=t.url.indexOf("?");-1===l?t.url=t.url+"?callback=":l===t.url.length?t.url=t.url+"callback=":t.url=t.url+"&callback=",e.info("setting callback default key in 'options.url' : "+t.url)}var c=!!t.callbackName||r;if(r||(t.callbackName||(e.info("setting 'options.callbackName' default value"),t.callbackName="callback",(i||""===i)&&(t.callbackName+=i)),t.url=t.url.replace("callback=","callback="+t.callbackName),e.info("setting callback function name in 'options.url' : "+t.url)),t.onTimeOut||(e.info("setting 'options.onTimeOut' default value"),t.onTimeOut=function(){console.log("TimeOut while invoking url : "+t.url)}),!c){var u=this,d=null;t.timeOut>0&&(d=window.setTimeout((function(){window[t.callbackName]=function(){},t.onTimeOut(),u._deleteScript(i)}),t.timeOut)),window[t.callbackName]=function(e){window.clearTimeout(d),t.onResponse(e),u._deleteScript(i)}}this._createScript(i,t.url)},_createScript:function(t,e){var i,n=document.getElementById("results"+t);(i=document.createElement("script")).setAttribute("type","text/javascript"),i.setAttribute("src",e),i.setAttribute("charset","UTF-8"),i.setAttribute("id","results"+t),i.setAttribute("async","true");var r=document.documentElement||document.getElementsByTagName("head")[0];null===n?r.appendChild(i):r.replaceChild(i,n)},_deleteScript:function(t){var e=document.getElementById("results"+t);if(e){var i=e.parentNode||document.documentElement;if(!i)return;i.removeChild(e)}}},g={send:function(t){var e=t||{method:"GET",protocol:"XHR",timeOut:0,format:null,wrap:!0,nocache:!0,output:"json",callback:null,callbackSuffix:null};if("undefined"!=typeof window||"JSONP"!==t.protocol){if("XHR"===t.protocol||"json"===t.format?e.wrap=!1:"JSONP"===t.protocol&&"xml"===t.format&&(e.wrap=!0),e.callback=null,e.output=e.wrap?"json":null,e.wrap){var i={};i.output=e.output,i.callback=e.callback,delete i.callback,e.url=u.normalyzeUrl(t.url,i)}switch(e.protocol){case"XHR":"GET"===t.method&&t.nocache&&(e.url=u.normalyzeUrl(e.url,{t:(new Date).getTime()})),f.call(e);break;case"JSONP":e.data&&(e.url=u.normalyzeUrl(e.url,e.data)),m.call(e);break;default:throw new Error("protocol not supported (XHR|JSONP) !")}}else console.log("Value (s) for parameter (s) 'protocol=JSONP (instead use XHR)' not supported to NodeJS")}};function v(t){if(!(this instanceof v))throw new TypeError("ErrorService constructor cannot be called as a function.");var e=t;"string"==typeof t||t instanceof String?(this.message=t,this.status=-1,this.type=v.TYPE_UNKERR):(this.message=e.message||"undefined!?",this.type=e.type,this.status=e.status||-1),this.name="ErrorService",this.stack=(new Error).stack}v.TYPE_SRVERR="SERVICE_ERROR",v.TYPE_USEERR="USAGE_ERROR",v.TYPE_UNKERR="UNKNOWN_ERROR",v.prototype=Object.create(Error.prototype,{constructor:{value:v,writable:!0,configurable:!0}});var y=v,_={ssl:!0,url:function(t){return(!1===_.ssl?"http://":"https://")+"wxs.ign.fr"+t},newUrl:function(t,e){return(!1===_.ssl?"http://":"https://")+e+t},Alti:{new_key:{"elevation-json":"/altimetrie/1.0/calcul/alti/rest/elevation.json","elevation-xml":"/altimetrie/1.0/calcul/alti/rest/elevation.xml","profil-json":"/altimetrie/1.0/calcul/alti/rest/elevationLine.json","profil-xml":"/altimetrie/1.0/calcul/alti/rest/elevationLine.xml"},_key:{"elevation-json":"/calcul/alti/rest/elevation.json","elevation-xml":"/calcul/alti/rest/elevation.xml","profil-json":"/calcul/alti/rest/elevationLine.json","profil-xml":"/calcul/alti/rest/elevationLine.xml",wps:"/alti/wps"},newUrl:function(){},url:function(){return{"elevation-json":_.url(this._key["elevation-json"]),"elevation-xml":_.url(this._key["elevation-xml"]),"profil-json":_.url(this._key["profil-json"]),"profil-xml":_.url(this._key["profil-xml"])}}},ProcessIsoCurve:{new_key:"/itineraire/isochrone",_key:"/calcul/geoportail/isochrone/rest/1.0.0/isochrone",newUrl:function(){},url:function(){return _.url(this._key)}},Config:{_key:"https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/dist/",url:function(t){Array.isArray(t)||(t=t.split(","));for(var e=[],i=0;in(t,{credentials:"same-origin"}).then(t=>{if(t.ok)return t.json().then(t=>t).catch(t=>{throw new Error("Exception Json : "+t)});throw new Error("Exception HTTP : "+t.status+" (status code) !")}).catch(t=>new Promise((e,i)=>{i(t)})),o=[];for(let t=0;t{if(!t)throw new Error("results config empty !?");t.forEach(t=>{this.listConfigResults.push(t)})}).then(()=>{e.call(this,this.listConfigResults)}).catch(e=>{t.call(this,e)})},P=function(t,e){this.listConfigResults=[];for(var i=0;ie||t__IDENTIFIER__\x3c!-- __DATAINPUTS__ --\x3e__RAWDATAOUTPUT__',input:"__KEY____DATA__"}},namespaceByDefault:function(){return['xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"','xmlns="http://www.opengis.net/wps/1.0.0"','xmlns:wfs="http://www.opengis.net/wfs"','xmlns:wps="http://www.opengis.net/wps/1.0.0"','xmlns:ows="http://www.opengis.net/ows/1.1"','xmlns:gml="http://www.opengis.net/gml"','xmlns:ogc="http://www.opengis.net/ogc"','xmlns:wcs="http://www.opengis.net/wcs/1.1.1"','xmlns:xlink="http://www.w3.org/1999/xlink"'].join(" ")},schemaLocationByDefault:function(){return'xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"'},processRequestString:function(){this.logger.trace("WPS::processRequestString ()");var t="";if("POST"===this.method)t=this.template.post.value;else{if("GET"!==this.method)return this.logger.error("No other method supported by the service !"),!1;t=this.template.get.value}return t=(t=(t=(t=(t=t.replace(/__SERVICE__/g,this.paramservice)).replace(/__VERSION__/g,this.paramversion)).replace(/__RAWDATAOUTPUT__/g,this.paramrawdataoutput)).replace(/__IDENTIFIER__/g,this.paramidentifier)).replace(/__REQUEST__/g,this.paramrequest),"POST"===this.method&&(t=(t=t.replace(/__NAMESPACE__/g,this.namespaceByDefault)).replace(/__SCHEMALOCATION__/g,this.schemaLocationByDefault)),(t=t.replace(//g,this.__addDataInputs()))?(this.requestString=t,this.logger.trace("traduction tmpl",t),!0):(this.logger.warn("traduction tmpl : empty request !?"),!1)},__addDataInputs:function(){this.logger.trace("WPS::__addDataInputs ()");for(var t,e="GET"===this.method?this.template.get.input:this.template.post.input,i="GET"===this.method?";":"",n="",r=this,s=this.DataObject.getData(),o=0;o0)for(var o=n.getElementsByTagName("parsererror"),a=0;a0){var n=function(t){if(t.attributes.length>0){for(var e={},i=t.attributes,n=0;n0?e.index=e.filters.type[0]:e.index=e.filters.type),delete e.filters.type),e.filters.bbox&&(this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"),delete e.filters.bbox)),delete e.filterOptions),e.position&&(e.position.x&&(this.logger.warn("The parameter 'position.x' is deprecated"),e.position.lon||(e.position.lon=e.position.x),delete e.position.x),e.position.y&&(this.logger.warn("The parameter 'position.y' is deprecated"),e.position.lat||(e.position.lat=e.position.y),delete e.position.y)),e.returnFreeForm&&(this.logger.warn("The parameter 'returnFreeForm' is deprecated"),delete e.returnFreeForm),e.srs&&(this.logger.warn("The parameter 'srs' is deprecated"),delete e.srs),e},mt.prototype.buildRequest=function(t,e){var i={httpMethod:this.options.httpMethod,geocodeMethod:"search",query:this.options.query,index:this.options.index,returnTrueGeometry:this.options.returnTrueGeometry,position:this.options.position,maxResp:this.options.maximumResponses,filters:this.options.filters};this.request=ot.build(i),this.request?e.call(this,this.request):t.call(this,new y(c.getMessage("SERVICE_REQUEST_BUILD")))},mt.prototype.analyzeResponse=function(t,e){if(this.response){var i={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:e,scope:this};ft.build(i)}else t.call(this,new y(c.getMessage("SERVICE_RESPONSE_EMPTY")))};var gt=mt;function vt(t){if(!(this instanceof vt))throw new TypeError(c.getMessage("CLASS_CONSTRUCTOR","ReverseGeocode"));this.CLASSNAME="ReverseGeocode",this.logger=h.getLogger("Gp.Services.ReverseGeocode"),this.logger.trace("[Constructeur ReverseGeocode (options)]");var e=this.patchOptionConvertor(t);if(e.serverUrl||(e.serverUrl=x.ReverseGeocode.url()),w.apply(this,[e]),e.searchGeometry)this.options.searchGeometry=e.searchGeometry;else if(!e.position)throw new Error(c.getMessage("PARAM_MISSING","searchGeometry"));if(e.index||(this.options.index=e.index="StreetAddress"),e.filters)for(var i=Object.keys(e.filters),n=0;n0?e.index=e.filterOptions.type[0]:e.index=e.filterOptions.type),delete e.filterOptions.type),e.filterOptions.bbox&&(this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"),e.searchGeometry||(e.searchGeometry=this.bbox2Json(e.filterOptions.bbox)),delete e.filterOptions.bbox),e.filterOptions.circle&&(this.logger.warn("The parameter 'filterOptions.circle' is deprecated"),e.searchGeometry||(e.searchGeometry=this.circle2Json(e.filterOptions.circle)),delete e.filterOptions.circle),e.filterOptions.polygon&&(this.logger.warn("The parameter 'filterOptions.polygon' is deprecated"),e.searchGeometry||(e.searchGeometry=this.polygon2Json(e.filterOptions.polygon)),delete e.filterOptions.polygon),!e.filters&&Object.keys(e.filterOptions).length>0&&(e.filters=e.filterOptions),delete e.filterOptions),e.position&&(e.position.x&&(this.logger.warn("The parameter 'position.x' is deprecated"),e.position.lon||(e.position.lon=e.position.x),delete e.position.x),e.position.y&&(this.logger.warn("The parameter 'position.y' is deprecated"),e.position.lat||(e.position.lat=e.position.y),delete e.position.y)),e.srs&&(this.logger.warn("The parameter 'srs' is deprecated"),delete e.srs),e},vt.prototype.buildRequest=function(t,e){var i={httpMethod:this.options.httpMethod,geocodeMethod:"reverse",searchGeometry:this.options.searchGeometry,index:this.options.index,position:this.options.position,returnTrueGeometry:this.options.returnTrueGeometry,maxResp:this.options.maximumResponses,filters:this.options.filters};this.request=ot.build(i),this.request?e.call(this,this.request):t.call(this,new y(c.getMessage("SERVICE_REQUEST_BUILD")))},vt.prototype.analyzeResponse=function(t,e){if(this.response){var i={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:e,scope:this};ft.build(i)}else t.call(this,new y(c.getMessage("SERVICE_RESPONSE_EMPTY")))},vt.prototype.bbox2Json=function(t){return{type:"Polygon",coordinates:[[[t.left,t.top],[t.right,t.top],[t.right,t.bottom],[t.left,t.bottom],[t.left,t.top]]]}},vt.prototype.circle2Json=function(t){return{type:"Circle",radius:t.radius,coordinates:[t.x,t.y]}},vt.prototype.polygon2Json=function(t){for(var e={type:"Polygon",coordinates:[[]]},i=0;i=s&&r<=o},_checkDMSDegrees:function(t,e){if(isNaN(e.value))return!1;var i=parseFloat(e.value);if((0|i)!==i)return!1;var n=Number(e.dataset.min),r=Number(e.dataset.max);if(ir)return!1;var s=document.getElementById(this._addUID("GPmousePosition"+t+"Minutes")),o=document.getElementById(this._addUID("GPmousePosition"+t+"Seconds"));return i>=r?(s.dataset.max=0,o.dataset.max=0):(s.dataset.max=59,o.dataset.max=59.9999),!0},GPdisplayCoords:function(t){if(t){var e=document.getElementById(this._addUID("GPmousePositionLonLabel")),i=document.getElementById(this._addUID("GPmousePositionLatLabel"));if(t.x||t.y?(i.innerHTML="X : ",e.innerHTML="Y : "):t.e||t.n?(i.innerHTML="E : ",e.innerHTML="N : "):(i.innerHTML="Latitude : ",e.innerHTML="Longitude : "),"object"===oe(t.lat)&&"object"===oe(t.lng)){var n={lng:"Lon",lat:"Lat"},r=["Degrees","Minutes","Seconds"];for(var s in n)for(var o=0;o>8&255]+he[t>>16&255]+he[t>>24&255]+"-"+he[255&e]+he[e>>8&255]+"-"+he[e>>16&15|64]+he[e>>24&255]+"-"+he[63&i|128]+he[i>>8&255]+"-"+he[i>>16&255]+he[i>>24&255]+he[255&n]+he[n>>8&255]+he[n>>16&255]+he[n>>24&255]).toUpperCase()}function pe(t,e,i){return Math.max(e,Math.min(i,t))}function fe(t,e){return(t%e+e)%e}function me(t,e,i){return(1-i)*t+i*e}function ge(t){return 0==(t&t-1)&&0!==t}function ve(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}class ye{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}ye.prototype.isVector2=!0;class _e{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,l){const h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=r,h[5]=a,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],h=i[4],c=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],_=n[7],x=n[2],b=n[5],M=n[8];return r[0]=s*f+o*v+a*x,r[3]=s*m+o*y+a*b,r[6]=s*g+o*_+a*M,r[1]=l*f+h*v+c*x,r[4]=l*m+h*y+c*b,r[7]=l*g+h*_+c*M,r[2]=u*f+d*v+p*x,r[5]=u*m+d*y+p*b,r[8]=u*g+d*_+p*M,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8];return e*s*h-e*o*l-i*r*h+i*o*a+n*r*l-n*s*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8],c=h*s-o*l,u=o*a-h*r,d=l*r-s*a,p=e*c+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=c*f,t[1]=(n*l-h*i)*f,t[2]=(o*i-n*s)*f,t[3]=u*f,t[4]=(h*e-n*a)*f,t[5]=(n*r-o*e)*f,t[6]=d*f,t[7]=(i*a-l*e)*f,t[8]=(s*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,s,o){const a=Math.cos(r),l=Math.sin(r);return this.set(i*a,i*l,-i*(a*s+l*o)+s+t,-n*l,n*a,-n*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],s=n[3],o=n[6],a=n[1],l=n[4],h=n[7];return n[0]=e*r+i*a,n[3]=e*s+i*l,n[6]=e*o+i*h,n[1]=-i*r+e*a,n[4]=-i*s+e*l,n[7]=-i*o+e*h,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}function xe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>65535)return!0;return!1}_e.prototype.isMatrix3=!0;Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function be(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const Me={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},we={h:0,s:0,l:0},Ee={h:0,s:0,l:0};function Se(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function Te(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ce(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Pe{constructor(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=fe(t,1),e=pe(e,0,1),i=pe(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=Se(r,n,t+1/3),this.g=Se(r,n,t),this.b=Se(r,n,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Me[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Te(t.r),this.g=Te(t.g),this.b=Te(t.b),this}copyLinearToSRGB(t){return this.r=Ce(t.r),this.g=Ce(t.g),this.b=Ce(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),s=Math.min(e,i,n);let o,a;const l=(s+r)/2;if(s===r)o=0,a=0;else{const t=r-s;switch(a=l<=.5?t/(r+s):t/(2-r-s),r){case e:o=(i-n)/t+(i2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=be("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&this.version++}}function De(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Ae.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Ie.DEFAULT_IMAGE=void 0,Ie.DEFAULT_MAPPING=300,Ie.prototype.isTexture=!0;class Ne{constructor(t=0,e=0,i=0,n=1){this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const s=t.elements,o=s[0],a=s[4],l=s[8],h=s[1],c=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-h)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(a+h)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(o+1)/2,s=(c+1)/2,m=(f+1)/2,g=(a+h)/4,v=(l+d)/4,y=(u+p)/4;return t>s&&t>m?t<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=g/i,r=v/i):s>m?s<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(s),i=g/n,r=y/n):m<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(m),i=v/r,n=y/r),this.set(i,n,r,e),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(h-a)*(h-a));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(h-a)/m,this.w=Math.acos((o+c+f-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}Ne.prototype.isVector4=!0;class Oe extends le{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Ne(0,0,t,e),this.scissorTest=!1,this.viewport=new Ne(0,0,t,e),this.texture=new Ie(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:1006,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Object.assign({},t.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Oe.prototype.isWebGLRenderTarget=!0;(class extends Oe{constructor(t,e,i){super(t,e);const n=this.texture;this.texture=[];for(let t=0;t=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,o=Math.sin(o*s)/r}const r=o*i;if(a=a*t+u*r,l=l*t+d*r,h=h*t+p*r,c=c*t+f*r,t===1-o){const t=1/Math.sqrt(a*a+l*l+h*h+c*c);a*=t,l*=t,h*=t,c*=t}}t[e]=a,t[e+1]=l,t[e+2]=h,t[e+3]=c}static multiplyQuaternionsFlat(t,e,i,n,r,s){const o=i[n],a=i[n+1],l=i[n+2],h=i[n+3],c=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=o*p+h*c+a*d-l*u,t[e+1]=a*p+h*u+l*c-o*d,t[e+2]=l*p+h*d+o*u-a*c,t[e+3]=h*p-o*c-a*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,s=t._order,o=Math.cos,a=Math.sin,l=o(i/2),h=o(n/2),c=o(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(s){case"XYZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"YXZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"ZXY":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"ZYX":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"YZX":this._x=u*h*c+l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c-u*d*p;break;case"XZY":this._x=u*h*c-l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],o=e[5],a=e[9],l=e[2],h=e[6],c=e[10],u=i+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(h-a)*t,this._y=(r-l)*t,this._z=(s-n)*t}else if(i>o&&i>c){const t=2*Math.sqrt(1+i-o-c);this._w=(h-a)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+l)/t}else if(o>c){const t=2*Math.sqrt(1+o-i-c);this._w=(r-l)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(a+h)/t}else{const t=2*Math.sqrt(1+c-i-o);this._w=(s-n)/t,this._x=(r+l)/t,this._y=(a+h)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(pe(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,s=t._w,o=e._x,a=e._y,l=e._z,h=e._w;return this._x=i*h+s*o+n*l-r*a,this._y=n*h+s*a+r*o-i*l,this._z=r*h+s*l+i*a-n*o,this._w=s*h-i*o-n*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,s=this._w;let o=s*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),h=Math.atan2(l,o),c=Math.sin((1-e)*h)/l,u=Math.sin(e*h)/l;return this._w=s*c+this._w*u,this._x=i*c+this._x*u,this._y=n*c+this._y*u,this._z=r*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}ke.prototype.isQuaternion=!0;class Ue{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ze.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ze.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,l=a*e+s*n-o*i,h=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=l*a+u*-r+h*-o-c*-s,this.y=h*a+u*-s+c*-r-l*-o,this.z=c*a+u*-o+l*-s-h*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Be.copy(this).projectOnVector(t),this.sub(Be)}reflect(t){return this.sub(Be.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(pe(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}Ue.prototype.isVector3=!0;const Be=new Ue,ze=new ke;class Fe{constructor(t=new Ue(1/0,1/0,1/0),e=new Ue(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.length;ar&&(r=l),h>s&&(s=h),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.count;ar&&(r=l),h>s&&(s=h),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,He),He.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Ke),Qe.subVectors(this.max,Ke),je.subVectors(t.a,Ke),qe.subVectors(t.b,Ke),Xe.subVectors(t.c,Ke),Ye.subVectors(qe,je),Je.subVectors(Xe,qe),Ze.subVectors(je,Xe);let e=[0,-Ye.z,Ye.y,0,-Je.z,Je.y,0,-Ze.z,Ze.y,Ye.z,0,-Ye.x,Je.z,0,-Je.x,Ze.z,0,-Ze.x,-Ye.y,Ye.x,0,-Je.y,Je.x,0,-Ze.y,Ze.x,0];return!!ei(e,je,qe,Xe,Qe)&&(e=[1,0,0,0,1,0,0,0,1],!!ei(e,je,qe,Xe,Qe)&&($e.crossVectors(Ye,Je),e=[$e.x,$e.y,$e.z],ei(e,je,qe,Xe,Qe)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return He.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(He).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Ve[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ve[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ve[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ve[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ve[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ve[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ve[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ve[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ve)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}Fe.prototype.isBox3=!0;const Ve=[new Ue,new Ue,new Ue,new Ue,new Ue,new Ue,new Ue,new Ue],He=new Ue,We=new Fe,je=new Ue,qe=new Ue,Xe=new Ue,Ye=new Ue,Je=new Ue,Ze=new Ue,Ke=new Ue,Qe=new Ue,$e=new Ue,ti=new Ue;function ei(t,e,i,n,r){for(let s=0,o=t.length-3;s<=o;s+=3){ti.fromArray(t,s);const o=r.x*Math.abs(ti.x)+r.y*Math.abs(ti.y)+r.z*Math.abs(ti.z),a=e.dot(ti),l=i.dot(ti),h=n.dot(ti);if(Math.max(-Math.max(a,l,h),Math.min(a,l,h))>o)return!1}return!0}const ii=new Fe,ni=new Ue,ri=new Ue,si=new Ue;class oi{constructor(t=new Ue,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):ii.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){si.subVectors(t,this.center);const e=si.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.add(si.multiplyScalar(i/t)),this.radius+=i}return this}union(t){return!0===this.center.equals(t.center)?ri.set(0,0,1).multiplyScalar(t.radius):ri.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(ni.copy(t.center).add(ri)),this.expandByPoint(ni.copy(t.center).sub(ri)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ai=new Ue,li=new Ue,hi=new Ue,ci=new Ue,ui=new Ue,di=new Ue,pi=new Ue;class fi{constructor(t=new Ue,e=new Ue(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ai)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=ai.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ai.copy(this.direction).multiplyScalar(e).add(this.origin),ai.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){li.copy(t).add(e).multiplyScalar(.5),hi.copy(e).sub(t).normalize(),ci.copy(this.origin).sub(li);const r=.5*t.distanceTo(e),s=-this.direction.dot(hi),o=ci.dot(this.direction),a=-ci.dot(hi),l=ci.lengthSq(),h=Math.abs(1-s*s);let c,u,d,p;if(h>0)if(c=s*a-o,u=s*o-a,p=r*h,c>=0)if(u>=-p)if(u<=p){const t=1/h;c*=t,u*=t,d=c*(c+s*u+2*o)+u*(s*c+u+2*a)+l}else u=r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;else u=-r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;else u<=-p?(c=Math.max(0,-(-s*r+o)),u=c>0?-r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+l):u<=p?(c=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(c=Math.max(0,-(s*r+o)),u=c>0?r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+l);else u=s>0?-r:r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(c).add(this.origin),n&&n.copy(hi).multiplyScalar(u).add(li),d}intersectSphere(t,e){ai.subVectors(t.center,this.origin);const i=ai.dot(this.direction),n=ai.dot(ai)-i*i,r=t.radius*t.radius;if(n>r)return null;const s=Math.sqrt(r-n),o=i-s,a=i+s;return o<0&&a<0?null:o<0?this.at(a,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,o,a;const l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),h>=0?(r=(t.min.y-u.y)*h,s=(t.max.y-u.y)*h):(r=(t.max.y-u.y)*h,s=(t.min.y-u.y)*h),i>s||r>n?null:((r>i||i!=i)&&(i=r),(s=0?(o=(t.min.z-u.z)*c,a=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,a=(t.min.z-u.z)*c),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,ai)}intersectTriangle(t,e,i,n,r){ui.subVectors(e,t),di.subVectors(i,t),pi.crossVectors(ui,di);let s,o=this.direction.dot(pi);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}ci.subVectors(this.origin,t);const a=s*this.direction.dot(di.crossVectors(ci,di));if(a<0)return null;const l=s*this.direction.dot(ui.cross(ci));if(l<0)return null;if(a+l>o)return null;const h=-s*ci.dot(pi);return h<0?null:this.at(h/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class mi{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 mi).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/gi.setFromMatrixColumn(t,0).length(),r=1/gi.setFromMatrixColumn(t,1).length(),s=1/gi.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),l=Math.sin(n),h=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){const t=s*h,i=s*c,n=o*h,r=o*c;e[0]=a*h,e[4]=-a*c,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-o*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*h,i=a*c,n=l*h,r=l*c;e[0]=t+r*o,e[4]=n*o-i,e[8]=s*l,e[1]=s*c,e[5]=s*h,e[9]=-o,e[2]=i*o-n,e[6]=r+t*o,e[10]=s*a}else if("ZXY"===t.order){const t=a*h,i=a*c,n=l*h,r=l*c;e[0]=t-r*o,e[4]=-s*c,e[8]=n+i*o,e[1]=i+n*o,e[5]=s*h,e[9]=r-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*h,i=s*c,n=o*h,r=o*c;e[0]=a*h,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*c,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*h,e[4]=r-t*c,e[8]=n*c+i,e[1]=c,e[5]=s*h,e[9]=-o*h,e[2]=-l*h,e[6]=i*c+n,e[10]=t-r*c}else if("XZY"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*h,e[4]=-c,e[8]=l*h,e[1]=t*c+r,e[5]=s*h,e[9]=i*c-n,e[2]=n*c-i,e[6]=o*h,e[10]=r*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(yi,t,_i)}lookAt(t,e,i){const n=this.elements;return Mi.subVectors(t,e),0===Mi.lengthSq()&&(Mi.z=1),Mi.normalize(),xi.crossVectors(i,Mi),0===xi.lengthSq()&&(1===Math.abs(i.z)?Mi.x+=1e-4:Mi.z+=1e-4,Mi.normalize(),xi.crossVectors(i,Mi)),xi.normalize(),bi.crossVectors(Mi,xi),n[0]=xi.x,n[4]=bi.x,n[8]=Mi.x,n[1]=xi.y,n[5]=bi.y,n[9]=Mi.y,n[2]=xi.z,n[6]=bi.z,n[10]=Mi.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[4],a=i[8],l=i[12],h=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],_=i[11],x=i[15],b=n[0],M=n[4],w=n[8],E=n[12],S=n[1],T=n[5],C=n[9],P=n[13],R=n[2],A=n[6],L=n[10],I=n[14],D=n[3],N=n[7],O=n[11],G=n[15];return r[0]=s*b+o*S+a*R+l*D,r[4]=s*M+o*T+a*A+l*N,r[8]=s*w+o*C+a*L+l*O,r[12]=s*E+o*P+a*I+l*G,r[1]=h*b+c*S+u*R+d*D,r[5]=h*M+c*T+u*A+d*N,r[9]=h*w+c*C+u*L+d*O,r[13]=h*E+c*P+u*I+d*G,r[2]=p*b+f*S+m*R+g*D,r[6]=p*M+f*T+m*A+g*N,r[10]=p*w+f*C+m*L+g*O,r[14]=p*E+f*P+m*I+g*G,r[3]=v*b+y*S+_*R+x*D,r[7]=v*M+y*T+_*A+x*N,r[11]=v*w+y*C+_*L+x*O,r[15]=v*E+y*P+_*I+x*G,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],o=t[5],a=t[9],l=t[13],h=t[2],c=t[6],u=t[10],d=t[14];return t[3]*(+r*a*c-n*l*c-r*o*u+i*l*u+n*o*d-i*a*d)+t[7]*(+e*a*d-e*l*u+r*s*u-n*s*d+n*l*h-r*a*h)+t[11]*(+e*l*c-e*o*d-r*s*c+i*s*d+r*o*h-i*l*h)+t[15]*(-n*o*h-e*a*c+e*o*u+n*s*c-i*s*u+i*a*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=c*m*l-f*u*l+f*a*d-o*m*d-c*a*g+o*u*g,y=p*u*l-h*m*l-p*a*d+s*m*d+h*a*g-s*u*g,_=h*f*l-p*c*l+p*o*d-s*f*d-h*o*g+s*c*g,x=p*c*a-h*f*a-p*o*u+s*f*u+h*o*m-s*c*m,b=e*v+i*y+n*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/b;return t[0]=v*M,t[1]=(f*u*r-c*m*r-f*n*d+i*m*d+c*n*g-i*u*g)*M,t[2]=(o*m*r-f*a*r+f*n*l-i*m*l-o*n*g+i*a*g)*M,t[3]=(c*a*r-o*u*r-c*n*l+i*u*l+o*n*d-i*a*d)*M,t[4]=y*M,t[5]=(h*m*r-p*u*r+p*n*d-e*m*d-h*n*g+e*u*g)*M,t[6]=(p*a*r-s*m*r-p*n*l+e*m*l+s*n*g-e*a*g)*M,t[7]=(s*u*r-h*a*r+h*n*l-e*u*l-s*n*d+e*a*d)*M,t[8]=_*M,t[9]=(p*c*r-h*f*r-p*i*d+e*f*d+h*i*g-e*c*g)*M,t[10]=(s*f*r-p*o*r+p*i*l-e*f*l-s*i*g+e*o*g)*M,t[11]=(h*o*r-s*c*r-h*i*l+e*c*l+s*i*d-e*o*d)*M,t[12]=x*M,t[13]=(h*f*n-p*c*n+p*i*u-e*f*u-h*i*m+e*c*m)*M,t[14]=(p*o*n-s*f*n-p*i*a+e*f*a+s*i*m-e*o*m)*M,t[15]=(s*c*n-h*o*n+h*i*a-e*c*a-s*i*u+e*o*u)*M,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,l=r*s,h=r*o;return this.set(l*s+i,l*o-n*a,l*a+n*o,0,l*o+n*a,h*o+i,h*a-n*s,0,l*a-n*o,h*a+n*s,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,s){return this.set(1,i,r,0,t,1,s,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,s=e._y,o=e._z,a=e._w,l=r+r,h=s+s,c=o+o,u=r*l,d=r*h,p=r*c,f=s*h,m=s*c,g=o*c,v=a*l,y=a*h,_=a*c,x=i.x,b=i.y,M=i.z;return n[0]=(1-(f+g))*x,n[1]=(d+_)*x,n[2]=(p-y)*x,n[3]=0,n[4]=(d-_)*b,n[5]=(1-(u+g))*b,n[6]=(m+v)*b,n[7]=0,n[8]=(p+y)*M,n[9]=(m-v)*M,n[10]=(1-(u+f))*M,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=gi.set(n[0],n[1],n[2]).length();const s=gi.set(n[4],n[5],n[6]).length(),o=gi.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],vi.copy(this);const a=1/r,l=1/s,h=1/o;return vi.elements[0]*=a,vi.elements[1]*=a,vi.elements[2]*=a,vi.elements[4]*=l,vi.elements[5]*=l,vi.elements[6]*=l,vi.elements[8]*=h,vi.elements[9]*=h,vi.elements[10]*=h,e.setFromRotationMatrix(vi),i.x=r,i.y=s,i.z=o,this}makePerspective(t,e,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(e-t),l=2*r/(i-n),h=(e+t)/(e-t),c=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,n,r,s){const o=this.elements,a=1/(e-t),l=1/(i-n),h=1/(s-r),c=(e+t)*a,u=(i+n)*l,d=(s+r)*h;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}mi.prototype.isMatrix4=!0;const gi=new Ue,vi=new mi,yi=new Ue(0,0,0),_i=new Ue(1,1,1),xi=new Ue,bi=new Ue,Mi=new Ue,wi=new mi,Ei=new ke;class Si{constructor(t=0,e=0,i=0,n=Si.DefaultOrder){this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,r=n[0],s=n[4],o=n[8],a=n[1],l=n[5],h=n[9],c=n[2],u=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(pe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-pe(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-c,r),this._z=0);break;case"ZXY":this._x=Math.asin(pe(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-pe(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(pe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-c,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-pe(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return wi.makeRotationFromQuaternion(t),this.setFromRotationMatrix(wi,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Ei.setFromEuler(this),this.setFromQuaternion(Ei,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new Ue(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Si.prototype.isEuler=!0,Si.DefaultOrder="XYZ",Si.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Ti{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0){n.children=[];for(let e=0;e0){n.animations=[];for(let e=0;e0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),o.length>0&&(i.images=o),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h)}return i.object=n,i;function s(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){Fi.subVectors(n,e),Vi.subVectors(i,e),Hi.subVectors(t,e);const s=Fi.dot(Fi),o=Fi.dot(Vi),a=Fi.dot(Hi),l=Vi.dot(Vi),h=Vi.dot(Hi),c=s*l-o*o;if(0===c)return r.set(-2,-1,-1);const u=1/c,d=(l*a-o*h)*u,p=(s*h-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,Wi),Wi.x>=0&&Wi.y>=0&&Wi.x+Wi.y<=1}static getUV(t,e,i,n,r,s,o,a){return this.getBarycoord(t,e,i,n,Wi),a.set(0,0),a.addScaledVector(r,Wi.x),a.addScaledVector(s,Wi.y),a.addScaledVector(o,Wi.z),a}static isFrontFacing(t,e,i,n){return Fi.subVectors(i,e),Vi.subVectors(t,e),Fi.cross(Vi).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Fi.subVectors(this.c,this.b),Vi.subVectors(this.a,this.b),.5*Fi.cross(Vi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Ki.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Ki.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return Ki.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return Ki.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Ki.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,n=this.b,r=this.c;let s,o;ji.subVectors(n,i),qi.subVectors(r,i),Yi.subVectors(t,i);const a=ji.dot(Yi),l=qi.dot(Yi);if(a<=0&&l<=0)return e.copy(i);Ji.subVectors(t,n);const h=ji.dot(Ji),c=qi.dot(Ji);if(h>=0&&c<=h)return e.copy(n);const u=a*c-h*l;if(u<=0&&a>=0&&h<=0)return s=a/(a-h),e.copy(i).addScaledVector(ji,s);Zi.subVectors(t,r);const d=ji.dot(Zi),p=qi.dot(Zi);if(p>=0&&d<=p)return e.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(i).addScaledVector(qi,o);const m=h*p-d*c;if(m<=0&&c-h>=0&&d-p>=0)return Xi.subVectors(r,n),o=(c-h)/(c-h+(d-p)),e.copy(n).addScaledVector(Xi,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(i).addScaledVector(ji,s).addScaledVector(qi,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Qi=0;class $i extends le{constructor(){super(),Object.defineProperty(this,"id",{value:Qi++}),this.uuid=de(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}$i.prototype.isMaterial=!0;class tn extends $i{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Pe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}tn.prototype.isMeshBasicMaterial=!0;const en=new Ue,nn=new ye;class rn{constructor(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),yn.copy(i.boundingSphere),yn.applyMatrix4(r),!1===t.ray.intersectsSphere(yn))return;if(gn.copy(r).invert(),vn.copy(t.ray).applyMatrix4(gn),null!==i.boundingBox&&!1===vn.intersectsBox(i.boundingBox))return;let s;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative,h=i.attributes.uv,c=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=u.length;ii.far?null:{distance:h,point:In.clone(),object:t}}(t,e,i,n,_n,xn,bn,Ln);if(p){a&&(Pn.fromBufferAttribute(a,h),Rn.fromBufferAttribute(a,c),An.fromBufferAttribute(a,u),p.uv=Ki.getUV(Ln,_n,xn,bn,Pn,Rn,An,new ye)),l&&(Pn.fromBufferAttribute(l,h),Rn.fromBufferAttribute(l,c),An.fromBufferAttribute(l,u),p.uv2=Ki.getUV(Ln,_n,xn,bn,Pn,Rn,An,new ye));const t={a:h,b:c,c:u,normal:new Ue,materialIndex:0};Ki.getNormal(_n,xn,bn,t.normal),p.face=t}return p}Dn.prototype.isMesh=!0;class On extends mn{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const o=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const a=[],l=[],h=[],c=[];let u=0,d=0;function p(t,e,i,n,r,s,p,f,m,g,v){const y=s/m,_=p/g,x=s/2,b=p/2,M=f/2,w=m+1,E=g+1;let S=0,T=0;const C=new Ue;for(let s=0;s0?1:-1,h.push(C.x,C.y,C.z),c.push(a/m),c.push(1-s/g),S+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}Bn.prototype.isShaderMaterial=!0;class zn extends zi{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new mi,this.projectionMatrix=new mi,this.projectionMatrixInverse=new mi}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}zn.prototype.isCamera=!0;class Fn extends zn{constructor(t=50,e=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*ue*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*ce*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*ue*Math.atan(Math.tan(.5*ce*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,n,r,s){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*ce*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/o,n*=s.width/t,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}Fn.prototype.isPerspectiveCamera=!0;class Vn extends zi{constructor(t,e,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new Fn(90,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new Ue(1,0,0)),this.add(n);const r=new Fn(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Ue(-1,0,0)),this.add(r);const s=new Fn(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ue(0,1,0)),this.add(s);const o=new Fn(90,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Ue(0,-1,0)),this.add(o);const a=new Fn(90,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Ue(0,0,1)),this.add(a);const l=new Fn(90,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ue(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,s,o,a,l]=this.children,h=t.xr.enabled,c=t.getRenderTarget();t.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(c),t.xr.enabled=h,i.texture.needsPMREMUpdate=!0}}class Hn extends Ie{constructor(t,e,i,n,r,s,o,a,l,h){super(t=void 0!==t?t:[],e=void 0!==e?e:301,i,n,r,s,o,a,l,h),this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}Hn.prototype.isCubeTexture=!0;class Wn extends Oe{constructor(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),super(t,t,e),e=e||{},this.texture=new Hn(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:1006}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=1023,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={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 \n\t\t\t\t\t#include \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 \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"},n=new On(5,5,5),r=new Bn({name:"CubemapFromEquirect",uniforms:Gn(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Dn(n,r),o=e.minFilter;1008===e.minFilter&&(e.minFilter=1006);return new Vn(1,10,this).update(t,s),e.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}Wn.prototype.isWebGLCubeRenderTarget=!0;const jn=new Ue,qn=new Ue,Xn=new _e;class Yn{constructor(t=new Ue(1,0,0),e=0){this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=jn.subVectors(i,e).cross(qn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta(jn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||Xn.getNormalMatrix(t),n=this.coplanarPoint(jn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Yn.prototype.isPlane=!0;const Jn=new oi,Zn=new Ue;class Kn{constructor(t=new Yn,e=new Yn,i=new Yn,n=new Yn,r=new Yn,s=new Yn){this.planes=[t,e,i,n,r,s]}set(t,e,i,n,r,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6],c=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,c-a,f-u,y-m).normalize(),e[1].setComponents(o+n,c+a,f+u,y+m).normalize(),e[2].setComponents(o+r,c+l,f+d,y+g).normalize(),e[3].setComponents(o-r,c-l,f-d,y-g).normalize(),e[4].setComponents(o-s,c-h,f-p,y-v).normalize(),e[5].setComponents(o+s,c+h,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Jn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Jn)}intersectsSprite(t){return Jn.center.set(0,0,0),Jn.radius=.7071067811865476,Jn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Jn)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)0?t.max.x:t.min.x,Zn.y=n.normal.y>0?t.max.y:t.min.y,Zn.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Zn)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Qn(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function $n(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version 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}\nfloat 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}\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",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + 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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\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 )\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 )\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",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; }\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 color ) { return dot( color, vec3( 0.3333 ) ); }\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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\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}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\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}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.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\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\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\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\treturn texture2D( envMap, uv ).rgb;\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + 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 ), m0, cubeUV_maxMipLevel );\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_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 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, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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\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 )\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 )\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:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#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\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\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\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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 GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\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( ( ior - 1.0 ) / ( 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, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\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}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\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:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\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, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\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#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\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\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_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\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, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).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( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\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 OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( 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( 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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - 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_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, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#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 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\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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 shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\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 shadow;\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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#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 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 mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\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.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.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ 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.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\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\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, vUv );\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 toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( 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}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\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\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 framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\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 ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\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;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \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 \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 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 SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},ir={common:{diffuse:{value:new Pe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new _e},uv2Transform:{value:new _e},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ye(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new _e}},sprite:{diffuse:{value:new Pe(16777215)},opacity:{value:1},center:{value:new ye(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new _e}}},nr={basic:{uniforms:kn([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.fog]),vertexShader:er.meshbasic_vert,fragmentShader:er.meshbasic_frag},lambert:{uniforms:kn([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.fog,ir.lights,{emissive:{value:new Pe(0)}}]),vertexShader:er.meshlambert_vert,fragmentShader:er.meshlambert_frag},phong:{uniforms:kn([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.fog,ir.lights,{emissive:{value:new Pe(0)},specular:{value:new Pe(1118481)},shininess:{value:30}}]),vertexShader:er.meshphong_vert,fragmentShader:er.meshphong_frag},standard:{uniforms:kn([ir.common,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.roughnessmap,ir.metalnessmap,ir.fog,ir.lights,{emissive:{value:new Pe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag},toon:{uniforms:kn([ir.common,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.gradientmap,ir.fog,ir.lights,{emissive:{value:new Pe(0)}}]),vertexShader:er.meshtoon_vert,fragmentShader:er.meshtoon_frag},matcap:{uniforms:kn([ir.common,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.fog,{matcap:{value:null}}]),vertexShader:er.meshmatcap_vert,fragmentShader:er.meshmatcap_frag},points:{uniforms:kn([ir.points,ir.fog]),vertexShader:er.points_vert,fragmentShader:er.points_frag},dashed:{uniforms:kn([ir.common,ir.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:er.linedashed_vert,fragmentShader:er.linedashed_frag},depth:{uniforms:kn([ir.common,ir.displacementmap]),vertexShader:er.depth_vert,fragmentShader:er.depth_frag},normal:{uniforms:kn([ir.common,ir.bumpmap,ir.normalmap,ir.displacementmap,{opacity:{value:1}}]),vertexShader:er.meshnormal_vert,fragmentShader:er.meshnormal_frag},sprite:{uniforms:kn([ir.sprite,ir.fog]),vertexShader:er.sprite_vert,fragmentShader:er.sprite_frag},background:{uniforms:{uvTransform:{value:new _e},t2D:{value:null}},vertexShader:er.background_vert,fragmentShader:er.background_frag},cube:{uniforms:kn([ir.envmap,{opacity:{value:1}}]),vertexShader:er.cube_vert,fragmentShader:er.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:er.equirect_vert,fragmentShader:er.equirect_frag},distanceRGBA:{uniforms:kn([ir.common,ir.displacementmap,{referencePosition:{value:new Ue},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:er.distanceRGBA_vert,fragmentShader:er.distanceRGBA_frag},shadow:{uniforms:kn([ir.lights,ir.fog,{color:{value:new Pe(0)},opacity:{value:1}}]),vertexShader:er.shadow_vert,fragmentShader:er.shadow_frag}};function rr(t,e,i,n,r,s){const o=new Pe(0);let a,l,h=!0===r?0:1,c=null,u=0,d=null;function p(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,s)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),h=e,p(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,p(o,h)},render:function(i,r){let s=!1,f=!0===r.isScene?r.background:null;f&&f.isTexture&&(f=e.get(f));const m=t.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(f=null),null===f?p(o,h):f&&f.isColor&&(p(f,1),s=!0),(t.autoClear||s)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||306===f.mapping)?(void 0===l&&(l=new Dn(new On(1,1,1),new Bn({name:"BackgroundCubeMaterial",uniforms:Gn(nr.cube.uniforms),vertexShader:nr.cube.vertexShader,fragmentShader:nr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=f,l.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,c===f&&u===f.version&&d===t.toneMapping||(l.material.needsUpdate=!0,c=f,u=f.version,d=t.toneMapping),i.unshift(l,l.geometry,l.material,0,0,null)):f&&f.isTexture&&(void 0===a&&(a=new Dn(new tr(2,2),new Bn({name:"BackgroundMaterial",uniforms:Gn(nr.background.uniforms),vertexShader:nr.background.vertexShader,fragmentShader:nr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),a.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&u===f.version&&d===t.toneMapping||(a.material.needsUpdate=!0,c=f,u=f.version,d=t.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null))}}}function sr(t,e,i,n){const r=t.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},l=d(null);let h=l;function c(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function u(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function d(t){const e=[],i=[],n=[];for(let t=0;t=0){let s=l[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const e=s.normalized,o=s.itemSize,l=i.get(s);if(void 0===l)continue;const h=l.buffer,c=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,l=i.stride,d=s.offset;if(i&&i.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==i.precision?i.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),h=!0===i.logarithmicDepthBuffer,c=t.getParameter(34930),u=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),y=u>0,_=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:h,maxTextures:c,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:y&&_,maxSamples:s?t.getParameter(36183):0}}function lr(t){const e=this;let i=null,n=0,r=!1,s=!1;const o=new Yn,a=new _e,l={value:null,needsUpdate:!1};function h(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,i,n,r){const s=null!==t?t.length:0;let h=null;if(0!==s){if(h=l.value,!0!==r||null===h){const e=n+4*s,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===h||h.length0){const o=new Wn(s.height/2);return o.fromEquirectangularTexture(t,r),e.set(r,o),r.addEventListener("dispose",n),i(o.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}nr.physical={uniforms:kn([nr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ye(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Pe(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Pe(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Pe(1,1,1)},specularColorMap:{value:null}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag};class cr extends zn{constructor(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,s){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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,s=i+t,o=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}cr.prototype.isOrthographicCamera=!0;class ur extends Bn{constructor(t){super(t),this.type="RawShaderMaterial"}}ur.prototype.isRawShaderMaterial=!0;const dr=Math.pow(2,8),pr=[.125,.215,.35,.446,.526,.582],fr=5+pr.length,mr=new cr,{_lodPlanes:gr,_sizeLods:vr,_sigmas:yr}=Sr(),_r=new Pe;let xr=null;const br=(1+Math.sqrt(5))/2,Mr=1/br,wr=[new Ue(1,1,1),new Ue(-1,1,1),new Ue(1,1,-1),new Ue(-1,1,-1),new Ue(0,br,Mr),new Ue(0,br,-Mr),new Ue(Mr,0,br),new Ue(-Mr,0,br),new Ue(br,Mr,0),new Ue(-br,Mr,0)];class Er{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const e=new Float32Array(t),i=new Ue(0,1,0);return new ur({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ar(),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 \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})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){xr=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=Rr(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=Pr(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t2?dr:0,dr,dr),a.setRenderTarget(n),d&&a.render(u,r),a.render(t,r)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=h,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const i=this._renderer,n=301===t.mapping||302===t.mapping;n?(null===this._cubemapShader&&(this._cubemapShader=Rr()),this._cubemapShader.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectShader&&(this._equirectShader=Pr());const r=n?this._cubemapShader:this._equirectShader,s=new Dn(gr[0],r),o=r.uniforms;o.envMap.value=t,n||o.texelSize.value.set(1/t.image.width,1/t.image.height),Cr(e,0,0,3*dr,2*dr),i.setRenderTarget(e),i.render(s,mr)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,i=Math.exp(-e*e/2);m.push(i),0===t?g+=i:t4?n-8+4:0),3*v,2*v),a.setRenderTarget(e),a.render(h,mr)}}function Sr(){const t=[],e=[],i=[];let n=8;for(let r=0;r4?o=pr[r-8+4-1]:0===r&&(o=0),i.push(o);const a=1/(s-1),l=-a/2,h=1+a/2,c=[l,l,h,l,h,h,l,l,h,h,l,h],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,p*d*t),v.set(c,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const _=new mn;_.setAttribute("position",new rn(g,p)),_.setAttribute("uv",new rn(v,f)),_.setAttribute("faceIndex",new rn(y,m)),t.push(_),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function Tr(t){const e=new Oe(3*dr,3*dr,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Cr(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Pr(){const t=new ye(1,1);return new ur({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:t}},vertexShader:Ar(),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 vec2 texelSize;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = texture2D ( envMap, uv ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Rr(){return new ur({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ar(),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 Ar(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\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 Lr(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,o=303===s||304===s,a=301===s||302===s;if(o||a){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let n=e.get(r);return null===i&&(i=new Er(t)),n=o?i.fromEquirectangular(r,n):i.fromCubemap(r,n),e.set(r,n),n.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let i=0;i<6;i++)void 0!==t[i]&&e++;return 6===e}(s)){null===i&&(i=new Er(t));const s=o?i.fromEquirectangular(r):i.fromCubemap(r);return e.set(r,s),r.addEventListener("dispose",n),s.texture}return null}}}return r},dispose:function(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function Ir(t){const e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Dr(t,e,i,n){const r={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",o),delete r[a.id];const l=s.get(a);l&&(e.remove(l),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],n=t.index,r=t.attributes.position;let o=0;if(null!==n){const t=n.array;o=n.version;for(let e=0,n=t.length;ee.maxTextureSize&&(u=Math.ceil(c/e.maxTextureSize),c=e.maxTextureSize);const d=new Float32Array(c*u*4*n),p=new Gr(d,c,u,n);p.format=1023,p.type=1015,p.needsUpdate=!0;const f=4*l;for(let e=0;e0)return t;const r=e*i;let s=Xr[r];if(void 0===s&&(s=new Float32Array(r),Xr[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function $r(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i/gm;function io(t){return t.replace(eo,no)}function no(t,e){const i=er[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return io(i)}const ro=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,so=/#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 oo(t){return t.replace(so,lo).replace(ro,ao)}function ao(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),lo(t,e,i,n)}function lo(t,e,i,n){let r="";for(let t=parseInt(e);t0&&(m+="\n"),g=[d,p].filter(Qs).join("\n"),g.length>0&&(g+="\n")):(m=[ho(i),"#define SHADER_NAME "+i.shaderName,p,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Qs).join("\n"),g=[d,ho(i),"#define SHADER_NAME "+i.shaderName,p,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.envMap?"#define "+c:"",i.envMap?"#define "+u:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?er.tonemapping_pars_fragment:"",0!==i.toneMapping?Ks("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.transparent?"":"#define OPAQUE",er.encodings_pars_fragment,Zs("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Qs).join("\n")),o=io(o),o=$s(o,i),o=to(o,i),a=io(a),a=$s(a,i),a=to(a,i),o=oo(o),a=oo(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(v="#version 300 es\n",m=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#define varying in","300 es"===i.glslVersion?"":"layout(location = 0) out highp vec4 pc_fragColor;","300 es"===i.glslVersion?"":"#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"+g);const y=v+g+a,_=Xs(r,35633,v+m+o),x=Xs(r,35632,y);if(r.attachShader(f,_),r.attachShader(f,x),void 0!==i.index0AttributeName?r.bindAttribLocation(f,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(f,0,"position"),r.linkProgram(f),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(f).trim(),e=r.getShaderInfoLog(_).trim(),i=r.getShaderInfoLog(x).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(f,35714)){n=!1;const e=Js(r,_,"vertex"),i=Js(r,x,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:m},fragmentShader:{log:i,prefix:g}})}let b,M;return r.deleteShader(_),r.deleteShader(x),this.getUniforms=function(){return void 0===b&&(b=new qs(r,f)),b},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r0,A=s.clearcoat>0;return{isWebGL2:c,shaderID:M,shaderName:s.type,vertexShader:E,fragmentShader:S,defines:s.defines,customVertexShaderID:T,customFragmentShaderID:C,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:f,outputEncoding:null===P?t.outputEncoding:!0===P.isXRRenderTarget?P.texture.encoding:3e3,map:!!s.map,matcap:!!s.matcap,envMap:!!b,envMapMode:b&&b.mapping,envMapCubeUV:!!b&&(306===b.mapping||307===b.mapping),lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:1===s.normalMapType,tangentSpaceNormalMap:0===s.normalMapType,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&3001===s.map.encoding,clearcoat:A,clearcoatMap:A&&!!s.clearcoatMap,clearcoatRoughnessMap:A&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:A&&!!s.clearcoatNormalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,transparent:s.transparent,alphaMap:!!s.alphaMap,alphaTest:R,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!y.geometry&&!!y.geometry.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!y.geometry&&!!y.geometry.attributes.color&&4===y.geometry.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!_,useFog:s.fog,fogExp2:_&&_.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===y.isSkinnedMesh&&w>0,maxBones:w,useVertexTexture:d,morphTargets:!!y.geometry&&!!y.geometry.morphAttributes.position,morphNormals:!!y.geometry&&!!y.geometry.morphAttributes.normal,morphTargetsCount:y.geometry&&y.geometry.morphAttributes.position?y.geometry.morphAttributes.position.length:0,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,depthPacking:void 0!==s.depthPacking&&s.depthPacking,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.maxBones),t.push(e.morphTargetsCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection)}(i,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0);e.supportsVertexTextures&&a.enable(1);e.instancing&&a.enable(2);e.instancingColor&&a.enable(3);e.map&&a.enable(4);e.matcap&&a.enable(5);e.envMap&&a.enable(6);e.envMapCubeUV&&a.enable(7);e.lightMap&&a.enable(8);e.aoMap&&a.enable(9);e.emissiveMap&&a.enable(10);e.bumpMap&&a.enable(11);e.normalMap&&a.enable(12);e.objectSpaceNormalMap&&a.enable(13);e.tangentSpaceNormalMap&&a.enable(14);e.clearcoat&&a.enable(15);e.clearcoatMap&&a.enable(16);e.clearcoatRoughnessMap&&a.enable(17);e.clearcoatNormalMap&&a.enable(18);e.displacementMap&&a.enable(19);e.specularMap&&a.enable(20);e.roughnessMap&&a.enable(21);e.metalnessMap&&a.enable(22);e.gradientMap&&a.enable(23);e.alphaMap&&a.enable(24);e.alphaTest&&a.enable(25);e.vertexColors&&a.enable(26);e.vertexAlphas&&a.enable(27);e.vertexUvs&&a.enable(28);e.vertexTangents&&a.enable(29);e.uvsVertexOnly&&a.enable(30);e.fog&&a.enable(31);t.push(a.mask),a.disableAll(),e.useFog&&a.enable(0);e.flatShading&&a.enable(1);e.logarithmicDepthBuffer&&a.enable(2);e.skinning&&a.enable(3);e.useVertexTexture&&a.enable(4);e.morphTargets&&a.enable(5);e.morphNormals&&a.enable(6);e.premultipliedAlpha&&a.enable(7);e.shadowMapEnabled&&a.enable(8);e.physicallyCorrectLights&&a.enable(9);e.doubleSided&&a.enable(10);e.flipSided&&a.enable(11);e.depthPacking&&a.enable(12);e.dithering&&a.enable(13);e.specularIntensityMap&&a.enable(14);e.specularColorMap&&a.enable(15);e.transmission&&a.enable(16);e.transmissionMap&&a.enable(17);e.thicknessMap&&a.enable(18);e.sheen&&a.enable(19);e.sheenColorMap&&a.enable(20);e.sheenRoughnessMap&&a.enable(21);e.decodeVideoTexture&&a.enable(22);e.transparent&&a.enable(23);t.push(a.mask)}(i,e),i.push(t.outputEncoding)),i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=g[t.type];let i;if(e){const t=nr[e];i=Un.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=h.length;t0?n.push(c):!0===o.transparent?r.push(c):i.push(c)},unshift:function(t,e,o,a,l,h){const c=s(t,e,o,a,l,h);o.transmission>0?n.unshift(c):!0===o.transparent?r.unshift(c):i.unshift(c)},finish:function(){for(let i=e,n=t.length;i1&&i.sort(t||vo),n.length>1&&n.sort(e||yo),r.length>1&&r.sort(e||yo)}}}function xo(){let t=new WeakMap;return{get:function(e,i){let n;return!1===t.has(e)?(n=new _o,t.set(e,[n])):i>=t.get(e).length?(n=new _o,t.get(e).push(n)):n=t.get(e)[i],n},dispose:function(){t=new WeakMap}}}function bo(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new Ue,color:new Pe};break;case"SpotLight":i={position:new Ue,direction:new Ue,color:new Pe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ue,color:new Pe,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ue,skyColor:new Pe,groundColor:new Pe};break;case"RectAreaLight":i={color:new Pe,position:new Ue,halfWidth:new Ue,halfHeight:new Ue}}return t[e.id]=i,i}}}let Mo=0;function wo(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Eo(t,e){const i=new bo,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new Ue);const s=new Ue,o=new mi,a=new mi;return{setup:function(s,o){let a=0,l=0,h=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let c=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0;s.sort(wo);const y=!0!==o?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=ir.LTC_FLOAT_1,r.rectAreaLTC2=ir.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=ir.LTC_HALF_1,r.rectAreaLTC2=ir.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=h;const _=r.hash;_.directionalLength===c&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===p&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===v||(r.directional.length=c,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,_.directionalLength=c,_.pointLength=u,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=v,r.version=Mo++)},setupView:function(t,e){let i=0,n=0,l=0,h=0,c=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=i.get(n).length?(s=new So(t,e),i.get(n).push(s)):s=i.get(n)[r],s},dispose:function(){i=new WeakMap}}}class Co extends $i{constructor(t){super(),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.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}Co.prototype.isMeshDepthMaterial=!0;class Po extends $i{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new Ue,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}Po.prototype.isMeshDistanceMaterial=!0;function Ro(t,e,i){let n=new Kn;const r=new ye,s=new ye,o=new Ne,a=new Co({depthPacking:3201}),l=new Po,h={},c=i.maxTextureSize,u={0:1,1:0,2:2},d=new Bn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ye},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 \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}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const f=new mn;f.setAttribute("position",new rn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Dn(f,d),g=this;function v(i,n){const r=e.update(m);d.defines.VSM_SAMPLES!==i.blurSamples&&(d.defines.VSM_SAMPLES=i.blurSamples,p.defines.VSM_SAMPLES=i.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,d,m,null),p.uniforms.shadow_pass.value=i.mapPass.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,p,m,null)}function y(e,i,n,r,s,o,c){let d=null;const p=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(d=void 0!==p?p:!0===r.isPointLight?l:a,t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const t=d.uuid,e=n.uuid;let i=h[t];void 0===i&&(i={},h[t]=i);let r=i[e];void 0===r&&(r=d.clone(),i[e]=r),d=r}return d.visible=n.visible,d.wireframe=n.wireframe,d.side=3===c?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],d.alphaMap=n.alphaMap,d.alphaTest=n.alphaTest,d.clipShadows=n.clipShadows,d.clippingPlanes=n.clippingPlanes,d.clipIntersection=n.clipIntersection,d.displacementMap=n.displacementMap,d.displacementScale=n.displacementScale,d.displacementBias=n.displacementBias,d.wireframeLinewidth=n.wireframeLinewidth,d.linewidth=n.linewidth,!0===r.isPointLight&&!0===d.isMeshDistanceMaterial&&(d.referencePosition.setFromMatrixPosition(r.matrixWorld),d.nearDistance=s,d.farDistance=o),d}function _(i,r,s,o,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===a)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,h=e.length;lc||r.y>c)&&(r.x>c&&(s.x=Math.floor(c/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>c&&(s.y=Math.floor(c/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const t={minFilter:1006,magFilter:1006,format:1023};u.map=new Oe(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.mapPass=new Oe(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:1003,magFilter:1003,format:1023};u.map=new Oe(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const f=u.getViewportCount();for(let t=0;t=1):-1!==R.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),C=P>=2);let A=null,L={};const I=t.getParameter(3088),D=t.getParameter(2978),N=(new Ne).fromArray(I),O=(new Ne).fromArray(D);function G(e,i,n){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;en||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?ve:Math.floor,s=n(r*t.width),o=n(r*t.height);void 0===f&&(f=g(s,o));const a=i?g(s,o):f;a.width=s,a.height=o;return a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return ge(t.width)&&ge(t.height)}function _(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function x(e){t.generateMipmap(e)}function b(i,n,r,s,o=!1){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let l=n;return 6403===n&&(5126===r&&(l=33326),5131===r&&(l=33325),5121===r&&(l=33321)),33319===n&&(5126===r&&(l=33328),5131===r&&(l=33327),5121===r&&(l=33323)),6408===n&&(5126===r&&(l=34836),5131===r&&(l=34842),5121===r&&(l=3001===s&&!1===o?35907:32856),32819===r&&(l=32854),32820===r&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||e.get("EXT_color_buffer_float"),l}function M(t,e,i){return!0===_(t,i)||t.isFramebufferTexture&&1003!==t.minFilter&&1006!==t.minFilter?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function w(t){return 1003===t||1004===t||1005===t?9728:9729}function E(e){const i=e.target;i.removeEventListener("dispose",E),function(e){const i=n.get(e);if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture),n.remove(e)}(i),i.isVideoTexture&&p.delete(i),o.memory.textures--}function S(e){const i=e.target;i.removeEventListener("dispose",S),function(e){const i=e.texture,r=n.get(e),s=n.get(i);if(!e)return;void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void D(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function P(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?function(e,n,r){if(6!==n.image.length)return;I(e,n),i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const o=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),l=n.image[0]&&n.image[0].isDataTexture,c=[];for(let t=0;t<6;t++)c[t]=o||l?l?n.image[t].image:n.image[t]:v(n.image[t],!1,!0,h),c[t]=U(n,c[t]);const u=c[0],d=y(u)||a,p=s.convert(n.format,n.encoding),f=s.convert(n.type),m=b(n.internalFormat,p,f,n.encoding),g=a&&!0!==n.isVideoTexture,w=void 0===e.__version;let E,S=M(n,u,d);if(L(34067,n,d),o){g&&w&&i.texStorage2D(34067,S,m,u.width,u.height);for(let t=0;t<6;t++){E=c[t].mipmaps;for(let e=0;e0&&S++,i.texStorage2D(34067,S,m,c[0].width,c[0].height));for(let t=0;t<6;t++)if(l){g?i.texSubImage2D(34069+t,0,0,0,c[t].width,c[t].height,p,f,c[t].data):i.texImage2D(34069+t,0,m,c[t].width,c[t].height,0,p,f,c[t].data);for(let e=0;e1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function I(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",E),e.__webglTexture=t.createTexture(),o.memory.textures++)}function D(e,n,r){let o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),I(e,n),i.activeTexture(33984+r),i.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const l=function(t){return!a&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(n)&&!1===y(n.image);let h=v(n.image,l,!1,c);h=U(n,h);const u=y(h)||a,d=s.convert(n.format,n.encoding);let p,f=s.convert(n.type),m=b(n.internalFormat,d,f,n.encoding,n.isVideoTexture);L(o,n,u);const g=n.mipmaps,w=a&&!0!==n.isVideoTexture,E=void 0===e.__version,S=M(n,h,u);if(n.isDepthTexture)m=6402,a?m=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===m&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,f=s.convert(n.type)),1027===n.format&&6402===m&&(m=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,f=s.convert(n.type))),w&&E?i.texStorage2D(3553,1,m,h.width,h.height):i.texImage2D(3553,0,m,h.width,h.height,0,d,f,null);else if(n.isDataTexture)if(g.length>0&&u){w&&E&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t0&&u){w&&E&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),T+=1,t},this.resetTextureUnits=function(){T=0},this.setTexture2D=C,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?D(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?D(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=P,this.rebindTextures=function(t,e,i){const r=n.get(t);void 0!==e&&N(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==i&&G(t)},this.setupRenderTarget=function(e){const l=e.texture,h=n.get(e),c=n.get(l);e.addEventListener("dispose",S),!0!==e.isWebGLMultipleRenderTargets&&(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=l.version,o.memory.textures++);const u=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=l.isDataTexture3D||l.isDataTexture2DArray,f=y(e)||a;if(u){h.__webglFramebuffer=[];for(let e=0;e<6;e++)h.__webglFramebuffer[e]=t.createFramebuffer()}else if(h.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){const i=e.texture;for(let e=0,r=i.length;ea+h?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=a-h&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}class ko extends Ie{constructor(t,e,i,n,r,s,o,a,l,h){if(1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),super(null,n,r,s,o,a,h,i,l),this.image={width:t,height:e},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==a?a:1003,this.flipY=!1,this.generateMipmaps=!1}}ko.prototype.isDepthTexture=!0;class Uo extends le{constructor(t,e){super();const i=this;let n=null,r=1,s=null,o="local-floor";const a=t.extensions.has("WEBGL_multisampled_render_to_texture");let l=null,h=null,c=null,u=null,d=!1,p=null;const f=e.getContextAttributes();let m=null,g=null;const v=[],y=new Map,_=new Fn;_.layers.enable(1),_.viewport=new Ne;const x=new Fn;x.layers.enable(2),x.viewport=new Ne;const b=[_,x],M=new Do;M.layers.enable(1),M.layers.enable(2);let w=null,E=null;function S(t){const e=y.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function T(){y.forEach((function(t,e){t.disconnect(e)})),y.clear(),w=null,E=null,t.setRenderTarget(m),u=null,c=null,h=null,n=null,g=null,I.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function C(t){const e=n.inputSources;for(let t=0;t0&&(e.alphaTest.value=i.alphaTest);const n=t.get(i).envMap;let r,s;n&&(e.envMap.value=n,e.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap?r=i.emissiveMap:i.clearcoatMap?r=i.clearcoatMap:i.clearcoatNormalMap?r=i.clearcoatNormalMap:i.clearcoatRoughnessMap?r=i.clearcoatRoughnessMap:i.specularIntensityMap?r=i.specularIntensityMap:i.specularColorMap?r=i.specularColorMap:i.transmissionMap?r=i.transmissionMap:i.thicknessMap?r=i.thicknessMap:i.sheenColorMap?r=i.sheenColorMap:i.sheenRoughnessMap&&(r=i.sheenRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),i.aoMap?s=i.aoMap:i.lightMap&&(s=i.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uv2Transform.value.copy(s.matrix))}function i(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,s,o){n.isMeshBasicMaterial?e(t,n):n.isMeshLambertMaterial?(e(t,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,n)):n.isMeshToonMaterial?(e(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshPhongMaterial?(e(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshStandardMaterial?(e(t,n),n.isMeshPhysicalMaterial?function(t,e,n){i(t,e),t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap);e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}(t,n,o):i(t,n)):n.isMeshMatcapMaterial?(e(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDepthMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDistanceMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?(e(t,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,s):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function zo(t={}){const e=void 0!==t.canvas?t.canvas:function(){const t=be("canvas");return t.style.display="block",t}(),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,s=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,h=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let u=null,d=null;const p=[],f=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const m=this;let g=!1,v=0,y=0,_=null,x=-1,b=null;const M=new Ne,w=new Ne;let E=null,S=e.width,T=e.height,C=1,P=null,R=null;const A=new Ne(0,0,S,T),L=new Ne(0,0,S,T);let I=!1;const D=new Kn;let N=!1,O=!1,G=null;const k=new mi,U=new Ue,B={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function z(){return null===_?C:1}let F,V,H,W,j,q,X,Y,J,Z,K,Q,$,tt,et,it,nt,rt,st,ot,at,lt,ht,ct=i;function ut(t,i){for(let n=0;n0&&function(t,e,i){if(null===G){const t=!0===o&&!0===V.isWebGL2;G=new(t?Ge:Oe)(1024,1024,{generateMipmaps:!0,type:null!==lt.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001,useRenderToTexture:F.has("WEBGL_multisampled_render_to_texture")})}const n=m.getRenderTarget();m.setRenderTarget(G),m.clear();const r=m.toneMapping;m.toneMapping=0,Mt(t,e,i),m.toneMapping=r,q.updateMultisampleRenderTarget(G),q.updateRenderTargetMipmap(G),m.setRenderTarget(n)}(r,e,i),n&&H.viewport(M.copy(n)),r.length>0&&Mt(r,e,i),s.length>0&&Mt(s,e,i),a.length>0&&Mt(a,e,i)}function Mt(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?f[f.length-1]:null,p.pop(),u=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return _},this.setRenderTargetTextures=function(t,e,i){j.get(t.texture).__webglTexture=e,j.get(t.depthTexture).__webglTexture=i;const n=j.get(t);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||t.useRenderToTexture&&(console.warn("render-to-texture extension was disabled because an external texture was provided"),t.useRenderToTexture=!1,t.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(t,e){const i=j.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){_=t,v=e,y=i;let n=!0;if(t){const e=j.get(t);void 0!==e.__useDefaultFramebuffer?(H.bindFramebuffer(36160,null),n=!1):void 0===e.__webglFramebuffer?q.setupRenderTarget(t):e.__hasExternalTextures&&q.rebindTextures(t,j.get(t.texture).__webglTexture,j.get(t.depthTexture).__webglTexture)}let r=null,s=!1,o=!1;if(t){const i=t.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(o=!0);const n=j.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=n[e],s=!0):r=t.useRenderbuffer?j.get(t).__webglMultisampledFramebuffer:n,M.copy(t.viewport),w.copy(t.scissor),E=t.scissorTest}else M.copy(A).multiplyScalar(C).floor(),w.copy(L).multiplyScalar(C).floor(),E=I;if(H.bindFramebuffer(36160,r)&&V.drawBuffers&&n&&H.drawBuffers(t,r),H.viewport(M),H.scissor(w),H.setScissorTest(E),s){const n=j.get(t.texture);ct.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(o){const n=j.get(t.texture),r=e||0;ct.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}x=-1},this.readRenderTargetPixels=function(t,e,i,n,r,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=j.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){H.bindFramebuffer(36160,a);try{const o=t.texture,a=o.format,l=o.type;if(1023!==a&<.convert(a)!==ct.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=1016===l&&(F.has("EXT_color_buffer_half_float")||V.isWebGL2&&F.has("EXT_color_buffer_float"));if(!(1009===l||lt.convert(l)===ct.getParameter(35738)||1015===l&&(V.isWebGL2||F.has("OES_texture_float")||F.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ct.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&ct.readPixels(e,i,n,r,lt.convert(a),lt.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const t=null!==_?j.get(_).__webglFramebuffer:null;H.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){if(!0!==e.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n);q.setTexture2D(e,0),ct.copyTexSubImage2D(3553,i,0,0,t.x,t.y,r,s),H.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,o=lt.convert(i.format),a=lt.convert(i.type);q.setTexture2D(i,0),ct.pixelStorei(37440,i.flipY),ct.pixelStorei(37441,i.premultiplyAlpha),ct.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?ct.texSubImage2D(3553,n,t.x,t.y,r,s,o,a,e.image.data):e.isCompressedTexture?ct.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):ct.texSubImage2D(3553,n,t.x,t.y,o,a,e.image),0===n&&i.generateMipmaps&&ct.generateMipmap(3553),H.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(m.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=lt.convert(n.format),h=lt.convert(n.type);let c;if(n.isDataTexture3D)q.setTexture3D(n,0),c=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");q.setTexture2DArray(n,0),c=35866}ct.pixelStorei(37440,n.flipY),ct.pixelStorei(37441,n.premultiplyAlpha),ct.pixelStorei(3317,n.unpackAlignment);const u=ct.getParameter(3314),d=ct.getParameter(32878),p=ct.getParameter(3316),f=ct.getParameter(3315),g=ct.getParameter(32877),v=i.isCompressedTexture?i.mipmaps[0]:i.image;ct.pixelStorei(3314,v.width),ct.pixelStorei(32878,v.height),ct.pixelStorei(3316,t.min.x),ct.pixelStorei(3315,t.min.y),ct.pixelStorei(32877,t.min.z),i.isDataTexture||i.isDataTexture3D?ct.texSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,h,v.data):i.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ct.compressedTexSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,v.data)):ct.texSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,h,v),ct.pixelStorei(3314,u),ct.pixelStorei(32878,d),ct.pixelStorei(3316,p),ct.pixelStorei(3315,f),ct.pixelStorei(32877,g),0===r&&n.generateMipmaps&&ct.generateMipmap(c),H.unbindTexture()},this.initTexture=function(t){q.setTexture2D(t,0),H.unbindTexture()},this.resetState=function(){v=0,y=0,_=null,H.reset(),ht.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}zo.prototype.isWebGLRenderer=!0;(class extends zo{}).prototype.isWebGL1Renderer=!0;class Fo{constructor(t,e=25e-5){this.name="",this.color=new Pe(t),this.density=e}clone(){return new Fo(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Fo.prototype.isFogExp2=!0;class Vo{constructor(t,e=1,i=1e3){this.name="",this.color=new Pe(t),this.near=e,this.far=i}clone(){return new Vo(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Vo.prototype.isFog=!0;class Ho extends zi{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}Ho.prototype.isScene=!0;class Wo{constructor(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=de()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;nt.far||e.push({distance:a,point:Jo.clone(),uv:Ki.getUV(Jo,ea,ia,na,ra,sa,oa,new ye),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function la(t,e,i,n,r,s){Qo.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?($o.x=s*Qo.x-r*Qo.y,$o.y=r*Qo.x+s*Qo.y):$o.copy(Qo),t.copy(e),t.x+=$o.x,t.y+=$o.y,t.applyMatrix4(ta)}aa.prototype.isSprite=!0;const ha=new Ue,ca=new Ne,ua=new Ne,da=new Ue,pa=new mi;class fa extends Dn{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new mi,this.bindMatrixInverse=new mi}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Ne,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;ia)continue;u.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(u);dt.far||e.push({distance:d,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,s.start),n=Math.min(r.count,s.start+s.count)-1;ia)continue;u.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(u);nt.far||e.push({distance:n,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Ra.prototype.isLine=!0;const Aa=new Ue,La=new Ue;class Ia extends Ra{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function za(t,e,i,n,r,s,o){const a=Ga.distanceSqToPoint(t);if(ar.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:o})}}Ba.prototype.isPoints=!0;(class extends Ie{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.minFilter=void 0!==s?s:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){h.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}).prototype.isVideoTexture=!0;(class extends Ie{constructor(t,e,i){super({width:t,height:e}),this.format=i,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}).prototype.isFramebufferTexture=!0;class Fa extends Ie{constructor(t,e,i,n,r,s,o,a,l,h,c,u){super(null,s,o,a,l,h,n,r,c,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}Fa.prototype.isCompressedTexture=!0;(class extends Ie{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.needsUpdate=!0}}).prototype.isCanvasTexture=!0;new Ue,new Ue,new Ue,new Ki;class Va{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let n=0;const r=i.length;let s;s=e||t*i[r-1];let o,a=0,l=r-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=i[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,i[n]===s)return n/(r-1);const h=i[n];return(n+(s-h)/(i[n+1]-h))/(r-1)}getTangent(t,e){let i=t-1e-4,n=t+1e-4;i<0&&(i=0),n>1&&(n=1);const r=this.getPoint(i),s=this.getPoint(n),o=e||(r.isVector2?new ye:new Ue);return o.copy(s).sub(r).normalize(),o}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new Ue,n=[],r=[],s=[],o=new Ue,a=new mi;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new Ue)}r[0]=new Ue,s[0]=new Ue;let l=Number.MAX_VALUE;const h=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);h<=l&&(l=h,i.set(1,0,0)),c<=l&&(l=c,i.set(0,1,0)),u<=l&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(pe(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(pe(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(o.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Ha extends Va{constructor(t=0,e=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const i=e||new ye,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)n;)r-=n;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===h&&l===r-1&&(l=r-2,h=1),this.closed||l>0?o=n[(l-1)%r]:(qa.subVectors(n[0],n[1]).add(n[0]),o=qa);const c=n[l%r],u=n[(l+1)%r];if(this.closed||l+2n.length-2?n.length-1:s+1],c=n[s>n.length-3?n.length-1:s+2];return i.set(Ka(o,a.x,l.x,h.x,c.x),Ka(o,a.y,l.y,h.y,c.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){const t=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-t/o;return s.getPointAt(a,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class hl extends ll{constructor(t){super(t),this.uuid=de(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,n=this.holes.length;i80*i){a=h=t[0],l=c=t[1];for(let e=i;eh&&(h=u),d>c&&(c=d);p=Math.max(h-a,c-l),p=0!==p?1/p:0}return pl(s,o,i,a,l,p),o};function ul(t,e,i,n,r){let s,o;if(r===function(t,e,i,n){let r=0;for(let s=e,o=i-n;s0)for(s=e;s=e;s-=n)o=Il(s,t[s],t[s+1],o);return o&&Tl(o,o.next)&&(Dl(o),o=o.next),o}function dl(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!Tl(n,n.next)&&0!==Sl(n.prev,n,n.next))n=n.next;else{if(Dl(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function pl(t,e,i,n,r,s,o){if(!t)return;!o&&s&&function(t,e,i,n){let r=t;do{null===r.z&&(r.z=bl(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,s,o,a,l,h=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(o>1)}(r)}(t,n,r,s);let a,l,h=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?ml(t,n,r,s):fl(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),Dl(t),t=l.next,h=l.next;else if((t=l)===h){o?1===o?pl(t=gl(dl(t),e,i),e,i,n,r,s,2):2===o&&vl(t,e,i,n,r,s):pl(dl(t),e,i,n,r,s,1);break}}function fl(t){const e=t.prev,i=t,n=t.next;if(Sl(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(wl(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Sl(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ml(t,e,i,n){const r=t.prev,s=t,o=t.next;if(Sl(r,s,o)>=0)return!1;const a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=bl(a,l,e,i,n),d=bl(h,c,e,i,n);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Sl(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Sl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Sl(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Sl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function gl(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!Tl(r,s)&&Cl(r,n,n.next,s)&&Al(r,s)&&Al(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),Dl(n),Dl(n.next),n=t=s),n=n.next}while(n!==t);return dl(n)}function vl(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&El(o,t)){let a=Ll(o,t);return o=dl(o,o.next),a=dl(a,a.next),pl(o,e,i,n,r,s),void pl(a,e,i,n,r,s)}t=t.next}o=o.next}while(o!==t)}function yl(t,e){return t.x-e.x}function _l(t,e){if(e=function(t,e){let i=e;const n=t.x,r=t.y;let s,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o){if(o=t,t===n){if(r===i.y)return i;if(r===i.next.y)return i.next}s=i.x=i.x&&i.x>=l&&n!==i.x&&wl(rs.x||i.x===s.x&&xl(s,i)))&&(s=i,u=c)),i=i.next}while(i!==a);return s}(t,e)){const i=Ll(e,t);dl(e,e.next),dl(i,i.next)}}function xl(t,e){return Sl(t.prev,t,e.prev)<0&&Sl(e.next,t,t.next)<0}function bl(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ml(t){let e=t,i=t;do{(e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function El(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Cl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Al(t,e)&&Al(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(Sl(t.prev,t,e.prev)||Sl(t,e.prev,e))||Tl(t,e)&&Sl(t.prev,t,t.next)>0&&Sl(e.prev,e,e.next)>0)}function Sl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Tl(t,e){return t.x===e.x&&t.y===e.y}function Cl(t,e,i,n){const r=Rl(Sl(t,e,i)),s=Rl(Sl(t,e,n)),o=Rl(Sl(i,n,t)),a=Rl(Sl(i,n,e));return r!==s&&o!==a||(!(0!==r||!Pl(t,i,e))||(!(0!==s||!Pl(t,n,e))||(!(0!==o||!Pl(i,t,n))||!(0!==a||!Pl(i,e,n)))))}function Pl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Rl(t){return t>0?1:t<0?-1:0}function Al(t,e){return Sl(t.prev,t,t.next)<0?Sl(t,e,t.next)>=0&&Sl(t,t.prev,e)>=0:Sl(t,e,t.prev)<0||Sl(t,t.next,e)<0}function Ll(t,e){const i=new Nl(t.i,t.x,t.y),n=new Nl(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Il(t,e,i,n){const r=new Nl(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Dl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Nl(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ol{static area(t){const e=t.length;let i=0;for(let n=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function kl(t,e){for(let i=0;iNumber.EPSILON){const u=Math.sqrt(c),d=Math.sqrt(l*l+h*h),p=e.x-a/u,f=e.y+o/u,m=((i.x-h/d-p)*h-(i.y+l/d-f)*l)/(o*h-a*l);n=p+o*m-t.x,r=f+a*m-t.y;const g=n*n+r*r;if(g<=2)return new ye(n,r);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(h)&&(t=!0),t?(n=-a,r=o,s=Math.sqrt(c)):(n=o,r=a,s=Math.sqrt(c/2))}return new ye(n/s,r/s)}const L=[];for(let t=0,e=T.length,i=e-1,n=t+1;t=0;t--){const e=t/p,i=c*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=T.length;t=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}Hl.prototype.isMeshPhysicalMaterial=!0;class Wl extends $i{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Pe(16777215),this.specular=new Pe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this}}Wl.prototype.isMeshPhongMaterial=!0;class jl extends $i{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Pe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}jl.prototype.isMeshToonMaterial=!0;class ql extends $i{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}ql.prototype.isMeshNormalMaterial=!0;class Xl extends $i{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Pe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Xl.prototype.isMeshLambertMaterial=!0;class Yl extends $i{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Pe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this}}Yl.prototype.isMeshMatcapMaterial=!0;class Jl extends wa{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}Jl.prototype.isLineDashedMaterial=!0;const Zl={arraySlice:function(t,e,i){return Zl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let s=0,o=0;o!==n;++s){const n=i[s]*e;for(let i=0;i!==e;++i)r[o++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(e.push(s.time),i.push.apply(i,o)),s=t[r++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(e.push(s.time),o.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(e.push(s.time),i.push(o)),s=t[r++]}while(void 0!==s)},subclip:function(t,e,i,n,r=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t=n)){l.push(e.times[t]);for(let i=0;is.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=n.times[u]){const t=u*l+a,e=t+l-a;d=Zl.arraySlice(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=l-a;t.evaluate(s),d=Zl.arraySlice(t.resultBuffer,e,i)}if("quaternion"===r){(new ke).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let t=0;t=r)break t;{const o=e[1];t=r)break e}s=i,i=0}}for(;i>>1;te;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Zl.arraySlice(i,r,s),this.values=Zl.arraySlice(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&Zl.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=Zl.arraySlice(this.times),e=Zl.arraySlice(this.values),i=this.getValueSize(),n=2302===this.getInterpolation(),r=t.length-1;let s=1;for(let o=1;o0){t[s]=t[r];for(let t=r*i,n=s*i,o=0;o!==i;++o)e[n+o]=e[t+o];++s}return s!==t.length?(this.times=Zl.arraySlice(t,0,s),this.values=Zl.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=Zl.arraySlice(this.times,0),e=Zl.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}eh.prototype.TimeBufferType=Float32Array,eh.prototype.ValueBufferType=Float32Array,eh.prototype.DefaultInterpolation=2301;class ih extends eh{}ih.prototype.ValueTypeName="bool",ih.prototype.ValueBufferType=Array,ih.prototype.DefaultInterpolation=2300,ih.prototype.InterpolantFactoryMethodLinear=void 0,ih.prototype.InterpolantFactoryMethodSmooth=void 0;class nh extends eh{}nh.prototype.ValueTypeName="color";class rh extends eh{}rh.prototype.ValueTypeName="number";class sh extends Kl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-e)/(n-e);let l=t*o;for(let t=l+o;l!==t;l+=4)ke.slerpFlat(r,0,s,l-o,s,l,a);return r}}class oh extends eh{InterpolantFactoryMethodLinear(t){return new sh(this.times,this.values,this.getValueSize(),t)}}oh.prototype.ValueTypeName="quaternion",oh.prototype.DefaultInterpolation=2301,oh.prototype.InterpolantFactoryMethodSmooth=void 0;class ah extends eh{}ah.prototype.ValueTypeName="string",ah.prototype.ValueBufferType=Array,ah.prototype.DefaultInterpolation=2300,ah.prototype.InterpolantFactoryMethodLinear=void 0,ah.prototype.InterpolantFactoryMethodSmooth=void 0;class lh extends eh{}lh.prototype.ValueTypeName="vector";class hh{constructor(t,e=-1,i,n=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=de(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(ch(i[t]).scale(n));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(eh.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],o=[];Zl.flattenJSON(i,s,o,n),0!==s.length&&r.push(new t(e,s,o))}},n=[],r=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==mh[t])return void mh[t].push({onLoad:e,onProgress:i,onError:n});mh[t]=[],mh[t].push({onLoad:e,onProgress:i,onError:n});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body.getReader)return e;const i=mh[t],n=e.body.getReader(),r=e.headers.get("Content-Length"),s=r?parseInt(r):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){n.read().then(({done:n,value:r})=>{if(n)t.close();else{a+=r.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=i.length;t{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,o));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then(t=>n.decode(t))}}}).then(e=>{uh.add(t,e);const i=mh[t];delete mh[t];for(let t=0,n=i.length;t{const i=mh[t];if(void 0===i)throw this.manager.itemError(t),e;delete mh[t];for(let t=0,n=i.length;t{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class vh extends fh{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=uh.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const o=be("img");function a(){h(),uh.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){h(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class yh extends fh{constructor(t){super(t)}load(t,e,i,n){const r=new Hn,s=new vh(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(i){s.load(t[i],(function(t){r.images[i]=t,o++,6===o&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(let e=0;e0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){o.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){ke.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){const s=this._workIndex*r;ke.multiplyQuaternionsFlat(t,s,t,e,t,i),ke.slerpFlat(t,e,t,e,t,s,n)}_lerp(t,e,i,n,r){const s=1-n;for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]*s+t[i+o]*n}}_lerpAdditive(t,e,i,n,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[i+s]*n}}}const qh=new RegExp("[\\[\\]\\.:\\/]","g"),Xh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Yh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Jh=/(WCOD+)?/.source.replace("WCOD",Xh),Zh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Kh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qh=new RegExp("^"+Yh+Jh+Zh+Kh+"$"),$h=["material","materials","bones"];class tc{constructor(t,e,i){this.path=e,this.parsedPath=i||tc.parseTrackName(e),this.node=tc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new tc.Composite(t,e,i):new tc(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(qh,"")}static parseTrackName(t){const e=Qh.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==$h.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n=r){const s=r++,h=t[s];e[h.uuid]=l,t[l]=h,e[a]=s,t[s]=o;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[l];e[l]=n,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,h=this.nCachedObjects_,c=new Array(l);n=r.length,i[t]=n,s.push(t),o.push(e),r.push(c);for(let i=h,n=a.length;i!==n;++i){const n=a[i];c[i]=new tc(n,t,e)}return c}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=i,s[i]=a,s.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}}).prototype.isAnimationObjectGroup=!0;class ec{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:2400,endingEnd:2400};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,a[1]=r+i,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case 2500:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=2202===i;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}(class extends le{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,s=t._propertyBindings,o=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let h=l[a];void 0===h&&(h={},l[a]=h);for(let t=0;t!==r;++t){const r=n[t],l=r.name;let c=h[l];if(void 0!==c)++c.referenceCount,s[t]=c;else{if(c=s[t],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,a,l));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;c=new jh(tc.create(i,l,n),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,a,l),s[t]=c}o[t].resultBuffer=c.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==i;++o){e[o]._update(n,t,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return nc.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}rc.prototype.isBox2=!0;const sc=new Ue,oc=new Ue;const ac=new Ue,lc=new mi,hc=new mi;const cc=new Float32Array(1);new Int32Array(cc.buffer);Va.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Va.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},ll.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},class extends Ia{constructor(t=10,e=10,i=4473924,n=8947848){i=new Pe(i),n=new Pe(n);const r=e/2,s=t/e,o=t/2,a=[],l=[];for(let t=0,h=0,c=-o;t<=e;t++,c+=s){a.push(-o,0,c,o,0,c),a.push(c,0,-o,c,0,o);const e=t===r?i:n;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}const h=new mn;h.setAttribute("position",new an(a,3)),h.setAttribute("color",new an(l,3));super(h,new wa({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Ia{constructor(t){const e=function t(e){const i=[];e&&e.isBone&&i.push(e);for(let n=0;ns.geoBBox.right||i.south>s.geoBBox.top||i.east * @author owenm * @license MIT - */function yc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function _c(t){for(var e=1;e=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function Ec(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Sc=Ec(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Tc=Ec(/Edge/i),Cc=Ec(/firefox/i),Pc=Ec(/safari/i)&&!Ec(/chrome/i)&&!Ec(/android/i),Rc=Ec(/iP(ad|od|hone)/i),Ac=Ec(/chrome/i)&&Ec(/android/i),Lc={capture:!1,passive:!1};function Ic(t,e,i){t.addEventListener(e,i,!Sc&&Lc)}function Dc(t,e,i){t.removeEventListener(e,i,!Sc&&Lc)}function Nc(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Oc(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Gc(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&Nc(t,e):Nc(t,e))||n&&t===i)return t;if(t===i)break}while(t=Oc(t))}return null}var kc,Uc=/\s+/g;function Bc(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(Uc," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(Uc," ")}}function zc(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function Fc(t,e){var i="";if("string"==typeof t)i=t;else do{var n=zc(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function Vc(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,s=n.length;if(i)for(;r=s:r<=s))return n;if(n===Hc())break;n=Zc(n,!1)}return!1}function qc(t,e,i,n){for(var r=0,s=0,o=t.children;s2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=wc(i,au);su.pluginEvent.bind(td)(t,e,_c({dragEl:cu,parentEl:uu,ghostEl:du,rootEl:pu,nextEl:fu,lastDownEl:mu,cloneEl:gu,cloneHidden:vu,dragStarted:Au,putSortable:wu,activeSortable:td.active,originalEvent:n,oldIndex:yu,oldDraggableIndex:xu,newIndex:_u,newDraggableIndex:bu,hideGhostForTarget:Zu,unhideGhostForTarget:Ku,cloneNowHidden:function(){vu=!0},cloneNowShown:function(){vu=!1},dispatchSortableEvent:function(t){hu({sortable:e,name:t,originalEvent:n})}},r))};function hu(t){ou(_c({putSortable:wu,cloneEl:gu,targetEl:cu,rootEl:pu,oldIndex:yu,oldDraggableIndex:xu,newIndex:_u,newDraggableIndex:bu},t))}var cu,uu,du,pu,fu,mu,gu,vu,yu,_u,xu,bu,Mu,wu,Eu,Su,Tu,Cu,Pu,Ru,Au,Lu,Iu,Du,Nu,Ou=!1,Gu=!1,ku=[],Uu=!1,Bu=!1,zu=[],Fu=!1,Vu=[],Hu="undefined"!=typeof document,Wu=Rc,ju=Tc||Sc?"cssFloat":"float",qu=Hu&&!Ac&&!Rc&&"draggable"in document.createElement("div"),Xu=function(){if(Hu){if(Sc)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Yu=function(t,e){var i=zc(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=qc(t,0,e),s=qc(t,1,e),o=r&&zc(r),a=s&&zc(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+Wc(r).width,h=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Wc(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var c="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==c?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[ju]||s&&"none"===i[ju]&&l+h>n)?"vertical":"horizontal"},Ju=function(t){function e(t,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},n=t.group;n&&"object"==xc(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},Zu=function(){!Xu&&du&&zc(du,"display","none")},Ku=function(){!Xu&&du&&zc(du,"display","")};Hu&&document.addEventListener("click",(function(t){if(Gu)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Gu=!1,!1}),!0);var Qu=function(t){if(cu){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,s=t.clientY,ku.some((function(t){var e=t[eu].options.emptyInsertThreshold;if(e&&!Xc(t)){var i=Wc(t),n=r>=i.left-e&&r<=i.right+e,a=s>=i.top-e&&s<=i.bottom+e;return n&&a?o=t:void 0}})),o);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[eu]._onDragOver(i)}}var r,s,o},$u=function(t){cu&&cu.parentNode[eu]._isOutsideThisEl(t.target)};function td(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Mc({},e),t[eu]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Yu(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==td.supportPointer&&"PointerEvent"in window&&!Pc,emptyInsertThreshold:5};for(var n in su.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var r in Ju(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&qu,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ic(t,"pointerdown",this._onTapStart):(Ic(t,"mousedown",this._onTapStart),Ic(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ic(t,"dragover",this),Ic(t,"dragenter",this)),ku.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Mc(this,iu())}function ed(t,e,i,n,r,s,o,a){var l,h,c=t[eu],u=c.options.onMove;return!window.CustomEvent||Sc||Tc?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=s||Wc(e),l.willInsertAfter=a,l.originalEvent=o,t.dispatchEvent(l),u&&(h=u.call(c,l,o)),h}function id(t){t.draggable=!1}function nd(){Fu=!1}function rd(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function sd(t){return setTimeout(t,0)}function od(t){return clearTimeout(t)}td.prototype={constructor:td,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Lu=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,cu):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,r=n.preventOnFilter,s=t.type,o=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(o||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,h=n.filter;if(function(t){Vu.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&Vu.push(n)}}(i),!cu&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Pc||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Gc(a,n.draggable,i,!1))&&a.animated||mu===a)){if(yu=Yc(a),xu=Yc(a,n.draggable),"function"==typeof h){if(h.call(this,t,a,this))return hu({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),lu("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(h&&(h=h.split(",").some((function(n){if(n=Gc(l,n.trim(),i,!1))return hu({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),lu("filter",e,{evt:t}),!0}))))return void(r&&t.cancelable&&t.preventDefault());n.handle&&!Gc(l,n.handle,i,!1)||this._prepareDragStart(t,o,a)}}},_prepareDragStart:function(t,e,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!cu&&i.parentNode===s){var l=Wc(i);if(pu=s,uu=(cu=i).parentNode,fu=cu.nextSibling,mu=i,Mu=o.group,td.dragged=cu,Eu={target:cu,clientX:(e||t).clientX,clientY:(e||t).clientY},Pu=Eu.clientX-l.left,Ru=Eu.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,cu.style["will-change"]="all",n=function(){lu("delayEnded",r,{evt:t}),td.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Cc&&r.nativeDraggable&&(cu.draggable=!0),r._triggerDragStart(t,e),hu({sortable:r,name:"choose",originalEvent:t}),Bc(cu,o.chosenClass,!0))},o.ignore.split(",").forEach((function(t){Vc(cu,t.trim(),id)})),Ic(a,"dragover",Qu),Ic(a,"mousemove",Qu),Ic(a,"touchmove",Qu),Ic(a,"mouseup",r._onDrop),Ic(a,"touchend",r._onDrop),Ic(a,"touchcancel",r._onDrop),Cc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,cu.draggable=!0),lu("delayStart",this,{evt:t}),!o.delay||o.delayOnTouchOnly&&!e||this.nativeDraggable&&(Tc||Sc))n();else{if(td.eventCanceled)return void this._onDrop();Ic(a,"mouseup",r._disableDelayedDrag),Ic(a,"touchend",r._disableDelayedDrag),Ic(a,"touchcancel",r._disableDelayedDrag),Ic(a,"mousemove",r._delayedDragTouchMoveHandler),Ic(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&Ic(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){cu&&id(cu),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Dc(t,"mouseup",this._disableDelayedDrag),Dc(t,"touchend",this._disableDelayedDrag),Dc(t,"touchcancel",this._disableDelayedDrag),Dc(t,"mousemove",this._delayedDragTouchMoveHandler),Dc(t,"touchmove",this._delayedDragTouchMoveHandler),Dc(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Ic(document,"pointermove",this._onTouchMove):Ic(document,e?"touchmove":"mousemove",this._onTouchMove):(Ic(cu,"dragend",this),Ic(pu,"dragstart",this._onDragStart));try{document.selection?sd((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Ou=!1,pu&&cu){lu("dragStarted",this,{evt:e}),this.nativeDraggable&&Ic(document,"dragover",$u);var i=this.options;!t&&Bc(cu,i.dragClass,!1),Bc(cu,i.ghostClass,!0),td.active=this,t&&this._appendGhost(),hu({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Su){this._lastX=Su.clientX,this._lastY=Su.clientY,Zu();for(var t=document.elementFromPoint(Su.clientX,Su.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Su.clientX,Su.clientY))!==e;)e=t;if(cu.parentNode[eu]._isOutsideThisEl(t),e)do{if(e[eu]){if(e[eu]._onDragOver({clientX:Su.clientX,clientY:Su.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Ku()}},_onTouchMove:function(t){if(Eu){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,r=t.touches?t.touches[0]:t,s=du&&Fc(du,!0),o=du&&s&&s.a,a=du&&s&&s.d,l=Wu&&Nu&&Jc(Nu),h=(r.clientX-Eu.clientX+n.x)/(o||1)+(l?l[0]-zu[0]:0)/(o||1),c=(r.clientY-Eu.clientY+n.y)/(a||1)+(l?l[1]-zu[1]:0)/(a||1);if(!td.active&&!Ou){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))n.right+10||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+10}(t,r,this)&&!m.animated){if(m===cu)return L(!1);if(m&&s===t.target&&(o=m),o&&(i=Wc(o)),!1!==ed(pu,s,cu,e,o,i,t,!!o))return A(),s.appendChild(cu),uu=s,I(),L(!0)}else if(m&&function(t,e,i){var n=Wc(qc(i.el,0,i.options,!0));return e?t.clientXc+h*s/2:lu-Du)return-Iu}else if(l>c+h*(1-r)/2&&lu-h*s/2))return l>c+h/2?1:-1;return 0}(t,o,i,r,b?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Bu,Lu===o))){var S=Yc(cu);do{S-=v,_=uu.children[S]}while(_&&("none"===zc(_,"display")||_===du))}if(0===v||_===o)return L(!1);Lu=o,Iu=v;var T=o.nextElementSibling,C=!1,P=ed(pu,s,cu,e,o,i,t,C=1===v);if(!1!==P)return 1!==P&&-1!==P||(C=1===P),Fu=!0,setTimeout(nd,30),A(),C&&!T?s.appendChild(cu):o.parentNode.insertBefore(cu,C?T:o),w&&$c(w,0,E-w.scrollTop),uu=cu.parentNode,void 0===y||Bu||(Du=Math.abs(y-Wc(o)[M])),I(),L(!0)}if(s.contains(cu))return L(!1)}return!1}function R(a,l){lu(a,p,_c({evt:t,isOwner:c,axis:r?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:d,target:o,completed:L,onMove:function(i,n){return ed(pu,s,cu,e,i,Wc(i),t,n)},changed:I},l))}function A(){R("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function L(e){return R("dragOverCompleted",{insertion:e}),e&&(c?h._hideClone():h._showClone(p),p!==d&&(Bc(cu,wu?wu.options.ghostClass:h.options.ghostClass,!1),Bc(cu,a.ghostClass,!0)),wu!==p&&p!==td.active?wu=p:p===td.active&&wu&&(wu=null),d===p&&(p._ignoreWhileAnimating=o),p.animateAll((function(){R("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(o===cu&&!cu.animated||o===s&&!o.animated)&&(Lu=null),a.dragoverBubble||t.rootEl||o===document||(cu.parentNode[eu]._isOutsideThisEl(t.target),!e&&Qu(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){_u=Yc(cu),bu=Yc(cu,a.draggable),hu({sortable:p,name:"change",toEl:s,newIndex:_u,newDraggableIndex:bu,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Dc(document,"mousemove",this._onTouchMove),Dc(document,"touchmove",this._onTouchMove),Dc(document,"pointermove",this._onTouchMove),Dc(document,"dragover",Qu),Dc(document,"mousemove",Qu),Dc(document,"touchmove",Qu)},_offUpEvents:function(){var t=this.el.ownerDocument;Dc(t,"mouseup",this._onDrop),Dc(t,"touchend",this._onDrop),Dc(t,"pointerup",this._onDrop),Dc(t,"touchcancel",this._onDrop),Dc(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;_u=Yc(cu),bu=Yc(cu,i.draggable),lu("drop",this,{evt:t}),uu=cu&&cu.parentNode,_u=Yc(cu),bu=Yc(cu,i.draggable),td.eventCanceled||(Ou=!1,Bu=!1,Uu=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),od(this.cloneId),od(this._dragStartId),this.nativeDraggable&&(Dc(document,"drop",this),Dc(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Pc&&zc(document.body,"user-select",""),zc(cu,"transform",""),t&&(Au&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),du&&du.parentNode&&du.parentNode.removeChild(du),(pu===uu||wu&&"clone"!==wu.lastPutMode)&&gu&&gu.parentNode&&gu.parentNode.removeChild(gu),cu&&(this.nativeDraggable&&Dc(cu,"dragend",this),id(cu),cu.style["will-change"]="",Au&&!Ou&&Bc(cu,wu?wu.options.ghostClass:this.options.ghostClass,!1),Bc(cu,this.options.chosenClass,!1),hu({sortable:this,name:"unchoose",toEl:uu,newIndex:null,newDraggableIndex:null,originalEvent:t}),pu!==uu?(_u>=0&&(hu({rootEl:uu,name:"add",toEl:uu,fromEl:pu,originalEvent:t}),hu({sortable:this,name:"remove",toEl:uu,originalEvent:t}),hu({rootEl:uu,name:"sort",toEl:uu,fromEl:pu,originalEvent:t}),hu({sortable:this,name:"sort",toEl:uu,originalEvent:t})),wu&&wu.save()):_u!==yu&&_u>=0&&(hu({sortable:this,name:"update",toEl:uu,originalEvent:t}),hu({sortable:this,name:"sort",toEl:uu,originalEvent:t})),td.active&&(null!=_u&&-1!==_u||(_u=yu,bu=xu),hu({sortable:this,name:"end",toEl:uu,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){lu("nulling",this),pu=cu=uu=du=fu=gu=mu=vu=Eu=Su=Au=_u=bu=yu=xu=Lu=Iu=wu=Mu=td.dragged=td.ghost=td.clone=td.active=null,Vu.forEach((function(t){t.checked=!0})),Vu.length=Tu=Cu=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":cu&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,r=i.length,s=this.options;n1&&(e=1),e<0&&(e=0);var i=document.getElementById(this._addUID("GPopacityValueDiv_ID_"+t));i&&(i.value=Math.round(100*e));var n=document.getElementById(this._addUID("GPopacityValue_ID_"+t));n&&(n.innerHTML=Math.round(100*e)+"%")},Sd.prototype._onVisibilityLayerClick=function(t){var e=this.getGlobe(),i=this._resolveLayerId(t.target.id);e.setLayerVisibility(i,t.target.checked)},Sd.prototype._updateLayerVisibility=function(t,e){var i=document.getElementById(this._addUID("GPvisibility_ID_"+t));i&&(i.checked=e)},Sd.prototype._onOpenLayerInfoClick=function(t){var e,i,n=this._resolveLayerId(t.target.id),r=this._layers[n],s=document.getElementById(t.target.id);if("GPlayerInfoOpened"===s.className)return void 0!==s.classList&&(s.classList.remove("GPlayerInfoOpened"),s.classList.add("GPlayerInfo")),void 0!==(e=document.getElementById(this._addUID("GPlayerInfoPanel"))).classList&&(e.classList.remove("GPpanel"),e.classList.remove("GPlayerInfoPanelOpened"),e.classList.add("GPlayerInfoPanelClosed")),i=document.getElementById(this._addUID("GPlayerInfoContent")),void e.removeChild(i);for(var o=document.getElementsByClassName("GPlayerInfoOpened"),a=0;a=0;n&&!i.inRange?(i.inRange=!0,document.getElementById(this._addUID("GPlayerSwitcher_ID_"+i.id)).classList.remove("outOfRange")):!n&&i.inRange&&(i.inRange=!1,document.getElementById(this._addUID("GPlayerSwitcher_ID_"+i.id)).classList.add("outOfRange"))}}},Sd.prototype._updateLayerListContainer=function(){if(this._layerListContainer){for(var t=this.getGlobe();this._layerListContainer.firstChild;)this._layerListContainer.removeChild(this._layerListContainer.firstChild);for(var e=t.getColorLayers().sort((function(t,e){return e.sequence-t.sequence})),i=0;ir.max&&(s=r.max),se.max&&(t=e.max),te&&(n=!1),n&&d&&dn&&n>c))continue}else if(!(o[a].constraints[0].minScaleDenominator=1e3&&(i/=1e3,s="km"),e.getElement().innerHTML=i+" "+s,e.getElement().style.width=r+"px"},t.isInitialized()?this._callbacks.onChangedViewCallback():t.listen($t.EVENTS.GLOBE_INITIALIZED,this._callbacks.onChangedViewCallback),t.listen($t.EVENTS.RANGE_CHANGED,this._callbacks.onChangedViewCallback)}else if(null==t){for(this._globe.forget($t.EVENTS.GLOBE_INITIALIZED,this._callbacks.onChangedViewCallback),this._globe.forget($t.EVENTS.RANGE_CHANGED,this._callbacks.onChangedViewCallback);this.getElement().hasChildNodes();)this.getElement().removeChild(this.getElement().lastChild);this.getElement().parentNode.removeChild(this.getElement())}uc.prototype.setGlobe.call(this,t)},Wd.prototype._initialize=function(){this._uid=ne.generate(),this._ScaleContainer=null,this._callbacks={}},Wd.prototype._initContainer=function(){return this._createMainContainerElement()};var jd=Wd,qd={_addUID:function(t){return this._uid?t+"-"+this._uid:t},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPminiglobeContainer"),t.className="GPwidget",t.style.width="100px",t.style.height="100px",t}};function Xd(t){return(Xd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yd(t){if(t=t||{},!(this instanceof Yd))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if("object"!==Xd(t))throw new Error("ERROR WRONG_TYPE : options should be an object");this._initialize();var e=this._initContainer();this._options=t,uc.call(this,{name:"Overview",element:e,target:t.target,position:t.position})}Yd.prototype=Object.create(uc.prototype,{}),ie.assign(Yd.prototype,qd),Yd.prototype.constructor=Yd,Yd.prototype.setGlobe=function(t){if(t){var e=t.getCenter(),i=new $t(this._element,e,{maxSubdivisionLevel:6,sseSubdivisionThreshold:3,noControls:!0});i.setBackground();var n=function(){var e=t.getGlobeView().camera.camera3D.position.length(),n=Math.min(Math.max(e,665e4),3e7),r=i.getGlobeView().camera.camera3D,s=t.getGlobeView().controls.getCameraTargetPosition();r.position.copy(s).setLength(n),r.lookAt(s),i.notifyChange(r)};t.listen($t.EVENTS.AFTER_RENDER,n),t.isInitialized()?n():t.listen($t.EVENTS.GLOBE_INITIALIZED,n);var r=this._options.layer;i.addLayer(r),this._globeObj=i}else if(null==t){for(;this.getElement().hasChildNodes();)this.getElement().removeChild(this.getElement().lastChild);this.getElement().parentNode.removeChild(this.getElement())}uc.prototype.setGlobe.call(this,t)},Yd.prototype._initialize=function(){this._uid=ne.generate(),this._MiniGlobeContainer=null,this._callbacks={}},Yd.prototype._initContainer=function(){return this._createMainContainerElement()};var Jd=Yd,Zd=i(1),Kd=l.getLogger("wmtsLayer");function Qd(t){if(!(this instanceof Qd))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!0),!Zd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Zd.a.configuration.getLayerId(t.layer,"WMTS");if(e&&Zd.a.configuration.getLayerParams(t.layer,"WMTS")){var i={},n=Zd.a.configuration.getLayerParams(t.layer,"WMTS");"EPSG:3857"===n.projection?n.extent=new Zt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):(n.projection="EPSG:4326",n.extent=new Zt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top)),0===Object.entries(n.tileMatrixSetLimits).length&&n.tileMatrixSetLimits.constructor===Object&&(n.tileMatrixSetLimits=void 0),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Zt.WMTSSource({protocol:"wmts",url:n.url.replace(/(http|https):\/\//,s),networkOptions:{crossOrigin:"omit"},updateStrategy:{type:0,options:{}},projection:n.projection,attribution:n.originators,name:t.layer,format:n.format,tileMatrixSet:n.TMSLink,tileMatrixSetLimits:n.tileMatrixSetLimits,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Jt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),ie.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Zt.ColorLayer(i.id,i)}Kd.error("ERROR layer id (layer name: "+t.layer+" / service: WMTS ) was not found !?")}Qd.prototype.constructor=Qd;var $d=Qd,tp=l.getLogger("wmsLayer");function ep(t){if(!(this instanceof ep))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!0),!Zd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Zd.a.configuration.getLayerId(t.layer,"WMS");if(e&&Zd.a.configuration.getLayerParams(t.layer,"WMS")){var i={},n=Zd.a.configuration.getLayerParams(t.layer,"WMS");"EPSG:3857"===n.projection?n.extent=new Zt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):n.extent=new Zt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Zt.WMSSource({protocol:"wms",version:n.version,attribution:n.originators,url:n.url.replace(/(http|https):\/\//,s),name:t.layer,projection:n.projection,style:"",heightMapWidth:256,waterMask:!1,networkOptions:{crossOrigin:"omit"},updateStrategy:{type:0,options:{}},format:n.format,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Jt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),ie.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Zt.ColorLayer(i.id,i)}tp.error("ERROR layer id (layer name: "+t.layer+" / service: WMS ) was not found !?")}ep.prototype.constructor=ep;var ip=ep,np=l.getLogger("elevationLayer");function rp(t){if(!(this instanceof rp))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!1),!Zd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Zd.a.configuration.getLayerId(t.layer,"WMTS");if(e&&Zd.a.configuration.getLayerParams(t.layer,"WMTS")){var i={},n=Zd.a.configuration.getLayerParams(t.layer,"WMTS");"EPSG:3857"===n.projection?n.extent=new Zt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):(n.projection="EPSG:4326",n.extent=new Zt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top)),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s="undefined"!=typeof window?window:"undefined"!=typeof self?self:null,o=s?s.location&&s.location.protocol&&0===s.location.protocol.indexOf("https:")?"https://":"http://":t.ssl?"https://":"http://";return i.id=e,i.noDataValue=-99999,i.updateStrategy={type:0,options:{groups:[11,14]}},i.source=new Zt.WMTSSource({protocol:"wmts",url:n.url.replace(/(http|https):\/\//,o),networkOptions:{crossOrigin:"omit"},attribution:n.originators,projection:n.projection,name:t.layer,format:"image/x-bil;bits=32",tileMatrixSet:n.TMSLink,tileMatrixSetLimits:n.tileMatrixSetLimits,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Jt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),ie.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Zt.ElevationLayer(i.id,i)}np.log("[source WMTS] ERROR : "+t.layer+" cannot be found in Geoportal Configuration. Make sure that this resource is included in your contract key.")}rp.prototype.constructor=rp;var sp=rp,op=l.getLogger("vectorTileLayer");function ap(t){if(!(this instanceof ap))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(!Zd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Zd.a.configuration.getLayerId(t.layer,"TMS");if(e&&Zd.a.configuration.getLayerParams(t.layer,"TMS")){var i={},n=Zd.a.configuration.getLayerParams(t.layer,"TMS"),r=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Zt.VectorTilesSource({style:n.url.replace(/(http|https):\/\//,r),url:t.urlService,attribution:t.attributions,filter:t.filter,zoom:t.zoom}),i.isValidData=function(){return!1},new Zt.ColorLayer(i.id,i)}op.error("ERROR layer id (layer name: "+t.layer+" / service: TMS ) was not found !?")}ap.prototype.constructor=ap;var lp=ap;!function(){var t=document.getElementsByTagName("script"),e=t[t.length-1].getAttribute("data-key"),i=t[t.length-1].getAttribute("data-url"),n=t[t.length-1].getAttribute("data-timeout");if(e||i){var r={apiKey:e,sync:!0,onSuccess:function(){},onFailure:function(t){throw new Error("Configuration load failed : "+t.message)}};i&&(r.customConfigFile=i,r.callbackSuffix=""),n&&(r.timeOut=n),window.Gp||Jt.Services.getConfig(r)}}();var hp={proxifyUrl:function(t,e){var i=l.getLogger("proxifyUrl");if(!e||!e.hasOwnProperty("proxyUrl")||null===e.proxyUrl||0===e.proxyUrl.trim().length)return t;if(e.noProxyDomains&&Array.isArray(e.noProxyDomains)&&e.noProxyDomains.length>0)for(var n in e.noProxyDomains)if(i.trace("[ProxyUtils] proxifyUrl : analyzing "+e.noProxyDomains[n]),-1!==t.indexOf(e.noProxyDomains[n]))return i.info("[ProxyUtils] proxifyUrl : "+t+" found in noProxyDomains list ("+e.noProxyDomains[n]+")."),t;return e.proxyUrl+encodeURIComponent(t)}},cp={hex:function(t){if(t>255)throw new Error("'"+t+"'' is greater than 255(0xff);");return("0"+Number(t).toString(16)).slice(-2)},num:function(t){return parseInt(t,16)},arrayToRgba:function(t){if(!Array.isArray(t))throw new Error("Not an array !");var e=t[0],i=t[1],n=t[2],r=t[3]||1;return"rgba("+e+", "+i+", "+n+", "+parseFloat(r)+")"},arrayToHex:function(t){if(!Array.isArray(t))throw new Error("Not an array !");var e=t[0],i=t[1],n=t[2],r=t[3],s=[this.hex(e),this.hex(i),this.hex(n)],o={};return o.hex="#"+s.join(""),r&&(o.opacity=parseFloat(r)),o},rgbaToHex:function(t){var e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/.exec(t);if(!e)throw new Error("Invalid format: "+t);var i=e[1],n=e[2],r=e[3],s=e[4],o=[this.hex(i),this.hex(n),this.hex(r)],a={};return a.hex="#"+o.join(""),s&&(a.opacity=parseFloat(s)),a},hexToRgba:function(t,e){if(!t)throw new Error("Invalid format");t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return(i=i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null)?"rgba("+i.r+", "+i.g+", "+i.b+", "+e+")":null},isHex:function(t){if(!t)return!1;if("#"!==t.charAt(0))return!1;return!!/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t)},isRGB:function(t){if(!t)return!1;return!!/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/.exec(t)}},up={modulo:function(t,e){var i=t%e;return i*e<0?i+e:i},decimalToDMS:function(t,e,i){var n=this.modulo(t+180,360)-180,r=Math.abs(3600*n),s=i||0,o=Math.pow(10,s),a=Math.floor(r/3600),l=Math.floor((r-3600*a)/60),h=r-3600*a-60*l;return(h=Math.ceil(h*o)/o)>=60&&(h=0,l+=1),l>=60&&(l=0,a+=1),{d:a,m:l,s:h,direction:e.charAt(n<0?1:0)}},toInteger:function(t,e){var i=parseInt(t,e||10);return!isNaN(i)&&isFinite(i)?i:null},isInteger:function(t){if(isNaN(t))return!1;var e=parseFloat(t);return(0|e)===e},toFloat:function(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}};function dp(t){return(dp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var pp=Jt.Services,fp=Jt.Error,mp=Jt.Helper,gp=Jt.Protocols,vp=Jt.servicesDate,yp=Jt.servicesVersion;function _p(t,e){return function t(e,i){for(var n in e)e.hasOwnProperty(n)&&(i.hasOwnProperty(n)?"object"===dp(e[n])&&t(e[n],i[n]):i[n]=e[n])}(t,e)}var xp=r.itownsExtVersion||r.version,bp=r.date,Mp={control:{}};Mp.control.MousePosition=vc,Mp.control.LayerSwitcher=Td,Mp.control.BoostRelief=Ld,Mp.control.Buildings=Od,Mp.control.Attributions=Fd,Mp.control.Scale=jd,Mp.control.MiniGlobe=Jd,Mp.layer={},Mp.layer.GeoportalWMTS=$d,Mp.layer.GeoportalWMS=ip,Mp.layer.GeoportalElevation=sp,Mp.layer.VectorTileLayer=lp,Mp.CRS=pc,Mp.GlobeViewExtended=$t,window.itowns&&(_p(Mp,window.itowns),_p(window.itowns,Mp))}])})); \ No newline at end of file + */function xc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bc(t){for(var e=1;e=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function Tc(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Cc=Tc(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pc=Tc(/Edge/i),Rc=Tc(/firefox/i),Ac=Tc(/safari/i)&&!Tc(/chrome/i)&&!Tc(/android/i),Lc=Tc(/iP(ad|od|hone)/i),Ic=Tc(/chrome/i)&&Tc(/android/i),Dc={capture:!1,passive:!1};function Nc(t,e,i){t.addEventListener(e,i,!Cc&&Dc)}function Oc(t,e,i){t.removeEventListener(e,i,!Cc&&Dc)}function Gc(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function kc(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Uc(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&Gc(t,e):Gc(t,e))||n&&t===i)return t;if(t===i)break}while(t=kc(t))}return null}var Bc,zc=/\s+/g;function Fc(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(zc," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(zc," ")}}function Vc(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function Hc(t,e){var i="";if("string"==typeof t)i=t;else do{var n=Vc(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function Wc(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,s=n.length;if(i)for(;r=s:r<=s))return n;if(n===jc())break;n=Qc(n,!1)}return!1}function Yc(t,e,i,n){for(var r=0,s=0,o=t.children;s2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=Sc(i,hu);au.pluginEvent.bind(id)(t,e,bc({dragEl:du,parentEl:pu,ghostEl:fu,rootEl:mu,nextEl:gu,lastDownEl:vu,cloneEl:yu,cloneHidden:_u,dragStarted:Iu,putSortable:Su,activeSortable:id.active,originalEvent:n,oldIndex:xu,oldDraggableIndex:Mu,newIndex:bu,newDraggableIndex:wu,hideGhostForTarget:Qu,unhideGhostForTarget:$u,cloneNowHidden:function(){_u=!0},cloneNowShown:function(){_u=!1},dispatchSortableEvent:function(t){uu({sortable:e,name:t,originalEvent:n})}},r))};function uu(t){lu(bc({putSortable:Su,cloneEl:yu,targetEl:du,rootEl:mu,oldIndex:xu,oldDraggableIndex:Mu,newIndex:bu,newDraggableIndex:wu},t))}var du,pu,fu,mu,gu,vu,yu,_u,xu,bu,Mu,wu,Eu,Su,Tu,Cu,Pu,Ru,Au,Lu,Iu,Du,Nu,Ou,Gu,ku=!1,Uu=!1,Bu=[],zu=!1,Fu=!1,Vu=[],Hu=!1,Wu=[],ju="undefined"!=typeof document,qu=Lc,Xu=Pc||Cc?"cssFloat":"float",Yu=ju&&!Ic&&!Lc&&"draggable"in document.createElement("div"),Ju=function(){if(ju){if(Cc)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Zu=function(t,e){var i=Vc(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Yc(t,0,e),s=Yc(t,1,e),o=r&&Vc(r),a=s&&Vc(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+qc(r).width,h=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qc(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var c="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==c?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[Xu]||s&&"none"===i[Xu]&&l+h>n)?"vertical":"horizontal"},Ku=function(t){function e(t,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},n=t.group;n&&"object"==Mc(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},Qu=function(){!Ju&&fu&&Vc(fu,"display","none")},$u=function(){!Ju&&fu&&Vc(fu,"display","")};ju&&document.addEventListener("click",(function(t){if(Uu)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Uu=!1,!1}),!0);var td=function(t){if(du){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,s=t.clientY,Bu.some((function(t){var e=t[nu].options.emptyInsertThreshold;if(e&&!Jc(t)){var i=qc(t),n=r>=i.left-e&&r<=i.right+e,a=s>=i.top-e&&s<=i.bottom+e;return n&&a?o=t:void 0}})),o);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[nu]._onDragOver(i)}}var r,s,o},ed=function(t){du&&du.parentNode[nu]._isOutsideThisEl(t.target)};function id(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Ec({},e),t[nu]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Zu(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==id.supportPointer&&"PointerEvent"in window&&!Ac,emptyInsertThreshold:5};for(var n in au.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var r in Ku(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Yu,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Nc(t,"pointerdown",this._onTapStart):(Nc(t,"mousedown",this._onTapStart),Nc(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Nc(t,"dragover",this),Nc(t,"dragenter",this)),Bu.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Ec(this,ru())}function nd(t,e,i,n,r,s,o,a){var l,h,c=t[nu],u=c.options.onMove;return!window.CustomEvent||Cc||Pc?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=s||qc(e),l.willInsertAfter=a,l.originalEvent=o,t.dispatchEvent(l),u&&(h=u.call(c,l,o)),h}function rd(t){t.draggable=!1}function sd(){Hu=!1}function od(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function ad(t){return setTimeout(t,0)}function ld(t){return clearTimeout(t)}id.prototype={constructor:id,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Du=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,du):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,r=n.preventOnFilter,s=t.type,o=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(o||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,h=n.filter;if(function(t){Wu.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&Wu.push(n)}}(i),!du&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ac||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Uc(a,n.draggable,i,!1))&&a.animated||vu===a)){if(xu=Zc(a),Mu=Zc(a,n.draggable),"function"==typeof h){if(h.call(this,t,a,this))return uu({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),cu("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(h&&(h=h.split(",").some((function(n){if(n=Uc(l,n.trim(),i,!1))return uu({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),cu("filter",e,{evt:t}),!0}))))return void(r&&t.cancelable&&t.preventDefault());n.handle&&!Uc(l,n.handle,i,!1)||this._prepareDragStart(t,o,a)}}},_prepareDragStart:function(t,e,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!du&&i.parentNode===s){var l=qc(i);if(mu=s,pu=(du=i).parentNode,gu=du.nextSibling,vu=i,Eu=o.group,id.dragged=du,Tu={target:du,clientX:(e||t).clientX,clientY:(e||t).clientY},Au=Tu.clientX-l.left,Lu=Tu.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,du.style["will-change"]="all",n=function(){cu("delayEnded",r,{evt:t}),id.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Rc&&r.nativeDraggable&&(du.draggable=!0),r._triggerDragStart(t,e),uu({sortable:r,name:"choose",originalEvent:t}),Fc(du,o.chosenClass,!0))},o.ignore.split(",").forEach((function(t){Wc(du,t.trim(),rd)})),Nc(a,"dragover",td),Nc(a,"mousemove",td),Nc(a,"touchmove",td),Nc(a,"mouseup",r._onDrop),Nc(a,"touchend",r._onDrop),Nc(a,"touchcancel",r._onDrop),Rc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,du.draggable=!0),cu("delayStart",this,{evt:t}),!o.delay||o.delayOnTouchOnly&&!e||this.nativeDraggable&&(Pc||Cc))n();else{if(id.eventCanceled)return void this._onDrop();Nc(a,"mouseup",r._disableDelayedDrag),Nc(a,"touchend",r._disableDelayedDrag),Nc(a,"touchcancel",r._disableDelayedDrag),Nc(a,"mousemove",r._delayedDragTouchMoveHandler),Nc(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&Nc(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){du&&rd(du),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Oc(t,"mouseup",this._disableDelayedDrag),Oc(t,"touchend",this._disableDelayedDrag),Oc(t,"touchcancel",this._disableDelayedDrag),Oc(t,"mousemove",this._delayedDragTouchMoveHandler),Oc(t,"touchmove",this._delayedDragTouchMoveHandler),Oc(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Nc(document,"pointermove",this._onTouchMove):Nc(document,e?"touchmove":"mousemove",this._onTouchMove):(Nc(du,"dragend",this),Nc(mu,"dragstart",this._onDragStart));try{document.selection?ad((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ku=!1,mu&&du){cu("dragStarted",this,{evt:e}),this.nativeDraggable&&Nc(document,"dragover",ed);var i=this.options;!t&&Fc(du,i.dragClass,!1),Fc(du,i.ghostClass,!0),id.active=this,t&&this._appendGhost(),uu({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Cu){this._lastX=Cu.clientX,this._lastY=Cu.clientY,Qu();for(var t=document.elementFromPoint(Cu.clientX,Cu.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Cu.clientX,Cu.clientY))!==e;)e=t;if(du.parentNode[nu]._isOutsideThisEl(t),e)do{if(e[nu]){if(e[nu]._onDragOver({clientX:Cu.clientX,clientY:Cu.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);$u()}},_onTouchMove:function(t){if(Tu){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,r=t.touches?t.touches[0]:t,s=fu&&Hc(fu,!0),o=fu&&s&&s.a,a=fu&&s&&s.d,l=qu&&Gu&&Kc(Gu),h=(r.clientX-Tu.clientX+n.x)/(o||1)+(l?l[0]-Vu[0]:0)/(o||1),c=(r.clientY-Tu.clientY+n.y)/(a||1)+(l?l[1]-Vu[1]:0)/(a||1);if(!id.active&&!ku){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))n.right+10||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+10}(t,r,this)&&!m.animated){if(m===du)return L(!1);if(m&&s===t.target&&(o=m),o&&(i=qc(o)),!1!==nd(mu,s,du,e,o,i,t,!!o))return A(),s.appendChild(du),pu=s,I(),L(!0)}else if(m&&function(t,e,i){var n=qc(Yc(i.el,0,i.options,!0));return e?t.clientXc+h*s/2:lu-Ou)return-Nu}else if(l>c+h*(1-r)/2&&lu-h*s/2))return l>c+h/2?1:-1;return 0}(t,o,i,r,b?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Fu,Du===o))){var S=Zc(du);do{S-=v,_=pu.children[S]}while(_&&("none"===Vc(_,"display")||_===fu))}if(0===v||_===o)return L(!1);Du=o,Nu=v;var T=o.nextElementSibling,C=!1,P=nd(mu,s,du,e,o,i,t,C=1===v);if(!1!==P)return 1!==P&&-1!==P||(C=1===P),Hu=!0,setTimeout(sd,30),A(),C&&!T?s.appendChild(du):o.parentNode.insertBefore(du,C?T:o),w&&eu(w,0,E-w.scrollTop),pu=du.parentNode,void 0===y||Fu||(Ou=Math.abs(y-qc(o)[M])),I(),L(!0)}if(s.contains(du))return L(!1)}return!1}function R(a,l){cu(a,p,bc({evt:t,isOwner:c,axis:r?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:d,target:o,completed:L,onMove:function(i,n){return nd(mu,s,du,e,i,qc(i),t,n)},changed:I},l))}function A(){R("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function L(e){return R("dragOverCompleted",{insertion:e}),e&&(c?h._hideClone():h._showClone(p),p!==d&&(Fc(du,Su?Su.options.ghostClass:h.options.ghostClass,!1),Fc(du,a.ghostClass,!0)),Su!==p&&p!==id.active?Su=p:p===id.active&&Su&&(Su=null),d===p&&(p._ignoreWhileAnimating=o),p.animateAll((function(){R("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(o===du&&!du.animated||o===s&&!o.animated)&&(Du=null),a.dragoverBubble||t.rootEl||o===document||(du.parentNode[nu]._isOutsideThisEl(t.target),!e&&td(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){bu=Zc(du),wu=Zc(du,a.draggable),uu({sortable:p,name:"change",toEl:s,newIndex:bu,newDraggableIndex:wu,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Oc(document,"mousemove",this._onTouchMove),Oc(document,"touchmove",this._onTouchMove),Oc(document,"pointermove",this._onTouchMove),Oc(document,"dragover",td),Oc(document,"mousemove",td),Oc(document,"touchmove",td)},_offUpEvents:function(){var t=this.el.ownerDocument;Oc(t,"mouseup",this._onDrop),Oc(t,"touchend",this._onDrop),Oc(t,"pointerup",this._onDrop),Oc(t,"touchcancel",this._onDrop),Oc(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;bu=Zc(du),wu=Zc(du,i.draggable),cu("drop",this,{evt:t}),pu=du&&du.parentNode,bu=Zc(du),wu=Zc(du,i.draggable),id.eventCanceled||(ku=!1,Fu=!1,zu=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ld(this.cloneId),ld(this._dragStartId),this.nativeDraggable&&(Oc(document,"drop",this),Oc(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ac&&Vc(document.body,"user-select",""),Vc(du,"transform",""),t&&(Iu&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),fu&&fu.parentNode&&fu.parentNode.removeChild(fu),(mu===pu||Su&&"clone"!==Su.lastPutMode)&&yu&&yu.parentNode&&yu.parentNode.removeChild(yu),du&&(this.nativeDraggable&&Oc(du,"dragend",this),rd(du),du.style["will-change"]="",Iu&&!ku&&Fc(du,Su?Su.options.ghostClass:this.options.ghostClass,!1),Fc(du,this.options.chosenClass,!1),uu({sortable:this,name:"unchoose",toEl:pu,newIndex:null,newDraggableIndex:null,originalEvent:t}),mu!==pu?(bu>=0&&(uu({rootEl:pu,name:"add",toEl:pu,fromEl:mu,originalEvent:t}),uu({sortable:this,name:"remove",toEl:pu,originalEvent:t}),uu({rootEl:pu,name:"sort",toEl:pu,fromEl:mu,originalEvent:t}),uu({sortable:this,name:"sort",toEl:pu,originalEvent:t})),Su&&Su.save()):bu!==xu&&bu>=0&&(uu({sortable:this,name:"update",toEl:pu,originalEvent:t}),uu({sortable:this,name:"sort",toEl:pu,originalEvent:t})),id.active&&(null!=bu&&-1!==bu||(bu=xu,wu=Mu),uu({sortable:this,name:"end",toEl:pu,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){cu("nulling",this),mu=du=pu=fu=gu=yu=vu=_u=Tu=Cu=Iu=bu=wu=xu=Mu=Du=Nu=Su=Eu=id.dragged=id.ghost=id.clone=id.active=null,Wu.forEach((function(t){t.checked=!0})),Wu.length=Pu=Ru=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":du&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,r=i.length,s=this.options;n1&&(e=1),e<0&&(e=0);var i=document.getElementById(this._addUID("GPopacityValueDiv_ID_"+t));i&&(i.value=Math.round(100*e));var n=document.getElementById(this._addUID("GPopacityValue_ID_"+t));n&&(n.innerHTML=Math.round(100*e)+"%")},Cd.prototype._onVisibilityLayerClick=function(t){var e=this.getGlobe(),i=this._resolveLayerId(t.target.id);e.setLayerVisibility(i,t.target.checked)},Cd.prototype._updateLayerVisibility=function(t,e){var i=document.getElementById(this._addUID("GPvisibility_ID_"+t));i&&(i.checked=e)},Cd.prototype._onOpenLayerInfoClick=function(t){var e,i,n=this._resolveLayerId(t.target.id),r=this._layers[n],s=document.getElementById(t.target.id);if("GPlayerInfoOpened"===s.className)return void 0!==s.classList&&(s.classList.remove("GPlayerInfoOpened"),s.classList.add("GPlayerInfo")),void 0!==(e=document.getElementById(this._addUID("GPlayerInfoPanel"))).classList&&(e.classList.remove("GPpanel"),e.classList.remove("GPlayerInfoPanelOpened"),e.classList.add("GPlayerInfoPanelClosed")),i=document.getElementById(this._addUID("GPlayerInfoContent")),void e.removeChild(i);for(var o=document.getElementsByClassName("GPlayerInfoOpened"),a=0;a=0;n&&!i.inRange?(i.inRange=!0,document.getElementById(this._addUID("GPlayerSwitcher_ID_"+i.id)).classList.remove("outOfRange")):!n&&i.inRange&&(i.inRange=!1,document.getElementById(this._addUID("GPlayerSwitcher_ID_"+i.id)).classList.add("outOfRange"))}}},Cd.prototype._updateLayerListContainer=function(){if(this._layerListContainer){for(var t=this.getGlobe();this._layerListContainer.firstChild;)this._layerListContainer.removeChild(this._layerListContainer.firstChild);for(var e=t.getColorLayers().sort((function(t,e){return e.sequence-t.sequence})),i=0;ir.max&&(s=r.max),se.max&&(t=e.max),te&&(n=!1),n&&d&&dn&&n>c))continue}else if(!(o[a].constraints[0].minScaleDenominator=1e3&&(i/=1e3,s="km"),e.getElement().innerHTML=i+" "+s,e.getElement().style.width=r+"px"},t.isInitialized()?this._callbacks.onChangedViewCallback():t.listen(ee.EVENTS.GLOBE_INITIALIZED,this._callbacks.onChangedViewCallback),t.listen(ee.EVENTS.RANGE_CHANGED,this._callbacks.onChangedViewCallback)}else if(null==t){for(this._globe.forget(ee.EVENTS.GLOBE_INITIALIZED,this._callbacks.onChangedViewCallback),this._globe.forget(ee.EVENTS.RANGE_CHANGED,this._callbacks.onChangedViewCallback);this.getElement().hasChildNodes();)this.getElement().removeChild(this.getElement().lastChild);this.getElement().parentNode.removeChild(this.getElement())}pc.prototype.setGlobe.call(this,t)},qd.prototype._initialize=function(){this._uid=se.generate(),this._ScaleContainer=null,this._callbacks={}},qd.prototype._initContainer=function(){return this._createMainContainerElement()};var Xd=qd,Yd={_addUID:function(t){return this._uid?t+"-"+this._uid:t},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPminiglobeContainer"),t.className="GPwidget",t.style.width="100px",t.style.height="100px",t}};function Jd(t){return(Jd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zd(t){if(t=t||{},!(this instanceof Zd))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if("object"!==Jd(t))throw new Error("ERROR WRONG_TYPE : options should be an object");this._initialize();var e=this._initContainer();this._options=t,pc.call(this,{name:"Overview",element:e,target:t.target,position:t.position})}Zd.prototype=Object.create(pc.prototype,{}),re.assign(Zd.prototype,Yd),Zd.prototype.constructor=Zd,Zd.prototype.setGlobe=function(t){if(t){var e=t.getCenter(),i=new ee(this._element,e,{maxSubdivisionLevel:6,sseSubdivisionThreshold:3,noControls:!0});i.setBackground();var n=function(){var e=t.getGlobeView().camera.camera3D.position.length(),n=Math.min(Math.max(e,665e4),3e7),r=i.getGlobeView().camera.camera3D,s=t.getGlobeView().controls.getCameraTargetPosition();r.position.copy(s).setLength(n),r.lookAt(s),i.notifyChange(r)};t.listen(ee.EVENTS.AFTER_RENDER,n),t.isInitialized()?n():t.listen(ee.EVENTS.GLOBE_INITIALIZED,n);var r=this._options.layer;i.addLayer(r),this._globeObj=i}else if(null==t){for(;this.getElement().hasChildNodes();)this.getElement().removeChild(this.getElement().lastChild);this.getElement().parentNode.removeChild(this.getElement())}pc.prototype.setGlobe.call(this,t)},Zd.prototype._initialize=function(){this._uid=se.generate(),this._MiniGlobeContainer=null,this._callbacks={}},Zd.prototype._initContainer=function(){return this._createMainContainerElement()};var Kd=Zd,Qd=i(1),$d=l.getLogger("wmtsLayer");function tp(t){if(!(this instanceof tp))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!0),!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"WMTS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"WMTS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"WMTS");"EPSG:3857"===n.projection?n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):(n.projection="EPSG:4326",n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top)),0===Object.entries(n.tileMatrixSetLimits).length&&n.tileMatrixSetLimits.constructor===Object&&(n.tileMatrixSetLimits=void 0),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Qt.WMTSSource({protocol:"wmts",url:n.url.replace(/(http|https):\/\//,s),networkOptions:{crossOrigin:"omit"},updateStrategy:{type:0,options:{}},projection:n.projection,attribution:n.originators,name:t.layer,format:n.format,tileMatrixSet:n.TMSLink,tileMatrixSetLimits:n.tileMatrixSetLimits,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Kt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),re.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Qt.ColorLayer(i.id,i)}$d.error("ERROR layer id (layer name: "+t.layer+" / service: WMTS ) was not found !?")}tp.prototype.constructor=tp;var ep=tp,ip=l.getLogger("wmsLayer");function np(t){if(!(this instanceof np))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!0),!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"WMS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"WMS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"WMS");"EPSG:3857"===n.projection?n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Qt.WMSSource({protocol:"wms",version:n.version,attribution:n.originators,url:n.url.replace(/(http|https):\/\//,s),name:t.layer,projection:n.projection,style:"",heightMapWidth:256,waterMask:!1,networkOptions:{crossOrigin:"omit"},updateStrategy:{type:0,options:{}},format:n.format,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Kt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),re.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Qt.ColorLayer(i.id,i)}ip.error("ERROR layer id (layer name: "+t.layer+" / service: WMS ) was not found !?")}np.prototype.constructor=np;var rp=np,sp=l.getLogger("elevationLayer");function op(t){if(!(this instanceof op))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!1),!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"WMTS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"WMTS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"WMTS");"EPSG:3857"===n.projection?n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):(n.projection="EPSG:4326",n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top)),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s="undefined"!=typeof window?window:"undefined"!=typeof self?self:null,o=s?s.location&&s.location.protocol&&0===s.location.protocol.indexOf("https:")?"https://":"http://":t.ssl?"https://":"http://";return i.id=e,i.noDataValue=-99999,i.updateStrategy={type:0,options:{groups:[11,14]}},i.source=new Qt.WMTSSource({protocol:"wmts",url:n.url.replace(/(http|https):\/\//,o),networkOptions:{crossOrigin:"omit"},attribution:n.originators,projection:n.projection,name:t.layer,format:"image/x-bil;bits=32",tileMatrixSet:n.TMSLink,tileMatrixSetLimits:n.tileMatrixSetLimits,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Kt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),re.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Qt.ElevationLayer(i.id,i)}sp.log("[source WMTS] ERROR : "+t.layer+" cannot be found in Geoportal Configuration. Make sure that this resource is included in your contract key.")}op.prototype.constructor=op;var ap=op,lp=l.getLogger("vectorTileLayer");function hp(t){if(!(this instanceof hp))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"TMS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"TMS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"TMS"),r=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Qt.VectorTilesSource({style:n.url.replace(/(http|https):\/\//,r),url:t.urlService,attribution:t.attributions,filter:t.filter,zoom:t.zoom}),i.isValidData=function(){return!1},new Qt.ColorLayer(i.id,i)}lp.error("ERROR layer id (layer name: "+t.layer+" / service: TMS ) was not found !?")}hp.prototype.constructor=hp;var cp=hp;!function(){var t=document.getElementsByTagName("script"),e=t[t.length-1].getAttribute("data-key"),i=t[t.length-1].getAttribute("data-url"),n=t[t.length-1].getAttribute("data-timeout");if(e||i){var r={apiKey:e,sync:!0,onSuccess:function(){},onFailure:function(t){throw new Error("Configuration load failed : "+t.message)}};i&&(r.customConfigFile=i,r.callbackSuffix=""),n&&(r.timeOut=n),window.Gp||Kt.Services.getConfig(r)}}();var up={proxifyUrl:function(t,e){var i=l.getLogger("proxifyUrl");if(!e||!e.hasOwnProperty("proxyUrl")||null===e.proxyUrl||0===e.proxyUrl.trim().length)return t;if(e.noProxyDomains&&Array.isArray(e.noProxyDomains)&&e.noProxyDomains.length>0)for(var n in e.noProxyDomains)if(i.trace("[ProxyUtils] proxifyUrl : analyzing "+e.noProxyDomains[n]),-1!==t.indexOf(e.noProxyDomains[n]))return i.info("[ProxyUtils] proxifyUrl : "+t+" found in noProxyDomains list ("+e.noProxyDomains[n]+")."),t;return e.proxyUrl+encodeURIComponent(t)}},dp={hex:function(t){if(t>255)throw new Error("'"+t+"'' is greater than 255(0xff);");return("0"+Number(t).toString(16)).slice(-2)},num:function(t){return parseInt(t,16)},arrayToRgba:function(t){if(!Array.isArray(t))throw new Error("Not an array !");var e=t[0],i=t[1],n=t[2],r=t[3]||1;return"rgba("+e+", "+i+", "+n+", "+parseFloat(r)+")"},arrayToHex:function(t){if(!Array.isArray(t))throw new Error("Not an array !");var e=t[0],i=t[1],n=t[2],r=t[3],s=[this.hex(e),this.hex(i),this.hex(n)],o={};return o.hex="#"+s.join(""),r&&(o.opacity=parseFloat(r)),o},rgbaToHex:function(t){var e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/.exec(t);if(!e)throw new Error("Invalid format: "+t);var i=e[1],n=e[2],r=e[3],s=e[4],o=[this.hex(i),this.hex(n),this.hex(r)],a={};return a.hex="#"+o.join(""),s&&(a.opacity=parseFloat(s)),a},hexToRgba:function(t,e){if(!t)throw new Error("Invalid format");t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return(i=i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null)?"rgba("+i.r+", "+i.g+", "+i.b+", "+e+")":null},isHex:function(t){if(!t)return!1;if("#"!==t.charAt(0))return!1;return!!/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t)},isRGB:function(t){if(!t)return!1;return!!/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/.exec(t)}},pp={modulo:function(t,e){var i=t%e;return i*e<0?i+e:i},decimalToDMS:function(t,e,i){var n=this.modulo(t+180,360)-180,r=Math.abs(3600*n),s=i||0,o=Math.pow(10,s),a=Math.floor(r/3600),l=Math.floor((r-3600*a)/60),h=r-3600*a-60*l;return(h=Math.ceil(h*o)/o)>=60&&(h=0,l+=1),l>=60&&(l=0,a+=1),{d:a,m:l,s:h,direction:e.charAt(n<0?1:0)}},toInteger:function(t,e){var i=parseInt(t,e||10);return!isNaN(i)&&isFinite(i)?i:null},isInteger:function(t){if(isNaN(t))return!1;var e=parseFloat(t);return(0|e)===e},toFloat:function(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}};function fp(t){return(fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var mp=Kt.Services,gp=Kt.Error,vp=Kt.Helper,yp=Kt.Protocols,_p=Kt.servicesDate,xp=Kt.servicesVersion;function bp(t,e){return function t(e,i){for(var n in e)e.hasOwnProperty(n)&&(i.hasOwnProperty(n)?"object"===fp(e[n])&&t(e[n],i[n]):i[n]=e[n])}(t,e)}var Mp=r.itownsExtVersion||r.version,wp=r.date,Ep={control:{}};Ep.control.MousePosition=_c,Ep.control.LayerSwitcher=Pd,Ep.control.BoostRelief=Dd,Ep.control.Buildings=kd,Ep.control.Attributions=Hd,Ep.control.Scale=Xd,Ep.control.MiniGlobe=Kd,Ep.layer={},Ep.layer.GeoportalWMTS=ep,Ep.layer.GeoportalWMS=rp,Ep.layer.GeoportalElevation=ap,Ep.layer.VectorTileLayer=cp,Ep.CRS=mc,Ep.GlobeViewExtended=ee,window.itowns&&(bp(Ep,window.itowns),bp(window.itowns,Ep))}])})); \ No newline at end of file diff --git a/current/dist/itowns/Itowns/Controls/Buildings.d.ts b/current/dist/itowns/Itowns/Controls/Buildings.d.ts index 9efb96783..cc5452043 100644 --- a/current/dist/itowns/Itowns/Controls/Buildings.d.ts +++ b/current/dist/itowns/Itowns/Controls/Buildings.d.ts @@ -7,7 +7,6 @@ export default Buildings; * @extends {itowns.control.Widget} * @alias itowns.control.Buildings * @param {Object} buildingsOptions - control options - * @param {String} [buildingsOptions.key = "essentiels"] - key to use to adds the buildings layer – “essentiels” by default * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation @@ -20,7 +19,6 @@ export default Buildings; * }) */ declare function Buildings(buildingsOptions: { - key?: string | undefined; MNT?: boolean | undefined; buildingsOnGround?: boolean | undefined; defaultVisibility?: boolean | undefined; @@ -35,7 +33,6 @@ declare class Buildings { * @extends {itowns.control.Widget} * @alias itowns.control.Buildings * @param {Object} buildingsOptions - control options - * @param {String} [buildingsOptions.key = "essentiels"] - key to use to adds the buildings layer – “essentiels” by default * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation @@ -48,7 +45,6 @@ declare class Buildings { * }) */ constructor(buildingsOptions: { - key?: string | undefined; MNT?: boolean | undefined; buildingsOnGround?: boolean | undefined; defaultVisibility?: boolean | undefined; @@ -79,7 +75,6 @@ declare class Buildings { * @param {options} options for the buildings control */ addBuildings(options: { - key?: string | undefined; MNT?: boolean | undefined; buildingsOnGround?: boolean | undefined; defaultVisibility?: boolean | undefined; diff --git a/current/dist/itowns/Itowns/Controls/Buildings.d.ts.map b/current/dist/itowns/Itowns/Controls/Buildings.d.ts.map index da3ef7fd9..6d9220753 100644 --- a/current/dist/itowns/Itowns/Controls/Buildings.d.ts.map +++ b/current/dist/itowns/Itowns/Controls/Buildings.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Buildings.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/Buildings.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAZqC,GAAG;IACF,GAAG;IACH,iBAAiB;IACjB,iBAAiB;IACjB,OAAO;SAgC5C;;IA5CD;;;;;;;;;;;;;;;;;;;OAmBG;IACH;QAZqC,GAAG;QACF,GAAG;QACH,iBAAiB;QACjB,iBAAiB;QACjB,OAAO;OAgC5C;IAUD;;;;OAIG;IACH,oBAA+B;IAM/B;;;;OAIG;IACH,yCASC;IAaiC,oBASjC;IAPG,yBAAiC;IAGjC,6BAAuB;IAGvB,2BAAoB;IAWa,uBAQpC;IAS4B,eAoG5B;IAED;;;;;OAKG;IACH;;;;;;aAuDC;IAED;;;;;OAKG;IACH,6CAQC;IAW4C,+BAQ5C;IAUmC,sBASnC;IASiC,oBAIjC;IASgC,mBAchC"} \ No newline at end of file +{"version":3,"file":"Buildings.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/Buildings.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAXsC,GAAG;IACH,iBAAiB;IACjB,iBAAiB;IACjB,OAAO;SAgC5C;;IA3CD;;;;;;;;;;;;;;;;;;OAkBG;IACH;QAXsC,GAAG;QACH,iBAAiB;QACjB,iBAAiB;QACjB,OAAO;OAgC5C;IAUD;;;;OAIG;IACH,oBAA+B;IAM/B;;;;OAIG;IACH,yCASC;IAaiC,oBASjC;IAPG,yBAAiC;IAGjC,6BAAuB;IAGvB,2BAAoB;IAWa,uBAQpC;IAS4B,eAoG5B;IAED;;;;;OAKG;IACH;;;;;aAuDC;IAED;;;;;OAKG;IACH,6CAQC;IAW4C,+BAQ5C;IAUmC,sBASnC;IASiC,oBAIjC;IASgC,mBAahC"} \ No newline at end of file diff --git a/current/jsdoc/itowns/GlobeViewExtended.html b/current/jsdoc/itowns/GlobeViewExtended.html index fc5d248d7..0ae3fed1e 100644 --- a/current/jsdoc/itowns/GlobeViewExtended.html +++ b/current/jsdoc/itowns/GlobeViewExtended.html @@ -9007,7 +9007,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:48 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/global.html b/current/jsdoc/itowns/global.html index ca19c991c..ace52ae44 100644 --- a/current/jsdoc/itowns/global.html +++ b/current/jsdoc/itowns/global.html @@ -2336,7 +2336,7 @@

- Itowns/Controls/Buildings.js, line 243 + Itowns/Controls/Buildings.js, line 242
@@ -2570,7 +2570,7 @@

- Itowns/Controls/Buildings.js, line 306 + Itowns/Controls/Buildings.js, line 305
@@ -2835,7 +2835,7 @@

Properties:
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:48 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/index.html b/current/jsdoc/itowns/index.html index 607763096..32363ba73 100644 --- a/current/jsdoc/itowns/index.html +++ b/current/jsdoc/itowns/index.html @@ -2289,7 +2289,7 @@

Geoportal Controls

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:48 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.Attributions.html b/current/jsdoc/itowns/itowns.control.Attributions.html index fa8364052..86f108792 100644 --- a/current/jsdoc/itowns/itowns.control.Attributions.html +++ b/current/jsdoc/itowns/itowns.control.Attributions.html @@ -3504,7 +3504,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:48 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.BoostRelief.html b/current/jsdoc/itowns/itowns.control.BoostRelief.html index 922ca591e..52829e66a 100644 --- a/current/jsdoc/itowns/itowns.control.BoostRelief.html +++ b/current/jsdoc/itowns/itowns.control.BoostRelief.html @@ -3633,7 +3633,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:48 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.Buildings.html b/current/jsdoc/itowns/itowns.control.Buildings.html index fa0adc7b4..55297ec00 100644 --- a/current/jsdoc/itowns/itowns.control.Buildings.html +++ b/current/jsdoc/itowns/itowns.control.Buildings.html @@ -2241,7 +2241,7 @@

- Itowns/Controls/Buildings.js, line 33 + Itowns/Controls/Buildings.js, line 32
@@ -2318,42 +2318,6 @@

- - - key - - - - - -String - - - - - - - - - "essentiels" - - - - - - - - optional - - - - - -

key to use to adds the buildings layer – “essentiels” by default

- - - - MNT @@ -3002,7 +2966,7 @@

- Itowns/Controls/Buildings.js, line 83 + Itowns/Controls/Buildings.js, line 82
@@ -3275,7 +3239,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.LayerSwitcher.html b/current/jsdoc/itowns/itowns.control.LayerSwitcher.html index 687f3664e..e48dc1ff1 100644 --- a/current/jsdoc/itowns/itowns.control.LayerSwitcher.html +++ b/current/jsdoc/itowns/itowns.control.LayerSwitcher.html @@ -4255,7 +4255,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.MiniGlobe.html b/current/jsdoc/itowns/itowns.control.MiniGlobe.html index 589ebca2c..8ee480bb6 100644 --- a/current/jsdoc/itowns/itowns.control.MiniGlobe.html +++ b/current/jsdoc/itowns/itowns.control.MiniGlobe.html @@ -3245,7 +3245,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.MousePosition.html b/current/jsdoc/itowns/itowns.control.MousePosition.html index f9edf9e6b..65844bc71 100644 --- a/current/jsdoc/itowns/itowns.control.MousePosition.html +++ b/current/jsdoc/itowns/itowns.control.MousePosition.html @@ -4531,7 +4531,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.Scale.html b/current/jsdoc/itowns/itowns.control.Scale.html index 7b5f08a32..16aa68531 100644 --- a/current/jsdoc/itowns/itowns.control.Scale.html +++ b/current/jsdoc/itowns/itowns.control.Scale.html @@ -3254,7 +3254,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.control.Widget.html b/current/jsdoc/itowns/itowns.control.Widget.html index 11e9c8ad2..c6ca20021 100644 --- a/current/jsdoc/itowns/itowns.control.Widget.html +++ b/current/jsdoc/itowns/itowns.control.Widget.html @@ -3419,7 +3419,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.layer.GeoportalElevation.html b/current/jsdoc/itowns/itowns.layer.GeoportalElevation.html index cf5c4832a..a2609a061 100644 --- a/current/jsdoc/itowns/itowns.layer.GeoportalElevation.html +++ b/current/jsdoc/itowns/itowns.layer.GeoportalElevation.html @@ -2680,7 +2680,7 @@

Example
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.layer.GeoportalWMS.html b/current/jsdoc/itowns/itowns.layer.GeoportalWMS.html index 8ec60b9c5..6a27dd753 100644 --- a/current/jsdoc/itowns/itowns.layer.GeoportalWMS.html +++ b/current/jsdoc/itowns/itowns.layer.GeoportalWMS.html @@ -2720,7 +2720,7 @@
Example
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.layer.GeoportalWMTS.html b/current/jsdoc/itowns/itowns.layer.GeoportalWMTS.html index c226d29e7..85b9f0dac 100644 --- a/current/jsdoc/itowns/itowns.layer.GeoportalWMTS.html +++ b/current/jsdoc/itowns/itowns.layer.GeoportalWMTS.html @@ -2720,7 +2720,7 @@
Example
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/itowns.layer.VectorTileLayer.html b/current/jsdoc/itowns/itowns.layer.VectorTileLayer.html index 0eefb692c..e4a526ad6 100644 --- a/current/jsdoc/itowns/itowns.layer.VectorTileLayer.html +++ b/current/jsdoc/itowns/itowns.layer.VectorTileLayer.html @@ -2618,7 +2618,7 @@
Example
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-ColorUtils.html b/current/jsdoc/itowns/module-ColorUtils.html index 40742ad1c..9d3d5d9f6 100644 --- a/current/jsdoc/itowns/module-ColorUtils.html +++ b/current/jsdoc/itowns/module-ColorUtils.html @@ -2846,7 +2846,7 @@
Returns:
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-Config.html b/current/jsdoc/itowns/module-Config.html index abd3193b8..0b81cf990 100644 --- a/current/jsdoc/itowns/module-Config.html +++ b/current/jsdoc/itowns/module-Config.html @@ -2304,7 +2304,7 @@

Example

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-Draggable.html b/current/jsdoc/itowns/module-Draggable.html index 2bb97e756..903675500 100644 --- a/current/jsdoc/itowns/module-Draggable.html +++ b/current/jsdoc/itowns/module-Draggable.html @@ -2500,7 +2500,7 @@
Example
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-Gp.html b/current/jsdoc/itowns/module-Gp.html index 15d30a9d8..314757f03 100644 --- a/current/jsdoc/itowns/module-Gp.html +++ b/current/jsdoc/itowns/module-Gp.html @@ -2775,7 +2775,7 @@

stati
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-LayerUtils.html b/current/jsdoc/itowns/module-LayerUtils.html index 3b651bbb7..7b668039a 100644 --- a/current/jsdoc/itowns/module-LayerUtils.html +++ b/current/jsdoc/itowns/module-LayerUtils.html @@ -2875,7 +2875,7 @@
Returns:
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-LoggerByDefault.html b/current/jsdoc/itowns/module-LoggerByDefault.html index f6c39a727..f2497ebdf 100644 --- a/current/jsdoc/itowns/module-LoggerByDefault.html +++ b/current/jsdoc/itowns/module-LoggerByDefault.html @@ -2590,7 +2590,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-MathUtils.html b/current/jsdoc/itowns/module-MathUtils.html index 5c0e8f27f..745b3b5f6 100644 --- a/current/jsdoc/itowns/module-MathUtils.html +++ b/current/jsdoc/itowns/module-MathUtils.html @@ -3028,7 +3028,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-Parser.html b/current/jsdoc/itowns/module-Parser.html index 7d1135d7d..b37966d88 100644 --- a/current/jsdoc/itowns/module-Parser.html +++ b/current/jsdoc/itowns/module-Parser.html @@ -2305,7 +2305,7 @@

Example

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-ProfileElevationPathDOM.html b/current/jsdoc/itowns/module-ProfileElevationPathDOM.html index 6584a4c9e..07ba326ed 100644 --- a/current/jsdoc/itowns/module-ProfileElevationPathDOM.html +++ b/current/jsdoc/itowns/module-ProfileElevationPathDOM.html @@ -2296,7 +2296,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-ProxyUtils.html b/current/jsdoc/itowns/module-ProxyUtils.html index 29ac28664..684e1b37f 100644 --- a/current/jsdoc/itowns/module-ProxyUtils.html +++ b/current/jsdoc/itowns/module-ProxyUtils.html @@ -2551,7 +2551,7 @@

Returns:
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-Register.html b/current/jsdoc/itowns/module-Register.html index 37f95b6e8..7236862ab 100644 --- a/current/jsdoc/itowns/module-Register.html +++ b/current/jsdoc/itowns/module-Register.html @@ -2971,7 +2971,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-SearchEngineUtils.html b/current/jsdoc/itowns/module-SearchEngineUtils.html index 8d1338c5a..5bf293e78 100644 --- a/current/jsdoc/itowns/module-SearchEngineUtils.html +++ b/current/jsdoc/itowns/module-SearchEngineUtils.html @@ -2507,7 +2507,7 @@

Returns:
Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-SelectorID.html b/current/jsdoc/itowns/module-SelectorID.html index e2bc1f37b..dbf13550a 100644 --- a/current/jsdoc/itowns/module-SelectorID.html +++ b/current/jsdoc/itowns/module-SelectorID.html @@ -2752,7 +2752,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/current/jsdoc/itowns/module-Utils.html b/current/jsdoc/itowns/module-Utils.html index 5c4d681ad..b45997628 100644 --- a/current/jsdoc/itowns/module-Utils.html +++ b/current/jsdoc/itowns/module-Utils.html @@ -2702,7 +2702,7 @@

Geoportail - Copyright (c) IGN, released under the CECILL-B license
- Documentation generated by JSDoc 3.6.11 on Fri Aug 04 2023 16:17:49 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time)
diff --git a/itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts new file mode 100644 index 000000000..c52c8b503 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts @@ -0,0 +1,10 @@ +export default AttributionDOM; +declare namespace AttributionDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createMainAttributionsShowElement(): DOMElement; + function _createAttributionsList(): DOMElement; + function _createMainAttributionsListContainer(): DOMElement; + function _createMainPictoElement(collapsed: boolean): DOMElement; +} +//# sourceMappingURL=AttributionDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts.map new file mode 100644 index 000000000..bb71a361d --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/AttributionDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributionDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/AttributionDOM.js"],"names":[],"mappings":";;IAYc,qCAGT;IAO6B,mDAM7B;IAOoC,0DAKpC;IAOyB,+CAIzB;IAOsC,4DAKtC;IAOyB,iEAqBzB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts new file mode 100644 index 000000000..9925da69a --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts @@ -0,0 +1,11 @@ +export default BoostReliefDOM; +declare namespace BoostReliefDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createMainBoostReliefShowElement(collapsed: boolean): DOMElement; + function _createAdvancedToolElement(brOptions: Object): DOMElement; + function _createAdvancedToolReliefElement(scale: Object, defaultBoost: number): DOMElement[]; + function _createMainBoostReliefListContainer(): DOMElement; + function _createMainPictoElement(): DOMElement; +} +//# sourceMappingURL=BoostReliefDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts.map new file mode 100644 index 000000000..ced06364f --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/BoostReliefDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BoostReliefDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/BoostReliefDOM.js"],"names":[],"mappings":";;IAWc,qCAGT;IAO6B,mDAK7B;IASmC,2EAQnC;IAa4B,mEAc5B;IASkC,6FAgHlC;IAOqC,2DAMrC;IASyB,+CAyBzB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts new file mode 100644 index 000000000..95b86c5cc --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts @@ -0,0 +1,7 @@ +export default BuildingsDOM; +declare namespace BuildingsDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createMainPictoElement(): DOMElement; +} +//# sourceMappingURL=BuildingsDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts.map new file mode 100644 index 000000000..c0fdd1394 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/BuildingsDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BuildingsDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/BuildingsDOM.js"],"names":[],"mappings":";;IAWc,qCAGT;IAO6B,mDAK7B;IASyB,+CAKzB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts new file mode 100644 index 000000000..00a145531 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts @@ -0,0 +1,3 @@ +export default DrawingDOM; +declare var DrawingDOM: any; +//# sourceMappingURL=DrawingDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts.map new file mode 100644 index 000000000..8bf44b186 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/DrawingDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DrawingDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/DrawingDOM.js"],"names":[],"mappings":";AAIA,4BA+sBE"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts new file mode 100644 index 000000000..e6ee82035 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts @@ -0,0 +1,5 @@ +export default EditorDOM; +declare namespace EditorDOM { + function _addUID(id: string): string; +} +//# sourceMappingURL=EditorDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts.map new file mode 100644 index 000000000..c1d7682cb --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/Editor/EditorDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EditorDOM.d.ts","sourceRoot":"","sources":["../../../../../src/Common/Controls/Editor/EditorDOM.js"],"names":[],"mappings":";;IAOc,qCAGT"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts new file mode 100644 index 000000000..72ceb6f58 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts @@ -0,0 +1,14 @@ +export default ElevationPathDOM; +declare namespace ElevationPathDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowElevationPathElement(): DOMElement; + function _createShowElevationPathPictoElement(): DOMElement; + function _createElevationPathPanelElement(): DOMElement; + function _createElevationPathPanelHeaderElement(): DOMElement; + function _createElevationPathPanelProfilElement(): DOMElement; + function _createElevationPathWaitingElement(): DOMElement; + function _createElevationPathInformationsElement(): DOMElement; + function _addElevationPathInformationsItem(value: string): DOMElement; +} +//# sourceMappingURL=ElevationPathDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts.map new file mode 100644 index 000000000..bc5f48f96 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ElevationPathDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ElevationPathDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/ElevationPathDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAWiC,uDAKjC;IAQsC,4DA8BtC;IAekC,wDASlC;IAOwC,8DA0ExC;IAQwC,8DAKxC;IAOoC,0DAYpC;IAOyC,+DAWzC;IAQmC,sEAWnC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts new file mode 100644 index 000000000..5bba9d425 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts @@ -0,0 +1,5 @@ +export default ExportDOM; +declare namespace ExportDOM { + function _addUID(id: string): string; +} +//# sourceMappingURL=ExportDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts.map new file mode 100644 index 000000000..1f3f92344 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ExportDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExportDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/ExportDOM.js"],"names":[],"mappings":";;IAOc,qCAGT"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts new file mode 100644 index 000000000..c5e1680e7 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts @@ -0,0 +1,8 @@ +export default GetFeatureInfoDOM; +declare namespace GetFeatureInfoDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createActivateGetFeatureInfoElement(activate: boolean): DOMElement; + function _createMainPictoElement(): DOMElement; +} +//# sourceMappingURL=GetFeatureInfoDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts.map new file mode 100644 index 000000000..949e12c80 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/GetFeatureInfoDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GetFeatureInfoDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/GetFeatureInfoDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAYsC,6EActC;IAMyB,+CAmBzB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts new file mode 100644 index 000000000..240752b2e --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts @@ -0,0 +1,26 @@ +export default IsoDOM; +declare namespace IsoDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowIsoElement(): DOMElement; + function _createShowIsoPictoElement(): DOMElement; + function _createIsoPanelElement(): DOMElement; + function _createIsoPanelHeaderElement(): DOMElement; + function _createIsoPanelFormElement(): DOMElement; + function _createIsoWaitingElement(): DOMElement; + function _createIsoPanelFormTypeChoiceElement(): DOMElement; + function _createIsoPanelFormTypeChoiceChronElement(checked: boolean): DOMElement; + function _createIsoPanelFormTypeChoiceDistElement(checked: boolean): DOMElement; + function _createIsoPanelFormValueIsochronElement(checked: boolean): DOMElement; + function _createIsoPanelFormValueIsodistanceElement(checked: boolean): DOMElement; + function _createIsoPanelFormModeChoiceElement(): DOMElement; + function _createIsoPanelFormModeChoiceTransportElement(transports: any[]): DOMElement; + function _createIsoPanelFormModeChoiceDirectionElement(directions: any[]): DOMElement; + function _createShowIsoExclusionsElement(): DOMElement; + function _createShowIsoExclusionsPictoElement(): DOMElement; + function _createIsoPanelFormExclusionsElement(): DOMElement; + function _createIsoPanelFormExclusionOptionsElement(exclusions: any[]): DOMElement; + function _createIsoSubmitFormElement(): DOMElement; + function _createIsoFormResetElement(): DOMElement; +} +//# sourceMappingURL=IsoDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts.map new file mode 100644 index 000000000..e2f631c75 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/IsoDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"IsoDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/IsoDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAWuB,6CAKvB;IAQ4B,kDA8B5B;IAewB,8CASxB;IAO8B,oDAoD9B;IAQ4B,kDAc5B;IAO0B,gDAY1B;IAesC,4DAQtC;IAS2C,iFAgD3C;IAS0C,gFAgD1C;IAYyC,+EAkEzC;IAQ4C,kFAwC5C;IAesC,4DAQtC;IAS+C,sFAgF/C;IAS+C,sFA8C/C;IAWiC,uDAKjC;IAOsC,4DAStC;IAOsC,4DAYtC;IAS4C,mFAoG5C;IAW6B,mDAQ7B;IAW4B,kDAW5B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts new file mode 100644 index 000000000..80ecbef76 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts @@ -0,0 +1,42 @@ +export default LayerImportDOM; +declare namespace LayerImportDOM { + function _addUID(id: string): string; + function _createLoadingElement(): DOMElement; + function _createMainContainerElement(): DOMElement; + function _createShowImportElement(): DOMElement; + function _createShowImportPictoElement(): DOMElement; + function _createImportPanelElement(): DOMElement; + function _createImportPanelHeaderElement(): DOMElement; + function _createImportPanelTitleElement(): DOMElement; + function _createImportPanelCloseElement(): DOMElement; + function _createImportPanelFormElement(): DOMElement; + function _createImportTypeLineElement(importTypes: any[]): DOMElement; + function _createImportWaitingElement(): DOMElement; + function _createImportStaticParamsContainer(currentType: string): DOMElement; + function _createStaticNameLabel(): DOMElement; + function _createStaticModeChoiceDiv(): DOMElement; + function _createStaticLocalChoiceDiv(): DOMElement; + function _createStaticUrlChoiceDiv(): DOMElement; + function _createStaticLocalInputDiv(): DOMElement; + function _createStaticLocalInputLabel(): DOMElement; + function _createStaticLocalInput(): DOMElement; + function _createStaticUrlInputDiv(): DOMElement; + function _createStaticUrlInputLabel(): DOMElement; + function _createStaticUrlInput(): DOMElement; + function _createServiceParamsContainer(currentType: string): DOMElement; + function _createServiceUrlDiv(): DOMElement; + function _createServiceUrlInputLabel(): DOMElement; + function _createServiceUrlInput(): DOMElement; + function _createImportSubmitFormElement(): DOMElement; + function _createImportGetCapPanelElement(): DOMElement; + function _createImportGetCapPanelHeaderElement(): DOMElement; + function _createImportGetCapResultsContainer(): DOMElement; + function _addImportGetCapResultListRubrique(title: any, container: any): any; + function _addImportGetCapResultRubrique(title: any, container: any): any; + function _addImportGetCapResultListLayer(container: any): any; + function _addImportGetCapResultLayer(description: any, id: any, container: any): any; + function _createImportMapBoxPanelElement(): DOMElement; + function _createImportMapBoxPanelHeaderElement(): DOMElement; + function _createImportMapBoxResultsContainer(): DOMElement; +} +//# sourceMappingURL=LayerImportDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts.map new file mode 100644 index 000000000..ed8c594f5 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/LayerImportDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LayerImportDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/LayerImportDOM.js"],"names":[],"mappings":";;IASc,qCAGT;IAOuB,6CAKvB;IAO6B,mDAK7B;IAW0B,gDAK1B;IAO+B,qDA2B/B;IAW2B,iDAM3B;IAOiC,uDAYjC;IAOgC,sDAKhC;IAOgC,sDAqBhC;IAY+B,qDAsB/B;IAQ8B,sEAsE9B;IAO6B,mDAY7B;IAWoC,6EAUpC;IAOwB,8CAkBxB;IAO4B,kDAI5B;IAO6B,mDAmC7B;IAO2B,iDAmC3B;IAO4B,kDAK5B;IAO8B,oDAO9B;IAOyB,+CAMzB;IAO0B,gDAK1B;IAO4B,kDAO5B;IAOuB,6CAMvB;IAW+B,wEAU/B;IAOsB,4CAItB;IAO6B,mDAO7B;IAOwB,8CAMxB;IAWgC,sDAQhC;IAWiC,uDAKjC;IAOuC,6DAmCvC;IAOqC,2DAMrC;IAEoC,6EAOpC;IAEgC,yEAqBhC;IAEiC,8DAMjC;IAE6B,qFAoB7B;IAWiC,uDAKjC;IAOuC,6DAuDvC;IAOqC,2DAKrC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts new file mode 100644 index 000000000..a0712978e --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts @@ -0,0 +1,28 @@ +export default LayerSwitcherDOM; +declare namespace LayerSwitcherDOM { + function _createDraggableElement(elementDraggable: Object, context: Object): void; + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createMainLayersShowElement(): DOMElement; + function _createMainLayersElement(): DOMElement; + function _createMainPictoElement(): DOMElement; + function _createMainInfoElement(): DOMElement; + function _createContainerLayerElement(obj: { + layer: Object; + id: string; + title: string; + description: string; + visibility: boolean; + opacity: Float; + }): DOMElement; + function _createBasicToolElement(obj: Object): DOMElement; + function _createBasicToolNameElement(obj: Object): DOMElement; + function _createBasicToolVisibilityElement(obj: Object): DOMElement[]; + function _createAdvancedToolShowElement(obj: Object): DOMElement[]; + function _createAdvancedToolElement(obj: Object): DOMElement; + function _createAdvancedToolDeleteElement(obj: Object): DOMElement; + function _createAdvancedToolInformationElement(obj: Object): DOMElement; + function _createAdvancedToolOpacityElement(obj: Object): DOMElement[]; + function _createContainerLayerInfoElement(obj: Object): DOMElement; +} +//# sourceMappingURL=LayerSwitcherDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts.map new file mode 100644 index 000000000..c425102af --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/LayerSwitcherDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LayerSwitcherDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/LayerSwitcherDOM.js"],"names":[],"mappings":";;IAU8B,kFA8BzB;IAWS,qCAGT;IAO6B,mDAK7B;IAO8B,oDAM9B;IAO0B,gDAS1B;IAOyB,+CA6CzB;IAOwB,8CAOxB;IAmB8B;;;;;;;mBAsC9B;IAayB,0DAmBzB;IAS6B,8DAU7B;IASmC,sEA4CnC;IASgC,mEAoBhC;IAS4B,6DA0B5B;IASkC,mEA6BlC;IASuC,wEA6BvC;IASmC,sEA+EnC;IAgBkC,mEA4HlC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts new file mode 100644 index 000000000..bdc355683 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts @@ -0,0 +1,17 @@ +export default LocationSelectorDOM; +declare namespace LocationSelectorDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createLocationPointElement(id: number, display: number): DOMElement; + function _createLocationPointLabelElement(id: number, text: string): DOMElement; + function _createLocationAutoCompleteteInputElement(id: number): DOMElement; + function _createLocationCoordinateInputElement(id: number): DOMElement; + function _createLocationPointerShowInputElement(id: number): DOMElement; + function _createLocationPointerInputElement(id: number): DOMElement; + function _createLocationRemovePointElement(id: number): DOMElement; + function _createLocationAddPointElement(): DOMElement; + function _createLocationAutoCompleteResultElement(id: number): DOMElement; + function _createLocationAutoCompletedLocationElement(id: number, location: Object, n: number): void; + function GPdisplayCoordinate(value: string): void; +} +//# sourceMappingURL=LocationSelectorDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts.map new file mode 100644 index 000000000..9b6d13b9f --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/LocationSelectorDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LocationSelectorDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/LocationSelectorDOM.js"],"names":[],"mappings":";;IAac,qCAGT;IAO6B,mDAK7B;IAU6B,8EAO7B;IAUkC,gFAiClC;IAQ2C,2EAgG3C;IAQuC,uEAcvC;IAQwC,wEAKxC;IAQoC,oEAyEpC;IASmC,mEAoCnC;IAQgC,sDAwChC;IAS0C,0EAqB1C;IAY6C,oGAS7C;IAMqB,kDAuBrB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts new file mode 100644 index 000000000..16f2579bc --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts @@ -0,0 +1,8 @@ +export default MeasureAreaDOM; +declare namespace MeasureAreaDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowMeasureAreaElement(): DOMElement; + function _createShowMeasureAreaPictoElement(): DOMElement; +} +//# sourceMappingURL=MeasureAreaDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts.map new file mode 100644 index 000000000..5df3b26c7 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAreaDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MeasureAreaDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/MeasureAreaDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAW+B,qDAK/B;IAQoC,0DA8BpC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts new file mode 100644 index 000000000..ddafd68c1 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts @@ -0,0 +1,8 @@ +export default MeasureAzimuthDOM; +declare namespace MeasureAzimuthDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowMeasureAzimuthElement(): DOMElement; + function _createShowMeasureAzimuthPictoElement(): DOMElement; +} +//# sourceMappingURL=MeasureAzimuthDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts.map new file mode 100644 index 000000000..b5a9c3016 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureAzimuthDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MeasureAzimuthDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/MeasureAzimuthDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAWkC,wDAKlC;IAQuC,6DA8BvC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts new file mode 100644 index 000000000..c9e8c56c9 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts @@ -0,0 +1,8 @@ +export default MeasureLengthDOM; +declare namespace MeasureLengthDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowMeasureLengthElement(): DOMElement; + function _createShowMeasureLengthPictoElement(): DOMElement; +} +//# sourceMappingURL=MeasureLengthDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts.map new file mode 100644 index 000000000..bec5b39c8 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureLengthDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MeasureLengthDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/MeasureLengthDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAWiC,uDAKjC;IAQsC,4DA8BtC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts new file mode 100644 index 000000000..01b2cd7cb --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts @@ -0,0 +1,11 @@ +export default MeasureToolBoxDOM; +declare namespace MeasureToolBoxDOM { + const _toolboxId: string; + const _buttonId: string; + const _widgetId: string; + function getToolBoxID(uid: number): string; + function getButtonID(uid: number): string; + function getWidgetID(uid: number): string; + function _createToolBoxContainerElement(uid: number): DOMElement; +} +//# sourceMappingURL=MeasureToolBoxDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts.map new file mode 100644 index 000000000..c96568285 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MeasureToolBoxDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MeasureToolBoxDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/MeasureToolBoxDOM.js"],"names":[],"mappings":";;;;;IAWmB,2CAEd;IAOa,0CAEb;IAOa,0CAEb;IAOgC,iEA4DhC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts new file mode 100644 index 000000000..23ea89199 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts @@ -0,0 +1,6 @@ +export default MiniGlobeDOM; +declare namespace MiniGlobeDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; +} +//# sourceMappingURL=MiniGlobeDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts.map new file mode 100644 index 000000000..66408d948 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MiniGlobeDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniGlobeDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/MiniGlobeDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAO7B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts new file mode 100644 index 000000000..4c622a5ba --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts @@ -0,0 +1,30 @@ +export default MousePositionDOM; +declare namespace MousePositionDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowMousePositionElement(): DOMElement; + function _createShowMousePositionPictoElement(isDesktop: boolean): DOMElement; + function _createMousePositionPanelElement(): DOMElement; + function _createMapCenter(): DOMElement; + function _createMousePositionPanelHeaderElement(): DOMElement; + function _createMousePositionPanelBasicElement(displayAltitude?: boolean | undefined, displayCoordinates?: boolean | undefined, editCoordinates?: boolean | undefined, currentProjectionUnits?: boolean | undefined): DOMElement; + function _createCoordinateElement(coordType: string, editCoordinates?: boolean | undefined): any[]; + function _createDMSCoordinateElement(coordType: string, editCoordinates?: boolean | undefined): any[]; + function _createMousePositionPanelBasicCoordinateElement(display?: boolean | undefined, editCoordinates?: boolean | undefined, currentProjectionUnits?: boolean | undefined): DOMElement; + function _createMousePositionPanelBasicAltitudeElement(display?: boolean | undefined): DOMElement; + function _createMousePositionPanelEditToolsElement(editCoordinates?: boolean | undefined): DOMElement; + function _createShowMousePositionSettingsElement(display?: boolean | undefined): DOMElement[]; + function _createMousePositionSettingsElement(display?: boolean | undefined): DOMElement; + function _createMousePositionSettingsSystemsElement(systems: Object[]): DOMElement; + function _createMousePositionSettingsUnitsElement(units: Object[]): DOMElement; + function _resetLabelElements(currentProjectionType?: string | undefined): void; + function _resetUnitElements(currentProjectionUnits: string): void; + function _resetCoordinateElements(editCoordinates: boolean, currentProjectionType: string, currentProjectionUnits: string): void; + function _setEditMode(editing: boolean): void; + function _checkDMSElement(input: DOMElement, isFloat: boolean): boolean; + function _checkDMSDegrees(coordType: string, input: DOMElement): boolean; + function GPdisplayCoords(coordinate: Object): void; + function GPdisplayElevation(coordinate: Object, altitudeTimeoutDelay: number, noDataValue: number, noDataValueTolerance: number): void; + function GPresetElevation(): void; +} +//# sourceMappingURL=MousePositionDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts.map new file mode 100644 index 000000000..530699d71 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/MousePositionDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MousePositionDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/MousePositionDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAWiC,uDAKjC;IAQsC,8EA8CtC;IAOkC,wDAalC;IAOkB,wCAKlB;IASwC,8DA6BxC;IAeuC,iOAgBvC;IAU0B,mGA8B1B;IAS6B,sGAsG7B;IASiD,yLAsDjD;IAO+C,kGAsB/C;IAO2C,sGAkC3C;IAWyC,8FAiCzC;IAYqC,wFA+DrC;IAO4C,mFA2B5C;IAO0C,+EAqB1C;IAKqB,+EAOrB;IAKoB,kEAUpB;IAO0B,iIAmC1B;IAOc,8CAoBd;IASkB,wEAmBlB;IAQkB,yEA4BlB;IAWiB,mDAiDjB;IAUoB,uIAqCpB;IAKkB,kCAIlB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts new file mode 100644 index 000000000..13e7df17d --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts @@ -0,0 +1,14 @@ +export default ProfileElevationPathDOM; +declare namespace ProfileElevationPathDOM { + function _getCssProperty(element: HTMLElement, property: string): string; + function _getTextWidth(text: string, container: HTMLElement, font?: string): number; + function _dataZToSvgY(z: Object, pathHeight: number, minGraphZ: number, pxPerMZ: number): number; + function _dataDistToSvgX(dist: number, svgWidth: number, pathWidth: number, pxPerMX: number): any[]; + function _svgXToDataDist(svgX: number, svgWidth: number, pathWidth: number, pxPerMX: number): any[]; + function _arrayBisect(array: any[], value: number): number; + function displayProfileByDefault(data: Object, container: HTMLElement, context: Object, className: Object): DOMElement; + function displayProfileRaw(data: Object, container: HTMLElement, context: Object, className: Object): DOMElement; + function displayProfileLibD3(data: Object, container: HTMLElement, context: Object, className: Object): DOMElement; + function displayProfileLibAmCharts(data: Object, container: HTMLElement, context: Object, className: Object): DOMElement; +} +//# sourceMappingURL=ProfileElevationPathDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts.map new file mode 100644 index 000000000..b22cde47f --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ProfileElevationPathDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ProfileElevationPathDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/ProfileElevationPathDOM.js"],"names":[],"mappings":";;IAoBsB,yEAEjB;IAae,oFAYf;IAac,iGAEd;IAaiB,oGAEjB;IAaiB,oGAEjB;IAWc,2DAWd;IAYyB,uHAsiBzB;IAYmB,iHAqCnB;IAYqB,mHA2OrB;IAY2B,yHA6H3B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts new file mode 100644 index 000000000..8819239f9 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts @@ -0,0 +1,21 @@ +export default ReverseGeocodingDOM; +declare namespace ReverseGeocodingDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowReverseGeocodingElement(): DOMElement; + function _createShowReverseGeocodingPictoElement(): DOMElement; + function _createReverseGeocodingWaitingElement(): DOMElement; + function _createReverseGeocodingResultsPanelElement(): DOMElement; + function _createReverseGeocodingResultsListElement(): DOMElement; + function _createReverseGeocodingResultElement(locationDescription: string, id: number): void; + function _createReverseGeocodingPanelElement(): DOMElement; + function _createReverseGeocodingPanelHeaderElement(): DOMElement; + function _createReverseGeocodingPanelReturnPictoElement(): DOMElement; + function _createReverseGeocodingPanelTitleElement(): DOMElement; + function _createReverseGeocodingPanelCloseElement(): DOMElement; + function _createReverseGeocodingPanelFormElement(): DOMElement; + function _createReverseGeocodingFormModeChoiceGeocodingTypeElement(resources: any[]): DOMElement; + function _createReverseGeocodingFormModeChoiceGeocodingDelimitationElement(delimitations: any[]): DOMElement; + function _createReverseGeocodingSubmitFormElement(): DOMElement; +} +//# sourceMappingURL=ReverseGeocodingDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts.map new file mode 100644 index 000000000..f3f0e6c95 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ReverseGeocodingDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ReverseGeocodingDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/ReverseGeocodingDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B;IAWoC,0DAKpC;IAOyC,+DA2BzC;IAOuC,6DAYvC;IAO4C,kEAK5C;IAO2C,iEAK3C;IASsC,6FAuCtC;IAWqC,2DAMrC;IAO2C,iEAM3C;IAOgD,sEA0BhD;IAO0C,gEAM1C;IAO0C,gEAqB1C;IAQyC,+DAoBzC;IAY2D,iGA2D3D;IAQmE,6GA2DnE;IAW0C,gEAQ1C"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts new file mode 100644 index 000000000..59aa4b055 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts @@ -0,0 +1,34 @@ +export default RouteDOM; +declare namespace RouteDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowRouteElement(): DOMElement; + function _createShowRoutePictoElement(): DOMElement; + function _createRoutePanelElement(): DOMElement; + function _createRoutePanelHeaderElement(): DOMElement; + function _createRoutePanelFormElement(): DOMElement; + function _createRoutePanelResultsElement(): DOMElement; + function _createRouteWaitingElement(): DOMElement; + function _createRouteResultsStagesElement(): DOMElement; + function _addRouteResultsStagesValuesElement(points: DOMElement): void; + function _createRouteResultsElement(): DOMElement; + function _addRouteResultsValuesElement(distance: number, duration: number, fconvert: Function): DOMElement; + function _createRouteShowResultsDetailsElement(): DOMElement; + function _createRouteResultsDetailsElement(): DOMElement; + function _addRouteResultsDetailsElement(instructions: Object[], fconvert: Function): DOMElement; + function _createRoutePanelFormPointElement(n: Integer, text: string, visibility: boolean): DOMElement; + function _createRoutePanelFormRemoveStageElement(n: Integer): DOMElement; + function _createRoutePanelFormAddStageElement(): DOMElement; + function _createRoutePanelFormAutoCompleteListElement(n: Integer): DOMElement; + function _createRouteAutoCompletedLocationElement(location: Object, n: number, id: number): void; + function _createRoutePanelFormModeChoiceElement(): DOMElement; + function _createRoutePanelFormModeChoiceTransportElement(transports: string[]): DOMElement; + function _createRoutePanelFormModeChoiceComputeElement(): DOMElement; + function _createShowRouteExclusionsElement(): DOMElement; + function _createShowRouteExclusionsPictoElement(): DOMElement; + function _createRoutePanelFormExclusionsElement(): DOMElement; + function _createRoutePanelFormExclusionOptionsElement(exclusions: Object[]): DOMElement; + function _createRouteSubmitFormElement(): DOMElement; + function _createRouteFormResetElement(): DOMElement; +} +//# sourceMappingURL=RouteDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts.map new file mode 100644 index 000000000..864862f84 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/RouteDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RouteDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/RouteDOM.js"],"names":[],"mappings":";;IAac,qCAGT;IAO6B,mDAK7B;IAWyB,+CAKzB;IAQ8B,oDA8B9B;IAgB0B,gDAU1B;IAOgC,sDA8BhC;IAQ8B,oDAqF9B;IAOiC,uDA+BjC;IAO4B,kDAY5B;IAWkC,wDAIlC;IAOqC,uEA4BrC;IAQ4B,kDAoD5B;IAY+B,2GAoD/B;IAOuC,6DAKvC;IAOmC,yDAKnC;IAUgC,gGA+DhC;IAiBmC,sGAkHnC;IAWyC,yEA0BzC;IAUsC,4DAkCtC;IAW8C,8EAwB9C;IAa0C,iGAS1C;IAWwC,8DAQxC;IAUiD,2FA8EjD;IAQ+C,qEA0C/C;IAWmC,yDAKnC;IASwC,8DAwBxC;IAOwC,8DAYxC;IAU8C,wFAiG9C;IAW+B,qDAQ/B;IAW8B,oDAW9B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts new file mode 100644 index 000000000..13a775e14 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts @@ -0,0 +1,6 @@ +export default ScaleDOM; +declare namespace ScaleDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; +} +//# sourceMappingURL=ScaleDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts.map new file mode 100644 index 000000000..36465b9a0 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/ScaleDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScaleDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/ScaleDOM.js"],"names":[],"mappings":";;IAOc,qCAGT;IAO6B,mDAK7B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts b/itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts new file mode 100644 index 000000000..bcd061223 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts @@ -0,0 +1,31 @@ +export default SearchEngineDOM; +declare namespace SearchEngineDOM { + function _addUID(id: string): string; + function _createMainContainerElement(): DOMElement; + function _createShowSearchEngineElement(): DOMElement; + function _createShowSearchEnginePictoElement(): DOMElement; + function _createSearchInputElement(placeholder: string): DOMElement; + function _createShowAdvancedSearchElement(): DOMElement; + function _createAdvancedSearchPanelElement(): DOMElement; + function _createGeocodeResultsElement(): DOMElement; + function _createAutoCompleteElement(): DOMElement; + function _createAutoCompleteListElement(): DOMElement; + function _createAutoCompletedLocationElement(location: Object, id: number): void; + function _createAdvancedSearchPanelHeaderElement(): DOMElement; + function _createAdvancedSearchPanelFormElement(advancedSearchCodes: Object[]): DOMElement; + function _createAdvancedSearchFormCodeElement(codes: Object[]): DOMElement; + function _createAdvancedSearchFormInputElement(): DOMElement; + function _createAdvancedSearchFormFiltersElement(): DOMElement; + function _createAdvancedSearchFiltersTableElement(code: string, display: boolean): DOMElement; + function _createAdvancedSearchFiltersAttributElement(filterAttributes: { + code: string; + name: string; + title: string; + description: string; + value: string; + }): DOMElement; + function _createGeocodeResultsHeaderElement(): DOMElement; + function _createGeocodeResultsListElement(): DOMElement; + function _createGeocodedLocationElement(location: Object, id: number): void; +} +//# sourceMappingURL=SearchEngineDOM.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts.map b/itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts.map new file mode 100644 index 000000000..e22be1f55 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Controls/SearchEngineDOM.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SearchEngineDOM.d.ts","sourceRoot":"","sources":["../../../../src/Common/Controls/SearchEngineDOM.js"],"names":[],"mappings":";;IAUc,qCAGT;IAO6B,mDAK7B;IAWgC,sDAKhC;IAOqC,2DA8BrC;IAQ2B,oEAqI3B;IAOkC,wDAyBlC;IAWmC,yDAYnC;IAU8B,oDAa9B;IAU4B,kDAW5B;IAWgC,sDAuBhC;IAWqC,iFAkBrC;IASyC,+DAsCzC;IAOuC,0FAoDvC;IAMsC,2EAqCtC;IAKuC,6DAQvC;IAOyC,+DAIzC;IAW0C,8FAQ1C;IAgB6C;;;;;;mBAuD7C;IASoC,0DA4BpC;IAOkC,wDA0BlC;IAYgC,4EAchC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Styles.d.ts b/itowns-2.5.0-beta/dist/Common/Styles.d.ts new file mode 100644 index 000000000..93815f397 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Styles.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=Styles.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Styles.d.ts.map b/itowns-2.5.0-beta/dist/Common/Styles.d.ts.map new file mode 100644 index 000000000..096caca7d --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Styles.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../src/Common/Styles.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils.d.ts b/itowns-2.5.0-beta/dist/Common/Utils.d.ts new file mode 100644 index 000000000..49877c30e --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils.d.ts @@ -0,0 +1,7 @@ +export default Utils; +declare namespace Utils { + function detectSupport(): boolean; + function assign(dest: Object, source: Object): Object; + function mergeParams(dest: Object, source: Object, replace: boolean): void; +} +//# sourceMappingURL=Utils.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils.d.ts.map new file mode 100644 index 000000000..519f694da --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/Common/Utils.js"],"names":[],"mappings":";;IAqBoB,kCAsBf;IAUQ,sDAQR;IAUa,2EA0Bb"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts new file mode 100644 index 000000000..1172478a4 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=AutoLoadConfig.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts.map new file mode 100644 index 000000000..34c3ee12d --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/AutoLoadConfig.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AutoLoadConfig.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/AutoLoadConfig.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts new file mode 100644 index 000000000..052062e94 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts @@ -0,0 +1,12 @@ +export default ColorUtils; +declare namespace ColorUtils { + function hex(number: number): string; + function num(hexa: any): number; + function arrayToRgba(values: any[]): string; + function arrayToHex(values: any[]): Object; + function rgbaToHex(rgba: string): Object; + function hexToRgba(hex: string, opacity: number): string; + function isHex(value: any): boolean; + function isRGB(value: any): boolean; +} +//# sourceMappingURL=ColorUtils.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts.map new file mode 100644 index 000000000..ec32c0560 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/ColorUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ColorUtils.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/ColorUtils.js"],"names":[],"mappings":";;IAsBU,qCAML;IAQK,gCAEL;IASa,4CAUb;IASY,2CAgBZ;IAUW,yCAkBX;IAWW,yDAkBX;IAOO,oCAaP;IAOO,oCAUP"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts new file mode 100644 index 000000000..5963ee88c --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts @@ -0,0 +1,6 @@ +export default Config; +declare namespace Config { + const configuration: Object; + function isConfigLoaded(): boolean; +} +//# sourceMappingURL=Config.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts.map new file mode 100644 index 000000000..771d7dbdd --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/Config.js"],"names":[],"mappings":";;yBAec,MAAM;IASC,mCAWhB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts new file mode 100644 index 000000000..7ce40a3d7 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts @@ -0,0 +1,5 @@ +export default Draggable; +declare namespace Draggable { + function dragElement(element: DOMElement, header: DOMElement, container: DOMElement): void; +} +//# sourceMappingURL=Draggable.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts.map new file mode 100644 index 000000000..55e064c2f --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Draggable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Draggable.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/Draggable.js"],"names":[],"mappings":";;IAsCkB,2FAwFb"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts new file mode 100644 index 000000000..ea40a52b2 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts @@ -0,0 +1,6 @@ +export default GeocodeUtils; +declare namespace GeocodeUtils { + function getGeocodedLocationFreeform(geocodedLocation: Object): string; + function getSuggestedLocationFreeform(suggestedLocation: Object): string; +} +//# sourceMappingURL=GeocodeUtils.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts.map new file mode 100644 index 000000000..215104620 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/GeocodeUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeocodeUtils.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/GeocodeUtils.js"],"names":[],"mappings":";;IAOkC,uEAa7B;IAQ8B,yEAe9B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts new file mode 100644 index 000000000..e04ac6d80 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts @@ -0,0 +1,13 @@ +export default LayerUtils; +declare namespace LayerUtils { + function getZoomLevelFromScaleDenominator(scaleDenominator: number, crs: string): Integer; + function getAttributions(params: { + extent: Float[]; + zoom: number; + crs: string; + visibility: boolean; + originators: Gp.Services.Config.Originator; + }): Object; + function intersects(extent1: Float[], extent2: Float[]): boolean; +} +//# sourceMappingURL=LayerUtils.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts.map new file mode 100644 index 000000000..2f37faa18 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/LayerUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LayerUtils.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/LayerUtils.js"],"names":[],"mappings":";;IAqBuC,0FAgKlC;IAciB;;;;;;eAsGjB;IAUY,iEAIZ"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts new file mode 100644 index 000000000..faf0a1811 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts @@ -0,0 +1,7 @@ +export default LoggerByDefault; +declare namespace LoggerByDefault { + function getLogger(name?: string | undefined): Object; + function disableAll(): void; + function enableAll(): void; +} +//# sourceMappingURL=LoggerByDefault.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts.map new file mode 100644 index 000000000..b33a02a78 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/LoggerByDefault.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LoggerByDefault.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/LoggerByDefault.js"],"names":[],"mappings":";;IAqBgB,sDAiBX;IAKY,4BAQZ;IAKW,2BAQX"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts new file mode 100644 index 000000000..187bed23f --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts @@ -0,0 +1,9 @@ +export default MathUtils; +declare namespace MathUtils { + function modulo(a: number, b: number): number; + function decimalToDMS(degrees: number, hemispheres: any[], numDigits: number): Object; + function toInteger(s: string, base: Numeric): any; + function isInteger(s: string): boolean; + function toFloat(s: string): any; +} +//# sourceMappingURL=MathUtils.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts.map new file mode 100644 index 000000000..b5d4f4b9c --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/MathUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MathUtils.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/MathUtils.js"],"names":[],"mappings":";;IAqBa,8CAGR;IAYc,sFA4Bd;IAUW,kDAOX;IASW,uCAOX;IASS,iCAMT"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts new file mode 100644 index 000000000..0591a82fa --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts @@ -0,0 +1,7 @@ +export default Parser; +declare namespace Parser { + function parse(xml: string): DOMElement; + function toString(doc: DOMElement): string; + function format(xml: string): string; +} +//# sourceMappingURL=Parser.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts.map new file mode 100644 index 000000000..fdade6492 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Parser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/Parser.js"],"names":[],"mappings":";;IAsBY,wCAiCP;IAQU,2CASV;IASQ,qCAoDR"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts new file mode 100644 index 000000000..63237a20d --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts @@ -0,0 +1,8 @@ +export default ProxyUtils; +declare namespace ProxyUtils { + function proxifyUrl(url: string, proxyOptions?: { + proxyUrl: string; + noProxyDomains?: string[] | undefined; + } | undefined): string; +} +//# sourceMappingURL=ProxyUtils.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts.map new file mode 100644 index 000000000..5900e89f0 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/ProxyUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ProxyUtils.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/ProxyUtils.js"],"names":[],"mappings":";;IAuBiB;;;2BAwBZ"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts new file mode 100644 index 000000000..bbbbdebee --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts @@ -0,0 +1,441 @@ +export default Register; +declare namespace Register { + const isLoaded: boolean; + function get(name: string): Object; + function exist(name: string): boolean; + function load(Proj4: Object): void; + function loadByDefault(Proj4: Object): void; + function loadByName(Proj4: Object, name: string): boolean; + const EPSG: { + 4978: string; + 3857: string; + 3785: string; + 4149: string; + 4150: string; + 4151: string; + 4171: string; + 4230: string; + 4235: string; + 4258: string; + 4275: string; + 4322: string; + 4326: string; + 4467: string; + 4470: string; + 4471: string; + 4474: string; + 4558: string; + 4559: string; + 4621: string; + 4622: string; + 4623: string; + 4624: string; + 4625: string; + 4626: string; + 4627: string; + 4628: string; + 4629: string; + 4630: string; + 4632: string; + 4633: string; + 4634: string; + 4637: string; + 4638: string; + 4640: string; + 4641: string; + 4645: string; + 4687: string; + 4662: string; + 4689: string; + 4690: string; + 4691: string; + 4692: string; + 4698: string; + 4749: string; + 4750: string; + 4807: string; + 2056: string; + 2154: string; + 2213: string; + 2969: string; + 2970: string; + 2971: string; + 2972: string; + 2973: string; + 2975: string; + 2976: string; + 2977: string; + 2978: string; + 2980: string; + 2981: string; + 2982: string; + 2984: string; + 2986: string; + 2987: string; + 2989: string; + 2990: string; + 2995: string; + 3038: string; + 3039: string; + 3040: string; + 3041: string; + 3045: string; + 3046: string; + 3047: string; + 3048: string; + 3049: string; + 3050: string; + 3051: string; + 3034: string; + 3035: string; + 3042: string; + 3043: string; + 3044: string; + 25828: string; + 25829: string; + 25833: string; + 25834: string; + 25835: string; + 25836: string; + 25837: string; + 25838: string; + 3060: string; + 3163: string; + 3164: string; + 3165: string; + 3166: string; + 3169: string; + 3170: string; + 3171: string; + 3172: string; + 3296: string; + 3297: string; + 3298: string; + 3299: string; + 3302: string; + 3303: string; + 3304: string; + 3305: string; + 3306: string; + 3312: string; + 3313: string; + 3336: string; + 3395: string; + 3727: string; + 21781: string; + 25830: string; + 25831: string; + 25832: string; + 27561: string; + 27562: string; + 27563: string; + 27564: string; + 27571: string; + 27572: string; + 27573: string; + 27574: string; + 27581: string; + 27582: string; + 27583: string; + 27584: string; + 27591: string; + 27592: string; + 27593: string; + 27594: string; + 32601: string; + 32602: string; + 32603: string; + 32604: string; + 32605: string; + 32606: string; + 32607: string; + 32608: string; + 32609: string; + 32610: string; + 32611: string; + 32612: string; + 32613: string; + 32614: string; + 32615: string; + 32616: string; + 32617: string; + 32618: string; + 32619: string; + 32620: string; + 32621: string; + 32622: string; + 32623: string; + 32624: string; + 32625: string; + 32626: string; + 32627: string; + 32628: string; + 32629: string; + 32630: string; + 32631: string; + 32632: string; + 32633: string; + 32634: string; + 32635: string; + 32636: string; + 32637: string; + 32638: string; + 32639: string; + 32640: string; + 32641: string; + 32642: string; + 32643: string; + 32644: string; + 32645: string; + 32646: string; + 32647: string; + 32648: string; + 32649: string; + 32650: string; + 32651: string; + 32652: string; + 32653: string; + 32654: string; + 32655: string; + 32656: string; + 32657: string; + 32658: string; + 32659: string; + 32660: string; + 32661: string; + 32662: string; + 32701: string; + 32702: string; + 32703: string; + 32704: string; + 32705: string; + 32706: string; + 32707: string; + 32708: string; + 32709: string; + 32710: string; + 32711: string; + 32712: string; + 32713: string; + 32714: string; + 32715: string; + 32716: string; + 32717: string; + 32718: string; + 32719: string; + 32720: string; + 32721: string; + 32722: string; + 32723: string; + 32724: string; + 32725: string; + 32726: string; + 32727: string; + 32728: string; + 32729: string; + 32730: string; + 32731: string; + 32732: string; + 32733: string; + 32734: string; + 32735: string; + 32736: string; + 32737: string; + 32738: string; + 32739: string; + 32740: string; + 32741: string; + 32742: string; + 32743: string; + 32744: string; + 32745: string; + 32746: string; + 32747: string; + 32748: string; + 32749: string; + 32750: string; + 32751: string; + 32752: string; + 32753: string; + 32754: string; + 32755: string; + 32756: string; + 32757: string; + 32758: string; + 32759: string; + 32760: string; + 32761: string; + 310024802: string; + 310915814: string; + 310486805: string; + 310700806: string; + 310702807: string; + 310706808: string; + 310547809: string; + 310642810: string; + 310032811: string; + 310642812: string; + 310642801: string; + 310642813: string; + 310642901: string; + 5489: string; + 5490: string; + }; + const CRS: { + 84: string; + }; + namespace IGNF { + const AMST63: string; + const CROZ63: string; + const CSG67: string; + const ED50: string; + const ETRS89: string; + const GUAD48: string; + const GUADFM49: string; + const IGN63: string; + const IGN72: string; + const KERG62CAR: string; + const MART38: string; + const MAYO50: string; + const MOOREA87: string; + const NTF: string; + const NUKU72: string; + const REUN47: string; + const RGF93: string; + const RGFG95: string; + const RGM04: string; + const RGNC: string; + const RGPF: string; + const RGR92: string; + const RGSPM06: string; + const RGTAAF07: string; + const RRAF91: string; + const STPL69: string; + const STPM50: string; + const TAHAA: string; + const TAHI79: string; + const TERA50: string; + const WALL78: string; + const WGS72: string; + const WGS84: string; + const AMST63GEO: string; + const CROZ63GEO: string; + const CSG67GEO: string; + const ED50G: string; + const GUAD48GEO: string; + const GUADFM49GEO: string; + const IGN63GEO: string; + const IGN72GEO: string; + const KERG62GEO: string; + const MART38GEO: string; + const MAYO50GEO: string; + const MOOREA87GEO: string; + const NTFG: string; + const NTFP: string; + const NUKU72GEO: string; + const REUN47GEO: string; + const RGF93G: string; + const RGFG95GEO: string; + const RGM04GEO: string; + const RGNCGEO: string; + const RGPFGEO: string; + const RGR92GEO: string; + const RGSPM06GEO: string; + const RGTAAF07G: string; + const STPL69GEO: string; + const STPM50GEO: string; + const TAHAAGEO: string; + const TAHI79GEO: string; + const TERA50G: string; + const WALL78GEO: string; + const WGS72G: string; + const WGS84G: string; + const WGS84RRAFGEO: string; + const XGEO: string; + const AMST63UTM43S: string; + const CROZ63UTM39S: string; + const CSG67UTM21: string; + const CSG67UTM22: string; + const GEOPORTALANF: string; + const GEOPORTALASP: string; + const GEOPORTALCRZ: string; + const GEOPORTALFXX: string; + const GEOPORTALGUF: string; + const GEOPORTALKER: string; + const GEOPORTALMYT: string; + const GEOPORTALNCL: string; + const GEOPORTALPYF: string; + const GEOPORTALREU: string; + const GEOPORTALSPM: string; + const GEOPORTALWLF: string; + const GUAD48UTM20: string; + const GUADFM49U20: string; + const IGN63UTM7S: string; + const IGN72UTM58S: string; + const KERG62UTM42S: string; + const LAMB1: string; + const LAMB1C: string; + const LAMB2: string; + const LAMB2C: string; + const LAMB3: string; + const LAMB3C: string; + const LAMB4: string; + const LAMB4C: string; + const LAMB93: string; + const RGF93CC42: string; + const RGF93CC43: string; + const RGF93CC44: string; + const RGF93CC45: string; + const RGF93CC46: string; + const RGF93CC47: string; + const RGF93CC48: string; + const RGF93CC49: string; + const RGF93CC50: string; + const LAMBE: string; + const MART38UTM20: string; + const MAYO50UTM38S: string; + const MILLER: string; + const MOOREA87U6S: string; + const NUKU72U7S: string; + const RGM04UTM38S: string; + const RGNCUTM57S: string; + const RGNCUTM58S: string; + const RGNCUTM59S: string; + const RGPFUTM5S: string; + const RGPFUTM6S: string; + const RGPFUTM7S: string; + const RGR92UTM40S: string; + const RGSPM06U21: string; + const STPL69UTM43S: string; + const STPM50UTM21: string; + const TAHAAUTM05S: string; + const TAHI51UTM06S: string; + const TAHI79UTM6S: string; + const TERA50STEREO: string; + const UTM01SW84: string; + const UTM20W84GUAD: string; + const UTM20W84MART: string; + const UTM22RGFG95: string; + const UTM39SW84: string; + const UTM42SW84: string; + const UTM43SW84: string; + const WALL78UTM1S: string; + const ETRS89GEO: string; + const ETRS89LAEA: string; + const ETRS89LCC: string; + const UTM26ETRS89: string; + const UTM27ETRS89: string; + const UTM28ETRS89: string; + const UTM29ETRS89: string; + const UTM30ETRS89: string; + const UTM31ETRS89: string; + const UTM32ETRS89: string; + const UTM33ETRS89: string; + const UTM34ETRS89: string; + const UTM35ETRS89: string; + const UTM36ETRS89: string; + const UTM37ETRS89: string; + const UTM38ETRS89: string; + } +} +//# sourceMappingURL=Register.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts.map new file mode 100644 index 000000000..cd04c18d4 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/Register.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Register.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/Register.js"],"names":[],"mappings":";;;IA6BU,mCAsBL;IAWO,sCAsBP;IAOM,mCAgCN;IAoBe,4CAoCf;IAUY,0DAaZ"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts new file mode 100644 index 000000000..b495d3394 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts @@ -0,0 +1,25 @@ +export default SearchEngineUtils; +declare namespace SearchEngineUtils { + namespace advancedSearchFiltersByDefault { + const PositionOfInterest: ({ + name: string; + title: string; + value: string[]; + } | { + name: string; + title: string; + value?: undefined; + })[]; + const StreetAddress: { + name: string; + title: string; + }[]; + const CadastralParcel: { + name: string; + title: string; + description: string; + }[]; + } + function zoomToResultsByDefault(info: Object): Integer; +} +//# sourceMappingURL=SearchEngineUtils.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts.map new file mode 100644 index 000000000..88999758f --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/SearchEngineUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SearchEngineUtils.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/SearchEngineUtils.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAwG6B,uDA4CxB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts b/itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts new file mode 100644 index 000000000..3841c84b0 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts @@ -0,0 +1,8 @@ +export default SelectorID; +declare namespace SelectorID { + function generate(): number; + function name(id: string): string; + function index(id: string): string; + function uuid(id: string): string; +} +//# sourceMappingURL=SelectorID.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts.map b/itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts.map new file mode 100644 index 000000000..d40e90e9c --- /dev/null +++ b/itowns-2.5.0-beta/dist/Common/Utils/SelectorID.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SelectorID.d.ts","sourceRoot":"","sources":["../../../../src/Common/Utils/SelectorID.js"],"names":[],"mappings":";;IAqBe,4BAEN;IASE,kCAWN;IASO,mCAYP;IASM,kCASN"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/GpPluginItowns-map.css b/itowns-2.5.0-beta/dist/GpPluginItowns-map.css new file mode 100644 index 000000000..b47ec69ac --- /dev/null +++ b/itowns-2.5.0-beta/dist/GpPluginItowns-map.css @@ -0,0 +1,3098 @@ +/*! + * @brief French Geoportal Extension for Itowns + * + * This software is released under the licence CeCILL-B (Free BSD compatible) + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * @see http://www.cecill.info/ + * + * @copyright copyright (c) IGN + * @license CeCILL-B + * @author IGN + * @version 2.5.0-beta + * @date 21/09/2023 + * + */ + +/*! + * Sortable -- JavaScript library for reorderable drag-and-drop lists on modern + * browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, + * React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap. + * + * Released under MIT LICENSE + * + * Copyright Lebedev Konstantin + * https://github.com/SortableJS/Sortable + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @version 1.14.0 + */ + +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.4 + */ + +/*! + * @overview Proj4js - Javascript reprojection library. + * + * @authors + * - Mike Adair madairATdmsolutions.ca + * - Richard Greenwood richATgreenwoodmap.com + * - Didier Richard didier.richardATign.fr + * - Stephen Irons stephen.ironsATclear.net.nz + * - Olivier Terral oterralATgmail.com + * - Calvin Metcalf cmetcalfATappgeo.com + * + * @copyright Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/proj4js/proj4js/master/LICENSE.md + * @version 2.7.5 + */ + +/* BOOST RELIEF */ + + div[id^=GPboostRelief-] { + font-size: 11px; + width: 150px; + } + + div[id^=GPboostRelief-] label { + display: block; + } + + div[id^=GPBoostReliefListContainer-] { + position: relative; + width: 100%; + height: 28px; + padding-left: 8px; + line-height: 28px; + } + + .GPlayerRelief, + .GPlayerReliefValue { + position: absolute; + top: 0; + } + + .GPlayerRelief { + width: calc(100% - 60px); + height: 28px; + padding-left: 8px; + } + + .GPlayerReliefValue { + width: 32px; + left: calc(100% - 40px); + line-height: 28px; + font-size: 10px; + font-style: italic; + cursor: default; + } + + /* Showing/hiding boost relief panel */ + + label[id^=GPshowBoostReliefPicto] { + display: inline-block; + } + + input[id^=GPshowBoostRelief-] + label { + display: block; + } + + input[id^=GPshowBoostRelief-]:checked + label { + display: none; + } + + input[id^=GPshowBoostRelief-] + label + div { + display: none; + } + + input[id^=GPshowBoostRelief-]:checked + label + div { + display: block; + } + + /* Showing layer advanced tools */ + + div[id^=GPboostRelief-] input[type="checkbox"]:checked + label + .GPlayerAdvancedToolsRelief { + max-height: 28px; + opacity: 1; + } + + .GPlayerAdvancedToolsRelief { + display: block; + position: relative; + width: 100%; + border-bottom : 1px dotted #CCC; + background-color : #FFF; + } + + .GPlayerReliefLayerId { + position: relative; + width: 100px; + height: 28px; + padding-left: 8px; + line-height: 28px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + /* Relief slider : general */ + + .GPlayerRelief input { + -webkit-appearance: none; + -moz-appearance: none; + background: none; + display: block; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + cursor: pointer; + } + + .GPlayerRelief input[type="range"]:focus { + box-shadow: none; + outline: none; + } + + /* Relief slider : Chrome, Safari, Opera */ + + .GPlayerRelief input[type="range"]::-webkit-slider-runnable-track { + -webkit-appearance: none; + height: 3px; + } + + .GPlayerRelief input[type="range"]::-webkit-slider-thumb:before { + position: absolute; + top: 0; + right: 50%; + left: -200px; + height: 3px; + pointer-events: none; + } + + .GPlayerRelief input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + width: 9px; + height: 17px; + -webkit-appearance: none; + border: 2px solid #FFF; + background-color: #505050; + position: relative; + top: -7px; + } + + /* Relief slider : Firefox */ + + .GPlayerRelief input[type="range"]::-moz-range-track { + width: 80px; + height: 3px; + } + + .GPlayerRelief input[type="range"]::-moz-range-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + border-radius: 0; + box-shadow: 0; + background-color: #505050; + position: relative; + } + + /* Relief slider : IE */ + + .GPlayerRelief input[type="range"]::-ms-track { + border: 0; + border-color: transparent; + border-radius: 0; + border-width: 0; + color: transparent; + height: 3px; + width: 80px; + } + + .GPlayerRelief input[type="range"]::-ms-fill-lower, + .GPlayerRelief input[type="range"]::-ms-fill-upper { + background: transparent; + border-radius: 0; + } + + .GPlayerRelief input[type="range"]::-ms-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + background-color: #505050; + } + + .GPlayerRelief input[type="range"]::-ms-tooltip { + display: none; + } +/* BUILDINGS */ + + div[id^=GPbuildings-] { + font-size: 11px; + } + + div[id^=GPbuildings-] label { + display: block; + } + + label[id^=GPshowBuildingsPicto] { + display: inline-block; + cursor: pointer; + } + + +/* MOUSE POSITION */ + +/* Showing/hiding drawing panel */ + +label[id^=GPshowDrawingPicto-] { + display: inline-block; +} + +input[id^=GPshowDrawing-] + label { + display: block; +} + +input[id^=GPshowDrawing-]:checked + label { + display: none; +} + +input[id^=GPshowDrawing-] + label + div { + display: none; +} + +input[id^=GPshowDrawing-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPdrawingPanel-] { + width: 240px; + overflow: hidden; +} + +/* Basic infos */ + +div[id^=GPdrawingBasicPanel-] { + padding: 10px 15px; +} + +.GPdrawingLabel, +.GPdrawingCoords { + display: inline-block; + line-height: 20px; +} + +.GPdrawingLabel { + width: 80px; + font-weight: bold; +} + +.GPdrawingCoords { + width: 110px; +} + +/* markers selector */ +.marker-input-radio { + display : none ; +} + +input.marker-input-radio:checked + label { + border: 1px solid red; +} + + +div[id^=GPelevationPathPanelInfo] { + display: none; /* on n'affiche pas le bouton d'information par defaut */ +} + +/* Calc waiting */ + +.GPelevationPathCalcWaitingContainerVisible, +.GPelevationPathCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPelevationPathInformationsContainerVisible, +.GPelevationPathInformationsContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 13px; + font-weight: bold; + overflow: hidden; +} + +.GPelevationPathCalcWaitingContainerVisible { + display: -webkit-flex; + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.GPelevationPathInformationsContainerVisible { + display: -webkit-flex; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + flex-direction: column; +} + +.GPelevationPathCalcWaitingContainerHidden, +.GPelevationPathInformationsContainerHidden { + display: none; +} + +.GPelevationPathCalcWaiting, +.GPelevationPathInformations { + margin: auto; +} + +.GPelevationPathInformations { + font-size: 0.8em; +} + +.GPelevationPathCalcWaitingContainerVisible, +.GPelevationPathCalcWaitingContainerHidden, +.GPelevationPathInformationsContainerVisible, +.GPelevationPathInformationsContainerHidden { + border-radius: 5px; +} + +/* CSS : Raw */ + +#profileElevationRaw { + resize: none; + padding: unset; +} + +/* CSS : default */ + +#profileElevationByDefault { + display:-webkit-flex; + display:-webkit-box; + display:-ms-flexbox; + display:flex; + -webkit-box-orient:vertical; + -webkit-box-direction:normal; + -webkit-flex-direction:column; + -ms-flex-direction:column; + flex-direction:column; + height:100%; +} + +.altiPathValue { + font-weight: 700; + fill: #5E5E5E; +} + +.altiPathCoords { + font-style: italic; + fill: #5E5E5E; +} + +.tooltipInit { + opacity: 0; +} + +.tooltipFadeIn { + transition: opacity 300ms ease 0ms, transform 50ms ease 0s, top 50ms ease 0s, left 50ms ease 0s; + opacity: 1; +} + +.tooltipFadeOut { + transition: opacity 500ms ease 0ms; + opacity: 0; +} + + + +/* CSS : D3 */ + +.axis-d3 > text { + fill: rgb(94, 94, 94); + font-family: Verdana; + font-size: 10px; + opacity: 1; + text-anchor: end; +} + +.axis-d3 { + fill: none; + stroke: #5E5E5E; + stroke-width: 1; + shape-rendering: crispEdges; +} + +.area-d3 { + fill: #C77A04; + stroke: #5E5E5E; + stroke-width: 0; + fill-opacity: 0.4; +} + +.line-d3 { + fill: none; + stroke: #C77A04; + stroke-width: 1px; +} + +.grid-d3 .tick { + stroke: lightgrey; + opacity: 0.7; +} + +.grid-d3 path { + stroke-width: 0; +} + +.grid-d3 .tick { + stroke: lightgrey; + opacity: 0.7; +} + +.grid-d3 path { + stroke-width: 0; +} + +.overlay-d3 { + fill: none; + pointer-events: all; +} + +.focusLine-d3 { + fill: none; + stroke: #C77A04; + stroke-width: 0.5px; +} + +.focusCircle-d3 { + fill: #C77A04; +} + +div.tooltip-d3 { + position: inherit;; + text-align: left; + width: 80px; + height: 45px; + padding: 5px; + font: 8px sans-serif; + background: white; + border: 0px; + border-radius: 8px; + pointer-events: none; +} + +/* Widgets : general */ + +.GPwidget { + position: absolute; + font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; + font-size: 13px; + color: #333; +} + +.GPwidget input[type='text'], +.GPwidget input[type='button'] { + -webkit-appearance: none; + color: #333333; +} + +.GPwidget input[type="checkbox"] { + display: none; +} + +.GPwidget select { + padding-left: 3px; + border-radius: 3px; +} + +.GPwidget form { + margin-bottom: 0; +} + +.GPwidget * { + box-sizing: border-box; + background-repeat: no-repeat; +} + +/* waiting */ + +.GPwaiting { + background-image : url(data:image/gif;base64,R0lGODlhNAA0AIQSAAFkpSZ5sAGV3k2Ruiao3kOj1/GUBk225pe/B4S83XrK75HH3qrS5szMzNbW1sHe797e3ubm5v///////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAQAfACwAAAAANAA0AAAF5uAnjmRpnmiqrmzrvnAsz3T9FXhh72Ke8zWfDzgT/ogxIw55cjgiJ6XOhKjaII1sNio8Vb8ImnbMXVLBVhl2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KX+FDTBtfYZ/gUmLhUqPf0p+i42Oi00QfxAiIQAh+QQFAQAfACwEAAQAGgAnAAAFc+AnjmRZGqhhrmyasrDounE7o/V64yvi6zuTb4gA0oTEn+lYSg5zSGcROpJOqVUntknc9rzgsHhMLhXOhTEaHV6vwW62N36G09tutbzM7/v/JhFlDYQNDmKFhYdeEYmFYA6OhIJbEJINYZdhlolkEA6UUCEAIfkEAQEAHwAsBAAEACcAGgAABXXgJ45kWSIoYq5sS6apK8swPN9mHeP8p6O9UmG4+qlMhmRryCwUa6uk1LBqMp9A5FQptBKDW2nX6+SFxSRyuXemjpvBz5lljYu2srX9vu/7/4CBgh8NhQ6DK4WKDYgkEIuGjSKQipKElIySj5CHlpSWIw6RoCEAOw==); + background-position : center center; + background-repeat : no-repeat; +} + +/* General panels */ + +.GPpanel { + background-color: #FFF; +} + +.GPpanelHeader { + position: relative; + width: 100%; +} + +.GPpanelTitle { + width: 100%; + height: 100%; + text-align: center; + font-weight: bold; +} + +.GPpanelClose, .GPpanelReduce, .GPpanelInfo { + position: absolute; + cursor: pointer; +} + +/* Showing/hiding advanced panels */ + +.GPshowAdvancedToolPicto { + position: relative; + box-sizing: border-box; + cursor: pointer; +} + +.GPshowAdvancedToolOpen { + position: absolute; + display: block; + box-sizing: border-box; +} + +/* Flex inputs */ + +.GPflexInput { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + transition: max-height 0.3s ease-out, opacity 0.3s ease-out; +} + +/* FIXME tempory hack with :not(.GPlocationOriginHidden) ! +.GPflexInput > *:not(.GPlocationOriginHidden) */ +.GPflexInput > * { + display: block; + height: 28px; + line-height: 26px; + border: 1px solid #999; + border-radius: 0; +} + +.GPflexInput *:not(:last-child) { + border-right:none; +} + +.GPflexInput *:first-child { + border-radius: 3px 0 0 3px; +} + +.GPflexInput *:last-child { + border-radius: 0 3px 3px 0; +} + +.GPflexInput > *:not(input) { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.GPflexInput > input { + -webkit-flex: 1; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; + padding: 0 5px; + min-width: 0; +} + +.GPflexInput > select { + -webkit-flex: 1; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; + padding-right: 7px; +} + +.GPflexInput > label { + background-color: #F2F2F2; + color: #666; + padding-left: 7px; + padding-right: 9px; + cursor: pointer; +} + +/* Particular inputs */ + +.GPinputSelect { + display: block; + height: 28px; + line-height: 26px; + margin: auto; + border: 1px solid #999; + color: #333; + cursor: pointer; +} + +input.GPinputSubmit { + display: block; + width: 80px; + margin: auto; + height: 28px; + line-height: 26px; + padding: 0; + background: none; + border: none; + border-radius: 3px; + font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; + color: #FFF; + font-weight: bold; + opacity: 0.8; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +input.GPinputSubmit:hover { + opacity: 1; +} + +/* Autocomplete/geocode results */ + +.GPautoCompleteList, +.GPadvancedAutoCompleteList { + z-index: 2; + display: none; + position: absolute; + max-height: 140px; + background-color: #FFF; + border: 1px solid #999; + overflow-y: hidden; +} + +.GPadvancedAutoCompleteList { + width: calc(100% - 28px); + border-top: none; + font-size: 0.9em; +} + +.GPautoCompleteProposal { + width: 100%; + height: 28px; + line-height: 16px; + padding: 6px 10px; + color: #5E5E5E; + font-size: 1.0em; + overflow: hidden; + white-space: nowrap; + text-overflow:ellipsis; + cursor: pointer; +} + +.GPautoCompleteProposal:hover { + color: #000000; + background-color: #CEDBEF +} + +/* Showing additional hidden options */ + +.GPshowMoreOptions { + display: block; + position: absolute; + width: 28px; + height: 28px; + cursor: pointer; + transition: all 0.5s ease-out 0s; +} + +input[type="checkbox"]:checked + .GPshowMoreOptions { + -webkit-transform: rotateX(180deg); + transform: rotateX(180deg); + /* bottom: 90px; */ +} + +/* GET FEATURE INFO */ + +label[id^=GPgetFeatureInfoPicto] { + display: inline-block; +} + +div[id^=GPgetFeatureInfo-] + label { + display: block; +} + +span[id^=GPgetFeatureInfoActivate], +span[id^=GPgetFeatureInfoDeactivate] { + position: absolute; + display: block; + transition: border-radius 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +span[id^=GPgetFeatureInfoActivate] { + background-position: 0 0; + opacity: 1; +} + +span[id^=GPgetFeatureInfoDeactivate] { + opacity: 0; +} + +div[id^=GPgetFeatureInfo-] input[type="checkbox"]:not(:checked) + label[id^=GPgetFeatureInfoPicto] span[id^=GPgetFeatureInfoDeactivate] { + opacity: 1; +} + +/* ISOCHRON */ + +div[id^=GPisochron-] { + top: 140px; +} + +/* Showing/hiding mouse position panel */ + +label[id^=GPshowIsochronPicto] { + display: inline-block; +} + +input[id^=GPshowIsochron-] + label { + display: block; +} + +input[id^=GPshowIsochron-]:checked + label { + display: none; +} + +input[id^=GPshowIsochron-] + label + div { + display: none; +} + +input[id^=GPshowIsochron-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPisochronPanel-] { + width: 280px; +} + +/* Calc waiting */ + +.GPisochronCalcWaitingContainerVisible, +.GPisochronCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPisochronCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GPisochronCalcWaitingContainerHidden { + display: none; +} + +.GPisochronCalcWaiting { + margin: auto; +} + +/* Isochron form */ + +form[id^=GPisochronForm] { + padding: 15px; +} + +.GPisochronFormMini { + max-height: 58px; + overflow: hidden; +} + +.GPisochronFormMini div[id^="GPisochronReset-"], +.GPisochronFormMini label[id^="GPshowIsoExclusionsPicto-"] { + display: none; +} + +.GPisochronOriginVisible { + display: block; +} + +.GPisochronOriginHidden { + display: none; +} + +.GPisochronOriginPointerImg { + width: 28px; + background-color: #F2F2F2; + cursor: pointer; +} + +input[id^="GPisochronOriginPointer"] + .GPisochronOriginPointerImg { + background-position: -1px -1px; +} + +input[id^="GPisochronOriginPointer"]:checked + .GPisochronOriginPointerImg { + background-position: -29px -1px; +} + +input[id^=GPisochronSubmit] { + margin-top: 5px; +} + +/* Alternative choice */ + +div[id^=GPisochronChoice] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + width: 160px; + -webkit-justify-content: space-between; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + margin: auto; + margin-top: 15px; + margin-bottom: 5px; +} + +.GPisochronChoiceAlt input { + display: none; +} + +.GPisochronChoiceAltImg { + display: block; + width: 28px; + height: 28px; + margin: auto; + cursor: pointer; +} + +input[id^=GPisochronChoiceAltChron] + .GPisochronChoiceAltImg { + background-position: -56px 0; +} + +input[id^=GPisochronChoiceAltChron]:checked + .GPisochronChoiceAltImg { + background-position: -84px 0; +} + +input[id^=GPisochronChoiceAltDist] + .GPisochronChoiceAltImg { + background-position: -112px 0; +} + +input[id^=GPisochronChoiceAltDist]:checked + .GPisochronChoiceAltImg { + background-position: -140px 0; +} + +.GPisochronChoiceAlt span { + cursor: pointer; + display:block; + color: #999; +} + +.GPisochronValueHidden { + display: none; +} + +div[id^=GPisochronValueChron], +div[id^=GPisochronValueDist] { + width: 220px; + margin: auto; +} + +/* Mode choice */ + +div[id^=GPisochronModeChoice] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-between; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + margin: 15px 0; +} + +.GPisochronModeLabel { + display: block; + text-align: center; + margin-bottom: 5px; +} + +div[id^=GPisochronTransportChoice] input { + display: none; +} + +.GPisochronTransportImg { + display: inline-block; + width: 28px; + height: 28px; + cursor: pointer; +} + +.GPisochronTransportImg:first-of-type { + margin-left: 18px; + margin-right: 10px; +} + +input[id^=GPisochronTransportCar] + .GPisochronTransportImg { + background-position: -168px 0; +} + +input[id^=GPisochronTransportCar]:checked + .GPisochronTransportImg { + background-position: -196px 0; +} + +input[id^=GPisochronTransportPedestrian] + .GPisochronTransportImg { + background-position: -224px 0; +} + +input[id^=GPisochronTransportPedestrian]:checked + .GPisochronTransportImg { + background-position: -252px 0; +} + +select[id^=GPisochronDirectionSelect] { + width: 80px; +} + +/* Showing/hiding exclusions */ + +input[id^=GPshowIsoExclusions] { + display: none; +} + +.GPshowIsoExclusionsPicto { + top: 250px; + right: 0; + transition: all 0.5s ease-out 0s; +} + +input[id^=GPshowIsoExclusions] + label + div[id^=GPisoExclusions] { + max-height: 0; + opacity: 0; + margin-bottom: 0; +} + +input[id^=GPshowIsoExclusions]:checked + label + div[id^=GPisoExclusions] { + display: block; + max-height: 60px; + opacity: 1; + margin-bottom: 15px; +} + +/* Exclusions */ + +div[id^=GPisoExclusions] { + transition: max-height 0.5s ease-in-out 0.25s, opacity 0.5s ease-in-out 0.25s, margin 0.3s ease-in-out 0.25s; + overflow: hidden; +} + +.GPisoExclusionsLabel { + display: block; + text-align: center; + margin-bottom: 10px; + font-weight: bold; + line-height: 16px; +} + +.GPisoExclusionsOptions { + display: -webkit-flex; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; +} + +.GPisoExclusionsOption { + display: block; + height: 28px; + line-height: 26px; + color: #A77; + background-color: #FEE; + padding-left: 28px; + padding-right: 5px; + border: 1px solid #A77; + border-radius: 3px; + cursor: pointer; +} + +input:checked + .GPisoExclusionsOption { + background-color: #EFE; + background-position: 0 -28px; + color: #797; + border: 1px solid #797; +} + +/* Reset picto */ +div[id^=GPisochronReset] { + position: absolute; + margin-top: 5px; + width: 28px; + height: 28px; + border-radius: 3px; + opacity: 0.8; + background-position: -281px 0; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +div[id^=GPisochronReset]:hover { + opacity: 1; +} + +/* LAYER SWITCHER */ + +div[id^=GPlayerSwitcher-] { + font-size: 11px; +} + +div[id^=GPlayerSwitcher-] [draggable] { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + user-select: none; + /* Required to make elements draggable in old WebKit */ + -khtml-user-drag: element; + -webkit-user-drag: element; +} + +/* Manage opening of the components through hiden checkboxes */ + +div[id^=GPlayerSwitcher-] input[type="checkbox"] + div, +div[id^=GPlayerSwitcher-] input[type="checkbox"] + label + div { + max-height: 0px; +} + +div[id^=GPlayerSwitcher-] label { + display: block; +} + +/* Showing/hiding layers list */ + +label[id^=GPshowLayersListPicto] { + position: relative; + float: right; + display: block; + opacity: 1; + transition: opacity 0.5s ease-out 0s, box-shadow 0.5s ease-out 0s, border 0.5s ease-out 0s, border-radius 0.5s ease-out 0s; + cursor: pointer; +} + +span[id^=GPshowLayersListOpen], +span[id^=GPshowLayersListClose] { + position: absolute; + display: block; + transition: border-radius 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +span[id^=GPshowLayersListOpen] { + background-position: 0 0; + opacity: 1; +} + +span[id^=GPshowLayersListClose] { + opacity: 0; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListClose] { + opacity: 1; +} + +/* Layers list */ + +div[id^=GPlayersList] { + position: relative; + width: 180px; + border-bottom-right-radius: 0; + opacity: 0; + overflow: auto; + transition: max-height 0.5s ease-out 0s, opacity 0.5s ease-out 0.25s; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div[id^=GPlayersList] { + max-height: 232px; + opacity: 1; + transition: max-height 0.5s ease-in 0s, opacity 0.25s ease-in 0s; +} + +/* Layer : general */ + +.GPlayerSwitcher_layer { + position: relative; + top: 0; + background-color: #FFF; + border-bottom: 1px dotted #CCC; + overflow: hidden; +} + +div[id^=GPlayersList] .GPlayerSwitcher_layer:last-child { + border-bottom: none; +} + +.GPlayerBasicTools, +.GPlayerAdvancedTools { + position: relative; + width: 100%; + height: 28px; +} + +.GPlayerVisibility, +.GPlayerInfo, +.GPlayerInfoOpened, +.GPlayerRemove { + width: 28px; + height: 28px; + cursor: pointer; +} + +.GPlayerVisibility, +.GPlayerName, +.GPlayerInfo, +.GPlayerInfoOpened, +.GPlayerRemove, +.GPlayerOpacity, +.GPlayerOpacityValue { + position: absolute; + top: 0; +} + +.GPghostLayer { + opacity: 0; +} + +/* Layer basic tools */ + +.GPlayerBasicTools { + background-color: #FFF; +} + +.GPlayerVisibility { + left: 0; + background-position: -28px 0; +} + +input[type="checkbox"]:checked + .GPlayerVisibility { + background-position: 0 0; +} + +.GPlayerName { + left: 28px; + width: calc(100% - 56px); + line-height: 28px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding-left: 4px; + cursor: move; +} + +.outOfRange .GPlayerName { + color: #AAA; +} + +/* Showing layer advanced tools */ + +.GPshowLayerAdvancedTools { + top: 0; + right: 0; + background-position: -112px 0; +} + +.GPlayerAdvancedTools { + display: block; + max-height: 0; + opacity: 0; + transition: max-height 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + label + .GPlayerAdvancedTools { + max-height: 28px; + opacity: 1; +} + +/* Layer advanced tools */ + +.GPlayerInfo { + left: 0; + background-position: -55px 0; +} + +.GPlayerInfoOpened { + left: 0; + background-position: -83px 0; +} + +.GPlayerOpacity { + left: 28px; + width: calc(100% - 100px); + height: 28px; + padding-left: 8px; +} + +.GPlayerOpacityValue { + width: 32px; + left: calc(100% - 60px); + line-height: 28px; + font-size: 10px; + font-style: italic; + cursor: default; +} + +.GPlayerRemove { + right: 0; + background-position: -140px 0; +} + +/* Opacity slider : general */ + +.GPlayerOpacity input { + -webkit-appearance: none; + -moz-appearance: none; + background: none; + display: block; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + cursor: pointer; +} + +.GPlayerOpacity input[type="range"]:focus { + box-shadow: none; + outline: none; +} + +/* Opacity slider : Chrome, Safari, Opera */ + +.GPlayerOpacity input[type="range"]::-webkit-slider-runnable-track { + -webkit-appearance: none; + height: 3px; +} + +.GPlayerOpacity input[type="range"]::-webkit-slider-thumb:before { + position: absolute; + top: 0; + right: 50%; + left: -200px; + height: 3px; + pointer-events: none; +} + +.GPlayerOpacity input[type="range"]::-webkit-slider-thumb { + width: 9px; + height: 17px; + -webkit-appearance: none; + border: 2px solid #FFF; + background-color: #505050; + position: relative; + top: -7px; +} + +/* Opacity slider : Firefox */ + +.GPlayerOpacity input[type="range"]::-moz-range-track { + width: 80px; + height: 3px; +} + +.GPlayerOpacity input[type="range"]::-moz-range-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + border-radius: 0; + box-shadow: 0; + background-color: #505050; + position: relative; +} + +/* Opacity slider : IE */ + +.GPlayerOpacity input[type="range"]::-ms-track { + border: 0; + border-color: transparent; + border-radius: 0; + border-width: 0; + color: transparent; + height: 3px; + width: 80px; +} + +.GPlayerOpacity input[type="range"]::-ms-fill-lower, +.GPlayerOpacity input[type="range"]::-ms-fill-upper { + background: transparent; + border-radius: 0; +} + +.GPlayerOpacity input[type="range"]::-ms-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + background-color: #505050; +} + +.GPlayerOpacity input[type="range"]::-ms-tooltip { + display: none; +} + +/* Layer info panel */ + +div[id^=GPlayerInfoPanel] { + position: absolute; + top: 0; + overflow-y: hidden; + padding-top: 10px; + padding-bottom: 10px; +} + +.GPlayerInfoPanelOpened { + display: block; +} + +.GPlayerInfoPanelClosed { + display: none; +} + +div[id^=GPlayerInfoContent] { + position: relative; + width: 280px; + max-height: 200px; + overflow-y: auto; + padding-left: 10px; + padding-right: 10px; +} + +div[id^=GPlayerInfoTitle] { + width: calc(100% - 52px); + margin: auto; + margin-bottom: 10px; + padding-bottom: 5px; + text-align: center; + font-size: 1.1em; + font-weight: bold; +} + +div[id^=GPlayerInfoQuicklook] { + position: absolute; + top: -2px; + left: 10px; + width: 20px; + height: 20px; + cursor: pointer; +} + +div[id^=GPlayerInfoClose] { + position: absolute; + top: -8px; + right: 10px; + width: 28px; + height: 28px; + cursor: pointer; +} + +div[id^=GPlayerInfoDescription] { + font-size: 0.9em; +} + +div[id^=GPlayerInfoLegend] { + +} + +div[id^=GPlayerInfoMetadata] { + +} + +.GPlayerInfoSubtitle { + padding-left: 35px; + font-weight: bold; + margin-top: 10px; + margin-bottom: 4px; +} + +.GPlayerInfoLink, +.GPlayerInfoPopup { + line-height: 20px; + padding-left: 23px; + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; + color: #999999; + background-repeat: no-repeat; + cursor: pointer; +} + +.GPlayerInfoLink { + background-position: 0 -20px; +} + +.GPlayerInfoLink:hover, +.GPlayerInfoPopup:hover { + color: #333; +} + +.GPlayerInfoLink a, +.GPlayerInfoLink a:visited +.GPlayerInfoLink a:focus +.GPlayerInfoLink a:hover { + text-decoration: none; + color: inherit; +} + +/* Location */ + +/* Location form */ + +.GPlocationStageFlexInput { + max-height: 28px; + opacity: 1; +} + +.GPlocationStageFlexInputHidden { + max-height: 0; + opacity: 0; + overflow: hidden; +} + +.GPlocationOriginVisible { + display: block; +} + +.GPlocationOriginHidden { + display: none; +} + +label.GPlocationOriginPointerImg[id*="GPlocationOriginPointerImg"] { + width: 28px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + border-right: 1px solid #999; +} + +input[id*="GPlocationOriginPointer"] + .GPlocationOriginPointerImg { + background-position: -1px -1px; +} + +input[id*="GPlocationOriginPointer"]:checked + .GPlocationOriginPointerImg { + background-position: -29px -1px; +} + +.GPlocationStageRemove, +div[id^=GPlocationStageAdd] { + width: 28px; + border: none; + cursor: pointer; +} + +.GPlocationStageRemove { + background-position: -84px 0; +} + +div[id^=GPlocationStageAdd] { + background-position: -56px 0; +} + +/* Showing/hiding drawing panel */ + +label[id^=GPshowMeasureAreaPicto-] { + display: inline-block; +} + +input[id^=GPshowMeasureArea-] + label { + display: block; +} + +input[id^=GPshowMeasureArea-]:checked + label { + display: block; + background-color: rgba(0,60,136,0.5); +} + +input[id^=GPshowMeasureArea-] + label + div { + display: block; +} + +input[id^=GPshowMeasureArea-]:checked + label + div { + display: block; +} + +/* Showing/hiding drawing panel */ + +label[id^=GPshowMeasureAzimuthPicto-] { + display: inline-block; +} + +input[id^=GPshowMeasureAzimuth-] + label { + display: block; +} + +input[id^=GPshowMeasureAzimuth-]:checked + label { + display: block; + background-color: rgba(0,60,136,0.5); +} + +input[id^=GPshowMeasureAzimuth-] + label + div { + display: block; +} + +input[id^=GPshowMeasureAzimuth-]:checked + label + div { + display: block; +} + +/* Showing/hiding drawing panel */ + +label[id^=GPshowMeasureLengthPicto-] { + display: inline-block; +} + +input[id^=GPshowMeasureLength-] + label { + display: block; +} + +input[id^=GPshowMeasureLength-]:checked + label { + display: block; + background-color: rgba(0,60,136,0.5); +} + +input[id^=GPshowMeasureLength-] + label + div { + display: block; +} + +input[id^=GPshowMeasureLength-]:checked + label + div { + display: block; +} + +/* MEASURE TOOL */ + +.GPmeasureTooltip { + position: relative; + background: rgba(0, 0, 0, 0.5); + border-radius: 4px; + color: white; + padding: 4px 8px; + white-space: nowrap; +} + +.GPmeasureTooltip-measure { + font-weight: bold; +} + +.GPmeasureTooltip-info { + font-size: 0.75em; + text-align: center; +} + +.GPmeasureTooltip-static { + background-color: #ffcc33; + color: black; + border: 1px solid white; +} + +.GPmeasureTooltip-hidden { + display: none; +} + +.GPmeasureTooltip-measure::before, +.GPmeasureTooltip-info::before, +.GPmeasureTooltip-static::before { + border-top: 6px solid rgba(0, 0, 0, 0.5); + border-right: 6px solid transparent; + border-left: 6px solid transparent; + content: ""; + position: absolute; + bottom: -6px; + margin-left: -7px; + left: 50%; +} + +.GPmeasureTooltip-static::before { + border-top-color: #ffcc33; +} + +/* MOUSE POSITION */ + +/* Showing/hiding mouse position panel */ + +label[id^=GPshowMousePositionPicto] { + display: inline-block; +} + +input[id^=GPshowMousePosition-] + label { + display: block; +} + +input[id^=GPshowMousePosition-]:checked + label { + display: none; +} + +input[id^=GPshowMousePosition-] + label + div { + display: none; +} + +input[id^=GPshowMousePosition-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPmousePositionPanel-] { + width: 300px; + overflow: hidden; +} + +/* Basic infos */ + +div[id^=GPmousePositionBasicPanel] { + padding: 10px 15px; + position: relative; +} + +.GPmousePositionLabel, +.GPmousePositionCoords { + display: inline-block; + line-height: 20px; +} + +.GPmousePositionLabel { + width: 80px; + font-weight: bold; +} + +.GPmousePositionCoords { + width: 110px; +} + +/* Showing settings */ + +.GPshowMousePositionSettingsPicto { + bottom: 5px; + right: 0; + transition: all 0.5s ease-out 0s; +} + +div[id^=GPmousePosition-] input[type="checkbox"]:checked + .GPshowMousePositionSettingsPicto { + bottom: 100px; +} + +div[id^=GPmousePositionSettings-] { + display: block; + max-height: 0; + opacity: 0; + transition: max-height 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +div[id^=GPmousePosition-] input[type="checkbox"]:checked + label + div[id^=GPmousePositionSettings-] { + max-height: 95px; + opacity: 1; +} + +/* Settings */ + +div[id^=GPmousePositionSettings-] { + height: 95px; + padding-left: 0 15px; + overflow: hidden; +} + +.GPmousePositionSettingsLabel { + display: block; + margin: auto; + text-align: center; + font-weight: bold; + line-height: 16px; +} + +.GPmousePositionSettingsSelect { + width: 180px; + margin-top: 5px; +} + +/* General panels */ + +div[id^=GPmousePositionCoordinate-] input.error { + border: 1px solid rgb(255, 0, 0); +} +div[id^=GPmousePositionCoordinate-] input[readonly] { + border: 1px solid transparent; + padding: 2px; + text-align: right; +} + +input[id^=GPmousePositionLat-], input[id^=GPmousePositionLon-] { + width: 120px; +} + +span[id^=GPmousePositionAlt-] { + display: inline-block; + padding: 2px; + width: 120px; + line-height: 20px; + text-align: right; +} + +/* sexagesimal coordinates */ + +.GPSexagesimal, .GPSexagesimalsec { + margin:0; + border: 1px solid rgb(204, 204, 204); + border-radius: 4px; +} + +input:read-only.GPSexagesimal, input:read-only.GPSexagesimalsec { + text-align: right; +} + +.GPSexagesimal { + width: 30px; +} + +.GPSexagesimalsec { + width: 45px; +} +.GPmousePositionSexagesimalLabel { + font-size: 1.2em; + vertical-align: middle; + padding: 0; +} + +/* direction N/S ou E/O */ +select.GPmousePositionDirection { + border: 1px solid #999; + margin-left: 2px; +} + +select.GPmousePositionDirection:disabled{ + border: none; + background: transparent; + color: black; + /*For FireFox*/ + -webkit-appearance: none; + /*For Chrome*/ + -moz-appearance: none; +} + +/*For IE10+*/ +select.GPmousePositionDirection:disabled::-ms-expand { + display: none; +} +select.GPmousePositionDirection:disabled::-ms-value { + color: black; +} + +.GPmousePositionUnits, +.GPmousePositionAltitudeUnits { + margin-left: 5px; +} + +/* EDIT COORDINATES TOOLS */ +.GPmousePositionPanelEditTools { + position: absolute; + top: 20px; + right: 5px; +} + +.GPmousePositionEditTool { + width: 18px; + height: 18px; + display: inline-block; + cursor: pointer; +} + +span[id^=GPmousePositionCloseEdit] { + background-position: -18px 0; + margin-left: 5px; +} + +img[id^=GPmousePositionMarker]:hover { + cursor: pointer; + opacity: 0.7; +} + +/* Map center localisation */ + +#GPmapCenter { + display: none; + position: absolute; + top: 50%; + left: 50%; + width: 50px; + height: 50px; + margin-top: -25px; + margin-left: -25px; +} + +#GPmapCenter.GPmapCenterVisible { + display: block; +} + +/* REVERSE GEOCODING */ + +[id^="GPreverseGeocoding-"] { + top: 180px; +} + +/* Showing/hiding reverse geocoding panel */ + +[id^="GPshowReverseGeocodingPicto-"] { + display: inline-block; +} + +[id^="GPshowReverseGeocoding-"] + label { + display: block; +} + +[id^="GPshowReverseGeocoding-"]:checked + label { + display: none; +} + +[id^="GPshowReverseGeocoding-"] + label + div { + display: none; +} + +[id^="GPshowReverseGeocoding-"]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPreverseGeocodingResultsClose] { + top: 0; + right: 0; + width: 30px; + height: 32px; + /*background-position: -26px 0;*/ +} + +[id^="GPreverseGeocodingPanel-"] { + width: 280px; +} + +.GPreverseGeocodingComponentHidden { + display: none; +} + +div[id^="GPreverseGeocodingReturnPicto-"] { + position: absolute; + width: 26px; + height: 26px; + border-radius: 3px; + opacity: 1; + background-position: 0 0; + cursor: pointer; +} + +.GPreverseGeocodingReturnPictoHidden { + display: none; +} + +/* Calc waiting */ + +.GPreverseGeocodingCalcWaitingContainerVisible, +.GPreverseGeocodingCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPreverseGeocodingCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GPreverseGeocodingCalcWaitingContainerHidden { + display: none; +} + +.GPreverseGeocodingCalcWaiting { + margin: auto; +} + +/* Search panel */ + +[id^="GPreverseGeocodingForm-"] { + position: relative; + max-height: 270px; + overflow-y: auto; + padding-left: 15px; + padding-right: 15px; + padding-top: 10px; +} + +.GPreverseGeocodingCodeLabel, +.GPreverseGeocodingFilterLabel { + max-width: 105px; +} + +.GPreverseGeocodingCodeLabel, +.GPreverseGeocodingCode { + margin-top: 5px; + margin-bottom: 0; +} + +.GPreverseGeocodingFilterLabel, +.GPreverseGeocodingFilterInput { + margin-bottom: 5px; +} + +input[id^="GPreverseGeocodingSubmit-"] { + margin-top: 5px; + margin-bottom: 15px; + width: 100px; +} + +/* Calc waiting */ + +/* TODO: waiting */ +.GPreverseGeocodingCalcWaitingContainerVisible, +.GPreverseGeocodingCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPreverseGeocodingCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GPreverseGeocodingCalcWaitingContainerHidden { + display: none; +} + +.GPreverseGeocodingCalcWaiting { + margin: auto; +} + +/* Result panel */ + +div[id^=GPreverseGeocodingResultsList-] { + position: relative; + max-height: 210px; + overflow-y: auto; +} + +/* ROUTE */ + +div[id^=GProute-] { + top: 100px; +} + +/* Showing/hiding route panel */ + +label[id^=GPshowRoutePicto] { + display: inline-block; +} + +input[id^=GPshowRoute-] + label { + display: block; +} + +input[id^=GPshowRoute-]:checked + label { + display: none; +} + +input[id^=GPshowRoute-] + label + div { + display: none; +} + +input[id^=GPshowRoute-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GProutePanel-] { + width: 320px; +} + +.GProuteComponentHidden { + display: none; +} + +/* Calc waiting */ + +.GProuteCalcWaitingContainerVisible, +.GProuteCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GProuteCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GProuteCalcWaitingContainerHidden { + display: none; +} + +.GProuteCalcWaiting { + margin: auto; +} + +/* Route form */ + +form[id^=GProuteForm] { + padding: 15px; +} + +.GProuteFormMini { + max-height: 58px; + overflow: hidden; + -webkit-transform: translateY(-5px); + transform: translateY(-5px); +} + +.GProuteStageFlexInput { + max-height: 28px; + opacity: 1; +} + +.GProuteStageFlexInputHidden { + max-height: 0; + opacity: 0; + overflow: hidden; +} + +form[id^=GProuteForm] > .GPlocationStageFlexInput { + margin-top: 5px; +} + +form[id^=GProuteForm] > .GPlocationStageFlexInputHidden { + margin-top: 0; +} + +form[id^=GProuteForm].GProuteFormMini .GPlocationStageFlexInput:first-child { + margin-top: 5px; +} + +.GProuteOriginVisible { + display: block; +} + +.GProuteOriginHidden { + display: none; +} + +label.GProuteOriginPointerImg[id*="GProuteOriginPointerImg"] { + width: 28px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + border-right: 1px solid #999; +} + +input[id*="GProuteOriginPointer"] + .GProuteOriginPointerImg { + background-position: -1px -1px; +} + +input[id*="GProuteOriginPointer"]:checked + .GProuteOriginPointerImg { + background-position: -29px -1px; +} + +.GProuteStageRemove, +div[id^=GProuteStageAdd] { + width: 28px; + border: none; + cursor: pointer; +} + +.GProuteFormMini .GProuteStageRemove, +.GProuteFormMini div[id^=GProuteStageAdd] { + display: none; +} + +.GProuteStageRemove { + background-position: -84px 0; +} + +div[id^=GProuteStageAdd] { + background-position: -56px 0; +} + +/* Mode choice */ + +div[id^=GProuteModeChoice] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; + margin: 15px 0; +} + +.GProuteModeLabel { + display: block; + text-align: center; + margin-bottom: 5px; +} + +div[id^=GProuteTransportChoice] input { + display: none; +} + +.GProuteTransportImg { + display: inline-block; + width: 28px; + height: 28px; + cursor: pointer; +} + +.GProuteTransportImg:first-of-type { + margin-left: 18px; + margin-right: 10px; +} + +input[id^=GProuteTransportCar] + .GProuteTransportImg { + background-position: -112px 0; +} + +input[id^=GProuteTransportCar]:checked + .GProuteTransportImg { + background-position: -140px 0; +} + +input[id^=GProuteTransportPedestrian] + .GProuteTransportImg { + background-position: -168px 0; +} + +input[id^=GProuteTransportPedestrian]:checked + .GProuteTransportImg { + background-position: -196px 0; +} + +select[id^=GProuteComputationSelect] { + width: 100px; +} + +/* Showing/hiding exclusions */ + +input[id^=GPshowRouteExclusions] { + display: none; +} + +.GPshowRouteExclusionsPicto { + /* top: 185px; */ + /* bottom: 25px; */ + right: 0; + transition: all 0.3s ease-out 0s; +} + +input[id^=GPshowRouteExclusions] + label + div[id^=GProuteExclusions] { + max-height: 0; + opacity: 0; + margin-bottom: 0; +} + +input[id^=GPshowRouteExclusions]:checked + label + div[id^=GProuteExclusions] { + display: block; + max-height: 60px; + opacity: 1; + margin-bottom: 15px; +} + +/* Exclusions */ + +div[id^=GProuteExclusions] { + transition: max-height 0.5s ease-in-out 0.25s, opacity 0.5s ease-in-out 0.25s, margin 0.3s ease-in-out 0.25s; + overflow: hidden; +} + +.GProuteExclusionsLabel { + display: block; + text-align: center; + margin-bottom: 10px; + font-weight: bold; + line-height: 16px; +} + +.GProuteExclusionsOptions { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; +} + +.GProuteExclusionsOption { + display: block; + height: 28px; + line-height: 26px; + color: #A77; + background-color: #FEE; + padding-left: 28px; + padding-right: 5px; + border: 1px solid #A77; + border-radius: 3px; + cursor: pointer; +} + +input:checked + .GProuteExclusionsOption { + background-color: #EFE; + background-position: 0 -28px; + color: #797; + border: 1px solid #797; +} + +/* Reset picto */ +div[id^=GProuteReset] { + position: absolute; + width: 28px; + height: 28px; + border-radius: 3px; + opacity: 0.8; + background-position: -224px 0; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +div[id^=GProuteReset]:hover { + opacity: 1; +} + +/* Result panel */ + +div[id^=GProuteResultsPanel] { + padding: 15px; +} + +.GProuteResultStage { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +div[id^=GProuteResultsStages] { + margin-bottom: 15px; +} + +.GProuteResultStageLabel, +.GProuteResultStageValue, +.GProuteResultsValueLabel, +div[id^=GProuteResultsValueDist], +div[id^=GProuteResultsValueTime] { + display: inline-block; + line-height: 18px; +} + +.GProuteResultStageLabel, +.GProuteResultsValueLabel { + color: #666; +} + +.GProuteResultStageLabel { + width: 60px; +} + +.GProuteResultsValueLabel { + width: 65px; +} + +.GProuteResultStageValue { + -webkit-flex: 1; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +div[id^=GProuteResultsValueDist], +div[id^=GProuteResultsValueTime] { + width: 80px; + font-weight: bold; +} + +div[id^=GProuteResults-] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-between; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + margin-bottom: 10px; +} + +select[id^=GProuteResultsComputationSelect] { + width: 100px; +} + +div[id^=GProuteResultsNew] { + width: 28px; + height: 28px; + border-radius: 3px; + opacity: 0.8; + background-position: -224px 0; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +div[id^=GProuteResultsNew]:hover { + opacity: 1; +} + +/* Results details header */ + +.GPfakeBorder { + display: inline-block; + height: 14px; + width: 60px; + border-bottom: 1px solid #999; +} + +.GPfakeBorderLeft { + margin-left:15px; +} + +input[id^=GProuteResultsShowDetails] + label, +input[id^=GProuteResultsShowDetails] + label + label { + width: 130px; + line-height: 28px; + vertical-align: top; + text-align: center; + font-weight: bold; + cursor: pointer; + transition: color 0.2s ease-out; +} + +input[id^=GProuteResultsShowDetails] + label, +input[id^=GProuteResultsShowDetails]:checked + label + label { + display: inline-block; +} + +input[id^=GProuteResultsShowDetails]:checked + label, +input[id^=GProuteResultsShowDetails] + label + label { + display: none; +} + +input[id^=GProuteResultsShowDetails] + label + label + div + div[id^=GProuteResultsDetails] { + max-height: 0; + opacity: 0; +} + +input[id^=GProuteResultsShowDetails]:checked + label + label + div + div[id^=GProuteResultsDetails] { + max-height: 200px; + opacity: 1; +} + +div[id^=GProuteResultsDetails] { + overflow-y: auto; + transition: max-height 0.5s ease-in-out 0.25s, opacity 0.5s ease-in-out 0.25s; +} + +.GProuteResultsDetailsNumber, +.GProuteResultsDetailsInstruction { + display: inline-block; + margin-top: 4px; + line-height: 16px; + color: #666; +} + +.GProuteResultsDetailsNumber { + font-weight: bold; + width: 22px; + text-align: right; + vertical-align: top; +} + +.GProuteResultsDetailsInstruction { + width: calc(100% - 30px); + padding-left: 5px; +} + +/* SEARCH ENGINE */ + +input[id^=GPshowSearchEngine-] + label + form[id^=GPsearchInput-] { + max-width: 0px; +} + +/* Showing/hiding search engine input */ + +input[id^=GPshowSearchEngine-] { + display: none; +} + +label[id^=GPshowSearchEnginePicto] { + display: inline-block; + transition: border-radius 0s ease-out 0s; + transition-delay: 0.5s; +} + +input[id^=GPshowSearchEngine-]:checked + label { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + transition-delay: 0s; +} + +input[id^=GPshowSearchEngine-] + label + form[id^=GPsearchInput-] { + max-width: 0px; + border: none; + transition: max-width 0.5s ease-out 0s; +} + +input[id^=GPshowSearchEngine-]:checked + label + form[id^=GPsearchInput-] { + max-width: 280px; +} + +input[id^=GPshowSearchEngine-] + label + form[id^=GPsearchInput-] + div[id^=GPshowAdvancedSearch] { + display: none; +} + +input[id^=GPshowSearchEngine-]:checked + label + form[id^=GPsearchInput-] + div[id^=GPshowAdvancedSearch] { + display: inline-block; +} + +div[id^=GPautoCompleteList] { + display: none; +} + +input[id^=GPshowSearchEngine-]:checked + label + form[id^=GPsearchInput-] + div[id^=GPautoCompleteList] { + display: block; +} + +/* Simple search input */ + +form[id^=GPsearchInput-] { + display: inline-block; + position: relative; + left: -3px; + width: 280px; + overflow: hidden; +} + +form[id^=GPsearchInput-] input { + display: block; + width: 100%; + height: 100%; + border: 1px solid #999; + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; + padding: 0; + padding-right: 30px; + padding-left: 5px; + color: #333; + font-size: 1.0em; +} + +form[id^=GPsearchInput-] input:disabled { + background-color: #DDD; + color: #999; +} + +div[id^=GPsearchInputReset] { + position: absolute; + top: 0; + right: 0; + width: 30px; + height: 32px; + background-position: -30px 0; + cursor: pointer; +} + +/* General panels */ + +div[id^=GPgeocodeResultsClose], +div[id^=GPadvancedSearchClose] { + top: 0; + right: 0; + width: 30px; + height: 32px; +} + +div[id^=GPgeocodeResultsClose] { + background-position: 0 0; +} + +div[id^=GPadvancedSearchClose] { + background-repeat: no-repeat; +} + +/* Advanced search picto */ + +div[id^=GPshowAdvancedSearch] { + transition: border-radius 0s ease-out 0s; + transition-delay: 0.5s; +} + +/* Advanced search panel */ + +div[id^=GPadvancedSearchPanel] { + display: none; + width: 280px; + vertical-align: top; + overflow: hidden; +} + +form[id^=GPadvancedSearchForm] { + max-height: 220px; + overflow-y: auto; + padding-left: 15px; + padding-right: 15px; +} + +.GPadvancedSearchCodeLabel, +.GPadvancedSearchFilterLabel { + max-width: 105px; +} + +.GPadvancedSearchCodeLabel, +.GPadvancedSearchCode, + div[id^=GPadvancedSearchFilters] { + margin-top: 15px; +} + +.GPadvancedSearchFilterLabel, +.GPadvancedSearchFilterInput { + margin-bottom: 5px; +} + +input[id^=GPadvancedSearchSubmit] { + margin-top: 10px; + margin-bottom: 15px; +} + +/* Autocomplete list / geocode results */ + +div[id^=GPautoCompleteList], +div[id^=GPgeocodeResultsList] { + width: 280px; +} + +div[id^=GPautoCompleteList] { + top: 35px; +} + +div[id^=GPgeocodeResultsList] { + display: none; + position: absolute; + top: 40px; + border-radius: 4px; + overflow: hidden; +} + +div[id^=GPgeocodeResults-] { + background-color: #FFF; + max-height: 140px; + overflow-y: auto; +} + +/** +* Map loading +* @sample +* function setMap(map) { +* var center = this._createLoadingElement(); +* map.getViewport().appendChild(center); +* center.className = ""; // invisible ! +* center.className = "GPmapLoadingVisible"; // visible ! +* } +* +* function _createLoadingElement() { +* var div = document.createElement("div"); +* div.id = "GPmapLoading"; +* div.className = ""; +* return div; +* } +*/ + +#GPmapLoading { + display: none; + position: absolute; + z-index: 50; + top: 50%; + left: 50%; + width: 50px; + height: 50px; + margin-top: -25px; + margin-left: -25px; +} + +#GPmapLoading.GPmapLoadingVisible { + display: block; +} + +#GPmapLoading { + background-image: url(data:image/gif;base64,R0lGODlhNAA0AIQSAAFkpSZ5sAGV3k2Ruiao3kOj1/GUBk225pe/B4S83XrK75HH3qrS5szMzNbW1sHe797e3ubm5v///////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAQAfACwAAAAANAA0AAAF5uAnjmRpnmiqrmzrvnAs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pHLJTCKeiCYUupxOlVaqMxvdZqtWqbZJLpvPyEK5wGYz23AlPJ6c0412t9yucjQaDi98KX+FDTBtfYZ/gUmLhUqPf0p+i42Oi00QfxAiIQAh+QQFAQAfACwEAAQAGgAnAAAFc+AnjmRZGqhhrmyasrDounE7o/V64yvi6zuTb4gA0oTEn+lYSg5zSGcROpJOqVUntknc9rzgsHhMLhXOhTEaHV6vwW62N36G09tutbzM7/v/JhFlDYQNDmKFhYdeEYmFYA6OhIJbEJINYZdhlolkEA6UUCEAIfkEAQEAHwAsBAAEACcAGgAABXXgJ45kWSIoYq5sS6apK8swPN9mHeP8p6O9UmG4+qlMhmRryCwUa6uk1LBqMp9A5FQptBKDW2nX6+SFxSRyuXemjpvBz5lljYu2srX9vu/7/4CBgh8NhQ6DK4WKDYgkEIuGjSKQipKElIySj5CHlpSWIw6RoCEAOw==); +} + +/* General panels */ + +.GPpanel { + box-shadow: 0 0 6px #000; + border-radius: 4px; +} + +.GPpanelHeader { + height: 32px; + padding: 3px; + background-color: #9DB1BD; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +.GPpanelTitle { + line-height: 26px; + border-top-left-radius: 2px; + border-top-right-radius: 2px; + background-color: #366291; + color: #FFF; +} + +.GPpanelClose { + top: 3px; + right: 3px; + width: 26px; + height: 26px; + background-position: -26px 0; +} + +/* Showing/hiding advanced panels */ + +.GPshowAdvancedToolPicto { + width: 32px; + height: 32px; + padding: 3px; + background-color: rgba(255, 255, 255, 0.4); + border-radius: 4px; +} + +.GPshowAdvancedToolPicto:hover { + background-color: rgba(255, 255, 255, 0.6); +} + +.GPshowAdvancedToolOpen { + width: 26px; + height: 26px; + background-color: rgba(0,60,136,0.5); + border-radius: 2px; +} + +.GPshowAdvancedToolPicto:hover .GPshowAdvancedToolOpen { + background-color: rgba(0,60,136,0.7); +} + +/* Submit inputs */ + +input.GPinputSubmit { + background-color: #366291; +} + +/* Showing additional hidden options */ + +.GPshowMoreOptionsImage { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAA7ElEQVRIx+3UvUoDQRSG4ffMLhbaLIEFvQSxtN1ALiGymkswpZVoupS6Vt6BYBMWf+s0Kaa1FG9BEBYbDQRnj4UKqTRgtjtPeWaYb4YPBowxpmmyyKbs6PpJVCfVan3wOOzN5te2huVK692dq0jHn+abf53lFrqWMlKRfjKNxu1Bmf6M24MyTabRWEX6KKOlvRAgO77ZQ/UCqBDXdSqzmnAPbKDs+yK/XGrgV+jtNlrfAcn36BVxXX+y89BYh+kbrQ+JrgBiDbsva1SNdhhigi/yzBd5FmKCdfivQIDOYbk+3+HkrPds35kx5lef+y50/JHC/FoAAAAASUVORK5CYII=); +} + +div[id^=GPAttribution-] { + display: flex; + bottom: 8px; + right: 8px; + width: calc(90% - 1.3em); + z-index: 1; +} + +div[id^=GPAttributionsListContainer-] { + display: none; + width: 80%; + height: 80%; + background: white; + opacity: 0.5; + border-radius: 4px; + z-index: 0; + position: absolute; +} + +div[id^=GPAttributionsListContainer-] ul { + display: flex; + margin: auto; + list-style: none; +} + +label[id^=GPshowAttributionsListPicto-] { + display: flex; + z-index: auto; + position: relative; + margin-left: auto; +} + +input[id^=GPshowAttributionsList-]:checked + div[id^=GPAttributionsListContainer-] { + display: flex; +} + +input[id^=GPshowAttributionsList-]:checked + div[id^=GPAttributionsListContainer-] + label[id^=GPshowAttributionsListPicto-] { + background-color: transparent; +} + +span[id^=GPshowAttributionsListOpenClose-] { + color: #fff; + font-size: 1.6em; + font-weight: 700; + text-align: center; + line-height: 1.2em; +} + +div[id^=GPAttributionsListContainer-] li:before { + content: " | "; +} + +div[id^=GPAttributionsListContainer-] ul li:nth-child(1):before { + content: ""; +} + +div[id^=GPAttributionsListContainer-] ul li:first-child:before { + content: ""; +} + +div[id^=GPAttributionsListContainer-] a:link { + text-decoration: none; +} + +div[id^=GPAttributionsListContainer-] a:visited { + text-decoration: none; +} + +/* BOOST RELIEF ITOWNS */ + +div[id^=GPboostRelief-] { + top: 8px; + left: 8px; + z-index: 1; +} + +/* Showing/hiding boostRelief panel */ +label[id^=GPshowBoostReliefPicto-] { + display: flex; + z-index: 1; + position: relative; + margin-left: auto; +} + +label[id^=GPshowBoostReliefListPicto-] { + display: flex; + z-index: 1; + position: relative; +} + +/* +span[id^=GPshowBoostReliefOpenClose-] { + color: #fff; + font-size: 1.6em; + font-weight: 700; + text-align: center; + line-height: 1.2em; +}*/ + +span[id^="GPshowBoostReliefOpenClose-"] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAA5ElEQVRIx+2VTQ+CMBBE31Y0hnjz//9RDYwHi6nYLiVF4sE5Qd9OPwayNQBJARBgwMBTwcwUeQeMQADukR/MbKzxf0jSNLGm5y35W1H6no618vlODjGGt+KEn2KMJZ71AwRJMjOLrAdeE03jCb8CZ4dn/ZJk6fESA7mMW3kx4y3fwwyeJB0pSNJFUu/woj9kxgZ83Ra47/92dJ0Hlzazlv+1j9yGueUiX1+sqjs7Cj+Vf2nnXn2x16XXRUv+7jxe/jXdoFSbMptdfNnFc7y2riqd2gibeuDa77RUH/b8pa31NDW+B1R2l0Qaq9wyAAAAAElFTkSuQmCC); +} + +.spanClose span[id^="GPshowBoostReliefOpenClose-"] { + background-position: 0 0; +} + +.spanOpen span[id^="GPshowBoostReliefOpenClose-"] { + background-position: -26px 0; +} + +/* +div[id^=GPboostRelief-] input[type="checkbox"]:checked + div + label[id^=GPshowBoostReliefPicto] span[id^=GPshowBoostReliefOpen] { + opacity: 0.7; +} + +div[id^=GPboostRelief-] input[type="checkbox"]:checked + div + label[id^=GPshowBoostReliefPicto] span[id^=GPshowBoostReliefClose] { + background-color: rgba(0,60,136,0.3); +} + +div[id^=GPboostRelief-] input[type="checkbox"]:checked + div + label[id^=GPshowBoostReliefPicto] :hover span[id^=GPshowBoostReliefClose] { + background-color: rgba(0,60,136,0.4); +} + +*/ + +/* Relief slider : Chrome, Safari, Opera */ + +.GPlayerRelief input[type="range"]::-webkit-slider-runnable-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Relief slider : Firefox */ + +.GPlayerRelief input[type="range"]::-moz-range-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Relief slider : IE */ + +.GPlayerRelief input[type="range"]::-ms-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* BUILDINGS ITOWNS */ + +div[id^=GPbuildings-] { + top: 8px; + right: 8px; + z-index: 1; + padding: 3px; + background-color: rgba(255, 255, 255, 0.4); + border-radius: 4px; +} + +/* Showing/hiding buildings panel */ +label[id^=GPshowBuildingsPicto-] { + display: flex; + height: 28px; + width: 28px; + z-index: 1; + position: relative; + margin-left: auto; + width: 26px; + height: 26px; + background-color: rgba(0,60,136,0.5); + border-radius: 2px; +} + +label[id^=GPshowBuildingsPicto-].buildingsOn { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAZS3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjaxZxZciu7jkX/OYoaQrInh8M24s2ghl8LJCXLkm3Z73zUcVxLllJMEM3GBghdNf73P1P9D/+Sc0E5H1PIIVz8c9llU3iSrv2vrN/6cuv3/qOc9/Tn19X9DcNLlke7/0zhXH97Xd8XuC2oL/+wUGrnjfr5jezO+ulpoXMjKxIZnvSzUD4LWbPf0GeBciQNOcXHLdSxH8/ntxr4T8mvedNJ3A/Pf7uI9rrnPtaYYbW9+G1s2gJY+c8oW3gS+K2t50LNi4X/5BVr9ZFEFPmFnu7/MhJNEdV9edEnq9yf6a9fV8/WcuZcYp+UHO6PX76utP/aKkv1D3d26Twzn18vU88t0ZP2l/JnT3PtmV0UF1B1OJu6bWU947rKLeTWSSFawDoBH0o8yk/mJ+HVDVfoV7sqP01nbTDX1E53XfTUYz023RDRmaFM5Ikxzdj1YrLRZNOs2M/Jj54m2my7TdiyYXbLq+Yui163zVdT626JO3fNpUazmLjAn3/UXz8wp4SC1le66wq5jBFlI4ZYTn5zGRbZdlixpx9+nv+JXS0W9KJlCZGMYuteonr9gQR2Gdpyoedxx6CO/SyAiri1RxhtsQBWIzZ00Fc0JmqNIhMGKohurDMVC2jvTUdI46wN2CYZuTUfiXpdarzhZcXrgBmW8MRXxDbZFozlnMd/okv4UPHWO+998NEnn30JNrjgQwgxCCiWaKNT0ccQY0wxx5JscsmnkGJKKaeSTbaAps8hx5xyzqVwz8LKhU8XLiilmmqrq17VUGNNNdfScJ/mmm+hxZZabqWbbjv40UOPPfXcy9ADVxpu+BFGHGnkITFiplXTTT/DjDPNPMvdasesLz9/sJo+VjPLUnJhvFuNV2O8LaEFTrzYDIMZ5TQWj2ICHNq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wNjQ2ODY4ODgxIgogICAgICBzdEV2dDpzb2Z0d2FyZUFnZW50PSJHaW1wIDIuMTAgKExpbnV4KSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMi0wNi0xNFQxNzo1MTozMCswMjowMCIvPgogICAgIDxyZGY6bGkKICAgICAgc3RFdnQ6YWN0aW9uPSJzYXZlZCIKICAgICAgc3RFdnQ6Y2hhbmdlZD0iLyIKICAgICAgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDo1MjAzZmE0Ny1kYTQ0LTQ0MmItODM3MS1hM2JkZDY2MmZjNTQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkdpbXAgMi4xMCAoTGludXgpIgogICAgICBzdEV2dDp3aGVuPSIyMDIyLTA2LTE1VDEyOjI2OjMxKzAyOjAwIi8+CiAgICA8L3JkZjpTZXE+CiAgIDwveG1wTU06SGlzdG9yeT4KICA8L3JkZjpEZXNjcmlwdGlvbj4KIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/PlXnzYgAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmBg8KGh/rWMUxAAAAyUlEQVRIx+1Wuw7CMAy0oyAGEAMb/P9PsnBdUsmynMS1YgQSt6Rtoju/YpfojyB4FREAdEWYOVUEDUREBcBDbd4jIjCwzJOZN3ItAK4/UU1uj9RmzTKoqPf3p4R2z07ZQhdPTiS8QtVIHslV3uz9jLwfXrHaI9AkvTNuj0ZWMjNri4+Eaxi6USO0vh0K3ShkqeWdgertzNpTT1HIDl4nIufG+YqEVBrD1tyYTcvIrCkjwkZ2E8/fXwxmmETyn71/gGVCAEr0clrYAONE4R0PSBonAAAAAElFTkSuQmCC); +} + +label[id^=GPshowBuildingsPicto-].buildingsOff { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAbu3pUWHR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gogICAgICBzdEV2dDp3aGVuPSIyMDIyLTA2LTE1VDEyOjI2OjMxKzAyOjAwIi8+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjM1MDAzNzUxLWE5ODYtNDk1Yy1iMThiLTA3NTMzNDY0ZmExMSIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChMaW51eCkiCiAgICAgIHN0RXZ0OndoZW49IjIwMjItMDYtMjlUMTU6Mjk6MDkrMDI6MDAiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+VUdqhwAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB+YGHQ0dCa+SbzYAAADhSURBVEjHxVZBDsMgDItZtB027QH9/w+3Sy/NLkVCESQZAuoLUithbJwEiIiQAgDQYCRaBNQUzVDHo05sHRgAeBRJTXlJnohos+yRApYSqaDcFxHp1n1ZagAgr0lEXitSxwC++rSeTT1pTGojnqVIF+yxiijjjhNeGnuJntPCUKkHKtehRJlEW1V+t2yKpDHVSGqVPdy6WTOJLcusFhQp6ksGH0dmjF57xgc7JI/Tsb2VLo88//d6265rSkfdi757R0ULenvtaNmbIZLG5Pi7AfhEJmroudWooxuA41+SlqIfMHbgRNt5fX8AAAAASUVORK5CYII=); +} + +/* LAYER SWITCHER OL3 */ + +div[id^=GPlayerSwitcher-] { + top: 8px; + right: 8px; + z-index: 1; +} + +/* Showing/hiding layers list */ + +label[id^=GPshowLayersListPicto] { + width: 38px; + height: 38px; +} + +span[id^=GPshowLayersListOpen] , +span[id^=GPshowLayersListClose] { + top: 3px; + left: 3px; + width: 32px; + height: 32px; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAACAklEQVRo3u3YsWsUQRgF8DMoBlFzikUQbMRGSG1xJ8QYWxFrMb3YpFI7g1jYibX4B4ilqI2EgIeVkE4sLCIWYmOCEVEUfxZ+J8uy5wVvZ3c192CbY/Z78958OzfzWq0xxhjjfwNmML1dxU9gFZvopCZro90wAxb8whomU5Hsw1V8wEfcwoEGiJ/EmzDgQmrhedRuBK7FXFYxkVp4D6fRwcO6jcDBzPzOJBdeMLZWI3AneB9VKrwJRuAovuA7ZkYttoiNjIDX6P5FnW6828cGFhMZ8CA47ta6+nV0AU7gBz7jSCUbX8Pa/1lw3Si78O6tGjFMeL9WAvHng+899pdVtBti8iKmcB3rGaFP4+ljPcZMFZjXw3yJ4nfiZfBeKtPVkzlReSOKOmIrY3o4W+I8L0fdV9iVor2GGdHviEErnkR48OzFu6h/LvUB449GVCk8w3czOJ5jR9nF+yv7GLOZ3+ewUvC95/eFFcxl3puNWr87ZcT5Hcan+OvrpHA3fxBazhmR74jCFQ/hy2UfhHAv6t1P2faDWnq+oCPyK95NdRbAcXzDVxyr4oIx1IgqhGc4nkTt21Xfs9tYKvo0BrT6UtlJEU5l9p5DdQUOtQQikfO9CJ4rTcjdKo3EcDHEv8WeJgWQyUPRyPnWwoCF1nZDXLQ2S8/5/jETpkdOesYYY4wi/ATOin+8BhQ7TwAAAABJRU5ErkJggg==); +} + +span[id^=GPshowLayersListClose] { + background-position: -32px 0; +} + + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListOpen] { + opacity: 0.7; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListClose] { + background-color: rgba(0,60,136,0.3); +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] :hover span[id^=GPshowLayersListClose] { + background-color: rgba(0,60,136,0.4); +} + +/* Layers list */ + +.GPlayerVisibility, +.GPshowLayerAdvancedTools, +.GPlayerInfo, +.GPlayerInfoOpened, +.GPlayerRemove { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAAAcCAYAAAD1EPTXAAAIgElEQVR42u2abWxT1xnHf8dOINhQXqpbRUEkiBECd0IghseLYhKhIAZkCIibfUFFQmpRPoAT8f62lQ8wSBaFJB/8CSEYIJoZglRKhFpFycgaJnspGZ1ZwoJITS23Fw2lyM40x/fsA7HLS4D4ha6p7u+Tfc699/Fzzv885znPNRgYGBgYGBgYGBgYGBgYGIwNhDEEBm+KnTt3zjWbzSuebotGo3+ura3952ifkTHWnL527Zr85ptvmDVrFkVFRWlbYDU1Ne+MGzduh5RyHZA/3NwLfBKJRBp37979bTr9WL7r8jumDHYg9XUg8gEk9Ar4RI+Kxs//sOnbsS5Qs9m8QkppF0LcAJBS2s1mM8CoBTrmIui2bdvkvXv3OHToUNoEevLkyXeBU8Ckl1zyWEq5taqqyp0Oe4X7Lr+LlK+0JyRbb1SXucfS3NTV1c0ymUwlUsoS4Fev8O8/QogOKeVnQojPnE7n39IWQc+dOyfb29vRNC3epigKRUVFbN68Oa2C9/v9MhAIcP/+fcLhMAAXLlwAICsrC7/fL2fMmCHSIM6PXrNYJwkhmurq6spTFemwOF9rTwqa7HsulY8lkQoh+qSUo7k0a1jEJcPXi5QjaF1dnfR6vaxZs4aioiK2b98e71NVFVVVcbvdOByOtAi1tbVVBgIB8vPzycvLo6WlhWAwSGtrK7m5uXzwwQf4fD5UVWXJkiVJ2aupqXknMzPzX8+vdKfTCUB9ff3zt3xnMplm79ixQ0t6WzfLF+zdOL4JAPu+y8/dIb8TJn32jd+Xayktir2X7ggp2/5t0Z3/+LD8v0/3/fzDpnHTwqZ6KURxx4myeT820WeMJoq5XC40TeP48ePEIlYsenV1dcmzZ88CcOLECVwuFwcOH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GjsNlsuFwu/H6/VFUVn8+Hw+Fg5syZcXGuXbsWn89HXl4efr9fnjlzBpvNxurVqxM6uCxatEjk5OTg8XgIBoMyFpVVVeXhw4cAzJw5k/z8fDRNY/LkyQSDQXnr1i1ycnKYP39+ogelq0nMwccpFGKSsCc+TlU0P2QOKoT4GngmgDzNhAkTGBwcfObalA5J7733HoqiUFtbSzgcRlVVzpw5Q0VFBVeuXBEOhwOXy4WqqgDU1taiKAoHDx5M6hS/YMECrFYrnZ2dRCIRFEWhu7ubR48eAbBq1Sq8Xm88Wnd2dmK1WhNeDACRSKQReJzA4A8MDQ01Jjt5elQkZA8YyBzKbEyHcH6oHFTX9a9jW/yECRNe6LdarfHUbDQCTagO2t7ejsPhQNO0Z/LLWB20paWFNWvWpK0O2t/fj6qq9PX1cfr0aSZOnMj69etRFAVFUbh79y75+flJ10GH/XIIIZpGMRZSSumoqqq6nIpf9j2XHFIwSnvC8ZfqTZdJI8W7m7KHhNkNkCGjjraa8mA6n9/Q0LBA1/VbU6dOZe7cuXR2djJnTgEAvb09LF++nDt37sQCzoLKysq/p1QHjVFVVSUAHA6H9Pl8z/TFDkfnz58X58+fT4ujK1euFLE3SV9++WU8/4zlN7G3V6m+SaqqqnLX1dWVCyFOvax+J4QY0HV9a6riBLhRXea277lULoU8BeJl9cIBKcXWdIsTYFiQhbwhTCbTA13XR3VI0nX9Qdoi6P+Tw4cPy5s3b/L+++9TXl7+Rn5zQ0ODEo1Gtwsh1gFzhpt7gatDQ0ONu3btephOe/b9TQrSvF1KnrEnEVczhzIb22p//ZAxysmTJ0OApbi4mLa2tngN9Kuv+om1AeHKykrrT0KgGzZskKFQiIaGBubNm2f8RfDHL9Bevv9H2Mvy+V6n01lgjJaBgYGBgYGBgYGBgYGBwU+F/wFeHcFLHB+SVgAAAABJRU5ErkJggg==); +} + +/* Opacity slider : Chrome, Safari, Opera */ + +.GPlayerOpacity input[type="range"]::-webkit-slider-runnable-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Opacity slider : Firefox */ + +.GPlayerOpacity input[type="range"]::-moz-range-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Opacity slider : IE */ + +.GPlayerOpacity input[type="range"]::-ms-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Layer info panel */ + +div[id^=GPlayerInfoPanel] { + right: 190px; +} + +div[id^=GPlayerInfoTitle] { + color: #366291; + border-bottom: 1px solid #366291; +} + +div[id^=GPlayerInfoQuicklook] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJTSURBVEiJ7ZZdSJNRGMd/59Vo9m6jQYKWRV/MQYGBXSStC2/S27YmXYfQZRexZiBhdNE2ke68qq5rY3rRjRFE1Du0KKIcwQYtaGpCH+r01ZrsPV2lc853c0IE+r87z3P+Px7OOc85B7adROFgcHDQAbRWYtR1fdTv9+vF8do1dCFanE7nU6vVagpbWFgglUq1A89NgQB2ux2Hw2EKVBRl45ypswqtq7BYM/oyD8emSE7rgMTVaKPTtac64E99mZtDKRZzeZobVABef55lPDPH6b2W+k0DH72aYjGX51rnEU4csAGQmJhnYCTNmx/qFSBa7DFdw+RXneYGdQUGcLLJxvF6C78M5VQpT5lNkebpzQJdjTaS0zqJifmVWGJynk/fflNXa7wr5Vm3htlsFsMwADjvtDCeEQyMpDm2bzcA6e85LLWwvy434vNFaqLRrnyhf03r9ff3q6qqthXGJhct9W9nrN1LeaUFoK7GeH/YujScmLWGhRCRl5YPl+nrM0oCNyN3INYL3AbxQAtd6AYhAWqqBX6JR14cOndpF8irB90f7Zl45AlssfW0oKdXIu8qQslshbOjba+SneIOxFavGSG6tKAn6u4ZCiBlsHCeFvKu85sd7AkgKg2ZAdCCnpCU3CtXodmNPaqFvF0rVfcMtyINbzlgRa139nrsDDL/DHCAzAL3twQE2kHYQWalFB1ayNuN4FbVwHjYewfkDSlFRzzsHXP3xI6C8rjU3LLv8l9poYurOywJguGjxCn5pz+HNncgFtkoVw2wCfBVUtWO/nP9AYuuwXn+Xm/WAAAAAElFTkSuQmCC); +} + +div[id^=GPlayerInfoClose] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAgCAYAAAAFQMh/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGUSURBVEiJ7ZQxT8JQEMf/hxOsDg6GOGtiYgyy0I4Ormj8BBqpZW9HFhNxRKom8AU0tHFRRx1KYlwcQIkrzM4mGnoOtlJKsa/q2N/4ernfu97dAxISEhJ+CYkEyZq1y8w5O9NRUKk44VFMsm7VHIdf2kdb9aicM0JS8BkIuezH3PxgfekKd3cclEqaeQxQmYg2soXt10H74uGnvKkoMROveHFE2JHelusAkz9C0iwDINU9IErRYlTeyIr79vnNgtybBZB3j9ayhZ5b+S3cSvd9F2nY6a46+VfGEeqx1z9mlL9PmJqE4TsoFZSWps9BbHG4PPBdWBpT7Mkva8zOmJzZabYzT3uiUkBguCbUPAy5LMUsQGC4fEpvZdTgFyJanb5qfxKHSbkB4B6g/JccseQC4nCpne6W+gfKtX/V4sgjeyPppgGGb2VwaleLKkA8uphlAFB8WU/sw82JlviJHC4CHgG408oNO90pj6QAQGxXiyoRvPeZwfQclVcIWWspkm4a409lECZJNw1ZaynTYxISEhL+gU/lu7XSwAzyjAAAAABJRU5ErkJggg==); +} + +.GPlayerInfoLink, +.GPlayerInfoPopup { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJTSURBVEiJ7ZZdSJNRGMd/59Vo9m6jQYKWRV/MQYGBXSStC2/S27YmXYfQZRexZiBhdNE2ke68qq5rY3rRjRFE1Du0KKIcwQYtaGpCH+r01ZrsPV2lc853c0IE+r87z3P+Px7OOc85B7adROFgcHDQAbRWYtR1fdTv9+vF8do1dCFanE7nU6vVagpbWFgglUq1A89NgQB2ux2Hw2EKVBRl45ypswqtq7BYM/oyD8emSE7rgMTVaKPTtac64E99mZtDKRZzeZobVABef55lPDPH6b2W+k0DH72aYjGX51rnEU4csAGQmJhnYCTNmx/qFSBa7DFdw+RXneYGdQUGcLLJxvF6C78M5VQpT5lNkebpzQJdjTaS0zqJifmVWGJynk/fflNXa7wr5Vm3htlsFsMwADjvtDCeEQyMpDm2bzcA6e85LLWwvy434vNFaqLRrnyhf03r9ff3q6qqthXGJhct9W9nrN1LeaUFoK7GeH/YujScmLWGhRCRl5YPl+nrM0oCNyN3INYL3AbxQAtd6AYhAWqqBX6JR14cOndpF8irB90f7Zl45AlssfW0oKdXIu8qQslshbOjba+SneIOxFavGSG6tKAn6u4ZCiBlsHCeFvKu85sd7AkgKg2ZAdCCnpCU3CtXodmNPaqFvF0rVfcMtyINbzlgRa139nrsDDL/DHCAzAL3twQE2kHYQWalFB1ayNuN4FbVwHjYewfkDSlFRzzsHXP3xI6C8rjU3LLv8l9poYurOywJguGjxCn5pz+HNncgFtkoVw2wCfBVUtWO/nP9AYuuwXn+Xm/WAAAAAElFTkSuQmCC); +} + +div[id^=GPminiglobeContainer-] { + display: block; + width:100px; + height:100px; + left: 20px; + bottom: 20px; + color: white; +} + +/* MOUSE POSITION */ + +div[id^=GPmousePosition-] { + bottom: 8px; + left: 10px; + z-index: 2; /* > z-index attribution*/ +} + +/* Showing/hiding mouse position panel */ + +span[id^=GPshowMousePositionOpen] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAaCAYAAAD43n+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD2SURBVFiF7ZbRDoIwDEUZ36oPRP9GMVF+k1c5vpQ4l24CFkfITsIDY2l70+6yqirsDITcdcSocxdQKHxhjTMEHIE7ED0CgAMuwNkyt7kgEfOUsJ0mSsRcZc9gLsoSoOWTG+C8707WfNqcNSfxRsmnA+qgMyOP1GjOSaxioCklKuyejRhJOtLLYyZI4muilosJC4y89957P2H/LMEJUapZaGzxpuAmrv3Gn0YuNIBFXZqaUMUodszNwjVbUWuQEDPatmrpueuOQu4fq+WoSbwD76uPas1BpwbgZJV/rctpI52KupmIaoHGMndh86wxcpZs1/4KO+UFLQ+rEigj9BAAAAAASUVORK5CYII=); +} + +/* General panels */ + +div[id^=GPmousePositionPanel-] { + position: relative; + left: 0px; + top: 0px; +} + +div[id^=GPmousePositionPanelClose] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAaCAYAAAD43n+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD2SURBVFiF7ZbRDoIwDEUZ36oPRP9GMVF+k1c5vpQ4l24CFkfITsIDY2l70+6yqirsDITcdcSocxdQKHxhjTMEHIE7ED0CgAMuwNkyt7kgEfOUsJ0mSsRcZc9gLsoSoOWTG+C8707WfNqcNSfxRsmnA+qgMyOP1GjOSaxioCklKuyejRhJOtLLYyZI4muilosJC4y89957P2H/LMEJUapZaGzxpuAmrv3Gn0YuNIBFXZqaUMUodszNwjVbUWuQEDPatmrpueuOQu4fq+WoSbwD76uPas1BpwbgZJV/rctpI52KupmIaoHGMndh86wxcpZs1/4KO+UFLQ+rEigj9BAAAAAASUVORK5CYII=); +} + +/* Map center localisation */ + +#GPmapCenter { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAc0SURBVGiB1ZptTBzHGcefmdnz+e72bvcAO8UYUCtTKgMGmsSpGhtcJSTCRTXIaoJUjNUm5kCkFv7SSLaVqpUdKeqHIDcIDqdSgnFLXUXGqmUrNVV9pI0UavsM2FYoqKl5MQ0Gbve4F69vZ6YfeCkQXm7JwSU/6T7cvD3//+3u7MzNgzjnEAumGhyJgFkJRyQXESEVOKRwzpKBs62IM8Sx8DlCeBQQjHCqDyFOu4Hhy/Za/0Qs4qMvY0RpsKRjREpBML8ETM8j9u13UULOIBaTfUjcrhL5Oz5hS77CAIA99Mp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JRU5ErkJggg==); +} + +div[id^=GPscaleContainer-] { + border: 2px solid white; + border-top: none; + text-align: center; + display: block; + background-image: linear-gradient(rgba(200, 200, 200, 0.3), rgba(200, 200, 200, 0.3)); + height: 18px; + width: 200px; + color: white; + font-family: 'Open Sans', + sans-serif; + font-size: 16px; + right: 20px; + bottom: 20px; +} + diff --git a/itowns-2.5.0-beta/dist/GpPluginItowns-map.js b/itowns-2.5.0-beta/dist/GpPluginItowns-map.js new file mode 100644 index 000000000..ecfbdceaf --- /dev/null +++ b/itowns-2.5.0-beta/dist/GpPluginItowns-map.js @@ -0,0 +1,1636 @@ +/*! + * @brief French Geoportal Extension for Itowns + * + * This software is released under the licence CeCILL-B (Free BSD compatible) + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * @see http://www.cecill.info/ + * + * @copyright copyright (c) IGN + * @license CeCILL-B + * @author IGN + * @version 2.5.0-beta + * @date 21/09/2023 + * + */ + +/*! + * Sortable -- JavaScript library for reorderable drag-and-drop lists on modern + * browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, + * React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap. + * + * Released under MIT LICENSE + * + * Copyright Lebedev Konstantin + * https://github.com/SortableJS/Sortable + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @version 1.14.0 + */ + +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.4 + */ + +/*! + * @overview Proj4js - Javascript reprojection library. + * + * @authors + * - Mike Adair madairATdmsolutions.ca + * - Richard Greenwood richATgreenwoodmap.com + * - Didier Richard didier.richardATign.fr + * - Stephen Irons stephen.ironsATclear.net.nz + * - Olivier Terral oterralATgmail.com + * - Calvin Metcalf cmetcalfATappgeo.com + * + * @copyright Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/proj4js/proj4js/master/LICENSE.md + * @version 2.7.5 + */ + +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("itowns"), require("node-fetch"), require("xmldom")); + else if(typeof define === 'function' && define.amd) + define("Gp", ["itowns", "require", "require"], factory); + else if(typeof exports === 'object') + exports["Gp"] = factory(require("itowns"), require("node-fetch"), require("xmldom")); + else + root["Gp"] = factory(root["itowns"], root[undefined], root[undefined]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_itowns__, __WEBPACK_EXTERNAL_MODULE_node_fetch__, __WEBPACK_EXTERNAL_MODULE_xmldom__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./src/Itowns/index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/es6-promise/dist/es6-promise.js": +/*!******************************************************!*\ + !*** ./node_modules/es6-promise/dist/es6-promise.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process, global) {/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */\n\n(function (global, factory) {\n\t true ? module.exports = factory() :\n\tundefined;\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\n\n\nvar _isArray = void 0;\nif (Array.isArray) {\n _isArray = Array.isArray;\n} else {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && \"function\" === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve$1(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n try {\n then$$1.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then$$1) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then$$1, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$1) {\n if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$1 === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$1)) {\n handleForeignThenable(promise, maybeThenable, then$$1);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n var then$$1 = void 0;\n try {\n then$$1 = value.then;\n } catch (error) {\n reject(promise, error);\n return;\n }\n handleMaybeThenable(promise, value, then$$1);\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = true;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n } catch (e) {\n succeeded = false;\n error = e;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (succeeded === false) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n}\n\nvar Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve$$1 = c.resolve;\n\n\n if (resolve$$1 === resolve$1) {\n var _then = void 0;\n var error = void 0;\n var didError = false;\n try {\n _then = entry.then;\n } catch (e) {\n didError = true;\n error = e;\n }\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise$1) {\n var promise = new c(noop);\n if (didError) {\n reject(promise, error);\n } else {\n handleMaybeThenable(promise, entry, _then);\n }\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$1) {\n return resolve$$1(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$1(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n}();\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject$1(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise$1 = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n}();\n\nPromise$1.prototype.then = then;\nPromise$1.all = all;\nPromise$1.race = race;\nPromise$1.resolve = resolve$1;\nPromise$1.reject = reject$1;\nPromise$1._setScheduler = setScheduler;\nPromise$1._setAsap = setAsap;\nPromise$1._asap = asap;\n\n/*global self*/\nfunction polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise$1;\n}\n\n// Strange compat..\nPromise$1.polyfill = polyfill;\nPromise$1.Promise = Promise$1;\n\nreturn Promise$1;\n\n})));\n\n\n\n//# sourceMappingURL=es6-promise.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/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uICB9XG5cbiAgdmFyIFAgPSBsb2NhbC5Qcm9taXNlO1xuXG4gIGlmIChQKSB7XG4gICAgdmFyIHByb21pc2VUb1N0cmluZyA9IG51bGw7XG4gICAgdHJ5IHtcbiAgICAgIHByb21pc2VUb1N0cmluZyA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChQLnJlc29sdmUoKSk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgLy8gc2lsZW50bHkgaWdub3JlZFxuICAgIH1cblxuICAgIGlmIChwcm9taXNlVG9TdHJpbmcgPT09ICdbb2JqZWN0IFByb21pc2VdJyAmJiAhUC5jYXN0KSB7XG4gICAgICByZXR1cm47XG4gICAgfVxuICB9XG5cbiAgbG9jYWwuUHJvbWlzZSA9IFByb21pc2UkMTtcbn1cblxuLy8gU3RyYW5nZSBjb21wYXQuLlxuUHJvbWlzZSQxLnBvbHlmaWxsID0gcG9seWZpbGw7XG5Qcm9taXNlJDEuUHJvbWlzZSA9IFByb21pc2UkMTtcblxucmV0dXJuIFByb21pc2UkMTtcblxufSkpKTtcblxuXG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWVzNi1wcm9taXNlLm1hcFxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/es6-promise/dist/es6-promise.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/package.json": +/*!********************************************************!*\ + !*** ./node_modules/geoportal-access-lib/package.json ***! + \********************************************************/ +/*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, date, dependencies, deprecated, description, devDependencies, homepage, keywords, license, main, module, name, nyc, optionalDependencies, peerDependencies, repository, scripts, version, default */ +/***/ (function(module) { + +eval("module.exports = JSON.parse(\"{\\\"_from\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"_id\\\":\\\"geoportal-access-lib@3.4.0-beta\\\",\\\"_inBundle\\\":false,\\\"_integrity\\\":\\\"sha512-gphFcmz76I5nDU8c5HS1X/afidc1hZMNKVESfzr212WyMpVCNbQhImVlLJakAlffXMCkNb40bVZnehKlKvD+9w==\\\",\\\"_location\\\":\\\"/geoportal-access-lib\\\",\\\"_phantomChildren\\\":{},\\\"_requested\\\":{\\\"type\\\":\\\"remote\\\",\\\"raw\\\":\\\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"name\\\":\\\"geoportal-access-lib\\\",\\\"escapedName\\\":\\\"geoportal-access-lib\\\",\\\"rawSpec\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"saveSpec\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"fetchSpec\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\"},\\\"_requiredBy\\\":[\\\"/\\\"],\\\"_resolved\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"_shasum\\\":\\\"4972f1314445354d85baad4d3b0e59f0be27ab82\\\",\\\"_spec\\\":\\\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"_where\\\":\\\"/home/runner/work/geoportal-extensions/geoportal-extensions\\\",\\\"author\\\":{\\\"name\\\":\\\"IGNF\\\"},\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/IGNF/geoportal-access-lib/issues\\\"},\\\"bundleDependencies\\\":[],\\\"date\\\":\\\"21/09/2023\\\",\\\"dependencies\\\":{\\\"es6-promise\\\":\\\"^4.2.4\\\",\\\"node-fetch\\\":\\\"^2.6.1\\\",\\\"xmldom\\\":\\\"^0.1.27\\\"},\\\"deprecated\\\":false,\\\"description\\\":\\\"French Geoportal resources access library\\\",\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"^7.12.10\\\",\\\"@babel/plugin-transform-template-literals\\\":\\\"^7.12.1\\\",\\\"@babel/preset-env\\\":\\\"^7.12.11\\\",\\\"babel-loader\\\":\\\"^8.2.2\\\",\\\"chai\\\":\\\"^4.1.2\\\",\\\"clean-webpack-plugin\\\":\\\"^3.0.0\\\",\\\"copy-webpack-plugin\\\":\\\"^5.1.2\\\",\\\"eslint\\\":\\\"^7.18.0\\\",\\\"eslint-config-standard\\\":\\\"^16.0.2\\\",\\\"eslint-loader\\\":\\\"^4.0.2\\\",\\\"eslint-plugin-import\\\":\\\"^2.22.1\\\",\\\"eslint-plugin-node\\\":\\\"^11.1.0\\\",\\\"eslint-plugin-promise\\\":\\\"^4.2.1\\\",\\\"eslint-plugin-standard\\\":\\\"^5.0.0\\\",\\\"glob\\\":\\\"^7.1.2\\\",\\\"handlebars-layouts\\\":\\\"^3.1.4\\\",\\\"handlebars-webpack-plugin\\\":\\\"^1.4.1\\\",\\\"html-webpack-plugin\\\":\\\"^4.5.1\\\",\\\"istanbul-instrumenter-loader\\\":\\\"^3.0.1\\\",\\\"jsdoc-webpack-plugin\\\":\\\"^0.3.0\\\",\\\"loglevel\\\":\\\"^1.6.1\\\",\\\"mocha\\\":\\\"^7.2.0\\\",\\\"mocha-loader\\\":\\\"^5.1.5\\\",\\\"mocha-webpack\\\":\\\"^2.0.0-beta.0\\\",\\\"mochawesome\\\":\\\"^6.2.1\\\",\\\"nyc\\\":\\\"^15.1.0\\\",\\\"path\\\":\\\"^0.12.7\\\",\\\"replace-bundle-webpack-plugin\\\":\\\"^1.0.0\\\",\\\"sinon\\\":\\\"^9.2.4\\\",\\\"sinon-es6\\\":\\\"0.0.3\\\",\\\"speed-measure-webpack-plugin\\\":\\\"^1.4.2\\\",\\\"string-template\\\":\\\"^1.0.0\\\",\\\"terser-webpack-plugin\\\":\\\"^2.3.8\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^3.3.12\\\",\\\"webpack-dev-server\\\":\\\"^3.11.2\\\",\\\"webpack-node-externals\\\":\\\"^2.5.2\\\",\\\"webpack-shell-plugin\\\":\\\"^0.5.0\\\"},\\\"homepage\\\":\\\"https://github.com/IGNF/geoportal-access-lib#readme\\\",\\\"keywords\\\":[\\\"geoportail\\\",\\\"webservice\\\",\\\"javascript\\\",\\\"es6\\\"],\\\"license\\\":\\\"CECILL-B\\\",\\\"main\\\":\\\"dist/GpServices-src.js\\\",\\\"module\\\":\\\"src/Gp.js\\\",\\\"name\\\":\\\"geoportal-access-lib\\\",\\\"nyc\\\":{\\\"include\\\":[\\\"src/**/*.js\\\"],\\\"instrument\\\":false,\\\"sourceMap\\\":false},\\\"optionalDependencies\\\":{},\\\"peerDependencies\\\":{},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"git+https://github.com/IGNF/geoportal-access-lib.git\\\"},\\\"scripts\\\":{\\\"build\\\":\\\"webpack --mode=none\\\",\\\"build:dev\\\":\\\"webpack --mode=development\\\",\\\"build:prod\\\":\\\"webpack --mode=production\\\",\\\"clean\\\":\\\"echo \\\\\\\"Warning: no yet implemented!\\\\\\\" && exit 0\\\",\\\"cover\\\":\\\"nyc --reporter=lcov --reporter=text npm run test\\\",\\\"doc\\\":\\\"npm run doc:serve\\\",\\\"doc:serve\\\":\\\"webpack-dev-server --content-base jsdoc --port 9001 --open\\\",\\\"eslint\\\":\\\"eslint src/\\\",\\\"sample\\\":\\\"npm run sample:serve\\\",\\\"sample:serve\\\":\\\"webpack-dev-server --mode=none --open-page samples/index-src.html --https --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"sample:serve:dev\\\":\\\"webpack-dev-server --mode=development --open-page samples/index-map.html --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"sample:serve:prod\\\":\\\"webpack-dev-server --mode=production --open-page samples/index-prod.html --content-base . --output-public-path '/dist/' --port 9001 --open\\\",\\\"setup\\\":\\\"npm install\\\",\\\"test\\\":\\\"mocha-webpack --reporter mochawesome --reporter-options reportDir=test-report,reportFilename=index --webpack-config ./test/webpack/webpack.test.js --glob \\\\\\\"test_*.js\\\\\\\" test/spec/\\\",\\\"test:end-to-end:serve\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.js\\\",\\\"test:end-to-end:serve:docker\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.docker.js\\\",\\\"test:serve\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.js\\\",\\\"test:serve:docker\\\":\\\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.docker.js\\\"},\\\"version\\\":\\\"3.4.0-beta\\\"}\");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9wYWNrYWdlLmpzb24uanMiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/package.json\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js": +/*!**************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Errors raised by API for one among three reasons : wrong API usage, underlying service error or unknown reason.\n *\n * @property {String} message - Error message\n * @property {Number} status - Error status : when {@link Gp.Error.TYPE_SRVERR}, gives the [HTTP status of the underlying web service response]{@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes} ; -1 otherwise.\n * @property {String} type - Error type ({@link Gp.Error.TYPE_SRVERR}, {@link Gp.Error.TYPE_USEERR} or {@link Gp.Error.TYPE_UNKERR}).\n *\n * @namespace\n * @alias Gp.Error\n * @param {Object|String} error - Options for creating error object. Can be a String (message) or an Object.\n * @param {String} error.message - Error message to return to user.\n * @param {enum} [error.type=TYPE_UNKERR] - Error type\n * @param {status} [error.status=-1] - Error status : when {@link Gp.Error.TYPE_SRVERR}, gives the [HTTP status of the underlying web service response]{@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}.\n *\n */\nfunction ErrorService (error) {\n if (!(this instanceof ErrorService)) {\n throw new TypeError(\"ErrorService constructor cannot be called as a function.\");\n }\n\n var e = error;\n if (typeof error === \"string\" || error instanceof String) {\n this.message = error;\n this.status = -1;\n this.type = ErrorService.TYPE_UNKERR;\n } else {\n this.message = e.message || \"undefined!?\";\n this.type = e.type;\n this.status = e.status || -1;\n }\n\n this.name = \"ErrorService\";\n this.stack = (new Error()).stack;\n}\n\n/**\n * Error raised when underlying geoportal service answers on error.\n *\n * @type {String}\n * @constant\n * @static\n */\nErrorService.TYPE_SRVERR = \"SERVICE_ERROR\";\n/**\n * Error raised when funcion use is inappropriate\n *\n * @type {String}\n * @constant\n * @static\n */\nErrorService.TYPE_USEERR = \"USAGE_ERROR\";\n/**\n * Error raised when API can't perform the job for a reason other than the two other ones.\n *\n * @type {String}\n * @constant\n * @static\n */\nErrorService.TYPE_UNKERR = \"UNKNOWN_ERROR\";\n\n/**\n * @lends module:ErrorService\n */\nErrorService.prototype = Object.create(Error.prototype, {\n constructor : {\n value : ErrorService,\n writable : true,\n configurable : true\n }\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ErrorService);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9u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n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Formats/WPS.js": +/*!**************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Formats/WPS.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n\n\n/**\n * @classdesc\n * Standard WPS\n *\n * @constructor\n * @alias Gp.Formats.WPS\n * @param {Object} options - options\n * @param {Object} options.data - objet\n * @param {String} options.method - POST|GET\n * @param {String} options.param.service - \"WPS\"\n * @param {String} options.param.version - \"1.0.0\"\n * @param {String} options.param.identifier - \"gs:WPSElevation|gs:WPSLineElevation\"\n * @param {String} options.param.rawdataoutput - \"result\"\n * @param {String} options.param.request - \"Execute\"\n * @param {Function} options.onsuccess - function callback success (TODO)\n * @param {Function} options.onerror - function callback error (TODO)\n * @private\n */\nfunction WPS (options) {\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur WPS()]\");\n\n if (!(this instanceof WPS)) {\n throw new TypeError(\"WPS constructor cannot be called as a function.\");\n }\n\n this.options = options || {};\n\n /**\n * Objet DATA\n */\n this.DataObject = this.options.data;\n\n if (!this.DataObject) {\n throw new TypeError(\"This data object is not defined !\");\n }\n\n /**\n * param service.\n * Par defaut, \"WPS\".\n */\n this.paramservice = this.options.param.service || \"WPS\";\n\n /**\n * param version.\n * Par defaut, \"1.0.0\".\n */\n this.paramversion = this.options.param.version || \"1.0.0\";\n\n /**\n * param identifier\n * Par defaut, \"gs:WPS\"\n */\n this.paramidentifier = this.options.param.identifier || \"gs:WPS\";\n\n /**\n * param rawdataoutput\n * Par defaut, \"result\".\n */\n this.paramrawdataoutput = this.options.param.rawdataoutput || \"result\";\n\n /**\n * param request\n * Par defaut, \"Execute\".\n */\n this.paramrequest = this.options.param.request || \"Execute\";\n\n /**\n * methode.\n * Par defaut, \"GET\".\n */\n this.method = this.options.method || \"GET\";\n}\n\nWPS.prototype = {\n\n /**\n * @lends module:WPS#\n */\n\n /**\n * request\n * @type {String}\n */\n requestString : null,\n\n /**\n * Constructeur (alias)\n */\n constructor : WPS,\n\n /**\n * Template de la requête.\n */\n template : {\n get : {\n value : \"service=__SERVICE__\" +\n \"&version=__VERSION__\" +\n \"&rawdataoutput=__RAWDATAOUTPUT__\" +\n \"&identifier=__IDENTIFIER__\" +\n \"&request=__REQUEST__\" +\n \"&datainputs=\",\n\n input : \"__KEY__=__DATA__\"\n\n },\n post : {\n\n value : \"\" +\n \"\" +\n \"__IDENTIFIER__\" +\n \"\" +\n \"\" +\n \"\" +\n \"\" +\n \"\" +\n \"__RAWDATAOUTPUT__\" +\n \"\" +\n \"\" +\n \"\",\n\n input : \"\" +\n \"__KEY__\" +\n \"\" +\n \"__DATA__\" +\n \"\" +\n \"\"\n }\n },\n\n /**\n * Namespace par defaut de la requete POST.\n *\n * @returns {String} namespace\n */\n namespaceByDefault : function () {\n var ns = [\n \"xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\"\",\n \"xmlns=\\\"http://www.opengis.net/wps/1.0.0\\\"\",\n \"xmlns:wfs=\\\"http://www.opengis.net/wfs\\\"\",\n \"xmlns:wps=\\\"http://www.opengis.net/wps/1.0.0\\\"\",\n \"xmlns:ows=\\\"http://www.opengis.net/ows/1.1\\\"\",\n \"xmlns:gml=\\\"http://www.opengis.net/gml\\\"\",\n \"xmlns:ogc=\\\"http://www.opengis.net/ogc\\\"\",\n \"xmlns:wcs=\\\"http://www.opengis.net/wcs/1.1.1\\\"\",\n \"xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\"\"\n ];\n\n return ns.join(\" \");\n },\n\n /**\n * Schemalocation par defaut.\n *\n * @returns {String} schemaLocation\n */\n schemaLocationByDefault : function () {\n return \"xsi:schemaLocation=\\\"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd\\\"\";\n },\n\n /**\n * Construction de la requête.\n *\n * @example\n * // GET out :\n * // service=__SERVICE__\n * // &version=__VERSION__\n * // &rawdataoutput=__RAWDATAOUTPUT__\n * // &identifier=__IDENTIFIER__\n * // &request=__REQUEST__\n * // &datainputs=\"__DATAINPUTS__\"\n * // avec __DATAINPUTS__ = __KEY__=__DATA__;...\n *\n * // POST out :\n * // \n * // \n * // __IDENTIFIER__\n * // \n * // \n * // \n * // \n * // \n * // __RAWDATAOUTPUT__\n * // \n * // \n * // \",\n * // avec __DATAINPUTS__\n * // \n * // __KEY__\n * // \n * // __DATA__\n * // \n * // \n *\n * @returns {Boolean} validation de la construction de la requete\n */\n processRequestString : function () {\n this.logger.trace(\"WPS::processRequestString ()\");\n\n var template = \"\";\n if (this.method === \"POST\") {\n template = this.template.post.value;\n } else if (this.method === \"GET\") {\n template = this.template.get.value;\n } else {\n this.logger.error(\"No other method supported by the service !\");\n return false;\n }\n\n template = template.replace(/__SERVICE__/g, this.paramservice);\n template = template.replace(/__VERSION__/g, this.paramversion);\n template = template.replace(/__RAWDATAOUTPUT__/g, this.paramrawdataoutput);\n template = template.replace(/__IDENTIFIER__/g, this.paramidentifier);\n template = template.replace(/__REQUEST__/g, this.paramrequest);\n\n // ajout +\n if (this.method === \"POST\") {\n template = template.replace(/__NAMESPACE__/g, this.namespaceByDefault);\n template = template.replace(/__SCHEMALOCATION__/g, this.schemaLocationByDefault);\n }\n\n // ajout des datainputs\n template = template.replace(//g, this.__addDataInputs());\n\n if (!template) {\n this.logger.warn(\"traduction tmpl : empty request !?\");\n return false;\n }\n\n this.requestString = template;\n this.logger.trace(\"traduction tmpl\", template);\n\n return true;\n },\n\n /**\n * Ajout des données\n *\n * @returns {String} Données concaténées dans une chaine\n */\n __addDataInputs : function () {\n this.logger.trace(\"WPS::__addDataInputs ()\");\n\n // c'est un peu grossier...\n var tmpl = this.method === \"GET\" ? this.template.get.input : this.template.post.input;\n var sep = this.method === \"GET\" ? \";\" : \"\";\n\n var result = \"\";\n var that = this;\n var map = this.DataObject.getData();\n for (var i = 0; i < map.length; i++) {\n // FIXME closure ?\n (function (j) {\n if (sep) {\n sep = (j === map.length - 1) ? \"\" : \";\";\n }\n result = result.concat(that.__addDataInput(tmpl, map[j].k, map[j].v), sep);\n })(i);\n }\n\n return result;\n },\n\n /**\n * Ajout d'une donnée.\n *\n * @param {String} tmpl - template\n * @param {String} key - clef\n * @param {String} data - valeur\n * @returns {String} chaine avec les substitutions clef/valeur\n */\n __addDataInput : function (tmpl, key, data) {\n var tmp = tmpl;\n tmp = tmp.replace(/__KEY__/g, key);\n tmp = tmp.replace(/__DATA__/g, data);\n return tmp;\n },\n\n /**\n * Definir le mode de requête\n *\n * @param {String} method - GET|POST\n */\n setMethod : function (method) {\n if (method === \"GET\" || method === \"POST\") {\n this.method = method;\n } else {\n this.logger.warn(\"support only GET and POST method !\");\n }\n },\n\n /**\n * Retourne le mode de requete (GET|POST).\n *\n * @returns {AltiRequest.options.mode|String} methode (GET|POST)\n */\n getMethod : function () {\n return this.method;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (WPS);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvRm9ybWF0cy9XUFMuanM/MjIzNSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQThDOztBQUU5QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0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AgICogQHR5cGUge1N0cmluZ31cbiAgICAgKi9cbiAgICByZXF1ZXN0U3RyaW5nIDogbnVsbCxcblxuICAgIC8qKlxuICAgICAqIENvbnN0cnVjdGV1ciAoYWxpYXMpXG4gICAgICovXG4gICAgY29uc3RydWN0b3IgOiBXUFMsXG5cbiAgICAvKipcbiAgICAgKiBUZW1wbGF0ZSBkZSBsYSByZXF1w6p0ZS5cbiAgICAgKi9cbiAgICB0ZW1wbGF0ZSA6IHtcbiAgICAgICAgZ2V0IDoge1xuICAgICAgICAgICAgdmFsdWUgOiBcInNlcnZpY2U9X19TRVJWSUNFX19cIiArXG4gICAgICAgICAgICAgICAgXCImdmVyc2lvbj1fX1ZFUlNJT05fX1wiICtcbiAgICAgICAgICAgICAgICBcIiZyYXdkYXRhb3V0cHV0PV9fUkFXREFUQU9VVFBVVF9fXCIgK1xuICAgICAgICAgICAgICAgIFwiJmlkZW50aWZpZXI9X19JREVOVElGSUVSX19cIiArXG4gICAgICAgICAgICAgICAgXCImcmVxdWVzdD1fX1JFUVVFU1RfX1wiICtcbiAgICAgICAgICAgICAgICBcIiZkYXRhaW5wdXRzPTwhLS0gX19EQVRBSU5QVVRTX18gLS0+XCIsXG5cbiAgICAgICAgICAgIGlucHV0IDogXCJfX0tFWV9fPV9fREFUQV9fXCJcblxuICAgICAgICB9LFxuICAgICAgICBwb3N0IDoge1xuXG4gICAgICAgICAgICB2YWx1ZSA6IFwiPD94bWwgdmVyc2lvbj1cXFwiMS4wXFxcIiBlbmNvZGluZz1cXFwiVVRGLThcXFwiPz5cIiArXG4gICAgICAgICAgICAgICAgXCI8d3BzOl9fUkVRVUVTVF9fIHZlcnNpb249XFxcIl9fVkVSU0lPTl9fXFxcIiBzZXJ2aWNlPVxcXCJfX1NFUlZJQ0VfX1xcXCIgXCIgK1xuICAgICAgICAgICAgICAgIFwiX19OQU1FU1BBQ0VfXyBfX1NDSEVNQUxPQ0FUSU9OX18+XCIgK1xuICAgICAgICAgICAgICAgIFwiPG93czpJZGVudGlmaWVyPl9fSURFTlRJRklFUl9fPC9vd3M6SWRlbnRpZmllcj5cIiArXG4gICAgICAgICAgICAgICAgXCI8d3BzOkRhdGFJbnB1dHM+XCIgK1xuICAgICAgICAgICAgICAgIFwiPCEtLSBfX0RBVEFJTlBVVFNfXyAtLT5cIiArXG4gICAgICAgICAgICAgICAgXCI8L3dwczpEYXRhSW5wdXRzPlwiICtcbiAgICAgICAgICAgICAgICBcIjx3cHM6UmVzcG9uc2VGb3JtPlwiICtcbiAgICAgICAgICAgICAgICBcIjx3cHM6UmF3RGF0YU91dHB1dD5cIiArXG4gICAgICAgICAgICAgICAgXCI8b3dzOklkZW50aWZpZXI+X19SQVdEQVRBT1VUUFVUX188L293czpJZGVudGlmaWVyPlwiICtcbiAgICAgICAgICAgICAgICBcIjwvd3BzOlJhd0RhdGFPdXRwdXQ+XCIgK1xuICAgICAgICAgICAgICAgIFwiPC93cHM6UmVzcG9uc2VGb3JtPlwiICtcbiAgICAgICAgICAgICAgICBcIjwvd3BzOl9fUkVRVUVTVF9fPlwiLFxuXG4gICAgICAgICAgICBpbnB1dCA6IFwiPHdwczpJbnB1dD5cIiArXG4gICAgICAgICAgICAgICAgXCI8b3dzOklkZW50aWZpZXI+X19LRVlfXzwvb3dzOklkZW50aWZpZXI+XCIgK1xuICAgICAgICAgICAgICAgIFwiPHdwczpEYXRhPlwiICtcbiAgICAgICAgICAgICAgICBcIjx3cHM6TGl0ZXJhbERhdGE+X19EQVRBX188L3dwczpMaXRlcmFsRGF0YT5cIiArXG4gICAgICAgICAgICAgICAgXCI8L3dwczpEYXRhPlwiICtcbiAgICAgICAgICAgICAgICBcIjwvd3BzOklucHV0PlwiXG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogTmFtZXNwYWNlIHBhciBkZWZhdXQgZGUgbGEgcmVxdWV0ZSBQT1NULlxuICAgICAqXG4gICAgICogQHJldHVybnMge1N0cmluZ30gbmFtZXNwYWNlXG4gICAg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URFTlRJRklFUl9fPC9vd3M6SWRlbnRpZmllcj5cbiAgICAgKiAvLyAgICAgICAgICA8d3BzOkRhdGFJbnB1dHM+XG4gICAgICogLy8gICAgICAgICAgICAgIDwhLS0gX19EQVRBSU5QVVRTX18gLS0+XG4gICAgICogLy8gICAgICAgICAgPC93cHM6RGF0YUlucHV0cz5cbiAgICAgKiAvLyAgICAgICAgICA8d3BzOlJlc3BvbnNlRm9ybT5cbiAgICAgKiAvLyAgICAgICAgICAgICAgPHdwczpSYXdEYXRhT3V0cHV0PlxuICAgICAqIC8vICAgICAgICAgICAgICA8b3dzOklkZW50aWZpZXI+X19SQVdEQVRBT1VUUFVUX188L293czpJZGVudGlmaWVyPlxuICAgICAqIC8vICAgICAgICAgICAgICA8L3dwczpSYXdEYXRhT3V0cHV0PlxuICAgICAqIC8vICAgICAgICAgIDwvd3BzOlJlc3BvbnNlRm9ybT5cbiAgICAgKiAvLyAgICAgIDwvd3BzOl9fUkVRVUVTVF9fPlwiLFxuICAgICAqIC8vICAgICAgYXZlYyBfX0RBVEFJTlBVVFNfX1xuICAgICAqIC8vICAgICAgICAgICAgIDx3cHM6SW5wdXQ+XG4gICAgICogLy8gICAgICAgICAgICAgICAgICA8b3dzOklkZW50aWZpZXI+X19LRVlfXzwvb3dzOklkZW50aWZpZXI+XG4gICAgICogLy8gICAgICAgICAgICAgICAgICA8d3BzOkRhdGE+XG4gICAgICogLy8gICAgICAgICAgICAgICAgICAgIDx3cHM6TGl0ZXJhbERhdGE+X19EQVRBX188L3dwczpMaXRlcmFsRGF0YT5cbiAgICAgKiAvLyAgICAgICAgICAgICAgICAgIDwvd3BzOkRhdGE+XG4gICAgICogLy8gICAgICAgICAgICAgIDwvd3BzOklucHV0PlxuICAgICAqXG4gICAgICogQHJldHVybnMge0Jvb2xlYW59IHZhbGlkYXRpb24gZGUgbGEgY29uc3RydWN0aW9uIGRlIGxhIHJlcXVldGVcbiAgICAgKi9cbiAgICBwcm9jZXNzUmVxdWVzdFN0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Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5tZXRob2Q7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgV1BTO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Formats/WPS.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Formats/XML.js": +/*!**************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Formats/XML.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* global require */\n\n\n// import __xmldom from \"xmldom\";\n\n/**\n * @classdesc\n *\n * Classe permettant d'écrire ou de lire du XML, sous forme de document DOM,\n * éventuellement selon des clés de lecture (readers) ou d'écriture (writers) spécifiques.\n *\n * @constructor\n * @alias Gp.Formats.XML\n *\n * @param {Object} [options] - options du format XML\n *\n * @param {Object} [options.reader] - Instance d'un Reader de service (AltiResponseReader, GeocodeRequestReader, etc.)\n * utile pour interpréter le XML lorsque sa structure est connue.\n * Ce reader doit comporter au moins une fonction statique read (root) permettant d'initialiser la lecture.\n *\n * @param {Object} [options.writers] - writers\n *\n * @param {String} [options.xmlString] - chaîne de caractère contenant du XML à interpréter.\n *\n * @private\n */\nfunction XML (options) {\n if (!(this instanceof XML)) {\n throw new TypeError(\"XML constructor cannot be called as a function.\");\n }\n\n // FIXME : notion de singleton\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur XML ()]\");\n\n /**\n * Chaîne de caractères contenant le texte XML\n * @type {String}\n */\n this.xmlString = null;\n\n /**\n * DOM Element correspondant à la structure du XML.\n * @type {DOMElement}\n */\n this.xmlDoc = null;\n\n /**\n * Objet contenant des fonctions de lecture des différentes balises XML.\n * @type {Object}\n */\n this.reader = null;\n\n // traitement des paramètres d'options s'il y en a\n if (options) {\n if (options.xmlString && typeof options.xmlString === \"string\") {\n this.xmlString = options.xmlString;\n // Si une chaine de caractère a été passée en entrée : on la transforme aussi en XML document\n this.xmlDoc = __getXMLDOC(options.xmlString);\n }\n if (options.reader) {\n this.setReader(options.reader);\n }\n }\n}\n\nXML.prototype = {\n\n /**\n * @lends module:XML\n */\n\n /*\n * Constructeur (alias)\n */\n constructor : XML,\n\n /**\n * Méthode permettant de récupérer la chaîne de caractères associée au format XML\n *\n * @returns {String} xmlString - la chaîne de caractères correspondant au format XML\n */\n getXMLString : function () {\n return this.xmlString;\n },\n\n /**\n * Méthode permettant d'attribuer une chaîne de caractères au format XML (attribut xmlString).\n * La méthode va aussi transformer cette chaîne de caractères en document XML,\n * afin de remplir l'attribut xmlDoc.\n *\n * @param {String} xmlString - la chaîne de caractères correspondant au format XML\n */\n setXMLString : function (xmlString) {\n if (xmlString && typeof xmlString === \"string\") {\n this.xmlString = xmlString;\n this.xmlDoc = __getXMLDOC(xmlString);\n }\n },\n\n /**\n * Méthode permettant de récupérer les readers associés au format XML, s'ils ont été définis\n *\n * @return {Object} readers - les readers associés au format XML, s'ils existent,\n * sous forme d'une collection de fonctions\n */\n getReader : function () {\n return this.reader;\n },\n\n /**\n * Méthode permettant d'attribuer des readers, sous la forme d'un objet de fonctions (node, data),\n * lorsqu'ils n'ont pas été définis lors de l'instanciation par exemple (new XML (options)).\n *\n * @param {Object} reader - Instance d'un Reader de service (AltiResponseReader, GeocodeRequestReader, etc.)\n * utile pour interpréter le XML lorsque sa structure est connue.\n * Ce reader doit comporter au moins une fonction statique read (root) permettant d'initialiser la lecture.\n */\n setReader : function (reader) {\n if (reader && reader.read && typeof reader.read === \"function\") {\n this.reader = reader;\n }\n },\n\n /**\n * Méthode permettant de récupérer le document XML associé au format, s'il existe.\n *\n * @return {DOMElement} xmlDoc - le document XML (DOM document node) s'il existe\n */\n getXMLDoc : function () {\n return this.xmlDoc;\n },\n\n /**\n * Setter\n */\n setXMLDoc : function (doc) {\n this.xmlDoc = doc;\n },\n /**\n * Méthode initialisant la lecture du XML, à partir d'un XML Document :\n * création d'un objet JavaScript contenant les informations du XML,\n * sauf dans le cas où il n'existe pas de XML Document à interpréter (retourne un objet vide).\n *\n * @return {Object} [parserOutput] - un objet JavaScript contenant les informations du XML :\n * - soit toutes les informations si aucun reader n'a été spécifié à la création du format\n * - soit les informations spécifiées dans le reader.\n */\n parse : function () {\n // build xml document from xmlString\n if (!this.xmlDoc && this.xmlString) {\n this.xmlDoc = __getXMLDOC(this.xmlString);\n }\n if (this.xmlDoc) {\n var root = __getRootNode(this.xmlDoc);\n if (root) {\n var parserOutput;\n // call reader if exists\n if (this.reader && this.reader.read) {\n parserOutput = this.reader.read(root);\n } else {\n parserOutput = {};\n parserOutput[root.nodeName] = __readDefault(root);\n }\n return parserOutput;\n } else {\n return {};\n }\n }\n }\n\n};\n\n/**\n * Méthode de la classe (privée) permettant de créer un XML Document à partir d'une chaîne de caractères XML,\n * en utilisant DOMParser () lorsque c'est possible.\n * For more information, see: https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#the-domparser-interface\n *\n * @private\n * @memberof XML\n * @method __getXMLDOC\n * @param {String} xmlString - xml string to be converted into DOM element\n * @return {DOMElement} - the corresponding XML Document\n */\nfunction __getXMLDOC (xmlString) {\n if (typeof window === \"undefined\") {\n // env. nodejs\n var DOMParser = __webpack_require__(/*! xmldom */ \"xmldom\").DOMParser; // __xmldom.DOMParser;\n return new DOMParser().parseFromString(xmlString, \"text/xml\");\n } else {\n // env. browser\n\n var parser;\n var xmlDoc;\n var errorMsg = \"Erreur lors du parsing de la réponse du service : XML non conforme\";\n\n if (window.ActiveXObject) {\n // Internet Explorer < 9\n xmlDoc = new window.ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = false;\n xmlDoc.loadXML(xmlString);\n var parseError = xmlDoc.parseError;\n if (parseError.errorCode) {\n if (parseError.line && parseError.linepos) {\n errorMsg += \"( ligne \" + parseError.line + \", colonne \" + parseError.linepos;\n }\n if (parseError.reason) {\n errorMsg += \": \" + parseError.reason + \")\";\n }\n throw new Error(errorMsg);\n }\n return xmlDoc;\n } else if (window.DOMParser) {\n // les autres (Chrome, Mozilla, IE >= 9)\n parser = new window.DOMParser();\n try {\n xmlDoc = parser.parseFromString(xmlString, \"text/xml\");\n } catch (e) {\n // Internet Explorer browser raises exception if xmlString is not valid XML\n if (e.message === \"SyntaxError\") {\n throw new Error(errorMsg);\n } else {\n throw new Error(\"Erreur lors du parsing de la réponse du service : \" + e.message);\n }\n }\n // look for parsing error in case no exception was raised\n if (xmlDoc.getElementsByTagName(\"parsererror\").length > 0) {\n var parsererror = xmlDoc.getElementsByTagName(\"parsererror\");\n for (var i = 0; i < parsererror.length; i++) {\n var content = parsererror[i].innerHTML;\n // except in case parsererror is just because of huge xml, but parsing is done.\n if (content.indexOf(\"Huge input lookup\") === -1) {\n errorMsg += \"(\" + content + \")\";\n throw new Error(errorMsg);\n }\n }\n } else if (!xmlDoc.documentElement) { // may happen in chrome browser\n throw new Error(errorMsg);\n }\n return xmlDoc;\n } else {\n // FIXME\n throw new Error(\"Incompatible DOM Parser pour ce navigateur !\");\n }\n }\n}\n\n/**\n * Méthode de la classe (privée) permettant de récupérer le noeud racine du document,\n * à partir d'un document node (nodeType=9), puis lecture de ce noeud (readNode)\n *\n * @private\n * @memberof XML\n * @method __getRootNode\n * @param {DOMElement} [xmlDoc] - a Document Node\n * @return {DOMElement} root - the document root node\n */\nfunction __getRootNode (xmlDoc) {\n var root;\n if (xmlDoc.nodeType === 9) {\n // INFO : nodeType 9 represents the entire document (the root-node of the DOM tree)\n root = xmlDoc.documentElement;\n } else if (xmlDoc.nodeType === 1) {\n root = xmlDoc;\n }\n return root;\n}\n\n/**\n * Méthode de la classe (privée) permettant de lire automatiquement un noeud XML,\n * lorsqu'aucun reader spécifique n'a été spécifié (parser brut)\n *\n * @private\n * @memberof XML\n * @method readDefault\n * @param {DOMElement} node - a DOM element node\n * @example final data object looks like :\n * data = {\n * attributeName: attributeValue,\n * childName: {\n * attributeName: attributeValue,\n * attributeName: attributeValue,\n * childName: {\n * \"textContent\": textContent\n * },\n * childName: {\n * childName: {\n * attributeName:attributeValue\n * }\n * }\n * }\n * }\n */\nfunction __readDefault (node) {\n var data = {};\n\n // if element node has attributes, set their values to data\n if (node.attributes.length > 0) {\n var dataAttributes = __getAttributes(node);\n data[\"attributes\"] = dataAttributes;\n }\n\n // if element node has childNodes, read them and set them to data\n if (node.hasChildNodes()) {\n var childData = {};\n var child;\n var children = node.childNodes;\n\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n\n if (child.nodeType === 3) { // TEXT_NODE\n data[\"textContent\"] = child.nodeValue;\n } else if (child.nodeType === 1) {\n childData = __readDefault(child);\n\n if (!data[child.nodeName]) {\n // store childData in an object\n data[child.nodeName] = childData;\n } else {\n // in case several childNodes has the same name : store them in an array.\n // if data[nodeName] already exists but is not an array\n if (!Array.isArray(data[child.nodeName])) {\n var old = data[child.nodeName];\n data[child.nodeName] = [];\n data[child.nodeName].push(old);\n }\n data[child.nodeName].push(childData);\n }\n }\n // TODO : manage other node types (4=CDATA, etc)\n }\n }\n\n return data;\n}\n\n/**\n * Méthode de la classe (privée) permettant de récupérer les attributs d'un noeud élément\n *\n * @private\n * @memberof XML\n * @method __getAttributes\n * @param {DOMElement} node - noeud contenant l'attribut recherché\n * @return {Object} nodeAttributes - objet contenant les noms et valeurs des différents attributs\n */\nfunction __getAttributes (node) {\n if (node.attributes.length > 0) {\n var nodeAttributes = {};\n var attributes = node.attributes;\n for (var i = 0; i < attributes.length; i++) {\n var attribute = attributes[i];\n nodeAttributes[attribute.nodeName] = attribute.nodeValue;\n }\n return nodeAttributes;\n }\n}\n\n/* harmony default export */ __webpack_exports__[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mV0dXJuIHtPYmplY3R9IFtwYXJzZXJPdXRwdXRdIC0gdW4gb2JqZXQgSmF2YVNjcmlwdCBjb250ZW5hbnQgbGVzIGluZm9ybWF0aW9ucyBkdSBYTUwgOlxuICAgICAqIC0gc29pdCB0b3V0ZXMgbGVzIGluZm9ybWF0aW9ucyBzaSBhdWN1biByZWFkZXIgbidhIMOpdMOpIHNww6ljaWZpw6kgw6AgbGEgY3LDqWF0aW9uIGR1IGZvcm1hdFxuICAgICAqIC0gc29pdCBsZXMgaW5mb3JtYXRpb25zIHNww6ljaWZpw6llcyBkYW5zIGxlIHJlYWRlci5cbiAgICAgKi9cbiAgICBwYXJzZSA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgLy8gYnVpbGQgeG1sIGRvY3VtZW50IGZyb20geG1sU3RyaW5nXG4gICAgICAgIGlmICghdGhpcy54bWxEb2MgJiYgdGhpcy54bWxTdHJpbmcpIHtcbiAgICAgICAgICAgIHRoaXMueG1sRG9jID0gX19nZXRYTUxET0ModGhpcy54bWxTdHJpbmcpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLnhtbERvYykge1xuICAgICAgICAgICAgdmFyIHJvb3QgPSBfX2dldFJvb3ROb2RlKHRoaXMueG1sRG9jKTtcbiAgICAgICAgICAgIGlmIChyb290KSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhcnNlck91dHB1dDtcbiAgICAgICAgICAgICAgICAvLyBjYWxsIHJlYWRlciBpZiBleGlzdHNcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5yZWFkZXIgJiYgdGhpcy5yZWFkZXIucmVhZCkge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPdXRwdXQgPSB0aGlzLnJlYWRlci5yZWFkKHJvb3QpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcnNlck91dHB1dCA9IHt9O1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPdXRwdXRbcm9vdC5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vLyBfX3htbGRvbS5ET01QYXJzZXI7XG4gICAgICAgIHJldHVybiBuZXcgRE9NUGFyc2VyKCkucGFyc2VGcm9tU3RyaW5nKHhtbFN0cmluZywgXCJ0ZXh0L3htbFwiKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICAvLyBlbnYuIGJyb3dzZXJcblxuICAgICAgICB2YXIgcGFyc2VyO1xuICAgICAgICB2YXIgeG1sRG9jO1xuICAgICAgICB2YXIgZXJyb3JNc2cgPSBcIkVycmV1ciBsb3JzIGR1IHBhcnNpbmcgZGUgbGEgcsOpcG9uc2UgZHUgc2VydmljZSA6IFhNTCBub24gY29uZm9ybWVcIjtcblxuICAgICAgICBpZiAod2luZG93LkFjdGl2ZVhPYmplY3QpIHtcbiAgICAgICAgICAgIC8vIEludGVybmV0IEV4cGxvcmVyIDwgOVxuICAgICAgICAgICAgeG1sRG9jID0gbmV3IHdpbmRvdy5BY3RpdmVYT2JqZWN0KFwiTWljcm9zb2Z0LlhNTERPTVwiKTtcbiAgICAgICAgICAgIHhtbERvYy5hc3luYyA9IGZhbHNlO1xuICAgICAgICAgICAgeG1sRG9jLmxvYWRYTUwoeG1sU3RyaW5nKTtcbiAgICAgICAgICAgIHZhciBwYXJzZUVycm9yID0geG1sRG9jLnBhcnNlRXJyb3I7XG4gICAgICAgICAgICBpZiAocGFyc2VFcnJvci5lcnJvckNvZGUpIHtcbiAgICAgICAgICAgICAgICBpZiAocGFyc2VFcnJvci5saW5lICYmIHBhcnNlRXJyb3IubGluZXBvcykge1xuICAgICAgICAgICAgICAgICAgICBlcnJvck1zZyArPSBcIiggbGlnbmUgXCIgKyBwYXJzZUVycm9yLmxpbmUgKyBcIiwgY29sb25uZSBcIiArIHBhcnNlRXJyb3IubGluZXBvcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHBhcnNlRXJyb3IucmVhc29uKSB7XG4gICAgICAgICAgICAgICAgICAgIGVycm9yTXNnICs9IFwiOiAgXCIgKyBwYXJzZUVycm9yLnJlYXNvbiArIFwiKVwiO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoZXJyb3JNc2cpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHhtbERvYztcbiAgICAgICAgfSBlbHNlIGlmICh3aW5kb3cuRE9NUGFyc2VyKSB7XG4gICAgICAgICAgICAvLyBsZXMgYXV0cmVzIChDaHJvbWUsIE1vemlsbGEsIElFID49IDkpXG4gICAgICAgICAgICBwYXJzZXIgPSBuZXcgd2luZG93LkRPTVBhcnNlcigpO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB4bWxEb2MgPSBwYXJzZXIucGFyc2VGcm9tU3RyaW5nKHhtbFN0cmluZywgXCJ0ZXh0L3htbFwiKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAvLyBJbnRlcm5ldCBFeHBsb3JlciBicm93c2VyIHJhaXNlcyBleGNlcHRpb24gaWYgeG1sU3RyaW5nIGlzIG5vdCB2YWxpZCBYTUxcbiAgICAgICAgICAgICAgICBpZiAoZS5tZXNzYWdlID09PSBcIlN5bnRheEVycm9yXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGVycm9yTXNnKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFcnJldXIgbG9ycyBkdSBwYXJzaW5nIGRlIGxhIHLDqXBvbnNlIGR1IHNlcnZpY2UgOiBcIiArIGUubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gbG9vayBmb3IgcGFyc2luZyBlcnJvciBpbiBjYXNlIG5vIGV4Y2VwdGlvbiB3YXMgcmFpc2VkXG4gICAgICAgICAgICBpZiAoeG1sRG9jLmdldEVsZW1lbnRzQnlUYWdOYW1lKFwicGFyc2VyZXJyb3JcIikubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXJzZXJlcnJvciA9IHhtbERvYy5nZXRFbGVtZW50c0J5VGFnTmFtZShcInBhcnNlcmVycm9yXCIpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGFyc2VyZXJyb3IubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSBwYXJzZXJlcnJvcltpXS5pbm5lckhUTUw7XG4gICAgICAgICAgICAgICAgICAgIC8vIGV4Y2VwdCBpbiBjYXNlIHBhcnNlcmVycm9yIGlzIGp1c3QgYmVjYXVzZSBvZiBodWdlIHhtbCwgYnV0IHBhcnNpbmcgaXMgZG9uZS5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRlbnQuaW5kZXhPZihcIkh1Z2UgaW5wdXQgbG9va3VwXCIpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JNc2cgKz0gXCIoXCIgKyBjb250ZW50ICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoZXJyb3JNc2cpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICgheG1sRG9jLmRvY3VtZW50RWxlbWVudCkgeyAvLyBtYXkgaGFwcGVuIGluIGNocm9tZSBicm93c2VyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGVycm9yTXNnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB4bWxEb2M7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBGSVhNRVxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiSW5jb21wYXRpYmxlIERPTSBQYXJzZXIgcG91ciBjZS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ww6ljaWZpcXVlIG4nYSDDqXTDqSBzcMOpY2lmacOpIChwYXJzZXIgYnJ1dClcbiAqXG4gKiBAcHJpdmF0ZVxuICogQG1lbWJlcm9mIFhNTFxuICogQG1ldGhvZCByZWFkRGVmYXVsdFxuICogQHBhcmFtIHtET01FbGVtZW50fSBub2RlIC0gYSBET00gZWxlbWVudCBub2RlXG4gKiBAZXhhbXBsZSBmaW5hbCBkYXRhIG9iamVjdCBsb29rcyBsaWtlIDpcbiAqICAgICAgICAgIGRhdGEgPSB7XG4gKiAgICAgICAgICAgICAgYXR0cmlidXRlTmFtZTogYXR0cmlidXRlVmFsdWUsXG4gKiAgICAgICAgICAgICAgY2hpbGROYW1lOiB7XG4gKiAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU6IGF0dHJpYnV0ZVZhbHVlLFxuICogICAgICAgICAgICAgICAgICBhdHRyaWJ1dGVOYW1lOiBhdHRyaWJ1dGVWYWx1ZSxcbiAqICAgICAgICAgICAgICAgICAgY2hpbGROYW1lOiB7XG4gKiAgICAgICAgICAgICAgICAgICAgICBcInRleHRDb250ZW50XCI6IHRleHRDb250ZW50XG4gKiAgICAgICAgICAgICAgICAgIH0sXG4gKiAgICAgICAgICAgICAgICAgIGNoaWxkTmFtZToge1xuICogICAgICAgICAgICAgICAgICAgICAgY2hpbGROYW1lOiB7XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRlTmFtZTphdHRyaWJ1dGVWYWx1ZVxuICogICAgICAgICAgICAgICAgICAgICAgfVxuICogICAgICAgICAgICAgICAgICB9XG4gKiAgICAgICAgICAgICAgfVxuICogICAgICAgICAgfVxuICovXG5mdW5jdGlvbiBfX3JlYWREZWZhdWx0IChub2RlKSB7XG4gICAgdmFyIGRhdGEgPSB7fTtcblxuICAgIC8vIGlmIGVsZW1lbnQgbm9kZSBoYXMgYXR0cmlidXRlcywgc2V0IHRoZWlyIHZhbHVlcyB0byBkYXRhXG4gICAgaWYgKG5vZGUuYXR0cmlidXRlcy5sZW5ndGggPiAwKSB7XG4gICAgICAgIHZhciBkYXRhQXR0cmlidXRlcyA9IF9fZ2V0QXR0cmlidXRlcyhub2RlKTtcbiAgICAgICAgZGF0YVtcImF0dHJpYnV0ZXNcIl0gPSBkYXRhQXR0cmlidXRlcztcbiAgICB9XG5cbiAgICAvLyBpZiBlbGVtZW50IG5vZGUgaGFzIGNoaWxkTm9kZXMsIHJlYWQgdGhlbSBhbmQgc2V0IHRoZW0gdG8gZGF0YVxuICAgIGlmIChub2RlLmhhc0NoaWxkTm9kZXMoKSkge1xuICAgICAgICB2YXIgY2hpbGREYXRhID0ge307XG4gICAgICAgIHZhciBjaGlsZDtcbiAgICAgICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZE5vZGVzO1xuXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGNoaWxkID0gY2hpbGRyZW5baV07XG5cbiAgICAgICAgICAgIGlmIChjaGlsZC5ub2RlVHlwZSA9PT0gMykgeyAvLyBURVhUX05PREVcbiAgICAgICAgICAgICAgICBkYXRhW1widGV4dENvbnRlbnRcIl0gPSBjaGlsZC5ub2RlVmFsdWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoaWxkLm5vZGVUeXBlID09PSAxKSB7XG4gICAgICAgICAgICAgICAgY2hpbGREYXRhID0gX19yZWFkRGVmYXVsdChjaGlsZCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIWRhdGFbY2hpbGQubm9kZU5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHN0b3JlIGNoaWxkRGF0YSBpbiBhbiBvYmplY3RcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtjaGlsZC5ub2RlTmFtZV0gPSBjaGlsZERhdGE7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gY2FzZ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4ge09iamVjdH0gbm9kZUF0dHJpYnV0ZXMgLSBvYmpldCBjb250ZW5hbnQgbGVzIG5vbXMgZXQgdmFsZXVycyBkZXMgZGlmZsOpcmVudHMgYXR0cmlidXRzXG4gKi9cbmZ1bmN0aW9uIF9fZ2V0QXR0cmlidXRlcyAobm9kZSkge1xuICAgIGlmIChub2RlLmF0dHJpYnV0ZXMubGVuZ3RoID4gMCkge1xuICAgICAgICB2YXIgbm9kZUF0dHJpYnV0ZXMgPSB7fTtcbiAgICAgICAgdmFyIGF0dHJpYnV0ZXMgPSBub2RlLmF0dHJpYnV0ZXM7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXR0cmlidXRlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGF0dHJpYnV0ZSA9IGF0dHJpYnV0ZXNbaV07XG4gICAgICAgICAgICBub2RlQXR0cmlidXRlc1thdHRyaWJ1dGUubm9kZU5hbWVdID0gYXR0cmlidXRlLm5vZGVWYWx1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbm9kZUF0dHJpYnV0ZXM7XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBYTUw7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Formats/XML.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Gp.js": +/*!*****************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Gp.js ***! + \*****************************************************/ +/*! exports provided: servicesVersion, servicesDate, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesVersion\", function() { return servicesVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesDate\", function() { return servicesDate; });\n/* harmony import */ var _Services_Services__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Services/Services */ \"./node_modules/geoportal-access-lib/src/Services/Services.js\");\n/* harmony import */ var _Services_DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Services/DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Services_Alti_Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Services/Alti/Response/model/AltiResponse */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\");\n/* harmony import */ var _Services_Alti_Response_model_Elevation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Services/Alti/Response/model/Elevation */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\");\n/* harmony import */ var _Services_AutoComplete_Response_model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Services/AutoComplete/Response/model/AutoCompleteResponse */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/AutoCompleteResponse.js\");\n/* harmony import */ var _Services_AutoComplete_Response_model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Services/AutoComplete/Response/model/SuggestedLocation */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/SuggestedLocation.js\");\n/* harmony import */ var _Services_ProcessIsoCurve_Response_model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Services/ProcessIsoCurve/Response/model/ProcessIsoCurveResponse */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/model/ProcessIsoCurveResponse.js\");\n/* harmony import */ var _Services_Route_Response_model_RouteResponse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Services/Route/Response/model/RouteResponse */ \"./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteResponse.js\");\n/* harmony import */ var _Services_Route_Response_model_RouteInstruction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Services/Route/Response/model/RouteInstruction */ \"./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteInstruction.js\");\n/* harmony import */ var _Services_Config_Config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Services/Config/Config */ \"./node_modules/geoportal-access-lib/src/Services/Config/Config.js\");\n/* harmony import */ var _Protocols_XHR__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Protocols/XHR */ \"./node_modules/geoportal-access-lib/src/Protocols/XHR.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../package.json */ \"./node_modules/geoportal-access-lib/package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_13___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../package.json */ \"./node_modules/geoportal-access-lib/package.json\", 1);\n/**\n* Global variable Gp.\n*\n* @module Gp\n* @alias Gp\n* @description\n*\n* This is the global variable that is exposed in the browser environment.\n* Content is composed of constructor, functions and properties...\n*\n* > {@link Gp.Error Error()}\n* - .TYPE_SRVERR : \"SERVICE_ERROR\"\n* - .TYPE_UNKERR : \"UNKNOWN_ERROR\"\n* - .TYPE_USEERR : \"USAGE_ERROR\"\n*\n* > {@link module:Helper Helper}\n* - .indent()\n* - .normalyzeParameters()\n* - .normalyzeUrl()\n*\n* > {@link module:XHR Protocols.XHR}\n* - .call()\n*\n* > {@link module:Services Services (objects)}\n* - .Alti\n* - {@link Gp.Services.Alti.Elevation .Elevation()}\n* - {@link Gp.Services.AltiResponse .AltiResponse()}\n* - .AutoComplete\n* - {@link Gp.Services.AutoComplete.SuggestedLocation .SuggestedLocation()}\n* - {@link Gp.Services.AutoCompleteResponse .AutoCompleteResponse()}\n* - {@link Gp.Services.Config .Config()}\n* - {@link Gp.Services.DefaultUrl .DefaultUrl()}\n* - {@link Gp.Services.GeocodeResponse .GeocodeResponse()}\n* - {@link Gp.Services.GetConfigResponse .GetConfigResponse()}\n* - {@link Gp.Services.IsoCurveResponse .IsoCurveResponse()}\n* - .Route\n* - {@link Gp.Services.Route.RouteInstruction .RouteInstruction()}\n* - {@link Gp.Services.RouteResponse .RouteResponse()}\n*\n* > Services (factory)\n* - {@link module:Services~autoComplete .autoComplete()}\n* - {@link module:Services~geocode .geocode()}\n* - {@link module:Services~getAltitude .getAltitude()}\n* - {@link module:Services~getConfig .getConfig()}\n* - {@link module:Services~isoCurve .isoCurve()}\n* - {@link module:Services~reverseGeocode .reverseGeocode()}\n* - {@link module:Services~route .route()}\n*\n* > servicesDate : \"YYYY-MM-DD\"\n*\n* > servicesVersion : \"X.X.X\"\n*\n*/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/** Version */\nconst servicesVersion = _package_json__WEBPACK_IMPORTED_MODULE_13__.version;\n/** Publication date */\nconst servicesDate = _package_json__WEBPACK_IMPORTED_MODULE_13__.date;\n\n// on declare les ns dans root global\nvar Gp = {};\n\nGp.servicesVersion = servicesVersion;\nGp.servicesDate = servicesDate;\n\n// Export Protocols\nGp.Protocols = {};\nGp.Protocols.XHR = _Protocols_XHR__WEBPACK_IMPORTED_MODULE_10__[\"default\"];\n// Export services\nGp.Services = _Services_Services__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n// Export DefaultUrls\nGp.Services.DefaultUrl = _Services_DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n// Export Alti\nGp.Services.AltiResponse = _Services_Alti_Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\nGp.Services.Alti = {};\nGp.Services.Alti.Elevation = _Services_Alti_Response_model_Elevation__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n// Export Autocomplete\nGp.Services.AutoCompleteResponse = _Services_AutoComplete_Response_model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\nGp.Services.AutoComplete = {};\nGp.Services.AutoComplete.SuggestedLocation = _Services_AutoComplete_Response_model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n// Export Config\nGp.Services.Config = _Services_Config_Config__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n// Export IsoCurve\nGp.Services.IsoCurveResponse = _Services_ProcessIsoCurve_Response_model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n// Export Route\nGp.Services.RouteResponse = _Services_Route_Response_model_RouteResponse__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\nGp.Services.Route = {};\nGp.Services.Route.RouteInstruction = _Services_Route_Response_model_RouteInstruction__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n// Export Erreurs et Outils\nGp.Error = _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\nGp.Helper = _Utils_Helper__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Gp);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvR3AuanM/NjZhOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTt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pbHNcbkdwLkVycm9yID0gRXJyb3I7XG5HcC5IZWxwZXIgPSBIZWxwZXI7XG5cbmV4cG9ydCBkZWZhdWx0IEdwO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Gp.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Protocols/JSONP.js": +/*!******************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Protocols/JSONP.js ***! + \******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/**\n * JSONP : Implémentation du protocole JSONP de la plateforme Géoportail\n *\n * @module JSONP\n * @private\n * @alias Gp.Protocols.JSONP\n */\n\n\n// cf. https://github.com/sobstel/jsonp.js\nvar JSONP = {\n\n /**\n * Construction d'un identifiant statique basé sur le timestamp,\n * et qui s'incremente de +1 à chaque appel\n */\n uuid : (function () {\n var id = Math.floor(Date.now());\n return function () {\n return id++;\n };\n })(),\n\n /**\n * Cette fonction réalise l'appel du service fourni via le paramètre \"options.url\"\n * en mettant en œuvre le protocole JSONP.\n *\n * @method call\n * @static\n * @param {Object} options - parametres d'invocation du service en JSONP\n * @param {String} options.url - URL du service à invoquer (indépendamment du protocole JSONP).\n * Cette URL contient déjà les paramètres du service.\n * Si le paramètre dédié à la mise en oeuvre du protocole JSONP (callback=xxx) n'est pas présent, il est rajouté par la fonction ;\n * sa valeur est déterminée en fonction du paramètre callbackName.\n * @param {Number} [options.timeOut = 0] - Nombre de ms au bout duquel on considère que le service n'a pas répondu.\n * Une valeur de 0 pour ce paramètre permet de désactiver la gestion du timeOut.\n * @param {String} [options.callbackSuffix = null] - Suffixe de la fonction de callback à rajouter sur l'URL.\n * Si aucun suffixe n'est spécifié (cas par défaut), on utilisera l'identifiant this.uuid () comme suffixe. Ex: \"callback1458574396582 ()\"\n * @param {String} [options.callbackName = gp.protocol.jsonp] - Valeur du paramètre callback à rajouter sur l'URL.\n * Si l'URL fournie contient déjà le paramètre callback, le paramètre callbackName ne sera pas pris en compte.\n * La fonction de callback est créée dynamiquement par la fonction JSONP ;\n * elle a deux fonctions :\n * elle annule la condition de timeOut\n * puis appelle la fonction fournie par l'utilisateur via le paramètre onResponse.\n * @param {Function} options.onResponse - Nom de la fonction qui sera appelée lors de la réception des résultats du service.\n * Ce paramètre sera ignoré si l'URL contient déjà le paramètre callback.\n * La fonction de rappel appelée sera alors celle ayant pour nom la valeur de ce paramètre.\n * @param {Function} [options.onTimeOut] - Nom de la fonction qui sera appelée en cas de non réponse du service.\n * Le temps au bout duquel on considère que le service n'a pas répondu est déterminé par le paramètre timeOut.\n * @example\n * var options = {\n * url : 'http://localhost/some/test.json&callback=myResults',\n * timeOut : 100,\n * callbackName : 'myResults',\n * callbackSuffix : \"\",\n * onResponse : function (response) {\n * console.log('results : ', response);\n * },\n *\n * };\n * JSONP.call(options);\n */\n call : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"JSONP\");\n logger.trace(\"[JSONP::call ()]\");\n\n // analyse parametres\n\n if (!options) {\n logger.error(\"missing parameter : options !\");\n throw new Error(\"missing parameter : options !\");\n }\n\n if (!options.url) {\n logger.error(\"missing parameter : options.url !\");\n throw new Error(\"missing parameter : options.url !\");\n }\n\n if (!options.timeOut) {\n logger.info(\"setting 'options.timeOut' default value\");\n options.timeOut = 0;\n }\n\n // FIXME si un callback coté client a été mis en place,\n // cette condition sur cette methode n'a pas de sens !?\n if (!options.onResponse) {\n logger.error(\"missing parameter : options.onResponse !\");\n throw new Error(\"missing parameter : options.onResponse !\");\n // FIXME doit on definir un callback interne par defaut !?\n // options.onResponse = function (data) {\n // console.log(\"response callback (inner) : \", data);\n // };\n }\n\n // ID du callback à utiliser : null ou string.\n // si l'utilisateur a spécifié un suffixe pour le callback, on le récupère comme un ID (ex: options.callbackSuffix = \"\")\n // sinon, on utilise un timestamp : this.uuid ()\n var callbackId = (typeof options.callbackSuffix === \"string\") ? options.callbackSuffix : this.uuid();\n\n // on recherche le parametre callback et son nom de fonction dans l'url\n var urlHasCallbackKey = false;\n var urlHasCallbackName = false;\n\n var idx = options.url.indexOf(\"callback=\");\n\n if (idx !== -1) {\n urlHasCallbackKey = true;\n // extraction callbackName de l'url : entre \"callback=\" et \"&\" ou fin de ligne\n var j = options.url.indexOf(\"&\", idx);\n if (j === -1) {\n j = options.url.length;\n }\n\n // on ecrase le parametre options.callbackName s'il avait été défini\n var callbackName = options.url.substring(idx + 9, j);\n\n if (callbackName) {\n urlHasCallbackName = true;\n options.callbackName = callbackName;\n logger.info(\"setting 'options.callbackName' value (\" + options.callbackName + \") from 'options.url' parameter\");\n }\n }\n\n // on ajoute le parametre callback dans l'URL s'il n'existe pas\n if (!urlHasCallbackKey) {\n // gestion des autres param. et \"?\"\n var k = options.url.indexOf(\"?\");\n if (k === -1) {\n // aucun param., ni de '?'\n options.url = options.url + \"?\" + \"callback=\";\n } else if (k === options.url.length) {\n // uniquement le '?'\n options.url = options.url + \"callback=\";\n } else {\n // le '?' et les param. existent\n options.url = options.url + \"&\" + \"callback=\";\n }\n logger.info(\"setting callback default key in 'options.url' : \" + options.url);\n }\n\n // utilisation de la fonction callback coté client ?\n var HasCallbackName = options.callbackName ? true : urlHasCallbackName;\n\n // on ajoute le nom de la fonction callback dans l'URL si elle n'existe pas\n if (!urlHasCallbackName) {\n // fonction callback par defaut\n if (!options.callbackName) {\n logger.info(\"setting 'options.callbackName' default value\");\n options.callbackName = \"callback\"; // ou \"gp.protocol.jsonp\" ?\n // info : si on ne veut pas gerer d'ID dans le callback,\n // options.callbackSuffix = \"\"\n if (callbackId || callbackId === \"\") {\n options.callbackName += callbackId;\n }\n }\n options.url = options.url.replace(\"callback=\", \"callback=\" + options.callbackName);\n logger.info(\"setting callback function name in 'options.url' : \" + options.url);\n }\n\n // timeOut par defaut\n if (!options.onTimeOut) {\n logger.info(\"setting 'options.onTimeOut' default value\");\n /** callback timeout par defaut */\n options.onTimeOut = function (/* error */) {\n console.log(\"TimeOut while invoking url : \" + options.url);\n };\n }\n\n if (!HasCallbackName) {\n var self = this;\n\n // event du timeout\n var onTimeOutTrigger = null;\n\n // declenche le timeout si > à 0 !\n if (options.timeOut > 0) {\n onTimeOutTrigger = window.setTimeout(\n function () {\n /** fonction de reponse du service */\n window[options.callbackName] = function () {};\n options.onTimeOut();\n self._deleteScript(callbackId);\n }, options.timeOut);\n }\n\n // FIXME le nom de la fonction n'accepte pas de namespace !\n // ex. Gp.Function.callback\n /**\n * fonction de reponse du service\n * @param {Object} data - data\n * @private\n */\n window[options.callbackName] = function (data) {\n window.clearTimeout(onTimeOutTrigger);\n options.onResponse(data);\n self._deleteScript(callbackId);\n };\n }\n\n this._createScript(callbackId, options.url);\n },\n\n /**\n * create Script\n * @param {String} callbackId - callback Id\n * @param {String} url - url\n * @private\n */\n _createScript : function (callbackId, url) {\n var scriptu;\n var scripto = document.getElementById(\"results\" + callbackId);\n\n scriptu = document.createElement(\"script\");\n scriptu.setAttribute(\"type\", \"text/javascript\");\n scriptu.setAttribute(\"src\", url);\n scriptu.setAttribute(\"charset\", \"UTF-8\");\n scriptu.setAttribute(\"id\", \"results\" + callbackId);\n scriptu.setAttribute(\"async\", \"true\"); // FIXME async ?\n // head ou body ou autres ?\n var node = document.documentElement || document.getElementsByTagName(\"head\")[0];\n if (scripto === null) {\n node.appendChild(scriptu);\n } else {\n // s'il existe déjà, on le remplace !\n node.replaceChild(scriptu, scripto);\n }\n },\n\n /**\n * delete Script\n * @param {String} callbackId - callback Id\n * @private\n */\n _deleteScript : function (callbackId) {\n var script = document.getElementById(\"results\" + callbackId);\n if (script) {\n var node = script.parentNode || document.documentElement;\n if (!node) {\n return;\n }\n node.removeChild(script);\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (JSONP);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvUHJvdG9jb2xzL0pTT05QLmpzPzNiMTUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQzhDOztBQUU5QztBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7O0FBRUw7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsZUFBZSxPQUFPO0FBQ3RCLGVBQWUsT0FBTztBQUN0QjtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEI7QUFDQSxlQUFlLE9BQU87QUFDdEI7QUFDQSxlQUFlLE9BQU87QUFDdEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsU0FBUztBQUN4QjtBQUNBO0FBQ0EsZUFBZSxTQUFTO0FBQ3hCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxxQkFBcUIsOERBQU07QUFDM0I7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ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1lJyB2YWx1ZSAoXCIgKyBvcHRpb25zLmNhbGxiYWNrTmFtZSArIFwiKSBmcm9tICdvcHRpb25zLnVybCcgcGFyYW1ldGVyXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gb24gYWpvdXRlIGxlIHBhcmFtZXRyZSBjYWxsYmFjayBkYW5zIGwnVVJMIHMnaWwgbidleGlzdGUgcGFzXG4gICAgICAgIGlmICghdXJsSGFzQ2FsbGJhY2tLZXkpIHtcbiAgICAgICAgICAgIC8vIGdlc3Rpb24gZGVzIGF1dHJlcyBwYXJhbS4gZXQgXCI/XCJcbiAgICAgICAgICAgIHZhciBrID0gb3B0aW9ucy51cmwuaW5kZXhPZihcIj9cIik7XG4gICAgICAgICAgICBpZiAoayA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAvLyBhdWN1biBwYXJhbS4sIG5pIGRlICc/J1xuICAgICAgICAgICAgICAgIG9wdGlvbnMudXJsID0gb3B0aW9ucy51cmwgKyBcIj9cIiArIFwiY2FsbGJhY2s9XCI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGsgPT09IG9wdGlvbnMudXJsLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIC8vIHVuaXF1ZW1lbnQgbGUgJz8nXG4gICAgICAgICAgICAgICAgb3B0aW9ucy51cmwgPSBvcHRpb25zLnVybCArIFwiY2FsbGJhY2s9XCI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGxlICc/JyBldCBsZXMgcGFyYW0uIGV4aXN0ZW50XG4gICAgICAgICAgICAgICAgb3B0aW9ucy51cmwgPSBvcHRpb25zLnVybCArIFwiJlwiICsgXCJjYWxsYmFjaz1cIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxvZ2dlci5pbmZvKFwic2V0dGluZyBjYWxsYmFjayBkZWZhdWx0IGtleSBpbiAnb3B0aW9ucy51cmwnIDogXCIgKyBvcHRpb25zLnVyb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udXJsLnJlcGxhY2UoXCJjYWxsYmFjaz1cIiwgXCJjYWxsYmFjaz1cIiArIG9wdGlvbnMuY2FsbGJhY2tOYW1lKTtcbiAgICAgICAgICAgIGxvZ2dlci5pbmZvKFwic2V0dGluZyBjYWxsYmFjayBmdW5jdGlvbiBuYW1lIGluICdvcHRpb25zLnVybCcgOiBcIiArIG9wdGlvbnMudXJsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHRpbWVPdXQgcGFyIGRlZmF1dFxuICAgICAgICBpZiAoIW9wdGlvbnMub25UaW1lT3V0KSB7XG4gICAgICAgICAgICBsb2dnZXIuaW5mbyhcInNldHRpbmcgJ29wdGlvbnMub25UaW1lT3V0JyBkZWZhdWx0IHZhbHVlXCIpO1xuICAgICAgICAgICAgLyoqIGNhbGxiYWNrIHRpbWVvdXQgcGFyIGRlZmF1dCAqL1xuICAgICAgICAgICAgb3B0aW9ucy5vblRpbWVPdXQgPSBmdW5jdGlvbiAoLyogZXJyb3IgKi8pIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIlRpbWVPdXQgd2hpbGUgaW52b2tpbmcgdXJsIDogXCIgKyBvcHRpb25zLnVybCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFIYXNDYWxsYmFja05hbWUpIHtcbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcblxuICAgICAgICAgICAgLy8gZXZlbnQgZHUgdGltZW91dFxuICAgICAgICAgICAgdmFyIG9uVGltZU91dFRyaWdnZXIgPSBudWxsO1xuXG4gICAgICAgICAgICAvLyBkZWNsZW5jaGUgbGUgdGltZW91dCBzaSA+IMOgIDAgIVxuICAgICAgICAgICAgaWYgKG9wdGlvbnMudGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICBvblRpbWVPdXRUcmlnZ2VyID0gd2luZG93LnNldFRpbWVvdXQoXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBmb25jdGlvbiBkZSByZXBvbnNlIGR1IHNlcnZpY2UgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1tvcHRpb25zLmNhbGxiYWNrTmFtZV0gPSBmdW5jdGlvbiAoKSB7fTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25UaW1lT3V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9kZWxldGVTY3JpcHQoY2FsbGJhY2tJZCk7XG4gICAgICAgICAgICAgICAgICAgIH0sIG9wdGlvbnMudGltZU91dCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEZJWE1FIGxlIG5vbSBkZSBsYSBmb25jdGlvbiBuJ2FjY2VwdGUgcGFzIGRlIG5hbWVzcGFjZSAhXG4gICAgICAgICAgICAvLyBleC4gR3AuRnVuY3Rpb24uY2FsbGJhY2tcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgKiBmb25jdGlvbiBkZSByZXBvbnNlIGR1IHNlcnZpY2VcbiAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IGRhdGEgLSBkYXRhXG4gICAgICAgICAgICAqIEBwcml2YXRlXG4gICAgICAgICAgICAqL1xuICAgICAgICAgICAgd2luZG93W29wdGlvbnMuY2FsbGJhY2tOYW1lXSA9IGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICAgICAgd2luZG93LmNsZWFyVGltZW91dChvblRpbWVPdXRUcmlnZ2VyKTtcbiAgICAgICAgICAgICAgICBvcHRpb25zLm9uUmVzcG9uc2UoZGF0YSk7XG4gICAgICAgICAgICAgICAgc2VsZi5fZGVsZXRlU2NyaXB0KGNhbGxiYWNrSWQpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX2NyZWF0ZVNjcmlwdChjYWxsYmFja0lkLCBvcHRpb25zLnVybCk7XG4gICAgfSxcblx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bGQoc2NyaXB0dSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBzJ2lsIGV4aXN0ZSBkw6lqw6AsIG9uIGxlIHJlbXBsYWNlICFcbiAgICAgICAgICAgIG5vZGUucmVwbGFjZUNoaWxkKHNjcmlwdHUsIHNjcmlwdG8pO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICogZGVsZXRlIFNjcmlwdFxuICAgICogQHBhcmFtIHtTdHJpbmd9IGNhbGxiYWNrSWQgLSBjYWxsYmFjayBJZFxuICAgICogQHByaXZhdGVcbiAgICAqL1xuICAgIF9kZWxldGVTY3JpcHQgOiBmdW5jdGlvbiAoY2FsbGJhY2tJZCkge1xuICAgICAgICB2YXIgc2NyaXB0ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoXCJyZXN1bHRzXCIgKyBjYWxsYmFja0lkKTtcbiAgICAgICAgaWYgKHNjcmlwdCkge1xuICAgICAgICAgICAgdmFyIG5vZGUgPSBzY3JpcHQucGFyZW50Tm9kZSB8fCBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQ7XG4gICAgICAgICAgICBpZiAoIW5vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBub2RlLnJlbW92ZUNoaWxkKHNjcmlwdCk7XG4gICAgICAgIH1cbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBKU09OUDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Protocols/JSONP.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Protocols/Protocol.js": +/*!*********************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Protocols/Protocol.js ***! + \*********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _XHR__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./XHR */ \"./node_modules/geoportal-access-lib/src/Protocols/XHR.js\");\n/* harmony import */ var _JSONP__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./JSONP */ \"./node_modules/geoportal-access-lib/src/Protocols/JSONP.js\");\n/**\n * Interface de dialogue avec les webservices\n *\n * @module Protocols\n * @private\n * @alias Gp.Protocols\n */\n\n\n\n\nvar Protocol = {\n\n /**\n * Interface unique d\"envoi d\"une requête.\n *\n * @method send\n * @static\n * @param {Object} options - options generales\n * @param {String} options.url - url du service\n * @param {String} options.method - GET, POST, PUT, DELETE\n * @param {String} options.protocol - XHR | JSONP\n * @param {String} options.format - format de la reponse du service : json, xml ou null (brute)...\n * @param {String} options.wrap - encapsuler la reponse du service dans du JSON : true|false (true par defaut sur le protocole JSONP)\n * @param {String} options.callbackSuffix - suffixe de la fonction de callback (JSONP uniquement) (ex: si callbackSuffix=\"\", la fonction s'appellera \"callback\")\n * @param {String} options.timeOut - 0 ms\n * @param {Boolean} options.nocache - true|false\n * @param {Object|String} options.data - content (post) ou param (get)\n * @param {Object|String} options.headers - (post) ex. referer\n * @param {Object|String} options.content - (post) ex. \"application/json\"\n * @param {String} options.scope - this (TODO)\n * @param {Function} options.onResponse - callback\n * @param {Function} options.onFailure - callback\n * @param {Function} options.onTimeOut - callback\n * @param {String} options.proxyUrl - (TODO)\n */\n send : function (options) {\n // INFO\n // \"output\" - param est interne à la classe \"Protocol\" (parametrable via \"wrap\"), et à ajouter à l\"url\n // ce param est independant du service car il est géré par le filtre LUA :\n // ex. json|xml (json par defaut).\n // Ce param. permet d\"encapsuler du XML dans du JSON :\n // {http : {status:200, error:null},xml :\"réponse du service\"}\n // Utile pour les services qui ne repondent que du XML (ex. Geocodage)\n //\n // |-------------------------------------------------|\n // | \\service | | | |\n // | output\\ format| json | xml | remarques |\n // |--------\\------|------|-----|--------------------|\n // | json | json | json| json/xml encapsulé |\n // | xml | json | xml | param inactif |\n // |-------------------------------------------------|\n // ex. le service demande une reponse native au \"format\" json et avec un \"output\" json.\n // on a donc une reponse json encapsulé dans un json : ce qu'on ne souhaite pas !\n // dans ce cas on ne renseigne pas output=json\n\n // INFO\n // \"wrap\" - choix d\"encapsuler ou non les reponses dans du JSON.\n // Par defaut, on encapsule uniquement les reponses sur le protocole JSONP (et qui sont en xml) !\n\n // INFO\n // \"callback\" - param est interne à la classe \"Protocol\" (non parametrable), et à ajouter à l\"url\n // ce param est independant du service car il est géré aussi par le filtre LUA :\n // ex. callback|null\n // Ce param. permet de renvoyer une reponse javascript :\n // callback ({http : {status:200, error:null},xml :\"réponse du service\"})\n // Ce param. est non renseigné par defaut car pour du JSONP, on utilise le\n // le protocol JSONP, et ce dernier implemente déjà le callback !\n\n // settings par defaut\n var settings = options || {\n method : \"GET\",\n // protocol : \"JSONP\",\n protocol : \"XHR\",\n timeOut : 0,\n format : null,\n wrap : true,\n nocache : true,\n output : \"json\",\n callback : null,\n callbackSuffix : null\n };\n\n // on determine l'environnement d'execution : browser ou non ?\n // et on stoppe pour nodeJS... sur un protocole JSONP !\n if (typeof window === \"undefined\" && options.protocol === \"JSONP\") {\n console.log(\"Value (s) for parameter (s) 'protocol=JSONP (instead use XHR)' not supported to NodeJS\");\n return;\n }\n\n if (options.protocol === \"XHR\" || options.format === \"json\") {\n settings.wrap = false;\n } else if (options.protocol === \"JSONP\" && options.format === \"xml\") {\n settings.wrap = true;\n }\n\n settings.callback = null; // FIXME non géré !?\n settings.output = settings.wrap ? \"json\" : null;\n\n // on encapsule les reponses dans un objet JSON\n if (settings.wrap) {\n var params = {};\n params.output = settings.output;\n params.callback = settings.callback;\n delete params.callback; // FIXME non géré !?\n settings.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__[\"default\"].normalyzeUrl(options.url, params);\n }\n\n // choix de l\"implementation :\n // XHR ou JSONP\n switch (settings.protocol) {\n case \"XHR\":\n // on normalise l'url (gestion du cache)\n if (options.method === \"GET\" && options.nocache) {\n settings.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__[\"default\"].normalyzeUrl(settings.url, {\n t : new Date().getTime()\n });\n }\n // appel du service en XHR\n _XHR__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(settings);\n break;\n case \"JSONP\":\n\n // on normalise l'url si les params. sont renseignés dans la string|object \"data\"\n if (settings.data) {\n settings.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__[\"default\"].normalyzeUrl(settings.url, settings.data);\n }\n\n // appel du service en JSONP\n _JSONP__WEBPACK_IMPORTED_MODULE_2__[\"default\"].call(settings);\n break;\n default:\n throw new Error(\"protocol not supported (XHR|JSONP) !\");\n }\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Protocol);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvUHJvdG9jb2xzL1Byb3RvY29sLmpzPzIyNjIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNxQztBQUNiO0FBQ0k7O0FBRTVCOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPO0FBQ3RCLGVBQWUsT0FBTztBQUN0QixlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPO0FBQ3RCLGVBQWUsT0FBTztBQUN0QixlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPO0FBQ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lLFxuICAgICAgICAgICAgb3V0cHV0IDogXCJqc29uXCIsXG4gICAgICAgICAgICBjYWxsYmFjayA6IG51bGwsXG4gICAgICAgICAgICBjYWxsYmFja1N1ZmZpeCA6IG51bGxcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBvbiBkZXRlcm1pbmUgbCdlbnZpcm9ubmVtZW50IGQnZXhlY3V0aW9uIDogYnJvd3NlciBvdSBub24gP1xuICAgICAgICAvLyBldCBvbiBzdG9wcGUgcG91ciBub2RlSlMuLi4gc3VyIHVuIHByb3RvY29sZSBKU09OUCAhXG4gICAgICAgIGlmICh0eXBlb2Ygd2luZG93ID09PSBcInVuZGVmaW5lZFwiICYmIG9wdGlvbnMucHJvdG9jb2wgPT09IFwiSlNPTlBcIikge1xuICAgICAgICAgICAgY29uc29sZS5sb2coXCJWYWx1ZSAocykgZm9yIHBhcmFtZXRlciAocykgJ3Byb3RvY29sPUpTT05QIChpbnN0ZWFkIHVzZSBYSFIpJyBub3Qgc3VwcG9ydGVkIHRvIE5vZGVKU1wiKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChvcHRpb25zLnByb3RvY29sID09PSBcIlhIUlwiIHx8IG9wdGlvbnMuZm9ybWF0ID09PSBcImpzb25cIikge1xuICAgICAgICAgICAgc2V0dGluZ3Mud3JhcCA9IGZhbHNlO1xuICAgICAgICB9IGVsc2UgaWYgKG9wdGlvbnMucHJvdG9jb2wgPT09IFwiSlNPTlBcIiAmJiBvcHRpb25zLmZvcm1hdCA9PT0gXCJ4bWxcIikge1xuICAgICAgICAgICAgc2V0dGluZ3Mud3JhcCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBzZXR0aW5ncy5jYWxsYmFjayA9IG51bGw7IC8vIEZJWE1FIG5vbiBnw6lyw6kgIT9cbiAgICAgICAgc2V0dGluZ3Mub3V0cHV0ID0gc2V0dGluZ3Mud3JhcCA/IFwianNvblwiIDogbnVsbDtcblxuICAgICAgICAvLyBvbiBlbmNhcHN1bGUgbGVzIHJlcG9uc2VzIGRhbnMgdW4gb2JqZXQgSlNPTlxuICAgICAgICBpZiAoc2V0dGluZ3Mud3JhcCkge1xuICAgICAgICAgICAgdmFyIHBhcmFtcyA9IHt9O1xuICAgICAgICAgICAgcGFyYW1zLm91dHB1dCA9IHNldHRpbmdzLm91dHB1dDtcbiAgICAgICAgICAgIHBhcmFtcy5jYWxsYmFjayA9IHNldHRpbmdzLmNhbGxiYWNrO1xuICAgICAgICAgICAgZGVsZXRlIHBhcmFtcy5jYWxsYmFjazsgLy8gRklYTUUgbm9uIGfDqXLDqSAhP1xuICAgICAgICAgICAgc2V0dGluZ3MudXJsID0gSGVscGVyLm5vcm1hbHl6ZVVybChvcHRpb25zLnVybCwgcGFyYW1zKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGNob2l4IGRlIGxcImltcGxlbWVudGF0aW9uIDpcbiAgICAgICAgLy8gWEhSIG91IEpTT05QXG4gICAgICAgIHN3aXRjaCAoc2V0dGluZ3MucHJvdG9jb2wpIHtcbiAgICAgICAgICAgIGNhc2UgXCJYSFJcIjpcbiAgICAgICAgICAgICAgICAvLyBvbiBub3JtYWxpc2UgbCd1cmwgKGdlc3Rpb24gZHUgY2FjaGUpXG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMubWV0aG9kID09PSBcIkdFVFwiICYmIG9wdGlvbnMubm9jYWNoZSkge1xuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy51cmwgPSBIZWxwZXIubm9ybWFseXplVXJsKHNldHRpbmdzLnVybCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgdCA6IG5ldyBEYXRlKCkuZ2V0VGltZSgpXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBhcHBlbCBkdSBzZXJ2aWNlIGVuIFhIUlxuICAgICAgICAgICAgICAgIFhIUi5jYWxsKHNldHRpbmdzKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgXCJKU09OUFwiOlxuXG4gICAgICAgICAgICAgICAgLy8gb24gbm9ybWFsaXNlIGwndXJsIHNpIGxlcyBwYXJhbXMuIHNvbnQgcmVuc2VpZ27DqXMgZGFucyBsYSBzdHJpbmd8b2JqZWN0IFwiZGF0YVwiXG4gICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLmRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MudXJsID0gSGVscGVyLm5vcm1hbHl6ZVVybChzZXR0aW5ncy51cmwsIHNldHRpbmdzLmRhdGEpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGFwcGVsIGR1IHNlcnZpY2UgZW4gSlNPTlBcbiAgICAgICAgICAgICAgICBKU09OUC5jYWxsKHNldHRpbmdzKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwicHJvdG9jb2wgbm90IHN1cHBvcnRlZCAoWEhSfEpTT05QKSAhXCIpO1xuICAgICAgICB9XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBQcm90b2NvbDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Protocols/Protocol.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Protocols/XHR.js": +/*!****************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Protocols/XHR.js ***! + \****************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var es6_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! es6-promise */ \"./node_modules/es6-promise/dist/es6-promise.js\");\n/* harmony import */ var es6_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(es6_promise__WEBPACK_IMPORTED_MODULE_2__);\n/* global Promise, require, XDomainRequest */\n\n\n\n\n// import __request from \"request\";\n// import __xmldom from \"xmldom\";\n\n/**\n * Ajax Request (use of Promises)\n *\n * @module XHR\n * @alias Gp.Protocols.XHR\n * @see dependance 'es6-promise'\n */\n\n// cf. https://xhr.spec.whatwg.org/\n// cf. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest\n\nvar XHR = {\n\n /**\n * Interface unique d'envoi d'une requête.\n *\n * @method call\n * @static\n * @param {Object} settings - options generales\n * @param {String} settings.url - url du service\n * @param {String} settings.method - GET, POST, PUT, DELETE\n * @param {String} settings.format - format de la reponse du service : json, xml ou null (brute)\n * @param {String} settings.data - content (post) ou param (get)\n * @param {String} settings.proxy - proxy url\n * @param {Object|String} settings.headers - (post) ex. referer\n * @param {Object|String} settings.content - (post) ex. 'application/json'\n * @param {String} settings.timeOut - timeout = 0 par defaut\n * @param {String} settings.scope - this\n * @param {Function} settings.onResponse - callback\n * @param {Function} settings.onFailure - callback\n */\n call : function (settings) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"XHR\");\n logger.trace(\"[XHR::call()]\");\n\n // FIXME\n // To polyfill the global environment\n es6_promise__WEBPACK_IMPORTED_MODULE_2___default.a.polyfill();\n\n // test sur les settings obligatoires\n if (!settings.url) {\n throw new Error(\"missing parameter : url is not defined !\");\n }\n\n if (!settings.method) {\n throw new Error(\"missing parameter : method is not defined !\");\n }\n\n if (!settings.format) {\n settings.format = \"text\"; // reponse brute !\n }\n\n var options = {};\n options.url = settings.url;\n options.data = settings.data ? settings.data : null;\n options.method = settings.method;\n options.timeOut = settings.timeOut || 0;\n options.scope = settings.scope || this;\n options.proxy = settings.proxy || null;\n options.content = settings.content || null;\n options.headers = settings.headers || {\n referer : \"http://localhost\"\n };\n\n // test sur les valeurs de 'settings.method'\n switch (settings.method) {\n case \"DELETE\":\n case \"GET\":\n break;\n case \"PUT\":\n case \"POST\":\n // on force sur ces params spécifiques au mode POST\n options.content = settings.content ? settings.content : \"application/x-www-form-urlencoded\"; // FIXME en attente des services : bascule en \"application/xml\" ou \"application/json\"\n options.headers = settings.headers ? settings.headers : { referer : \"http://localhost\" }; // FIXME parametrable...\n break;\n case \"HEAD\":\n case \"OPTIONS\":\n throw new Error(\"HTTP method not yet supported !\");\n default:\n throw new Error(\"HTTP method unknown !\");\n }\n\n // test sur les valeurs de 'settings.format'\n switch (settings.format) {\n case \"text\":\n this.__call(options)\n .then(function (response) {\n logger.trace(response);\n settings.onResponse.call(this, response);\n })\n .catch(function (error) {\n settings.onFailure.call(this, error);\n });\n break;\n case \"json\":\n this.__callJSON(options)\n .then(function (response) {\n logger.trace(response);\n settings.onResponse.call(this, response);\n })\n .catch(function (error) {\n settings.onFailure.call(this, error);\n });\n break;\n case \"xml\":\n this.__callXML(options)\n .then(function (response) {\n logger.trace(response);\n settings.onResponse.call(this, response);\n })\n .catch(function (error) {\n settings.onFailure.call(this, error);\n });\n break;\n default:\n throw new Error(\"This output Format is not yet supported !\");\n }\n },\n\n /**\n * Requete\n *\n * @method __call\n * @private\n * @param {Object} options - options\n * @return {Object} promise\n */\n __call : function (options) {\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"XHR\");\n logger.trace(\"[XHR::__call()]\");\n\n var promise = new Promise(\n function (resolve, reject) {\n // traitement du corps de la requête\n var corps = (options.method === \"POST\" || options.method === \"PUT\") ? 1 : 0;\n\n // seulement si options.data n'est pas vide (peut être un objet ou une chaine de caractères)\n if (options.data && ((typeof options.data === \"object\" && Object.keys(options.data).length) || (typeof options.data === \"string\" && options.data.length)) && !corps) {\n if (options.scope.CLASSNAME === \"Geocode\" || options.scope.CLASSNAME === \"ReverseGeocode\") {\n options.url = options.url + options.data;\n } else {\n options.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(options.url, options.data);\n }\n }\n\n logger.trace(\"URL = \", options.url);\n\n var hXHR = null;\n\n // test on env. nodejs or browser\n if (typeof window === \"undefined\") {\n var nodefetch = __webpack_require__(/*! node-fetch */ \"node-fetch\");\n\n var opts = {\n headers : {\n Referer : \"https://localhost\"\n }\n };\n\n if (options.data && typeof options.data === \"string\" && corps) {\n opts = {\n method : options.method,\n body : options.data,\n headers : {\n \"Content-Type\" : options.content,\n Referer : \"https://localhost\"\n }\n };\n }\n\n return nodefetch(options.url, opts)\n .then(function (response) {\n if (response.ok) { // res.status >= 200 && res.status < 300\n resolve(response.text());\n } else {\n var message = \"Errors Occured on Http Request (status : '\" + response.statusText + \"' | url : '\" + response.url + \"')\";\n var status = response.status;\n reject({\n message : message,\n status : status\n });\n }\n })\n .catch(function (e) {\n reject({\n message : e,\n status : -1\n });\n });\n } else {\n if (window.XMLHttpRequest) {\n logger.trace(\"XMLHttpRequest\");\n\n hXHR = new XMLHttpRequest();\n hXHR.open(options.method, options.url, true); // async\n hXHR.overrideMimeType = options.content;\n\n // gestion du timeout\n var onTimeOutTrigger = null;\n if (options.timeOut > 0) {\n // FIXME le timeout interne ne me permet pas de declencher le bon message...\n // hXHR.timeout = options.timeOut;\n logger.trace(\"XHR - TimeOut actif !\");\n /**\n * Description\n *\n * @method onTimeOutTrigger\n * @private\n */\n onTimeOutTrigger = window.setTimeout(\n function () {\n var message = \"TimeOut Occured on Http Request with XMLHttpRequest !\";\n reject({\n message : message,\n status : -1\n });\n }, options.timeOut);\n }\n\n if (corps) {\n // headers, data, content of data\n // cf. https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader\n logger.trace(\"data = \", options.data);\n hXHR.setRequestHeader(\"Content-type\", options.content);\n // FIXME refused to set unsafe header content-length javascript\n // hXHR.setRequestHeader (\"Content-length\", options.data.length);\n // hXHR.setRequestHeader (\"Referer\", options.headers.referer);\n }\n\n /**\n * On Error\n * FIXME ne se declenche pas !?\n *\n * @param {Object} e - Event\n * @method onerror\n * @private\n */\n hXHR.onerror = function (e) {\n console.log(e);\n reject(new Error(\"Errors Occured on Http Request with XMLHttpRequest !\"));\n };\n\n /**\n * On Timeout\n * FIXME ne se declenche pas !?\n *\n * @param {Object} e - Event\n * @method ontimeout\n * @private\n */\n hXHR.ontimeout = function (e) {\n console.log(e);\n reject(new Error(\"TimeOut Occured on Http Request with XMLHttpRequest !\"));\n };\n\n /**\n * Description\n *\n * @method onreadystatechange\n * @private\n */\n hXHR.onreadystatechange = function (e) {\n if (hXHR.readyState === 4) { // DONE\n if (hXHR.status === 200) {\n window.clearTimeout(onTimeOutTrigger);\n resolve(hXHR.response);\n } else {\n var message = \"Errors Occured on Http Request (status : '\" + e.target.statusText + \"' | url : '\" + e.target.responseURL + \"' | response : '\" + e.target.response + \"')\";\n var status = e.target.status;\n reject({\n message : message,\n status : status\n });\n }\n }\n };\n\n // gestion du content data\n var data4xhr = (options.data && corps) ? options.data : null;\n\n hXHR.send(data4xhr);\n } else if (window.XDomainRequest) {\n // worked in Internet Explorer 8–10 only !\n logger.trace(\"XDomainRequest\");\n\n hXHR = new XDomainRequest();\n hXHR.open(options.method, options.url);\n\n hXHR.overrideMimeType = options.content;\n\n if (options.timeOut > 0) {\n hXHR.timeout = options.timeout;\n logger.trace(\"XHR - TimeOut actif !\");\n }\n\n if (corps) {\n // headers, data, content of data\n // cf. https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader\n hXHR.setRequestHeader(\"Content-type\", options.content);\n // FIXME refused to set unsafe header content-length javascript\n // hXHR.setRequestHeader (\"Content-length\", options.data.length);\n // hXHR.setRequestHeader (\"Referer\", options.headers.referer);\n }\n\n /**\n * Description\n *\n * @method onerror\n * @private\n */\n hXHR.onerror = function () {\n reject(new Error(\"Errors Occured on Http Request with XMLHttpRequest !\"));\n };\n\n /**\n * Description\n *\n * @method ontimeout\n * @private\n */\n hXHR.ontimeout = function () {\n reject(new Error(\"TimeOut Occured on Http Request with XMLHttpRequest !\"));\n };\n\n /**\n * On Load\n *\n * @method onload\n * @private\n */\n hXHR.onload = function (e) {\n if (hXHR.status === 200) {\n resolve(hXHR.responseText);\n } else {\n var message = \"Errors Occured on Http Request (status : '\" + e.target.statusText + \"' | url : '\" + e.target.responseURL + \"')\";\n var status = e.target.status;\n reject({\n message : message,\n status : status\n });\n }\n };\n\n var data4xdr = (options.data && corps) ? options.data : null;\n\n hXHR.send(data4xdr);\n } else {\n throw new Error(\"CORS not supported\");\n }\n }\n }\n );\n\n return promise;\n },\n\n /**\n * Requete avec parser JSON\n *\n * @method __callJSON\n * @private\n * @param {Object} options - options\n * @return {Object} promise\n */\n __callJSON : function (options) {\n return this.__call(options)\n .then(JSON.parse)\n .catch(function (error) {\n console.log(\"_callJSON failed on : \", options.url, error);\n // FIXME pas d'exception, laissons le fil se derouler...\n // throw error;\n });\n },\n\n /**\n * Requete avec parser XML\n *\n * @method __callXML\n * @private\n * @param {Object} options - options\n * @return {Object} promise\n */\n __callXML : function (options) {\n return this.__call(options)\n .then(function (response) {\n var xmlDoc;\n\n // test on env. nodejs or browser\n if (typeof window === \"undefined\") {\n var DOMParser = __webpack_require__(/*! xmldom */ \"xmldom\").DOMParser; // __xmldom.DOMParser\n xmlDoc = new DOMParser().parseFromString(response, \"text/xml\");\n } else {\n if (window.DOMParser) {\n var parser = new window.DOMParser();\n xmlDoc = parser.parseFromString(response, \"text/xml\");\n } else { // IE\n xmlDoc = new window.ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = false;\n xmlDoc.loadXML(response);\n }\n }\n\n return xmlDoc;\n })\n .catch(function (error) {\n console.log(\"__callXML failed on : \", options.url, error);\n // FIXME pas d'exception, laissons le fil se derouler...\n // throw error;\n });\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (XHR);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvUHJvdG9jb2xzL1hIUi5qcz8wYzViIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFFOEM7QUFDVDtBQUNBO0FBQ3JDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsZUFBZSxPQUFPO0FBQ3RCLGVBQWUsT0FBTztBQUN0QixlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPO0FBQ3RCLGVBQWUsT0FBTztBQUN0QixlQUFlLE9BQU87QUFDdEIsZUFBZSxjQUFjO0FBQzdCLGVBQWUsY0FBYztBQUM3QixlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPO0FBQ3RCLGVBQWUsU0FBUztBQUN4QixlQUFlLFNBQVM7QUFDeEI7QUFDQTtBQUNBO0FBQ0EscUJBQXFCLDhEQUFNO0FBQzNCOztBQUVBO0FBQ0E7QUFDQSxRQUFRLGtEQUFVOztBQUVsQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxxQ0FBcUM7QUFDckM7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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WxldXJzIGRlICdzZXR0aW5ncy5tZXRob2QnXG4gICAgICAgIHN3aXRjaCAoc2V0dGluZ3MubWV0aG9kKSB7XG4gICAgICAgICAgICBjYXNlIFwiREVMRVRFXCI6XG4gICAgICAgICAgICBjYXNlIFwiR0VUXCI6XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFwiUFVUXCI6XG4gICAgICAgICAgICBjYXNlIFwiUE9TVFwiOlxuICAgICAgICAgICAgICAgIC8vIG9uIGZvcmNlIHN1ciBjZXMgcGFyYW1zIHNww6ljaWZpcXVlcyBhdSBtb2RlIFBPU1RcbiAgICAgICAgICAgICAgICBvcHRpb25zLmNvbnRlbnQgPSBzZXR0aW5ncy5jb250ZW50ID8gc2V0dGluZ3MuY29udGVudCA6IFwiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkXCI7IC8vIEZJWE1FIGVuIGF0dGVudGUgZGVzIHNlcnZpY2VzIDogYmFzY3VsZSBlbiBcImFwcGxpY2F0aW9uL3htbFwiIG91IFwiYXBwbGljYXRpb24vanNvblwiXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5oZWFkZXJzID0gc2V0dGluZ3MuaGVhZGVycyA/IHNldHRpbmdzLmhlYWRlcnMgOiB7IHJlZmVyZXIgOiBcImh0dHA6Ly9sb2NhbGhvc3RcIiB9OyAvLyBGSVhNRSBwYXJhbWV0cmFibGUuLi5cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgXCJIRUFEXCI6XG4gICAgICAgICAgICBjYXNlIFwiT1BUSU9OU1wiOlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkhUVFAgbWV0aG9kIG5vdCB5ZXQgc3VwcG9ydGVkICFcIik7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkhUVFAgbWV0aG9kIHVua25vd24gIVwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHRlc3Qgc3VyIGxlcyB2YWxldXJzIGRlICdzZXR0aW5ncy5mb3JtYXQnXG4gICAgICAgIHN3aXRjaCAoc2V0dGluZ3MuZm9ybWF0KSB7XG4gICAgICAgICAgICBjYXNlIFwidGV4dFwiOlxuICAgICAgICAgICAgICAgIHRoaXMuX19jYWxsKG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9uUmVzcG9uc2UuY2FsbCh0aGlzLCByZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9uRmFpbHVyZS5jYWxsKHRoaXMsIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFwianNvblwiOlxuICAgICAgICAgICAgICAgIHRoaXMuX19jYWxsSlNPTihvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZ2dlci50cmFjZShyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vblJlc3BvbnNlLmNhbGwodGhpcywgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vbkZhaWx1cmUuY2FsbCh0aGlzLCBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBcInhtbFwiOlxuICAgICAgICAgICAgICAgIHRoaXMuX19jYWxsWE1MKG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9uUmVzcG9uc2UuY2FsbCh0aGlzLCByZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9uRmFpbHVyZS5jYWxsKHRoaXMsIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlRoaXMgb3V0cHV0IEZvcm1hdCBpcyBub3QgeWV0IHN1cHBvcnRlZCAhXCIpO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJlcXVldGVcbiAgICAgKlxuICAgICAqIEBtZXRob2QgX19jYWxsXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0gIHtPYmplY3R9IG9wdGlvbnMgLSBvcHRpb25zXG4gICAgICogQHJldHVybiB7T2JqZWN0fSBwcm9taXNlXG4gICAgICovXG4gICAgX19jYWxsIDogZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgdmFyIGxvZ2dlciA9IExvZ2dlci5nZXRMb2dnZXIoXCJYSFJcIik7XG4gICAgICAgIGxvZ2dlci50cmFjZShcIltYSFI6Ol9fY2Fsb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kYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxvZ2dlci50cmFjZShcIlVSTCA9IFwiLCBvcHRpb25zLnVybCk7XG5cbiAgICAgICAgICAgICAgICB2YXIgaFhIUiA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAvLyB0ZXN0IG9uIGVudi4gbm9kZWpzIG9yIGJyb3dzZXJcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHdpbmRvdyA9PT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZWZldGNoID0gcmVxdWlyZShcIm5vZGUtZmV0Y2hcIik7XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIG9wdHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzIDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlZmVyZXIgOiBcImh0dHBzOi8vbG9jYWxob3N0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5kYXRhICYmIHR5cGVvZiBvcHRpb25zLmRhdGEgPT09IFwic3RyaW5nXCIgJiYgY29ycHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kIDogb3B0aW9ucy5tZXRob2QsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA6IG9wdGlvbnMuZGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzIDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIkNvbnRlbnQtVHlwZVwiIDogb3B0aW9ucy5jb250ZW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWZlcmVyIDogXCJodHRwczovL2xvY2FsaG9zdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlZmV0Y2gob3B0aW9ucy51cmwsIG9wdHMpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uub2spIHsgLy8gcmVzLnN0YXR1cyA+PSAyMDAgJiYgcmVzLnN0YXR1cyA8IDMwMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3BvbnNlLnRleHQoKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1lc3NhZ2UgPSBcIkVycm9ycyBPY2N1cmVkIG9uIEh0dHAgUmVxdWVzdCAoc3RhdHVzIDogJ1wiICsgcmVzcG9uc2Uuc3RhdHVzVGV4dCArIFwiJyB8IHVybCA6ICdcIiArIHJlc3BvbnNlLnVybCArIFwiJylcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXR1cyA9IHJlc3BvbnNlLnN0YXR1cztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBtZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogc3RhdHVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3Qoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh3aW5kb3cuWE1MSHR0cFJlcXVlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZ2dlci50cmFjZShcIlhNTEh0dHBSZXF1ZXN0XCIpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBoWEhSID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBoWEhSLm9wZW4ob3B0aW9ucy5tZXRob2QsIG9wdGlvbnMudXJsLCB0cnVlKTsgLy8gYXN5bmNcbiAgICAgICAgICAgICAgICAgICAgICAgIGhYSFIub3ZlcnJpZGVNaW1lVHlwZSA9IG9wdGlvbnMuY29udGVudDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZ2VzdGlvbiBkdSB0aW1lb3V0XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgb25UaW1lT3V0VHJpZ2dlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy50aW1lT3V0ID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZJWE1FIGxlIHRpbWVvdXQgaW50ZXJuZSBuZSBtZSBwZXJtZXQgcGFzIGRlIGRlY2xlbmNoZXIgbGUgYm9uIG1lc3NhZ2UuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBoWEhSLnRpbWVvdXQgPSBvcHRpb25zLnRpbWVPdXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiWEhSIC0gVGltZU91dCBhY3RpZiAhXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIERlc2NyaXB0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBAbWV0aG9kIG9uVGltZU91dFRyaWdnZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBAcHJpdmF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uVGltZU91dFRyaWdnZXIgPSB3aW5kb3cuc2V0VGltZW91dChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1lc3NhZ2UgPSBcIlRpbWVPdXQgT2NjdXJlZCBvbiBIdHRwIFJlcXVlc3Qgd2l0aCBYTUxIdHRwUmVxdWVzdCAhXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3Qoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBtZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA6IC0xXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgb3B0aW9ucy50aW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvcnBzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaGVhZGVycywgZGF0YSwgY29udGVudCBvZiBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2YuIGh0dHBzOi8vZHZjcy53My5vcmcvaGcveGhyL3Jhdy1maWxlL3RpcC9PdmVydmlldy5odG1sI2RvbS14bWxodHRwcmVxdWVzdC1zZXRyZXF1ZXN0aGVhZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiZGF0YSA9IFwiLCBvcHRpb25zLmRhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhYSFIuc2V0UmVxdWVzdEhlYWRlcihcIkNvbnRlbnQtdHlwZVwiLCBvcHRpb25zLmNvbnRlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZJWE1FIHJlZnVzZWQgdG8gc2V0IHVuc2FmZSBoZWFkZXIgY29udGVudC1sZW5ndGggamF2YXNjcmlwdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGhYSFIuc2V0UmVxdWVzdEhlYWRlciAoXCJDb250ZW50LWxlbmd0aFwiLCBvcHRpb25zLmRhdGEubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBoWEhSLnNldFJlcXVlc3RIZWFkZXIgKFwiUmVmZXJlclwiLCBvcHRpb25zLmhlYWRlcnMucmVmZXJlcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAgICAgICAgICogT24gRXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgICAqIEZJWE1FIG5lIHNlIGRlY2xlbmNoZSBwYXMgIT9cbiAgICAgICAgICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gZSAtIEV2ZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBAbWV0aG9kIG9uZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgICAqIEBwcml2YXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgIGhYSFIub25lcnJvciA9IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihcIkVycm9ycyBPY2N1cmVkIG9uIEh0dHAgUmVxdWVzdCB3aXRoIFhNTEh0dHBSZXF1ZXN0ICFcIikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBPbiBUaW1lb3V0XG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBGSVhNRSBuZSBzZSBkZWNsZW5jaGUgcGFzICE/XG4gICAgICAgICAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IGUgLSBFdmVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICogQG1ldGhvZCBvbnRpbWVvdXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAqIEBwcml2YXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgIGhYSFIub250aW1lb3V0ID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKFwiVGltZU91dCBPY2N1cmVkIG9uIEh0dHAgUmVxdWVzdCB3aXRoIFhNTEh0dHBSZXF1ZXN0ICFcIikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBEZXNjcmlwdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2Qgb25yZWFkeXN0YXRlY2hhbmdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBAcHJpdmF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICBoWEhSLm9ucmVhZHlzdGF0ZWNoYW5nZSA9IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhYSFIucmVhZHlTdGF0ZSA9PT0gNCkgeyAvLyBET05FXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoWEhSLnN0YXR1cyA9PT0gMjAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2xlYXJUaW1lb3V0KG9uVGltZU91dFRyaWdnZXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShoWEhSLnJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtZXNzYWdlID0gXCJFcnJvcnMgT2NjdXJlZCBvbiBIdHRwIFJlcXVlc3QgKHN0YXR1cyA6ICdcIiArIGUudGFyZ2V0LnN0YXR1c1RleHQgKyBcIicgfCB1cmwgOiAnXCIgKyBlLnRhcmdldC5yZXNwb25zZVVSTCArIFwiJyB8IHJlc3BvbnNlIDogJ1wiICsgZS50YXJnZXQucmVzcG9uc2UgKyBcIicpXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RhdHVzID0gZS50YXJnZXQuc3RhdHVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiBzdGF0dXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZ2VzdGlvbiBkdSBjb250ZW50IGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhNHhociA9IChvcHRpb25zLmRhdGEgJiYgY29ycHMpID8gb3B0aW9ucy5kYXRhIDogbnVsbDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaFhIUi5zZW5kKGRhdGE0eGhyKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aW5kb3cuWERvbWFpblJlcXVlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdvcmtlZCBpbiBJbnRlcm5ldCBFeHBsb3JlciA44oCTMTAgb25seSAhXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJYRG9tYWluUmVxdWVzdFwiKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaFhIUiA9IG5ldyBYRG9tYWluUmVxdWVzdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaFhIUi5vcGVuKG9wdGlvbnMubWV0aG9kLCBvcHRpb25zLnVybCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGhYSFIub3ZlcnJpZGVNaW1lVHlwZSA9IG9wdGlvbnMuY29udGVudDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMudGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoWEhSLnRpbWVvdXQgPSBvcHRpb25zLnRpbWVvdXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiWEhSIC0gVGltZU91dCBhY3RpZiAhXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29ycHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBoZWFkZXJzLCBkYXRhLCBjb250ZW50IG9mIGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjZi4gaHR0cHM6Ly9kdmNzLnczLm9yZy9oZy94aHIvcmF3LWZpbGUvdGlwL092ZXJ2aWV3Lmh0bWwjZG9tLXhtbGh0dHByZXF1ZXN0LXNldHJlcXVlc3RoZWFkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoWEhSLnNldFJlcXVlc3RIZWFkZXIoXCJDb250ZW50LXR5cGVcIiwgb3B0aW9ucy5jb250ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRSByZWZ1c2VkIHRvIHNldCB1bnNhZmUgaGVhZGVyIGNvbnRlbnQtbGVuZ3RoIGphdmFzY3JpcHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBoWEhSLnNldFJlcXVlc3RIZWFkZXIgKFwiQ29udGVudC1sZW5ndGhcIiwgb3B0aW9ucy5kYXRhLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaFhIUi5zZXRSZXF1ZXN0SGVhZGVyIChcIlJlZmVyZXJcIiwgb3B0aW9ucy5oZWFkZXJzLnJlZmVyZXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgICAgICAgICAqIERlc2NyaXB0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICogQG1ldGhvZCBvbmVycm9yXG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBAcHJpdmF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICBoWEhSLm9uZXJyb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihcIkVycm9ycyBPY2N1cmVkIG9uIEh0dHAgUmVxdWVzdCB3aXRoIFhNTEh0dHBSZXF1ZXN0ICFcIikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBEZXNjcmlwdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2Qgb250aW1lb3V0XG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBAcHJpdmF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICBoWEhSLm9udGltZW91dCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKFwiVGltZU91dCBPY2N1cmVkIG9uIEh0dHAgUmVxdWVzdCB3aXRoIFhNTEh0dHBSZXF1ZXN0ICFcIikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAgICAgKiBPbiBMb2FkXG4gICAgICAgICAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICogQG1ldGhvZCBvbmxvYWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAqIEBwcml2YXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgIGhYSFIub25sb2FkID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaFhIUi5zdGF0dXMgPT09IDIwMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGhYSFIucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9IFwiRXJyb3JzIE9jY3VyZWQgb24gSHR0cCBSZXF1ZXN0IChzdGF0dXMgOiAnXCIgKyBlLnRhcmdldC5zdGF0dXNUZXh0ICsgXCInIHwgdXJsIDogJ1wiICsgZS50YXJnZXQucmVzcG9uc2VVUkwgKyBcIicpXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdGF0dXMgPSBlLnRhcmdldC5zdGF0dXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA6IHN0YXR1c1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YTR4ZHIgPSAob3B0aW9ucy5kYXRhICYmIGNvcnBzKSA/IG9wdGlvbnMuZGF0YSA6IG51bGw7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGhYSFIuc2VuZChkYXRhNHhkcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJDT1JTIG5vdCBzdXBwb3J0ZWRcIik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG5cbiAgICAgICAgcmV0dXJuIHByb21pc2U7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJlcXVldGUgYXZlYyBwYXJzZXIgSlNPTlxuICAgICAqXG4gICAgICogQG1ldGhvZCBfX2NhbGxKU09OXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0gIHtPYmplY3R9IG9wdGlvbnMgLSBvcHRpb25zXG4gICAgICogQHJldHVybiB7T2JqZWN0fSBwcm9taXNlXG4gICAgICovXG4gICAgX19jYWxsSlNPTiA6IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fY2FsbChvcHRpb25zKVxuICAgICAgICAgICAgLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIl9jYWxsSlNPTiBmYWlsZWQgb24gOiBcIiwgb3B0aW9ucy51cmwsIGVycm9yKTtcbiAgICAgICAgICAgICAgICAvLyBGSVhNRSBwYXMgZCdleGNlcHRpb24sIGxhaXNzb25zIGxlIGZpbCBzZSBkZXJvdWxlci4uLlxuICAgICAgICAgICAgICAgIC8vIHRocm93IGVycm9yO1xuICAgICAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJlcXVldGUgYXZlYyBwYXJzZXIgWE1MXG4gICAgICpcbiAgICAgKiBAbWV0aG9kIF9fY2FsbFhNTFxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHBhcmFtICB7T2JqZWN0fSBvcHRpb25zIC0gb3B0aW9uc1xuICAgICAqIEByZXR1cm4ge09iamVjdH0gcHJvbWlzZVxuICAgICAqL1xuICAgIF9fY2FsbFhNTCA6IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fY2FsbChvcHRpb25zKVxuICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHhtbERvYztcblxuICAgICAgICAgICAgICAgIC8vIHRlc3Qgb24gZW52LiBub2RlanMgb3IgYnJvd3NlclxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygd2luZG93ID09PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBET01QYXJzZXIgPSByZXF1aXJlKFwieG1sZG9tXCIpLkRPTVBhcnNlcjsgLy8gX194bWxkb20uRE9NUGFyc2VyXG4gICAgICAgICAgICAgICAgICAgIHhtbERvYyA9IG5ldyBET01QYXJzZXIoKS5wYXJzZUZyb21TdHJpbmcocmVzcG9uc2UsIFwidGV4dC94bWxcIik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5ET01QYXJzZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYXJzZXIgPSBuZXcgd2luZG93LkRPTVBhcnNlcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgeG1sRG9jID0gcGFyc2VyLnBhcnNlRnJvbVN0cmluZyhyZXNwb25zZSwgXCJ0ZXh0L3htbFwiKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gSUVcbiAgICAgICAgICAgICAgICAgICAgICAgIHhtbERvYyA9IG5ldyB3aW5kb3cuQWN0aXZlWE9iamVjdChcIk1pY3Jvc29mdC5YTUxET01cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB4bWxEb2MuYXN5bmMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHhtbERvYy5sb2FkWE1MKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiB4bWxEb2M7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiX19jYWxsWE1MIGZhaWxlZCBvbiA6IFwiLCBvcHRpb25zLnVybCwgZXJyb3IpO1xuICAgICAgICAgICAgICAgIC8vIEZJWE1FIHBhcyBkJ2V4Y2VwdGlvbiwgbGFpc3NvbnMgbGUgZmlsIHNlIGRlcm91bGVyLi4uXG4gICAgICAgICAgICAgICAgLy8gdGhyb3cgZXJyb3I7XG4gICAgICAgICAgICB9KTtcbiAgICB9XG5cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFhIUjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Protocols/XHR.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js": +/*!*********************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js ***! + \*********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/AltiRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js\");\n/* harmony import */ var _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/AltiResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n *\n * Appel du service d'altimétrie du Géoportail\n *\n * @todo gestion du parma. output et callback\n * @todo outputFormat (REST) et format (WPS)\n * @todo La reponse JSON peut encapsuler un XML !\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Alti\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {Array.} options.positions - Tableau ({lon:float,lat:float}) contenant les coordonnées des points (CRS:84)\n * dont on veut connaître les altitudes (ou à partir desquelles on va calculer le profil).\n * Chaque élément du tableau est un objet JavaScript avec deux attributs : lon et lat, qui sont des flottants.\n * Minimum 2 éléments si on souhaite calculer un profil altimétrique (ElevationLine).\n * Maximum 50 éléments.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service alti : 'xml' ou 'json'.\n * Ce paramètre déterminera l'extension '.xml' ou '.json' du service dans le cas de l'API REST,\n * ou la valeur du paramètre 'format' dans le cas de la norme WPS.\n * Nécessaire si serverUrl est renseigné, et qu'on souhaite passer par l'API REST,\n * pour connaître le format dans lequel sera fournie la réponse (pour son traitement).\n * Non nécessaire pour la norme WPS. Par défaut, ce paramètre vaut 'json'.\n *\n * @param {Number} [options.sampling] - Nombre de points à utiliser pour déterminer le tracé d'un profil altimétrique, compris entre 2 et 5000.\n * A spécifier lorsqu'on souhaite accéder à cette fonctionnalité.\n * Dans ce cas, les points fournis en entrée (au minimum de deux) servent à déterminer l'axe planimétrique\n * le long duquel le profil doit être calculé.\n * Si le paramètre sampling n'est pas spécifié ou moins de deux points sont fournis,\n * c'est le service Elevation qui sera interrogé (altitudes simples calculées pour les points fournis).\n * Une valeur de sampling strictement inférieure à 2 déclenchera un échantillonnage avec la valeur par défaut du service (3 points).\n *\n * @param {String} [options.api] - Manière d'accéder au service : 'REST' (via l'API REST) ou 'WPS' (via la norme WPS).\n * Par défaut, on utilise l'API REST.\n *\n * @param {Boolean} [options.zonly] - Permet de ne récupérer que les altitudes en sortie s'il vaut 'true'.\n * Vaut 'false' par défaut.\n *\n * @param {String} [options.resource] - Resource utilisée pour réaliser le calcul.\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * positions : [{lon:, lat:}, {lon:, lat:}],\n * outputFormat : 'json' // json|xml\n * sampling : 3,\n * api : 'REST', // REST|WPS\n * zonly : false // false|true,\n * resource : \"resource-par-defaut\"\n * };\n *\n */\nfunction Alti (options) {\n if (!(this instanceof Alti)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Alti\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"Alti\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Alti\");\n this.logger.trace(\"[Constructeur Alti (options)]\");\n\n // #####################\n // analyse des options\n // #####################\n\n if (!options.positions) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"positions\"));\n }\n\n if (options.positions.length === 0) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"positions\"));\n }\n\n // ajout des options spécifiques au service\n this.options.positions = options.positions;\n\n // format de réponse du service : \"json\" ou \"xml\" (valeur par défaut), en minuscule !\n this.options.outputFormat = (typeof options.outputFormat === \"string\") ? options.outputFormat.toLowerCase() : \"xml\";\n\n // ressource utilisée pour le calcul altimétrique\n this.options.resource = options.resource || \"rge_alti_corse2a_float32_zip_lamb93\";\n\n // sampling\n this.options.sampling = options.sampling || null;\n\n // type d'api utilisé pour requeter le service, en majuscule !\n this.options.api = (typeof options.api === \"string\") ? options.api.toUpperCase() : \"REST\";\n\n // l'api ne peut être interrogée qu'en GET.\n if (this.options.api === \"REST\") {\n this.options.httpMethod = \"GET\";\n }\n\n // param. zonly\n this.options.zonly = options.zonly || false;\n\n // param. measures\n this.options.measures = options.measures || false;\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n // en fonction du type d'api, REST ou WPS, du format de reponse demandé (outputFormat)\n // ainsi que sur le type de service (profil ou elevation)\n if (!this.options.serverUrl) {\n // Code commenté pour Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti\n /* var lstUrlByDefault = DefaultUrlService.Alti.newUrl();\n if (this.options.oldAltiService) {\n lstUrlByDefault = DefaultUrlService.Alti.url();\n }*/\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti\n var lstUrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Alti.url();\n var urlFound = null;\n switch (this.options.api) {\n case \"WPS\":\n urlFound = lstUrlByDefault.wps;\n break;\n case \"REST\":\n var key = (options.sampling ? \"profil\" : \"elevation\") + \"-\" + this.options.outputFormat;\n urlFound = lstUrlByDefault[key];\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"api\"));\n }\n\n if (!urlFound) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = urlFound;\n this.logger.trace(\"Server URL by default : \" + this.options.serverUrl);\n }\n\n // gestion du type de service\n // si l'extension de l'url est .json ou .xml, on surcharge le format de sortie (outputFormat)\n var idx = this.options.serverUrl.lastIndexOf(\".\");\n if (idx !== -1) {\n var extension = this.options.serverUrl.substring(idx + 1);\n if (extension && extension.length < 5) { // FIXME extension de moins de 4 car. ...\n this.logger.trace(\"Server Extension URL : \" + extension);\n switch (extension.toLowerCase()) {\n case \"json\":\n case \"xml\":\n this.options.outputFormat = extension.toLowerCase();\n break;\n default:\n throw new Error(\"type of service : unknown or unsupported (json or xml) !\");\n }\n }\n }\n}\n\n/**\n * @lends module:Alti#\n */\nAlti.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/**\n * Constructeur (alias)\n */\nAlti.prototype.constructor = Alti;\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAlti.prototype.buildRequest = function (error, success) {\n // utilisation en mode callback\n var options = {\n httpMethod : this.options.httpMethod,\n // callback\n onSuccess : function (result) {\n // sauvegarde de la requete !\n this.request = result;\n success.call(this, this.request);\n },\n onError : error,\n scope : this,\n // spécifique au service :\n resource : this.options.resource,\n positions : this.options.positions,\n outputFormat : this.options.outputFormat,\n sampling : this.options.sampling,\n api : this.options.api,\n zonly : this.options.zonly,\n measures : this.options.measures\n };\n\n _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n};\n\n/**\n * Analyse de la reponse (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAlti.prototype.analyzeResponse = function (error, success) {\n // INFO\n // Factory pour masquer la complexité du retour du service qui renvoie soit\n // - une 'string' qui contient du XML ou JSON natif en mode XHR\n // - un objet JSON qui est natif ou encapsulé\n\n if (this.response) {\n var options = {\n response : this.response,\n outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML !\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Alti);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9BbHRpLmpzPzJlNDIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQ2lEO0FBQ0g7QUFDVztBQUNaO0FBQ1E7QUFDUztBQUNHOztBQUVqRTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsZUFBZSwrQkFBK0Isb0JBQW9CO0FBQzdFO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FB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wic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js ***! + \*******************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Response/model/AltiResponse */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\");\n/* harmony import */ var _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Response/model/Elevation */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\");\n/* harmony import */ var _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Response/model/Measure */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js\");\n\n/**\n * Fonction retournant un objet contenant des clés de lecture (readers)\n * qui permettent de parser des réponses XML du service Altimétrique du Géoportail\n * (calcul altimétrique simple ou profil altimétrique d'une courbe),\n * lorsque le paramètre output = xml,\n * afin de récupérer les élévations retournées.\n *\n * @module AltiResponseReader\n * @alias Gp.Services.Alti.Formats.AltiResponseReader\n * @private\n */\n\n// import Logger from \"../../../Utils/LoggerByDefault\";\n\n\n\n\n/**\n *\n * Objet AltiResponseReader\n *\n * @member {Object} AltiResponseReader\n *\n * @property {Object} AltiResponseReader.READERS - Objet contenant des fonctions de lecture, appelées \"readers\"\n * dont chaque clé correspond au nom d'un tag du XML que l'on souhaite lire\n * et la valeur associée est une fonction (node, data)\n * où node est un noeud du document DOM\n * et data est un objet où l'on stocke les informations lues dans le XML.\n *\n * @property {Method} AltiResponseReader.READERS.elevations - Lecture d'un noeud \"elevations\" de la réponse XML\n * du service alti, correspondant logiquement à la racine du document\n * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée)\n *\n * @property {Method} AltiResponseReader.READERS.elevation - Lecture d'un noeud \"elevation\" de la réponse xml du service alti.\n * (contient un ou 4 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, et acc)\n *\n * @property {Method} AltiResponseReader.READERS.lat - Lecture d'un noeud \"lat\" de la réponse xml du service alti.\n * (contient une valeur de latitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.lon - Lecture d'un noeud \"lon\" de la réponse xml du service alti.\n * (contient une valeur de longitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.z - Lecture d'un noeud \"z\" de la réponse xml du service alti.\n * (contient une valeur d'altitude, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.acc - Lecture d'un noeud \"acc\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.measures - Lecture d'un noeud \"measures\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @property {Method} AltiResponseReader.READERS.source_name - Lecture d'un noeud \"source_name\" de la réponse xml du service alti.\n * (pour remplir l'éventuel objet measure)\n *\n * @property {Method} AltiResponseReader.READERS.source_mesure - Lecture d'un noeud \"source_mesure\" de la réponse xml du service alti.\n * (pour remplir l'éventuel objet measure)\n *\n * @property {Method} AltiResponseReader.READERS.exceptionreport - Lecture d'un noeud \"ExceptionReport\" de la réponse xml du service alti.\n *\n * @property {Method} AltiResponseReader.READERS.exception - Lecture d'un noeud \"Exception\" de la réponse xml du service alti.\n *\n * @property {Method} AltiResponseReader.read - Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique,\n * à l'aide des readers de la classe.\n *\n */\nvar AltiResponseReader = {};\n\nAltiResponseReader.READERS = {\n\n /**\n * Lecture d'un noeud \"elevations\" de la réponse XML du service alti, correspondant logiquement à la racine du document\n * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée)\n *\n * @param {DOMElement} root - racine de la réponse XML\n * @static\n * @memberof AltiResponseReader\n * @returns {Object} Retourne un objet de type AltiResponse\n */\n elevations : function (root) {\n // INFO : on passe en paramètre l'objet en entrée elevations, vide, à remplir.\n var altiResponse = new _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n\n if (root.hasChildNodes()) {\n var children = root.childNodes;\n var child;\n var elevation;\n\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n\n if (AltiResponseReader.READERS[child.nodeName]) {\n elevation = AltiResponseReader.READERS[child.nodeName](child);\n altiResponse.elevations.push(elevation);\n }\n }\n }\n\n return altiResponse;\n },\n\n /**\n * Lecture d'un noeud \"elevation\" de la réponse xml du service alti.\n * (contient un ou 5 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, acc et measures)\n *\n * @param {DOMElement} node - noeud elevation à lire pour récupérer les informations de l'élévation retournée (z [, lon, lat, acc, measures])\n * @return {Array} elevationResponse - format de la réponse en sortie, instance de AltiResponse\n * @static\n * @memberof AltiResponseReader\n */\n elevation : function (node) {\n var elevation = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (AltiResponseReader.READERS[child.nodeName]) {\n // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir.\n AltiResponseReader.READERS[child.nodeName](child, elevation);\n }\n }\n }\n return elevation;\n },\n\n /**\n * Lecture d'un noeud \"lat\" de la réponse xml du service alti.\n * (contient une valeur de latitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la latitude\n * @param {Object} elevation - objet dans lequel stocker la latitude retournée\n * @static\n * @memberof AltiResponseReader\n */\n lat : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevation.lat = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : latitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"lon\" de la réponse xml du service alti.\n * (contient une valeur de longitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la longitude\n * @param {Object} elevation - objet dans lequel stocker la longitude retournée\n * @static\n * @memberof AltiResponseReader\n */\n lon : function (node, elevation) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevation.lon = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : longitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"z\" de la réponse xml du service alti.\n * (contient une valeur d'altitude, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'altitude\n * @param {Object} elevationObject - objet dans lequel stocker l'altitude retournée : elevation ou measure\n * @static\n * @memberof AltiResponseReader\n */\n z : function (node, elevationObject) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n if (elevationObject) {\n elevationObject.z = parseFloat(textNode.nodeValue);\n } else {\n elevationObject = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n elevationObject.z = parseFloat(textNode.nodeValue);\n return elevationObject;\n }\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : altitude attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"acc\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} elevationObject - objet dans lequel stocker la précision retournée : elevation ou measure\n * @static\n * @memberof AltiResponseReader\n */\n acc : function (node, elevationObject) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n elevationObject.acc = parseFloat(textNode.nodeValue);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : précision (acc) attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"source_name\" de la réponse xml du service alti.\n * (contient le nom de la source, qui est un string)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} measure - objet dans lequel stocker le nom de la source retourné\n * @static\n * @memberof AltiResponseReader\n */\n source_name : function (node, measure) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n measure.source_name = textNode.nodeValue;\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : source_name attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"source_measure\" de la réponse xml du service alti.\n * (contient le nom de la mesure, qui est un string)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} measure - objet dans lequel stocker le nom de la source retourné\n * @static\n * @memberof AltiResponseReader\n */\n source_measure : function (node, measure) {\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n measure.source_measure = textNode.nodeValue;\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : source_measure attendue mais absente\");\n }\n },\n\n /**\n * Lecture d'un noeud \"measures\" et de ses enfants \"measure\" de la réponse xml du service alti.\n * (contient une valeur de précision, qui est un flottant)\n *\n * @param {DOMElement} node - noeud à lire pour récupérer la précision\n * @param {Object} elevation - objet dans lequel stocker la précision retournée\n * @static\n * @memberof AltiResponseReader\n */\n measures : function (node, elevation) {\n elevation.measures = [];\n var measure;\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var measureNode;\n var measureChildren;\n for (var i = 0; i < children.length; i++) {\n measure = new _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n measureNode = children[i];\n measureChildren = measureNode.childNodes;\n for (var j = 0; j < measureChildren.length; j++) {\n if (AltiResponseReader.READERS[measureChildren[j].nodeName]) {\n // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir.\n AltiResponseReader.READERS[measureChildren[j].nodeName](measureChildren[j], measure);\n } else {\n throw new Error(\"Erreur dans la lecture de la réponse du service : measures attendues mais absentes\");\n }\n }\n elevation.measures.push(measure);\n }\n }\n },\n\n /**\n * Lecture d'un noeud \"ExceptionReport\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} exceptionReport - objet contenant l'exception\n * @static\n * @memberof AltiResponseReader\n */\n exceptionreport : function (node) {\n var response = {};\n\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.nodeName === \"Exception\") {\n response.exceptionReport = AltiResponseReader.READERS.exception(child);\n }\n }\n }\n\n return response;\n },\n\n /**\n * Lecture d'un noeud \"Exception\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} exceptionReport - objet contenant l'exception, avec deux attributs :\n * {String} exceptionReport.exceptionCode - qui contient l'identifiant du code de l'exception\n * {String} exceptionReport.exception - qui contient le message de l'exception\n * @static\n * @memberof AltiResponseReader\n */\n exception : function (node) {\n var exceptionReport = {};\n\n // get exception code\n var exceptionCode = node.getAttribute(\"exceptionCode\");\n if (exceptionCode) {\n exceptionReport.exceptionCode = exceptionCode;\n }\n\n // get exception message\n var textNode = node.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n exceptionReport.exception = textNode.nodeValue;\n }\n\n return exceptionReport;\n },\n\n /**\n * Lecture d'un noeud \"Error\" de la réponse xml du service alti.\n *\n * @param {DOMElement} node - noeud à lire pour récupérer l'exception\n * @return {Object} error - objet contenant l'exception\n * @static\n */\n error : function (node) {\n var response = {\n error : {}\n };\n // get error code and description\n if (node.hasChildNodes()) {\n var children = node.childNodes;\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n var textNode;\n // get error code\n if (child.nodeType === 1 && child.nodeName === \"code\") { // 1 === node.ELEMENT_NODE\n textNode = child.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n response.error.code = textNode.nodeValue;\n }\n }\n // get error description\n if (child.nodeType === 1 && child.nodeName === \"description\") { // 1 === node.ELEMENT_NODE\n textNode = child.firstChild;\n if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE\n response.error.description = textNode.nodeValue;\n }\n }\n }\n }\n return response;\n }\n\n};\n\n/**\n * Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique,\n * à l'aide des readers de la classe.\n *\n * @method AltiResponseReader.read\n * @param {DOMElement} root - racine de la réponse XML à lire\n * @static\n * @memberof AltiResponseReader\n */\nAltiResponseReader.read = function (root) {\n if (root.nodeName === \"elevations\") {\n var altiResponse = AltiResponseReader.READERS.elevations(root);\n return altiResponse;\n } else if (root.nodeName === \"ExceptionReport\") {\n var exceptionReport = AltiResponseReader.READERS.exceptionreport(root);\n return exceptionReport;\n } else if (root.nodeName === \"error\") {\n var error = AltiResponseReader.READERS.error(root);\n return error;\n } else {\n throw new Error(\"Erreur lors de la lecture de la réponse : elle n'est pas au format attendu.\");\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiResponseReader);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9Gb3JtYXRzL0FsdGlSZXNwb25zZVJlYWRlci5qcz8xNzViIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUMwRDtBQUNOO0FBQ0o7O0FBRWhEO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsWUFBWSxPQ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VjdH0gZXJyb3IgLSBvYmpldCBjb250ZW5hbnQgbCdleGNlcHRpb25cbiAgICAgKiBAc3RhdGljXG4gICAgICovXG4gICAgZXJyb3IgOiBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICB2YXIgcmVzcG9uc2UgPSB7XG4gICAgICAgICAgICBlcnJvciA6IHt9XG4gICAgICAgIH07XG4gICAgICAgIC8vIGdldCBlcnJvciBjb2RlIGFuZCBkZXNjcmlwdGlvblxuICAgICAgICBpZiAobm9kZS5oYXNDaGlsZE5vZGVzKCkpIHtcbiAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IG5vZGUuY2hpbGROb2RlcztcbiAgICAgICAgICAgIHZhciBjaGlsZDtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjaGlsZCA9IGNoaWxkcmVuW2ldO1xuICAgICAgICAgICAgICAgIHZhciB0ZXh0Tm9kZTtcbiAgICAgICAgICAgICAgICAvLyBnZXQgZXJyb3IgY29kZVxuICAgICAgICAgICAgICAgIGlmIChjaGlsZC5ub2RlVHlwZSA9PT0gMSAmJiBjaGlsZC5ub2RlTmFtZSA9PT0gXCJjb2RlXCIpIHsgLy8gMSA9PT0gbm9kZS5FTEVNRU5UX05PREVcbiAgICAgICAgICAgICAgICAgICAgdGV4dE5vZGUgPSBjaGlsZC5maXJzdENoaWxkO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGV4dE5vZGUgJiYgdGV4dE5vZGUubm9kZVR5cGUgPT09IDMpIHsgLy8gMyA9PT0gbm9kZS5URVhUX05PREVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVycm9yLmNvZGUgPSB0ZXh0Tm9kZS5ub2RlVmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZ2V0IGVycm9yIGRlc2NyaXB0aW9uXG4gICAgICAgICAgICAgICAgaWYgKGNoaWxkLm5vZGVUeXBlID09PSAxICYmIGNoaWxkLm5vZGVOYW1lID09PSBcImRlc2NyaXB0aW9uXCIpIHsgLy8gMSA9PT0gbm9kZS5FTEVNRU5UX05PREVcbiAgICAgICAgICAgICAgICAgICAgdGV4dE5vZGUgPSBjaGlsZC5maXJzdENoaWxkO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGV4dE5vZGUgJiYgdGV4dE5vZGUubm9kZVR5cGUgPT09IDMpIHsgLy8gMyA9PT0gbm9kZS5URVhUX05PREVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVycm9yLmRlc2NyaXB0aW9uID0gdGV4dE5vZGUubm9kZVZhbHVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbn07XG5cbi8qKlxuICogTcOpdGhvZGUgcGVybWV0dGFudCBkZSBsYW5jZXIgbGEgbGVjdHVyZSBkJ3VuZSByw6lwb25zZSBYTUwgZHUgc2VydmljZSBhbHRpbcOpdHJpcXVlLFxuICogICAgICDDoCBsJ2FpZGUgZGVzIHJlYWRlcnMgZGUgbGEgY2xhc3NlLlxuICpcbiAqIEBtZXRob2QgQWx0aVJlc3BvbnNlUmVhZGVyLnJlYWRcbiAqIEBwYXJhbSB7RE9NRWxlbWVudH0gcm9vdCAtIHJhY2luZSBkZSBsYSByw6lwb25zZSBYTUwgw6AgbGlyZVxuICogQHN0YXRpY1xuICogQG1lbWJlcm9mIEFsdGlSZXNwb25zZVJlYWRlclxuICovXG5BbHRpUmVzcG9uc2VSZWFkZXIucmVhZCA9IGZ1bmN0aW9uIChyb290KSB7XG4gICAgaWYgKHJvb3Qubm9kZU5hbWUgPT09IFwiZWxldmF0aW9uc1wiKSB7XG4gICAgICAgIHZhciBhbHRpUmVzcG9uc2UgPSBBbHRpUmVzcG9uc2VSZWFkZXIuUkVBREVSUy5lbGV2YXRpb25zKHJvb3QpO1xuICAgICAgICByZXR1cm4gYWx0aVJlc3BvbnNlO1xuICAgIH0gZWxzZSBpZiAocm9vdC5ub2RlTmFtZSA9PT0gXCJFeGNlcHRpb25SZXBvcnRcIikge1xuICAgICAgICB2YXIgZXhjZXB0aW9uUmVwb3J0ID0gQWx0aVJlc3BvbnNlUmVhZGVyLlJFQURFUlMuZXhjZXB0aW9ucmVwb3J0KHJvb3QpO1xuICAgICAgICByZXR1cm4gZXhjZXB0aW9uUmVwb3J0O1xuICAgIH0gZWxzZSBpZiAocm9vdC5ub2RlTmFtZSA9PT0gXCJlcnJvclwiKSB7XG4gICAgICAgIHZhciBlcnJvciA9IEFsdGlSZXNwb25zZVJlYWRlci5SRUFERVJTLmVycm9yKHJvb3QpO1xuICAgICAgICByZXR1cm4gZXJyb3I7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRXJyZXVyIGxvcnMgZGUgbGEgbGVjdHVyZSBkZSBsYSByw6lwb25zZSA6IGVsbGUgbidlc3QgcGFzIGF1IGZvcm1hdCBhdHRlbmR1LlwiKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUmVzcG9uc2VSZWFkZXI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js ***! + \*******************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AltiRequestREST */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js\");\n/* harmony import */ var _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AltiRequestWPS */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestWPS.js\");\n/**\n * Creation d'une requête en REST ou WPS\n * (Factory)\n *\n * @module AltiRequestFactory\n * @alias Gp.Services.Alti.Request.AltiRequestFactory\n * @private\n */\n\n\n\n\n\nvar AltiRequestFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Alti\n *\n * @example\n * var options = {\n * httpMethod : 'GET', // GET|POST\n * onSuccess : function (response) {},\n * onError : function (error) {},\n * scope : this,\n * positions : [{lon:, lat:}, {lon:, lat:}],\n * outputFormat : 'json' // json|xml\n * sampling : 3,\n * api : 'REST', // REST|WPS\n * zonly : false // false|true\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiRequestFactory\");\n logger.trace([\"AltiRequestFactory::build()\"]);\n\n var request = null;\n\n // on factorise les options par groupe;\n // - global,\n // - param, les params pour les data inputs\n // - wps, les param du service\n // - callback\n\n var settings = {\n // ajout des valeurs par defaut spécifiques au service\n type : options.sampling ? \"Profil\" : \"Elevation\",\n method : options.httpMethod,\n param : {\n positions : null,\n delimiter : null, // FIXME par defaut, on ne le met pas en place car ça fait planter la requête !?\n indent : null, // par defaut\n crs : null, // par defaut\n format : null, // (only to POST)\n sampling : null, // (only use by Profil)\n zonly : null, // (only use by Elevation)\n measures : null // (only use by Elevation)\n }\n };\n\n // surcharge des valeurs obligatoires\n settings.param.positions = options.positions;\n settings.param.format = options.outputFormat;\n settings.param.sampling = options.sampling;\n settings.param.zonly = options.zonly;\n settings.param.measures = options.measures;\n settings.param.resource = options.resource;\n\n // gestion des callback\n var bOnError = !!(options.onError !== null && typeof options.onError === \"function\"); // cast variable to boolean\n var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === \"function\");\n\n var message = null;\n switch (options.api) {\n case \"REST\":\n // FIXME les exceptions ne sont pas 'catchées' sur le constructeur !\n var myReq = new _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__[\"default\"](settings);\n if (!myReq.processRequestString()) {\n message = \"Error in process request (rest) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n request = myReq.requestString;\n break;\n case \"WPS\":\n // ajout des valeurs par defaut spécifiques au service WPS\n settings.wps = {\n service : null, // par defaut\n version : null, // par defaut\n identifier : null, // par defaut\n rawdataoutput : null, // par defaut\n request : null // par defaut\n };\n\n request = _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__[\"default\"].build(settings);\n if (!request) {\n message = \"Error in process request (wps) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n break;\n default:\n message = \"Type of API is not supported by service (REST or WPS) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n\n if (bOnSuccess) {\n options.onSuccess.call(options.scope, request);\n }\n\n return request;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiR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dyb3VwZTtcbiAgICAgICAgLy8gLSBnbG9iYWwsXG4gICAgICAgIC8vIC0gcGFyYW0sIGxlcyBwYXJhbXMgcG91ciBsZXMgZGF0YSBpbnB1dHNcbiAgICAgICAgLy8gLSB3cHMsIGxlcyBwYXJhbSBkdSBzZXJ2aWNlXG4gICAgICAgIC8vIC0gY2FsbGJhY2tcblxuICAgICAgICB2YXIgc2V0dGluZ3MgPSB7XG4gICAgICAgICAgICAvLyBham91dCBkZXMgdmFsZXVycyBwYXIgZGVmYXV0IHNww6ljaWZpcXVlcyBhdSBzZXJ2aWNlXG4gICAgICAgICAgICB0eXBlIDogb3B0aW9ucy5zYW1wbGluZyA/IFwiUHJvZmlsXCIgOiBcIkVsZXZhdGlvblwiLFxuICAgICAgICAgICAgbWV0aG9kIDogb3B0aW9ucy5odHRwTWV0aG9kLFxuICAgICAgICAgICAgcGFyYW0gOiB7XG4gICAgICAgICAgICAgICAgcG9zaXRpb25zIDogbnVsbCxcbiAgICAgICAgICAgICAgICBkZWxpbWl0ZXIgOiBudWxsLCAvLyBGSVhNRSBwYXIgZGVmYXV0LCBvbiBuZSBsZSBtZXQgcGFzIGVuIHBsYWNlIGNhciDDp2EgZmFpdCBwbGFudGVyIGxhIHJlcXXDqnRlICE/XG4gICAgICAgICAgICAgICAgaW5kZW50IDogbnVsbCwgLy8gcGFyIGRlZmF1dFxuICAgICAgICAgICAgICAgIGNycyA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICBmb3JtYXQgOiBudWxsLCAvLyAob25seSB0byBQT1NUKVxuICAgICAgICAgICAgICAgIHNhbXBsaW5nIDogbnVsbCwgLy8gKG9ubHkgdXNlIGJ5IFByb2ZpbClcbiAgICAgICAgICAgICAgICB6b25seSA6IG51bGwsIC8vIChvbmx5IHVzZSBieSBFbGV2YXRpb24pXG4gICAgICAgICAgICAgICAgbWVhc3VyZXMgOiBudWxsIC8vIChvbmx5IHVzZSBieSBFbGV2YXRpb24pXG4gIC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ICAgICAgICAgICB2YXIgbXlSZXEgPSBuZXcgQWx0aVJlcXVlc3RSRVNUKHNldHRpbmdzKTtcbiAgICAgICAgICAgICAgICBpZiAoIW15UmVxLnByb2Nlc3NSZXF1ZXN0U3RyaW5nKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IFwiRXJyb3IgaW4gcHJvY2VzcyByZXF1ZXN0IChyZXN0KSAhXCI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChiT25FcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShtZXNzYWdlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXF1ZXN0ID0gbXlSZXEucmVxdWVzdFN0cmluZztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgXCJXUFNcIjpcbiAgICAgICAgICAgICAgICAvLyBham91dCBkZXMgdmFsZXVycyBwYXIgZGVmYXV0IHNww6ljaWZpcXVlcyBhdSBzZXJ2aWNlIFdQU1xuICAgICAgICAgICAgICAgIHNldHRpbmdzLndwcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgc2VydmljZSA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgdmVyc2lvbiA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgaWRlbnRpZmllciA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgcmF3ZGF0YW91dHB1dCA6IG51bGwsIC8vIHBhciBkZWZhdXRcbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdCA6IG51bGwgLy8gcGFyIGRlZmF1dFxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICByZXF1ZXN0ID0gQWx0aVJlcXVlc3RXUFMuYnVpbGQoc2V0dGluZ3MpO1xuICAgICAgICAgICAgICAgIGlmICghcmVxdWVzdCkge1xuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlID0gXCJFcnJvciBpbiBwcm9jZXNzIHJlcXVlc3QgKHdwcykgIVwiO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYk9uRXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2UobWVzc2FnZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSBcIlR5cGUgb2YgQVBJIGlzIG5vdCBzdXBwb3J0ZWQgYnkgc2VydmljZSAoUkVTVCBvciBXUFMpICFcIjtcbiAgICAgICAgICAgICAgICBpZiAoYk9uRXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShtZXNzYWdlKSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGJPblN1Y2Nlc3MpIHtcbiAgICAgICAgICAgIG9wdGlvbnMub25TdWNjZXNzLmNhbGwob3B0aW9ucy5zY29wZSwgcmVxdWVzdCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVxdWVzdDtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUmVxdWVzdEZhY3Rvcnk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js ***! + \****************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model/AltiElevationRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js\");\n/* harmony import */ var _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model/AltiProfilRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js\");\n/* jshint multistr : true */\n\n\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des requêtes de type REST sur le service altimetrique.\n *\n * @todo Le service Alti n'implemente pas le POST !?\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiRequestREST\n * @param {Object} options - options\n * @param {Object} options.param.positions - tableau de coordonnées lon/lat\n * @param {String} options.param.delimiter - '|'\n * @param {Boolean} options.param.indent - false|true\n * @param {String} options.param.crs - 'CRS:84'\n * @param {String} options.param.sampling - 3\n * @param {String} options.param.resource - 'rge_alti_corse2a_float32_zip_lamb93'\n * @param {Boolean} options.param.zonly - false|true\n * @param {Boolean} options.param.measures - false|true\n * @param {String} options.param.format - \"JSON|XML\"\n * @param {String} options.type - \"Profil|Elevation\"\n * @param {String} options.method - GET|POST\n *\n * @example\n * var options = {\n * type : 'Profil', // Elevation\n * method : 'GET', // par defaut\n * param : {\n * positions : [\n * {lon:'1.11', lat:'1.11'},\n * {lon:'1.10', lat:'1.10'},\n * {lon:'1.12', lat:'1.12'}\n * ],\n * delimiter : \";\", // par defaut\n * indent : true, // par defaut\n * crs : 'EPSG:4326', // par defaut\n * format : 'json', // par defaut (only to POST)\n * sampling : 3 , // par defaut (only use by Profil)\n * zonly : false // par defaut (only use by Elevation)\n * measures : false // par defaut (only use by Elevation)\n * }\n * };\n *\n * var result;\n * try {\n * var obj = new AltiRequestREST (options);\n * if (! obj.processRequestString ()) {\n * throw new Error(\"Request empty !?\")\n * }\n * result = obj.requestString;\n * } catch (e) {\n * // exceptions...\n * }\n * @private\n */\nfunction AltiRequestREST (options) {\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiRequestREST\");\n this.logger.trace(\"[Constructeur AltiRequestREST ()]\");\n\n if (!(this instanceof AltiRequestREST)) {\n throw new TypeError(\"AltiRequestREST constructor cannot be called as a function.\");\n }\n\n this.options = options || {};\n\n // existance des options\n if (!this.options) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"options\"));\n }\n\n // type de requete : Altitude ou Profil\n // (param. à determiner en fonction des parametres d'entrée)\n if (!this.options.type) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"type (Elevation or Profil)\"));\n }\n\n // construction du modele de requête\n // (test du type d'objet candidat)\n this.DataObject = null;\n switch (this.options.type) {\n case \"Elevation\":\n this.DataObject = new _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.options.param);\n break;\n case \"Profil\":\n this.DataObject = new _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.options.param);\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"type (Elevation or Profil)\"));\n }\n\n /**\n * methode.\n * Par defaut, \"GET\".\n */\n this.method = this.options.method || \"GET\";\n}\n\nAltiRequestREST.prototype = {\n\n /**\n * request\n * @type {String}\n */\n requestString : null,\n\n /**\n * Constructeur (alias)\n */\n constructor : AltiRequestREST,\n\n /**\n * Template de la requête.\n */\n template : {\n get : {\n // FIXME on retire le param 'delimiter' : &delimiter='__DELIMITER__'\n value : \"lon=__LON__&lat=__LAT__&indent=__INDENT__&crs='__CRS__'&resource=__RESOURCE__&measures=__MEASURES__\",\n input : {\n point : \"&zonly=__ZONLY__\",\n profil : \"&sampling=__SAMPLING__\"\n }\n },\n post : {\n // FIXME on retire le param 'delimiter' : delimiter='__DELIMITER__'\\n\\\n value : \"lon=__LON__\\n\" +\n \"lat=__LAT__\\n\" +\n \"indent=__INDENT__\\n\" +\n \"crs='__CRS__'\\n\" +\n \"resource='__RESOURCE__'\\n\" +\n \"measures='__MEASURES__'\\n\",\n input : {\n point : \"zonly=__ZONLY__\\n\",\n profil : \"sampling=__SAMPLING__\"\n }\n }\n },\n\n /**\n * Construction de la requête.\n *\n * @example\n * // GET out : lon=0.2367,2.1570&lat=48.0551,46.6077&delimiter=,&indent=true&zonly=true&crs='CRS:84'\n * // POST out : Not yet supported method POST !\n * @returns {String}\n */\n processRequestString : function () {\n this.logger.trace(\"AltiRequestREST::processRequestString ()\");\n\n var template = \"\";\n if (this.method === \"POST\") {\n template = this.template.post.value;\n } else if (this.method === \"GET\") {\n template = this.template.get.value;\n }\n\n template = template.replace(/__LON__/g, this.DataObject.getLon());\n template = template.replace(/__LAT__/g, this.DataObject.getLat());\n // FIXME on retire le param 'delimiter'\n // template = template.replace(/__DELIMITER__/g, this.DataObject.delimiter);\n template = template.replace(/__INDENT__/g, this.DataObject.indent);\n template = template.replace(/__CRS__/g, this.DataObject.crs);\n template = template.replace(/__RESOURCE__/g, this.DataObject.resource);\n template = template.replace(/__MEASURES__/g, this.DataObject.measures);\n\n // ajout +\n template = template + this.__addDataInputs();\n this.logger.trace(\"traduction tmpl\", template);\n\n // sauvegarde\n this.requestString = template;\n\n return this.requestString;\n },\n\n /**\n * Ajout de parametres spécifiques (ex. zonly)\n *\n * @returns {String}\n */\n __addDataInputs : function () {\n this.logger.trace(\"AltiRequestREST::addDataInput ()\");\n\n var myTemplate;\n if (this.method === \"POST\") {\n myTemplate = this.template.post;\n } else if (this.method === \"GET\") {\n myTemplate = this.template.get;\n } else {\n throw new Error(\"No other HTTP method supported by the service !\");\n }\n\n var tmpl = null;\n if (this.DataObject.CLASSNAME === \"AltiElevationRequest\") {\n tmpl = myTemplate.input.point;\n return tmpl.replace(/__ZONLY__/g, this.DataObject.zonly.toString());\n } else if (this.DataObject.CLASSNAME === \"AltiProfilRequest\") {\n tmpl = myTemplate.input.profil;\n return tmpl.replace(/__SAMPLING__/g, this.DataObject.sampling);\n } else {\n throw new Error(\"No other object supported than elevation or profil !?\");\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequestREST);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L0FsdGlSZXF1ZXN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yYW0ge1N0cmluZ30gICBvcHRpb25zLnBhcmFtLnJlc291cmNlIC0gJ3JnZV9hbHRpX2NvcnNlMmFfZmxvYXQzMl96aXBfbGFtYjkzJ1xuICogQHBhcmFtIHtCb29sZWFufSAgb3B0aW9ucy5wYXJhbS56b25seSAtIGZhbHNlfHRydWVcbiAqIEBwYXJhbSB7Qm9vbGVhbn0gIG9wdGlvbnMucGFyYW0ubWVhc3VyZXMgLSBmYWxzZXx0cnVlXG4gKiBAcGFyYW0ge1N0cmluZ30gICBvcHRpb25zLnBhcmFtLmZvcm1hdCAtIFwiSlNPTnxYTUxcIlxuICogQHBhcmFtIHtTdHJpbmd9ICAgb3B0aW9ucy50eXBlIC0gXCJQcm9maWx8RWxldmF0aW9uXCJcbiAqIEBwYXJhbSB7U3RyaW5nfSAgIG9wdGlvbnMubWV0aG9kIC0gR0VUfFBPU1RcbiAqXG4gKiBAZXhhbXBsZVxuICogICAgICB2YXIgb3B0aW9ucyA9IHtcbiAqICAgICAgICAgICB0eXBlIDogJ1Byb2ZpbCcsIC8vIEVsZXZhdGlvblxuICogICAgICAgICAgIG1ldGhvZCA6ICdHRVQnLCAgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgIHBhcmFtIDoge1xuICogICAgICAgICAgICAgICBwb3NpdGlvbnMgOiBbXG4gKiAgICAgICAgICAgICAgICAgICB7bG9uOicxLjExJywgbGF0OicxLjExJ30sXG4gKiAgICAgICAgICAgICAgICAgICB7bG9uOicxLjEwJywgbGF0OicxLjEwJ30sXG4gKiAgICAgICAgICAgICAgICAgICB7bG9uOicxLjEyJywgbGF0OicxLjEyJ31cbiAqICAgICAgICAgICAgICAgXSxcbiAqICAgICAgICAgICAgICAgZGVsaW1pdGVyIDogXCI7XCIsICAgICAgICAgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgICAgICBpbmRlbnQgICAgOiB0cnVlLCAgICAgICAgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgICAgICBjcnMgICAgICAgOiAnRVBTRzo0MzI2JywgLy8gcGFyIGRlZmF1dFxuICogICAgICAgICAgICAgICBmb3JtYXQgICAgOiAnanNvbicsICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB0byBQT1NUKVxuICogICAgICAgICAgICAgICBzYW1wbGluZyAgOiAzICwgICAgICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB1c2UgYnkgUHJvZmlsKVxuICogICAgICAgICAgICAgICB6b25seSAgICAgOiBmYWxzZSAgICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB1c2UgYnkgRWxldmF0aW9uKVxuICogICAgICAgICAgICAgICBtZWFzdXJlcyAgOiBmYWxzZSAgICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB1c2UgYnkgRWxldmF0aW9uKVxuICogICAgICAgICAgIH1cbiAqICAgICAgfTtcbiAqXG4gKiAgICAgIHZhciByZXN1bHQ7XG4gKiAgICAgIHRyeSB7XG4gKiAgICAgICAgICB2YXIgb2JqID0gbmV3IEFsdGlSZXF1ZXN0UkVTVCAob3B0aW9ucyk7XG4gKiAgICAgICAgICBpZiAoISBvYmoucHJvY2Vzc1JlcXVlc3RTdHJpbmcgKCkpIHtcbiAqICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJSZXF1ZXN0IGVtcHR5ICE/XCIpXG4gKiAgICAgICAgICB9XG4gKiAgICAgICAgICByZXN1bHQgPSBvYmoucmVxdWVzdFN0cmluZztcbiAqICAgICAgfSBjYXRjaCAoZSkge1xuICogICAgICAgICAgLy8gZXhjZXB0aW9ucy4uLlxuICogICAgICB9XG4gKiBAcHJpdmF0ZVxuICovXG5mdW5jdGlvbiBBbHRpUmVxdWVzdFJFU1QgKG9wdGlvbnMpIHtcbiAgICB0aGlzLmxvZ2dlciA9IExvZ2dlci5nZXRMb2dnZXIoXCJBbHRpUmVxdWVzdFJFU1RcIik7XG4gICAgdGhpcy5sb2dnZXIudHJhY2UoXCJbQ29uc3RydWN0ZXVyIEFsdGlSZXF1ZX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F9fJmNycz0nX19DUlNfXycmcmVzb3VyY2U9X19SRVNPVVJDRV9fJm1lYXN1cmVzPV9fTUVBU1VSRVNfX1wiLFxuICAgICAgICAgICAgaW5wdXQgOiB7XG4gICAgICAgICAgICAgICAgcG9pbnQgOiBcIiZ6b25seT1fX1pPTkxZX19cIixcbiAgICAgICAgICAgICAgICBwcm9maWwgOiBcIiZzYW1wbGluZz1fX1NBTVBMSU5HX19cIlxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBwb3N0IDoge1xuICAgICAgICAgICAgLy8gRklYTUUgb24gcmV0aXJlIGxlIHBhcmFtICdkZWxpbWl0ZXInIDogZGVsaW1pdGVyPSdfX0RFTElNSVRFUl9fJ1xcblxcXG4gICAgICAgICAgICB2YWx1ZSA6IFwibG9uPV9fTE9OX19cXG5cIiArXG4gICAgICAgICAgICAgICAgXCJsYXQ9X19MQVRfX1xcblwiICtcbiAgICAgICAgICAgICAgICBcImluZGVudD1fX0lOREVOVF9fXFxuXCIgK1xuICAgICAgICAgICAgICAgIFwiY3JzPSdfX0NSU19fJ1xcblwiICtcbiAgICAgICAgICAgICAgICBcInJlc291cmNlPSdfX1JFU09VUkNFX18nXFxuXCIgK1xuICAgICAgICAgICAgICAgIFwibWVhc3VyZXM9J19fTUVBU1VSRVNfXydcXG5cIixcbiAgICAgICAgICAgIGlucHV0IDoge1xuICAgICAgICAgICAgICAgIHBvaW50IDogXCJ6b25seT1fX1pPTkxZX19cXG5cIixcbiAgICAgICAgICAgICAgICBwcm9maWwgOiBcInNhbXBsaW5nPV9fU0FNUExJTkdfX1wiXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogQ29uc3RydWN0aW9uIGRlIGxhIHJlcXXDqnRlLlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiAvLyBHRVQgIG91dCA6IGxvbj0wLjIzNjcsMi4xNTcwJmxhdD00OC4wNTUxLDQ2LjY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iJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestREST.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestWPS.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestWPS.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Formats_WPS__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Formats/WPS */ \"./node_modules/geoportal-access-lib/src/Formats/WPS.js\");\n/* harmony import */ var _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model/AltiElevationRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js\");\n/* harmony import */ var _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./model/AltiProfilRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js\");\n/**\n * Classe d'interface des requêtes de type WPS sur le service altimetrique.\n * (Factory)\n *\n * @module Gp.Services.Alti.Request.AltiRequestWPS\n * @alias Gp.Services.Alti.Request.AltiRequestWPS\n * @private\n */\n\n\n\n\n\n\nvar AltiRequestWPS = {\n\n /**\n * Interface unique de construction de la requête.\n *\n * @method build\n * @param {Object} options - options\n * @param {Object} options.param.positions - tableau de coordonnées lon/lat\n * @param {String} options.param.delimiter - '|'\n * @param {Boolean} options.param.indent - false|true\n * @param {String} options.param.crs - 'CRS:84'\n * @param {String} options.param.sampling - 3\n * @param {Boolean} options.param.zonly - false|true\n * @param {String} options.param.format - \"JSON|XML\" (only to POST)\n * @param {String} options.wps.service - \"WPS\"\n * @param {String} options.wps.version - \"1.0.0\"\n * @param {String} options.wps.identifier - \"gs:WPSElevation|gs:WPSLineElevation\"\n * @param {String} options.wps.rawdataoutput - \"result\"\n * @param {String} options.wps.request - \"Execute\"\n * @param {String} options.type - \"Profil|Elevation\"\n * @param {String} options.method - GET|POST\n * @example\n * var options = {\n * type : 'Profil', // Elevation\n * method : 'GET', // par defaut\n * param : {\n * positions : [\n * {lon:'1.11', lat:'1.11'},\n * {lon:'1.10', lat:'1.10'},\n * {lon:'1.12', lat:'1.12'}\n * ],\n * delimiter : \";\", // par defaut\n * indent : true, // par defaut\n * crs : 'EPSG:4326', // par defaut\n * format : 'json', // par defaut (only to POST)\n * sampling : 3 , // par defaut (only use by Profil)\n * zonly : false, // par defaut (only use by Elevation)\n * },\n * wps : {\n * service : 'WPS', // par defaut\n * version : '1.0.0', // par defaut\n * identifier : 'gs:WPS', // par defaut, Elevation = gs:WPSElevation, Profil = gs:WPSLineElevation\n * rawdataoutput : 'result',// par defaut\n * request : 'Execute' // par defaut\n * }\n * };\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiRequestWPS\");\n logger.trace([\"AltiRequestWPS::build()\"]);\n\n // existance des options\n if (!options) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"options\"));\n }\n\n // type de requete : Altitude ou Profil\n // (param. à determiner en fonction des parametres d'entrée)\n if (!options.type) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"type (Elevation or Profil)\"));\n }\n\n // construction du modele de requête\n // (test du type d'objet candidat)\n var DataObject = null;\n switch (options.type) {\n case \"Elevation\":\n // surcharge\n options.wps.identifier = \"gs:WPSElevation\";\n DataObject = new _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_3__[\"default\"](options.param);\n break;\n case \"Profil\":\n // surcharge\n options.wps.identifier = \"gs:WPSLineElevation\";\n DataObject = new _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_4__[\"default\"](options.param);\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"type (Elevation or Profil)\"));\n }\n\n // construction de la requête WPS\n var settings = {\n data : DataObject,\n method : options.method,\n param : options.wps\n };\n\n var rqstWPS = new _Formats_WPS__WEBPACK_IMPORTED_MODULE_2__[\"default\"](settings);\n\n if (!rqstWPS.processRequestString()) {\n throw new Error(\"Enable to process request !\");\n }\n\n return rqstWPS.requestString;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequestWPS);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L0FsdGlSZXF1ZXN0V1BTLmpzPzQzNzAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNvRDtBQUNIO0FBQ1Y7QUFDeUI7QUFDTjs7QUFFMUQ7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPO0FBQ3RCLGVBQW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XRob2QgLSBHRVR8UE9TVFxuICAgICAqIEBleGFtcGxlXG4gICAgICogICAgICB2YXIgb3B0aW9ucyA9IHtcbiAgICAgKiAgICAgICAgICAgdHlwZSA6ICdQcm9maWwnLCAvLyBFbGV2YXRpb25cbiAgICAgKiAgICAgICAgICAgbWV0aG9kIDogJ0dFVCcsICAvLyBwYXIgZGVmYXV0XG4gICAgICogICAgICAgICAgIHBhcmFtIDoge1xuICAgICAqICAgICAgICAgICAgICAgcG9zaXRpb25zIDogW1xuICAgICAqICAgICAgICAgICAgICAgICAgIHtsb246JzEuMTEnLCBsYXQ6JzEuMTEnfSxcbiAgICAgKiAgICAgICAgICAgICAgICAgICB7bG9uOicxLjEwJywgbGF0OicxLjEwJ30sXG4gICAgICogICAgICAgICAgICAgICAgICAge2xvbjonMS4xMicsIGxhdDonMS4xMid9XG4gICAgICogICAgICAgICAgICAgICBdLFxuICAgICAqICAgICAgICAgICAgICAgZGVsaW1pdGVyIDogXCI7XCIsICAgICAgICAgLy8gcGFyIGRlZmF1dFxuICAgICAqICAgICAgICAgICAgICAgaW5kZW50ICAgIDogdHJ1ZSwgICAgICAgIC8vIHBhciBkZWZhdXRcbiAgICAgKiAgICAgICAgICAgICAgIGNycyAgICAgICA6ICdFUFNHOjQzMjYnLCAvLyBwYXIgZGVmYXV0XG4gICAgICogICAgICAgICAgICAgICBmb3JtYXQgICAgOiAnanNvbicsICAgICAgLy8gcGFyIGRlZmF1dCAob25seSB0byBQT1NUKVxuICAgICAqICAgICAgICAgICAgICAgc2FtcGxpbmcgIDogMyAsICAgICAgICAgIC8vIHBhciBkZWZhdXQgKG9ubHkgdXNlIGJ5IFByb2ZpbClcbiAgICAgKiAgICAgICAgICAgICAgIHpvbmx5ICAgICA6IGZhbHNlLCAgICAgICAvLyBwYXIgZGVmYXV0IChvbmx5IHVzZSBieSBFbGV2YXRpb24pXG4gICAgICogICAgICAgICAgIH0sXG4gICAgICogICAgICAgICAgIHdwcyA6IHtcbiAgICAgKiAg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2VudHLDqWUpXG4gICAgICAgIGlmICghb3B0aW9ucy50eXBlKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXy5nZXRNZXNzYWdlKFwiUEFSQU1fRU1QVFlcIiwgXCJ0eXBlIChFbGV2YXRpb24gb3IgUHJvZmlsKVwiKSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBjb25zdHJ1Y3Rpb24gZHUgbW9kZWxlIGRlIHJlcXXDqnRlXG4gICAgICAgIC8vICh0ZXN0IGR1IHR5cGUgZCdvYmpldCBjYW5kaWRhdClcbiAgICAgICAgdmFyIERhdGFPYmplY3QgPSBudWxsO1xuICAgICAgICBzd2l0Y2ggKG9wdGlvbnMudHlwZSkge1xuICAgICAgICAgICAgY2FzZSBcIkVsZXZhdGlvblwiOlxuICAgICAgICAgICAgICAgIC8vIHN1cmNoYXJnZVxuICAgICAgICAgICAgICAgIG9wdGlvbnMud3BzLmlkZW50aWZpZXIgPSBcImdzOldQU0VsZXZhdGlvblwiO1xuICAgICAgICAgICAgICAgIERhdGFPYmplY3QgPSBuZXcgQWx0aUVsZXZhdGlvblJlcXVlc3Qob3B0aW9ucy5wYXJhbSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFwiUHJvZmlsXCI6XG4gICAgICAgICAgICAgICAgLy8gc3VyY2hhcmdlXG4gICAgICAgICAgICAgICAgb3B0aW9ucy53cHMuaWRlbnRpZmllciA9IFwiZ3M6V1BTTGluZUVsZXZhdGlvblwiO1xuICAgICAgICAgICAgICAgIERhdGFPYmplY3QgPSBuZXcgQWx0aVByb2ZpbFJlcXVlc3Qob3B0aW9ucy5wYXJhbSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihfLmdldE1lc3NhZ2UoXCJQQVJBTV9UWVBFXCIsIFwidHlwZSAoRWxldmF0aW9uIG9yIFByb2ZpbClcIikpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gY29uc3RydWN0aW9uIGRlIGxhIHJlcXXDqnRlIFdQU1xuICAgICAgICB2YXIgc2V0dGluZ3MgPSB7XG4gICAgICAgICAgICBkYXRhIDogRGF0YU9iamVjdCxcbiAgICAgICAgICAgIG1ldGhvZCA6IG9wdGlvbnMubWV0aG9kLFxuICAgICAgICAgICAgcGFyYW0gOiBvcHRpb25zLndwc1xuICAgICAgICB9O1xuXG4gICAgICAgIHZhciBycXN0V1BTID0gbmV3IFdQUyhzZXR0aW5ncyk7XG5cbiAgICAgICAgaWYgKCFycXN0V1BTLnByb2Nlc3NSZXF1ZXN0U3RyaW5nKCkpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVuYWJsZSB0byBwcm9jZXNzIHJlcXVlc3QgIVwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBycXN0V1BTLnJlcXVlc3RTdHJpbmc7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQWx0aVJlcXVlc3RXUFM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/AltiRequestWPS.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js": +/*!***************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js ***! + \***************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AltiRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\");\n\n\n\n\n/**\n * @classdesc\n *\n * Classe de gestion des param. des requêtes de type POINT du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiElevationRequest\n * @param {Object} options - options\n * @param {Boolean} options.zonly - false|true\n *\n * @private\n */\nfunction AltiElevationRequest (options) {\n if (!(this instanceof AltiElevationRequest)) {\n throw new TypeError(\"AltiElevationRequest constructor cannot be called as a function.\");\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"AltiElevationRequest\";\n\n // appel du constructeur par heritage\n _AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiElevationRequest ()]\");\n\n /**\n * Z uniquement.\n * true|false\n */\n this.zonly = this.options.zonly || false; // test des options héritées !\n}\n\n/**\n * @lends module:AltiElevationRequest#\n */\n\nAltiElevationRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].prototype, {\n\n /**\n * Setter/getter pour \"zonly\"\n */\n zonly : {\n /** getter */\n get : function () {\n return this._zonly;\n },\n /** setter */\n set : function (z) {\n this._zonly = z;\n }\n }\n\n});\n\n/**\n * Constructeur (alias)\n */\nAltiElevationRequest.prototype.constructor = AltiElevationRequest;\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Array}\n */\nAltiElevationRequest.prototype.getData = function () {\n // par glop..., appel de AltiRequest::getData () !\n var map = [];\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n // map.push({k : \"delimiter\", v : this.delimiter}); // FIXME on retire le param \"delimiter\"\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"zonly\",\n v : this.zonly\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n map.push({\n k : \"resource\",\n v : this.resource\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiElevationRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlFbGV2YXRpb25SZXF1ZXN0LmpzPzNkM2YiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUN1RDtBQUNmOztBQUV4QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxJQUFJLG9EQUFXOztBQUVmLGtCQUFrQiw4REFBTTtBQUN4Qjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDZDQUE2QztBQUM3Qzs7QUFFQTtBQUNBO0FBQ0E7O0FBRUEsK0NBQStDLG9EQUFXOztBQUUxRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLENBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTCxpQkFBaUIsb0NBQW9DLEVBQUU7QU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H0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiem9ubHlcIixcbiAgICAgICAgdiA6IHRoaXMuem9ubHlcbiAgICB9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcImZvcm1hdFwiLFxuICAgICAgICB2IDogdGhpcy5mb3JtYXRcbiAgICB9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcInJlc291cmNlXCIsXG4gICAgICAgIHYgOiB0aGlzLnJlc291cmNlXG4gICAgfSk7XG5cbiAgICByZXR1cm4gbWFwO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQWx0aUVsZXZhdGlvblJlcXVlc3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiElevationRequest.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js ***! + \************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AltiRequest */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\");\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes de type PROFIL du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiProfilRequest\n * @param {Object} options - options\n * @param {String} options.sampling - 3\n *\n * @private\n */\nfunction AltiProfilRequest (options) {\n if (!(this instanceof AltiProfilRequest)) {\n throw new TypeError(\"AltiProfilRequest constructor cannot be called as a function.\");\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"AltiProfilRequest\";\n\n // appel du constructeur par heritage\n _AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiProfilRequest ()]\");\n\n /**\n * Sampling\n * Par defaut, 3\n */\n this.sampling = this.options.sampling || 3; // test des options héritées !\n}\n\n/**\n * @lends module:AltiProfilRequest#\n */\n\nAltiProfilRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__[\"default\"].prototype, {\n\n /**\n * Setter/getter pour \"sampling\"\n */\n sampling : {\n /** getter */\n get : function () {\n return this._sampling;\n },\n /** setter */\n set : function (value) {\n this._sampling = value;\n }\n }\n});\n\n/**\n * Constructeur (alias)\n */\nAltiProfilRequest.prototype.constructor = AltiProfilRequest;\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Object[]}\n */\nAltiProfilRequest.prototype.getData = function () {\n // par glop..., appel de AltiRequest::getData () !\n var map = [];\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n // map.push({k : \"delimiter\", v : this.delimiter}); // FIXME on retire le param \"delimiter\"\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"sampling\",\n v : this.sampling\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n map.push({\n k : \"resource\",\n v : this.resource\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiProfilRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Hc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FwicmVzb3VyY2VcIixcbiAgICAgICAgdiA6IHRoaXMucmVzb3VyY2VcbiAgICB9KTtcblxuICAgIHJldHVybiBtYXA7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUHJvZmlsUmVxdWVzdDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiProfilRequest.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js ***! + \******************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes du service altimetrique.\n *\n * @constructor\n * @alias Gp.Services.Alti.Request.AltiRequest\n * @param {Object} options - options\n * @param {Object} options.positions - tableau de coordonnées lon/lat\n * @param {String} options.delimiter - \"|\"\n * @param {Boolean} options.indent - false|true\n * @param {String} options.crs - \"CRS:84\"\n * @param {String} options.format - \"JSON|XML\"\n *\n * @private\n */\nfunction AltiRequest (options) {\n if (!(this instanceof AltiRequest)) {\n throw new TypeError(\"AltiRequest constructor cannot be called as a function.\");\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur AltiRequest ()]\");\n\n /**\n * Options en paramêtres du constructeur.\n */\n this.options = options || {};\n\n /**\n * Liste des coordonnées.\n * @example\n * var c = [{lon : \"\", lat : \"\"}, {lon : \"\", lat : \"\"}];\n */\n this.positions = this.options.positions || [];\n\n /**\n * Caractère de séparation.\n * Par defaut, \"|\".\n */\n this.delimiter = this.options.delimiter || \"|\";\n\n /**\n * Indentation.\n * true|false\n */\n this.indent = this.options.indent || false;\n\n /**\n * Projection.\n * Par defaut, CRS:84.\n */\n this.crs = this.options.crs || \"CRS:84\";\n\n /**\n * format de sortie.\n * Par defaut, \"json\".\n */\n this.format = this.options.format || \"json\";\n\n /*\n * Ressource utilisée\n */\n this.resource = this.options.resource;\n\n /**\n * Réponse détaillée (source & accuracy)\n * true|false\n */\n this.measures = this.options.measures || false;\n}\n\n/**\n * CLASSNAME\n */\nAltiRequest.CLASSNAME = \"AltiRequest\";\n\nAltiRequest.prototype = {\n\n /**\n * @lends module:AltiRequest#\n */\n\n /**\n * Constructeur (alias)\n */\n constructor : AltiRequest,\n\n /**\n * Ajout d\"une liste de coordonnées.\n *\n * @param {Object[]} lstPosition - liste de positions\n * @example\n * obj.setPositions ([{lon : \"0.15\", lat : \"0.15\"}, {lon : \"1.15\", lat : \"1.15\"}]);\n */\n setPositions : function (lstPosition) {\n var positions = [];\n for (var i = 0; i < lstPosition.length; i++) {\n var o = lstPosition[i];\n if (o.lon && o.lat) {\n positions.push(o);\n }\n }\n\n this.positions = positions;\n },\n\n /**\n * Liste des coordonnées.\n *\n * @param {Int} pos - position\n * @returns {positions}\n * @example\n * obj.getPositions (); // [{lon : \"\", lat : \"\"}, {lon : \"\", lat : \"\"}]\n * obj.getPositions (0); // [{lon : \"\", lat : \"\"}]\n */\n getPositions : function (pos) {\n // FIXME test if not a number !?\n if (!pos) {\n return this.positions;\n }\n\n var index = this.positions.length - 1;\n if (pos > index || pos < index) {\n this.logger.warn(\"index out of range !\");\n return this.positions;\n }\n\n return this.positions[pos];\n },\n\n /**\n * Ajout d\"une liste de coordonnées.\n *\n * @param {Object[]} lstPosition - liste de positions\n * @example\n * obj.addPositions ([{lon : \"0.15\", lat : \"0.15\"}, {lon : \"1.15\", lat : \"1.15\"}]);\n */\n addPositions : function (lstPosition) {\n for (var i = 0; i < lstPosition.length; i++) {\n var o = lstPosition[i];\n if (o.lon && o.lat) {\n this.positions.push(lstPosition[i]);\n }\n }\n },\n\n /**\n * Retourne la liste des longitudes avec un caractère de séparation.\n *\n * @returns {String} - une liste de longitudes\n * @example\n * // out : 0.2367|2.1570|43.789|...\n */\n getLon : function () {\n var lstLon = [];\n for (var i = 0; i < this.positions.length; i++) {\n lstLon.push(this.positions[i].lon);\n }\n this.logger.trace(lstLon);\n return lstLon.join(this.delimiter);\n },\n\n /**\n * Retourne la liste des lattitudes avec un caractère de séparation.\n *\n * @returns {String} - une liste de lattitudes\n * @example\n * // out : 0.2367|2.1570|43.789|...\n */\n getLat : function () {\n var lstLat = [];\n for (var i = 0; i < this.positions.length; i++) {\n lstLat.push(this.positions[i].lat);\n }\n this.logger.trace(lstLat);\n return lstLat.join(this.delimiter);\n }\n\n};\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Object[]}\n */\nAltiRequest.prototype.getData = function () {\n var map = [];\n\n map.push({\n k : \"lon\",\n v : this.getLon()\n });\n map.push({\n k : \"lat\",\n v : this.getLat()\n });\n map.push({\n k : \"delimiter\",\n v : this.delimiter\n });\n map.push({\n k : \"indent\",\n v : this.indent\n });\n map.push({\n k : \"crs\",\n v : this.crs\n });\n map.push({\n k : \"format\",\n v : this.format\n });\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXF1ZXN0L21vZGVsL0FsdGlSZXF1ZXN0LmpzPzAyMmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ3VEOztBQUV2RDtBQUNBO0FBQ0E7QUFDQTtB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9uKClcbiAgICB9KTtcbiAgICBtYXAucHVzaCh7XG4gICAgICAgIGsgOiBcImxhdFwiLFxuICAgICAgICB2IDogdGhpcy5nZXRMYXQoKVxuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiZGVsaW1pdGVyXCIsXG4gICAgICAgIHYgOiB0aGlzLmRlbGltaXRlclxuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiaW5kZW50XCIsXG4gICAgICAgIHYgOiB0aGlzLmluZGVudFxuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiY3JzXCIsXG4gICAgICAgIHYgOiB0aGlzLmNyc1xuICAgIH0pO1xuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiZm9ybWF0XCIsXG4gICAgICAgIHYgOiB0aGlzLmZvcm1hdFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIG1hcDtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFsdGlSZXF1ZXN0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Request/model/AltiRequest.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js ***! + \*********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _Formats_XML__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../Formats/XML */ \"./node_modules/geoportal-access-lib/src/Formats/XML.js\");\n/* harmony import */ var _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Formats/AltiResponseReader */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Formats/AltiResponseReader.js\");\n/* harmony import */ var _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./model/AltiResponse */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\");\n/* harmony import */ var _model_Elevation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model/Elevation */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\");\n/**\n * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON\n * (Factory)\n *\n * @module AltiResponseFactory\n * @private\n * @alias Gp.Services.Alti.Response.AltiResponseFactory\n */\n\n\n\n\n\n\n\n\nvar AltiResponseFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Alti\n *\n * @example\n * var options = {\n * response :\n * outputFormat :\n * rawResponse :\n * scope :\n * onSuccess :\n * onError :\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AltiResponseFactory\");\n logger.trace([\"AltiResponseFactory::build()\"]);\n\n var data = null;\n\n if (options.response) {\n if (options.rawResponse) {\n logger.trace(\"analyze response : raw\");\n data = options.response;\n } else {\n switch (options.outputFormat) {\n case \"xml\":\n logger.trace(\"analyze response : xml\");\n\n try {\n var p = new _Formats_XML__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n reader : _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n });\n\n if (typeof options.response === \"string\") {\n p.setXMLString(options.response);\n } else {\n p.setXMLDoc(options.response);\n }\n\n data = p.parse();\n\n if (!data) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION_2\"));\n }\n } catch (e) {\n var message = e.message;\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", message),\n status : 200,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR\n }));\n return;\n }\n\n break;\n\n case \"json\":\n logger.trace(\"analyze response : json\");\n logger.trace(\"analyze response : \", typeof options.response);\n\n var JSONResponse = null;\n if (typeof options.response === \"string\") {\n JSONResponse = JSON.parse(options.response);\n } else {\n JSONResponse = options.response;\n }\n\n // le service renvoie t il une erreur ?\n if (JSONResponse && JSONResponse.error) {\n // ex. {\"error\": {\"code\": \"BAD_PARAMETER\",\"description\": \"The values () cannot be parsed as a valid longitude (double value such as -180 < lat < 180).\"}}\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", JSONResponse.error.description),\n status : 200,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR\n }));\n return;\n }\n\n // analyse de la reponse\n if (JSONResponse) {\n var elevations = JSONResponse.elevations;\n var altiResponse = new _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n var elevation;\n if (Array.isArray(elevations) && elevations.length) {\n for (var i = 0; i < elevations.length; i++) {\n elevation = new _model_Elevation__WEBPACK_IMPORTED_MODULE_6__[\"default\"]();\n\n if (typeof elevations[i] === \"object\") {\n // elevations[i] est un objet elevation\n if (elevations[i].lon) {\n elevation.lon = elevations[i].lon;\n }\n if (elevations[i].lat) {\n elevation.lat = elevations[i].lat;\n }\n if (elevations[i].z) {\n elevation.z = elevations[i].z;\n }\n if (elevations[i].acc) {\n elevation.acc = elevations[i].acc;\n }\n if (elevations[i].measures) {\n elevation.measures = elevations[i].measures;\n }\n } else if (typeof elevations[i] === \"number\") {\n // elevations[i] est un nombre, dans le cas de zonly=true notamment\n elevation.z = elevations[i];\n }\n\n if (Array.isArray(altiResponse.elevations)) {\n altiResponse.elevations.push(elevation);\n }\n }\n }\n data = altiResponse;\n }\n\n if (!data) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE_2\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n break;\n\n default:\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_FORMAT_2\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n\n // Si la réponse contenait une exception renvoyée par le service\n if (data.exceptionReport) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", data.exceptionReport),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n } else if (data.error) {\n var errorMess = data.error.description;\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", errorMess),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n }\n }\n } else {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n return;\n }\n\n options.onSuccess.call(options.scope, data);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiResponseFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXNwb25zZS9BbHRpUmVzcG9uc2VGYWN0b3J5LmpzP2QwZWYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDb0Q7QUFDQTtBQUNRO0FBQ3JCO0FBQ3dCO0FBQ2Y7QUFDTjs7QUFFMUM7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsT0FBTztBQUN0QjtB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AgICAgKiAgIH07XG4gICAgICpcbiAgICAgKi9cbiAgICBidWlsZCA6IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgIC8vIGxvZ2dlclxuICAgICAgICB2YXIgbG9nZ2VyID0gTG9nZ2VyLmdldExvZ2dlcihcIkFsdGlSZXNwb25zZUZhY3RvcnlcIik7XG4gICAgICAgIGxvZ2dlci50cmFjZShbXCJBbHRpUmVzcG9uc2VGYWN0b3J5OjpidWlsZCgpXCJdKTtcblxuICAgICAgICB2YXIgZGF0YSA9IG51bGw7XG5cbiAgICAgICAgaWYgKG9wdGlvbnMucmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnJhd1Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiYW5hbHl6ZSByZXNwb25zZSA6IHJhd1wiKTtcbiAgICAgICAgICAgICAgICBkYXRhID0gb3B0aW9ucy5yZXNwb25zZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoIChvcHRpb25zLm91dHB1dEZvcm1hdCkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFwieG1sXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDogeG1sXCIpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwID0gbmV3IFhNTCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRlciA6IEFsdGlSZXNwb25zZVJlYWRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAuc2V0WE1MU3RyaW5nKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAuc2V0WE1MRG9jKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBwLnBhcnNlKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRVhDRVBUSU9OXzJcIikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9IGUubWVzc2FnZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRVhDRVBUSU9OXCIsIG1lc3NhZ2UpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAyMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBjYXNlIFwianNvblwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLnRyYWNlKFwiYW5hbHl6ZSByZXNwb25zZSA6IGpzb25cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDogXCIsIHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIEpTT05SZXNwb25zZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMucmVzcG9uc2UgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OUmVzcG9uc2UgPSBKU09OLnBhcnNlKG9wdGlvbnMucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OUmVzcG9uc2UgPSBvcHRpb25zLnJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZSBzZXJ2aWNlIHJlbnZvaWUgdCBpbCB1bmUgZXJyZXVyID9cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChKU09OUmVzcG9uc2UgJiYgSlNPTlJlc3BvbnNlLmVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHtcImVycm9yXCI6IHtcImNvZGVcIjogXCJCQURfUEFSQU1FVEVSXCIsXCJkZXNjcmlwdGlvblwiOiBcIlRoZSB2YWx1ZXMgKCkgY2Fubm90IGJlIHBhcnNlZCBhcyBhIHZhbGlkIGxvbmdpdHVkZSAoZG91YmxlIHZhbHVlIHN1Y2ggYXMgLTE4MCA8IGxhdCA8IDE4MCkuXCJ9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgSlNPTlJlc3BvbnNlLmVycm9yLmRlc2NyaXB0aW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogMjAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfU1JWRVJSXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5hbHlzZSBkZSBsYSByZXBvbnNlXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTlJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZXZhdGlvbnMgPSBKU09OUmVzcG9uc2UuZWxldmF0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWx0aVJlc3BvbnNlID0gbmV3IEFsdGlSZXNwb25zZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGV2YXRpb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZWxldmF0aW9ucykgJiYgZWxldmF0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBlbGV2YXRpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24gPSBuZXcgRWxldmF0aW9uKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZWxldmF0aW9uc1tpXSA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVsZXZhdGlvbnNbaV0gZXN0IHVuIG9iamV0IGVsZXZhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmxvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ubG9uID0gZWxldmF0aW9uc1tpXS5sb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmxhdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ubGF0ID0gZWxldmF0aW9uc1tpXS5sYXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLnopIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxldmF0aW9uLnogPSBlbGV2YXRpb25zW2ldLno7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLmFjYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24uYWNjID0gZWxldmF0aW9uc1tpXS5hY2M7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGV2YXRpb25zW2ldLm1lYXN1cmVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZXZhdGlvbi5tZWFzdXJlcyA9IGVsZXZhdGlvbnNbaV0ubWVhc3VyZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZWxldmF0aW9uc1tpXSA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVsZXZhdGlvbnNbaV0gZXN0IHVuIG5vbWJyZSwgZGFucyBsZSBjYXMgZGUgem9ubHk9dHJ1ZSBub3RhbW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGV2YXRpb24ueiA9IGVsZXZhdGlvbnNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFsdGlSZXNwb25zZS5lbGV2YXRpb25zKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsdGlSZXNwb25zZS5lbGV2YXRpb25zLnB1c2goZWxldmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gYWx0aVJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfQU5BTFlTRV8yXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfVU5LRVJSLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRk9STUFUXzJcIiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA6IEVycm9yU2VydmljZS5UWVBFX1VOS0VSUixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFNpIGxhIHLDqXBvbnNlIGNvbnRlbmFpdCB1bmUgZXhjZXB0aW9uIHJlbnZvecOpZSBwYXIgbGUgc2VydmljZVxuICAgICAgICAgICAgICAgIGlmIChkYXRhLmV4Y2VwdGlvblJlcG9ydCkge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VYQ0VQVElPTlwiLCBkYXRhLmV4Y2VwdGlvblJlcG9ydCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfU1JWRVJSLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogMjAwXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YS5lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXJyb3JNZXNzID0gZGF0YS5lcnJvci5kZXNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgZXJyb3JNZXNzKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAyMDBcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBvcHRpb25zLm9uU3VjY2Vzcy5jYWxsKG9wdGlvbnMuc2NvcGUsIGRhdGEpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFsdGlSZXNwb25zZUZhY3Rvcnk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Response/AltiResponseFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js ***! + \********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Response object for {@link module:Services~getAltitude Gp.Services.getAltitude ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Array.} elevations - Elevations array.\n *\n * @namespace\n * @alias Gp.Services.AltiResponse\n */\nfunction AltiResponse () {\n if (!(this instanceof AltiResponse)) {\n throw new TypeError(\"AltiResponse constructor cannot be called as a function.\");\n }\n\n this.elevations = [];\n}\n\nAltiResponse.prototype = {\n\n constructor : AltiResponse\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AltiResponse);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXNwb25zZS9tb2RlbC9BbHRpUmVzcG9u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AgfVxuXG4gICAgdGhpcy5lbGV2YXRpb25zID0gW107XG59XG5cbkFsdGlSZXNwb25zZS5wcm90b3R5cGUgPSB7XG5cbiAgICBjb25zdHJ1Y3RvciA6IEFsdGlSZXNwb25zZVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBBbHRpUmVzcG9uc2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/AltiResponse.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js ***! + \*****************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single elevation object returned by underlying web service. Contains at least, one elevation (z). May also contain point coordinates and elevation accuracy if \"zonly\" parameter wasn't set to true.\n *\n * @property {Float} lat - Point latitude. (only if zonly=false)\n * @property {Float} lon - Point longitude. (only if zonly=false)\n * @property {Float} z - Point elevation.\n * @property {Float} acc - Accuracy of elevation for this point. (only if zonly=false)\n *\n * @namespace\n * @alias Gp.Services.Alti.Elevation\n */\nfunction Elevation () {\n if (!(this instanceof Elevation)) {\n throw new TypeError(\"Elevation constructor cannot be called as a function.\");\n }\n\n this.z = null;\n}\n\nElevation.prototype = {\n\n constructor : Elevation\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Elevation);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQWx0aS9SZXNwb25zZS9tb2RlbC9FbGV2YXRpb24uanM/YzY2OSJdLCJuYW1lcy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hbGlhcyBHcC5TZXJ2aWNlcy5BbHRpLkVsZXZhdGlvblxuICovXG5mdW5jdGlvbiBFbGV2YXRpb24gKCkge1xuICAgIGlmICghKHRoaXMgaW5zdGFuY2VvZiBFbGV2YXRpb24pKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJFbGV2YXRpb24gY29uc3RydWN0b3IgY2Fubm90IGJlIGNhbGxlZCBhcyBhIGZ1bmN0aW9uLlwiKTtcbiAgICB9XG5cbiAgICB0aGlzLnogPSBudWxsO1xufVxuXG5FbGV2YXRpb24ucHJvdG90eXBlID0ge1xuXG4gICAgY29uc3RydWN0b3IgOiBFbGV2YXRpb25cblxufTtcblxuZXhwb3J0IGRlZmF1bHQgRWxldmF0aW9uO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Elevation.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single measure object returned by underlying web service if measures = true and zonly = false\n *\n * @property {String} source_name - Name of the source\n * @property {String} source_measure - Name of the measure\n * @property {Float} z - Point elevation.\n * @property {Float} acc - Accuracy of elevation for this point. (only if zonly=false)\n *\n * @namespace\n * @alias Gp.Services.Alti.Measure\n */\nfunction Measure () {\n if (!(this instanceof Measure)) {\n throw new TypeError(\"Measure constructor cannot be called as a function.\");\n }\n\n this.source_name = null;\n this.source_measure = null;\n this.z = null;\n this.acc = null;\n}\n\nMeasure.prototype = {\n\n constructor : Measure\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Measure);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json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mx5IGlmIHpvbmx5PWZhbHNlKVxuICpcbiAqIEBuYW1lc3BhY2VcbiAqIEBhbGlhcyBHcC5TZXJ2aWNlcy5BbHRpLk1lYXN1cmVcbiAqL1xuZnVuY3Rpb24gTWVhc3VyZSAoKSB7XG4gICAgaWYgKCEodGhpcyBpbnN0YW5jZW9mIE1lYXN1cmUpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJNZWFzdXJlIGNvbnN0cnVjdG9yIGNhbm5vdCBiZSBjYWxsZWQgYXMgYSBmdW5jdGlvbi5cIik7XG4gICAgfVxuXG4gICAgdGhpcy5zb3VyY2VfbmFtZSA9IG51bGw7XG4gICAgdGhpcy5zb3VyY2VfbWVhc3VyZSA9IG51bGw7XG4gICAgdGhpcy56ID0gbnVsbDtcbiAgICB0aGlzLmFjYyA9IG51bGw7XG59XG5cbk1lYXN1cmUucHJvdG90eXBlID0ge1xuXG4gICAgY29uc3RydWN0b3IgOiBNZWFzdXJlXG5cbn07XG5cbmV4cG9ydCBkZWZhdWx0IE1lYXN1cmU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Alti/Response/model/Measure.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Response/AutoCompleteResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/AutoCompleteResponseFactory.js\");\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'autocomplétion du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.AutoComplete\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.text - La chaîne de caractère à compléter.\n * Cette chaîne n'est pas \"URL encodée\".\n * C'est l'API qui s'occupe de l'encoder pour l'inclure dans la requête.\n *\n * @param {Array.} [options.type = [\"StreetAddress\"]] - Type de l'objet recherché.\n * Le service d'autocomplétion du Géoportail permet de rechercher des toponymes 'PositionOfInterest' et/ou des adresses postales 'StreetAddress'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, type = ['StreetAddress'].\n *\n * @param {String} [options.territory] - Limitation de la zone de recherche de localisants.\n * Le service d'autocomplétion du Géoportail permet de limiter la recherche à la métropole et la Corse : options.territory = 'METROPOLE',\n * DOMS TOMS : options.territory = 'DOMTOM', ou à un département : options.territory = '31'\n * Pas de valeur par défaut.\n * La valeur par défaut est donc celle du service.\n * Le service d'autocomplétion du Géoportail renvoie toutes les informations quand aucun territoire n'est spécifié.\n *\n * @param {Number} [options.maximumResponses = 10] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut.\n * La valeur par défaut sera donc celle du service : 10.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * text : \"\",\n * type : \"StreetAddress\",\n * territory : 'METROPOLE',\n * maximumResponses : 10\n * };\n */\nfunction AutoComplete (options_) {\n if (!(this instanceof AutoComplete)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"AutoComplete\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"AutoComplete\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getLogger(\"Gp.Services.AutoComplete\");\n this.logger.trace(\"[Constructeur AutoComplete (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n\n if (!options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocomplétion\n /* options.serverUrl = DefaultUrlService.AutoComplete.newUrl();\n if (options.oldAutocompleteService) {\n options.serverUrl = DefaultUrlService.AutoComplete.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocompletion\n options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__[\"default\"].AutoComplete.url();\n }\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].apply(this, arguments);\n\n if (!options.text) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"PARAM_MISSING\", \"text\"));\n }\n\n // ajout des options spécifiques au service\n this.options.text = options.text;\n\n // on definit des parametres par defaut\n if (!options.type) {\n options.type = [\"StreetAddress,PositionOfInterest\"];\n }\n\n this.options.type = options.type;\n this.options.territory = options.territory || \"\";\n this.options.maximumResponses = options.maximumResponses || 10;\n\n // INFO\n // le service ne repond pas en mode POST (405 Method Not Allowed)\n if (this.options.protocol === \"XHR\" && this.options.httpMethod === \"POST\") {\n this.logger.warn(\"Le service ne gére pas le mode d'interrogation en POST, on bascule sur du GET !\");\n this.options.httpMethod = \"GET\"; // on surcharge !\n }\n\n // attributs d'instances\n\n /**\n * Format forcé de la réponse du service : \"json\"\n * sauf si l'on souhaite une reponse brute (options.rawResponse)\n */\n this.options.outputFormat = (this.options.rawResponse) ? \"\" : \"json\";\n}\n\n/**\n * @lends module:AutoComplete#\n */\n\nAutoComplete.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nAutoComplete.prototype.constructor = AutoComplete;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nAutoComplete.prototype.patchOptionConvertor = function (options_) {\n const options = options_;\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (options.filterOptions.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.type) {\n options.type = options.filterOptions.type;\n }\n }\n\n if (options.filterOptions.territory) {\n this.logger.warn(\"The parameter 'filterOptions.territory' is deprecated\");\n if (!options.terr) {\n options.terr = options.filterOptions.territory;\n }\n }\n\n delete options.filterOptions;\n }\n\n return options;\n};\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nAutoComplete.prototype.buildRequest = function (error, success) {\n // ex.\n // http://wxs.ign.fr/CLEF/ols/apis/completion?\n // text=Brie-Comt&\n // type=StreetAddress,PositionOfInterest&\n // territory=METROPOLE&\n // maximumResponses=10\n\n // traitement des param KPV sous forme de tableau\n var territory = \"\";\n if (this.options.territory) {\n territory = this.options.territory;\n }\n\n var type = \"\";\n if (this.options.type) {\n type = this.options.type.join(\",\");\n }\n\n // normalisation de la requete avec param KPV\n this.request = _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].normalyzeParameters({\n text : encodeURIComponent(this.options.text),\n type : type,\n terr : territory,\n maximumResponses : this.options.maximumResponses\n });\n\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback de succès de l'analyse de la réponse\n */\nAutoComplete.prototype.analyzeResponse = function (error, success) {\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onSuccess : success,\n onError : error,\n scope : this\n };\n\n _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AutoComplete);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application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k7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgZXJyb3IuY2FsbCh0aGlzLCBuZXcgRXJyb3JTZXJ2aWNlKE1SLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQXV0b0NvbXBsZXRlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/AutoCompleteResponseFactory.js": +/*!*************************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/AutoCompleteResponseFactory.js ***! + \*************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model/AutoCompleteResponse */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/AutoCompleteResponse.js\");\n/* harmony import */ var _model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./model/SuggestedLocation */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/SuggestedLocation.js\");\n/**\n * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON\n * (Factory)\n *\n * @module AutoCompleteResponseFactory\n * @private\n * @alias Gp.Services.AutoComplete.Response.AutoCompleteResponseFactory\n */\n\n\n\n\n\n\nvar AutoCompleteResponseFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Alti\n *\n * @example\n * var options = {\n * response :\n * outputFormat :\n * rawResponse :\n * scope :\n * onSuccess :\n * onError :\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"AutoCompleteResponseFactory\");\n logger.trace([\"AutoCompleteResponseFactory::build()\"]);\n\n var data = null;\n\n if (options.response) {\n if (options.rawResponse) {\n logger.trace(\"analyze response : raw\");\n data = options.response;\n } else {\n var JSONResponse = null;\n if (typeof options.response === \"string\") {\n JSONResponse = JSON.parse(options.response);\n } else {\n JSONResponse = options.response;\n }\n\n // analyse de la réponse\n if (JSONResponse) {\n // le service renvoie t il une erreur ?\n if (JSONResponse.error) {\n // ex. ?\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", JSONResponse.error.description),\n status : JSONResponse.error.code,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR\n }));\n return;\n }\n\n // création de l'objet réponse\n data = new _model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n\n // boucle sur les résultats de l'autocomplétion\n if (JSONResponse.results && Array.isArray(JSONResponse.results)) {\n var suggestedLocation = null;\n\n for (var i = 0; i < JSONResponse.results.length; i++) {\n var result = JSONResponse.results[i];\n suggestedLocation = new _model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n\n if (result) {\n if (result.country === \"StreetAddress\") {\n suggestedLocation.street = result.street;\n suggestedLocation.type = \"StreetAddress\";\n } else if (result.country === \"PositionOfInterest\") {\n suggestedLocation.poi = result.street;\n suggestedLocation.kind = result.kind;\n suggestedLocation.type = \"PositionOfInterest\";\n }\n\n if (suggestedLocation.position) {\n suggestedLocation.position.x = result.x;\n suggestedLocation.position.y = result.y;\n }\n\n suggestedLocation.commune = result.city;\n suggestedLocation.fullText = result.fulltext;\n suggestedLocation.postalCode = result.zipcode;\n suggestedLocation.classification = result.classification;\n }\n // Ajout du résultat au tableau reverseGeocodedLocations de geocodedLocation\n data.suggestedLocations.push(suggestedLocation);\n }\n } else {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_FORMAT_3\")));\n return;\n }\n\n if (!data.suggestedLocations.length) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_FORMAT_3\")));\n return;\n }\n }\n\n if (!data) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE_2\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n\n // Si la réponse contenait une exception renvoyée par le service\n if (data.exceptionReport) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", data.exceptionReport),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n }\n }\n } else {\n // si la réponse (xmlString) est vide, on appelle le callback d'erreur\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n return;\n }\n\n // si tout s'est bien passé, on appelle le callback de succès\n options.onSuccess.call(options.scope, data);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AutoCompleteResponseFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQXV0b0NvbXBsZXRlL1Jlc3BvbnNlL0F1dG9Db21wbGV0ZVJlc3BvbnNlRmFjdG9yeS5qcz8wYmIyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDb0Q7QUFDQTtBQUNRO0FBQ0k7QUFDTjs7QUFFMUQ7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsT0FBTztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUJBQXFCLDhEQUFNO0FBQzNCOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ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ucGFyc2Uob3B0aW9ucy5yZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgSlNPTlJlc3BvbnNlID0gb3B0aW9ucy5yZXNwb25zZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBhbmFseXNlIGRlIGxhIHLDqXBvbnNlXG4gICAgICAgICAgICAgICAgaWYgKEpTT05SZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsZSBzZXJ2aWNlIHJlbnZvaWUgdCBpbCB1bmUgZXJyZXVyID9cbiAgICAgICAgICAgICAgICAgICAgaWYgKEpTT05SZXNwb25zZS5lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguID9cbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VYQ0VQVElPTlwiLCBKU09OUmVzcG9uc2UuZXJyb3IuZGVzY3JpcHRpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA6IEpTT05SZXNwb25zZS5lcnJvci5jb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGNyw6lhdGlvbiBkZSBsJ29iamV0IHLDqXBvbnNlXG4gICAgICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgQXV0b0NvbXBsZXRlUmVzcG9uc2UoKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBib3VjbGUgc3VyIGxlcyByw6lzdWx0YXRzIGRlIGwnYXV0b2NvbXBsw6l0aW9uXG4gICAgICAgICAgICAgICAgICAgIGlmIChKU09OUmVzcG9uc2UucmVzdWx0cyAmJiBBcnJheS5pc0FycmF5KEpTT05SZXNwb25zZS5yZXN1bHRzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1Z2dlc3RlZExvY2F0aW9uID0gbnVsbDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBKU09OUmVzcG9uc2UucmVzdWx0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBKU09OUmVzcG9uc2UucmVzdWx0c1tpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWdnZXN0ZWRMb2NhdGlvbiA9IG5ldyBTdWdnZXN0ZWRMb2NhdGlvbigpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0LmNvdW50cnkgPT09IFwiU3RyZWV0QWRkcmVzc1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWdnZXN0ZWRMb2NhdGlvbi5zdHJlZXQgPSByZXN1bHQuc3RyZWV0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VnZ2VzdGVkTG9jYXRpb24udHlwZSA9IFwiU3RyZWV0QWRkcmVzc1wiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdC5jb3VudHJ5ID09PSBcIlBvc2l0aW9uT2ZJbnRlcmVzdFwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWdnZXN0ZWRMb2NhdGlvbi5wb2kgPSByZXN1bHQuc3RyZWV0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VnZ2VzdGVkTG9jYXRpb24ua2luZCA9IHJlc3VsdC5raW5kO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VnZ2VzdGVkTG9jYXRpb24udHlwZSA9IFwiUG9zaXRpb25PZkludGVyZXN0XCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VnZ2VzdGVkTG9jYXRpb24ucG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Z2dlc3RlZExvY2F0aW9uLnBvc2l0aW9uLnggPSByZXN1bHQueDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Z2dlc3RlZExvY2F0aW9uLnBvc2l0aW9uLnkgPSByZXN1bHQueTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Z2dlc3RlZExvY2F0aW9uLmNvbW11bmUgPSByZXN1bHQuY2l0eTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VnZ2VzdGVkTG9jYXRpb24uZnVsbFRleHQgPSByZXN1bHQuZnVsbHRleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Z2dlc3RlZExvY2F0aW9uLnBvc3RhbENvZGUgPSByZXN1bHQuemlwY29kZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VnZ2VzdGVkTG9jYXRpb24uY2xhc3NpZmljYXRpb24gPSByZXN1bHQuY2xhc3NpZmljYXRpb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFqb3V0IGR1IHLDqXN1bHRhdCBhdSB0YWJsZWF1IHJldmVyc2VHZW9jb2RlZExvY2F0aW9ucyBkZSBnZW9jb2RlZExvY2F0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5zdWdnZXN0ZWRMb2NhdGlvbnMucHVzaChzdWdnZXN0ZWRMb2NhdGlvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRk9STUFUXzNcIikpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghZGF0YS5zdWdnZXN0ZWRMb2NhdGlvbnMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRk9STUFUXzNcIikpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0FOQUxZU0VfMlwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9VTktFUlIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAtMVxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTaSBsYSByw6lwb25zZSBjb250ZW5haXQgdW5lIGV4Y2VwdGlvbiByZW52b3nDqWUgcGFyIGxlIHNlcnZpY2VcbiAgICAgICAgICAgICAgICBpZiAoZGF0YS5leGNlcHRpb25SZXBvcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgZGF0YS5leGNlcHRpb25SZXBvcnQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA6IEVycm9yU2VydmljZS5UWVBFX1NSVkVSUixcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA6IDIwMFxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBzaSBsYSByw6lwb25zZSAoeG1sU3RyaW5nKSBlc3QgdmlkZSwgb24gYXBwZWxsZSBsZSBjYWxsYmFjayBkJ2VycmV1clxuICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBzaSB0b3V0IHMnZXN0IGJpZW4gcGFzc8OpLCBvbiBhcHBlbGxlIGxlIGNhbGxiYWNrIGRlIHN1Y2PDqHNcbiAgICAgICAgb3B0aW9ucy5vblN1Y2Nlc3MuY2FsbChvcHRpb25zLnNjb3BlLCBkYXRhKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBdXRvQ29tcGxldGVSZXNwb25zZUZhY3Rvcnk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/AutoCompleteResponseFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/AutoCompleteResponse.js": +/*!************************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/AutoCompleteResponse.js ***! + \************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Response object for {@link module:Services~autoComplete Gp.Services.autoComplete ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Array.} suggestedLocations - SuggestedLocations array.\n *\n * @namespace\n * @alias Gp.Services.AutoCompleteResponse\n */\nfunction AutoCompleteResponse () {\n if (!(this instanceof AutoCompleteResponse)) {\n throw new TypeError(\"AutoCompleteResponse constructor cannot be called as a function.\");\n }\n\n this.suggestedLocations = [];\n}\n\nAutoCompleteResponse.prototype = {\n\n constructor : AutoCompleteResponse\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AutoCompleteResponse);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQXV0b0NvbXBs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GxldGVSZXNwb25zZSkpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcIkF1dG9Db21wbGV0ZVJlc3BvbnNlIGNvbnN0cnVjdG9yIGNhbm5vdCBiZSBjYWxsZWQgYXMgYSBmdW5jdGlvbi5cIik7XG4gICAgfVxuXG4gICAgdGhpcy5zdWdnZXN0ZWRMb2NhdGlvbnMgPSBbXTtcbn1cblxuQXV0b0NvbXBsZXRlUmVzcG9uc2UucHJvdG90eXBlID0ge1xuXG4gICAgY29uc3RydWN0b3IgOiBBdXRvQ29tcGxldGVSZXNwb25zZVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBBdXRvQ29tcGxldGVSZXNwb25zZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/AutoCompleteResponse.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/SuggestedLocation.js": +/*!*********************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/SuggestedLocation.js ***! + \*********************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single SuggestedLocation Object returned by underlying web service.\n * Each suggested location represents a street address (\"StreetAddress\") or a place name (\"PositionOfInterest\").\n *\n * @property {String} type - Suggested location type : \"StreetAddress\" ou \"PositionOfInterest\"\n * @property {Gp.Point} position - Position of the suggested location given in requested coordinates system.\n * @property {String} commune - Suggested municipality\n * @property {String} fullText - Full text representation of the suggested location.\n * @property {String} postalCode - Suggested location postcode\n * @property {Integer} classification - Number used to classify the importance of the place where is the suggested location from 1 (most important) to 7 (less important).\n * @property {String} street - Street name of the suggested location (\"StreetAddress\" only).\n * @property {String} kind - Nature of the suggested location : \"prefecture\", \"monument\", \"commune\", ... for instance (\"PositionOfInterest\" only).\n *\n * @namespace\n * @alias Gp.Services.AutoComplete.SuggestedLocation\n */\nfunction SuggestedLocation () {\n if (!(this instanceof SuggestedLocation)) {\n throw new TypeError(\"SuggestedLocation constructor cannot be called as a function.\");\n }\n\n /* REPONSE :\n {\n \"status\" : \"OK\",\n \"results\" : [\n {\n \"country\":\"PositionOfInterest\",\n \"x\":-1.559185,\n \"y\":47.952603,\n \"city\":\"Brie\",\n \"zipcode\":\"35150\",\n \"street\":\"corbe\",\n \"kind\":\"Lieu-dit habité\",\n \"fulltext\":\"corbe, 35150 Brie\",\n \"classification\":6\n },\n {\n \"country\":\"StreetAddress\",\n \"x\":1.538295,\n \"y\":43.19646,\n \"city\":\"Brie\",\n \"zipcode\":\"09700\",\n \"street\":\"courreste\",\n \"kind\":\"\",\n \"fulltext\":\"courreste, 09700 Brie\",\n \"classification\":7\n }\n ]\n }\n */\n\n /* REPONSE EN ERREUR\n {\n status : \"ERROR\",\n results : [ ]\n }\n */\n\n /**\n * Suggested location type : \"StreetAddress\" ou \"PositionOfInterest\"\n * @type {String}\n */\n this.type = null;\n\n /**\n * Position of the suggested location given in requested coordinates system.\n * @type {Gp.Point}\n */\n this.position = {\n x : null,\n y : null\n };\n\n /**\n * Suggested municipality\n * @type {String}\n */\n this.commune = null;\n\n /**\n * Full text representation of the suggested location.\n * @type {String}\n */\n this.fullText = null;\n\n /**\n * Suggested location postcode\n * @type {Number}\n */\n this.postalCode = null;\n\n /**\n * Number used to classify the importance of the place where is the suggested location from 1 (most important) to 7 (less important).\n * @type {Integer}\n */\n this.classification = null;\n\n /**\n * Street name of the suggested location (\"StreetAddress\" only).\n * @type {String}\n */\n this.street = null;\n\n /**\n * Place name of the suggested location (\"PositionOfInterest\" only).\n * @type {String}\n */\n this.poi = null;\n\n /**\n * Nature of the suggested location : \"prefecture\", \"monument\", \"commune\", ... for instance (\"PositionOfInterest\" only).\n * @type {String}\n */\n this.kind = null;\n}\n\nSuggestedLocation.prototype = {\n\n constructor : SuggestedLocation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m5vdCBiZSBjYWxsZWQgYXMgYSBmdW5jdGlvbi5cIik7XG4gICAgfVxuXG4gICAgLyogUkVQT05TRSA6XG4gICAgICAgIHtcbiAgICAgICAgICAgXCJzdGF0dXNcIiA6IFwiT0tcIixcbiAgICAgICAgICAgXCJyZXN1bHRzXCIgOiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgXCJjb3VudHJ5XCI6XCJQb3NpdGlvbk9mSW50ZXJlc3RcIixcbiAgICAgICAgICAgICAgICAgXCJ4XCI6LTEuNTU5MTg1LFxuICAgICAgICAgICAgICAgICBcInlcIjo0Ny45NTI2MDMsXG4gICAgICAgICAgICAgICAgIFwiY2l0eVwiOlwiQnJpZVwiLFxuICAgICAgICAgICAgICAgICBcInppcGNvZGVcIjpcIjM1MTUwXCIsXG4gICAgICAgICAgICAgICAgIFwic3RyZWV0XCI6XCJjb3JiZVwiLFxuICAgICAgICAgICAgICAgICBcImtpbmRcIjpcIkxpZXUtZGl0IGhhYml0w6lcIixcbiAgICAgICAgICAgICAgICAgXCJmdWxsdGV4dFwiOlwiY29yYmUsIDM1MTUwIEJyaWVcIixcbiAgICAgICAgICAgICAgICAgXCJjbGFzc2lmaWNhdGlvblwiOjZcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICBcImNvdW50cnlcIjpcIlN0cmVldEFkZHJlc3NcIixcbiAgICAgICAgICAgICAgICAgXCJ4XCI6MS41MzgyOTUsXG4gICAgICAgICAgICAgICAgIFwieVwiOjQzLjE5NjQ2LFxuICAgICAgICAgICAgICAgICBcImNpdHlcIjpcIkJyaWVcIixcbiAgICAgICAgICAgICAgICAgXCJ6aXBjb2RlXCI6XCIwOTcwMFwiLFxuICAgICAgICAgICAgICAgICBcInN0cmVldFwiOlwiY291cnJlc3RlXCIsXG4gICAgICAgICAgICAgICAgIFwia2luZFwiOlwiXCIsXG4gICAgICAgICAgICAgICAgIFwiZnVsbHRleHRcIjpcIm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ICBjb25zdHJ1Y3RvciA6IFN1Z2dlc3RlZExvY2F0aW9uXG59O1xuXG5leHBvcnQgZGVmYXVsdCBTdWdnZXN0ZWRMb2NhdGlvbjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/AutoComplete/Response/model/SuggestedLocation.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/CommonService.js": +/*!*************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/CommonService.js ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Utils/Helper */ \"./node_modules/geoportal-access-lib/src/Utils/Helper.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Protocols/Protocol */ \"./node_modules/geoportal-access-lib/src/Protocols/Protocol.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../package.json */ \"./node_modules/geoportal-access-lib/package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_6___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./node_modules/geoportal-access-lib/package.json\", 1);\n\n\n\n\n\n\n// package.json (extract version)\n\n\n/**\n * @classdesc\n * Composant Service\n *\n * @constructor\n * @alias Gp.Services.CommonService\n * @param {Object} options - options communes à tous les services\n *\n * @param {String} [options.serverUrl] - URL d'accès au service. Par défaut \"https://wxs.ign.fr/calcul/geoportail/SERVICE/\".\n * Permet de forcer l'utilisation d'un service équivalent déployé derrière une éventuelle autre URL d'accès.\n * Si ce paramètre est renseigné alors, le paramètre par défaut est ignoré.\n *\n * @param {String} [options.protocol] - Le protocole à utiliser pour récupérer les informations du service :\n * peut valoir 'JSONP' ou 'XHR'.\n * Par défaut, c'est le protocole XHR qui sera utilisé.\n * Attention, le protocole JSONP n'est pas valide dans un environnement NodeJS (Utilisation du mode XHR).\n *\n * @param {Boolean} [options.ssl] - Indique si l'on souhaite intérroger les services en https.\n * Ce paramètre ne fonctionne que pour une utilisation hors navigateur (ex. NodeJS).\n * Sur un navigateur, le protocole est automatiquement extrait de l'url du site...\n * Par défaut, on utilise le protocole http (ssl=false).\n *\n * @param {String} [options.proxyURL] - Le proxy à utiliser pour pallier au problème de cross-domain dans le cas d'une requête XHR.\n * Utile si le paramètre 'protocol' vaut 'XHR', il ne sera pas pris en compte si protocol vaut JSONP.\n *\n * @param {String} [options.callbackSuffix] - Suffixe de la fonction de callback à utiliser, dans le cas du protocole JSONP.\n * Par défaut, la fonction de callback portera un nom du type \"callback\"+ID, où ID est soit un identifiant unique généré à chaque requête,\n * soit le paramètre callbackSuffix s'il est spécifié. Par exemple, si callbackSuffix=\"_2\", la fonction sera \"callback_2 ()\".\n * Utile pour utiliser une réponse déjà encapsulée dans une fonction de callback, dont le nom est connu\n * Utile seulement si le paramètre 'protocol' vaut 'JSONP', il ne sera pas pris en compte si protocol vaut 'XHR'.\n *\n * @param {String} [options.httpMethod] - La méthode HTTP\n * à utiliser dans le cas d'une requête XHR : peut valoir 'GET' ou 'POST'.\n * Non pris en compte si 'protocol' vaut JSONP qui fonctionne obligatoirement en GET.\n * Par défaut, c'est la méthode GET qui est utilisée.\n *\n * @param {String} [options.contentType] - Content-Type de la requete\n * à utiliser dans le cas d'une requête XHR en mode POST.\n * Non pris en compte si 'protocol' vaut JSONP et/ou la méthode HTTP vaut GET.\n * Par défaut, c'est la méthode GET qui est utilisée donc on n'utilise pas de Content-Type.\n *\n * @param {Number} [options.timeOut] - Délai d'attente maximal (en ms) de la réponse du service (à partir de l'envoi de la requête).\n * Par défaut, aucun timeOut n'est pris en compte (timeoutDelay= 0).\n *\n * @param {Boolean} [options.rawResponse] - Indique si l'on souhaite que la réponse du service ne soit pas parsée par l'API avant d'être restituée.\n * (Cf. paramètre « onSuccess » pour plus de détails).\n *\n * @param {Function} [options.onSuccess] - Fonction appelée lorsque le service répond correctement à la requête\n * (code HTTP 200, sans message d'erreur).\n * Cette fonction prend en paramètre la réponse du service,\n * soit sous la forme d'un Object Javascript formaté par le parseur dédié à la syntaxe du service (comportement par défaut) ;\n * soit brute au format String non prétraité si le paramètre « rawResponse » a été précisé avec la valeur « true ».\n *\n * @param {Function} [options.onFailure] - Fonction appelée lorsque le service ne répond pas correctement\n * (code HTTP de retour différent de 200 ou pas de réponse).\n *\n * @param {Function} [options.onBeforeParse] - Fonction appelée avant le parsing de la réponse\n * Permet de modifier la réponse avant parsing et la fonction doit retourner une String.\n * Cette fonction prend en paramètre la réponse telle que renvoyée par le service\n * (cad au format json ou xml).\n * Pour le JSONP, si le paramètre \"rawResponse\" a été précisé avec la valeur \"true\",\n * la fonction prend en paramètre un Object JavaScript contenant la réponse XML.\n *\n * @example\n * var options = {\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * ssl : false,\n * proxyURL : null,\n * callbackName : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * onBeforeParse : function (rawResponse) {}\n * };\n */\nfunction CommonService (options) {\n if (!(this instanceof CommonService)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\"));\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"CommonService\");\n this.logger.trace(\"[Constructeur CommonService (options)]\");\n\n // #####################\n // récupération des options par défaut pour les paramètres optionnels\n // #####################\n\n /**\n * Options du service\n * @type {Object}\n */\n this.options = {\n // protocol : \"JSONP\",\n protocol : \"XHR\",\n ssl : true,\n proxyURL : \"\",\n // callbackName : \"\",\n callbackSuffix : null,\n httpMethod : \"GET\",\n timeOut : 0,\n rawResponse : false,\n scope : this,\n /**\n * callback par defaut pour la reponse\n * @param {Object} response - response\n * @private\n */\n onSuccess : function (response) {\n console.log(\"onSuccess - la reponse est la suivante : \", response);\n },\n /**\n * callback par defaut pour les erreurs\n * @param {Object} error - error\n * @private\n */\n onFailure : function (error) {\n if (error.status === 200 || !error.status) {\n console.log(\"onFailure : \", error.message);\n } else {\n console.log(\"onFailure - Erreur (\", error.status, \") : \", error.message);\n }\n }\n };\n\n // et on ajoute les options en paramètre aux options par défaut\n for (var opt in options) {\n if (options.hasOwnProperty(opt)) {\n this.options[opt] = options[opt];\n }\n }\n\n // #####################\n // analyse des options\n // #####################\n\n // modification de la fonction de callback onSuccess dans le cas où la réponse brute est demandée\n if (this.options.rawResponse && !this.options.onSuccess) {\n /**\n * callback par defaut pour la reponse\n * @param {Object} response - response\n * @private\n */\n this.options.onSuccess = function (response) {\n console.log(\"onSuccess - la réponse brute du service est la suivante : \", response);\n };\n }\n\n // gestion du callback onSuccess\n var bOnSuccess = !!(this.options.onSuccess !== null && typeof this.options.onSuccess === \"function\");\n if (!bOnSuccess) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_MISSING\", \"onSuccess()\"));\n }\n\n /* FIXME traitement au niveau de chaque composant pour tester service WXS / GPF\n // gestion de l'url du service par defaut\n if (!this.options.serverUrl) {\n // INFO\n // gestion de l'url du service par defaut pour les services qui ne possèdent qu'une seul url par defaut\n // les cas particuliers des services avec plusieurs urls (ex. Alti) devront être traité dans la classe du composant\n // donc si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n DefaultUrlService.ssl = this.options.ssl;\n var urlByDefault = DefaultUrlService[this.CLASSNAME].url(\"calcul\");\n if (typeof urlByDefault === \"string\") {\n this.options.serverUrl = urlByDefault;\n } else {\n this.logger.trace(\"URL par defaut à determiner au niveau du composant...\");\n }\n }*/\n\n // FIXME nettoyage des KVP dans l'url du service\n // if (this.options.serverUrl) {\n // // INFO\n // // si l'url est renseignée, il faut la nettoyer de tous ses KVP\n // // ex. on ne veut pas de params. 'callback' ou 'output' car ceci declencherait\n // // des opérations d'encapsulations des reponses légèrement farfelues ...\n // var urlsource = this.options.serverUrl;\n // var urlparts = urlsource.split(\"?\");\n // this.options.serverUrl = urlparts[0];\n // }\n\n // gestion de la methode HTTP\n this.options.httpMethod = (typeof options.httpMethod === \"string\") ? options.httpMethod.toUpperCase() : \"GET\";\n\n switch (this.options.httpMethod) {\n case \"POST\":\n case \"GET\":\n break;\n case \"PUT\":\n case \"DELETE\":\n case \"HEAD\":\n case \"OPTIONS\":\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT\", \"httpMethod\"));\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"httpMethod\"));\n }\n\n // gestion du protocole\n // this.options.protocol = (typeof options.protocol === \"string\" ) ? options.protocol.toUpperCase() : \"JSONP\";\n this.options.protocol = (typeof options.protocol === \"string\") ? options.protocol.toUpperCase() : \"XHR\";\n\n switch (this.options.protocol) {\n case \"JSONP\":\n case \"XHR\":\n break;\n default:\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_UNKNOWN\", \"protocol\"));\n }\n\n // on determine l'environnement d'execution : browser ou non ?\n // et on lance une exception sur l'utilisation du protocole JSONP pour nodeJS...\n if (typeof window === \"undefined\" && this.options.protocol === \"JSONP\") {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT_NODEJS\", \"protocol=JSONP (instead use XHR)\"));\n }\n\n // le protocole JSONP ne fonctionne qu'en GET.\n if (this.options.protocol === \"JSONP\") {\n this.options.httpMethod = \"GET\";\n }\n\n // gestion du cache\n this.options.nocache = options.nocache || false;\n\n // #####################\n // attributs d'instances\n // #####################\n\n /**\n * Format de réponse du service\n */\n this.options.outputFormat = null;\n /**\n * Requête envoyée au service\n */\n this.request = null;\n /**\n * Reponse du service\n */\n this.response = null;\n}\n\n/**\n * @lends module:CommonService\n */\nCommonService.prototype = {\n\n /*\n * Constructeur (alias)\n */\n constructor : CommonService,\n\n /**\n * Appel du service Géoportail\n */\n call : function () {\n /* jshint validthis : true */\n this.logger.trace(\"CommonService::call ()\");\n\n var context = this;\n /** fonction d'execution */\n function run () {\n this.logger.trace(\"CommonService::run ()\");\n this.buildRequest.call(context, onError, onBuildRequest);\n }\n\n run.call(context);\n\n // callback de fin de construction de la requête\n function onBuildRequest (result) {\n this.logger.trace(\"CommonService::onBuildRequest : \", result);\n this.callService.call(context, onError, onCallService);\n }\n\n // callback de fin d'appel au service\n function onCallService (result) {\n this.logger.trace(\"CommonService::onCallService : \", result);\n this.analyzeResponse.call(context, onError, onAnalyzeResponse);\n }\n\n // callback de fin de lecture de la reponse\n function onAnalyzeResponse (result) {\n this.logger.trace(\"CommonService::onAnalyzeResponse : \", result);\n if (result) {\n this.options.onSuccess.call(this, result);\n } else {\n return onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"Analyse de la reponse en échec !?\"));\n }\n }\n\n // callback de gestion des erreurs : renvoit un objet de type ErrorService\n function onError (error) {\n this.logger.trace(\"CommonService::onError()\");\n // error : l'objet est du type ErrorService ou Error\n var e = error;\n if (!(e instanceof _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"])) {\n e = new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](error.message);\n }\n this.options.onFailure.call(this, e);\n }\n },\n\n /**\n * Création de la requête\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n buildRequest : function (error, success) {\n // INFO\n this.logger.error(\"overwritten method !\");\n // retourne l'objet 'this.request'\n if (error) {\n error.call(this, \"This method must be overwritten !\");\n }\n success.call(this, \"This method must be overwritten !\");\n },\n\n /**\n * Appel du service\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n callService : function (error, success) {\n // INFO\n // retourne l'objet 'this.response'\n\n // NOTES\n // Pour le mode XHR, on recupère une reponse sous forme d'un json ou xml (#document).\n // Pour le mode JSONP, on a toujours un objet JSON mais sous 2 formes :\n // - natif\n // - XML encapsulé :\n // {http : {status:200, error:null},xml :'réponse du service'}\n // {http : {status:400, error:'reponse du service'},xml :null}\n // En XHR, la reponse est directement sauvegardée dans 'this.response'.\n // Par contre, en JSONP, on doit analyser la reponse (status ou non vide),\n // et ne renvoyer que le contenu (xml ou l'objet)\n\n // gestion de la proxification du service\n var strUrlProxified = null;\n var strData = this.request;\n\n // a t on mis en place un proxy ?\n // la proxyfication est valable uniquement en mode XHR !\n var bUrlProxified = !!(this.options.proxyURL && this.options.protocol === \"XHR\");\n\n // rajout de l'option gpbibaccess\n // INFO : acces au numero de version de package.conf aprés compilation !\n if (this.CLASSNAME !== \"Geocode\" && this.CLASSNAME !== \"ReverseGeocode\" && this.CLASSNAME !== \"AutoComplete\") {\n this.options.serverUrl = _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, {\n \"gp-access-lib\" : _package_json__WEBPACK_IMPORTED_MODULE_6__.version,\n apiKey : this.options.apiKey || \"calcul\"\n }, false);\n }\n\n // si le proxy est renseigné, on proxifie l'url du service\n if (bUrlProxified) {\n if (this.options.httpMethod === \"GET\") {\n strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, this.request, true);\n strData = null;\n }\n\n if (this.options.httpMethod === \"POST\") {\n strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalyzeUrl(this.options.serverUrl, null, true);\n strData = this.request;\n }\n }\n\n // contexte du composant spécifique !\n var self = this;\n\n var options = {\n url : strUrlProxified || this.options.serverUrl,\n method : this.options.httpMethod,\n protocol : this.options.protocol,\n timeOut : this.options.timeOut || 0,\n format : this.options.outputFormat, // ceci declenche le parsing de la reponse du service, mais on souhaite toujours une reponse brute (string) !\n nocache : this.options.nocache || false, // ceci permet d'ajouter un timestamp dans la requête\n wrap : this.options.protocol !== \"XHR\", // ceci declenche l'encapsulation de la reponse XML du service dans du JSON, mais pas en mode XHR !\n callbackSuffix : this.options.callbackSuffix,\n // callbackName : this.options.callbackName || null,\n data : strData,\n headers : null, // TODO...\n content : this.options.contentType || \"application/xml\",\n scope : this.options.scope || this,\n // callback de reponse\n onResponse : function (response) {\n self.logger.trace(\"callService::onResponse()\");\n\n // le contenu de la reponse à renvoyer !\n var content = null;\n\n // XHR : on renvoie toujours la reponse brute du service (json ou xml)\n // au parser du composant...\n if (self.options.protocol === \"XHR\") {\n self.logger.trace(\"Response XHR\", response);\n content = response; // par defaut, la reponse du service !\n }\n\n // JSONP : on pre-analyse la reponse brute du service (encapsuler ou pas)\n // avant de l'envoyer au parser du composant...\n if (self.options.protocol === \"JSONP\") {\n self.logger.trace(\"Response JSON\", response);\n if (response) {\n if (response.http) {\n // reponse encapsulée :\n // ex. reponse du service en xml\n // > {http : {status:200, error:null},xml :'réponse du service'}\n if (response.http.status !== 200) {\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"]({\n status : response.http.status,\n message : response.http.error,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TYPE_SRVERR\n }));\n return;\n } else {\n content = response.xml; // par defaut !\n if (self.options.rawResponse) {\n content = response;\n }\n }\n } else {\n // reponse non encapsulée :\n // ex. reponse du service en json ou xml\n content = response;\n }\n } else {\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"Le contenu de la reponse est vide !?\"));\n return;\n }\n }\n\n // si on souhaite parser la reponse du service\n if (typeof self.options.onBeforeParse === \"function\") {\n var newResponse = self.options.onBeforeParse(content);\n if (typeof newResponse === \"string\") {\n // la reponse parsée par l'utilisateur est retournée sous\n // forme de string !\n content = newResponse;\n }\n }\n // sauvegarde de la reponse dans l'objet parent (CommonService)\n self.response = content;\n // on renvoie la reponse...\n success.call(self, content);\n },\n // callback des erreurs\n onFailure : function (e) {\n self.logger.trace(\"callService::onFailure()\");\n // on est forcement sur une erreur levée par un service !\n e.type = _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TYPE_SRVERR;\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](e));\n },\n // callback de timeOut\n onTimeOut : function () {\n self.logger.trace(\"callService::onTimeOut()\");\n error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\"TimeOut!\"));\n }\n };\n\n _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__[\"default\"].send(options);\n },\n\n /**\n * Analyse de la réponse\n * @param {Function} error - callback\n * @param {Function} success - callback\n */\n analyzeResponse : function (error, success) {\n // INFO\n this.logger.error(\"overwritten method !\");\n // retourne l'objet spécifique au type de composant (json)\n if (error) {\n error.call(this, \"This method must be overwritten !\");\n }\n success.call(this, \"This method must be overwritten !\");\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (CommonService);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQ29tbW9uU2VydmljZS5qcz8xYjIyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUE4QztBQUNUO0FBQ007QUFDRTtBQUNTO0FBQ0Y7QUFDcEQ7QUFDcUM7O0FBRXJDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxTQUFTO0FBQ3BCO0FBQ0E7QU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V2ZXJzZUdlb2NvZGVcIiAmJiB0aGlzLkNMQVNTTkFNRSAhPT0gXCJBdXRvQ29tcGxldGVcIikge1xuICAgICAgICAgICAgdGhpcy5vcHRpb25zLnNlcnZlclVybCA9IEhlbHBlci5ub3JtYWx5emVVcmwodGhpcy5vcHRpb25zLnNlcnZlclVybCwge1xuICAgICAgICAgICAgICAgIFwiZ3AtYWNjZXNzLWxpYlwiIDogUGtnLnZlcnNpb24sXG4gICAgICAgICAgICAgICAgYXBpS2V5IDogdGhpcy5vcHRpb25zLmFwaUtleSB8fCBcImNhbGN1bFwiXG4gICAgICAgICAgICB9LCBmYWxzZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBzaSBsZSBwcm94eSBlc3QgcmVuc2VpZ27DqSwgb24gcHJveGlmaWUgbCd1cmwgZHUgc2VydmljZVxuICAgICAgICBpZiAoYlVybFByb3hpZmllZCkge1xuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5odHRwTWV0aG9kID09PSBcIkdFVFwiKSB7XG4gICAgICAgICAgICAgICAgc3RyVXJsUHJveGlmaWVkID0gdGhpcy5vcHRpb25zLnByb3h5VVJMICsgSGVscGVyLm5vcm1hbHl6ZVVybCh0aGlzLm9wdGlvbnMuc2VydmVyVXJsLCB0aGlzLnJlcXVlc3QsIHRydWUpO1xuICAgICAgICAgICAgICAgIHN0ckRhdGEgPSBudWxsO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmh0dHBNZXRob2QgPT09IFwiUE9TVFwiKSB7XG4gICAgICAgICAgICAgICAgc3RyVXJsUHJveGlmaWVkID0gdGhpcy5vcHRpb25zLnByb3h5VVJMICsgSGVscGVyLm5vcm1hbHl6ZVVybCh0aGlzLm9wdGlvbnMuc2VydmVyVXJsLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBzdHJEYXRhID0gdGhpcy5yZXF1ZXN0O1xuICAgICAgICAgICAgfVxuICAgICAgICB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RoaXMub3B0aW9ucy5jYWxsYmFja05hbWUgfHwgbnVsbCxcbiAgICAgICAgICAgIGRhdGEgOiBzdHJEYXRhLFxuICAgICAgICAgICAgaGVhZGVycyA6IG51bGwsIC8vIFRPRE8uLi5cbiAgICAgICAgICAgIGNvbnRlbnQgOiB0aGlzLm9wdGlvbnMuY29udGVudFR5cGUgfHwgXCJhcHBsaWNhdGlvbi94bWxcIixcbiAgICAgICAgICAgIHNjb3BlIDogdGhpcy5vcHRpb25zLnNjb3BlIHx8IHRoaXMsXG4gICAgICAgICAgICAvLyBjYWxsYmFjayBkZSByZXBvbnNlXG4gICAgICAgICAgICBvblJlc3BvbnNlIDogZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJjYWxsU2VydmljZTo6b25SZXNwb25zZSgpXCIpO1xuXG4gICAgICAgICAgICAgICAgLy8gbGUgY29udGVudSBkZSBsYSByZXBvbnNlIMOgIHJlbnZveWVyICFcbiAgICAgICAgICAgICAgICB2YXIgY29udGVudCA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAvLyBYSFIgOiBvbiByZW52b2llIHRvdWpvdXJzIGxhIHJlcG9uc2UgYnJ1dGUgZHUgc2VydmljZSAoanNvbiBvdSB4bWwpXG4gICAgICAgICAgICAgICAgLy8gYXUgcGFyc2VyIGR1IGNvbXBvc2FudC4uLlxuICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMucHJvdG9jb2wgPT09IFwiWEhSXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJSZXNwb25zZSBYSFJcIiwgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gcmVzcG9uc2U7IC8vIHBhciBkZWZhdXQsIGxhIHJlcG9uc2UgZHUgc2VydmljZSAgIVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIEpTT05QIDogb24gcHJlLWFuYWx5c2UgbGEgcmVwb25zZSBicnV0ZSBkdSBzZXJ2aWNlIChlbmNhcHN1bGVyIG91IHBhcylcbiAgICAgICAgICAgICAgICAvLyBhdmFudCBkZSBsJ2Vudm95ZXIgYXUgcGFyc2VyIGR1IGNvbXBvc2FudC4uLlxuICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMucHJvdG9jb2wgPT09IFwiSlNPTlBcIikge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmxvZ2dlci50cmFjZShcIlJlc3BvbnNlIEpTT05cIiwgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5odHRwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVwb25zZSBlbmNhcHN1bMOpZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHJlcG9uc2UgZHUgc2VydmljZSBlbiB4bWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA+IHtodHRwIDoge3N0YXR1czoyMDAsIGVycm9yOm51bGx9LHhtbCA6J3LDqXBvbnNlIGR1IHNlcnZpY2UnfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5odHRwLnN0YXR1cyAhPT0gMjAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLmNhbGwoc2VsZiwgbmV3IEVycm9yU2VydmljZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiByZXNwb25zZS5odHRwLnN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiByZXNwb25zZS5odHRwLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA6IEVycm9yU2VydmljZS5UWVBFX1NSVkVSUlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gcmVzcG9uc2UueG1sOyAvLyBwYXIgZGVmYXV0ICFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYub3B0aW9ucy5yYXdSZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCA9IHJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXBvbnNlIG5vbiBlbmNhcHN1bMOpZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXguIHJlcG9uc2UgZHUgc2VydmljZSBlbiBqc29uIG91IHhtbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgPSByZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLmNhbGwoc2VsZiwgbmV3IEVycm9yU2VydmljZShcIkxlIGNvbnRlbnUgZGUgbGEgcmVwb25zZSBlc3QgdmlkZSAhP1wiKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBzaSBvbiBzb3VoYWl0ZSBwYXJzZXIgbGEgcmVwb25zZSBkdSBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzZWxmLm9wdGlvbnMub25CZWZvcmVQYXJzZSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXdSZXNwb25zZSA9IHNlbGYub3B0aW9ucy5vbkJlZm9yZVBhcnNlKGNvbnRlbnQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG5ld1Jlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsYSByZXBvbnNlIHBhcnPDqWUgcGFyIGwndXRpbGlzYXRldXIgZXN0IHJldG91cm7DqWUgc291c1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZm9ybWUgZGUgc3RyaW5nICFcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBuZXdSZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzYXV2ZWdhcmRlIGRlIGxhIHJlcG9uc2UgZGFucyBsJ29iamV0IHBhcmVudCAoQ29tbW9uU2VydmljZSlcbiAgICAgICAgICAgICAgICBzZWxmLnJlc3BvbnNlID0gY29udGVudDtcbiAgICAgICAgICAgICAgICAvLyBvbiByZW52b2llIGxhIHJlcG9uc2UuLi5cbiAgICAgICAgICAgICAgICBzdWNjZXNzLmNhbGwoc2VsZiwgY29udGVudCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gY2FsbGJhY2sgZGVzIGVycmV1cnNcbiAgICAgICAgICAgIG9uRmFpbHVyZSA6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5sb2dnZXIudHJhY2UoXCJjYWxsU2VydmljZTo6b25GYWlsdXJlKClcIik7XG4gICAgICAgICAgICAgICAgLy8gb24gZXN0IGZvcmNlbWVudCBzdXIgdW5lIGVycmV1ciBsZXbDqWUgcGFyIHVuIHNlcnZ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cbiAgICAgICAgc3VjY2Vzcy5jYWxsKHRoaXMsIFwiVGhpcyBtZXRob2QgbXVzdCBiZSBvdmVyd3JpdHRlbiAhXCIpO1xuICAgIH1cblxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29tbW9uU2VydmljZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/CommonService.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Config/Config.js": +/*!*************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Config/Config.js ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ConfigInterface */ \"./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js\");\n\n\n\n\n\n\n/**\n * @classdesc\n *\n * Recupération de la configuration de clés Géoportail sous forme de JSON\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Config\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n * @param {Sting} options.apiKey - clé(s) dont on veut obtenir la configuration. Si plusieurs clés, séparer chacune par une virgule\n * @param {Boolean} [options.sync=false] - force le mode synchrone\n * @param {String} options.customConfigFile - chemin vers un fichier de configuration personnalisé. Surcharge le paramètre apiKey.\n *\n * @example\n * var options = {\n * apiKey : \"cartes,ortho\",\n * sync : false,\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * };\n *\n */\nfunction Config (options) {\n if (!(this instanceof Config)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Config\"));\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"Config\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Config\");\n this.logger.trace(\"[Constructeur Config (options)]\");\n\n // #####################\n // analyse des options\n // #####################\n\n // gestion du callback onSuccess\n var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === \"function\");\n if (!bOnSuccess) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"onSuccess()\"));\n }\n if (!options.apiKey && !options.customConfigFile) {\n // si pas de thème spécifié, on récupère toutes les ressources possibles dans l'objet Config\n options.apiKey = \"full\";\n }\n this.options = {};\n this.options.onSuccess = options.onSuccess;\n this.options.onFailure = options.onFailure;\n\n // mode sync\n this.options.sync = options.sync || false;\n\n // gestion d'un tableau d'url des fichiers de configuration\n this.options.listConfigUrls = (options.customConfigFile)\n ? [options.customConfigFile]\n : !Array.isArray(options.apiKey)\n ? _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Config.url(options.apiKey.split(\",\"))\n : _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Config.url(options.apiKey);\n}\n\n/**\n * @lends module:Config#\n */\nConfig.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/**\n * Constructeur (alias)\n */\nConfig.prototype.constructor = Config;\n\n/**\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.buildRequest = function (error, success) {\n // liste des urls des fichiers de configuration en JSON\n this.listConfigUrls = this.options.listConfigUrls;\n\n if (!this.listConfigUrls) {\n error.call(this, new Error(\"url by default not found !\"));\n return;\n }\n\n // INFO :\n // il n'y a pas de construction de requête,\n // on passe directement à l'appel des requêtes\n success.call(this, this.listConfigUrls);\n};\n\n/**\n * Récupération des configuration\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.callService = function (error, success) {\n if (this.options.sync) {\n __callServiceSync.call(this, error, success);\n } else {\n __callService.call(this, error, success);\n }\n};\n\n/**\n * Requêtes en mode asynchrone\n *\n * @param {*} error\n * @param {*} success\n * @private\n */\nvar __callService = function (error, success) {\n // liste des resultats au format JSON\n this.listConfigResults = [];\n\n // test on env. nodejs or browser\n let Fetch = null;\n if (typeof window === \"undefined\") {\n var nodefetch = __webpack_require__(/*! node-fetch */ \"node-fetch\");\n Fetch = nodefetch;\n } else {\n Fetch = window.fetch;\n }\n\n // the factory of fetch !\n var fetchFactory = (url) => {\n return Fetch(url, { credentials : \"same-origin\" })\n .then((response) => {\n if (response.ok) {\n return response.json()\n .then((json) => {\n // TODO :\n // tester le contenu !\n return json;\n })\n .catch((error) => {\n throw new Error(\"Exception Json : \" + error);\n });\n } else {\n throw new Error(\"Exception HTTP : \" + response.status + \" (status code) !\");\n }\n })\n .catch((error) => {\n return new Promise((resolve, reject) => {\n // eslint-disable-line no-unused-vars\n reject(error);\n });\n });\n };\n\n // construction des promises fetch\n var promises = [];\n for (let index = 0; index < this.listConfigUrls.length; index++) {\n const url = this.listConfigUrls[index];\n promises.push(fetchFactory(url));\n }\n\n Promise.all(promises)\n .then((results) => {\n if (!results) {\n throw new Error(\"results config empty !?\");\n }\n results.forEach((result) => {\n // TODO :\n // verification des resultats\n this.listConfigResults.push(result);\n });\n })\n .then(() => {\n success.call(this, this.listConfigResults);\n })\n .catch((e) => {\n // TODO :\n // construction d'un message\n error.call(this, e);\n });\n};\n\n/**\n * Requêtes en mode synchrone\n *\n * @param {*} error\n * @param {*} success\n * @private\n */\nvar __callServiceSync = function (error, success) {\n // liste des resultats au format JSON\n this.listConfigResults = [];\n\n // FIXME :\n // boucle synchrone !\n for (var i = 0; i < this.listConfigUrls.length; i++) {\n const url = this.listConfigUrls[i];\n // TODO :\n // prévoir le CORS, headers, ...\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, false);\n request.send(null);\n if (request.status === 200) {\n // TODO :\n // tester la reponse !\n var response = JSON.parse(request.responseText);\n this.listConfigResults.push(response);\n }\n }\n // callback\n if (this.listConfigResults.length !== 0) {\n success.call(this, this.listConfigResults);\n } else {\n error.call(this, new Error(\"...\"));\n }\n};\n\n/**\n * Analyse et mise en forme de la réponse en fusionnant les configurations\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n * @overload\n */\nConfig.prototype.analyzeResponse = function (error, success) {\n // fonction de merge des objects JSON\n var mergeConfig = function (objects) {\n // objet fusion des couches\n var allLayersConfig = {};\n // objet fusion des clés\n var allKeysConfig = {};\n // objet fusion des TMS\n var allTMSConfig = {};\n\n // on fusionne les résultat\n for (var i = 0; i < objects.length; i++) {\n if (!objects[i].generalOptions || !objects[i].layers) {\n return;\n }\n allKeysConfig = {\n ...allKeysConfig,\n ...objects[i].generalOptions.apiKeys\n };\n allLayersConfig = {\n ...allLayersConfig,\n ...objects[i].layers\n };\n allTMSConfig = {\n ...allTMSConfig,\n ...objects[i].tileMatrixSets\n };\n }\n\n var mergedConfig = {\n generalOptions : {\n apiKeys : allKeysConfig\n },\n layers : allLayersConfig,\n tileMatrixSets : allTMSConfig\n };\n return mergedConfig;\n };\n\n // fusion des configurations JSON\n var ConfigJSON = mergeConfig(this.listConfigResults);\n if (!ConfigJSON) {\n error.call(this, new Error(\"configuration structure not conforme !\"));\n return;\n }\n\n // creation des interfaces\n var IConfig = new _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n // ajout des interfaces avec la configuration JSON\n Object.assign(IConfig, ConfigJSON);\n\n // définition de la variable globale Gp.Config\n var scope = typeof window !== \"undefined\" ? window : {};\n if (!scope.Gp) {\n scope.Gp = {};\n }\n\n // enregistrement\n if (scope.Gp.Config) {\n Object.assign(scope.Gp.Config, IConfig);\n // dans le doute..., ceinture et bretelles !\n for (var property in IConfig) {\n scope.Gp.Config[property] = IConfig[property];\n }\n } else {\n scope.Gp.Config = IConfig;\n }\n\n // INFO :\n // il n'y a pas d'analyse des résultats,\n // on passe directement à l'appel de la callback utilisateur\n success.call(this, scope.Gp.Config);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Config);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvQ29uZmlnL0NvbmZpZy5qcz9lZjhmIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFpRDtBQUNIO0FBQ0Q7QUFDUTtBQUNMOztBQUVoRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsUUFBUTtBQUNuQixXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDBDQUEwQztBQUMxQyx1Q0FBdUM7QUFDdkM7QUFDQTtBQUNBO0FBQ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ZSBhc3luY2hyb25lXG4gKlxuICogQHBhcmFtIHsqfSBlcnJvclxuICogQHBhcmFtIHsqfSBzdWNjZXNzXG4gKiBAcHJpdmF0ZVxuICovXG52YXIgX19jYWxsU2VydmljZSA9IGZ1bmN0aW9uIChlcnJvciwgc3VjY2Vzcykge1xuICAgIC8vIGxpc3RlIGRlcyByZXN1bHRhdHMgYXUgZm9ybWF0IEpTT05cbiAgICB0aGlzLmxpc3RDb25maWdSZXN1bHRzID0gW107XG5cbiAgICAvLyB0ZXN0IG9uIGVudi4gbm9kZWpzIG9yIGJyb3dzZXJcbiAgICBsZXQgRmV0Y2ggPSBudWxsO1xuICAgIGlmICh0eXBlb2Ygd2luZG93ID09PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgIHZhciBub2RlZmV0Y2ggPSByZXF1aXJlKFwibm9kZS1mZXRjaFwiKTtcbiAgICAgICAgRmV0Y2ggPSBub2RlZmV0Y2g7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgRmV0Y2ggPSB3aW5kb3cuZmV0Y2g7XG4gICAgfVxuXG4gICAgLy8gdGhlIGZhY3Rvcnkgb2YgZmV0Y2ggIVxuICAgIHZhciBmZXRjaEZhY3RvcnkgPSAodXJsKSA9PiB7XG4gICAgICAgIHJldHVybiBGZXRjaCh1cmwsIHsgY3JlZGVudGlhbHMgOiBcInNhbWUtb3JpZ2luXCIgfSlcbiAgICAgICAgICAgIC50aGVuKChyZXNwb25zZSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5vaykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2UuanNvbigpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbigoanNvbikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRlc3RlciBsZSBjb250ZW51ICFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ganNvbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2F0Y2goKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRXhjZXB0aW9uIEpzb24gOiBcIiArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkV4Y2VwdGlvbiBIVFRQIDogXCIgKyByZXNwb25zZS5zdGF0dXMgKyBcIiAoc3RhdHVzIGNvZGUpICFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYXRjaCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgLy8gY29uc3RydWN0aW9uIGRlcyBwcm9taXNlcyBmZXRjaFxuICAgIHZhciBwcm9taXNlcyA9IFtdO1xuICAgIGZvciAobGV0IGluZGV4ID0gMDsgaW5kZXggPCB0aGlzLmxpc3RDb25maWdVcmxzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICBjb25zdCB1cmwgPSB0aGlzLmxpc3RDb25maWdVcmxzW2luZGV4XTtcbiAgICAgICAgcHJvbWlzZXMucHVzaChmZXRjaEZhY3RvcnkodXJsKSk7XG4gICAgfVxuXG4gICAgUHJvbWlzZS5hbGwocHJvbWlzZXMpXG4gICAgICAgIC50aGVuKChyZXN1bHRz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cnJldXJzXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBzdWNjZXNzIC0gY2FsbGJhY2tcbiAqIEBvdmVybG9hZFxuICovXG5Db25maWcucHJvdG90eXBlLmFuYWx5emVSZXNwb25zZSA9IGZ1bmN0aW9uIChlcnJvciwgc3VjY2Vzcykge1xuICAgIC8vIGZvbmN0aW9uIGRlIG1lcmdlIGRlcyBvYmplY3RzIEpTT05cbiAgICB2YXIgbWVyZ2VDb25maWcgPSBmdW5jdGlvbiAob2JqZWN0cykge1xuICAgICAgICAvLyBvYmpldCBmdXNpb24gZGVzIGNvdWNoZXNcbiAgICAgICAgdmFyIGFsbExheWVyc0NvbmZpZyA9IHt9O1xuICAgICAgICAvLyBvYmpldCBmdXNpb24gZGVzIGNsw6lzXG4gICAgICAgIHZhciBhbGxLZXlzQ29uZmlnID0ge307XG4gICAgICAgIC8vIG9iamV0IGZ1c2lvbiBkZXMgVE1TXG4gICAgICAgIHZhciBhbGxUTVNDb25maWcgPSB7fTtcblxuICAgICAgICAvLyBvbiBmdXNpb25uZSBsZXMgcsOpc3VsdGF0XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqZWN0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKCFvYmplY3RzW2ldLmdlbmVyYWxPcHRpb25zIHx8ICFvYmplY3RzW2ldLmxheWVycykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFsbEtleXNDb25maWcgPSB7XG4gICAgICAgICAgICAgICAgLi4uYWxsS2V5c0NvbmZpZyxcbiAgICAgICAgICAgICAgICAuLi5vYmplY3RzW2ldLmdlbmVyYWxPcHRpb25zLmFwaUtleXNcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhbGxMYXllcnNDb25maWcgPSB7XG4gICAgICAgICAgICAgICAgLi4uYWxsTGF5ZXJzQ29uZmlnLFxuICAgICAgICAgICAgICAgIC4uLm9iamVjdH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uIGRlIGxhIHZhcmlhYmxlIGdsb2JhbGUgR3AuQ29uZmlnXG4gICAgdmFyIHNjb3BlID0gdHlwZW9mIHdpbmRvdyAhPT0gXCJ1bmRlZmluZWRcIiA/IHdpbmRvdyA6IHt9O1xuICAgIGlmICghc2NvcGUuR3ApIHtcbiAgICAgICAgc2NvcGUuR3AgPSB7fTtcbiAgICB9XG5cbiAgICAvLyBlbnJlZ2lzdHJlbWVudFxuICAgIGlmIChzY29wZS5HcC5Db25maWcpIHtcbiAgICAgICAgT2JqZWN0LmFzc2lnbihzY29wZS5HcC5Db25maWcsIElDb25maWcpO1xuICAgICAgICAvLyBkYW5zIGxlIGRvdXRlLi4uLCBjZWludHVyZSBldCBicmV0ZWxsZXMgIVxuICAgICAgICBmb3IgKHZhciBwcm9wZXJ0eSBpbiBJQ29uZmlnKSB7XG4gICAgICAgICAgICBzY29wZS5HcC5Db25maWdbcHJvcGVydHldID0gSUNvbmZpZ1twcm9wZXJ0eV07XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICBzY29wZS5HcC5Db25maWcgPSBJQ29uZmlnO1xuICAgIH1cblxuICAgIC8vIElORk8gOlxuICAgIC8vIGlsIG4neSBhIHBhcyBkJ2FuYWx5c2UgZGVzIHLDqXN1bHRhdHMsXG4gICAgLy8gb24gcGFzc2UgZGlyZWN0ZW1lbnQgw6AgbCdhcHBlbCBkZSBsYSBjYWxsYmFjayB1dGlsaXNhdGV1clxuICAgIHN1Y2Nlc3MuY2FsbCh0aGlzLCBzY29wZS5HcC5Db25maWcpO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29uZmlnO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Config/Config.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Response object for {@link module:Services~getConfig Gp.Services.getConfig ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Object} generalOptions - General properties for default map configuration resources.\n * @property {Object} generalOptions.apiKeys - Object that associates apiKey (s) with an array of resources IDs availables with that key.\n * @property {String} generalOptions.title - Underlying web service Title.\n * @property {String} generalOptions.defaultGMLGFIStyle - XSL URL used by default to translate an XML GetFeatureInfo response into an HTML array.\n * @property {String} generalOptions.theme - default theme (FIXME : for what ?)\n * @property {Array.} generalOptions.wgs84Resolutions - geographical resolutions Array for each [zoom level of the Geoportal platform]{@link http://api.ign.fr/tech-docs-js/webmaster/layers.html#Geoportal_resolutions} from 0 to 21. Expressed in degrees/pixel.\n * @property {Object} layers - Associative array mapping resources availables IDs (keys) with their properties (values given as {@link Gp.Services.Config.Layer}).\n * @property {Object} tileMatrixSets - Associative Array mapping TileMatrixSets IDs (keys) availables with their properties (values given as {@link Gp.Services.Config.TileMatrixSet}).\n *\n * @namespace\n * @alias Gp.Services.GetConfigInterface\n */\nfunction ConfigInterface () {\n if (!(this instanceof ConfigInterface)) {\n throw new TypeError(\"ConfigInterface constructor cannot be called as a function.\");\n }\n\n this.generalOptions = {\n apiKeys : {},\n title : null,\n defaultGMLGFIStyle : null,\n theme : null,\n wgs84Resolutions : []\n };\n\n this.layers = {};\n\n this.tileMatrixSets = {};\n}\n\nConfigInterface.prototype = {\n\n /*\n * Constructor (alias)\n */\n constructor : ConfigInterface,\n\n /**\n * Check if config is loaded for a given key\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Boolean} isKeyConfLoaded - true if config of the key is already loaded, false otherwise\n */\n isKeyConfLoaded : function (apiKey) {\n if (!apiKey) {\n return;\n }\n if (this.generalOptions.apiKeys[apiKey]) {\n return true;\n }\n return false;\n },\n\n /**\n * Returns an array of Geoportal layers identifiers, corresponding to an API contract key.\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Array} apiKeys - Array of geoportal layers identifiers\n */\n getLayersId : function (apiKey) {\n return this.generalOptions.apiKeys[apiKey];\n },\n\n /**\n * Returns the id of a Geoportal layer with its name and its service.\n *\n * @param {String} layerName - name of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {String} service - name of the service (ex. \"WMS\" ou \"WMTS\")\n * @returns {String} Id of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS\")\n */\n getLayerId : function (layerName, service) {\n if (!layerName || !service) {\n return;\n }\n var layerId = null;\n\n // layer\n // key : [layerName]$[contexte]:OGC:[service]\n // ex : \"ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS\"\n\n // service\n // key : [layerName]$[contexte];[service]\n // ex : PositionOfInterest$OGC:OPENLS;ReverseGeocode\n\n if (this.layers) {\n var layers = this.layers;\n for (var key in layers) {\n if (layers.hasOwnProperty(key)) {\n var parts = key.split(\"$\");\n if (layerName === parts[0]) {\n if (parts[1]) {\n var servicePartsLayer = parts[1].split(\":\");\n var servicePartsService = parts[1].split(\";\");\n\n if (servicePartsService[1] === service.toUpperCase()) {\n layerId = key;\n break;\n }\n if (servicePartsLayer[2] === service.toUpperCase()) {\n layerId = key;\n break;\n }\n }\n }\n }\n }\n }\n if (!layerId) {\n return;\n }\n return layerId;\n },\n\n /**\n * Returns an associative array of Geoportal layers configurations, corresponding to an API contract key.\n * If no key is specified, all layers from configuration are returned.\n *\n * @param {String} apiKey - Access key to Geoportal platform\n * @returns {Object} layers - Object which properties are layers identifiers.\n */\n getLayersConf : function (apiKey) {\n var layers = {};\n var layersIdArray = this.getLayersId(apiKey);\n if (layersIdArray) {\n for (var i = 0; i < layersIdArray.length; i++) {\n var lyrId = layersIdArray[i];\n layers[lyrId] = this.layers[lyrId];\n }\n }\n return layers;\n },\n\n /**\n * Returns a geoportal layer configuration, given its identifier\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @return {Object} layer - Layer configuration\n */\n getLayerConf : function (layerId) {\n if (!this.layers) {\n return;\n }\n return this.layers[layerId];\n },\n\n /**\n * Get all parameters needed to display a WMS or WMTS layer given its name, its service and its key\n *\n * @param {String} layerName - name of the layer (ex. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {String} service - name of the service (ex. \"WMS\" ou \"WMTS\")\n * @param {String} [apiKey] - Contract API key\n * @returns {Object} params - params of the service (WMS or WMTS) for the given layer\n * @returns {String} params.url - Url of the service to reach to display the layer\n * @returns {String} params.version - Version of the service\n * @returns {String} params.styles - Default style of the layer\n * @returns {String} params.format - Default format of the layer\n * @returns {String} params.projection - Default projection of the layer\n * @returns {Number} params.minScale - Min scale denominator of the layer\n * @returns {Number} params.maxScale - Max scale denominator of the layer\n * @returns {Gp.BBox} params.extent - Extent of the layer, in the projection of the layer\n * @returns {Array} params.legends - Array of legends associated to the layer\n * @returns {Array} params.title - Name of the layer, readable by a human\n * @returns {Array} params.description - Description of the layer\n * @returns {String} params.[TMSLink] - Id of the Tile Matrix Set (TMS), in the case of WMTS layer\n * @returns {Gp.Point} params.[matrixOrigin] - Originof the tile matrix (top left corner), in the case of WMTS layer\n * @returns {Array} params.[nativeResolutions] - Array with the resolution of each level of the tile matrix set, in the case of WMTS layer\n * @returns {Array} params.[matrixIds] - Array with the ID of each level of the tile matrix set, in the case of WMTS layer\n */\n getLayerParams : function (layerName, service) {\n var params = {};\n\n if ((service === \"WMS\" || Object.keys(this.tileMatrixSets).length !== 0) && Object.keys(this.layers).length !== 0) {\n // get the layerId of the layer\n var layerId = this.getLayerId(layerName, service);\n\n if (layerId) {\n // get the layer Conf Object\n var layerConf = this.getLayerConf(layerId);\n\n var keys = this.getLayerKey(layerId);\n if (keys.length === 0) {\n return;\n }\n\n // get services params\n for (var i = 0; i < keys.length; i++) {\n // only one serverUrl is saved in Gp.Config : with multiKeys, we have to retrieve the key used in the serverUrl property\n if (layerConf.serviceParams.serverUrl[keys[i]]) {\n params.url = layerConf.serviceParams.serverUrl[keys[i]];\n }\n }\n\n const wmsTypeRegex = /\\/v\\//;\n // WMS vector style always empty (not in getCap)\n if (wmsTypeRegex.test(params.url)) {\n params.styles = \" \";\n } else {\n // WMS raster style is defined in getCap\n params.styles = layerConf.styles[0].name;\n }\n\n params.version = layerConf.serviceParams.version;\n params.format = layerConf.formats[0].name;\n params.projection = layerConf.defaultProjection;\n\n // get layer info and constraints\n params.minScale = layerConf.globalConstraint.minScaleDenominator;\n params.maxScale = layerConf.globalConstraint.maxScaleDenominator;\n params.extent = layerConf.globalConstraint.bbox;\n params.legends = layerConf.legends;\n params.title = layerConf.title;\n params.description = layerConf.description;\n\n if (service === \"WMS\") {\n params.metadata = layerConf.metadata;\n }\n\n // Informations non disponibles avec les getCap\n // params.metadata = layerConf.getMetadata();\n // params.originators = layerConf.getOriginators();\n // params.quicklookUrl = layerConf.getQuicklookUrl();\n\n // WMTS : get the tileMatrixSetLimits\n if (layerConf.wmtsOptions) {\n params.tileMatrixSetLimits = layerConf.wmtsOptions.tileMatrixSetLimits;\n var TMSLink = layerConf.wmtsOptions.tileMatrixSetLink;\n if (TMSLink) {\n params.TMSLink = TMSLink;\n var tmsConf = this.getTMSConf(TMSLink);\n // Get matrix origin : Gp.Point = Object{x:Float, y:Float}\n // params.matrixOrigin = tmsConf.getTopLeftCorner();\n params.matrixIds = Object.keys(tmsConf.tileMatrices);\n params.tileMatrices = tmsConf.tileMatrices;\n // by default, pseudo mercator resolutions\n params.nativeResolutions = tmsConf.nativeResolutions || this.getTMSConf(\"PM\").nativeResolutions;\n }\n }\n }\n }\n return params;\n },\n\n /**\n * Get the contract key(s) associated to a given layer.\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @return {Array} layerKey - array of key(s) associated to the given layer\n */\n getLayerKey : function (layerId) {\n var layerKey = [];\n if (this.generalOptions && this.generalOptions.apiKeys && Object.keys(this.generalOptions.apiKeys).length !== 0) {\n var resourcesByKey = this.generalOptions.apiKeys;\n for (var key in resourcesByKey) {\n var resourcesArray = resourcesByKey[key];\n resourcesArray.forEach(function (arrayLayerId) {\n if (arrayLayerId === layerId) {\n layerKey.push(key);\n }\n });\n }\n }\n return layerKey;\n },\n\n /**\n * Returns an associative array of Tile Matrix Sets configurations.\n *\n * @return {Object} tileMatrixSets - Object which properties are TMS identifiers\n *\n */\n getTileMatrixSets : function () {\n return this.tileMatrixSets;\n },\n\n /**\n * Returns a Tile Matrix Sets configuration, given its identifier.\n *\n * @param {String} tmsID - Tile Matrix Set identifier (e.g. : \"PM\")\n * @return {Object} tileMatrixSet - Tile Matrix Set configuration\n */\n getTMSConf : function (tmsID) {\n if (!this.tileMatrixSets) {\n return;\n }\n return this.tileMatrixSets[tmsID];\n },\n\n /**\n * Get global constraints for a given Layer : extent, minScale, maxScale, projection\n *\n * @param {String} layerId - Geoportal layer identifier (e.g. \"GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS\")\n * @returns {Object} params - layer constraints\n * @returns {String} params.projection - default layer projection\n * @returns {Number} params.minScale - layer min scale denominator\n * @returns {Number} params.maxScale - layer max scale denominator\n * @returns {Gp.BBox} params.extent - layer extent expressed in the layer projection\n */\n getGlobalConstraints : function (layerId) {\n var params = {};\n\n if (layerId) {\n // get layer configuration object\n var layerConf = this.getLayerConf(layerId);\n params.projection = layerConf.defaultProjection;\n params.minScale = layerConf.globalConstraint.minScaleDenominator;\n params.maxScale = layerConf.globalConstraint.maxScaleDenominator;\n params.extent = layerConf.globalConstraint.bbox;\n }\n\n return params;\n }\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ConfigInterface);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;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BpZiAocGFydHNbMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VydmljZVBhcnRzTGF5ZXIgPSBwYXJ0c1sxXS5zcGxpdChcIjpcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcnZpY2VQYXJ0c1NlcnZpY2UgPSBwYXJ0c1sxXS5zcGxpdChcIjtcIik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VydmljZVBhcnRzU2VydmljZVsxXSA9PT0gc2VydmljZS50b1VwcGVyQ2FzZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheWVySWQgPSBrZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VydmljZVBhcnRzTGF5ZXJbMl0gPT09IHNlcnZpY2UudG9VcHBlckNhc2UoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXllcklkID0ga2V5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFsYXllcklkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGxheWVySWQ7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYW4gYXNzb2NpYXRpdmUgYXJyYXkgb2YgR2VvcG9ydGFsIGxheWVycyBjb25maWd1cmF0aW9ucywgY29ycmVzcG9uZGluZyB0byBhbiBBUEkgY29udHJhY3Qga2V5LlxuICAgICAqIElmIG5vIGtle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B7R3AuUG9pbnR9IHBhcmFtcy5bbWF0cml4T3JpZ2luXSAgIC0gT3JpZ2lub2YgdGhlIHRpbGUgbWF0cml4ICh0b3AgbGVmdCBjb3JuZXIpLCBpbiB0aGUgY2FzZSBvZiBXTVRTIGxheWVyXG4gICAgICogQHJldHVybnMge0FycmF5fSBwYXJhbXMuW25hdGl2ZVJlc29sdXRpb25zXSAtIEFycmF5IHdpdGggdGhlIHJlc29sdXRpb24gb2YgZWFjaCBsZXZlbCBvZiB0aGUgdGlsZSBtYXRyaXggc2V0LCBpbiB0aGUgY2FzZSBvZiBXTVRTIGxheWVyXG4gICAgICogQHJldHVybnMge0FycmF5fSBwYXJhbXMuW21hdHJpeElkc10gICAgICAgICAtIEFycmF5IHdpdGggdGhlIElEIG9mIGVhY2ggbGV2ZWwgb2YgdGhlIHRpbGUgbWF0cml4IHNldCwgaW4gdGhlIGNhc2Ugb2YgV01UUyBsYXllclxuICAgICAqL1xuICAgIGdldExheWVyUGFyYW1zIDogZnVuY3Rpb24gKGxheWVyTmFtZSwgc2VydmljZSkge1xuICAgICAgICB2YXIgcGFyYW1zID0ge307XG5cbiAgICAgICAgaWYgKChzZXJ2aWNlID09PSBcIldNU1wiIHx8IE9iamVjdC5rZXlzKHRoaXMudGlsZU1hdHJpeFNldHMpLmxlbmd0aCAhPT0gMCkgJiYgT2JqZWN0LmtleXModGhpcy5sYXllcnMpLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgLy8gZ2V0IHRoZSBsYXllcklkIG9mIHRoZSBsYXllclxuICAgICAgICAgICAgdmFyIGxheWVySWQgPSB0aGlzLmdldExheWVySWQobGF5ZXJOYW1lLCBzZXJ2aWNlKTtcblxuICAgICAgICAgICAgaWYgKGxheWVySWQpIHtcbiAgICAgICAgICAgICAgICAvLyBnZXQgdGhlIGxheWVyIENvbmYgT2JqZWN0XG4gICAgICAgICAgICAgICAgdmFyIGxheWVyQ29uZiA9IHRoaXMuZ2V0TGF5ZXJDb25mKGxheWVySWQpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGtleXMgPSB0aGlzLmdldExheWVyS2V5KGxheWVySWQpO1xuICAgICAgICAgICAgICAgIGlmIChrZXlzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gZ2V0IHNlcnZpY2VzIHBhcmFtc1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IG9uZSBzZXJ2ZXJVcmwgaXMgc2F2ZWQgaW4gR3AuQ29uZmlnIDogd2l0aCBtdWx0aUtleXMsIHdlIGhhdmUgdG8gcmV0cmlldmUgdGhlIGtleSB1c2VkIGluIHRoZSBzZXJ2ZXJVcmwgcHJvcGVydHlcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnNlcnZlclVybFtrZXlzW2ldXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnVybCA9IGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnNlcnZlclVybFtrZXlzW2ldXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IHdtc1R5cGVSZWdleCA9IC9cXC92XFwvLztcbiAgICAgICAgICAgICAgICAvLyBXTVMgdmVjdG9yIHN0eWxlIGFsd2F5cyBlbXB0eSAobm90IGluIGdldENhcClcbiAgICAgICAgICAgICAgICBpZiAod21zVHlwZVJlZ2V4LnRlc3QocGFyYW1zLnVybCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnN0eWxlcyA9IFwiIFwiO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdNUyByYXN0ZXIgc3R5bGUgaXMgZGVmaW5lZCBpbiBnZXRDYXBcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zLnN0eWxlcyA9IGxheWVyQ29uZi5zdHlsZXNbMF0ubmFtZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBwYXJhbXMudmVyc2lvbiA9IGxheWVyQ29uZi5zZXJ2aWNlUGFyYW1zLnZlcnNpb247XG4gICAgICAgICAgICAgICAgcGFyYW1zLmZvcm1hdCA9IGxheWVyQ29uZi5mb3JtYXRzWzBdLm5hbWU7XG4gICAgICAgICAgICAgICAgcGFyYW1zLnByb2plY3Rpb24gPSBsYXllckNvbmYuZGVmYXVsdFByb2plY3Rpb247XG5cbiAgICAgICAgICAgICAgICAvLyBnZXQgbGF5ZXIgaW5mbyBhbmQgY29uc3RyYWludHNcbiAgICAgICAgICAgICAgICBwYXJhbXMubWluU2NhbGUgPSBsYXllckNvbmYuZ2xvYmFsQ29uc3RyYWludC5taW5TY2FsZURlbm9taW5hdG9yO1xuICAgICAgICAgICAgICAgIHBhcmFtcy5tYXhTY2FsZSA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50Lm1heFNjYWxlRGVub21pbmF0b3I7XG4gICAgICAgICAgICAgICAgcGFyYW1zLmV4dGVudCA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50LmJib3g7XG4gICAgICAgICAgICAgICAgcGFyYW1zLmxlZ2VuZHMgPSBsYXllckNvbmYubGVnZW5kcztcbiAgICAgICAgICAgICAgICBwYXJhbXMudGl0bGUgPSBsYXllckNvbmYudGl0bGU7XG4gICAgICAgICAgICAgICAgcGFyYW1zLmRlc2NyaXB0aW9uID0gbGF5ZXJDb25mLmRlc2NyaXB0aW9uO1xuXG4gICAgICAgICAgICAgICAgaWYgKHNlcnZpY2UgPT09IFwiV01TXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zLm1ldGFkYXRhID0gbGF5ZXJDb25mLm1ldGFkYXRhO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIEluZm9ybWF0aW9ucyAgbm9uIGRpc3BvbmlibGVzIGF2ZWMgbGVzIGdldENhcFxuICAgICAgICAgICAgICAgIC8vIHBhcmFtcy5tZXRhZGF0YSA9IGxheWVyQ29uZi5nZXRNZXRhZGF0YSgpO1xuICAgICAgICAgICAgICAgIC8vIHBhcmFtcy5vcmlnaW5hdG9ycyA9IGxheWVyQ29uZi5nZXRPcmlnaW5hdG9ycygpO1xuICAgICAgICAgICAgICAgIC8vIHBhcmFtcy5xdWlja2xvb2tVcmwgPSBsYXllckNvbmYuZ2V0UXVpY2tsb29rVXJsKCk7XG5cbiAgICAgICAgICAgICAgICAvLyBXTVRTIDogZ2V0IHRoZSB0aWxlTWF0cml4U2V0TGltaXRzXG4gICAgICAgICAgICAgICAgaWYgKGxheWVyQ29uZi53bXRzT3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXMudGlsZU1hdHJpeFNldExpbWl0cyA9IGxheWVyQ29uZi53bXRzT3B0aW9ucy50aWxlTWF0cml4U2V0TGltaXRzO1xuICAgICAgICAgICAgICAgICAgICB2YXIgVE1TTGluayA9IGxheWVyQ29uZi53bXRzT3B0aW9ucy50aWxlTWF0cml4U2V0TGluaztcbiAgICAgICAgICAgICAgICAgICAgaWYgKFRNU0xpbmspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5UTVNMaW5rID0gVE1TTGluaztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXNDb25mID0gdGhpcy5nZXRUTVNDb25mKFRNU0xpbmspO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IG1hdHJpeCBvcmlnaW4gOiBHcC5Qb2ludCA9IE9iamVjdHt4OkZsb2F0LCB5OkZsb2F0fVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFyYW1zLm1hdHJpeE9yaWdpbiA9IHRtc0NvbmYuZ2V0V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Z2VuZXJhbE9wdGlvbnMgJiYgdGhpcy5nZW5lcmFsT3B0aW9ucy5hcGlLZXlzICYmIE9iamVjdC5rZXlzKHRoaXMuZ2VuZXJhbE9wdGlvbnMuYXBpS2V5cykubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgICB2YXIgcmVzb3VyY2VzQnlLZXkgPSB0aGlzLmdlbmVyYWxPcHRpb25zLmFwaUtleXM7XG4gICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gcmVzb3VyY2VzQnlLZXkpIHtcbiAgICAgICAgICAgICAgICB2YXIgcmVzb3VyY2VzQXJyYXkgPSByZXNvdXJjZXNCeUtleVtrZXldO1xuICAgICAgICAgICAgICAgIHJlc291cmNlc0FycmF5LmZvckVhY2goZnVuY3Rpb24gKGFycmF5TGF5ZXJJZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYXJyYXlMYXllcklkID09PSBsYXllcklkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXllcktleS5wdXNoKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbGF5ZXJLZXk7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYW4gYXNzb2NpYXRpdmUgYXJyYXkgb2YgVGlsZSBNYXRyaXggU2V0cyBjb25maWd1cmF0aW9ucy5cbiAgICAgKlxuICAgICAqIEByZXR1cm4ge09iamVjdH0gdGlsZU1hdHJpeFNldHMgLSBPYmplY3Qgd2hpY2ggcHJvcGVydGllcyBhcmUgVE1TIGlkZW50aWZpZXJzXG4gICAgICpcbiAgICAgKi9cbiAgICBnZXRUaWxlTWF0cml4U2V0cyA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMudGlsZU1hdHJpeFNldHM7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSBU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FyYW1zLm1heFNjYWxlICAgLSBsYXllciBtYXggc2NhbGUgZGVub21pbmF0b3JcbiAgICAgKiBAcmV0dXJucyB7R3AuQkJveH0gcGFyYW1zLmV4dGVudCAgICAtIGxheWVyIGV4dGVudCBleHByZXNzZWQgaW4gdGhlIGxheWVyIHByb2plY3Rpb25cbiAgICAgKi9cbiAgICBnZXRHbG9iYWxDb25zdHJhaW50cyA6IGZ1bmN0aW9uIChsYXllcklkKSB7XG4gICAgICAgIHZhciBwYXJhbXMgPSB7fTtcblxuICAgICAgICBpZiAobGF5ZXJJZCkge1xuICAgICAgICAgICAgLy8gZ2V0IGxheWVyIGNvbmZpZ3VyYXRpb24gb2JqZWN0XG4gICAgICAgICAgICB2YXIgbGF5ZXJDb25mID0gdGhpcy5nZXRMYXllckNvbmYobGF5ZXJJZCk7XG4gICAgICAgICAgICBwYXJhbXMucHJvamVjdGlvbiA9IGxheWVyQ29uZi5kZWZhdWx0UHJvamVjdGlvbjtcbiAgICAgICAgICAgIHBhcmFtcy5taW5TY2FsZSA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50Lm1pblNjYWxlRGVub21pbmF0b3I7XG4gICAgICAgICAgICBwYXJhbXMubWF4U2NhbGUgPSBsYXllckNvbmYuZ2xvYmFsQ29uc3RyYWludC5tYXhTY2FsZURlbm9taW5hdG9yO1xuICAgICAgICAgICAgcGFyYW1zLmV4dGVudCA9IGxheWVyQ29uZi5nbG9iYWxDb25zdHJhaW50LmJib3g7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcGFyYW1zO1xuICAgIH1cblxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29uZmlnSW50ZXJmYWNlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Config/ConfigInterface.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// cette classe contient les URLs par defaut des services.\n// DefaultUrlService.Alti.url(key)[elevation-json]\n// DefaultUrlService.Alti.url(key)[elevation-xml]\n// DefaultUrlService.Alti.url(key)[profil-json]\n// DefaultUrlService.Alti.url(key)[profil-xml]\n// DefaultUrlService.ProcessIsoCurve.url(key)\n// DefaultUrlService.AutoComplete.url(key)\n// DefaultUrlService.ReverseGeocode.url(key)\n// DefaultUrlService.Geocode.url(key)\n// DefaultUrlService.Route.url(key)\n\n// Example :\n//\n// DefaultUrlService.Alti.url('alti')[elevation-json]\n// output {String} -> http://wxs.ign.fr/calcul/alti/rest/elevation.json\n//\n// DefaultUrlService.Alti.url('calcul')\n// output {Object|String}\n// -> http://wxs.ign.fr/calcul/alti/rest/elevation.json\n// -> http://wxs.ign.fr/calcul/alti/rest/elevation.xml\n// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.json\n// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.xml\n//\n// ssl by default.\n//\n// Force to not do ssl :\n// DefaultUrlService.ssl = false;\n//\n// DefaultUrlService.AutoComplete.url('calcul')\n// output {Object|String}\n// -> https://wxs.ign.fr/calcul/ols/apis/completion\n\n// constantes internes\nvar HOSTNAME = \"wxs.ign.fr\";\n\n/**\n * Default Geoportal web services URLs access.\n *\n * @namespace\n * @alias Gp.Services.DefaultUrl\n */\nvar DefaultUrlService = {\n\n /** if set true, require the use of https protocol */\n ssl : true,\n\n /**\n * base url of services (ssl protocol management)\n * @param {String} path - path\n * @returns {String} url\n */\n url : function (path) {\n // comportement par défaut => https\n // sinon, il est fixé par l'option 'ssl' (false => http)\n var _protocol;\n if (DefaultUrlService.ssl === false) {\n _protocol = \"http://\";\n } else {\n _protocol = \"https://\";\n }\n\n return _protocol + HOSTNAME + path;\n },\n\n /**\n * base new-url of services (ssl protocol management)\n * @param {String} path - path\n * @returns {String} url\n */\n newUrl : function (path, hostname) {\n // comportement par défaut => https\n // sinon, il est fixé par l'option 'ssl' (false => http)\n var _protocol;\n if (DefaultUrlService.ssl === false) {\n _protocol = \"http://\";\n } else {\n _protocol = \"https://\";\n }\n\n return _protocol + hostname + path;\n },\n\n /**\n * Elevation web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns elevation service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols (\"elevation-json\", \"elevation-xml\", \"profil-json\" or \"profil-xml\").\n */\n Alti : {\n new_key : {\n // rest\n \"elevation-json\" : \"/altimetrie/1.0/calcul/alti/rest/elevation.json\",\n \"elevation-xml\" : \"/altimetrie/1.0/calcul/alti/rest/elevation.xml\",\n \"profil-json\" : \"/altimetrie/1.0/calcul/alti/rest/elevationLine.json\",\n \"profil-xml\" : \"/altimetrie/1.0/calcul/alti/rest/elevationLine.xml\"\n },\n _key : {\n // rest\n \"elevation-json\" : \"/calcul/alti/rest/elevation.json\",\n \"elevation-xml\" : \"/calcul/alti/rest/elevation.xml\",\n \"profil-json\" : \"/calcul/alti/rest/elevationLine.json\",\n \"profil-xml\" : \"/calcul/alti/rest/elevationLine.xml\",\n // other\n wps : \"/alti/wps\"\n },\n /**\n * newurl from geoplateforme service\n * @param {String} key - key\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n /**\n * url from wxs service\n * @returns {String} url\n */\n url : function () {\n return {\n // rest\n \"elevation-json\" : DefaultUrlService.url(this._key[\"elevation-json\"]),\n \"elevation-xml\" : DefaultUrlService.url(this._key[\"elevation-xml\"]),\n \"profil-json\" : DefaultUrlService.url(this._key[\"profil-json\"]),\n \"profil-xml\" : DefaultUrlService.url(this._key[\"profil-xml\"])\n };\n }\n },\n /**\n * IsoCurve web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns isocurve service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols (\"iso-json\" or \"iso-xml\").\n */\n ProcessIsoCurve : {\n\n new_key : \"/itineraire/isochrone\",\n\n _key : \"/calcul/geoportail/isochrone/rest/1.0.0/isochrone\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url from wxs service\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Config web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns config service default urls with or without geoportal access key given as a parameter.\n */\n Config : {\n _key : \"https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/dist/\",\n /**\n * url\n * @param {String} key - key\n * @returns {String} url\n */\n url : function (key) {\n // key must be an array of one or several keys\n if (!Array.isArray(key)) {\n key = key.split(\",\");\n }\n // not homogeneous with others geoportal services URLs\n var url = [];\n for (var i = 0; i < key.length; i++) {\n url[i] = this._key + key[i] + \"Config.json\";\n }\n return url;\n }\n },\n /**\n * Autocompletion web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns autocomplete service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n AutoComplete : {\n new_key : \"/completion\",\n\n _key : \"/calcul/geoportail/geocodage/rest/0.1/completion\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url\n * @returns {String} url\n */\n url : function (key) {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Reverse geocoding web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns reverse geocoding service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n ReverseGeocode : {\n new_key : \"/reverse\",\n\n _key : \"/calcul/geoportail/geocodage/rest/0.1/reverse\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Geocoding web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns geocoding service default urls with or without geoportal access key given as a parameter. The result is a String.\n */\n Geocode : {\n new_key : \"/search\",\n\n _key : \"/calcul/geoportail/geocodage/rest/0.1/search\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n },\n /**\n * Routing web service access\n *\n * @member {Object}\n * @property {Function} url (key) - Returns routing service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols.\n */\n Route : {\n new_key : \"/itineraire/route\",\n\n _key : \"/calcul/geoportail/itineraire/rest/1.0.0/route\",\n\n /**\n * url from geoplateforme service\n * @returns {String} url\n */\n newUrl : function () {\n return;\n },\n\n /**\n * url from wxs service\n * @returns {String} url\n */\n url : function () {\n return DefaultUrlService.url(this._key);\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (DefaultUrlService);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvRGVmYXVsdFVybFNlcnZpY2UuanM/MzE5NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLFlBQVksT0FBTztBQUNuQjtBQUNBO0FBQ0EsV0FBVztBQUNYO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXO0FBQ1g7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO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xLjAvY2FsY3VsL2FsdGkvcmVzdC9lbGV2YXRpb24ueG1sXCIsXG4gICAgICAgICAgICBcInByb2ZpbC1qc29uXCIgOiBcIi9hbHRpbWV0cmllLzEuMC9jYWxjdWwvYWx0aS9yZXN0L2VsZXZhdGlvbkxpbmUuanNvblwiLFxuICAgICAgICAgICAgXCJwcm9maWwteG1sXCIgOiBcIi9hbHRpbWV0cmllLzEuMC9jYWxjdWwvYWx0aS9yZXN0L2VsZXZhdGlvbkxpbmUueG1sXCJcbiAgICAgICAgfSxcbiAgICAgICAgX2tleSA6IHtcbiAgICAgICAgICAgIC8vIHJlc3RcbiAgICAgICAgICAgIFwiZWxldmF0aW9uLWpzb25cIiA6IFwiL2NhbGN1bC9hbHRpL3Jlc3QvZWxldmF0aW9uLmpzb25cIixcbiAgICAgICAgICAgIFwiZWxldmF0aW9uLXhtbFwiIDogXCIvY2FsY3VsL2FsdGkvcmVzdC9lbGV2YXRpb24ueG1sXCIsXG4gICAgICAgICAgICBcInByb2ZpbC1qc29uXCIgOiBcIi9jYWxjdWwvYWx0aS9yZXN0L2VsZXZhdGlvbkxpbmUuanNvblwiLFxuICAgICAgICAgICAgXCJwcm9maWwteG1sXCIgOiBcIi9jYWxjdWwvYWx0aS9yZXN0L2VsZXZhdGlvbkxpbmUueG1sXCIsXG4gICAgICAgICAgICAvLyBvdGhlclxuICAgICAgICAgICAgd3BzIDogXCIvYWx0aS93cHNcIlxuICAgICAgICB9LFxuICAgICAgICAvKipcbiAgICAgICAgKiBuZXd1cmwgZnJvbSBnZW9wbGF0ZWZvcm1lIHNlcnZpY2VcbiAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30ga2V5IC0ga2V5XG4gICAgICAgICogQHJldHVybnMge1N0cmluZ30gdXJsXG4gICAgICAgICovXG4gICAgICAgIG5ld1VybCA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfSxcbiAgICAgICAgLyoqXG4gICAgICAgICogdXJ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y11cmwvZGlzdC9cIixcbiAgICAgICAgLyoqXG4gICAgICAgICogdXJsXG4gICAgICAgICogQHBhcmFtIHtTdHJpbmd9IGtleSAtIGtleVxuICAgICAgICAqIEByZXR1cm5zIHtTdHJpbmd9IHVybFxuICAgICAgICAqL1xuICAgICAgICB1cmwgOiBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAvLyBrZXkgbXVzdCBiZSBhbiBhcnJheSBvZiBvbmUgb3Igc2V2ZXJhbCBrZXlzXG4gICAgICAgICAgICBpZiAoIUFycmF5LmlzQXJyYXkoa2V5KSkge1xuICAgICAgICAgICAgICAgIGtleSA9IGtleS5zcGxpdChcIixcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBub3QgaG9tb2dlbmVvdXMgd2l0aCBvdGhlcnMgZ2VvcG9ydGFsIHNlcnZpY2VzIFVSTHNcbiAgICAgICAgICAgIHZhciB1cmwgPSBbXTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwga2V5Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdXJsW2ldID0gdGhpcy5fa2V5ICsga2V5W2ldICsgXCJDb25maWcuanNvblwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHVybDtcbiAgICAgICAgfVxuICAgIH0sXG4gICAgLyoqXG4gICAgICogQXV0b2NvbXBsZXRpb24gd2ViIHNlcnZpY2UgYWNjZXNzXG4gICAgICpcbiAgICAgKiBAbWVtYmVyIHtPYmplY3R9XG4gICAgICogQHByb3BlcnR5IHtGdW5jdGlvbn0gdXJsIChrZXkpIC0gUmV0dXJucyBhdXRvY29tcGxldGUgc2VydmljZSBkZWZhdWx0IHVybHMgd2l0aCBvciB3aXRob3V0IGdlb3BvcnRhbCBhY2Nlc3Mga2V5IGdpdmVuIGFzIGEgcGFyYW1ldGVyLiBUaGUgcmVzdWx0IGlzIGEgU3RyaW5nLlxuICAgICAqL1xuICAgIEF1dG9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AgICAgLyoqXG4gICAgICAgICogdXJsIGZyb20gd3hzIHNlcnZpY2VcbiAgICAgICAgKiBAcmV0dXJucyB7U3RyaW5nfSB1cmxcbiAgICAgICAgKi9cbiAgICAgICAgdXJsIDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIERlZmF1bHRVcmxTZXJ2aWNlLnVybCh0aGlzLl9rZXkpO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgRGVmYXVsdFVybFNlcnZpY2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Formats/GeocodeResponseParser.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Formats/GeocodeResponseParser.js ***! + \*************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _Response_model_GeocodeResponse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Response/model/GeocodeResponse */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodeResponse.js\");\n/* harmony import */ var _Response_model_GeocodedLocation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Response/model/GeocodedLocation */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodedLocation.js\");\n// import Logger from \"../../../Utils/LoggerByDefault\";\n\n\n\n\n\n/**\n * Fonction retournant un objet contenant des clés de lecture (readers)\n * qui permettent de parser des réponses XML du service de géocodage direct du Géoportail\n * afin de récupérer les résultats retournés.\n * @module GeocodeResponseParser\n * @alias Gp.Services.Geocode.Formats.GeocodeResponseParser\n * @private\n */\n\n/**\n * @classdesc\n *\n * Classe permettant de parser une réponse GeoJSON\n *\n * @constructor\n * @alias Gp.Formats.GeocodeResponseParser\n *\n * @private\n */\nfunction GeocodeResponseParser () {\n if (!(this instanceof GeocodeResponseParser)) {\n throw new TypeError(\"GeocodeResponseParser constructor cannot be called as a function.\");\n }\n}\n\nGeocodeResponseParser.prototype = {\n\n /**\n * @lends module:GeocodeResponseParser\n */\n\n /*\n * Constructeur (alias)\n */\n constructor : GeocodeResponseParser,\n\n /**\n * Méthode permettant de lancer la lecture d'une réponse GeoJSON,\n *\n * @param {String} json - réponse au format GeoJSON\n * @return {Object} geocodeResponse|exceptionReport : l'objet contenant les informations de la réponse GeoJSON,\n * sous la forme d'un objet GeocodeResponse, ou un objet littéral exceptionReport si le service a renvoyé une exception.\n */\n parse : function (json) {\n var geocodeResponse = new _Response_model_GeocodeResponse__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n\n const obj = JSON.parse(json);\n\n if (obj.type === \"FeatureCollection\") {\n for (var i = 0; i < obj.features.length; ++i) {\n _parseFeature(obj.features[i], geocodeResponse);\n }\n } else if (obj.type === \"Feature\") {\n _parseFeature(obj, geocodeResponse);\n } else if (obj.type === \"SERVICE_ERROR\") {\n return _parseError(obj);\n } else {\n var mess = _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE\", obj.type);\n throw new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n message : mess,\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"].TYPE_UNKERR,\n status : 200\n });\n }\n\n return geocodeResponse;\n }\n};\n\n/**\n * Méthode permettant de parser un feature\n *\n * @private\n *\n * @param {Object} feature\n * @param {Object} geocodeResponse\n *\n * @memberof GeocodeResponseParser\n * @return {Object} objet GeocodedLocation\n */\nfunction _parseFeature (feature, geocodeResponse) {\n var location = new _Response_model_GeocodedLocation__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n if (feature.geometry && feature.geometry.type === \"Point\") {\n location.position = {\n lon : feature.geometry.coordinates[0],\n lat : feature.geometry.coordinates[1]\n };\n }\n if (feature.properties) {\n for (var prop in feature.properties) {\n if (prop === \"_score\") {\n location.accuracy = feature.properties[prop];\n } else if (prop === \"_type\") {\n if (feature.properties[prop] === \"address\") {\n location.type = \"StreetAddress\";\n } else if (feature.properties[prop] === \"poi\") {\n location.type = \"PositionOfInterest\";\n } else if (feature.properties[prop] === \"parcel\") {\n location.type = \"CadastralParcel\";\n }\n } else {\n location.placeAttributes[prop] = feature.properties[prop];\n }\n }\n if (feature.properties._type === \"address\") {\n location.matchType = feature.properties.number !== undefined && feature.properties.number !== null ? \"street number\" : \"street\";\n }\n }\n geocodeResponse.locations.push(location);\n}\n\n/**\n * Méthode permettant de parser une erreur\n *\n * @private\n *\n * @param {Object} error\n *\n * @memberof GeocodeResponseParser\n * @return {Object}\n */\nfunction _parseError (error) {\n return {\n exceptionReport : error\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (GeocodeResponseParser);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9Gb3JtYXRzL0dlb2NvZGVSZXNwb25zZVBhcnNlci5qcz8zM2IyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7Q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IFwic3RyZWV0IG51bWJlclwiIDogXCJzdHJlZXRcIjtcbiAgICAgICAgfVxuICAgIH1cbiAgICBnZW9jb2RlUmVzcG9uc2UubG9jYXRpb25zLnB1c2gobG9jYXRpb24pO1xufVxuXG4vKipcbiAqIE3DqXRob2RlIHBlcm1ldHRhbnQgZGUgcGFyc2VyIHVuZSBlcnJldXJcbiAqXG4gKiBAcHJpdmF0ZVxuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBlcnJvclxuICpcbiAqIEBtZW1iZXJvZiBHZW9jb2RlUmVzcG9uc2VQYXJzZXJcbiAqIEByZXR1cm4ge09iamVjdH1cbiAqL1xuZnVuY3Rpb24gX3BhcnNlRXJyb3IgKGVycm9yKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgZXhjZXB0aW9uUmVwb3J0IDogZXJyb3JcbiAgICB9O1xufVxuXG5leHBvcnQgZGVmYXVsdCBHZW9jb2RlUmVzcG9uc2VQYXJzZXI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Formats/GeocodeResponseParser.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js": +/*!***************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/GeocodeRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js\");\n/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/GeocodeResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js\");\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service de géocodage direct du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n *\n *\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.Geocode\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String|Object} options.query - Nom de l'adresse, du toponyme, de l'unité administrative ou de la parcelle cadastrale recherchée.\n *\n * @param {Object} [options.filters] - Les propriétés possibles de cet objet sont décrites ci-après.\n * @param {String} [options.filters.[prop]] - Critère supplémentaire pour filtrer la recherche sous la forme\n * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête.\n * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"city\".\n * Il permet également de filtrer les toponymes avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"type\".\n * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés :\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n *\n * @param {String} [options.index = \"StreetAddress\"] - Type de l'objet recherché.\n * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress'\n * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales.\n * L'index 'location' regroupe les indexes 'StreetAddress' et 'PositionOfInterest'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, index = 'StreetAddress'.\n *\n * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs.\n * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité.\n * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité.\n *\n * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut.\n * Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20.\n *\n * @param {Boolean} [options.returnTrueGeometry = false] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés.\n * false par défaut.\n *\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * proxyURL : null,\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * position : {lon:, lat:},\n * index : 'StreetAddress',\n * query : '10 rue du pont Machin-ville'\n * (...)\n * };\n */\nfunction Geocode (options_) {\n if (!(this instanceof Geocode)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Geocode\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"Geocode\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Geocode\");\n this.logger.trace(\"[Constructeur Geocode (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n if (!options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage\n /* options.serverUrl = DefaultUrlService.Geocode.newUrl();\n if (options.oldGeocodeService) {\n options.serverUrl = DefaultUrlService.Geocode.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage\n options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Geocode.url();\n }\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, [options]);\n\n if (!options.hasOwnProperty(\"query\")) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"query\"));\n }\n\n // ajout des options spécifiques au service\n this.options.query = options.query;\n\n // on definit l'index par defaut\n if (!options.index) {\n this.options.index = options.index = \"StreetAddress\";\n }\n\n if (options.filters) {\n var filter = Object.keys(options.filters);\n for (var i = 0; i < filter.length; i++) {\n var key = filter[i];\n // on supprime les filtres vides\n if (typeof options.filters[key] === \"undefined\" ||\n (typeof options.filters[key] === \"object\" && Object.keys(options.filters[key]).length === 0) ||\n (typeof options.filters[key] === \"string\" && options.filters[key].length === 0) ||\n (Array.isArray(options.filters[key]) && options.filters[key].length === 0)\n ) {\n delete this.options.filters[key];\n }\n }\n }\n\n this.options.index = options.index || \"StreetAddress\";\n this.options.maximumResponses = options.maximumResponses || 20;\n}\n\n/**\n * @lends module:Geocode#\n */\nGeocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nGeocode.prototype.constructor = Geocode;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nGeocode.prototype.patchOptionConvertor = function (options_) {\n const options = options_;\n\n if (options.hasOwnProperty(\"location\")) {\n this.logger.warn(\"The parameter 'location' is deprecated\");\n\n if (!options.query) {\n options.query = options.location;\n }\n delete options.location;\n }\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (!options.filters) {\n options.filters = options.filterOptions;\n\n if (options.filters.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.index) {\n if (Array.isArray(options.filters.type) && options.filters.type.length > 0) {\n options.index = options.filters.type[0];\n } else {\n options.index = options.filters.type;\n }\n }\n delete options.filters.type;\n }\n\n if (options.filters.bbox) {\n this.logger.warn(\"The parameter 'filterOptions.bbox' is deprecated\");\n delete options.filters.bbox;\n }\n }\n delete options.filterOptions;\n }\n\n if (options.position) {\n if (options.position.x) {\n this.logger.warn(\"The parameter 'position.x' is deprecated\");\n\n if (!options.position.lon) {\n options.position.lon = options.position.x;\n }\n delete options.position.x;\n }\n\n if (options.position.y) {\n this.logger.warn(\"The parameter 'position.y' is deprecated\");\n\n if (!options.position.lat) {\n options.position.lat = options.position.y;\n }\n delete options.position.y;\n }\n }\n\n if (options.returnFreeForm) {\n this.logger.warn(\"The parameter 'returnFreeForm' is deprecated\");\n delete options.returnFreeForm;\n }\n\n if (options.srs) {\n this.logger.warn(\"The parameter 'srs' is deprecated\");\n delete options.srs;\n }\n\n return options;\n};\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nGeocode.prototype.buildRequest = function (error, success) {\n var options = {\n httpMethod : this.options.httpMethod,\n // options specifiques du service\n geocodeMethod : \"search\",\n query : this.options.query,\n index : this.options.index,\n returnTrueGeometry : this.options.returnTrueGeometry,\n position : this.options.position,\n maxResp : this.options.maximumResponses,\n filters : this.options.filters\n };\n\n this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * Analyse de la reponse (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nGeocode.prototype.analyzeResponse = function (error, success) {\n /* INFO :\n Etape 1 : Création de la requête (URL)\n -> stockage de la requête dans this.request\n Etape 2 : Envoi de la requête\n -> appel du protocol XHR, et envoi (par ex send ())\n -> récupération de la réponse JSON dans la fonction onSuccess () (this.response)\n -> si code HTTP 200 et pas de message d'erreur : etape 3\n -> si code HTTP != 200 : lancement de la fonction de callback onFailure avec le message d'erreur\n Etape 3 : Analyse de la réponse JSON (si rawResponse === false )\n -> appel du parser pour récupérer le document\n Etape 4 : Lancement de la fonction de callback onSuccess avec la réponse :\n -> JSON (si rawResponse === true)\n -> ou geocodedLocations\n */\n\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Geocode);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9HZW9jb2RlLmpzP2Q1NWQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFpRDtBQUNIO0FBQ1c7QUFDWjtBQUNRO0FBQ2U7QUFDRzs7QUFFdkU7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLGNBQWM7QUFDekI7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTt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pbHRlcnMudHlwZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmluZGV4ID0gb3B0aW9ucy5maWx0ZXJzLnR5cGVbMF07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmluZGV4ID0gb3B0aW9ucy5maWx0ZXJzLnR5cGU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZGVsZXRlIG9wdGlvbnMuZmlsdGVycy50eXBlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAob3B0aW9ucy5maWx0ZXJzLmJib3gpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci53YXJuKFwiVGhlIHBhcmFtZXRlciAnZmlsdGVyT3B0aW9ucy5iYm94JyBpcyBkZXByZWNhdGVkXCIpO1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBvcHRpb25zLmZpbHRlcnMuYmJveDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBkZWxldGUgb3B0aW9ucy5maWx0ZXJPcHRpb25zO1xuICAgIH1cblxuICAgIGlmIChvcHRpb25zLnBvc2l0aW9uKSB7XG4gICAgICAgIGlmIChvcHRpb25zLnBvc2l0aW9uLngpIHtcbiAgICAgICAgICAgIHRoaXMubG9nZ2VyLndhcm4oXCJUaGUgcGFyYW1ldGVyICdwb3NpdGlvbi54JyBpcyBkZXByZWNhdGVkXCIpO1xuXG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMucG9zaXRpb24ubG9uKSB7XG4gICAgICAgICAgICAgICAgb3B0aW9ucy5wb3NpdGlvbi5sb24gPSBvcHRpb25zLnBvc2l0aW9uLng7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWxldGUgb3B0aW9ucy5wb3NpdGlvbi54O1xuICAgICAgICB9XG5cbiAgICAgICAgaWY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AgICAgICAgIC0+IEpTT04gKHNpIHJhd1Jlc3BvbnNlID09PSB0cnVlKVxuICAgICAgICAgICAgLT4gb3UgZ2VvY29kZWRMb2NhdGlvbnNcbiAgICAqL1xuXG4gICAgaWYgKHRoaXMucmVzcG9uc2UpIHtcbiAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICByZXNwb25zZSA6IHRoaXMucmVzcG9uc2UsXG4gICAgICAgICAgICByYXdSZXNwb25zZSA6IHRoaXMub3B0aW9ucy5yYXdSZXNwb25zZSxcbiAgICAgICAgICAgIG9uRXJyb3IgOiBlcnJvcixcbiAgICAgICAgICAgIG9uU3VjY2VzcyA6IHN1Y2Nlc3MsXG4gICAgICAgICAgICBzY29wZSA6IHRoaXNcbiAgICAgICAgfTtcblxuICAgICAgICBHZW9jb2RlUmVzcG9uc2VGYWN0b3J5LmJ1aWxkKG9wdGlvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShfLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgR2VvY29kZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js ***! + \*************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _GeocodeRequestREST__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GeocodeRequestREST */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestREST.js\");\n\n\n\n/**\n * Creation d'une requête\n * (Factory)\n *\n * @module GeocodeRequestFactory\n * @alias Gp.Services.Geocode.Request.GeocodeRequestFactory\n * @private\n */\nvar GeocodeRequestFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Geocode\n *\n * @example\n * var options = {\n * // options specifiques du service\n * geocodeMethod:\n * query:\n * filters:\n * maximumResponses:\n * };\n * var result = GeocodeRequestFactory.build(options);\n * if (!result) {\n * // error...\n * }\n * @returns {String} request\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"GeocodeRequestFactory\");\n logger.trace([\"GeocodeRequestFactory::build()\"]);\n\n var settings = options || {};\n\n var myReq = new _GeocodeRequestREST__WEBPACK_IMPORTED_MODULE_1__[\"default\"](settings);\n if (!myReq.processRequestString()) {\n throw new Error(\"Error process request (rest) !\");\n }\n var request = myReq.requestString;\n\n logger.trace(request);\n\n return request;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (GeocodeRequestFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9SZXF1ZXN0L0dlb2NvZGVSZXF1ZXN0RmFjdG9yeS5qcz8xNTMzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFvRDtBQUNFOztBQUV0RDtBQUNBO0FBQ0E7QUFDQTtBQUNBO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cXVlc3QgKHJlc3QpICFcIik7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHJlcXVlc3QgPSBteVJlcS5yZXF1ZXN0U3RyaW5nO1xuXG4gICAgICAgIGxvZ2dlci50cmFjZShyZXF1ZXN0KTtcblxuICAgICAgICByZXR1cm4gcmVxdWVzdDtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBHZW9jb2RlUmVxdWVzdEZhY3Rvcnk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestREST.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestREST.js ***! + \**********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _model_GeocodeParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model/GeocodeParamREST */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/model/GeocodeParamREST.js\");\n\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des requêtes de type REST sur le service de calcul d'itineraire\n * (uniquement en GET)\n *\n * @constructor\n * @alias Gp.Services.Geocode.Request.GeocodeRequestREST\n * @param {Object} options - options definies dans le composant Route\n *\n * @example\n * var options = {\n * (...)\n * };\n *\n * @private\n */\nfunction GeocodeRequestREST (options) {\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"GeocodeRequestREST\");\n this.logger.trace(\"[Constructeur GeocodeRequestREST ()]\");\n\n if (!(this instanceof GeocodeRequestREST)) {\n throw new TypeError(\"GeocodeRequestREST constructor cannot be called as a function.\");\n }\n\n // existance des options\n if (!options) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"options\"));\n }\n\n /** liste des options */\n this.settings = options;\n}\n\nGeocodeRequestREST.prototype = {\n\n /**\n * @lends module:GeocodeRequestREST#\n */\n\n /**\n * request\n * @type {String}\n */\n requestString : null,\n\n /**\n * Constructeur (alias)\n */\n constructor : GeocodeRequestREST,\n\n /**\n * Construction de la requête.\n *\n * @returns {String} request\n */\n processRequestString : function () {\n var request = \"\";\n\n // Mapping des options avec le service de l'API REST\n const oParams = new _model_GeocodeParamREST__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.settings);\n\n const params = oParams.getParams();\n for (var i = 0; i < params.length; i++) {\n var o = params[i];\n if (request) {\n request += \"&\";\n }\n request += o.k + \"=\" + o.v;\n }\n\n if (!this.settings.geocodeMethod || (this.settings.geocodeMethod !== \"search\" && this.settings.geocodeMethod !== \"reverse\")) {\n throw new Error(\"Error geocodeMethod not valid\");\n }\n\n this.requestString = \"?\" + request;\n this.logger.trace(this.requestString);\n\n return this.requestString;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (GeocodeRequestREST);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9SZXF1ZXN0L0dlb2NvZGVSZXF1ZXN0UkVTVC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tc1tpXTtcbiAgICAgICAgICAgIGlmIChyZXF1ZXN0KSB7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSBcIiZcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlcXVlc3QgKz0gby5rICsgXCI9XCIgKyBvLnY7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRoaXMuc2V0dGluZ3MuZ2VvY29kZU1ldGhvZCB8fCAodGhpcy5zZXR0aW5ncy5nZW9jb2RlTWV0aG9kICE9PSBcInNlYXJjaFwiICYmIHRoaXMuc2V0dGluZ3MuZ2VvY29kZU1ldGhvZCAhPT0gXCJyZXZlcnNlXCIpKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFcnJvciBnZW9jb2RlTWV0aG9kIG5vdCB2YWxpZFwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmVxdWVzdFN0cmluZyA9IFwiP1wiICsgcmVxdWVzdDtcbiAgICAgICAgdGhpcy5sb2dnZXIudHJhY2UodGhpcy5yZXF1ZXN0U3RyaW5nKTtcblxuICAgICAgICByZXR1cm4gdGhpcy5yZXF1ZXN0U3RyaW5nO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEdlb2NvZGVSZXF1ZXN0UkVTVDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestREST.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Request/model/GeocodeParamREST.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Request/model/GeocodeParamREST.js ***! + \**************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes du service de calcul d'itineraire (REST).\n * Permet le mapping avec les options du service.\n * @constructor\n * @alias Gp.Services.Route.Request.RouteParamREST\n * @param {Object} options - options\n *\n * @private\n */\nfunction GeocodeParamREST (options) {\n if (!(this instanceof GeocodeParamREST)) {\n throw new TypeError(\"GeocodeParamREST constructor cannot be called as a function.\");\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur GeocodeParamREST ()]\");\n\n /**\n * Options en paramêtres du constructeur.\n */\n this.options = options || {};\n\n // methode de geocodage\n if (!this.options.geocodeMethod || (this.options.geocodeMethod !== \"search\" && this.options.geocodeMethod !== \"reverse\")) {\n throw new Error(\"Error geocodeMethod not valid\");\n }\n this.geocodeMethod = this.options.geocodeMethod;\n\n // mapping des options avec l'API REST\n this.query = (typeof this.options !== \"undefined\") ? this.options.query : null;\n\n this.searchGeometry = this.options.searchGeometry || null;\n\n this.index = this.options.index || null;\n\n this.lon = this.options.position && this.options.position.lon ? this.options.position.lon : null;\n\n this.lat = this.options.position && this.options.position.lat ? this.options.position.lat : null;\n\n this.maxResp = this.options.maxResp || null;\n\n this.returnTrueGeometry = this.options.returnTrueGeometry || null;\n\n this.filters = this.options.filters || {};\n}\n\n/**\n * CLASSNAME\n */\nGeocodeParamREST.CLASSNAME = \"GeocodeParamREST\";\n\nGeocodeParamREST.prototype = {\n\n /**\n * @lends module:GeocodeParamREST#\n */\n\n /**\n * Constructeur (alias)\n */\n constructor : GeocodeParamREST,\n\n /**\n * Retourne les filtres\n * @returns {String} les filtres\n */\n getFilters : function () {\n var filters = {};\n for (var prop in this.filters) {\n if (this.filters.hasOwnProperty(prop)) {\n filters[prop] = this.filters[prop];\n }\n }\n return filters;\n },\n\n /**\n * Retourne l'index\n * @returns {String} l'index\n */\n getIndex : function () {\n if (this.index === undefined) {\n return null;\n }\n if (this.index === \"StreetAddress\") {\n return \"address\";\n } else if (this.index === \"CadastralParcel\") {\n return \"parcel\";\n } else if (this.index === \"PositionOfInterest\") {\n return \"poi\";\n } else if (this.index === \"location\") {\n return \"location\";\n }\n return this.index;\n },\n\n /**\n * Retourne la géométrie de recherche\n * @returns {String} la géométrie de recherche au format json\n */\n getSearchGeometry : function () {\n return JSON.stringify(this.searchGeometry);\n }\n};\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Array} liste de paramêtres\n */\nGeocodeParamREST.prototype.getParams = function () {\n var map = [];\n\n if (this.geocodeMethod === \"search\") {\n map.push({\n k : \"q\",\n v : this.query\n });\n }\n\n if (this.index) {\n map.push({\n k : \"index\",\n v : this.getIndex()\n });\n }\n\n if (this.geocodeMethod === \"reverse\" && this.searchGeometry) {\n map.push({\n k : \"searchgeom\",\n v : this.getSearchGeometry()\n });\n }\n\n if (this.lon && this.lat) {\n map.push({\n k : \"lon\",\n v : this.lon\n });\n map.push({\n k : \"lat\",\n v : this.lat\n });\n }\n\n if (this.maxResp) {\n map.push({\n k : \"limit\",\n v : this.maxResp\n });\n }\n\n if (this.returnTrueGeometry) {\n map.push({\n k : \"returntruegeometry\",\n v : this.returnTrueGeometry\n });\n }\n\n const filters = this.getFilters();\n for (var key in filters) {\n map.push({\n k : key,\n v : filters[key]\n });\n }\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (GeocodeParamREST);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9SZXF1ZXN0L21vZGVsL0dlb2NvZGVQYXJhbVJFU1QuanM/MjUyMyJdLCJuYW1lcyI6W10sIm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lcnMpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmZpbHRlcnMuaGFzT3duUHJvcGVydHkocHJvcCkpIHtcbiAgICAgICAgICAgICAgICBmaWx0ZXJzW3Byb3BdID0gdGhpcy5maWx0ZXJzW3Byb3BdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmaWx0ZXJzO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBSZXRvdXJuZSBsJ2luZGV4XG4gICAgICogQHJldHVybnMge1N0cmluZ30gbCdpbmRleFxuICAgICAqL1xuICAgIGdldEluZGV4IDogZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5pbmRleCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5pbmRleCA9PT0gXCJTdHJlZXRBZGRyZXNzXCIpIHtcbiAgICAgICAgICAgIHJldHVybiBcImFkZHJlc3NcIjtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLmluZGV4ID09PSBcIkNhZGFzdHJhbFBhcmNlbFwiKSB7XG4gICAgICAgICAgICByZXR1cm4gXCJwYXJjZWxcIjtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLmluZGV4ID09PSBcIlBvc2l0aW9uT2ZJbnRlcmVzdFwiKSB7XG4gICAgICAgICAgICByZXR1cm4gXCJwb2lcIjtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLmluZGV4ID09PSBcImxvY2F0aW9uXCIpIHtcbiAgICAgICAgICAgIHJldHVybiBcImxvY2F0aW9uXCI7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuaW5kZXg7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldG91cm5lIGxhIGfDqW9tw6l0cmllIGRlIHJlY2hlcmNoZVxuICAgICAqIEByZXR1cm5zIHtTdHJpbmd9IGxhIGfDqW9tw6l0cmllIG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ibG9uXCIsXG4gICAgICAgICAgICB2IDogdGhpcy5sb25cbiAgICAgICAgfSk7XG4gICAgICAgIG1hcC5wdXNoKHtcbiAgICAgICAgICAgIGsgOiBcImxhdFwiLFxuICAgICAgICAgICAgdiA6IHRoaXMubGF0XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGlmICh0aGlzLm1heFJlc3ApIHtcbiAgICAgICAgbWFwLnB1c2goe1xuICAgICAgICAgICAgayA6IFwibGltaXRcIixcbiAgICAgICAgICAgIHYgOiB0aGlzLm1heFJlc3BcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaWYgKHRoaXMucmV0dXJuVHJ1ZUdlb21ldHJ5KSB7XG4gICAgICAgIG1hcC5wdXNoKHtcbiAgICAgICAgICAgIGsgOiBcInJldHVybnRydWVnZW9tZXRyeVwiLFxuICAgICAgICAgICAgdiA6IHRoaXMucmV0dXJuVHJ1ZUdlb21ldHJ5XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbnN0IGZpbHRlcnMgPSB0aGlzLmdldEZpbHRlcnMoKTtcbiAgICBmb3IgKHZhciBrZXkgaW4gZmlsdGVycykge1xuICAgICAgICBtYXAucHVzaCh7XG4gICAgICAgICAgICBrIDoga2V5LFxuICAgICAgICAgICAgdiA6IGZpbHRlcnNba2V5XVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICByZXR1cm4gbWFwO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgR2VvY29kZVBhcmFtUkVTVDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Request/model/GeocodeParamREST.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js": +/*!***************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js ***! + \***************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Formats_GeocodeResponseParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Formats/GeocodeResponseParser */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Formats/GeocodeResponseParser.js\");\n/**\n * Factory pour générer une reponse JSON à partir d'un XML\n * (Factory)\n *\n * @module GeocodeResponseFactory\n * @alias Gp.Services.Geocode.Response.GeocodeResponseFactory\n * @private\n */\n// import Logger from \"../../../Utils/LoggerByDefault\";\n\n\n\n\nvar GeocodeReponseFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Geocode\n *\n * @example\n * var options = {\n * response :\n * rawResponse :\n * scope :\n * onSuccess :\n * onError :\n * };\n *\n */\n build : function (options) {\n // data de type GeocodeResponse\n var data = null;\n\n if (options.response) {\n if (options.rawResponse) {\n data = options.response;\n } else {\n try {\n const parser = new _Formats_GeocodeResponseParser__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n data = parser.parse(options.response);\n\n if (!data) {\n throw new Error(\"L'analyse de la réponse du service !?\");\n }\n } catch (e) {\n var message = e.message;\n if (typeof options.response === \"string\") {\n message += \"('\" + options.response + \"')\";\n } else {\n message += \"('\" + options.response.documentElement.innerHTML + \"')\";\n }\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE\", message),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].TYPE_UNKERR,\n status : -1\n }));\n return;\n }\n\n // Si la réponse contenait une exception renvoyée par le service\n if (data.exceptionReport) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", data.exceptionReport),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].TYPE_SRVERR,\n status : 200 // FIXME : 200 ?\n }));\n return;\n }\n }\n } else {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\"),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__[\"default\"].TYPE_SRVERR,\n status : -1 // FIXME : status response\n }));\n return;\n }\n\n options.onSuccess.call(options.scope, data);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (GeocodeReponseFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9SZXNwb25zZS9HZW9jb2RlUmVzcG9uc2VGYWN0b3J5LmpzPzliN2IiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDNEQ7QUFDUjtBQUNpQjs7QUFFckU7O0FBR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ICAgICAgICB2YXIgZGF0YSA9IG51bGw7XG5cbiAgICAgICAgaWYgKG9wdGlvbnMucmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnJhd1Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgZGF0YSA9IG9wdGlvbnMucmVzcG9uc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcnNlciA9IG5ldyBHZW9jb2RlUmVzcG9uc2VQYXJzZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YSA9IHBhcnNlci5wYXJzZShvcHRpb25zLnJlc3BvbnNlKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkwnYW5hbHlzZSBkZSBsYSByw6lwb25zZSBkdSBzZXJ2aWNlICE/XCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9IGUubWVzc2FnZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlICs9IFwiKCdcIiArIG9wdGlvbnMucmVzcG9uc2UgKyBcIicpXCI7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlICs9IFwiKCdcIiArIG9wdGlvbnMucmVzcG9uc2UuZG9jdW1lbnRFbGVtZW50LmlubmVySFRNTCArIFwiJylcIjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgOiBNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0FOQUxZU0VcIiwgbWVzc2FnZSksXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfVU5LRVJSLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIDogLTFcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2kgbGEgcsOpcG9uc2UgY29udGVuYWl0IHVuZSBleGNlcHRpb24gcmVudm95w6llIHBhciBsZSBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgaWYgKGRhdGEuZXhjZXB0aW9uUmVwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA6IE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRVhDRVBUSU9OXCIsIGRhdGEuZXhjZXB0aW9uUmVwb3J0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiBFcnJvclNlcnZpY2UuVFlQRV9TUlZFUlIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgOiAyMDAgLy8gRklYTUUgOiAyMDAgP1xuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKHtcbiAgICAgICAgICAgICAgICBtZXNzYWdlIDogTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FTVBUWVwiKSxcbiAgICAgICAgICAgICAgICB0eXBlIDogRXJyb3JTZXJ2aWNlLlRZUEVfU1JWRVJSLFxuICAgICAgICAgICAgICAgIHN0YXR1cyA6IC0xIC8vIEZJWE1FIDogc3RhdHVzIHJlc3BvbnNlXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBvcHRpb25zLm9uU3VjY2Vzcy5jYWxsKG9wdGlvbnMuc2NvcGUsIGRhdGEpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEdlb2NvZGVSZXBvbnNlRmFjdG9yeTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodeResponse.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodeResponse.js ***! + \**************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Response object for {@link module:Services~geocode Gp.Services.geocode ()} or {@link module:Services~reverseGeocode Gp.Services.reverseGeocode ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Array.} locations - locations array.\n *\n * @namespace\n * @alias Gp.Services.GeocodeResponse\n */\nfunction GeocodeResponse () {\n if (!(this instanceof GeocodeResponse)) {\n throw new TypeError(\"GeocodeResponse constructor cannot be called as a function.\");\n }\n\n this.locations = [];\n}\n\nGeocodeResponse.prototype = {\n\n constructor : GeocodeResponse\n\n};\n\n/* harmony default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kTG9jYXRpb24+fSBsb2NhdGlvbnMgLSBsb2NhdGlvbnMgYXJyYXkuXG4gKlxuICogQG5hbWVzcGFjZVxuICogQGFsaWFzIEdwLlNlcnZpY2VzLkdlb2NvZGVSZXNwb25zZVxuICovXG5mdW5jdGlvbiBHZW9jb2RlUmVzcG9uc2UgKCkge1xuICAgIGlmICghKHRoaXMgaW5zdGFuY2VvZiBHZW9jb2RlUmVzcG9uc2UpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJHZW9jb2RlUmVzcG9uc2UgY29uc3RydWN0b3IgY2Fubm90IGJlIGNhbGxlZCBhcyBhIGZ1bmN0aW9uLlwiKTtcbiAgICB9XG5cbiAgICB0aGlzLmxvY2F0aW9ucyA9IFtdO1xufVxuXG5HZW9jb2RlUmVzcG9uc2UucHJvdG90eXBlID0ge1xuXG4gICAgY29uc3RydWN0b3IgOiBHZW9jb2RlUmVzcG9uc2VcblxufTtcblxuZXhwb3J0IGRlZmF1bHQgR2VvY29kZVJlc3BvbnNlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodeResponse.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodedLocation.js": +/*!***************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodedLocation.js ***! + \***************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single location object returned by the underlying geocoding web service.\n *\n * @property {Gp.Point} position - Position of the location given in the requested coordinates system.\n * @property {String} type - location type \"StreetAddress\" (for an address), \"PositionOfInterest\" (for a place name) or \"CadastralParcel\" (for cadastral parcel).\n * @property {String} matchType - how geocoding is performed : \"street number\" (exact address), \"street enhanced\" (street number calculated by interpolation), \"street\" (only the street), \"city\" (only the city).\n * @property {Float} accuracy - Accuracy of the response towards the requested location between 0 (unaccurate) and 1 (exact match).\n * @property {Object} placeAttributes - Associative array matching the following attributes with their values given by the underlying web service :\n *\n * *Common attributes : *\n *\n * - **trueGeometry** - the 'real life' geometry if different from 'Point' type.\n *\n * *if type === \"StreetAddress\" :*\n *\n * - **number** - Street number.\n * - **postalCode** - PostCode\n * - **street** - Street name\n * - **city** - City\n * - **houseNumberInfos** - additional street number information\n * - **inseeCode** - INSEE Code\n *\n *\n * *if type === \"PositionOfInterest\" :*\n *\n * - **type** - Place name type\n * - **postalCode** - PostCode\n * - **toponyme** - Toponyme\n * - **extraFields** - additional place name properties\n * - **inseeCode** - INSEE Code\n *\n *\n * *si type = \"CadastralParcel\" :*\n *\n * - **codeCommuneAbs** - when a parcel comes from a city that was absorbed by another, code of that old city. \"000\" otherwise.\n * - **codeArrondissement** - arrondissement\n * - **identifiant** - cadastral parcel code\n * - **feuille** - Parcel Sheet (eg. \"1\").\n * - **numero** - Parcel Number (eg. \"0041\")\n * - **section** - Parcel Section (eg. \"0D\").\n * - **nomCommune** - Parcel municipality name.\n * - **codeCommune** - Parcel municipality.\n * - **codeDepartement** - Parcel Department.\n *\n * @namespace\n * @alias Gp.Services.Geocode.GeocodedLocation\n */\nfunction GeocodedLocation () {\n if (!(this instanceof GeocodedLocation)) {\n throw new TypeError(\"GeocodedLocation constructor cannot be called as a function.\");\n }\n\n this.position = null;\n\n this.matchType = null;\n\n this.placeAttributes = {};\n\n this.type = null;\n\n this.accuracy = null;\n\n /**\n * Nom de la classe : \"GeocodedLocation\"\n * @type {String}\n */\n this.CLASSNAME = \"GeocodedLocation\";\n}\n\nGeocodedLocation.prototype = {\n\n constructor : GeocodedLocation\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (GeocodedLocation);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s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cmluZ31cbiAgICAgKi9cbiAgICB0aGlzLkNMQVNTTkFNRSA9IFwiR2VvY29kZWRMb2NhdGlvblwiO1xufVxuXG5HZW9jb2RlZExvY2F0aW9uLnByb3RvdHlwZSA9IHtcblxuICAgIGNvbnN0cnVjdG9yIDogR2VvY29kZWRMb2NhdGlvblxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBHZW9jb2RlZExvY2F0aW9uO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/Response/model/GeocodedLocation.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/GeocodeRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Request/GeocodeRequestFactory.js\");\n/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/GeocodeResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Response/GeocodeResponseFactory.js\");\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service de géocodage inverse du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.ReverseGeocode\n *\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs.\n * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité.\n * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité.\n *\n * @param {Object} [options.filters] - Les propriétés possibles de cet objet.\n * @param {String} [options.filters.[proprietes du filtre]] - Critère supplémentaire pour filtrer la recherche sous la forme\n * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête.\n * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"city\".\n * Il permet également de filtrer les toponymes avec les propriétés :\n * \"postalCode\", \"inseeCode\", \"type\".\n * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés :\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n *\n * @param {Object} [options.searchGeometry] - Emprise dans laquelle on souhaite effectuer la recherche.\n * Les propriétés possibles de cet objet sont décrites ci-après.\n * @param {String} options.searchGeometry.type - Type de géometrie (Point|Circle|Linestring|Polygon)\n * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordonnées des points constituant la géométrie.\n * @param {Float} options.searchGeometry.radius - Rayon. Paramètre applicable uniquement pour le type 'Circle'.\n *\n * @param {String} [options.index = \"StreetAddress\"] - Type de l'objet recherché.\n * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress'\n * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales. L'index 'location' permet une recherche\n * multi-indexes en regroupant les indexes 'PositionOfInterest' et 'StreetAddress'.\n * D'autres types pourront être rajoutés selon l'évolution du service.\n * Par défaut, index = 'StreetAddress'.\n *\n * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir.\n * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20s.\n *\n * @param {Boolean} [options.returnTrueGeometry] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés.\n * false par défaut.\n *\n * @example\n * var options = {\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * proxyURL : null,\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * index : 'StreetAddress',\n * searchGeometry : {\n * type : Circle,\n * coordinates : [48, 2],\n * radius : 100\n * },\n * position : {lon:2 , lat:48.5},\n * maximumResponses : 25,\n * };\n *\n */\nfunction ReverseGeocode (options_) {\n if (!(this instanceof ReverseGeocode)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"ReverseGeocode\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"ReverseGeocode\";\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.ReverseGeocode\");\n this.logger.trace(\"[Constructeur ReverseGeocode (options)]\");\n\n var options = this.patchOptionConvertor(options_);\n if (!options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse\n /* options.serverUrl = DefaultUrlService.ReverseGeocode.newUrl();\n if (options.oldReverseService) {\n options.serverUrl = DefaultUrlService.ReverseGeocode.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse\n options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ReverseGeocode.url();\n }\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, [options]);\n\n if (!options.searchGeometry) {\n if (!options.position) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"searchGeometry\"));\n }\n } else {\n this.options.searchGeometry = options.searchGeometry;\n }\n\n // on definit l'index par defaut\n if (!options.index) {\n this.options.index = options.index = \"StreetAddress\";\n }\n\n if (options.filters) {\n var filter = Object.keys(options.filters);\n for (var i = 0; i < filter.length; i++) {\n var key = filter[i];\n // on supprime les filtres vides\n if (typeof options.filters[key] === \"undefined\" ||\n (typeof options.filters[key] === \"object\" && Object.keys(options.filters[key]).length === 0) ||\n (typeof options.filters[key] === \"string\" && options.filters[key].length === 0) ||\n (Array.isArray(options.filters[key]) && options.filters[key].length === 0)\n ) {\n delete this.options.filters[key];\n }\n }\n }\n\n this.options.position = options.position;\n this.options.index = options.index || \"StreetAddress\";\n this.options.maximumResponses = options.maximumResponses || 20;\n}\n\n/**\n * @lends module:ReverseGeocode#\n */\nReverseGeocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nReverseGeocode.prototype.constructor = ReverseGeocode;\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} options_ - options du service\n * @return {Object} - options\n */\nReverseGeocode.prototype.patchOptionConvertor = function (options_) {\n var options = options_;\n\n if (options.filterOptions) {\n this.logger.warn(\"The parameter 'filterOptions' is deprecated\");\n\n if (options.filterOptions.type) {\n this.logger.warn(\"The parameter 'filterOptions.type' is deprecated\");\n if (!options.index) {\n if (Array.isArray(options.filterOptions.type) && options.filterOptions.type.length > 0) {\n options.index = options.filterOptions.type[0];\n } else {\n options.index = options.filterOptions.type;\n }\n }\n delete options.filterOptions.type;\n }\n\n if (options.filterOptions.bbox) {\n this.logger.warn(\"The parameter 'filterOptions.bbox' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.bbox2Json(options.filterOptions.bbox);\n }\n delete options.filterOptions.bbox;\n }\n\n if (options.filterOptions.circle) {\n this.logger.warn(\"The parameter 'filterOptions.circle' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.circle2Json(options.filterOptions.circle);\n }\n delete options.filterOptions.circle;\n }\n\n if (options.filterOptions.polygon) {\n this.logger.warn(\"The parameter 'filterOptions.polygon' is deprecated\");\n if (!options.searchGeometry) {\n // convertir la geometrie\n options.searchGeometry = this.polygon2Json(options.filterOptions.polygon);\n }\n delete options.filterOptions.polygon;\n }\n\n if (!options.filters && Object.keys(options.filterOptions).length > 0) {\n options.filters = options.filterOptions;\n }\n\n delete options.filterOptions;\n }\n\n if (options.position) {\n if (options.position.x) {\n this.logger.warn(\"The parameter 'position.x' is deprecated\");\n\n if (!options.position.lon) {\n options.position.lon = options.position.x;\n }\n delete options.position.x;\n }\n\n if (options.position.y) {\n this.logger.warn(\"The parameter 'position.y' is deprecated\");\n\n if (!options.position.lat) {\n options.position.lat = options.position.y;\n }\n delete options.position.y;\n }\n }\n\n if (options.srs) {\n this.logger.warn(\"The parameter 'srs' is deprecated\");\n delete options.srs;\n }\n\n return options;\n};\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nReverseGeocode.prototype.buildRequest = function (error, success) {\n var options = {\n httpMethod : this.options.httpMethod,\n // options specifiques du service\n geocodeMethod : \"reverse\",\n searchGeometry : this.options.searchGeometry,\n index : this.options.index,\n position : this.options.position,\n returnTrueGeometry : this.options.returnTrueGeometry,\n maxResp : this.options.maximumResponses,\n filters : this.options.filters\n };\n\n this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n (!this.request)\n ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")))\n : success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nReverseGeocode.prototype.analyzeResponse = function (error, success) {\n if (this.response) {\n var options = {\n response : this.response,\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this\n };\n\n _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Array} bbox - bbox\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.bbox2Json = function (bbox) {\n return {\n type : \"Polygon\",\n coordinates : [[\n [bbox.left, bbox.top],\n [bbox.right, bbox.top],\n [bbox.right, bbox.bottom],\n [bbox.left, bbox.bottom],\n [bbox.left, bbox.top]\n ]]\n };\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Object} circle - circle\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.circle2Json = function (circle) {\n return {\n type : \"Circle\",\n radius : circle.radius,\n coordinates : [circle.x, circle.y]\n };\n};\n\n/**\n * Patch pour la convertion des options vers le nouveau formalisme.\n *\n * @param {Array} polygon - polygon\n * @return {Object} - geometrie au format json\n */\nReverseGeocode.prototype.polygon2Json = function (polygon) {\n var jsonGeom = {\n type : \"Polygon\",\n coordinates : [[]]\n };\n\n for (var i = 0; i < polygon.length; ++i) {\n jsonGeom.coordinates[0].push([polygon[i].x, polygon[i].y]);\n }\n\n return jsonGeom;\n};\n\n/**\n * Codes EPSG géographiques (lat/lon). Utiles car les coordonnées doivent être inversées.\n */\nReverseGeocode.geoEPSG = [\"EPSG:4326\"];\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReverseGeocode);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvR2VvY29kZS9SZXZlcnNlR2VvY29kZS5qcz9iZGFlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBaUQ7QUFDSDtBQUNXO0FBQ1o7QUFDUTtBQUNlO0FBQ0c7O0FBRXZFO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEIsZ0JBQWdCLE1BQU07QUFDdEIsZ0JBQWdCLE1BQU07QUFDdEI7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQU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gKHZhciBpID0gMDsgaSA8IGZpbHRlci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGtleSA9IGZpbHRlcltpXTtcbiAgICAgICAgICAgIC8vIG9uIHN1cHByaW1lIGxlcyBmaWx0cmVzIHZpZGVzXG4gICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuZmlsdGVyc1trZXldID09PSBcInVuZGVmaW5lZFwiIHx8XG4gICAgICAgICAgICAgICAgKHR5cGVvZiBvcHRpb25zLmZpbHRlcnNba2V5XSA9PT0gXCJvYmplY3RcIiAmJiBPYmplY3Qua2V5cyhvcHRpb25zLmZpbHRlcnNba2V5XSkubGVuZ3RoID09PSAwKSB8fFxuICAgICAgICAgICAgICAgICh0eXBlb2Ygb3B0aW9ucy5maWx0ZXJzW2tleV0gPT09IFwic3RyaW5nXCIgJiYgb3B0aW9ucy5maWx0ZXJzW2tleV0ubGVuZ3RoID09PSAwKSB8fFxuICAgICAgICAgICAgICAgIChBcnJheS5pc0FycmF5KG9wdGlvbnMuZmlsdGVyc1trZXldKSAmJiBvcHRpb25zLmZpbHRlcnNba2V5XS5sZW5ndGggPT09IDApXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5vcHRpb25zLmZpbHRlcnNba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHRoaXMub3B0aW9ucy5wb3NpdGlvbiA9IG9wdGlvbnMucG9zaXRpb247XG4gICAgdGhpcy5vcHRpb25zLmluZGV4ID0gb3B0aW9ucy5pbmRleCB8fCBcIlN0cmVldEFkZHJlc3NcIjtcbiAgICB0aGlzLm9wdGlvbnMubWF4aW11bVJlc3BvbnNlcyA9IG9wdGlvbnMubWF4aW11bVJlc3BvbnNlcyB8fCAyMDtcbn1cblxuLyoqXG4gKiBAbGVuZHMgbW9kdWxlOlJldmVyc2VHZW9jb2RlI1xuICovXG5SZXZlcnNlR2VvY29kZS5wcm90b3R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XBlLnBvbHlnb24ySnNvbiA9IGZ1bmN0aW9uIChwb2x5Z29uKSB7XG4gICAgdmFyIGpzb25HZW9tID0ge1xuICAgICAgICB0eXBlIDogXCJQb2x5Z29uXCIsXG4gICAgICAgIGNvb3JkaW5hdGVzIDogW1tdXVxuICAgIH07XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBvbHlnb24ubGVuZ3RoOyArK2kpIHtcbiAgICAgICAganNvbkdlb20uY29vcmRpbmF0ZXNbMF0ucHVzaChbcG9seWdvbltpXS54LCBwb2x5Z29uW2ldLnldKTtcbiAgICB9XG5cbiAgICByZXR1cm4ganNvbkdlb207XG59O1xuXG4vKipcbiAqIENvZGVzIEVQU0cgZ8Opb2dyYXBoaXF1ZXMgKGxhdC9sb24pLiBVdGlsZXMgY2FyIGxlcyBjb29yZG9ubsOpZXMgZG9pdmVudCDDqnRyZSBpbnZlcnPDqWVzLlxuICovXG5SZXZlcnNlR2VvY29kZS5nZW9FUFNHID0gW1wiRVBTRzo0MzI2XCJdO1xuXG5leHBvcnQgZGVmYXVsdCBSZXZlcnNlR2VvY29kZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js ***! + \*******************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/ProcessIsoCurveRequest */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/ProcessIsoCurveRequest.js\");\n/* harmony import */ var _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/ProcessIsoCurveResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/ProcessIsoCurveResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'isochrone/distance du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @alias Gp.Services.ProcessIsoCurve\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service iso : 'json' uniquement et par défaut.\n *\n * @param {Object} options.position - Point de départ du calcul.\n * Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.position.x - Abcisse du point de départ du calcul d'isochrone/distance.\n * @param {Float} options.position.y - Ordonnée du point de départ du calcul d'isochrone/distance.\n *\n * @param {String} options.srs - Projection.\n * Système de coordonnées dans lequel les coordonnées du point « location » sont exprimées et\n * dans lequel la géométrie de la courbe résultante sera exprimée.\n * Par défaut, le système de coordonnées utilisé sera « EPSG:4326 ».\n *\n * @param {String} [options.graph = \"voiture\"] - Nom du graphe à utiliser pour le calcul (« Pieton » ou « Voiture »).\n * La valeur par défaut est : «voiture»\n *\n * @param {Array.} [options.exclusions] - DEPRECATED: Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints.\n * Critères d'exclusions à appliquer pour le calcul.\n * On précise ici le type de tronçons que l'on ne veut pas que l'isochrone/distance emprunte\n * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »).\n *\n * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement \"banned\".\n * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement \"wayType\".\n * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement \"=\".\n * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement \"autoroute\".\n *\n * @param {String} [options.method = \"time\"] - Méthode utilisée pour le calcul de la courbe iso.\n * Les valeurs possible sont \"time\" pour un calcul d'isochrone, \"distance\" pour un calcul d'isodistance.\n * Pas de valeur spécifié équivaut à un calcul d'isochrone.\n *\n * @param {String} [options.distanceUnit = \"m\"] - Indique si la distance doit être exprimée en km ou m dans la réponse (\"m\" or \"km\").\n *\n * @param {String} [options.timeUnit = \"second\"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse (\"standard\", \"second\", \"minute\", \"hour\"). Il peut-être formatté hh:mm::ss avec la valeur standard.\n *\n * @param {Float} options.time - Durée maximum (exprimée en secondes) à utiliser pour le calcul de la courbe à partir du ou jusqu'au point « location ».\n * Ce paramètre doit être renseigné si l'option \"méthod\" a la valeur \"time\".\n * Si l'option method n'est pas renseignée, ce paramètre doit être renseigné.\n *\n * @param {Float} options.distance - Distance maximum (exprimée en metres) à utiliser pour le calcul de la courbe à partir du ou j'usqu'au point « location ».\n * Ce paramètre doit être renseigné si l'option \"méthod\" a la valeur \"DISTANCE\".\n * Si l'option \"method\" n'est pas renseignée, ce paramètre sera ignoré.\n *\n * @param {Boolean} [options.reverse = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier.\n * Par défaut, la valeur « false » est appliquée.\n *\n * @param {Boolean} [options.smoothing = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier.\n * Par défaut, la valeur « false » est appliquée.\n *\n * @param {Boolean} [options.holes = false] - Indique si la géométrie résultante (surface) doit être retournée avec des trous (« true »).\n * Par défaut, la valeur « false » est appliquée.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'JSONP', // JSONP|XHR\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * position : {\n * x : 2.3242664298058053,\n * y : 48.86118017324745\n * },\n * distance : 200,\n * [time : ]\n * method : \"distance\",\n * graph : \"voiture\",\n * reverse : false\n * };\n */\n\nfunction ProcessIsoCurve (options) {\n if (!(this instanceof ProcessIsoCurve)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"ProcessIsoCurve\"));\n }\n\n /**\n * Nom de la classe (heritage)\n * FIXME instance ou classe ?\n */\n this.CLASSNAME = \"ProcessIsoCurve\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.ProcessIsoCurve\");\n this.logger.trace(\"[Constructeur ProcessIsoCurve (options)]\");\n\n if (!options.position) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.position.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position.x\"));\n }\n\n if (options.position.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"position.y\"));\n }\n\n if (!options.time && !options.distance) {\n throw new Error(\"Parameter (s) 'distance' missing. Parameter time to calculate an isochrone, parameter distance for an isodistance\");\n }\n\n // si on a que le paramètre \"distance\" en entrée, on calcule une isodistance.\n // Le paramètre \"méthode\" doit pour avoir une réponse du service, être passé à \"distance\"\n if (!options.time && options.distance) {\n this.options.method = \"distance\";\n // on supprime l'éventuel attribut time, résidu d'un appel antérieur\n if (this.options.time) {\n delete this.options.time;\n }\n }\n\n // si on a que le paramètre \"time\" en entrée, on calcule une isochrone.\n // Le paramètre \"méthode\" doit pour avoir une réponse du service, être passé à \"time\"\n if (options.time && !options.distance) {\n this.options.method = \"time\";\n // on supprime l'éventuel attribut time, résidu d'un appel antérieur\n if (this.options.distance) {\n delete this.options.distance;\n }\n }\n\n // au cas où on a ni l'un, ni l'autre...\n this.options.method = this.options.method || \"time\";\n\n // options par defaut du service\n // TODO: modifier la ressource lors de la mise en production du service\n this.options.resource = options.resource || \"bdtopo-iso\";\n this.options.exclusions = options.exclusions || [];\n this.options.reverse = options.reverse || false;\n this.options.srs = options.srs || \"EPSG:4326\";\n this.options.distanceUnit = options.distanceUnit || \"m\";\n this.options.timeUnit = options.timeUnit || \"second\";\n\n // options depreciees\n if (options.smoothing) {\n this.logger.warn(\"options.smoothing is DEPRECATED\");\n }\n this.options.smoothing = false;\n if (options.holes) {\n this.logger.warn(\"options.holes is DEPRECATED\");\n }\n this.options.holes = false;\n\n // Gestion du graphe\n if (options.graph) {\n if (options.graph === \"Voiture\") {\n this.options.graph = \"car\";\n }\n if (options.graph === \"Pieton\") {\n this.options.graph = \"pedestrian\";\n }\n } else {\n this.options.graph = \"car\";\n }\n\n // Gestions des contraintes\n this.options.constraints = [];\n if (options.constraints) {\n if (Array.isArray(options.constraints)) {\n for (var k = 0; k < options.constraints.length; k++) {\n this.options.constraints.push(options.constraints[k]);\n }\n } else {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"constraints\"));\n }\n }\n\n // Gestion de l'ancien paramètre exclusions\n var constraintTunnel = {};\n var constraintPont = {};\n var constraintAutoroute = {};\n if (options.exclusions) {\n if (options.exclusions.length !== 0) {\n this.logger.warn(\"options.exclusions is DEPRECATED !!\");\n for (var c = 0; c < options.exclusions.length; c++) {\n if (typeof options.exclusions[c] === \"string\") {\n options.exclusions[c] = options.exclusions[c].toLowerCase();\n } else {\n // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions\n continue;\n }\n if (options.exclusions[c] === \"toll\") {\n constraintAutoroute.constraintType = \"banned\";\n constraintAutoroute.key = \"wayType\";\n constraintAutoroute.operator = \"=\";\n constraintAutoroute.value = \"autoroute\";\n this.options.constraints.push(constraintAutoroute);\n }\n if (options.exclusions[c] === \"tunnel\") {\n constraintTunnel.constraintType = \"banned\";\n constraintTunnel.key = \"wayType\";\n constraintTunnel.operator = \"=\";\n constraintTunnel.value = \"tunnel\";\n this.options.constraints.push(constraintTunnel);\n }\n if (options.exclusions[c] === \"bridge\") {\n constraintPont.constraintType = \"banned\";\n constraintPont.key = \"wayType\";\n constraintPont.operator = \"=\";\n constraintPont.value = \"pont\";\n this.options.constraints.push(constraintPont);\n }\n }\n }\n }\n\n // on passe l'option outputFormat en minuscules afin d'éviter des exceptions.\n this.options.outputFormat = (typeof options.outputFormat === \"string\") ? options.outputFormat.toLowerCase() : \"json\";\n if (options.outputFormat && options.outputFormat !== \"json\") {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_NOT_SUPPORT\", \"outputFormat\"));\n }\n this.options.outputFormat = \"json\";\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n if (!this.options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone\n /* var urlFound = DefaultUrlService.ProcessIsoCurve.newUrl();\n if (this.options.oldIsoService) {\n urlFound = DefaultUrlService.ProcessIsoCurve.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone\n var urlFound = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ProcessIsoCurve.url();\n if (!urlFound) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = urlFound;\n this.logger.trace(\"Serveur URL par defaut : \" + this.options.serverUrl);\n }\n}\n\n/**\n * @lends module:ProcessIsoCurve#\n */\nProcessIsoCurve.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nProcessIsoCurve.prototype.constructor = ProcessIsoCurve;\n\n/**\n * Création de la requête (overwrite)\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nProcessIsoCurve.prototype.buildRequest = function (error, success) {\n try {\n var oIsoCurve = new _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this.options);\n if (!oIsoCurve.processRequestString()) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\"));\n }\n\n this.request = oIsoCurve.requestString;\n } catch (e) {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](e.message));\n return;\n }\n\n success.call(this, this.request);\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} onError - callback des erreurs\n * @param {Function} onSuccess - callback de succès de l'analyse de la réponse\n */\nProcessIsoCurve.prototype.analyzeResponse = function (onError, onSuccess) {\n if (this.response) {\n var options = {\n response : this.response,\n outputFormat : this.options.outputFormat,\n rawResponse : this.options.rawResponse,\n onSuccess : onSuccess,\n onError : onError,\n scope : this\n };\n\n _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProcessIsoCurve);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUHJvY2Vzc0lzb0N1cnZlL1Byb2Nlc3NJc29DdXJ2ZS5qcz84OGNlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUNpRDtBQUNIO0FBQ1c7QUFDWjtBQUNRO0FBQ2lCO0FBQ2lCOztBQUV2RjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQ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IFwiVm9pdHVyZVwiKSB7XG4gICAgICAgICAgICB0aGlzLm9wdGlvbnMuZ3JhcGggPSBcImNhclwiO1xuICAgICAgICB9XG4gICAgICAgIGlmIChvcHRpb25zLmdyYXBoID09PSBcIlBpZXRvblwiKSB7XG4gICAgICAgICAgICB0aGlzLm9wdGlvbnMuZ3JhcGggPSBcInBlZGVzdHJpYW5cIjtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIHRoaXMub3B0aW9ucy5ncmFwaCA9IFwiY2FyXCI7XG4gICAgfVxuXG4gICAgLy8gR2VzdGlvbnMgZGVzIGNvbnRyYWludGVzXG4gICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzID0gW107XG4gICAgaWYgKG9wdGlvbnMuY29uc3RyYWludHMpIHtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob3B0aW9ucy5jb25zdHJhaW50cykpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGsgPSAwOyBrIDwgb3B0aW9ucy5jb25zdHJhaW50cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgIHRoaXMub3B0aW9ucy5jb25zdHJhaW50cy5wdXNoKG9wdGlvbnMuY29uc3RyYWludHNba10pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKF8uZ2V0TWVzc2FnZShcIlBBUkFNX1RZUEVcIiwgXCJjb25zdHJhaW50c1wiKSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBHZXN0aW9uIGRlIGwnYW5jaWVuIHBhcmFtw6h0cmUgZXhjbHVzaW9uc1xuICAgIHZhciBjb25zdHJhaW50VHVubmVsID0ge307XG4gICAgdmFyIGNvbnN0cmFpbnRQb250ID0ge307XG4gICAgdmFyIGNvbnN0cmFpbnRBdXRvcm91dGUgPSB7fTtcbiAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zKSB7XG4gICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgICB0aGlzLmxvZ2dlci53YXJuKFwib3B0aW9ucy5leGNsdXNpb25zIGlzIERFUFJFQ0FURUQgISFcIik7XG4gICAgICAgICAgICBmb3IgKHZhciBjID0gMDsgYyA8IG9wdGlvbnMuZXhjbHVzaW9ucy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3B0aW9ucy5leGNsdXNpb25zW2NdID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9IG9wdGlvbnMuZXhjbHVzaW9uc1tjXS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG9uIG5lIGNyw6llIHBhcyB1bmUgZXJyZXVyIHBvdXIgcsOpdHJvLWNvbXBhdGliaWxpdMOpIGF2ZWMgbGVzIGFuY2llbm5lcyB2ZXJzaW9uc1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJ0b2xsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludEF1dG9yb3V0ZS5jb25zdHJhaW50VHlwZSA9IFwiYmFubmVkXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUua2V5ID0gXCJ3YXlUeXBlXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUub3BlcmF0b3IgPSBcIj1cIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludEF1dG9yb3V0ZS52YWx1ZSA9IFwiYXV0b3JvdXRlXCI7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3B0aW9ucy5jb25zdHJhaW50cy5wdXNoKGNvbnN0cmFpbnRBdXRvcm91dGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zW2NdID09PSBcInR1bm5lbFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRUdW5uZWwuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLm9wZXJhdG9yID0gXCI9XCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRUdW5uZWwudmFsdWUgPSBcInR1bm5lbFwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChjb25zdHJhaW50VHVubmVsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJicmlkZ2VcIikge1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC5jb25zdHJhaW50VHlwZSA9IFwiYmFubmVkXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRQb250LmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC5vcGVyYXRvciA9IFwiPVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50UG9udC52YWx1ZSA9IFwicG9udFwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChjb25zdHJhaW50UG9udCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gb24gcGFzc2UgbCdvcHRpb24gb3V0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YgKHRoaXMucmVzcG9uc2UpIHtcbiAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICByZXNwb25zZSA6IHRoaXMucmVzcG9uc2UsXG4gICAgICAgICAgICBvdXRwdXRGb3JtYXQgOiB0aGlzLm9wdGlvbnMub3V0cHV0Rm9ybWF0LFxuICAgICAgICAgICAgcmF3UmVzcG9uc2UgOiB0aGlzLm9wdGlvbnMucmF3UmVzcG9uc2UsXG4gICAgICAgICAgICBvblN1Y2Nlc3MgOiBvblN1Y2Nlc3MsXG4gICAgICAgICAgICBvbkVycm9yIDogb25FcnJvcixcbiAgICAgICAgICAgIHNjb3BlIDogdGhpc1xuICAgICAgICB9O1xuXG4gICAgICAgIFByb2Nlc3NJc29DdXJ2ZVJlc3BvbnNlRmFjdG9yeS5idWlsZChvcHRpb25zKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBvbkVycm9yLmNhbGwodGhpcywgbmV3IEVycm9yU2VydmljZShfLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgUHJvY2Vzc0lzb0N1cnZlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/ProcessIsoCurveRequest.js": +/*!**********************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/ProcessIsoCurveRequest.js ***! + \**********************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _model_ProcessIsoCurveParam__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model/ProcessIsoCurveParam */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/model/ProcessIsoCurveParam.js\");\n\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des requêtes sur le service de calcul d'isoschrone/isodistance.\n * Les requêtes peuvent être en mode GET ou POST,\n * et le format de sorti est en JSON.\n *\n * @constructor\n * @alias Gp.Services.ProcessIsoCurve.Request.ProcessIsoCurveRequest\n * @param {Object} options - options\n *\n * @example\n * var options = {\n * httpMethod : 'GET', // GET|POST\n * // spécifique au service\n * position : {\n * x : 2.3242664298058053,\n * y : 48.86118017324745\n * },\n * graph : \"car\",\n * method : 'time',\n * time : 1000, //distance : 200\n * reverse : false,\n * srs : 'EPSG:4326'\n * };\n *\n * try {\n *\n * var oIsoCurve = new ProcessIsoCurveRequest (options);\n * if (!oIsoCurve.processRequestString ()) {\n * // error\n * }\n *\n * var request = oIsoCurve.requestString;\n *\n * } catch (e) {\n * // error\n * }\n * @private\n */\nfunction ProcessIsoCurveRequest (options) {\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"ProcessIsoCurveRequest\");\n this.logger.trace(\"[Constructeur ProcessIsoCurveRequest ()]\");\n\n if (!(this instanceof ProcessIsoCurveRequest)) {\n throw new TypeError(\"ProcessIsoCurveRequest constructor cannot be called as a function.\");\n }\n\n // existance des options\n if (!options) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"options\"));\n }\n\n /**\n * Liste des options\n */\n this.settings = options;\n\n /**\n * Mode HTPP.\n * Par defaut, \"GET\".\n * @type {String}\n */\n this.mode = this.settings.httpMethod || \"GET\";\n}\n\nProcessIsoCurveRequest.prototype = {\n\n /**\n * @lends module:ProcessIsoCurveRequest#\n */\n\n /**\n * Requête\n * @type {String}\n */\n requestString : null,\n\n /**\n * Constructeur (alias)\n */\n constructor : ProcessIsoCurveRequest,\n\n /**\n * Construction de la requête.\n *\n * @example\n * // GET out :\n * // (http://wxs.ign.fr/KEY/isochrone?)\n * // resource=&\n * // point=&\n * // costValue=&\n * // costType=&\n * // profile=&\n * // constraints=&\n * // direction=&\n * // crs=\n *\n * // POST out :\n * {\n * resource: \"bduni-idf-pgr\",\n * point: \"2.337306,48.849319\",\n * costValue: 100,\n * costType: \"time\",\n * profile: \"car\",\n * constraints: [{\n * constraintType: \"banned\",\n * key: \"ways_type\",\n * operator: \"=\",\n * value: \"autoroute\"\n * }]\n * }\n *\n * @returns {String} request\n */\n processRequestString : function () {\n var request = \"\";\n var i = 0;\n\n switch (this.mode) {\n case \"GET\":\n this.logger.trace(\"Process GET Request\");\n\n // Mapping des options avec le service de l'API REST\n var oParams = new _model_ProcessIsoCurveParam__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.settings);\n var params = oParams.getParams();\n\n for (i = 0; i < params.length; i++) {\n var o = params[i];\n if (request) {\n request += \"&\";\n }\n request += o.k + \"=\" + o.v;\n }\n\n break;\n\n case \"POST\":\n this.logger.trace(\"Process POST Request\");\n // creation du JSON\n var postRequest = {};\n\n postRequest.resource = this.settings.resource;\n\n postRequest.point = this.settings.position.x + \",\" + this.settings.position.y;\n\n if (this.settings.method === \"distance\") {\n postRequest.costType = \"distance\";\n postRequest.costValue = this.settings.distance;\n } else {\n postRequest.costType = \"time\";\n postRequest.costValue = this.settings.time;\n }\n\n postRequest.profile = this.settings.graph;\n\n if (this.settings.reverse) {\n postRequest.direction = \"arrival\";\n } else {\n postRequest.direction = \"departure\";\n }\n\n postRequest.constraints = this.settings.constraints;\n\n postRequest.distanceUnit = this.settings.distanceUnit;\n\n postRequest.timeUnit = this.settings.timeUnit;\n\n postRequest.crs = this.settings.srs;\n\n // conversion en chaîne de caractères\n request = JSON.stringify(postRequest);\n break;\n\n default:\n this.logger.error(\"No other HTTP method supported by the service !\");\n }\n\n this.logger.trace(request);\n this.requestString = request;\n\n return this.requestString;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProcessIsoCurveRequest);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUHJvY2Vzc0lzb0N1cnZlL1JlcXVlc3QvUHJvY2Vzc0lzb0N1cnZlUmVxdWVzdC5qcz9iMzc3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQ29EO0FBQ0g7QUFDZTs7QUFFaEU7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxrQkFBa0IsOERBQU07QUFDeEI7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSx3QkFBd0IsZ0VBQUM7QUFDekI7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsY0FBYztBQUNkO0FBQ0E7QUFDQTs7QUFFQTs7Q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ICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBhcmFtcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbyA9IHBhcmFtc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcXVlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QgKz0gXCImXCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdCArPSBvLmsgKyBcIj1cIiArIG8udjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSBcIlBPU1RcIjpcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci50cmFjZShcIlByb2Nlc3MgUE9TVCBSZXF1ZXN0XCIpO1xuICAgICAgICAgICAgICAgIC8vIGNyZWF0aW9uIGR1IEpTT05cbiAgICAgICAgICAgICAgICB2YXIgcG9zdFJlcXVlc3QgPSB7fTtcblxuICAgICAgICAgICAgICAgIHBvc3RSZXF1ZXN0LnJlc291cmNlID0gdGhpcy5zZXR0aW5ncy5yZXNvdXJjZTtcblxuICAgICAgICAgICAgICAgIHBvc3RSZXF1ZXN0LnBvaW50ID0gdGhpcy5zZXR0aW5ncy5wb3NpdGlvbi54ICsgXCIsXCIgKyB0aGlzLnNldHRpbmdzLnBvc2l0aW9uLnk7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5tZXRob2QgPT09IFwiZGlzdGFuY2VcIikge1xuICAgICAgICAgICAgICAgICAgICBwb3N0UmVxdWVzdC5jb3N0VHlwZSA9IFwiZGlzdGFuY2VcIjtcbiAgICAgICAgICAgICAgICAgICAgcG9zdFJlcXVlc3QuY29zdFZhbHVlID0gdGhpcy5zZXR0aW5ncy5kaXN0YW5jZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwb3N0UmV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ZXJyb3IoXCJObyBvdGhlciBIVFRQIG1ldGhvZCBzdXBwb3J0ZWQgYnkgdGhlIHNlcnZpY2UgIVwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMubG9nZ2VyLnRyYWNlKHJlcXVlc3QpO1xuICAgICAgICB0aGlzLnJlcXVlc3RTdHJpbmcgPSByZXF1ZXN0O1xuXG4gICAgICAgIHJldHVybiB0aGlzLnJlcXVlc3RTdHJpbmc7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgUHJvY2Vzc0lzb0N1cnZlUmVxdWVzdDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/ProcessIsoCurveRequest.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/model/ProcessIsoCurveParam.js": +/*!**************************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/model/ProcessIsoCurveParam.js ***! + \**************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n\n\n\n/**\n * @classdesc\n *\n * Classe de gestion des param. des requêtes du service de calcul des iso.\n * Permet le mapping avec les options du service.\n *\n * @constructor\n * @alias Gp.Services.ProcessIsoCurve.Request.ProcessIsoCurveParam\n * @param {Object} options - options\n * @private\n *\n */\nfunction ProcessIsoCurveParam (options) {\n if (!(this instanceof ProcessIsoCurveParam)) {\n throw new TypeError(\"ProcessIsoCurveParam constructor cannot be called as a function.\");\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur ProcessIsoCurveParam ()]\");\n\n /**\n * Options en paramêtres du constructeur.\n */\n this.options = options || {};\n\n // mapping des options avec l'API REST\n\n /** Identifiant de l’isochrone */\n this.id = this.options.id;\n\n /** Resource */\n this.resource = this.options.resource;\n\n /** Coordonnées de départ (ou arrivée si le reverse est à true). */\n this.point = this.options.position;\n\n /** projection (code EPSG comme epsg:4326 ou wgs84) */\n this.crs = this.options.srs;\n\n /**\n * Profil de véhicule à utiliser pour le calcul.\n * Voiture ou Pieton\n */\n this.profile = this.options.graph;\n\n /** Liste des règles de restrictions à utiliser */\n this.constraints = this.options.constraints;\n\n this.reverse = this.options.reverse;\n\n this.timeUnit = this.options.timeUnit;\n\n this.distanceUnit = this.options.distanceUnit;\n\n /**\n * \"time\" pour isochrone ou \"distance\" for isodistance.\n * Par defaut, time...\n */\n if (this.options.method === \"distance\") {\n this.costType = \"distance\";\n this.costValue = this.options.distance;\n } else {\n this.costType = \"time\";\n this.costValue = this.options.time;\n }\n}\n\n/**\n * CLASSNAME\n */\nProcessIsoCurveParam.CLASSNAME = \"ProcessIsoCurveParam\";\n\nProcessIsoCurveParam.prototype = {\n\n /**\n * @lends module:ProcessIsoCurveParam#\n */\n\n /**\n * Constructeur (alias)\n */\n constructor : ProcessIsoCurveParam,\n\n /**\n * Retourne le point\n * @returns {String} x,y\n */\n getLocation : function () {\n return this.point.x + \",\" + this.point.y;\n },\n\n /**\n * Retourne l'unité de la distance\n * @returns {String}\n */\n getDistanceUnit : function () {\n if (this.distanceUnit === \"m\") {\n return \"meter\";\n }\n if (this.distanceUnit === \"km\") {\n return \"kilometer\";\n }\n return \"\";\n },\n\n /**\n * Retourne la liste des contraintes\n * @returns {String}\n */\n getConstraints : function () {\n var constraintArray = [];\n\n if (this.constraints.length !== 0) {\n for (var k = 0; k < this.constraints.length; k++) {\n constraintArray.push(JSON.stringify(this.constraints[k]));\n }\n }\n return constraintArray.join(\"|\");\n },\n\n /**\n * Retourne la direction\n * @returns {String}\n */\n getDirection : function () {\n if (this.reverse) {\n return \"arrival\";\n } else {\n return \"departure\";\n }\n }\n};\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Object[]} KVP\n */\nProcessIsoCurveParam.prototype.getParams = function () {\n var map = [];\n\n map.push({\n k : \"resource\",\n v : this.resource\n });\n\n map.push({\n k : \"point\",\n v : this.getLocation()\n });\n\n map.push({\n k : \"direction\",\n v : this.getDirection()\n });\n\n map.push({\n k : \"costType\",\n v : this.costType\n });\n\n map.push({\n k : \"costValue\",\n v : this.costValue\n });\n\n map.push({\n k : \"profile\",\n v : this.profile\n });\n\n map.push({\n k : \"timeUnit\",\n v : this.timeUnit\n });\n\n map.push({\n k : \"distanceUnit\",\n v : this.getDistanceUnit()\n });\n\n if (this.crs) {\n map.push({\n k : \"crs\",\n v : this.crs\n });\n }\n\n if (this.constraints) {\n map.push({\n k : \"constraints\",\n v : this.getConstraints()\n });\n }\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProcessIsoCurveParam);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUHJvY2Vzc0lzb0N1cnZlL1JlcXVlc3QvbW9kZWwvUHJvY2Vzc0lzb0N1cnZlUGFyYW0uanM/MjU4YiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDdUQ7O0FBRXZEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsa0JBQWtCLDhEQUFNO0FBQ3hCOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUV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KiBDb25zdHJ1Y3RldXIgKGFsaWFzKVxuICAgICAqL1xuICAgIGNvbnN0cnVjdG9yIDogUHJvY2Vzc0lzb0N1cnZlUGFyYW0sXG5cbiAgICAvKipcbiAgICAgKiBSZXRvdXJuZSBsZSBwb2ludFxuICAgICAqIEByZXR1cm5zIHtTdHJpbmd9IHgseVxuICAgICAqL1xuICAgIGdldExvY2F0aW9uIDogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wb2ludC54ICsgXCIsXCIgKyB0aGlzLnBvaW50Lnk7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldG91cm5lIGwndW5pdMOpIGRlIGxhIGRpc3RhbmNlXG4gICAgICogQHJldHVybnMge1N0cmluZ31cbiAgICAgKi9cbiAgICBnZXREaXN0YW5jZVVuaXQgOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLmRpc3RhbmNlVW5pdCA9PT0gXCJtXCIpIHtcbiAgICAgICAgICAgIHJldHVybiBcIm1ldGVyXCI7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuZGlzdGFuY2VVbml0ID09PSBcImttXCIpIHtcbiAgICAgICAgICAgIHJldHVybiBcImtpbG9tZXRlclwiO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBcIlwiO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBSZXRvdXJuZSBsYSBsaXN0ZSBkZXMgY29udHJhaW50ZXNcbiAgICAgKiBAcmV0dXJucyB7U3RyaW5nfVxuICAgICAqL1xuICAgIGdldENvbnN0cmFpbnRzIDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29uc3RyYWludEFycmF5ID0gW107XG5cbiAgICAgICAgaWYgKHRoaXMuY29uc3RyYWludHMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IHRoaXMuY29uc3RyYWludHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICBjb25zdHJhaW50QXJyYXkucHVzaChKU09OLnN0cmluZ2lmeSh0aGlzLmNvbnN0cmFpbnRzW2tdKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGNvbnN0cmFpbnRBcnJheS5qb2luKFwifFwiKTtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogUmV0b3VybmUgbGEgZGlyZWN0aW9uXG4gICAgICogQHJldHVybnMge1N0cmluZ31cbiAgICAgKi9cbiAgICBnZXREaXJlY3Rpb24gOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLnJldmVyc2UpIHtcbiAgICAgICAgICAgIHJldHVybiBcImFycml2YWxcIjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBcImRlcGFydHVyZVwiO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuLyoqXG4gKiBUYWJsZWF1IGRlIGNsZWZzL3ZhbGV1cnMgcG91ciBwYXJhbS5cbiAqXG4gKiBAcmV0dXJucyB7T2JqZWN0W119IEtWUFxuICovXG5Qcm9jZXNzSXNvQ3VydmVQYXJhbS5wcm90b3R5cGUuZ2V0UGFyYW1zID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBtYXAgPSBbXTtcblxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwicmVzb3VyY2VcIixcbiAgICAgICAgdiA6IHRoaXMucmVzb3VyY2VcbiAgICB9KTtcblxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwicG9pbnRcIixcbiAgICAgICAgdiA6IHRoaXMuZ2V0TG9jYXRpb24oKVxuICAgIH0pO1xuXG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJkaXJlY3Rpb25cIixcbiAgICAgICAgdiA6IHRoaXMuZ2V0RGlyZWN0aW9uKClcbiAgICB9KTtcblxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiY29zdFR5cGVcIixcbiAgICAgICAgdiA6IHRoaXMuY29zdFR5cGVcbiAgICB9KTtcblxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiY29zdFZhbHVlXCIsXG4gICAgICAgIHYgOiB0aGlzLmNvc3RWYWx1ZVxuICAgIH0pO1xuXG4gICAgbWFwLnB1c2goe1xuICAgICAgICBrIDogXCJwcm9maWxlXCIsXG4gICAgICAgIHYgOiB0aGlzLnByb2ZpbGVcbiAgICB9KTtcblxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwidGltZVVuaXRcIixcbiAgICAgICAgdiA6IHRoaXMudGltZVVuaXRcbiAgICB9KTtcblxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiZGlzdGFuY2VVbml0XCIsXG4gICAgICAgIHYgOiB0aGlzLmdldERpc3RhbmNlVW5pdCgpXG4gICAgfSk7XG5cbiAgICBpZiAodGhpcy5jcnMpIHtcbiAgICAgICAgbWFwLnB1c2goe1xuICAgICAgICAgICAgayA6IFwiY3JzXCIsXG4gICAgICAgICAgICB2IDogdGhpcy5jcnNcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaWYgKHRoaXMuY29uc3RyYWludHMpIHtcbiAgICAgICAgbWFwLnB1c2goe1xuICAgICAgICAgICAgayA6IFwiY29uc3RyYWludHNcIixcbiAgICAgICAgICAgIHYgOiB0aGlzLmdldENvbnN0cmFpbnRzKClcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG1hcDtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFByb2Nlc3NJc29DdXJ2ZVBhcmFtO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Request/model/ProcessIsoCurveParam.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/ProcessIsoCurveResponseFactory.js": +/*!*******************************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/ProcessIsoCurveResponseFactory.js ***! + \*******************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model/ProcessIsoCurveResponse */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/model/ProcessIsoCurveResponse.js\");\n\n\n\n\n\n/**\n * Factory pour générer une reponse JSON à partir d'un JSON\n * (Factory)\n *\n * @module ProcessIsoCurveResponseFactory\n * @alias Gp.Services.ProcessIsoCurve.Response.ProcessIsoCurveResponseFactory\n * @private\n */\nvar ProcessIsoCurveResponseFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant ProcessIsoCurve\n *\n * @example\n * var options = {\n * response :\n * outputFormat :\n * rawResponse :\n * scope :\n * onSuccess :\n * onError :\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"ProcessIsoCurveResponseFactory\");\n logger.trace([\"ProcessIsoCurveResponseFactory::build()\"]);\n\n var data = null;\n\n if (options.response) {\n if (options.rawResponse) {\n logger.trace(\"analyze response : raw\");\n data = options.response;\n } else {\n logger.trace(\"analyze response : json\");\n\n var JSONResponse;\n if (typeof options.response === \"string\") {\n JSONResponse = JSON.parse(options.response);\n } else {\n JSONResponse = options.response;\n }\n\n // analyse de la reponse\n // création de l'objet de réponse\n data = new _model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n\n // remplissage de l'objet créé avec les attribtuts de la réponse du service\n if (JSONResponse) {\n if (JSONResponse.costType === \"distance\") {\n data.time = \"\";\n data.distance = JSONResponse.costValue;\n } else {\n data.time = JSONResponse.costValue;\n data.distance = \"\";\n }\n\n data.message = \"\";\n data.id = \"\";\n data.srs = JSONResponse.crs;\n data.geometry = JSONResponse.geometry;\n var coords = JSONResponse.point.split(\",\");\n if (data.location) {\n data.location.x = coords[0];\n data.location.y = coords[1];\n }\n } else {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE\", options.response)));\n return;\n }\n\n // info : en cas de problèmes de droits (clé invalide ou autre), la réponse est au format XML !!\n // ex. Key does not exist or has expired\n // mais le statut est 403, l'erreur est donc remontée plus tôt.\n if (data.exceptionReport) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", data.exceptionReport),\n type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"].TYPE_SRVERR,\n status : 200\n }));\n return;\n }\n }\n } else {\n // si la réponse est vide, on appelle le callback d'erreur\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n return;\n }\n\n // si tout s'est bien passé, on appelle le callback de succès\n options.onSuccess.call(options.scope, data);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProcessIsoCurveResponseFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUHJvY2Vzc0lzb0N1cnZlL1Jlc3BvbnNlL1Byb2Nlc3NJc29DdXJ2ZVJlc3BvbnNlRmFjdG9yeS5qcz9kZTQ3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBb0Q7QUFDQTtBQUNRO0FBQ1U7O0FBRXRFO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsZUFBZSxPQUFPO0FBQ3RCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxxQkFBcUIsOERBQU07QUFDM0I7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsaUJBQWlCO0FBQ2pCO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLDJCQUEyQixzRUFBdUI7O0FBRWxEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxxQkFBcUI7QUFDckI7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0F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3B0aW9ucy5yYXdSZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGxvZ2dlci50cmFjZShcImFuYWx5emUgcmVzcG9uc2UgOiByYXdcIik7XG4gICAgICAgICAgICAgICAgZGF0YSA9IG9wdGlvbnMucmVzcG9uc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxvZ2dlci50cmFjZShcImFuYWx5emUgcmVzcG9uc2UgOiBqc29uXCIpO1xuXG4gICAgICAgICAgICAgICAgdmFyIEpTT05SZXNwb25zZTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMucmVzcG9uc2UgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgSlNPTlJlc3BvbnNlID0gSlNPTi5wYXJzZShvcHRpb25zLnJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBKU09OUmVzcG9uc2UgPSBvcHRpb25zLnJlc3BvbnNlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGFuYWx5c2UgZGUgbGEgcmVwb25zZVxuICAgICAgICAgICAgICAgIC8vIGNyw6lhdGlvbiBkZSBsJ29iamV0IGRlIHLDqXBvbnNlXG4gICAgICAgICAgICAgICAgZGF0YSA9IG5ldyBQcm9jZXNzSXNvQ3VydmVSZXNwb25zZSgpO1xuXG4gICAgICAgICAgICAgICAgLy8gcmVtcGxpc3NhZ2UgZGUgbCdvYmpldCBjcsOpw6kgYXZlYyBsZXMgYXR0cmlidHV0cyBkZSBsYSByw6lwb25zZSBkdSBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgaWYgKEpTT05SZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTlJlc3BvbnNlLmNvc3RUeXBlID09PSBcImRpc3RhbmNlXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEudGltZSA9IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmRpc3RhbmNlID0gSlNPTlJlc3BvbnNlLmNvc3RWYWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEudGltZSA9IEpTT05SZXNwb25zZS5jb3N0VmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmRpc3RhbmNlID0gXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGRhdGEubWVzc2FnZSA9IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuaWQgPSBcIlwiO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLnNycyA9IEpTT05SZXNwb25zZS5jcnM7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuZ2VvbWV0cnkgPSBKU09OUmVzcG9uc2UuZ2VvbWV0cnk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb29yZHMgPSBKU09OUmVzcG9uc2UucG9pbnQuc3BsaXQoXCIsXCIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YS5sb2NhdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5sb2NhdGlvbi54ID0gY29vcmRzWzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5sb2NhdGlvbi55ID0gY29vcmRzWzFdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0FOQUxZU0VcIiwgb3B0aW9ucy5yZXNwb25zZSkpKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxu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IGxlIGNhbGxiYWNrIGQnZXJyZXVyXG4gICAgICAgICAgICBvcHRpb25zLm9uRXJyb3IuY2FsbChvcHRpb25zLnNjb3BlLCBuZXcgRXJyb3JTZXJ2aWNlKE1SZXMuZ2V0TWVzc2FnZShcIlNFUlZJQ0VfUkVTUE9OU0VfRU1QVFlcIikpKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHNpIHRvdXQgcydlc3QgYmllbiBwYXNzw6ksIG9uIGFwcGVsbGUgbGUgY2FsbGJhY2sgZGUgc3VjY8Ooc1xuICAgICAgICBvcHRpb25zLm9uU3VjY2Vzcy5jYWxsKG9wdGlvbnMuc2NvcGUsIGRhdGEpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFByb2Nlc3NJc29DdXJ2ZVJlc3BvbnNlRmFjdG9yeTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/ProcessIsoCurveResponseFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/model/ProcessIsoCurveResponse.js": +/*!******************************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/model/ProcessIsoCurveResponse.js ***! + \******************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Response object for {@link module:Services~isoCurve Gp.Services.isoCurve ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Float} distance - distance (expressed in meters) used for the request.\n * @property {Float} time - time (expressed in seconds) used for the request.\n * @property {Object} geometry - Geometry (expressed in [GeoJSON]{@link http://geojson.org/}) of the isocurve.\n * @property {String} id - request id (used by underlying webservice).\n * @property {Gp.Point} location - Position of the start or end point used for the request (expressed in \"srs\" coordinates system).\n * @property {String} message - message\n * @property {String} srs - Identifier of the coordinates system used for the isocurve.\n *\n * @namespace\n * @alias Gp.Services.IsoCurveResponse\n *\n */\nfunction ProcessIsoCurveResponse () {\n if (!(this instanceof ProcessIsoCurveResponse)) {\n throw new TypeError(\"ProcessIsoCurveResponse constructor cannot be called as a function.\");\n }\n\n this.message = null;\n\n this.id = null;\n\n this.location = {};\n this.location.x = null;\n this.location.y = null;\n\n this.srs = null;\n\n this.geometry = null;\n\n this.time = null;\n\n this.distance = null;\n}\n\nProcessIsoCurveResponse.prototype = {\n\n constructor : ProcessIsoCurveResponse\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProcessIsoCurveResponse);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUHJvY2Vzc0lzb0N1cnZlL1Jlc3BvbnNlL21vZGVsL1Byb2Nlc3NJc29DdXJ2ZVJlc3BvbnNlLmpzP2Q5OTQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQTtBQUNBLHdCQUF3Qix1REFBdUQ7QUFDL0U7QUFDQSxjQUFjLE1BQU07QUFDcEIsY0FBYyxNQUFNO0FBQ3BCLGNBQWMsT0FBTyw2Q0FBNkMsMEJBQTBCO0FBQzVGLGNBQWMsT0FBTztBQUNyQixjQUFjLFNBQVM7QUFDdkIsY0FBYyxPQUFPO0FBQ3JCLGNBQWMsT0FBTztBQUNyQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7O0FBRWUsc0ZBQXVCLEV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291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/Response/model/ProcessIsoCurveResponse.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestFactory.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestFactory.js ***! + \*********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _RouteRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RouteRequestREST */ \"./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestREST.js\");\n\n\n\n\n/**\n * Creation d'une requête REST en mode POST ou GET\n * (Factory)\n *\n * @module RouteRequestFactory\n * @alias Gp.Services.Route.Request.RouteRequestFactory\n * @private\n */\nvar RouteRequestFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Route\n *\n * @example\n * // utilisation avec les callback\n * var options = {\n * (...)\n * onSuccess : function (response) {},\n * onError : function (error) {},\n * // spécifique au service\n * startPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * endPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * provideBbox : false,\n * exclusions : [\"bridge\", \"tunnel\", \"toll\"],\n * distanceUnit : \"km\",\n * graph : \"Voiture\",\n * geometryInInstructions : false,\n * routePreference : \"fastest\"\n * };\n * RouteRequestFactory.build(options);\n *\n * // utilisation sans callback\n * var options = {...};\n * try {\n * var result = RouteRequestFactory.build(options);\n * if (! result) { throw new Error(\"...\"):}\n * } catch (e) {\n * // todo\n * }\n * @returns {String} request\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"RouteRequestFactory\");\n logger.trace([\"RouteRequestFactory::build()\"]);\n\n var request = null;\n\n var settings = options || {};\n\n // gestion des callback\n var bOnError = !!(options.onError !== null && typeof options.onError === \"function\");\n\n var message = null;\n\n // FIXME les exceptions ne sont pas 'catchées' sur le constructeur !\n var myReq = new _RouteRequestREST__WEBPACK_IMPORTED_MODULE_2__[\"default\"](settings);\n if (!myReq.processRequestString()) {\n message = \"Error process request (rest) !\";\n if (bOnError) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__[\"default\"](message));\n return;\n }\n throw new Error(message);\n }\n request = myReq.requestString;\n\n return request;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RouteRequestFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUmVxdWVzdC9Sb3V0ZVJlcXVlc3RGYWN0b3J5LmpzPzFlZDUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBb0Q7QUFDUTtBQUNWOztBQUVsRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsT0FBTztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ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T09IG51bGwgJiYgdHlwZW9mIG9wdGlvbnMub25FcnJvciA9PT0gXCJmdW5jdGlvblwiKTtcblxuICAgICAgICB2YXIgbWVzc2FnZSA9IG51bGw7XG5cbiAgICAgICAgLy8gRklYTUUgbGVzIGV4Y2VwdGlvbnMgbmUgc29udCBwYXMgJ2NhdGNow6llcycgc3VyIGxlIGNvbnN0cnVjdGV1ciAhXG4gICAgICAgIHZhciBteVJlcSA9IG5ldyBSb3V0ZVJlcXVlc3RSRVNUKHNldHRpbmdzKTtcbiAgICAgICAgaWYgKCFteVJlcS5wcm9jZXNzUmVxdWVzdFN0cmluZygpKSB7XG4gICAgICAgICAgICBtZXNzYWdlID0gXCJFcnJvciBwcm9jZXNzIHJlcXVlc3QgKHJlc3QpICFcIjtcbiAgICAgICAgICAgIGlmIChiT25FcnJvcikge1xuICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2UobWVzc2FnZSkpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgfVxuICAgICAgICByZXF1ZXN0ID0gbXlSZXEucmVxdWVzdFN0cmluZztcblxuICAgICAgICByZXR1cm4gcmVxdWVzdDtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBSb3V0ZVJlcXVlc3RGYWN0b3J5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestREST.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestREST.js ***! + \******************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _model_RouteParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model/RouteParamREST */ \"./node_modules/geoportal-access-lib/src/Services/Route/Request/model/RouteParamREST.js\");\n\n\n\n\n\n/**\n * @classdesc\n * Classe de gestion des requêtes de type REST sur le service de calcul d'itineraire\n * (uniquement en GET)\n *\n * @constructor\n * @alias Gp.Services.Route.Request.RouteRequestREST\n * @param {Object} options - options definies dans le composant Route\n *\n * @example\n * var options = {\n * (...)\n * };\n *\n * @private\n */\nfunction RouteRequestREST (options) {\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"RouteRequestREST\");\n this.logger.trace(\"[Constructeur RouteRequestREST ()]\");\n\n if (!(this instanceof RouteRequestREST)) {\n throw new TypeError(\"RouteRequestREST constructor cannot be called as a function.\");\n }\n\n // existance des options\n if (!options) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_EMPTY\", \"options\"));\n }\n\n /** liste des options */\n this.settings = options;\n}\n\nRouteRequestREST.prototype = {\n\n /**\n * @lends module:RouteRequestREST#\n */\n\n /**\n * request\n * @type {String}\n */\n requestString : null,\n\n /**\n * Constructeur (alias)\n */\n constructor : RouteRequestREST,\n\n /**\n * Construction de la requête.\n *\n * @example\n * // GET out : origin=2.416907353809513,48.8465772142297&destination=2.4248037771493673,48.84591353161838\n * // POST out : Not yet supported method POST !\n * @returns {String} request\n */\n processRequestString : function () {\n // INFO\n // construction simple sans template...,\n // mais en attendant que les services soient fixés, on taggue ce composant en mode PROTOTYPE !\n this.logger.warn(\" PROTOTYPE !\");\n\n // Mapping des options avec le service de l'API REST\n var oParams = new _model_RouteParamREST__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.settings);\n var params = oParams.getParams();\n\n var request = \"\";\n for (var i = 0; i < params.length; i++) {\n var o = params[i];\n if (request) {\n request += \"&\";\n }\n request += o.k + \"=\" + o.v;\n }\n\n // Exemple :\n // http://wxs.ign.fr/KEY/itineraire/rest/route.json?\n // origin=&\n // destination=&\n // waypoints=&\n // method=DISTANCE&\n // graph=Pieton&\n // graphName=Pieton&\n // exclusions=&\n // tolerance=10&\n // srs=\n\n this.logger.trace(request);\n this.requestString = request;\n\n return this.requestString;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RouteRequestREST);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUmVxdWVzdC9Sb3V0ZVJlcXVlc3RSRVNULmpzPzlmYzEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFDb0Q7QUFDSDtBQUNHOztBQUVwRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxrQkFBa0IsOERBQU07QUFDeEI7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSx3QkFBd0IsZ0VBQUM7QUFDekI7O0FBRUE7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTt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ciBwYXJhbXMgPSBvUGFyYW1zLmdldFBhcmFtcygpO1xuXG4gICAgICAgIHZhciByZXF1ZXN0ID0gXCJcIjtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXJhbXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciBvID0gcGFyYW1zW2ldO1xuICAgICAgICAgICAgaWYgKHJlcXVlc3QpIHtcbiAgICAgICAgICAgICAgICByZXF1ZXN0ICs9IFwiJlwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVxdWVzdCArPSBvLmsgKyBcIj1cIiArIG8udjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEV4ZW1wbGUgOlxuICAgICAgICAvLyAgaHR0cDovL3d4cy5pZ24uZnIvS0VZL2l0aW5lcmFpcmUvcmVzdC9yb3V0ZS5qc29uP1xuICAgICAgICAvLyAgb3JpZ2luPSZcbiAgICAgICAgLy8gIGRlc3RpbmF0aW9uPSZcbiAgICAgICAgLy8gIHdheXBvaW50cz0mXG4gICAgICAgIC8vICBtZXRob2Q9RElTVEFOQ0UmXG4gICAgICAgIC8vICBncmFwaD1QaWV0b24mXG4gICAgICAgIC8vICBncmFwaE5hbWU9UGlldG9uJlxuICAgICAgICAvLyAgZXhjbHVzaW9ucz0mXG4gICAgICAgIC8vICB0b2xlcmFuY2U9MTAmXG4gICAgICAgIC8vICBzcnM9XG5cbiAgICAgICAgdGhpcy5sb2dnZXIudHJhY2UocmVxdWVzdCk7XG4gICAgICAgIHRoaXMucmVxdWVzdFN0cmluZyA9IHJlcXVlc3Q7XG5cbiAgICAgICAgcmV0dXJuIHRoaXMucmVxdWVzdFN0cmluZztcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBSb3V0ZVJlcXVlc3RSRVNUO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestREST.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Route/Request/model/RouteParamREST.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Route/Request/model/RouteParamREST.js ***! + \**********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n\n\n\n/**\n * @classdesc\n * Classe de gestion des param. des requêtes du service de calcul d'itineraire (REST).\n * Permet le mapping avec les options du service.\n * @constructor\n * @alias Gp.Services.Route.Request.RouteParamREST\n * @param {Object} options - options\n *\n * @private\n */\nfunction RouteParamREST (options) {\n if (!(this instanceof RouteParamREST)) {\n throw new TypeError(\"RouteParamREST constructor cannot be called as a function.\");\n }\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger();\n this.logger.trace(\"[Constructeur RouteParamREST ()]\");\n /**\n * Options en paramêtres du constructeur.\n */\n this.options = options || {};\n\n // mapping des options avec l'API REST\n\n /** Ressource utilisée */\n this.resource = this.options.resource;\n\n /** Coordonnées du point de départ. */\n this.start = this.options.startPoint.x + \",\" + this.options.startPoint.y;\n\n /** Coordonnées du point d’arrivée. */\n this.end = this.options.endPoint.x + \",\" + this.options.endPoint.y;\n\n /** Coordonnées des étapes point de départ. */\n this.intermediates = this.options.viaPoints;\n\n /** Nom du profile à utiliser */\n this.profile = this.options.graph;\n\n /** projection (code EPSG comme epsg:4326 ou wgs84) */\n this.crs = this.options.srs;\n\n /** Liste des contraintes */\n this.constraints = this.options.constraints;\n\n /** Nom de l'optimisation à utiliser */\n this.optimization = this.options.routePreference;\n\n /** Format de sortie (résumé de l’itinéraire) */\n this.getSteps = (this.options.geometryInInstructions) ? \"true\" : \"false\";\n\n /** Unité des distances */\n this.distanceUnit = this.options.distanceUnit;\n\n /** Unité des durées */\n this.timeUnit = this.options.timeUnit;\n\n /** Attributs des voies */\n this.waysAttributes = this.options.waysAttributes;\n}\n\n/**\n * CLASSNAME\n */\nRouteParamREST.CLASSNAME = \"RouteParamREST\";\n\nRouteParamREST.prototype = {\n\n /**\n * @lends module:RouteParamREST#\n */\n\n /**\n * Constructeur (alias)\n */\n constructor : RouteParamREST,\n\n /**\n * Retourne une liste de points\n * @returns {String} une liste de points (sep '|')\n */\n getIntermediates : function () {\n var array = [];\n if (this.intermediates.length !== 0) {\n for (var i = 0; i < this.intermediates.length; i++) {\n var obj = this.intermediates[i];\n array.push(obj.x + \",\" + obj.y);\n }\n }\n\n return array.join(\"|\");\n },\n\n /**\n * Retourne une liste d'attributs\n * @returns {String} une liste d'attributs (sep '|')\n */\n getWaysAttributes : function () {\n return this.waysAttributes.join(\"|\");\n },\n\n /**\n * Retourne un profile\n * @returns {String} profile\n */\n getProfile : function () {\n return this.profile;\n },\n\n /**\n * Retourne un distanceUnit\n * @returns {String} distanceUnit\n */\n getDistanceUnit : function () {\n if (this.distanceUnit === \"m\") {\n return \"meter\";\n }\n if (this.distanceUnit === \"km\") {\n return \"kilometer\";\n }\n return \"\";\n },\n\n /**\n * Retourne une optimisation\n * @returns {String} optimization\n */\n getOptimization : function () {\n if (this.optimization) {\n return this.optimization;\n } else {\n return \"\";\n }\n },\n\n /**\n * Retourne la liste des constraints\n * @returns {String} une liste des constraints (sep '|')\n */\n getConstraints : function () {\n var constraintArray = [];\n\n if (this.constraints.length !== 0) {\n for (var k = 0; k < this.constraints.length; k++) {\n constraintArray.push(JSON.stringify(this.constraints[k]));\n }\n }\n return constraintArray.join(\"|\");\n }\n};\n\n/**\n * Tableau de clefs/valeurs pour param.\n *\n * @returns {Array} liste de paramêtres\n */\nRouteParamREST.prototype.getParams = function () {\n var map = [];\n\n map.push({\n k : \"resource\",\n v : this.resource\n });\n\n map.push({\n k : \"start\",\n v : this.start\n });\n\n map.push({\n k : \"end\",\n v : this.end\n });\n\n map.push({\n k : \"geometryFormat\",\n v : \"geojson\"\n });\n\n if (this.optimization) {\n map.push({\n k : \"optimization\",\n v : this.getOptimization()\n });\n }\n\n if (this.intermediates) {\n map.push({\n k : \"intermediates\",\n v : this.getIntermediates()\n });\n }\n\n if (this.profile) {\n map.push({\n k : \"profile\",\n v : this.getProfile()\n });\n }\n\n if (this.constraints) {\n map.push({\n k : \"constraints\",\n v : this.getConstraints()\n });\n }\n\n if (this.crs) {\n map.push({\n k : \"crs\",\n v : this.crs\n });\n }\n\n if (this.distanceUnit) {\n map.push({\n k : \"distanceUnit\",\n v : this.getDistanceUnit()\n });\n }\n\n if (this.timeUnit) {\n map.push({\n k : \"timeUnit\",\n v : this.timeUnit\n });\n }\n\n if (this.waysAttributes) {\n map.push({\n k : \"waysAttributes\",\n v : this.getWaysAttributes()\n });\n }\n\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RouteParamREST);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUmVxdWVzdC9tb2RlbC9Sb3V0ZVBhcmFtUkVTVC5qcz9jYjhkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUN1RDs7QUFFdkQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLGtCQUFrQiw4REFBTTtBQUN4QjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O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0ZSBkJ2F0dHJpYnV0cyAoc2VwICd8JylcbiAgICAgKi9cbiAgICBnZXRXYXlzQXR0cmlidXRlcyA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMud2F5c0F0dHJpYnV0ZXMuam9pbihcInxcIik7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldG91cm5lIHVuIHByb2ZpbGVcbiAgICAgKiBAcmV0dXJucyB7U3RyaW5nfSBwcm9maWxlXG4gICAgICovXG4gICAgZ2V0UHJvZmlsZSA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJvZmlsZTtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogUmV0b3VybmUgdW4gZGlzdGFuY2VVbml0XG4gICAgICogQHJldHVybnMge1N0cmluZ30gZGlzdGFuY2VVbml0XG4gICAgICovXG4gICAgZ2V0RGlzdGFuY2VVbml0IDogZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5kaXN0YW5jZVVuaXQgPT09IFwibVwiKSB7XG4gICAgICAgICAgICByZXR1cm4gXCJtZXRlclwiO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmRpc3RhbmNlVW5pdCA9PT0gXCJrbVwiKSB7XG4gICAgICAgICAgICByZXR1cm4gXCJraWxvbWV0ZXJcIjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gXCJcIjtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogUmV0b3VybmUgdW5lIG9wdGltaXNhdGlvblxuICAgICAqIEByZXR1cm5zIHtTdHJpbmd9IG9wdGltaXphdGlvblxuICAgICAqL1xuICAgIGdldE9wdGltaXphdGlvbiA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHRoaXMub3B0aW1pemF0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5vcHRpbWl6YXRpb247XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBy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gICAgICAgIGsgOiBcImVuZFwiLFxuICAgICAgICB2IDogdGhpcy5lbmRcbiAgICB9KTtcblxuICAgIG1hcC5wdXNoKHtcbiAgICAgICAgayA6IFwiZ2VvbWV0cnlGb3JtYXRcIixcbiAgICAgICAgdiA6IFwiZ2VvanNvblwiXG4gICAgfSk7XG5cbiAgICBpZiAodGhpcy5vcHRpbWl6YXRpb24pIHtcbiAgICAgICAgbWFwLnB1c2goe1xuICAgICAgICAgICAgayA6IFwib3B0aW1pemF0aW9uXCIsXG4gICAgICAgICAgICB2IDogdGhpcy5nZXRPcHRpbWl6YXRpb24oKVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5pbnRlcm1lZGlhdGVzKSB7XG4gICAgICAgIG1hcC5wdXNoKHtcbiAgICAgICAgICAgIGsgOiBcImludGVybWVkaWF0ZXNcIixcbiAgICAgICAgICAgIHYgOiB0aGlzLmdldEludGVybWVkaWF0ZXMoKVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5wcm9maWxlKSB7XG4gICAgICAgIG1hcC5wdXNoKHtcbiAgICAgICAgICAgIGsgOiBcInByb2ZpbGVcIixcbiAgICAgICAgICAgIHYgOiB0aGlzLmdldFByb2ZpbGUoKVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5jb25zdHJhaW50cykge1xuICAgICAgICBtYXAucHVzaCh7XG4gICAgICAgICAgICBrIDogXCJjb25zdHJhaW50c1wiLFxuICAgICAgICAgICAgdiA6IHRoaXMuZ2V0Q29uc3RyYWludHMoKVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5jcnMpIHtcbiAgICAgICAgbWFwLnB1c2goe1xuICAgICAgICAgICAgayA6IFwiY3JzXCIsXG4gICAgICAgICAgICB2IDogdGhpcy5jcnNcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaWYgKHRoaXMuZGlzdGFuY2VVbml0KSB7XG4gICAgICAgIG1hcC5wdXNoKHtcbiAgICAgICAgICAgIGsgOiBcImRpc3RhbmNlVW5pdFwiLFxuICAgICAgICAgICAgdiA6IHRoaXMuZ2V0RGlzdGFuY2VVbml0KClcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaWYgKHRoaXMudGltZVVuaXQpIHtcbiAgICAgICAgbWFwLnB1c2goe1xuICAgICAgICAgICAgayA6IFwidGltZVVuaXRcIixcbiAgICAgICAgICAgIHYgOiB0aGlzLnRpbWVVbml0XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGlmICh0aGlzLndheXNBdHRyaWJ1dGVzKSB7XG4gICAgICAgIG1hcC5wdXNoKHtcbiAgICAgICAgICAgIGsgOiBcIndheXNBdHRyaWJ1dGVzXCIsXG4gICAgICAgICAgICB2IDogdGhpcy5nZXRXYXlzQXR0cmlidXRlcygpXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHJldHVybiBtYXA7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBSb3V0ZVBhcmFtUkVTVDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Request/model/RouteParamREST.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Route/Response/RouteResponseFactory.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Route/Response/RouteResponseFactory.js ***! + \***********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _model_RouteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model/RouteResponse */ \"./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteResponse.js\");\n/* harmony import */ var _model_RouteInstruction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./model/RouteInstruction */ \"./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteInstruction.js\");\n\n\n\n\n\n\n/**\n * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON\n * (Factory)\n *\n * @module RouteResponseFactory\n * @alias Gp.Services.Route.Response.RouteResponseFactory\n * @private\n */\nvar RouteResponseFactory = {\n\n /**\n * interface unique\n *\n * @method build\n * @static\n * @param {Object} options - options definies dans le composant Route\n *\n * @example\n * var options = {\n * response :\n * outputFormat :\n * rawResponse :\n * scope :\n * onSuccess :\n * onError :\n * };\n *\n */\n build : function (options) {\n // logger\n var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"RouteResponseFactory\");\n logger.trace(\"RouteResponseFactory::build()\");\n\n var data = null;\n\n if (options.response) {\n if (options.rawResponse) {\n logger.trace(\"analyze response : raw\");\n data = options.response;\n } else {\n logger.trace(\"analyze response : json\");\n\n var JSONResponse;\n if (typeof options.response === \"string\") {\n JSONResponse = JSON.parse(options.response);\n } else {\n JSONResponse = options.response;\n }\n\n // construction de l'objet réponse JSON\n if (JSONResponse) {\n // le service renvoie t il une erreur ?\n if (JSONResponse.message) {\n // ex. {\"message\":\"message not null\", \"status\":\"ERROR\"}\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION\", JSONResponse.message)));\n return;\n }\n var legs = [];\n var legSteps = [];\n var steps = [];\n\n data = new _model_RouteResponse__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n\n if (data.hasOwnProperty(\"totalTime\")) {\n data.totalTime = parseFloat(JSONResponse.duration);\n }\n if (data.hasOwnProperty(\"totalDistance\")) {\n data.totalDistance = parseFloat(JSONResponse.distance);\n }\n\n if (data.hasOwnProperty(\"bbox\")) {\n data.bbox.left = parseFloat(JSONResponse.bbox[0]);\n data.bbox.bottom = parseFloat(JSONResponse.bbox[1]);\n data.bbox.right = parseFloat(JSONResponse.bbox[2]);\n data.bbox.top = parseFloat(JSONResponse.bbox[3]);\n }\n\n if (data.hasOwnProperty(\"routeGeometry\") && !options.geometryInInstructions) {\n data.routeGeometry = JSONResponse.geometry;\n }\n\n if (data.hasOwnProperty(\"routeInstructions\") && options.geometryInInstructions) {\n var legList = JSONResponse.portions;\n var i;\n if (Array.isArray(legList) && legList.length) {\n for (i = 0; i < legList.length; i++) {\n legs.push(legList[i]);\n }\n }\n if (legs.length) {\n for (i = 0; i < legs.length; i++) {\n legSteps.push(legs[i].steps);\n }\n }\n if (legSteps.length) {\n for (i = 0; i < legSteps.length; i++) {\n steps = steps.concat(legSteps[i]);\n }\n }\n\n steps.forEach(function (step) {\n data.routeInstructions.push(new _model_RouteInstruction__WEBPACK_IMPORTED_MODULE_4__[\"default\"]());\n data.routeInstructions[data.routeInstructions.length - 1].duration = step.duration;\n data.routeInstructions[data.routeInstructions.length - 1].distance = step.distance;\n data.routeInstructions[data.routeInstructions.length - 1].code = \"\";\n data.routeInstructions[data.routeInstructions.length - 1].instruction = \"\";\n data.routeInstructions[data.routeInstructions.length - 1].geometry = step.geometry;\n\n // on ne souhaite pas de ce type de valeur...\n if (step.name === \"Valeur non renseignée\") {\n step.name = \"\";\n }\n\n switch (step.instruction.type) {\n case \"turn\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Tourner\";\n break;\n case \"new name\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Continuer tout droit\";\n break;\n case \"depart\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Départ\";\n break;\n case \"arrive\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Arrivée\";\n break;\n case \"merge\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Rejoindre\";\n break;\n case \"ramp\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Prendre la bretelle\";\n break;\n case \"on ramp\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Prendre la bretelle\";\n break;\n case \"off ramp\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Prendre la sortie\";\n break;\n case \"fork\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Sur la bifurcation, prendre\";\n break;\n case \"end of road\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"À la fin de la route, prendre\";\n break;\n case \"use lane\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Utiliser la file\";\n break;\n case \"continue\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Continuer\";\n break;\n case \"roundabout\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Au rond-point\";\n break;\n case \"rotary\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Au rond-point\";\n break;\n case \"roundabout turn\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"Au rond point, tourner\";\n break;\n case \"notification\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"\";\n break;\n default:\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \"?\" + step.instruction.type + \"?\";\n break;\n }\n\n if (step.instruction.modifier) {\n switch (step.instruction.modifier) {\n case \"uturn\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction = \"Faire demi-tour\";\n break;\n case \"sharp right\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" complètement à droite\";\n break;\n case \"right\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" à droite\";\n break;\n case \"slight right\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" légèrement à droite\";\n break;\n case \"straight\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction = \"Continuer tout droit\";\n break;\n case \"slight left\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" lègèrement à gauche\";\n break;\n case \"left\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" à gauche\";\n break;\n case \"sharp left\":\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" complètement à gauche\";\n break;\n default:\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" ?\" + step.instruction.modifier + \"?\";\n break;\n }\n }\n\n if (step.instruction.exit) {\n data.routeInstructions[data.routeInstructions.length - 1].instruction += `${step.instruction.exit}e sortie`;\n }\n\n if (step.attributes.name) {\n if (step.attributes.name.nom_1_droite || step.attributes.name.toponyme) {\n data.routeInstructions[data.routeInstructions.length - 1].instruction += \" sur\";\n }\n\n if (step.attributes.name.nom_1_droite) {\n data.routeInstructions[data.routeInstructions.length - 1].instruction += ` ${step.attributes.name.nom_1_droite}`;\n }\n\n if (step.attributes.name.toponyme) {\n data.routeInstructions[data.routeInstructions.length - 1].instruction += ` ${step.attributes.name.toponyme}`;\n }\n }\n });\n }\n }\n\n if (!data) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_ANALYSE\", \"json\")));\n return;\n }\n\n // Si la réponse contenait une exception renvoyée par le service\n if (data.exceptionReport) {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EXCEPTION_2\")));\n return;\n }\n }\n } else {\n options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n return;\n }\n\n options.onSuccess.call(options.scope, data);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RouteResponseFactory);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUmVzcG9uc2UvUm91dGVSZXNwb25zZUZhY3RvcnkuanM/OWY1MyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBb0Q7QUFDQTtBQUNRO0FBQ1Y7QUFDTTs7QUFFeEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLHFCQUFxQiw4REFBTTtBQUMzQjs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYjs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxpQkFBaUI7QUFDakI7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGdDQUFnQztBQUNoQyxnRUFBZ0UsZ0VBQVksQ0FBQyxnRUFBSTtBQUNqRjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLCtC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2UpIHtcbiAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDogcmF3XCIpO1xuICAgICAgICAgICAgICAgIGRhdGEgPSBvcHRpb25zLnJlc3BvbnNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJhbmFseXplIHJlc3BvbnNlIDoganNvblwiKTtcblxuICAgICAgICAgICAgICAgIHZhciBKU09OUmVzcG9uc2U7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnJlc3BvbnNlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgIEpTT05SZXNwb25zZSA9IEpTT04ucGFyc2Uob3B0aW9ucy5yZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgSlNPTlJlc3BvbnNlID0gb3B0aW9ucy5yZXNwb25zZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBjb25zdHJ1Y3Rpb24gZGUgbCdvYmpldCByw6lwb25zZSBKU09OXG4gICAgICAgICAgICAgICAgaWYgKEpTT05SZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsZSBzZXJ2aWNlIHJlbnZvaWUgdCBpbCB1bmUgZXJyZXVyID9cbiAgICAgICAgICAgICAgICAgICAgaWYgKEpTT05SZXNwb25zZS5tZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBleC4ge1wibWVzc2FnZVwiOlwibWVzc2FnZSBub3QgbnVsbFwiLCBcInN0YXR1c1wiOlwiRVJST1JcIn1cbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2UoTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05cIiwgSlNPTlJlc3BvbnNlLm1lc3NhZ2UpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlZ3MgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlZ1N0ZXBzID0gW107XG4gICAgICAgICAgICAgICAgICAgIHZhciBzdGVwcyA9IFtdO1xuXG4gICAgICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgUm91dGVSZXNwb25zZSgpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhLmhhc093blByb3BlcnR5KFwidG90YWxUaW1lXCIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnRvdGFsVGltZSA9IHBhcnNlRmxvYXQoSlNPTlJlc3BvbnNlLmR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YS5oYXNPd25Qcm9wZXJ0eShcInRvdGFsRGlzdGFuY2VcIikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEudG90YWxEaXN0YW5jZSA9IHBhcnNlRmxvYXQoSlNPTlJlc3BvbnNlLmRpc3RhbmNlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhLmhhc093blByb3BlcnR5KFwiYmJveFwiKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5iYm94LmxlZnQgPSBwYXJzZUZsb2F0KEpTT05SZXNwb25zZS5iYm94WzBdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYmJveC5ib3R0b20gPSBwYXJzZUZsb2F0KEpTT05SZXNwb25zZS5iYm94WzFdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYmJveC5yaWdodCA9IHBhcnNlRmxvYXQoSlNPTlJlc3BvbnNlLmJib3hbMl0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5iYm94LnRvcCA9IHBhcnNlRmxvYXQoSlNPTlJlc3BvbnNlLmJib3hbM10pO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGEuaGFzT3duUHJvcGVydHkoXCJyb3V0ZUdlb21ldHJ5XCIpICYmICFvcHRpb25zLmdlb21ldHJ5SW5JbnN0cnVjdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVHZW9tZXRyeSA9IEpTT05SZXNwb25zZS5nZW9tZXRyeTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhLmhhc093blByb3BlcnR5KFwicm91dGVJbnN0cnVjdGlvbnNcIikgJiYgb3B0aW9ucy5nZW9tZXRyeUluSW5zdHJ1Y3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGVnTGlzdCA9IEpTT05SZXNwb25zZS5wb3J0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobGVnTGlzdCkgJiYgbGVnTGlzdC5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVnTGlzdC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWdzLnB1c2gobGVnTGlzdFtpXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxlZ3MubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlZ3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVnU3RlcHMucHVzaChsZWdzW2ldLnN0ZXBzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGVnU3RlcHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlZ1N0ZXBzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXBzID0gc3RlcHMuY29uY2F0KGxlZ1N0ZXBzW2ldKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXBzLmZvckVhY2goZnVuY3Rpb24gKHN0ZXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLnB1c2gobmV3IFJvdXRlSW5zdHJ1Y3Rpb24oKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmR1cmF0aW9uID0gc3RlcC5kdXJhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uZGlzdGFuY2UgPSBzdGVwLmRpc3RhbmNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5jb2RlID0gXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gPSBcIlwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5nZW9tZXRyeSA9IHN0ZXAuZ2VvbWV0cnk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiBuZSBzb3VoYWl0ZSBwYXMgZGUgY2UgdHlwZSBkZSB2YWxldXIuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RlcC5uYW1lID09PSBcIlZhbGV1ciBub24gcmVuc2VpZ27DqWVcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGVwLm5hbWUgPSBcIlwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoc3RlcC5pbnN0cnVjdGlvbi50eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJ0dXJuXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCJUb3VybmVyXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcIm5ldyBuYW1lXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCJDb250aW51ZXIgdG91dCBkcm9pdFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJkZXBhcnRcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBcIkTDqXBhcnRcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiYXJyaXZlXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCJBcnJpdsOpZVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJtZXJnZVwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiUmVqb2luZHJlXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcInJhbXBcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBcIlByZW5kcmUgbGEgYnJldGVsbGVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwib24gcmFtcFwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiUHJlbmRyZSBsYSBicmV0ZWxsZVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJvZmYgcmFtcFwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiUHJlbmRyZSBsYSBzb3J0aWVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiZm9ya1wiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiU3VyIGxhIGJpZnVyY2F0aW9uLCBwcmVuZHJlXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcImVuZCBvZiByb2FkXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCLDgCBsYSBmaW4gZGUgbGEgcm91dGUsIHByZW5kcmVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwidXNlIGxhbmVcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBcIlV0aWxpc2VyIGxhIGZpbGVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiY29udGludWVcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBcIkNvbnRpbnVlclwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJyb3VuZGFib3V0XCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCJBdSByb25kLXBvaW50XCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcInJvdGFyeVwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiQXUgcm9uZC1wb2ludFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJyb3VuZGFib3V0IHR1cm5cIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBcIkF1IHJvbmQgcG9pbnQsIHRvdXJuZXJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwibm90aWZpY2F0aW9uXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiP1wiICsgc3RlcC5pbnN0cnVjdGlvbi50eXBlICsgXCI/XCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RlcC5pbnN0cnVjdGlvbi5tb2RpZmllcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHN0ZXAuaW5zdHJ1Y3Rpb24ubW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJ1dHVyblwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiA9IFwiRmFpcmUgZGVtaS10b3VyXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwic2hhcnAgcmlnaHRcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCIgY29tcGzDqHRlbWVudCDDoCBkcm9pdGVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJyaWdodFwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBcIiDDoCBkcm9pdGVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJzbGlnaHQgcmlnaHRcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCIgbMOpZ8OocmVtZW50IMOgIGRyb2l0ZVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcInN0cmFpZ2h0XCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uID0gXCJDb250aW51ZXIgdG91dCBkcm9pdFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcInNsaWdodCBsZWZ0XCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiIGzDqGfDqHJlbWVudCDDoCBnYXVjaGVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJsZWZ0XCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiIMOgIGdhdWNoZVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcInNoYXJwIGxlZnRcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zW2RhdGEucm91dGVJbnN0cnVjdGlvbnMubGVuZ3RoIC0gMV0uaW5zdHJ1Y3Rpb24gKz0gXCIgY29tcGzDqHRlbWVudCDDoCBnYXVjaGVcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IFwiID9cIiArIHN0ZXAuaW5zdHJ1Y3Rpb24ubW9kaWZpZXIgKyBcIj9cIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGVwLmluc3RydWN0aW9uLmV4aXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5yb3V0ZUluc3RydWN0aW9uc1tkYXRhLnJvdXRlSW5zdHJ1Y3Rpb25zLmxlbmd0aCAtIDFdLmluc3RydWN0aW9uICs9IGAke3N0ZXAuaW5zdHJ1Y3Rpb24uZXhpdH1lIHNvcnRpZWA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0ZXAuYXR0cmlidXRlcy5uYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGVwLmF0dHJpYnV0ZXMubmFtZS5ub21fMV9kcm9pdGUgfHwgc3RlcC5hdHRyaWJ1dGVzLm5hbWUudG9wb255bWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBcIiBzdXJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGVwLmF0dHJpYnV0ZXMubmFtZS5ub21fMV9kcm9pdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBgICR7c3RlcC5hdHRyaWJ1dGVzLm5hbWUubm9tXzFfZHJvaXRlfWA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RlcC5hdHRyaWJ1dGVzLm5hbWUudG9wb255bWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucm91dGVJbnN0cnVjdGlvbnNbZGF0YS5yb3V0ZUluc3RydWN0aW9ucy5sZW5ndGggLSAxXS5pbnN0cnVjdGlvbiArPSBgICR7c3RlcC5hdHRyaWJ1dGVzLm5hbWUudG9wb255bWV9YDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2UoTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9BTkFMWVNFXCIsIFwianNvblwiKSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2kgbGEgcsOpcG9uc2UgY29udGVuYWl0IHVuZSBleGNlcHRpb24gcmVudm95w6llIHBhciBsZSBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgaWYgKGRhdGEuZXhjZXB0aW9uUmVwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvci5jYWxsKG9wdGlvbnMuc2NvcGUsIG5ldyBFcnJvclNlcnZpY2UoTVJlcy5nZXRNZXNzYWdlKFwiU0VSVklDRV9SRVNQT05TRV9FWENFUFRJT05fMlwiKSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3B0aW9ucy5vbkVycm9yLmNhbGwob3B0aW9ucy5zY29wZSwgbmV3IEVycm9yU2VydmljZShNUmVzLmdldE1lc3NhZ2UoXCJTRVJWSUNFX1JFU1BPTlNFX0VNUFRZXCIpKSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBvcHRpb25zLm9uU3VjY2Vzcy5jYWxsKG9wdGlvbnMuc2NvcGUsIGRhdGEpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFJvdXRlUmVzcG9uc2VGYWN0b3J5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Response/RouteResponseFactory.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteInstruction.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteInstruction.js ***! + \*************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n/**\n * Single Route Instruction object.\n *\n * @property {String} code - Instruction code :\n *\n * - \"F\" : Straight forward\n * - \"B\" : U-turn\n * - \"L\" : turn left\n * - \"R\" : turn right\n * - \"BL\" : turn left strongly\n * - \"BR\" : turn right strongly\n * - \"FL\" : turn lightly to the left\n * - \"FR\" : turn lightly to the right\n * - \"round_about_entry\" : round about entry\n * - \"round_about_exit\" : round about exit\n *\n * @property {String} instruction - Instruction text : translated code + street name\n * @property {Object} geometry - Geometry (expressed in [GeoJSON]{@link http://geojson.org/}) of the street.\n * @property {Float} distance - Length of the instruction. Expressed in km or m, depending on distanceUnit parameter.\n * @property {Float} duration - Instruction duration in seconds.\n *\n * @namespace\n * @alias Gp.Services.Route.RouteInstruction\n */\nfunction RouteInstruction () {\n if (!(this instanceof RouteInstruction)) {\n throw new TypeError(\"RouteInstruction constructor cannot be called as a function.\");\n }\n\n this.duration = null;\n\n this.distance = null;\n\n this.code = null;\n\n this.instruction = null;\n\n this.geometry = null; // FIXME can be null if option 'geometryInInstructions' is false !\n}\n\nRouteInstruction.prototype = {\n\n constructor : RouteInstruction\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RouteInstruction);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zc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cblxuICAgIHRoaXMuZHVyYXRpb24gPSBudWxsO1xuXG4gICAgdGhpcy5kaXN0YW5jZSA9IG51bGw7XG5cbiAgICB0aGlzLmNvZGUgPSBudWxsO1xuXG4gICAgdGhpcy5pbnN0cnVjdGlvbiA9IG51bGw7XG5cbiAgICB0aGlzLmdlb21ldHJ5ID0gbnVsbDsgLy8gRklYTUUgY2FuIGJlIG51bGwgaWYgb3B0aW9uICdnZW9tZXRyeUluSW5zdHJ1Y3Rpb25zJyBpcyBmYWxzZSAhXG59XG5cblJvdXRlSW5zdHJ1Y3Rpb24ucHJvdG90eXBlID0ge1xuXG4gICAgY29uc3RydWN0b3IgOiBSb3V0ZUluc3RydWN0aW9uXG5cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFJvdXRlSW5zdHJ1Y3Rpb247XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteInstruction.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteResponse.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteResponse.js ***! + \**********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Response object for {@link module:Services~route Gp.Services.route ()} invocation when successful. Received as the argument of onSuccess callback function.\n *\n * @property {Gp.BBox} bbox - Bounding Box of the route. Given when provideBBox parameter is used in function call.\n * @property {Object} routeGeometry - Geometry (expressed in [GeoJSON]{@link http://geojson.org/}) of the route.\n * @property {Array.} routeInstructions - Instructions of the route.\n * @property {String} totalDistance - Length of the route. If distanceUnit parameter was set to \"km\" (default), totalDistance is a string containing the total distance expressed in kilometers, followed by \" Km\" (e.g. : \"19.6 Km\"). If distanceUnit parameter was set to \"m\", totalDistance is a string containing the total distance expressed in meters (e.g. : \"19599.14\").\n * @property {Float} totalTime - Route duration in seconds.\n *\n * @namespace\n * @alias Gp.Services.RouteResponse\n */\nfunction RouteResponse () {\n if (!(this instanceof RouteResponse)) {\n throw new TypeError(\"RouteResponse constructor cannot be called as a function.\");\n }\n\n this.totalTime = null;\n\n this.totalDistance = null;\n\n this.bbox = {\n left : null,\n right : null,\n top : null,\n bottom : null\n };\n\n this.routeGeometry = null; // FIXME can be null if option 'geometryInInstructions' is true !\n\n this.routeInstructions = [];\n}\n\nRouteResponse.prototype = {\n\n constructor : RouteResponse\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RouteResponse);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUmVzcG9uc2UvbW9kZWwvUm91dGVSZXNwb25zZS5qcz8yNjYyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFDQSx3QkFBd0IsaURBQWlEO0FBQ3pFO0FBQ0EsY0FBYyxRQUFRO0FBQ3RCLGNBQWMsT0FBTyxrREFBa0QsMEJBQTBCO0FBQ2pHLGNBQWMsMkNBQTJDO0FBQ3pELGNBQWMsT0FBTztBQUNyQixjQUFjLE1BQU07QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsOEJBQThCOztBQUU5QjtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVlLDRFQUFhLEVBQUMiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZ2VvcG9ydGFsLWFjY2Vzcy1saWIvc3JjL1NlcnZpY2VzL1JvdXRlL1Jlc3BvbnNlL21vZG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wb25zZVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBSb3V0ZVJlc3BvbnNlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Response/model/RouteResponse.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Route/Route.js": +/*!***********************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Route/Route.js ***! + \***********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/LoggerByDefault */ \"./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Utils/MessagesResources */ \"./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\");\n/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Exceptions/ErrorService */ \"./node_modules/geoportal-access-lib/src/Exceptions/ErrorService.js\");\n/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CommonService */ \"./node_modules/geoportal-access-lib/src/Services/CommonService.js\");\n/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DefaultUrlService */ \"./node_modules/geoportal-access-lib/src/Services/DefaultUrlService.js\");\n/* harmony import */ var _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Request/RouteRequestFactory */ \"./node_modules/geoportal-access-lib/src/Services/Route/Request/RouteRequestFactory.js\");\n/* harmony import */ var _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Response/RouteResponseFactory */ \"./node_modules/geoportal-access-lib/src/Services/Route/Response/RouteResponseFactory.js\");\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Appel du service d'itinéraire du Géoportail :\n * envoi de la requête construite selon les paramètres en options,\n * éventuellement parsing et analyse de la réponse,\n * retour d'une réponse en paramètre de la fonction onSuccess.\n *\n * @alias Gp.Services.Route\n * @constructor\n * @extends {Gp.Services.CommonService}\n * @param {Object} options - options spécifiques au service (+ les options heritées)\n *\n * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité.\n *\n * @param {String} options.outputFormat - Le format de la réponse du service itineraire : 'json' uniquement et par défaut.\n *\n * @param {String} [options.routePreference = \"fastest\"] - Mode de calcul à utiliser :\n * - le plus rapide « fastest »\n * - le plus court « shortest »\n * Par défaut : « fastest ».\n *\n * @param {Object} options.startPoint - Point de départ du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.startPoint.x - Abcisse du point de départ du calcul d'itinéraire.\n * @param {Float} options.startPoint.y - Ordonnée du point de départ du calcul d'itinéraire.\n *\n * @param {Object} options.endPoint - Point d'arrivée du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326)\n * @param {Float} options.endPoint.x - Abcisse du point d'arrivée du calcul d'itinéraire.\n * @param {Float} options.endPoint.y - Ordonnée du point d'arrivée du calcul d'itinéraire.\n *\n * @param {Object[]} [options.viaPoints] - Liste de point ({x:Float,y:Float}) intermédaires que l'itinéraire doit emprunter dans l'ordre du tableau.\n * Coordonnées exprimées en longitudes, latitudes (EPSG:4326) :{x:float, y:float}\n *\n * @param {String} [options.graph = \"voiture\"] - Type de graphe utilisé : \"Voiture\" ou \"Pieton\".\n * Détermine le profil de vitesses utilisé pour le calcul ainsi que les tronçons autorisés ou non.\n * Par défaut, c'est la valeur \"Voiture\" qui sera utilisée.\n *\n * @param {String[]} [options.exclusions] - DEPRECATED: Critères d'exclusions à appliquer pour le calcul. (correspond au paramètre \"avoidFeature\" d'OpenLS)\n * On précise ici le type de tronçons que l'on ne veut pas que l'itinéraire emprunte\n * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »).\n * Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints\n *\n * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement \"banned\".\n * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement \"wayType\".\n * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement \"=\".\n * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement \"autoroute\".\n *\n * @param {Boolean} [options.geometryInInstructions = false] - Indique si la géométrie de l'itinéraire doit être reprise morceau par morceau dans les instructions.\n * (correspond au paramètre \"provideGeometry\" d'OpenLS) Par défaut : false.\n *\n * @param {Boolean} [options.provideBbox = true] - Indique si les instructions doivent être localisées par une bbox dans la réponse.\n * Par défaut : true.\n *\n * @param {String} [options.distanceUnit = \"m\"] - Indique si la distance doit être exprimée en km ou m dans la réponse.\n * Par défaut : m.\n * @param {String} [options.timeUnit = \"second\"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse. Il peut-être formatté hh:mm::ss avec la valeur standard.\n * Les valeurs possibles sont \"standard\", \"second\", \"minute\" ou \"hour\".\n * Par défaut : \"standard\".\n *\n * @param {String} [options.srs] - Système de coordonnées dans lequel les paramètres géographiques en entrée et la réponse du service sont exprimés.\n * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 'EPSG:4326'.\n *\n * @param {String[]} [options.waysAttributes] - Nom des attributs des voies. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities.\n *\n * @example\n * var options = {\n * // options communes aux services\n * apiKey : null,\n * serverUrl : 'http://localhost/service/',\n * protocol : 'XHR',\n * proxyURL : null,\n * httpMethod : 'GET', // GET|POST\n * timeOut : 10000, // ms\n * rawResponse : false, // true|false\n * scope : null, // this\n * onSuccess : function (response) {},\n * onFailure : function (error) {},\n * // spécifique au service\n * resource : 'bdtopo'\n * outputFormat : 'json',\n * startPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * endPoint : {\n * x : 42.1121,\n * y : 1.5557\n * },\n * provideBbox : true,\n * exclusions : [\"Bridge\", \"Tunnel\", \"Toll\"],\n * distanceUnit : \"km\",\n * graph : \"Voiture\",\n * geometryInInstructions : true,\n * routePreference : \"fastest\"\n * };\n *\n */\nfunction Route (options) {\n if (!(this instanceof Route)) {\n throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"CLASS_CONSTRUCTOR\", \"Route\"));\n }\n\n /**\n * Nom de la classe (heritage)\n */\n this.CLASSNAME = \"Route\";\n\n // appel du constructeur par heritage\n _CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].apply(this, arguments);\n\n this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"Gp.Services.Route\");\n this.logger.trace(\"[Constructeur Route (options)]\");\n\n if (!options.startPoint) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.startPoint.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint.x\"));\n }\n\n if (options.startPoint.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"startPoint.y\"));\n }\n\n if (!options.endPoint) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint\"));\n }\n\n // on lance une exception afin d'eviter au service de le faire...\n if (options.endPoint.x === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint.x\"));\n }\n\n if (options.endPoint.y === null) {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_MISSING\", \"endPoint.y\"));\n }\n\n // options par defaut\n\n // on passe l'option outputFormat en minuscules afin d'éviter des exceptions.\n if (options.outputFormat && options.outputFormat !== \"json\") {\n this.logger.warn(\"options.outputFormat could only be json\");\n }\n this.options.outputFormat = \"json\";\n\n this.options.resource = options.resource || \"bdtopo-osrm\";\n this.options.startPoint = options.startPoint;\n this.options.endPoint = options.endPoint;\n this.options.viaPoints = options.viaPoints || [];\n this.options.routePreference = options.routePreference || \"fastest\";\n /** Gestion des anciennes valeurs de graph */\n if (options.graph) {\n if (options.graph === \"Voiture\") {\n this.options.graph = \"car\";\n }\n if (options.graph === \"Pieton\") {\n this.options.graph = \"pedestrian\";\n }\n } else {\n this.options.graph = \"car\";\n }\n this.options.constraints = [];\n if (options.constraints) {\n if (Array.isArray(options.constraints)) {\n for (var k = 0; k < options.constraints.length; k++) {\n this.options.constraints.push(options.constraints[k]);\n }\n } else {\n throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"PARAM_TYPE\", \"constraints\"));\n }\n }\n\n /** Gestion de l'ancien paramètre exclusion */\n var constraintTunnel = {};\n var constraintPont = {};\n var constraintAutoroute = {};\n if (options.exclusions) {\n if (options.exclusions.length !== 0) {\n this.logger.warn(\"options.exclusions is DEPRECATED !!\");\n for (var c = 0; c < options.exclusions.length; c++) {\n if (typeof options.exclusions[c] === \"string\") {\n options.exclusions[c] = options.exclusions[c].toLowerCase();\n } else {\n // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions\n continue;\n }\n if (options.exclusions[c] === \"toll\") {\n constraintAutoroute.constraintType = \"banned\";\n constraintAutoroute.key = \"wayType\";\n constraintAutoroute.operator = \"=\";\n constraintAutoroute.value = \"autoroute\";\n this.options.constraints.push(constraintAutoroute);\n }\n if (options.exclusions[c] === \"tunnel\") {\n constraintTunnel.constraintType = \"banned\";\n constraintTunnel.key = \"wayType\";\n constraintTunnel.operator = \"=\";\n constraintTunnel.value = \"tunnel\";\n this.options.constraints.push(constraintTunnel);\n }\n if (options.exclusions[c] === \"bridge\") {\n constraintPont.constraintType = \"banned\";\n constraintPont.key = \"wayType\";\n constraintPont.operator = \"=\";\n constraintPont.value = \"pont\";\n this.options.constraints.push(constraintPont);\n }\n }\n }\n }\n\n this.options.geometryInInstructions = options.geometryInInstructions || false;\n this.options.provideBbox = options.provideBbox || true;\n this.options.distanceUnit = options.distanceUnit || \"m\";\n this.options.timeUnit = options.timeUnit || \"second\";\n this.options.expectedStartTime = null; // FIXME not yet implemented !\n this.options.srs = options.srs || \"EPSG:4326\";\n this.options.waysAttributes = options.waysAttributes || [];\n\n // gestion de l'url du service par defaut\n // si l'url n'est pas renseignée, il faut utiliser les urls par defaut\n if (!this.options.serverUrl) {\n // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire\n /* var UrlByDefault = DefaultUrlService.Route.newUrl();\n if (this.options.oldRouteService) {\n UrlByDefault = DefaultUrlService.Route.url();\n } */\n // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire\n var UrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Route.url();\n\n if (!UrlByDefault) {\n throw new Error(\"Url by default not found !\");\n }\n this.options.serverUrl = UrlByDefault;\n this.logger.trace(\"Serveur URL par defaut : \" + this.options.serverUrl);\n }\n}\n\n/**\n * @lends module:Route#\n */\nRoute.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {\n // todo\n // getter/setter\n});\n\n/*\n * Constructeur (alias)\n */\nRoute.prototype.constructor = Route;\n\n/**\n * (overwrite)\n * Création de la requête\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nRoute.prototype.buildRequest = function (error, success) {\n var options = {\n // spécifique au service\n resource : this.options.resource,\n startPoint : this.options.startPoint,\n endPoint : this.options.endPoint,\n viaPoints : this.options.viaPoints,\n provideBbox : this.options.provideBbox,\n constraints : this.options.constraints,\n distanceUnit : this.options.distanceUnit,\n timeUnit : this.options.timeUnit,\n graph : this.options.graph,\n geometryInInstructions : this.options.geometryInInstructions,\n routePreference : this.options.routePreference,\n srs : this.options.srs,\n waysAttributes : this.options.waysAttributes\n };\n\n this.request = _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].build(options);\n\n // on teste si la requete a bien été construite !\n if (!this.request) {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_REQUEST_BUILD\")));\n } else {\n success.call(this, this.request);\n }\n};\n\n/**\n * (overwrite)\n * Analyse de la reponse\n *\n * @param {Function} error - callback des erreurs\n * @param {Function} success - callback\n */\nRoute.prototype.analyzeResponse = function (error, success) {\n // INFO\n // Factory pour masquer la complexité du retour du service\n\n if (this.response) {\n var options = {\n distanceUnit : this.options.distanceUnit,\n timeUnit : this.options.timeUnit,\n response : this.response,\n outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML !\n rawResponse : this.options.rawResponse,\n onError : error,\n onSuccess : success,\n scope : this,\n geometryInInstructions : this.options.geometryInInstructions\n };\n\n _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__[\"default\"].build(options);\n } else {\n error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMessage(\"SERVICE_RESPONSE_EMPTY\")));\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Route);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvUm91dGUvUm91dGUuanM/ZjE5YyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFDaUQ7QUFDSDtBQUNXO0FBQ1o7QUFDUTtBQUNXO0FBQ0c7O0FBRW5FO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYixXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsTUFBTTtBQUNqQjtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLE1BQU07QUFDakIsV0FBVyxNQUFNO0FBQ2pCO0FBQ0EsV0FBVyxTQUFTLHdDQUF3QyxnQkFBZ0I7QUFDNUUscUVBQXFFO0FBQ3JFO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQixXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBLFdBQVcsUUFBUTtBQUNuQjtBQUNBO0F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MucHVzaChvcHRpb25zLmNvbnN0cmFpbnRzW2tdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihfLmdldE1lc3NhZ2UoXCJQQVJBTV9UWVBFXCIsIFwiY29uc3RyYWludHNcIikpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqIEdlc3Rpb24gZGUgbCdhbmNpZW4gcGFyYW3DqHRyZSBleGNsdXNpb24gKi9cbiAgICB2YXIgY29uc3RyYWludFR1bm5lbCA9IHt9O1xuICAgIHZhciBjb25zdHJhaW50UG9udCA9IHt9O1xuICAgIHZhciBjb25zdHJhaW50QXV0b3JvdXRlID0ge307XG4gICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9ucykge1xuICAgICAgICBpZiAob3B0aW9ucy5leGNsdXNpb25zLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIud2FybihcIm9wdGlvbnMuZXhjbHVzaW9ucyBpcyBERVBSRUNBVEVEICEhXCIpO1xuICAgICAgICAgICAgZm9yICh2YXIgYyA9IDA7IGMgPCBvcHRpb25zLmV4Y2x1c2lvbnMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmV4Y2x1c2lvbnNbY10gPSBvcHRpb25zLmV4Y2x1c2lvbnNbY10udG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbiBuZSBjcsOpZSBwYXMgdW5lIGVycmV1ciBwb3VyIHLDqXRyby1jb21wYXRpYmlsaXTDqSBhdmVjIGxlcyBhbmNpZW5uZXMgdmVyc2lvbnNcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwidG9sbFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUuY29uc3RyYWludFR5cGUgPSBcImJhbm5lZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLmtleSA9IFwid2F5VHlwZVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50QXV0b3JvdXRlLm9wZXJhdG9yID0gXCI9XCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRBdXRvcm91dGUudmFsdWUgPSBcImF1dG9yb3V0ZVwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuY29uc3RyYWludHMucHVzaChjb25zdHJhaW50QXV0b3JvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXhjbHVzaW9uc1tjXSA9PT0gXCJ0dW5uZWxcIikge1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLmNvbnN0cmFpbnRUeXBlID0gXCJiYW5uZWRcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5rZXkgPSBcIndheVR5cGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludFR1bm5lbC5vcGVyYXRvciA9IFwiPVwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50VHVubmVsLnZhbHVlID0gXCJ0dW5uZWxcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLmNvbnN0cmFpbnRzLnB1c2goY29uc3RyYWludFR1bm5lbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmV4Y2x1c2lvbnNbY10gPT09IFwiYnJpZGdlXCIpIHtcbiAgICAgICAgICAgICAg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IifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Route/Route.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Services/Services.js": +/*!********************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Services/Services.js ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Config_Config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Config/Config */ \"./node_modules/geoportal-access-lib/src/Services/Config/Config.js\");\n/* harmony import */ var _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Alti/Alti */ \"./node_modules/geoportal-access-lib/src/Services/Alti/Alti.js\");\n/* harmony import */ var _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Geocode/Geocode */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/Geocode.js\");\n/* harmony import */ var _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Geocode/ReverseGeocode */ \"./node_modules/geoportal-access-lib/src/Services/Geocode/ReverseGeocode.js\");\n/* harmony import */ var _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AutoComplete/AutoComplete */ \"./node_modules/geoportal-access-lib/src/Services/AutoComplete/AutoComplete.js\");\n/* harmony import */ var _Route_Route__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Route/Route */ \"./node_modules/geoportal-access-lib/src/Services/Route/Route.js\");\n/* harmony import */ var _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProcessIsoCurve/ProcessIsoCurve */ \"./node_modules/geoportal-access-lib/src/Services/ProcessIsoCurve/ProcessIsoCurve.js\");\n/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"point|circle|bbox\" }] */\n\n/**\n* Geoportal web services invocation namespace.\n*\n* @module Services\n* @alias Gp.Services\n*/\n\n\n\n\n\n\n\n\nvar Services = {\n /**\n * Access to Geoportal resources metadata availables with one ore several keys\n *\n * @method getConfig\n * @param {Object} options - Options for function call.\n * @param {String} [options.apiKey] - Access key(s) (\",\" as separator, no spaces) to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}\n * @param {String} [options.customConfigFile] - path to a local config file. Overload the apiKey parameter\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GetConfigResponse} object as a parameter except if \"rawResponse\" parameter is set to true : a String will be returned.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n */\n getConfig : function (options) {\n var configService = new _Config_Config__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options);\n configService.call();\n },\n /**\n * Getting elevations in or along of one or several points on french territories using the [elevation services of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/alti.html}.
\n * Two use cases are availables :
\n * 1. getting elevations of the given points : don't use the options.sampling parameter ;
\n * 2. getting a regular set of elevations along the given points : use the options.sampling parameter.\n *\n * @method getAltitude\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {Array.} options.positions - Array of positions ({lon:float, lat:float}) expressed in CRS:84 coordinates system, where to get elevations. 50 positions maximum may be given. 2 positions minimum are required if you use the options.sampling parameter.\n * @param {Number} [options.sampling] - Number of points to use (between 2 and 5000) in order to compute an elevation path. The points given with the options.positions parameter are used to fix the planimetric path along which the elevations will be computed.
\n * If not used, only elevations of these positions will be returned.\n * @param {Boolean} [options.zonly=false] - Set this parameter to true if you only want to have elevations returned without corresponding coordinates.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AltiResponse} object as a parameter, except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/alti/rest/elevation.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n * @param {String} [options.api='REST'] - What API to use for interacting with underlying web service : 'REST'. Only use if you know what you are doing.\n * @param {String} [options.outputFormat='xml'] - Output format for underlying web service response : 'xml' or 'json'. Only use if you know what you are doing.\n */\n getAltitude : function (options) {\n var altiService = new _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__[\"default\"](options);\n altiService.call();\n },\n /**\n * Getting positon of a geographic identifier (places names, address, cadastral parcel, other...) using the [geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage.html}.\n *\n * @example\n * Gp.Services.geocode ({\n * apiKey : \"carte\",\n * location : \"73 avenue de Paris, Saint-Mandé\",\n * // traitement des resultats\n * onSuccess : function (result) {\n * console.log(\"found (x:\"+result.position.x+\", y:\"+result.position.y+\")\") ;\n * }\n * }) ;\n *\n *\n * @method geocode\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.index=\"StreetAddress\"] - Geographical identifier type to search. Values currently availables are : \"PositionOfInterest\" for place names, \"StreetAddress\" for address search, \"CadastralParcel\" for Cadastral parcels search, \"location\" for a multi-index search on \"StreetAddress\" and \"PositionOfInterest\". Default is \"StreetAddress\".\n * @param {String} options.query - Geographic identifier to locate.\n * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given.\n * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be \"String\".\n *

\n * Properties availables for address search :
\n * \"postalCode\", \"inseeCode\" and \"city\".\n *

\n * Properties availables for place names search :
\n * \"postalCode\", \"inseeCode\" and \"type\".\n *

\n * Properties availables for cadastral parcels search :
\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided.\n * @param {Boolean} [options.returnTrueGeometry=false] - Set this parameter to true if you wish to have the true geometrie returned.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n geocode : function (options) {\n var geocodeService = new _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__[\"default\"](options);\n geocodeService.call();\n },\n /**\n * Retrieving geographical identifiers (place names, address, cadastral parcels, ...) near a given position, using the [reverse geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage-inverse.html}.\n *\n * @method reverseGeocode\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.index=\"StreetAddress\"] - Geographical identifier type to search. Values currently availables are : \"PositionOfInterest\" for place names, \"StreetAddress\" for address search, \"CadastralParcel\" for Cadastral parcels search, \"location\" for a multi-index search on \"StreetAddress\" and \"PositionOfInterest\". Default is \"StreetAddress\".\n * @param {Object} options.position - Reference position where to search geographical identifiers.\n * @param {Float} options.position.lon - Longitude\n * @param {Float} options.position.lat - Latitude\n * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given.\n * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be \"String\".\n *

\n * Properties availables for address search :
\n * \"postalCode\", \"inseeCode\" and \"city\".\n *

\n * Properties availables for place names search :
\n * \"postalCode\", \"inseeCode\" and \"type\".\n *

\n * Properties availables for cadastral parcels search :
\n * \"codeDepartement\", \"codeCommune\", \"nomCommune\", \"codeCommuneAbs\", \"codeArrondissement\", \"section\", \"numero\", \"feuille\".\n * @param {Object} [options.searchGeometry] - Location where to perform the search.\n * @param {String} options.searchGeometry.type - Geometry type (Point|Circle|Linestring|Polygon)\n * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordinates\n * @param {Float} [options.searchGeometry.radius] - Radius (only for type 'Circle')\n * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n reverseGeocode : function (options) {\n var reverseGeocodeService = new _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__[\"default\"](options);\n reverseGeocodeService.call();\n },\n /**\n * Getting suggestions of probable places names or address based on uncomplete texts, using the [autocompletion service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/autocompletion.html}\n *\n * @method autoComplete\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} options.text - Text input to complete.\n * @param {Array.} [options.filterOptions.type = \"StreetAddress\"] - Suggestion types to provide : address (\"StreetAddress\") and/or place name (\"PositionOfInterest\").\n * @param {Array.} [options.filterOptions.territory] - Places where to limit the search of suggestions : \"METROPOLE\" (Corsica and metropolitan France), \"DOMTOM\" (French overseas departments and territories), or an INSEE code of a department. No limitation by default. For instance : ['METROPOLE', '31']\n * @param {Number} [options.maximumResponses = 10] - Maximum number of responses.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AutoCompleteResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/ols/apis/completion] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n autoComplete : function (options) {\n var autoCompleteService = new _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__[\"default\"](options);\n autoCompleteService.call();\n },\n /**\n * Getting a route from one point to another using the [route service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/itineraires.html}.\n *\n * @method route\n * @param {Object} options - Options for function call.\n * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} [options.routePreference = \"fastest\"] - Indicates the way to compute the route : \"fastest\" (time optimisation) or \"shortest\" (distance optimisation). Available values are in the GetCapabilities.\n * @param {Gp.Point} options.startPoint - Start point of the route. Expressed in CRS:84 coordinates system (startPoint.x corresponds to longitude, startPoint.y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {Gp.Point} options.endPoint - End point of the route. Expressed in CRS:84 coordinates system (endPoint.x corresponds to longitude, endPoint.y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {Array.} [options.viaPoints] - Ordered via Points of the route. Expressed in CRS:84 coordinates system (viaPoints[i].x corresponds to longitude, viaPoints[i].y corresponds to latitude). Available bbox are in the GetCapabilities.\n * @param {String} [options.graph = \"Voiture\"] - User profile to use to compute the route : \"Voiture\" (using a vehicule) or \"Pieton\" (pedestrian). Has an influence on the kind of roads the route may use and the average speed. Available bbox are in the GetCapabilities.\n * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features (\"toll\", \"bridge\" or \"tunnel\").\n * @param {Boolean} [options.geometryInInstructions = false] - Indicates if route geometry has to be also returned with route instructions.\n * @param {Boolean} [options.provideBoundingBox = true] - Indicates if route instructions has to be localised with a BBOX in the response.\n * @param {String} [options.distanceUnit = \"m\"] - The unit used to provide distances in the response (\"meter\" or \"kilometer\").\n * @param {String} [options.timeUnit = \"second\"] - The unit used to provide duration in the response (\"standard\", \"second\", \"minute\", \"hour\").\n * @param {Array.} [options.waysAttributes] - Way Attributes to add in the response. Available values are in the GetCapabilities.\n * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.RouteResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.outputFormat='json'] - Output format (\"json\" or \"xml\") to use for underlying webService. Only use if you know what you are doing.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/itineraire/rest/route.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n route : function (options) {\n var routeService = new _Route_Route__WEBPACK_IMPORTED_MODULE_5__[\"default\"](options);\n routeService.call();\n },\n /**\n * Computing a set of places (curve) reachable from a given point (or from where to start to reach a given point) within a time or distance constraint using the [isochrone service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/isochrones.html}.\n *\n * @method isoCurve\n * @param {Object} options - Options for function call.\n * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}.\n * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities.\n * @param {Gp.Point} options.position - Start or Arrival (options.reverse===true) Point for the computing. Expressed in CRS:84 coordinates system (position.x corresponds to longitude, position.y corresponds to latitude).\n * @param {String} [options.graph = \"Voiture\"] - User profile to use to compute the isoCurve : \"Voiture\" (using a vehicule) or \"Pieton\" (pedestrian). Has an influence on the kind of roads to use and the average speed. Available values are in the GetCapabilities.\n * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features (\"toll\", \"bridge\" or \"tunnel\").\n * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities.\n * @param {String} [options.method = \"time\"] - Computing method to use : \"time\" (using a duration as a constraint) or \"distance\" (using a distance as a constraint). Available values are in the GetCapabilities.\n * @param {Float} options.time - Maximum duration (expressed in seconds) to use when options.method is set to \"time\".\n * @param {Float} options.distance - Maximum distance (expressed in meters) to use when options.method is set to \"distance\".\n * @param {Boolean} [options.reverse = false] - Set this parameter to true if you want options.position to be the destination (instead of departure) for the computing.\n * @param {String} [options.distanceUnit = \"km\"] - The unit used to provide distances in the response (\"m\" or \"km\").\n * @param {String} [options.timeUnit = \"second\"] - The unit used to provide duration in the response (\"standard\", \"second\", \"minute\", \"hour\").\n * @param {Boolean} [options.smoothing = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry to be smoothed.\n * @param {Boolean} [options.holes = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry (polygon) to have holes if pertinent.\n * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.IsoCurveResponse} object as a parameter except if \"rawResponse\" is set to true.\n * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter.\n * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled.\n * @param {String} [options.outputFormat='json'] - Output format (\"json\") to use for underlying webService. Only use if you know what you are doing.\n * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/isochrone/isochrone.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing.\n * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true).\n * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing.\n * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing.\n * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing.\n * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {String} [options.contentType=\"application/xml\"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing.\n * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing.\n * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing.\n */\n isoCurve : function (options) {\n var processIsoCurveService = new _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__[\"default\"](options);\n processIsoCurveService.call();\n }\n};\n\n/**\n * Point object.\n *\n * @namespace\n * @alias Gp.Point\n *\n * @property {Float} x - Point abscissa\n * @property {Float} y - Point ordinate\n */\nvar point = {};\n\n/**\n * Circle object.\n *\n * @namespace\n * @alias Gp.Circle\n *\n * @property {Float} x - Circle center abscissa.\n * @property {Float} y - Circle center ordinate.\n * @property {Float} radius - Circle radius.\n */\nvar circle = {};\n\n/**\n * Bounding box object, expressed with four coordinates.\n *\n * @namespace\n * @alias Gp.BBox\n *\n * @property {Float} left - minimum abscissa\n * @property {Float} right - maximum abscissa\n * @property {Float} bottom - minimum ordinate\n * @property {Float} top - maximum ordinate\n */\nvar bbox = {};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Services);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvU2VydmljZXMvU2VydmljZXMuanM/YmMwOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEscUNBQXFDLDJDQUEyQzs7QUFFaEY7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ3FDO0FBQ047QUFDUztBQUNjO0FBQ0M7QUFDckI7QUFDOEI7O0FBRWhFO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsZUFBZSxPQUFPLHVHQUF1RztBQUM3SCxlQUFlLE9BQU87QUFDdEIsZUFBZSxTQUFTL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ZXJ0eSB7RmxvYXR9IHggLSBDaXJjbGUgY2VudGVyIGFic2Npc3NhLlxuICogQHByb3BlcnR5IHtGbG9hdH0geSAtIENpcmNsZSBjZW50ZXIgb3JkaW5hdGUuXG4gKiBAcHJvcGVydHkge0Zsb2F0fSByYWRpdXMgLSBDaXJjbGUgcmFkaXVzLlxuICovXG52YXIgY2lyY2xlID0ge307XG5cbi8qKlxuICogQm91bmRpbmcgYm94IG9iamVjdCwgZXhwcmVzc2VkIHdpdGggZm91ciBjb29yZGluYXRlcy5cbiAqXG4gKiBAbmFtZXNwYWNlXG4gKiBAYWxpYXMgR3AuQkJveFxuICpcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IGxlZnQgLSBtaW5pbXVtIGFic2Npc3NhXG4gKiBAcHJvcGVydHkge0Zsb2F0fSByaWdodCAtIG1heGltdW0gYWJzY2lzc2FcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IGJvdHRvbSAtIG1pbmltdW0gb3JkaW5hdGVcbiAqIEBwcm9wZXJ0eSB7RmxvYXR9IHRvcCAtIG1heGltdW0gb3JkaW5hdGVcbiAqL1xudmFyIGJib3ggPSB7fTtcblxuZXhwb3J0IGRlZmF1bHQgU2VydmljZXM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Services/Services.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Utils/Helper.js": +/*!***************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Utils/Helper.js ***! + \***************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Classe utilitaire\n *\n * @module Helper\n * @alias Gp.Helper\n */\nvar Helper = {\n\n /**\n * concatenation des parametres key/value dans les urls\n *\n * @method normalyzeParameters\n * @static\n * @param {Object} params - tableau de clef/valeur\n *\n * @example\n * Gp.Utils.Helper.normalyzeParameters ({\n * key1:value1,\n * key2:value2,\n * key3:value3\n * });\n * // out : \"key1=value1&key2=value2&key3=value3\"\n *\n * @returns {String} retourne les paramètres concaténés\n */\n normalyzeParameters : function (params) {\n var myParams = null;\n\n if (params) {\n var tabParams = [];\n for (var key in params) {\n if (params.hasOwnProperty(key)) {\n var value = params[key];\n if (!value) {\n value = \"\";\n }\n tabParams.push(key + \"=\" + value);\n }\n }\n\n myParams = tabParams.join(\"&\");\n }\n\n return myParams;\n },\n\n /**\n * Concaténation et encodage des urls.\n *\n * @method normalyzeUrl\n * @static\n * @param {String} url - url\n * @param {Object|String} params - tableau de clef/valeur ou string\n * @param {Boolean} encode - true|false, false par defaut\n *\n * @example\n * Gp.Utils.Helper.normalyzeUrl (url, {\n * key1:value1,\n * key2=:value2,\n * key3:value3\n * });\n * // out : \"url?key1=value1&key2=value2&key3=value3\"\n *\n * @returns {String} retourne une url normalisée\n */\n normalyzeUrl : function (url, params, encode) {\n var myUrl = url;\n\n if (url) {\n var k = url.indexOf(\"?\");\n if (k === -1) { // pas de ? et KVP\n myUrl += \"?\";\n }\n\n if (k !== -1 && k !== url.length - 1) { // KVP\n myUrl += \"&\";\n }\n }\n\n if (params) {\n if (typeof params === \"string\") {\n myUrl += params;\n } else {\n myUrl += this.normalyzeParameters(params);\n }\n }\n\n if (encode) {\n // FIXME bonne idée ?\n myUrl = encodeURIComponent(myUrl);\n }\n\n return myUrl;\n },\n\n /**\n * Indentation d'une chaine\n *\n * @method indent\n * @static\n * @param {Number} n - nombre de tabulation\n * @param {String} msg - chaine\n *\n * @example\n * Gp.Utils.Helper.indent (2, \"message à indenter\")\n * // out\n * // ........message à indenter\n *\n * @returns {String} retourne une chaine indentée\n */\n indent : function (n, msg) {\n var num = n || 0;\n return new Array(num + 1).join(\"\\t\") + msg;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Helper);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9u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BpZiAocGFyYW1zKSB7XG4gICAgICAgICAgICB2YXIgdGFiUGFyYW1zID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IHBhcmFtc1trZXldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGFiUGFyYW1zLnB1c2goa2V5ICsgXCI9XCIgKyB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBteVBhcmFtcyA9IHRhYlBhcmFtcy5qb2luKFwiJlwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBteVBhcmFtcztcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogQ29uY2F0w6luYXRpb24gZXQgZW5jb2RhZ2UgZGVzIHVybHMuXG4gICAgICpcbiAgICAgKiBAbWV0aG9kIG5vcm1hbHl6ZVVybFxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAcGFyYW0ge1N0cmluZ30gdXJsIC0gdXJsXG4gICAgICogQHBhcmFtIHtPYmplY3R8U3RyaW5nfSBwYXJhbXMgLSB0YWJsZWF1IGRlIGNsZWYvdmFsZXVyIG91IHN0cmluZ1xuICAgICAqIEBwYXJhbSB7Qm9vbGVhbn0gZW5jb2RlIC0gdHJ1ZXxmYWxzZSwgZmFsc2UgcGFyIGRlZmF1dFxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiAgR3AuVXRpbHMuSGVscGVyLm5vcm1hbHl6ZVVybCAodXJsLCB7XG4gICAgICogICAgICAgICBrZXkxOnZhbHVlMSxcbiAgICAgKiAgICAgICAgIGtleTI9OnZhbHVlMixcbiAgICAgKiAgICAgICAgIGtleTM6dmFsdWUzXG4gICAgICogIH0pO1xuICAgICAqICAvLyBvdXQgOiBcInVybD9rZXkxPXZhbHVlMSZrZXkyPXZhbHVlMiZrZXkzPXZhbHVlM1wiXG4gICAgICpcbiAgICAgKiBAcmV0dXJucyB7U3RyaW5nfSByZXRvdXJuZSB1bmUgdXJsIG5vcm1hbGlzw6llXG4gICAgICovXG4gICAgbm9ybWFseXplVXJsIDogZnVuY3Rpb24gKHVybCwgcGFyYW1zLCBlbmNvZGUpIHtcbiAgICAgICAgdmFyIG15VXJsID0gdXJsO1xuXG4gICAgICAgIGlmICh1cmwpIHtcbiAgICAgICAgICAgIHZhciBrID0gdXJsLmluZGV4T2YoXCI/XCIpO1xuICAgICAgICAgICAgaWYgKGsgPT09IC0xKSB7IC8vIHBhcyBkZSA/IGV0IEtWUFxuICAgICAgICAgICAgICAgIG15VXJsICs9IFwiP1wiO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoayAhPT0gLTEgJiYgayAhPT0gdXJsLmxlbmd0aCAtIDEpIHsgLy8gS1ZQXG4gICAgICAgICAgICAgICAgbXlVcmwgKz0gXCImXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHBhcmFtcyA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgIG15VXJsICs9IHBhcmFtcztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbXlVcmwgKz0gdGhpcy5ub3JtYWx5emVQYXJhbWV0ZXJzKHBhcmFtcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZW5jb2RlKSB7XG4gICAgICAgICAgICAvLyBGSVhNRSBib25uZSBpZMOpZSA/XG4gICAgICAgICAgICBteVVybCA9IGVuY29kZVVSSUNvbXBvbmVudChteVVybCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbXlVcmw7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIEluZGVudGF0aW9uIGQndW5lIGNoYWluZVxuICAgICAqXG4gICAgICogQG1ldGhvZCBpbmRlbnRcbiAgICAgKiBAc3RhdGljXG4gICAgICogQHBhcmFtIHtOdW1iZXJ9IG4gLSBub21icmUgZGUgdGFidWxhdGlvblxuICAgICAqIEBwYXJhbSB7U3RyaW5nfSBtc2cgLSBjaGFpbmVcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogR3AuVXRpbHMuSGVscGVyLmluZGVudCAoMiwgXCJtZXNzYWdlIMOgIGluZGVudGVyXCIpXG4gICAgICogLy8gb3V0XG4gICAgICogLy8gLi4uLi4uLi5tZXNzYWdlIMOgIGluZGVudGVyXG4gICAgICpcbiAgICAgKiBAcmV0dXJucyB7U3RyaW5nfSByZXRvdXJuZSB1bmUgY2hhaW5lIGluZGVudMOpZVxuICAgICAqL1xuICAgIGluZGVudCA6IGZ1bmN0aW9uIChuLCBtc2cpIHtcbiAgICAgICAgdmFyIG51bSA9IG4gfHwgMDtcbiAgICAgICAgcmV0dXJuIG5ldyBBcnJheShudW0gKyAxKS5qb2luKFwiXFx0XCIpICsgbXNnO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEhlbHBlcjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Utils/Helper.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js": +/*!************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js ***! + \************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! loglevel */ \"./node_modules/loglevel/lib/loglevel.js\");\n/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar LoggerByDefault = {\n /**\n * logger statique\n *\n * @static\n * @param {String} name - nom du logger\n * @returns {Object} retourne un logger\n */\n getLogger : function (name) {\n // Substitute global constants configured at compile time\n // cf. webpack.config.js\n // FIXME howtodo !? DefineWebpackPlugin ? EnvironmentWebpackPlugin ?\n (\"false\".match(/true/)) ? loglevel__WEBPACK_IMPORTED_MODULE_0__[\"disableAll\"]() : loglevel__WEBPACK_IMPORTED_MODULE_0__[\"enableAll\"]();\n var logname = name || \"default\";\n return loglevel__WEBPACK_IMPORTED_MODULE_0__[\"getLogger\"](logname);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LoggerByDefault);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvVXRpbHMvTG9nZ2VyQnlEZWZhdWx0LmpzPzA2NWQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQWdDOztBQUVoQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsZUFBZSxPQUFPO0FBQ3RCLGlCQUFpQixPQUFPO0FBQ3hCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSwyQ0FBMkMsbURBQWMsS0FBSyxrREFBYTtBQUMzRTtBQUNBLGVBQWUsa0RBQWE7QUFDNUI7QUFDQTs7QUFFZSw4RUFBZSxFQUFDIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2dlb3BvcnRhbC1hY2Nlc3MtbGliL3NyYy9VdGlscy9Mb2dnZXJCeURlZmF1bHQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBMb2cgZnJvbSBcImxvZ2xldmVsXCI7XG5cbnZhciBMb2dnZXJCeURlZmF1bHQgPSB7XG4gICAgLyoqXG4gICAgICogbG9nZ2VyIHN0YXRpcXVlXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQHBhcmFtIHtTdHJpbmd9IG5hbWUgLSBub20gZHUgbG9nZ2VyXG4gICAgICogQHJldHVybnMge09iamVjdH0gcmV0b3VybmUgdW4gbG9nZ2VyXG4gICAgICovXG4gICAgZ2V0TG9nZ2VyIDogZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgLy8gU3Vic3RpdHV0ZSBnbG9iYWwgY29uc3RhbnRzIGNvbmZpZ3VyZWQgYXQgY29tcGlsZSB0aW1lXG4gICAgICAgIC8vIGNmLiB3ZWJwYWNrLmNvbmZpZy5qc1xuICAgICAgICAvLyBGSVhNRSBob3d0b2RvICE/IERlZmluZVdlYnBhY2tQbHVnaW4gPyBFbnZpcm9ubWVudFdlYnBhY2tQbHVnaW4gP1xuICAgICAgICAoXCJfX1BST0RVQ1RJT05fX1wiLm1hdGNoKC90cnVlLykpID8gTG9nLmRpc2FibGVBbGwoKSA6IExvZy5lbmFibGVBbGwoKTtcbiAgICAgICAgdmFyIGxvZ25hbWUgPSBuYW1lIHx8IFwiZGVmYXVsdFwiO1xuICAgICAgICByZXR1cm4gTG9nLmdldExvZ2dlcihsb2duYW1lKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBMb2dnZXJCeURlZmF1bHQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Utils/LoggerByDefault.js\n"); + +/***/ }), + +/***/ "./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js": +/*!**************************************************************************!*\ + !*** ./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Classe de gestion des erreurs qui permer d'associer un message d'erreur à l'exception lancée.\n *\n * @example\n * MessagesResources.getMessage(\"ERROR_PARAM_MISSING\", \"x\", \"y\", \"z\")));\n * // --> output : Parameter(s) 'x - y - z' missing\n *\n * @module MessagesResources\n * @alias Gp.Utils.MessagesResources\n * @private\n */\nvar MessagesResources = {\n\n // Paramètres\n PARAM_MISSING : \"Parameter(s) '%var%' missing\",\n PARAM_EMPTY : \"Parameter(s) '%var%' empty\",\n PARAM_TYPE : \"Wrong type(s) for parameter(s) '%var%'\",\n PARAM_FORMAT : \"Parameter(s) '%var%' not correctly formatted\",\n PARAM_NOT_SUPPORT : \"Value(s) for parameter(s) '%var%' not supported\",\n PARAM_NOT_SUPPORT_NODEJS : \"Value(s) for parameter(s) '%var%' not supported to NodeJS\",\n PARAM_UNKNOWN : \"Value(s) for parameter(s) '%var%' unknown\",\n\n // Services\n // Requête\n SERVICE_REQUEST_BUILD : \"An error occurred during the request building of the service\",\n SERVICE_REQUEST_EMPTY : \"The request sent to the service is empty\",\n\n // Réponse\n SERVICE_RESPONSE_EXCEPTION : \"The service returned an exception : '%var%'\",\n SERVICE_RESPONSE_EXCEPTION_2 : \"The service returned an exception\",\n SERVICE_RESPONSE_ANALYSE : \"An error occurred while parsing the response '%var%' of the service\",\n SERVICE_RESPONSE_ANALYSE_2 : \"An unknown error occurred while parsing the response\",\n SERVICE_RESPONSE_EMPTY : \"The response of the service is empty\",\n SERVICE_RESPONSE_EMPTY_2 : \"The response from the service could not be analyzed or is empty\",\n SERVICE_RESPONSE_FORMAT : \"The format of the service response is not supported (handled format(s) : '%var%')\",\n SERVICE_RESPONSE_FORMAT_2 : \"The format of the service response is not supported\",\n SERVICE_RESPONSE_FORMAT_3 : \"No suggestion matching the search\",\n\n // Classes\n CLASS_CONSTRUCTOR : \"'%var%' constructor cannot be called as a function.\",\n\n /**\n * Fonction qui va retourner le message d'erreur associé à la clé donnée\n *\n * @method getMessage\n * @param {String} clef - Clef de l'erreur (ex : ERROR_PARAM)\n * @param {String[]} parametres - Paramètres/variables concernés par le message d'erreur associé à la clef donnée\n * @return {String} message - String contenant le message de l'exception\n */\n getMessage : function (clef, parametres) {\n // param de la fonction uniquement pour la documentation...\n\n if (Object.keys(arguments).length === 0) {\n return \"Message indefined !\";\n }\n\n var params = Array.prototype.slice.call(arguments);\n var key = params.shift();\n var args = params;\n\n var message = this[key];\n\n try {\n if (Array.isArray(args) && args.length > 0) {\n message = message.replace(\"%var%\", args.join(\" - \"));\n } else {\n message = message.replace(\"%var%\", \"%var% (not specified)\");\n }\n } catch (e) {\n // error de string.replace()\n\n }\n\n return message;\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (MessagesResources);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9nZW9wb3J0YWwtYWNjZXNzLWxpYi9zcmMvVXRpbHMvTWVzc2FnZXNSZXNvdXJjZXMuanM/Y2ViZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLE9BQU87QUFDdEIsZUFBZSxTQUFTO0FBQ3hCLGdC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AgICAgICAgbWVzc2FnZSA9IG1lc3NhZ2UucmVwbGFjZShcIiV2YXIlXCIsIFwiJXZhciUgKG5vdCBzcGVjaWZpZWQpXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAvLyBlcnJvciBkZSBzdHJpbmcucmVwbGFjZSgpXG5cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtZXNzYWdlO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IE1lc3NhZ2VzUmVzb3VyY2VzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/geoportal-access-lib/src/Utils/MessagesResources.js\n"); + +/***/ }), + +/***/ "./node_modules/loglevel/lib/loglevel.js": +/*!***********************************************!*\ + !*** ./node_modules/loglevel/lib/loglevel.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9sb2dsZXZlbC9saWIvbG9nbGV2ZWwuanM/NWM3ZCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsUUFBUSxJQUEwQztBQUNsRCxRQUFRLG9DQUFPLFVBQVU7QUFBQTtBQUFBO0FBQUE7QUFBQSxvR0FBQztBQUMxQixLQUFLLE1BQU0sRUFJTjtBQUNMLENBQUM7QUFDRDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLHlCQUF5QjtBQUN6QixTQUFTO0FBQ1Q7QUFDQSxTQUFTO0FBQ1Q7QUFDQSxTQUFTO0FBQ1Q7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSx1QkFBdUIsdUJBQXVCO0FBQzlDO0FBQ0E7QUFDQTtBQUNBO0FB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VkTGV2ZWwgPT09IHVuZGVmaW5lZFR5cGUpIHtcbiAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgIHZhciBjb29raWUgPSB3aW5kb3cuZG9jdW1lbnQuY29va2llO1xuICAgICAgICAgICAgICAgICAgdmFyIGxvY2F0aW9uID0gY29va2llLmluZGV4T2YoXG4gICAgICAgICAgICAgICAgICAgICAgZW5jb2RlVVJJQ29tcG9uZW50KHN0b3JhZ2VLZXkpICsgXCI9XCIpO1xuICAgICAgICAgICAgICAgICAgaWYgKGxvY2F0aW9uICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgIHN0b3JlZExldmVsID0gL14oW147XSspLy5leGVjKGNvb2tpZS5zbGljZShsb2NhdGlvbikpWzFdO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGNhdGNoIChpZ25vcmUpIHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gSWYgdGhlIHN0b3JlZCBsZXZlbCBpcyBub3QgdmFsaWQsIHRyZWF0IGl0IGFzIGlmIG5vdGhpbmcgd2FzIHN0b3JlZC5cbiAgICAgICAgICBpZiAoc2VsZi5sZXZlbHNbc3RvcmVkTGV2ZWxdID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgc3RvcmVkTGV2ZWwgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIHN0b3JlZExldmVsO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBjbGVhclBlcnNpc3RlZExldmVsKCkge1xuICAgICAgICAgIGlmICh0eXBlb2Ygd2luZG93ID09PSB1bmRlZmluZWRUeXBlIHx8ICFzdG9yYWdlS2V5KSByZXR1cm47XG5cbiAgICAgICAgICAvLyBVc2UgbG9jYWxTdG9yYWdlIGlmIGF2YWlsYWJsZVxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHdpbmRvdy5sb2NhbFN0b3JhZ2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Zi5sZXZlbHNbbGV2ZWwudG9VcHBlckNhc2UoKV0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICBsZXZlbCA9IHNlbGYubGV2ZWxzW2xldmVsLnRvVXBwZXJDYXNlKCldO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodHlwZW9mIGxldmVsID09PSBcIm51bWJlclwiICYmIGxldmVsID49IDAgJiYgbGV2ZWwgPD0gc2VsZi5sZXZlbHMuU0lMRU5UKSB7XG4gICAgICAgICAgICAgIGN1cnJlbnRMZXZlbCA9IGxldmVsO1xuICAgICAgICAgICAgICBpZiAocGVyc2lzdCAhPT0gZmFsc2UpIHsgIC8vIGRlZmF1bHRzIHRvIHRydWVcbiAgICAgICAgICAgICAgICAgIHBlcnNpc3RMZXZlbElmUG9zc2libGUobGV2ZWwpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJlcGxhY2VMb2dnaW5nTWV0aG9kcy5jYWxsKHNlbGYsIGxldmVsLCBuYW1lKTtcbiAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb25zb2xlID09PSB1bmRlZmluZWRUeXBlICYmIGxldmVsIDwgc2VsZi5sZXZlbHMuU0lMRU5UKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gXCJObyBjb25zb2xlIGF2YWlsYWJsZSBmb3IgbG9nZ2luZ1wiO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhyb3cgXCJsb2cuc2V0TGV2ZWwoKSBjYWxsZWQgd2l0aCBpbnZhbGlkIGxldmVsOiBcIiArIGxldmVsO1xuICAgICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHNlbGYuc2V0RGVmYXVsdExldmVsID0gZnVuY3Rpb24gKGxldmVsKSB7XG4gICAgICAgICAgZGVmYXVsdExldmVsID0gbGV2ZWw7XG4gICAgICAgICAgaWYgKCFnZXRQZXJzaXN0ZWRMZXZlbCgpKSB7XG4g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GVmYXVsdExvZ2dlci5nZXRMb2dnZXJzID0gZnVuY3Rpb24gZ2V0TG9nZ2VycygpIHtcbiAgICAgICAgcmV0dXJuIF9sb2dnZXJzQnlOYW1lO1xuICAgIH07XG5cbiAgICAvLyBFUzYgZGVmYXVsdCBleHBvcnQsIGZvciBjb21wYXRpYmlsaXR5XG4gICAgZGVmYXVsdExvZ2dlclsnZGVmYXVsdCddID0gZGVmYXVsdExvZ2dlcjtcblxuICAgIHJldHVybiBkZWZhdWx0TG9nZ2VyO1xufSkpO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/loglevel/lib/loglevel.js\n"); + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9wcm9jZXNzL2Jyb3dzZXIuanM/ZjI4YyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBLENBQUM7QUFDRD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./node_modules/process/browser.js\n"); + +/***/ }), + +/***/ "./node_modules/proj4/dist/proj4-src.js": +/*!**********************************************!*\ + !*** ./node_modules/proj4/dist/proj4-src.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n}(this, (function () { 'use strict';\n\n var globals = function(defs) {\n defs('EPSG:4326', \"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\");\n defs('EPSG:4269', \"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\");\n defs('EPSG:3857', \"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\");\n\n defs.WGS84 = defs['EPSG:4326'];\n defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857\n defs.GOOGLE = defs['EPSG:3857'];\n defs['EPSG:900913'] = defs['EPSG:3857'];\n defs['EPSG:102113'] = defs['EPSG:3857'];\n };\n\n var PJD_3PARAM = 1;\n var PJD_7PARAM = 2;\n var PJD_GRIDSHIFT = 3;\n var PJD_WGS84 = 4; // WGS84 or equivalent\n var PJD_NODATUM = 5; // WGS84 or equivalent\n var SRS_WGS84_SEMIMAJOR = 6378137.0; // only used in grid shift transforms\n var SRS_WGS84_SEMIMINOR = 6356752.314; // only used in grid shift transforms\n var SRS_WGS84_ESQUARED = 0.0066943799901413165; // only used in grid shift transforms\n var SEC_TO_RAD = 4.84813681109535993589914102357e-6;\n var HALF_PI = Math.PI/2;\n // ellipoid pj_set_ell.c\n var SIXTH = 0.1666666666666666667;\n /* 1/6 */\n var RA4 = 0.04722222222222222222;\n /* 17/360 */\n var RA6 = 0.02215608465608465608;\n var EPSLN = 1.0e-10;\n // you'd think you could use Number.EPSILON above but that makes\n // Mollweide get into an infinate loop.\n\n var D2R = 0.01745329251994329577;\n var R2D = 57.29577951308232088;\n var FORTPI = Math.PI/4;\n var TWO_PI = Math.PI * 2;\n // SPI is slightly greater than Math.PI, so values that exceed the -180..180\n // degree range by a tiny amount don't get wrapped. This prevents points that\n // have drifted from their original location along the 180th meridian (due to\n // floating point error) from changing their sign.\n var SPI = 3.14159265359;\n\n var exports$1 = {};\n exports$1.greenwich = 0.0; //\"0dE\",\n exports$1.lisbon = -9.131906111111; //\"9d07'54.862\\\"W\",\n exports$1.paris = 2.337229166667; //\"2d20'14.025\\\"E\",\n exports$1.bogota = -74.080916666667; //\"74d04'51.3\\\"W\",\n exports$1.madrid = -3.687938888889; //\"3d41'16.58\\\"W\",\n exports$1.rome = 12.452333333333; //\"12d27'8.4\\\"E\",\n exports$1.bern = 7.439583333333; //\"7d26'22.5\\\"E\",\n exports$1.jakarta = 106.807719444444; //\"106d48'27.79\\\"E\",\n exports$1.ferro = -17.666666666667; //\"17d40'W\",\n exports$1.brussels = 4.367975; //\"4d22'4.71\\\"E\",\n exports$1.stockholm = 18.058277777778; //\"18d3'29.8\\\"E\",\n exports$1.athens = 23.7163375; //\"23d42'58.815\\\"E\",\n exports$1.oslo = 10.722916666667; //\"10d43'22.5\\\"E\"\n\n var units = {\n ft: {to_meter: 0.3048},\n 'us-ft': {to_meter: 1200 / 3937}\n };\n\n var ignoredChar = /[\\s_\\-\\/\\(\\)]/g;\n function match(obj, key) {\n if (obj[key]) {\n return obj[key];\n }\n var keys = Object.keys(obj);\n var lkey = key.toLowerCase().replace(ignoredChar, '');\n var i = -1;\n var testkey, processedKey;\n while (++i < keys.length) {\n testkey = keys[i];\n processedKey = testkey.toLowerCase().replace(ignoredChar, '');\n if (processedKey === lkey) {\n return obj[testkey];\n }\n }\n }\n\n var parseProj = function(defData) {\n var self = {};\n var paramObj = defData.split('+').map(function(v) {\n return v.trim();\n }).filter(function(a) {\n return a;\n }).reduce(function(p, a) {\n var split = a.split('=');\n split.push(true);\n p[split[0].toLowerCase()] = split[1];\n return p;\n }, {});\n var paramName, paramVal, paramOutname;\n var params = {\n proj: 'projName',\n datum: 'datumCode',\n rf: function(v) {\n self.rf = parseFloat(v);\n },\n lat_0: function(v) {\n self.lat0 = v * D2R;\n },\n lat_1: function(v) {\n self.lat1 = v * D2R;\n },\n lat_2: function(v) {\n self.lat2 = v * D2R;\n },\n lat_ts: function(v) {\n self.lat_ts = v * D2R;\n },\n lon_0: function(v) {\n self.long0 = v * D2R;\n },\n lon_1: function(v) {\n self.long1 = v * D2R;\n },\n lon_2: function(v) {\n self.long2 = v * D2R;\n },\n alpha: function(v) {\n self.alpha = parseFloat(v) * D2R;\n },\n gamma: function(v) {\n self.rectified_grid_angle = parseFloat(v);\n },\n lonc: function(v) {\n self.longc = v * D2R;\n },\n x_0: function(v) {\n self.x0 = parseFloat(v);\n },\n y_0: function(v) {\n self.y0 = parseFloat(v);\n },\n k_0: function(v) {\n self.k0 = parseFloat(v);\n },\n k: function(v) {\n self.k0 = parseFloat(v);\n },\n a: function(v) {\n self.a = parseFloat(v);\n },\n b: function(v) {\n self.b = parseFloat(v);\n },\n r_a: function() {\n self.R_A = true;\n },\n zone: function(v) {\n self.zone = parseInt(v, 10);\n },\n south: function() {\n self.utmSouth = true;\n },\n towgs84: function(v) {\n self.datum_params = v.split(\",\").map(function(a) {\n return parseFloat(a);\n });\n },\n to_meter: function(v) {\n self.to_meter = parseFloat(v);\n },\n units: function(v) {\n self.units = v;\n var unit = match(units, v);\n if (unit) {\n self.to_meter = unit.to_meter;\n }\n },\n from_greenwich: function(v) {\n self.from_greenwich = v * D2R;\n },\n pm: function(v) {\n var pm = match(exports$1, v);\n self.from_greenwich = (pm ? pm : parseFloat(v)) * D2R;\n },\n nadgrids: function(v) {\n if (v === '@null') {\n self.datumCode = 'none';\n }\n else {\n self.nadgrids = v;\n }\n },\n axis: function(v) {\n var legalAxis = \"ewnsud\";\n if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) {\n self.axis = v;\n }\n },\n approx: function() {\n self.approx = true;\n }\n };\n for (paramName in paramObj) {\n paramVal = paramObj[paramName];\n if (paramName in params) {\n paramOutname = params[paramName];\n if (typeof paramOutname === 'function') {\n paramOutname(paramVal);\n }\n else {\n self[paramOutname] = paramVal;\n }\n }\n else {\n self[paramName] = paramVal;\n }\n }\n if(typeof self.datumCode === 'string' && self.datumCode !== \"WGS84\"){\n self.datumCode = self.datumCode.toLowerCase();\n }\n return self;\n };\n\n var NEUTRAL = 1;\n var KEYWORD = 2;\n var NUMBER = 3;\n var QUOTED = 4;\n var AFTERQUOTE = 5;\n var ENDED = -1;\n var whitespace = /\\s/;\n var latin = /[A-Za-z]/;\n var keyword = /[A-Za-z84]/;\n var endThings = /[,\\]]/;\n var digets = /[\\d\\.E\\-\\+]/;\n // const ignoredChar = /[\\s_\\-\\/\\(\\)]/g;\n function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n }\n Parser.prototype.readCharicter = function() {\n var char = this.text[this.place++];\n if (this.state !== QUOTED) {\n while (whitespace.test(char)) {\n if (this.place >= this.text.length) {\n return;\n }\n char = this.text[this.place++];\n }\n }\n switch (this.state) {\n case NEUTRAL:\n return this.neutral(char);\n case KEYWORD:\n return this.keyword(char)\n case QUOTED:\n return this.quoted(char);\n case AFTERQUOTE:\n return this.afterquote(char);\n case NUMBER:\n return this.number(char);\n case ENDED:\n return;\n }\n };\n Parser.prototype.afterquote = function(char) {\n if (char === '\"') {\n this.word += '\"';\n this.state = QUOTED;\n return;\n }\n if (endThings.test(char)) {\n this.word = this.word.trim();\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in afterquote yet, index ' + this.place);\n };\n Parser.prototype.afterItem = function(char) {\n if (char === ',') {\n if (this.word !== null) {\n this.currentObject.push(this.word);\n }\n this.word = null;\n this.state = NEUTRAL;\n return;\n }\n if (char === ']') {\n this.level--;\n if (this.word !== null) {\n this.currentObject.push(this.word);\n this.word = null;\n }\n this.state = NEUTRAL;\n this.currentObject = this.stack.pop();\n if (!this.currentObject) {\n this.state = ENDED;\n }\n\n return;\n }\n };\n Parser.prototype.number = function(char) {\n if (digets.test(char)) {\n this.word += char;\n return;\n }\n if (endThings.test(char)) {\n this.word = parseFloat(this.word);\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in number yet, index ' + this.place);\n };\n Parser.prototype.quoted = function(char) {\n if (char === '\"') {\n this.state = AFTERQUOTE;\n return;\n }\n this.word += char;\n return;\n };\n Parser.prototype.keyword = function(char) {\n if (keyword.test(char)) {\n this.word += char;\n return;\n }\n if (char === '[') {\n var newObjects = [];\n newObjects.push(this.word);\n this.level++;\n if (this.root === null) {\n this.root = newObjects;\n } else {\n this.currentObject.push(newObjects);\n }\n this.stack.push(this.currentObject);\n this.currentObject = newObjects;\n this.state = NEUTRAL;\n return;\n }\n if (endThings.test(char)) {\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in keyword yet, index ' + this.place);\n };\n Parser.prototype.neutral = function(char) {\n if (latin.test(char)) {\n this.word = char;\n this.state = KEYWORD;\n return;\n }\n if (char === '\"') {\n this.word = '';\n this.state = QUOTED;\n return;\n }\n if (digets.test(char)) {\n this.word = char;\n this.state = NUMBER;\n return;\n }\n if (endThings.test(char)) {\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in neutral yet, index ' + this.place);\n };\n Parser.prototype.output = function() {\n while (this.place < this.text.length) {\n this.readCharicter();\n }\n if (this.state === ENDED) {\n return this.root;\n }\n throw new Error('unable to parse string \"' +this.text + '\". State is ' + this.state);\n };\n\n function parseString(txt) {\n var parser = new Parser(txt);\n return parser.output();\n }\n\n function mapit(obj, key, value) {\n if (Array.isArray(key)) {\n value.unshift(key);\n key = null;\n }\n var thing = key ? {} : obj;\n\n var out = value.reduce(function(newObj, item) {\n sExpr(item, newObj);\n return newObj\n }, thing);\n if (key) {\n obj[key] = out;\n }\n }\n\n function sExpr(v, obj) {\n if (!Array.isArray(v)) {\n obj[v] = true;\n return;\n }\n var key = v.shift();\n if (key === 'PARAMETER') {\n key = v.shift();\n }\n if (v.length === 1) {\n if (Array.isArray(v[0])) {\n obj[key] = {};\n sExpr(v[0], obj[key]);\n return;\n }\n obj[key] = v[0];\n return;\n }\n if (!v.length) {\n obj[key] = true;\n return;\n }\n if (key === 'TOWGS84') {\n obj[key] = v;\n return;\n }\n if (key === 'AXIS') {\n if (!(key in obj)) {\n obj[key] = [];\n }\n obj[key].push(v);\n return;\n }\n if (!Array.isArray(key)) {\n obj[key] = {};\n }\n\n var i;\n switch (key) {\n case 'UNIT':\n case 'PRIMEM':\n case 'VERT_DATUM':\n obj[key] = {\n name: v[0].toLowerCase(),\n convert: v[1]\n };\n if (v.length === 3) {\n sExpr(v[2], obj[key]);\n }\n return;\n case 'SPHEROID':\n case 'ELLIPSOID':\n obj[key] = {\n name: v[0],\n a: v[1],\n rf: v[2]\n };\n if (v.length === 4) {\n sExpr(v[3], obj[key]);\n }\n return;\n case 'PROJECTEDCRS':\n case 'PROJCRS':\n case 'GEOGCS':\n case 'GEOCCS':\n case 'PROJCS':\n case 'LOCAL_CS':\n case 'GEODCRS':\n case 'GEODETICCRS':\n case 'GEODETICDATUM':\n case 'EDATUM':\n case 'ENGINEERINGDATUM':\n case 'VERT_CS':\n case 'VERTCRS':\n case 'VERTICALCRS':\n case 'COMPD_CS':\n case 'COMPOUNDCRS':\n case 'ENGINEERINGCRS':\n case 'ENGCRS':\n case 'FITTED_CS':\n case 'LOCAL_DATUM':\n case 'DATUM':\n v[0] = ['name', v[0]];\n mapit(obj, key, v);\n return;\n default:\n i = -1;\n while (++i < v.length) {\n if (!Array.isArray(v[i])) {\n return sExpr(v, obj[key]);\n }\n }\n return mapit(obj, key, v);\n }\n }\n\n var D2R$1 = 0.01745329251994329577;\n function rename(obj, params) {\n var outName = params[0];\n var inName = params[1];\n if (!(outName in obj) && (inName in obj)) {\n obj[outName] = obj[inName];\n if (params.length === 3) {\n obj[outName] = params[2](obj[outName]);\n }\n }\n }\n\n function d2r(input) {\n return input * D2R$1;\n }\n\n function cleanWKT(wkt) {\n if (wkt.type === 'GEOGCS') {\n wkt.projName = 'longlat';\n } else if (wkt.type === 'LOCAL_CS') {\n wkt.projName = 'identity';\n wkt.local = true;\n } else {\n if (typeof wkt.PROJECTION === 'object') {\n wkt.projName = Object.keys(wkt.PROJECTION)[0];\n } else {\n wkt.projName = wkt.PROJECTION;\n }\n }\n if (wkt.AXIS) {\n var axisOrder = '';\n for (var i = 0, ii = wkt.AXIS.length; i < ii; ++i) {\n var axis = [wkt.AXIS[i][0].toLowerCase(), wkt.AXIS[i][1].toLowerCase()];\n if (axis[0].indexOf('north') !== -1 || ((axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'north')) {\n axisOrder += 'n';\n } else if (axis[0].indexOf('south') !== -1 || ((axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'south')) {\n axisOrder += 's';\n } else if (axis[0].indexOf('east') !== -1 || ((axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'east')) {\n axisOrder += 'e';\n } else if (axis[0].indexOf('west') !== -1 || ((axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'west')) {\n axisOrder += 'w';\n }\n }\n if (axisOrder.length === 2) {\n axisOrder += 'u';\n }\n if (axisOrder.length === 3) {\n wkt.axis = axisOrder;\n }\n }\n if (wkt.UNIT) {\n wkt.units = wkt.UNIT.name.toLowerCase();\n if (wkt.units === 'metre') {\n wkt.units = 'meter';\n }\n if (wkt.UNIT.convert) {\n if (wkt.type === 'GEOGCS') {\n if (wkt.DATUM && wkt.DATUM.SPHEROID) {\n wkt.to_meter = wkt.UNIT.convert*wkt.DATUM.SPHEROID.a;\n }\n } else {\n wkt.to_meter = wkt.UNIT.convert;\n }\n }\n }\n var geogcs = wkt.GEOGCS;\n if (wkt.type === 'GEOGCS') {\n geogcs = wkt;\n }\n if (geogcs) {\n //if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){\n // wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R;\n //}\n if (geogcs.DATUM) {\n wkt.datumCode = geogcs.DATUM.name.toLowerCase();\n } else {\n wkt.datumCode = geogcs.name.toLowerCase();\n }\n if (wkt.datumCode.slice(0, 2) === 'd_') {\n wkt.datumCode = wkt.datumCode.slice(2);\n }\n if (wkt.datumCode === 'new_zealand_geodetic_datum_1949' || wkt.datumCode === 'new_zealand_1949') {\n wkt.datumCode = 'nzgd49';\n }\n if (wkt.datumCode === 'wgs_1984' || wkt.datumCode === 'world_geodetic_system_1984') {\n if (wkt.PROJECTION === 'Mercator_Auxiliary_Sphere') {\n wkt.sphere = true;\n }\n wkt.datumCode = 'wgs84';\n }\n if (wkt.datumCode.slice(-6) === '_ferro') {\n wkt.datumCode = wkt.datumCode.slice(0, - 6);\n }\n if (wkt.datumCode.slice(-8) === '_jakarta') {\n wkt.datumCode = wkt.datumCode.slice(0, - 8);\n }\n if (~wkt.datumCode.indexOf('belge')) {\n wkt.datumCode = 'rnb72';\n }\n if (geogcs.DATUM && geogcs.DATUM.SPHEROID) {\n wkt.ellps = geogcs.DATUM.SPHEROID.name.replace('_19', '').replace(/[Cc]larke\\_18/, 'clrk');\n if (wkt.ellps.toLowerCase().slice(0, 13) === 'international') {\n wkt.ellps = 'intl';\n }\n\n wkt.a = geogcs.DATUM.SPHEROID.a;\n wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10);\n }\n\n if (geogcs.DATUM && geogcs.DATUM.TOWGS84) {\n wkt.datum_params = geogcs.DATUM.TOWGS84;\n }\n if (~wkt.datumCode.indexOf('osgb_1936')) {\n wkt.datumCode = 'osgb36';\n }\n if (~wkt.datumCode.indexOf('osni_1952')) {\n wkt.datumCode = 'osni52';\n }\n if (~wkt.datumCode.indexOf('tm65')\n || ~wkt.datumCode.indexOf('geodetic_datum_of_1965')) {\n wkt.datumCode = 'ire65';\n }\n if (wkt.datumCode === 'ch1903+') {\n wkt.datumCode = 'ch1903';\n }\n if (~wkt.datumCode.indexOf('israel')) {\n wkt.datumCode = 'isr93';\n }\n }\n if (wkt.b && !isFinite(wkt.b)) {\n wkt.b = wkt.a;\n }\n\n function toMeter(input) {\n var ratio = wkt.to_meter || 1;\n return input * ratio;\n }\n var renamer = function(a) {\n return rename(wkt, a);\n };\n var list = [\n ['standard_parallel_1', 'Standard_Parallel_1'],\n ['standard_parallel_1', 'Latitude of 1st standard parallel'],\n ['standard_parallel_2', 'Standard_Parallel_2'],\n ['standard_parallel_2', 'Latitude of 2nd standard parallel'],\n ['false_easting', 'False_Easting'],\n ['false_easting', 'False easting'],\n ['false-easting', 'Easting at false origin'],\n ['false_northing', 'False_Northing'],\n ['false_northing', 'False northing'],\n ['false_northing', 'Northing at false origin'],\n ['central_meridian', 'Central_Meridian'],\n ['central_meridian', 'Longitude of natural origin'],\n ['central_meridian', 'Longitude of false origin'],\n ['latitude_of_origin', 'Latitude_Of_Origin'],\n ['latitude_of_origin', 'Central_Parallel'],\n ['latitude_of_origin', 'Latitude of natural origin'],\n ['latitude_of_origin', 'Latitude of false origin'],\n ['scale_factor', 'Scale_Factor'],\n ['k0', 'scale_factor'],\n ['latitude_of_center', 'Latitude_Of_Center'],\n ['latitude_of_center', 'Latitude_of_center'],\n ['lat0', 'latitude_of_center', d2r],\n ['longitude_of_center', 'Longitude_Of_Center'],\n ['longitude_of_center', 'Longitude_of_center'],\n ['longc', 'longitude_of_center', d2r],\n ['x0', 'false_easting', toMeter],\n ['y0', 'false_northing', toMeter],\n ['long0', 'central_meridian', d2r],\n ['lat0', 'latitude_of_origin', d2r],\n ['lat0', 'standard_parallel_1', d2r],\n ['lat1', 'standard_parallel_1', d2r],\n ['lat2', 'standard_parallel_2', d2r],\n ['azimuth', 'Azimuth'],\n ['alpha', 'azimuth', d2r],\n ['srsCode', 'name']\n ];\n list.forEach(renamer);\n if (!wkt.long0 && wkt.longc && (wkt.projName === 'Albers_Conic_Equal_Area' || wkt.projName === 'Lambert_Azimuthal_Equal_Area')) {\n wkt.long0 = wkt.longc;\n }\n if (!wkt.lat_ts && wkt.lat1 && (wkt.projName === 'Stereographic_South_Pole' || wkt.projName === 'Polar Stereographic (variant B)')) {\n wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);\n wkt.lat_ts = wkt.lat1;\n }\n }\n var wkt = function(wkt) {\n var lisp = parseString(wkt);\n var type = lisp.shift();\n var name = lisp.shift();\n lisp.unshift(['name', name]);\n lisp.unshift(['type', type]);\n var obj = {};\n sExpr(lisp, obj);\n cleanWKT(obj);\n return obj;\n };\n\n function defs(name) {\n /*global console*/\n var that = this;\n if (arguments.length === 2) {\n var def = arguments[1];\n if (typeof def === 'string') {\n if (def.charAt(0) === '+') {\n defs[name] = parseProj(arguments[1]);\n }\n else {\n defs[name] = wkt(arguments[1]);\n }\n } else {\n defs[name] = def;\n }\n }\n else if (arguments.length === 1) {\n if (Array.isArray(name)) {\n return name.map(function(v) {\n if (Array.isArray(v)) {\n defs.apply(that, v);\n }\n else {\n defs(v);\n }\n });\n }\n else if (typeof name === 'string') {\n if (name in defs) {\n return defs[name];\n }\n }\n else if ('EPSG' in name) {\n defs['EPSG:' + name.EPSG] = name;\n }\n else if ('ESRI' in name) {\n defs['ESRI:' + name.ESRI] = name;\n }\n else if ('IAU2000' in name) {\n defs['IAU2000:' + name.IAU2000] = name;\n }\n else {\n console.log(name);\n }\n return;\n }\n\n\n }\n globals(defs);\n\n function testObj(code){\n return typeof code === 'string';\n }\n function testDef(code){\n return code in defs;\n }\n var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS','GEOCCS','PROJCS','LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];\n function testWKT(code){\n return codeWords.some(function (word) {\n return code.indexOf(word) > -1;\n });\n }\n var codes = ['3857', '900913', '3785', '102113'];\n function checkMercator(item) {\n var auth = match(item, 'authority');\n if (!auth) {\n return;\n }\n var code = match(auth, 'epsg');\n return code && codes.indexOf(code) > -1;\n }\n function checkProjStr(item) {\n var ext = match(item, 'extension');\n if (!ext) {\n return;\n }\n return match(ext, 'proj4');\n }\n function testProj(code){\n return code[0] === '+';\n }\n function parse(code){\n if (testObj(code)) {\n //check to see if this is a WKT string\n if (testDef(code)) {\n return defs[code];\n }\n if (testWKT(code)) {\n var out = wkt(code);\n // test of spetial case, due to this being a very common and often malformed\n if (checkMercator(out)) {\n return defs['EPSG:3857'];\n }\n var maybeProjStr = checkProjStr(out);\n if (maybeProjStr) {\n return parseProj(maybeProjStr);\n }\n return out;\n }\n if (testProj(code)) {\n return parseProj(code);\n }\n }else{\n return code;\n }\n }\n\n var extend = function(destination, source) {\n destination = destination || {};\n var value, property;\n if (!source) {\n return destination;\n }\n for (property in source) {\n value = source[property];\n if (value !== undefined) {\n destination[property] = value;\n }\n }\n return destination;\n };\n\n var msfnz = function(eccent, sinphi, cosphi) {\n var con = eccent * sinphi;\n return cosphi / (Math.sqrt(1 - con * con));\n };\n\n var sign = function(x) {\n return x<0 ? -1 : 1;\n };\n\n var adjust_lon = function(x) {\n return (Math.abs(x) <= SPI) ? x : (x - (sign(x) * TWO_PI));\n };\n\n var tsfnz = function(eccent, phi, sinphi) {\n var con = eccent * sinphi;\n var com = 0.5 * eccent;\n con = Math.pow(((1 - con) / (1 + con)), com);\n return (Math.tan(0.5 * (HALF_PI - phi)) / con);\n };\n\n var phi2z = function(eccent, ts) {\n var eccnth = 0.5 * eccent;\n var con, dphi;\n var phi = HALF_PI - 2 * Math.atan(ts);\n for (var i = 0; i <= 15; i++) {\n con = eccent * Math.sin(phi);\n dphi = HALF_PI - 2 * Math.atan(ts * (Math.pow(((1 - con) / (1 + con)), eccnth))) - phi;\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n //console.log(\"phi2z has NoConvergence\");\n return -9999;\n };\n\n function init() {\n var con = this.b / this.a;\n this.es = 1 - con * con;\n if(!('x0' in this)){\n this.x0 = 0;\n }\n if(!('y0' in this)){\n this.y0 = 0;\n }\n this.e = Math.sqrt(this.es);\n if (this.lat_ts) {\n if (this.sphere) {\n this.k0 = Math.cos(this.lat_ts);\n }\n else {\n this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n else {\n if (!this.k0) {\n if (this.k) {\n this.k0 = this.k;\n }\n else {\n this.k0 = 1;\n }\n }\n }\n }\n\n /* Mercator forward equations--mapping lat,long to x,y\n --------------------------------------------------*/\n\n function forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = tsfnz(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n }\n\n /* Mercator inverse equations--mapping x,y to lat/long\n --------------------------------------------------*/\n function inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = phi2z(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = adjust_lon(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$1 = [\"Mercator\", \"Popular Visualisation Pseudo Mercator\", \"Mercator_1SP\", \"Mercator_Auxiliary_Sphere\", \"merc\"];\n var merc = {\n init: init,\n forward: forward,\n inverse: inverse,\n names: names$1\n };\n\n function init$1() {\n //no-op for longlat\n }\n\n function identity(pt) {\n return pt;\n }\n var names$2 = [\"longlat\", \"identity\"];\n var longlat = {\n init: init$1,\n forward: identity,\n inverse: identity,\n names: names$2\n };\n\n var projs = [merc, longlat];\n var names = {};\n var projStore = [];\n\n function add(proj, i) {\n var len = projStore.length;\n if (!proj.names) {\n console.log(i);\n return true;\n }\n projStore[len] = proj;\n proj.names.forEach(function(n) {\n names[n.toLowerCase()] = len;\n });\n return this;\n }\n\n function get(name) {\n if (!name) {\n return false;\n }\n var n = name.toLowerCase();\n if (typeof names[n] !== 'undefined' && projStore[names[n]]) {\n return projStore[names[n]];\n }\n }\n\n function start() {\n projs.forEach(add);\n }\n var projections = {\n start: start,\n add: add,\n get: get\n };\n\n var exports$2 = {};\n exports$2.MERIT = {\n a: 6378137.0,\n rf: 298.257,\n ellipseName: \"MERIT 1983\"\n };\n\n exports$2.SGS85 = {\n a: 6378136.0,\n rf: 298.257,\n ellipseName: \"Soviet Geodetic System 85\"\n };\n\n exports$2.GRS80 = {\n a: 6378137.0,\n rf: 298.257222101,\n ellipseName: \"GRS 1980(IUGG, 1980)\"\n };\n\n exports$2.IAU76 = {\n a: 6378140.0,\n rf: 298.257,\n ellipseName: \"IAU 1976\"\n };\n\n exports$2.airy = {\n a: 6377563.396,\n b: 6356256.910,\n ellipseName: \"Airy 1830\"\n };\n\n exports$2.APL4 = {\n a: 6378137,\n rf: 298.25,\n ellipseName: \"Appl. Physics. 1965\"\n };\n\n exports$2.NWL9D = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"Naval Weapons Lab., 1965\"\n };\n\n exports$2.mod_airy = {\n a: 6377340.189,\n b: 6356034.446,\n ellipseName: \"Modified Airy\"\n };\n\n exports$2.andrae = {\n a: 6377104.43,\n rf: 300.0,\n ellipseName: \"Andrae 1876 (Den., Iclnd.)\"\n };\n\n exports$2.aust_SA = {\n a: 6378160.0,\n rf: 298.25,\n ellipseName: \"Australian Natl & S. Amer. 1969\"\n };\n\n exports$2.GRS67 = {\n a: 6378160.0,\n rf: 298.2471674270,\n ellipseName: \"GRS 67(IUGG 1967)\"\n };\n\n exports$2.bessel = {\n a: 6377397.155,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841\"\n };\n\n exports$2.bess_nam = {\n a: 6377483.865,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841 (Namibia)\"\n };\n\n exports$2.clrk66 = {\n a: 6378206.4,\n b: 6356583.8,\n ellipseName: \"Clarke 1866\"\n };\n\n exports$2.clrk80 = {\n a: 6378249.145,\n rf: 293.4663,\n ellipseName: \"Clarke 1880 mod.\"\n };\n\n exports$2.clrk58 = {\n a: 6378293.645208759,\n rf: 294.2606763692654,\n ellipseName: \"Clarke 1858\"\n };\n\n exports$2.CPM = {\n a: 6375738.7,\n rf: 334.29,\n ellipseName: \"Comm. des Poids et Mesures 1799\"\n };\n\n exports$2.delmbr = {\n a: 6376428.0,\n rf: 311.5,\n ellipseName: \"Delambre 1810 (Belgium)\"\n };\n\n exports$2.engelis = {\n a: 6378136.05,\n rf: 298.2566,\n ellipseName: \"Engelis 1985\"\n };\n\n exports$2.evrst30 = {\n a: 6377276.345,\n rf: 300.8017,\n ellipseName: \"Everest 1830\"\n };\n\n exports$2.evrst48 = {\n a: 6377304.063,\n rf: 300.8017,\n ellipseName: \"Everest 1948\"\n };\n\n exports$2.evrst56 = {\n a: 6377301.243,\n rf: 300.8017,\n ellipseName: \"Everest 1956\"\n };\n\n exports$2.evrst69 = {\n a: 6377295.664,\n rf: 300.8017,\n ellipseName: \"Everest 1969\"\n };\n\n exports$2.evrstSS = {\n a: 6377298.556,\n rf: 300.8017,\n ellipseName: \"Everest (Sabah & Sarawak)\"\n };\n\n exports$2.fschr60 = {\n a: 6378166.0,\n rf: 298.3,\n ellipseName: \"Fischer (Mercury Datum) 1960\"\n };\n\n exports$2.fschr60m = {\n a: 6378155.0,\n rf: 298.3,\n ellipseName: \"Fischer 1960\"\n };\n\n exports$2.fschr68 = {\n a: 6378150.0,\n rf: 298.3,\n ellipseName: \"Fischer 1968\"\n };\n\n exports$2.helmert = {\n a: 6378200.0,\n rf: 298.3,\n ellipseName: \"Helmert 1906\"\n };\n\n exports$2.hough = {\n a: 6378270.0,\n rf: 297.0,\n ellipseName: \"Hough\"\n };\n\n exports$2.intl = {\n a: 6378388.0,\n rf: 297.0,\n ellipseName: \"International 1909 (Hayford)\"\n };\n\n exports$2.kaula = {\n a: 6378163.0,\n rf: 298.24,\n ellipseName: \"Kaula 1961\"\n };\n\n exports$2.lerch = {\n a: 6378139.0,\n rf: 298.257,\n ellipseName: \"Lerch 1979\"\n };\n\n exports$2.mprts = {\n a: 6397300.0,\n rf: 191.0,\n ellipseName: \"Maupertius 1738\"\n };\n\n exports$2.new_intl = {\n a: 6378157.5,\n b: 6356772.2,\n ellipseName: \"New International 1967\"\n };\n\n exports$2.plessis = {\n a: 6376523.0,\n rf: 6355863.0,\n ellipseName: \"Plessis 1817 (France)\"\n };\n\n exports$2.krass = {\n a: 6378245.0,\n rf: 298.3,\n ellipseName: \"Krassovsky, 1942\"\n };\n\n exports$2.SEasia = {\n a: 6378155.0,\n b: 6356773.3205,\n ellipseName: \"Southeast Asia\"\n };\n\n exports$2.walbeck = {\n a: 6376896.0,\n b: 6355834.8467,\n ellipseName: \"Walbeck\"\n };\n\n exports$2.WGS60 = {\n a: 6378165.0,\n rf: 298.3,\n ellipseName: \"WGS 60\"\n };\n\n exports$2.WGS66 = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"WGS 66\"\n };\n\n exports$2.WGS7 = {\n a: 6378135.0,\n rf: 298.26,\n ellipseName: \"WGS 72\"\n };\n\n var WGS84 = exports$2.WGS84 = {\n a: 6378137.0,\n rf: 298.257223563,\n ellipseName: \"WGS 84\"\n };\n\n exports$2.sphere = {\n a: 6370997.0,\n b: 6370997.0,\n ellipseName: \"Normal Sphere (r=6370997)\"\n };\n\n function eccentricity(a, b, rf, R_A) {\n var a2 = a * a; // used in geocentric\n var b2 = b * b; // used in geocentric\n var es = (a2 - b2) / a2; // e ^ 2\n var e = 0;\n if (R_A) {\n a *= 1 - es * (SIXTH + es * (RA4 + es * RA6));\n a2 = a * a;\n es = 0;\n } else {\n e = Math.sqrt(es); // eccentricity\n }\n var ep2 = (a2 - b2) / b2; // used in geocentric\n return {\n es: es,\n e: e,\n ep2: ep2\n };\n }\n function sphere(a, b, rf, ellps, sphere) {\n if (!a) { // do we have an ellipsoid?\n var ellipse = match(exports$2, ellps);\n if (!ellipse) {\n ellipse = WGS84;\n }\n a = ellipse.a;\n b = ellipse.b;\n rf = ellipse.rf;\n }\n\n if (rf && !b) {\n b = (1.0 - 1.0 / rf) * a;\n }\n if (rf === 0 || Math.abs(a - b) < EPSLN) {\n sphere = true;\n b = a;\n }\n return {\n a: a,\n b: b,\n rf: rf,\n sphere: sphere\n };\n }\n\n var exports$3 = {};\n exports$3.wgs84 = {\n towgs84: \"0,0,0\",\n ellipse: \"WGS84\",\n datumName: \"WGS84\"\n };\n\n exports$3.ch1903 = {\n towgs84: \"674.374,15.056,405.346\",\n ellipse: \"bessel\",\n datumName: \"swiss\"\n };\n\n exports$3.ggrs87 = {\n towgs84: \"-199.87,74.79,246.62\",\n ellipse: \"GRS80\",\n datumName: \"Greek_Geodetic_Reference_System_1987\"\n };\n\n exports$3.nad83 = {\n towgs84: \"0,0,0\",\n ellipse: \"GRS80\",\n datumName: \"North_American_Datum_1983\"\n };\n\n exports$3.nad27 = {\n nadgrids: \"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",\n ellipse: \"clrk66\",\n datumName: \"North_American_Datum_1927\"\n };\n\n exports$3.potsdam = {\n towgs84: \"598.1,73.7,418.2,0.202,0.045,-2.455,6.7\",\n ellipse: \"bessel\",\n datumName: \"Potsdam Rauenberg 1950 DHDN\"\n };\n\n exports$3.carthage = {\n towgs84: \"-263.0,6.0,431.0\",\n ellipse: \"clark80\",\n datumName: \"Carthage 1934 Tunisia\"\n };\n\n exports$3.hermannskogel = {\n towgs84: \"577.326,90.129,463.919,5.137,1.474,5.297,2.4232\",\n ellipse: \"bessel\",\n datumName: \"Hermannskogel\"\n };\n\n exports$3.osni52 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"airy\",\n datumName: \"Irish National\"\n };\n\n exports$3.ire65 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"mod_airy\",\n datumName: \"Ireland 1965\"\n };\n\n exports$3.rassadiran = {\n towgs84: \"-133.63,-157.5,-158.62\",\n ellipse: \"intl\",\n datumName: \"Rassadiran\"\n };\n\n exports$3.nzgd49 = {\n towgs84: \"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",\n ellipse: \"intl\",\n datumName: \"New Zealand Geodetic Datum 1949\"\n };\n\n exports$3.osgb36 = {\n towgs84: \"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",\n ellipse: \"airy\",\n datumName: \"Airy 1830\"\n };\n\n exports$3.s_jtsk = {\n towgs84: \"589,76,480\",\n ellipse: 'bessel',\n datumName: 'S-JTSK (Ferro)'\n };\n\n exports$3.beduaram = {\n towgs84: '-106,-87,188',\n ellipse: 'clrk80',\n datumName: 'Beduaram'\n };\n\n exports$3.gunung_segara = {\n towgs84: '-403,684,41',\n ellipse: 'bessel',\n datumName: 'Gunung Segara Jakarta'\n };\n\n exports$3.rnb72 = {\n towgs84: \"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",\n ellipse: \"intl\",\n datumName: \"Reseau National Belge 1972\"\n };\n\n function datum(datumCode, datum_params, a, b, es, ep2, nadgrids) {\n var out = {};\n\n if (datumCode === undefined || datumCode === 'none') {\n out.datum_type = PJD_NODATUM;\n } else {\n out.datum_type = PJD_WGS84;\n }\n\n if (datum_params) {\n out.datum_params = datum_params.map(parseFloat);\n if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {\n out.datum_type = PJD_3PARAM;\n }\n if (out.datum_params.length > 3) {\n if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {\n out.datum_type = PJD_7PARAM;\n out.datum_params[3] *= SEC_TO_RAD;\n out.datum_params[4] *= SEC_TO_RAD;\n out.datum_params[5] *= SEC_TO_RAD;\n out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0;\n }\n }\n }\n\n if (nadgrids) {\n out.datum_type = PJD_GRIDSHIFT;\n out.grids = nadgrids;\n }\n out.a = a; //datum object also uses these values\n out.b = b;\n out.es = es;\n out.ep2 = ep2;\n return out;\n }\n\n /**\n * Resources for details of NTv2 file formats:\n * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf\n * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm\n */\n\n var loadedNadgrids = {};\n\n /**\n * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=. Pass the NTv2 file\n * as an ArrayBuffer.\n */\n function nadgrid(key, data) {\n var view = new DataView(data);\n var isLittleEndian = detectLittleEndian(view);\n var header = readHeader(view, isLittleEndian);\n if (header.nSubgrids > 1) {\n console.log('Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored');\n }\n var subgrids = readSubgrids(view, header, isLittleEndian);\n var nadgrid = {header: header, subgrids: subgrids};\n loadedNadgrids[key] = nadgrid;\n return nadgrid;\n }\n\n /**\n * Given a proj4 value for nadgrids, return an array of loaded grids\n */\n function getNadgrids(nadgrids) {\n // Format details: http://proj.maptools.org/gen_parms.html\n if (nadgrids === undefined) { return null; }\n var grids = nadgrids.split(',');\n return grids.map(parseNadgridString);\n }\n\n function parseNadgridString(value) {\n if (value.length === 0) {\n return null;\n }\n var optional = value[0] === '@';\n if (optional) {\n value = value.slice(1);\n }\n if (value === 'null') {\n return {name: 'null', mandatory: !optional, grid: null, isNull: true};\n }\n return {\n name: value,\n mandatory: !optional,\n grid: loadedNadgrids[value] || null,\n isNull: false\n };\n }\n\n function secondsToRadians(seconds) {\n return (seconds / 3600) * Math.PI / 180;\n }\n\n function detectLittleEndian(view) {\n var nFields = view.getInt32(8, false);\n if (nFields === 11) {\n return false;\n }\n nFields = view.getInt32(8, true);\n if (nFields !== 11) {\n console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian');\n }\n return true;\n }\n\n function readHeader(view, isLittleEndian) {\n return {\n nFields: view.getInt32(8, isLittleEndian),\n nSubgridFields: view.getInt32(24, isLittleEndian),\n nSubgrids: view.getInt32(40, isLittleEndian),\n shiftType: decodeString(view, 56, 56 + 8).trim(),\n fromSemiMajorAxis: view.getFloat64(120, isLittleEndian),\n fromSemiMinorAxis: view.getFloat64(136, isLittleEndian),\n toSemiMajorAxis: view.getFloat64(152, isLittleEndian),\n toSemiMinorAxis: view.getFloat64(168, isLittleEndian),\n };\n }\n\n function decodeString(view, start, end) {\n return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end)));\n }\n\n function readSubgrids(view, header, isLittleEndian) {\n var gridOffset = 176;\n var grids = [];\n for (var i = 0; i < header.nSubgrids; i++) {\n var subHeader = readGridHeader(view, gridOffset, isLittleEndian);\n var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian);\n var lngColumnCount = Math.round(\n 1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval);\n var latColumnCount = Math.round(\n 1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval);\n // Proj4 operates on radians whereas the coordinates are in seconds in the grid\n grids.push({\n ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)],\n del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)],\n lim: [lngColumnCount, latColumnCount],\n count: subHeader.gridNodeCount,\n cvs: mapNodes(nodes)\n });\n }\n return grids;\n }\n\n function mapNodes(nodes) {\n return nodes.map(function (r) {return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];});\n }\n\n function readGridHeader(view, offset, isLittleEndian) {\n return {\n name: decodeString(view, offset + 8, offset + 16).trim(),\n parent: decodeString(view, offset + 24, offset + 24 + 8).trim(),\n lowerLatitude: view.getFloat64(offset + 72, isLittleEndian),\n upperLatitude: view.getFloat64(offset + 88, isLittleEndian),\n lowerLongitude: view.getFloat64(offset + 104, isLittleEndian),\n upperLongitude: view.getFloat64(offset + 120, isLittleEndian),\n latitudeInterval: view.getFloat64(offset + 136, isLittleEndian),\n longitudeInterval: view.getFloat64(offset + 152, isLittleEndian),\n gridNodeCount: view.getInt32(offset + 168, isLittleEndian)\n };\n }\n\n function readGridNodes(view, offset, gridHeader, isLittleEndian) {\n var nodesOffset = offset + 176;\n var gridRecordLength = 16;\n var gridShiftRecords = [];\n for (var i = 0; i < gridHeader.gridNodeCount; i++) {\n var record = {\n latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian),\n longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian),\n latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian),\n longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian),\n };\n gridShiftRecords.push(record);\n }\n return gridShiftRecords;\n }\n\n function Projection(srsCode,callback) {\n if (!(this instanceof Projection)) {\n return new Projection(srsCode);\n }\n callback = callback || function(error){\n if(error){\n throw error;\n }\n };\n var json = parse(srsCode);\n if(typeof json !== 'object'){\n callback(srsCode);\n return;\n }\n var ourProj = Projection.projections.get(json.projName);\n if(!ourProj){\n callback(srsCode);\n return;\n }\n if (json.datumCode && json.datumCode !== 'none') {\n var datumDef = match(exports$3, json.datumCode);\n if (datumDef) {\n json.datum_params = json.datum_params || (datumDef.towgs84 ? datumDef.towgs84.split(',') : null);\n json.ellps = datumDef.ellipse;\n json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;\n }\n }\n json.k0 = json.k0 || 1.0;\n json.axis = json.axis || 'enu';\n json.ellps = json.ellps || 'wgs84';\n json.lat1 = json.lat1 || json.lat0; // Lambert_Conformal_Conic_1SP, for example, needs this\n\n var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere);\n var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);\n var nadgrids = getNadgrids(json.nadgrids);\n var datumObj = json.datum || datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2,\n nadgrids);\n\n extend(this, json); // transfer everything over from the projection because we don't know what we'll need\n extend(this, ourProj); // transfer all the methods from the projection\n\n // copy the 4 things over we calulated in deriveConstants.sphere\n this.a = sphere_.a;\n this.b = sphere_.b;\n this.rf = sphere_.rf;\n this.sphere = sphere_.sphere;\n\n // copy the 3 things we calculated in deriveConstants.eccentricity\n this.es = ecc.es;\n this.e = ecc.e;\n this.ep2 = ecc.ep2;\n\n // add in the datum object\n this.datum = datumObj;\n\n // init the projection\n this.init();\n\n // legecy callback from back in the day when it went to spatialreference.org\n callback(null, this);\n\n }\n Projection.projections = projections;\n Projection.projections.start();\n\n 'use strict';\n function compareDatums(source, dest) {\n if (source.datum_type !== dest.datum_type) {\n return false; // false, datums are not equal\n } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {\n // the tolerance for es is to ensure that GRS80 and WGS84\n // are considered identical\n return false;\n } else if (source.datum_type === PJD_3PARAM) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2]);\n } else if (source.datum_type === PJD_7PARAM) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6]);\n } else {\n return true; // datums are equal\n }\n } // cs_compare_datums()\n\n /*\n * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates\n * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),\n * according to the current ellipsoid parameters.\n *\n * Latitude : Geodetic latitude in radians (input)\n * Longitude : Geodetic longitude in radians (input)\n * Height : Geodetic height, in meters (input)\n * X : Calculated Geocentric X coordinate, in meters (output)\n * Y : Calculated Geocentric Y coordinate, in meters (output)\n * Z : Calculated Geocentric Z coordinate, in meters (output)\n *\n */\n function geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {\n Latitude = -HALF_PI;\n } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {\n Latitude = HALF_PI;\n } else if (Latitude < -HALF_PI) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return { x: -Infinity, y: -Infinity, z: p.z };\n } else if (Latitude > HALF_PI) {\n /* Latitude out of range */\n return { x: Infinity, y: Infinity, z: p.z };\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n } // cs_geodetic_to_geocentric()\n\n function geocentricToGeodetic(p, es, a, b) {\n /* local defintions and variables */\n /* end-criterium of loop, accuracy of sin(Latitude) */\n var genau = 1e-12;\n var genau2 = (genau * genau);\n var maxiter = 30;\n\n var P; /* distance between semi-minor axis and location */\n var RR; /* distance between center and location */\n var CT; /* sin of geocentric latitude */\n var ST; /* cos of geocentric latitude */\n var RX;\n var RK;\n var RN; /* Earth radius at location */\n var CPHI0; /* cos of start or old geodetic latitude in iterations */\n var SPHI0; /* sin of start or old geodetic latitude in iterations */\n var CPHI; /* cos of searched geodetic latitude */\n var SPHI; /* sin of searched geodetic latitude */\n var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */\n var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */\n\n var X = p.x;\n var Y = p.y;\n var Z = p.z ? p.z : 0.0; //Z value not always supplied\n var Longitude;\n var Latitude;\n var Height;\n\n P = Math.sqrt(X * X + Y * Y);\n RR = Math.sqrt(X * X + Y * Y + Z * Z);\n\n /* special cases for latitude and longitude */\n if (P / a < genau) {\n\n /* special case, if P=0. (X=0., Y=0.) */\n Longitude = 0.0;\n\n /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis\n * of ellipsoid (=center of mass), Latitude becomes PI/2 */\n if (RR / a < genau) {\n Latitude = HALF_PI;\n Height = -b;\n return {\n x: p.x,\n y: p.y,\n z: p.z\n };\n }\n } else {\n /* ellipsoidal (geodetic) longitude\n * interval: -PI < Longitude <= +PI */\n Longitude = Math.atan2(Y, X);\n }\n\n /* --------------------------------------------------------------\n * Following iterative algorithm was developped by\n * \"Institut for Erdmessung\", University of Hannover, July 1988.\n * Internet: www.ife.uni-hannover.de\n * Iterative computation of CPHI,SPHI and Height.\n * Iteration of CPHI and SPHI to 10**-12 radian resp.\n * 2*10**-7 arcsec.\n * --------------------------------------------------------------\n */\n CT = Z / RR;\n ST = P / RR;\n RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);\n CPHI0 = ST * (1.0 - es) * RX;\n SPHI0 = CT * RX;\n iter = 0;\n\n /* loop to find sin(Latitude) resp. Latitude\n * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */\n do {\n iter++;\n RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);\n\n /* ellipsoidal (geodetic) height */\n Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);\n\n RK = es * RN / (RN + Height);\n RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);\n CPHI = ST * (1.0 - RK) * RX;\n SPHI = CT * RX;\n SDPHI = SPHI * CPHI0 - CPHI * SPHI0;\n CPHI0 = CPHI;\n SPHI0 = SPHI;\n }\n while (SDPHI * SDPHI > genau2 && iter < maxiter);\n\n /* ellipsoidal (geodetic) latitude */\n Latitude = Math.atan(SPHI / Math.abs(CPHI));\n return {\n x: Longitude,\n y: Latitude,\n z: Height\n };\n } // cs_geocentric_to_geodetic()\n\n /****************************************************************/\n // pj_geocentic_to_wgs84( p )\n // p = point to transform in geocentric coordinates (x,y,z)\n\n\n /** point object, nothing fancy, just allows values to be\n passed back and forth by reference rather than by value.\n Other point classes may be used as long as they have\n x and y properties, which will get modified in the transform method.\n */\n function geocentricToWgs84(p, datum_type, datum_params) {\n\n if (datum_type === PJD_3PARAM) {\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x + datum_params[0],\n y: p.y + datum_params[1],\n z: p.z + datum_params[2],\n };\n } else if (datum_type === PJD_7PARAM) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,\n y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,\n z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF\n };\n }\n } // cs_geocentric_to_wgs84\n\n /****************************************************************/\n // pj_geocentic_from_wgs84()\n // coordinate system definition,\n // point to transform in geocentric coordinates (x,y,z)\n function geocentricFromWgs84(p, datum_type, datum_params) {\n\n if (datum_type === PJD_3PARAM) {\n //if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x - datum_params[0],\n y: p.y - datum_params[1],\n z: p.z - datum_params[2],\n };\n\n } else if (datum_type === PJD_7PARAM) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n var x_tmp = (p.x - Dx_BF) / M_BF;\n var y_tmp = (p.y - Dy_BF) / M_BF;\n var z_tmp = (p.z - Dz_BF) / M_BF;\n //if( x[io] === HUGE_VAL )\n // continue;\n\n return {\n x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,\n y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,\n z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp\n };\n } //cs_geocentric_from_wgs84()\n }\n\n function checkParams(type) {\n return (type === PJD_3PARAM || type === PJD_7PARAM);\n }\n\n var datum_transform = function(source, dest, point) {\n // Short cut if the datums are identical.\n if (compareDatums(source, dest)) {\n return point; // in this case, zero is sucess,\n // whereas cs_compare_datums returns 1 to indicate TRUE\n // confusing, should fix this\n }\n\n // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest\n if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) {\n return point;\n }\n\n // If this datum requires grid shifts, then apply it to geodetic coordinates.\n var source_a = source.a;\n var source_es = source.es;\n if (source.datum_type === PJD_GRIDSHIFT) {\n var gridShiftCode = applyGridShift(source, false, point);\n if (gridShiftCode !== 0) {\n return undefined;\n }\n source_a = SRS_WGS84_SEMIMAJOR;\n source_es = SRS_WGS84_ESQUARED;\n }\n\n var dest_a = dest.a;\n var dest_b = dest.b;\n var dest_es = dest.es;\n if (dest.datum_type === PJD_GRIDSHIFT) {\n dest_a = SRS_WGS84_SEMIMAJOR;\n dest_b = SRS_WGS84_SEMIMINOR;\n dest_es = SRS_WGS84_ESQUARED;\n }\n\n // Do we need to go through geocentric coordinates?\n if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {\n return point;\n }\n\n // Convert to geocentric coordinates.\n point = geodeticToGeocentric(point, source_es, source_a);\n // Convert between datums\n if (checkParams(source.datum_type)) {\n point = geocentricToWgs84(point, source.datum_type, source.datum_params);\n }\n if (checkParams(dest.datum_type)) {\n point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params);\n }\n point = geocentricToGeodetic(point, dest_es, dest_a, dest_b);\n\n if (dest.datum_type === PJD_GRIDSHIFT) {\n var destGridShiftResult = applyGridShift(dest, true, point);\n if (destGridShiftResult !== 0) {\n return undefined;\n }\n }\n\n return point;\n };\n\n function applyGridShift(source, inverse, point) {\n if (source.grids === null || source.grids.length === 0) {\n console.log('Grid shift grids not found');\n return -1;\n }\n var input = {x: -point.x, y: point.y};\n var output = {x: Number.NaN, y: Number.NaN};\n var attemptedGrids = [];\n for (var i = 0; i < source.grids.length; i++) {\n var grid = source.grids[i];\n attemptedGrids.push(grid.name);\n if (grid.isNull) {\n output = input;\n break;\n }\n if (grid.grid === null) {\n if (grid.mandatory) {\n console.log(\"Unable to find mandatory grid '\" + grid.name + \"'\");\n return -1;\n }\n continue;\n }\n var subgrid = grid.grid.subgrids[0];\n // skip tables that don't match our point at all\n var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0;\n var minX = subgrid.ll[0] - epsilon;\n var minY = subgrid.ll[1] - epsilon;\n var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon;\n var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon;\n if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x ) {\n continue;\n }\n output = applySubgridShift(input, inverse, subgrid);\n if (!isNaN(output.x)) {\n break;\n }\n }\n if (isNaN(output.x)) {\n console.log(\"Failed to find a grid shift table for location '\"+\n -input.x * R2D + \" \" + input.y * R2D + \" tried: '\" + attemptedGrids + \"'\");\n return -1;\n }\n point.x = -output.x;\n point.y = output.y;\n return 0;\n }\n\n function applySubgridShift(pin, inverse, ct) {\n var val = {x: Number.NaN, y: Number.NaN};\n if (isNaN(pin.x)) { return val; }\n var tb = {x: pin.x, y: pin.y};\n tb.x -= ct.ll[0];\n tb.y -= ct.ll[1];\n tb.x = adjust_lon(tb.x - Math.PI) + Math.PI;\n var t = nadInterpolate(tb, ct);\n if (inverse) {\n if (isNaN(t.x)) {\n return val;\n }\n t.x = tb.x - t.x;\n t.y = tb.y - t.y;\n var i = 9, tol = 1e-12;\n var dif, del;\n do {\n del = nadInterpolate(t, ct);\n if (isNaN(del.x)) {\n console.log(\"Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.\");\n break;\n }\n dif = {x: tb.x - (del.x + t.x), y: tb.y - (del.y + t.y)};\n t.x += dif.x;\n t.y += dif.y;\n } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol);\n if (i < 0) {\n console.log(\"Inverse grid shift iterator failed to converge.\");\n return val;\n }\n val.x = adjust_lon(t.x + ct.ll[0]);\n val.y = t.y + ct.ll[1];\n } else {\n if (!isNaN(t.x)) {\n val.x = pin.x + t.x;\n val.y = pin.y + t.y;\n }\n }\n return val;\n }\n\n function nadInterpolate(pin, ct) {\n var t = {x: pin.x / ct.del[0], y: pin.y / ct.del[1]};\n var indx = {x: Math.floor(t.x), y: Math.floor(t.y)};\n var frct = {x: t.x - 1.0 * indx.x, y: t.y - 1.0 * indx.y};\n var val= {x: Number.NaN, y: Number.NaN};\n var inx;\n if (indx.x < 0 || indx.x >= ct.lim[0]) {\n return val;\n }\n if (indx.y < 0 || indx.y >= ct.lim[1]) {\n return val;\n }\n inx = (indx.y * ct.lim[0]) + indx.x;\n var f00 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx++;\n var f10= {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx += ct.lim[0];\n var f11 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx--;\n var f01 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n var m11 = frct.x * frct.y, m10 = frct.x * (1.0 - frct.y),\n m00 = (1.0 - frct.x) * (1.0 - frct.y), m01 = (1.0 - frct.x) * frct.y;\n val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x);\n val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y);\n return val;\n }\n\n var adjust_axis = function(crs, denorm, point) {\n var xin = point.x,\n yin = point.y,\n zin = point.z || 0.0;\n var v, t, i;\n var out = {};\n for (i = 0; i < 3; i++) {\n if (denorm && i === 2 && point.z === undefined) {\n continue;\n }\n if (i === 0) {\n v = xin;\n if (\"ew\".indexOf(crs.axis[i]) !== -1) {\n t = 'x';\n } else {\n t = 'y';\n }\n\n }\n else if (i === 1) {\n v = yin;\n if (\"ns\".indexOf(crs.axis[i]) !== -1) {\n t = 'y';\n } else {\n t = 'x';\n }\n }\n else {\n v = zin;\n t = 'z';\n }\n switch (crs.axis[i]) {\n case 'e':\n out[t] = v;\n break;\n case 'w':\n out[t] = -v;\n break;\n case 'n':\n out[t] = v;\n break;\n case 's':\n out[t] = -v;\n break;\n case 'u':\n if (point[t] !== undefined) {\n out.z = v;\n }\n break;\n case 'd':\n if (point[t] !== undefined) {\n out.z = -v;\n }\n break;\n default:\n //console.log(\"ERROR: unknow axis (\"+crs.axis[i]+\") - check definition of \"+crs.projName);\n return null;\n }\n }\n return out;\n };\n\n var toPoint = function (array){\n var out = {\n x: array[0],\n y: array[1]\n };\n if (array.length>2) {\n out.z = array[2];\n }\n if (array.length>3) {\n out.m = array[3];\n }\n return out;\n };\n\n var checkSanity = function (point) {\n checkCoord(point.x);\n checkCoord(point.y);\n };\n function checkCoord(num) {\n if (typeof Number.isFinite === 'function') {\n if (Number.isFinite(num)) {\n return;\n }\n throw new TypeError('coordinates must be finite numbers');\n }\n if (typeof num !== 'number' || num !== num || !isFinite(num)) {\n throw new TypeError('coordinates must be finite numbers');\n }\n }\n\n function checkNotWGS(source, dest) {\n return ((source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM) && dest.datumCode !== 'WGS84') || ((dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM) && source.datumCode !== 'WGS84');\n }\n\n function transform(source, dest, point, enforceAxis) {\n var wgs84;\n if (Array.isArray(point)) {\n point = toPoint(point);\n }\n checkSanity(point);\n // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84\n if (source.datum && dest.datum && checkNotWGS(source, dest)) {\n wgs84 = new Projection('WGS84');\n point = transform(source, wgs84, point, enforceAxis);\n source = wgs84;\n }\n // DGR, 2010/11/12\n if (enforceAxis && source.axis !== 'enu') {\n point = adjust_axis(source, false, point);\n }\n // Transform source points to long/lat, if they aren't already.\n if (source.projName === 'longlat') {\n point = {\n x: point.x * D2R,\n y: point.y * D2R,\n z: point.z || 0\n };\n } else {\n if (source.to_meter) {\n point = {\n x: point.x * source.to_meter,\n y: point.y * source.to_meter,\n z: point.z || 0\n };\n }\n point = source.inverse(point); // Convert Cartesian to longlat\n if (!point) {\n return;\n }\n }\n // Adjust for the prime meridian if necessary\n if (source.from_greenwich) {\n point.x += source.from_greenwich;\n }\n\n // Convert datums if needed, and if possible.\n point = datum_transform(source.datum, dest.datum, point);\n if (!point) {\n return;\n }\n\n // Adjust for the prime meridian if necessary\n if (dest.from_greenwich) {\n point = {\n x: point.x - dest.from_greenwich,\n y: point.y,\n z: point.z || 0\n };\n }\n\n if (dest.projName === 'longlat') {\n // convert radians to decimal degrees\n point = {\n x: point.x * R2D,\n y: point.y * R2D,\n z: point.z || 0\n };\n } else { // else project\n point = dest.forward(point);\n if (dest.to_meter) {\n point = {\n x: point.x / dest.to_meter,\n y: point.y / dest.to_meter,\n z: point.z || 0\n };\n }\n }\n\n // DGR, 2010/11/12\n if (enforceAxis && dest.axis !== 'enu') {\n return adjust_axis(dest, true, point);\n }\n\n return point;\n }\n\n var wgs84 = Projection('WGS84');\n\n function transformer(from, to, coords, enforceAxis) {\n var transformedArray, out, keys;\n if (Array.isArray(coords)) {\n transformedArray = transform(from, to, coords, enforceAxis) || {x: NaN, y: NaN};\n if (coords.length > 2) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (typeof transformedArray.z === 'number') {\n return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));\n } else {\n return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));\n }\n } else {\n return [transformedArray.x, transformedArray.y].concat(coords.splice(2));\n }\n } else {\n return [transformedArray.x, transformedArray.y];\n }\n } else {\n out = transform(from, to, coords, enforceAxis);\n keys = Object.keys(coords);\n if (keys.length === 2) {\n return out;\n }\n keys.forEach(function (key) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (key === 'x' || key === 'y' || key === 'z') {\n return;\n }\n } else {\n if (key === 'x' || key === 'y') {\n return;\n }\n }\n out[key] = coords[key];\n });\n return out;\n }\n }\n\n function checkProj(item) {\n if (item instanceof Projection) {\n return item;\n }\n if (item.oProj) {\n return item.oProj;\n }\n return Projection(item);\n }\n\n function proj4$1(fromProj, toProj, coord) {\n fromProj = checkProj(fromProj);\n var single = false;\n var obj;\n if (typeof toProj === 'undefined') {\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {\n coord = toProj;\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n }\n toProj = checkProj(toProj);\n if (coord) {\n return transformer(fromProj, toProj, coord);\n } else {\n obj = {\n forward: function (coords, enforceAxis) {\n return transformer(fromProj, toProj, coords, enforceAxis);\n },\n inverse: function (coords, enforceAxis) {\n return transformer(toProj, fromProj, coords, enforceAxis);\n }\n };\n if (single) {\n obj.oProj = toProj;\n }\n return obj;\n }\n }\n\n /**\n * UTM zones are grouped, and assigned to one of a group of 6\n * sets.\n *\n * {int} @private\n */\n var NUM_100K_SETS = 6;\n\n /**\n * The column letters (for easting) of the lower left value, per\n * set.\n *\n * {string} @private\n */\n var SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';\n\n /**\n * The row letters (for northing) of the lower left value, per\n * set.\n *\n * {string} @private\n */\n var SET_ORIGIN_ROW_LETTERS = 'AFAFAF';\n\n var A = 65; // A\n var I = 73; // I\n var O = 79; // O\n var V = 86; // V\n var Z = 90; // Z\n var mgrs = {\n forward: forward$1,\n inverse: inverse$1,\n toPoint: toPoint$1\n };\n /**\n * Conversion of lat/lon to MGRS.\n *\n * @param {object} ll Object literal with lat and lon properties on a\n * WGS84 ellipsoid.\n * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for\n * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.\n * @return {string} the MGRS string for the given location and accuracy.\n */\n function forward$1(ll, accuracy) {\n accuracy = accuracy || 5; // default accuracy 1m\n return encode(LLtoUTM({\n lat: ll[1],\n lon: ll[0]\n }), accuracy);\n }\n\n /**\n * Conversion of MGRS to lat/lon.\n *\n * @param {string} mgrs MGRS string.\n * @return {array} An array with left (longitude), bottom (latitude), right\n * (longitude) and top (latitude) values in WGS84, representing the\n * bounding box for the provided MGRS reference.\n */\n function inverse$1(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];\n }\n return [bbox.left, bbox.bottom, bbox.right, bbox.top];\n }\n\n function toPoint$1(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat];\n }\n return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];\n }\n /**\n * Conversion from degrees to radians.\n *\n * @private\n * @param {number} deg the angle in degrees.\n * @return {number} the angle in radians.\n */\n function degToRad(deg) {\n return (deg * (Math.PI / 180.0));\n }\n\n /**\n * Conversion from radians to degrees.\n *\n * @private\n * @param {number} rad the angle in radians.\n * @return {number} the angle in degrees.\n */\n function radToDeg(rad) {\n return (180.0 * (rad / Math.PI));\n }\n\n /**\n * Converts a set of Longitude and Latitude co-ordinates to UTM\n * using the WGS84 ellipsoid.\n *\n * @private\n * @param {object} ll Object literal with lat and lon properties\n * representing the WGS84 coordinate to be converted.\n * @return {object} Object literal containing the UTM value with easting,\n * northing, zoneNumber and zoneLetter properties, and an optional\n * accuracy property in digits. Returns null if the conversion failed.\n */\n function LLtoUTM(ll) {\n var Lat = ll.lat;\n var Long = ll.lon;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var k0 = 0.9996;\n var LongOrigin;\n var eccPrimeSquared;\n var N, T, C, A, M;\n var LatRad = degToRad(Lat);\n var LongRad = degToRad(Long);\n var LongOriginRad;\n var ZoneNumber;\n // (int)\n ZoneNumber = Math.floor((Long + 180) / 6) + 1;\n\n //Make sure the longitude 180.00 is in Zone 60\n if (Long === 180) {\n ZoneNumber = 60;\n }\n\n // Special zone for Norway\n if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {\n ZoneNumber = 32;\n }\n\n // Special zones for Svalbard\n if (Lat >= 72.0 && Lat < 84.0) {\n if (Long >= 0.0 && Long < 9.0) {\n ZoneNumber = 31;\n }\n else if (Long >= 9.0 && Long < 21.0) {\n ZoneNumber = 33;\n }\n else if (Long >= 21.0 && Long < 33.0) {\n ZoneNumber = 35;\n }\n else if (Long >= 33.0 && Long < 42.0) {\n ZoneNumber = 37;\n }\n }\n\n LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin\n // in middle of\n // zone\n LongOriginRad = degToRad(LongOrigin);\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));\n T = Math.tan(LatRad) * Math.tan(LatRad);\n C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);\n A = Math.cos(LatRad) * (LongRad - LongOriginRad);\n\n M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - (35 * eccSquared * eccSquared * eccSquared / 3072) * Math.sin(6 * LatRad));\n\n var UTMEasting = (k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0);\n\n var UTMNorthing = (k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0)));\n if (Lat < 0.0) {\n UTMNorthing += 10000000.0; //10000000 meter offset for\n // southern hemisphere\n }\n\n return {\n northing: Math.round(UTMNorthing),\n easting: Math.round(UTMEasting),\n zoneNumber: ZoneNumber,\n zoneLetter: getLetterDesignator(Lat)\n };\n }\n\n /**\n * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience\n * class where the Zone can be specified as a single string eg.\"60N\" which\n * is then broken down into the ZoneNumber and ZoneLetter.\n *\n * @private\n * @param {object} utm An object literal with northing, easting, zoneNumber\n * and zoneLetter properties. If an optional accuracy property is\n * provided (in meters), a bounding box will be returned instead of\n * latitude and longitude.\n * @return {object} An object literal containing either lat and lon values\n * (if no accuracy was provided), or top, right, bottom and left values\n * for the bounding box calculated according to the provided accuracy.\n * Returns null if the conversion failed.\n */\n function UTMtoLL(utm) {\n\n var UTMNorthing = utm.northing;\n var UTMEasting = utm.easting;\n var zoneLetter = utm.zoneLetter;\n var zoneNumber = utm.zoneNumber;\n // check the ZoneNummber is valid\n if (zoneNumber < 0 || zoneNumber > 60) {\n return null;\n }\n\n var k0 = 0.9996;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var eccPrimeSquared;\n var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));\n var N1, T1, C1, R1, D, M;\n var LongOrigin;\n var mu, phi1Rad;\n\n // remove 500,000 meter offset for longitude\n var x = UTMEasting - 500000.0;\n var y = UTMNorthing;\n\n // We must know somehow if we are in the Northern or Southern\n // hemisphere, this is the only time we use the letter So even\n // if the Zone letter isn't exactly correct it should indicate\n // the hemisphere correctly\n if (zoneLetter < 'N') {\n y -= 10000000.0; // remove 10,000,000 meter offset used\n // for southern hemisphere\n }\n\n // There are 60 zones with zone 1 being at West -180 to -174\n LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin\n // in middle of\n // zone\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n M = y / k0;\n mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));\n\n phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + (151 * e1 * e1 * e1 / 96) * Math.sin(6 * mu);\n // double phi1 = ProjMath.radToDeg(phi1Rad);\n\n N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));\n T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);\n C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);\n R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);\n D = x / (N1 * k0);\n\n var lat = phi1Rad - (N1 * Math.tan(phi1Rad) / R1) * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720);\n lat = radToDeg(lat);\n\n var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);\n lon = LongOrigin + radToDeg(lon);\n\n var result;\n if (utm.accuracy) {\n var topRight = UTMtoLL({\n northing: utm.northing + utm.accuracy,\n easting: utm.easting + utm.accuracy,\n zoneLetter: utm.zoneLetter,\n zoneNumber: utm.zoneNumber\n });\n result = {\n top: topRight.lat,\n right: topRight.lon,\n bottom: lat,\n left: lon\n };\n }\n else {\n result = {\n lat: lat,\n lon: lon\n };\n }\n return result;\n }\n\n /**\n * Calculates the MGRS letter designator for the given latitude.\n *\n * @private\n * @param {number} lat The latitude in WGS84 to get the letter designator\n * for.\n * @return {char} The letter designator.\n */\n function getLetterDesignator(lat) {\n //This is here as an error flag to show that the Latitude is\n //outside MGRS limits\n var LetterDesignator = 'Z';\n\n if ((84 >= lat) && (lat >= 72)) {\n LetterDesignator = 'X';\n }\n else if ((72 > lat) && (lat >= 64)) {\n LetterDesignator = 'W';\n }\n else if ((64 > lat) && (lat >= 56)) {\n LetterDesignator = 'V';\n }\n else if ((56 > lat) && (lat >= 48)) {\n LetterDesignator = 'U';\n }\n else if ((48 > lat) && (lat >= 40)) {\n LetterDesignator = 'T';\n }\n else if ((40 > lat) && (lat >= 32)) {\n LetterDesignator = 'S';\n }\n else if ((32 > lat) && (lat >= 24)) {\n LetterDesignator = 'R';\n }\n else if ((24 > lat) && (lat >= 16)) {\n LetterDesignator = 'Q';\n }\n else if ((16 > lat) && (lat >= 8)) {\n LetterDesignator = 'P';\n }\n else if ((8 > lat) && (lat >= 0)) {\n LetterDesignator = 'N';\n }\n else if ((0 > lat) && (lat >= -8)) {\n LetterDesignator = 'M';\n }\n else if ((-8 > lat) && (lat >= -16)) {\n LetterDesignator = 'L';\n }\n else if ((-16 > lat) && (lat >= -24)) {\n LetterDesignator = 'K';\n }\n else if ((-24 > lat) && (lat >= -32)) {\n LetterDesignator = 'J';\n }\n else if ((-32 > lat) && (lat >= -40)) {\n LetterDesignator = 'H';\n }\n else if ((-40 > lat) && (lat >= -48)) {\n LetterDesignator = 'G';\n }\n else if ((-48 > lat) && (lat >= -56)) {\n LetterDesignator = 'F';\n }\n else if ((-56 > lat) && (lat >= -64)) {\n LetterDesignator = 'E';\n }\n else if ((-64 > lat) && (lat >= -72)) {\n LetterDesignator = 'D';\n }\n else if ((-72 > lat) && (lat >= -80)) {\n LetterDesignator = 'C';\n }\n return LetterDesignator;\n }\n\n /**\n * Encodes a UTM location as MGRS string.\n *\n * @private\n * @param {object} utm An object literal with easting, northing,\n * zoneLetter, zoneNumber\n * @param {number} accuracy Accuracy in digits (1-5).\n * @return {string} MGRS string for the given UTM location.\n */\n function encode(utm, accuracy) {\n // prepend with leading zeroes\n var seasting = \"00000\" + utm.easting,\n snorthing = \"00000\" + utm.northing;\n\n return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);\n }\n\n /**\n * Get the two letter 100k designator for a given UTM easting,\n * northing and zone number value.\n *\n * @private\n * @param {number} easting\n * @param {number} northing\n * @param {number} zoneNumber\n * @return the two letter 100k designator for the given UTM location.\n */\n function get100kID(easting, northing, zoneNumber) {\n var setParm = get100kSetForZone(zoneNumber);\n var setColumn = Math.floor(easting / 100000);\n var setRow = Math.floor(northing / 100000) % 20;\n return getLetter100kID(setColumn, setRow, setParm);\n }\n\n /**\n * Given a UTM zone number, figure out the MGRS 100K set it is in.\n *\n * @private\n * @param {number} i An UTM zone number.\n * @return {number} the 100k set the UTM zone is in.\n */\n function get100kSetForZone(i) {\n var setParm = i % NUM_100K_SETS;\n if (setParm === 0) {\n setParm = NUM_100K_SETS;\n }\n\n return setParm;\n }\n\n /**\n * Get the two-letter MGRS 100k designator given information\n * translated from the UTM northing, easting and zone number.\n *\n * @private\n * @param {number} column the column index as it relates to the MGRS\n * 100k set spreadsheet, created from the UTM easting.\n * Values are 1-8.\n * @param {number} row the row index as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM northing value. Values\n * are from 0-19.\n * @param {number} parm the set block, as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM zone. Values are from\n * 1-60.\n * @return two letter MGRS 100k code.\n */\n function getLetter100kID(column, row, parm) {\n // colOrigin and rowOrigin are the letters at the origin of the set\n var index = parm - 1;\n var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);\n var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);\n\n // colInt and rowInt are the letters to build to return\n var colInt = colOrigin + column - 1;\n var rowInt = rowOrigin + row;\n var rollover = false;\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n rollover = true;\n }\n\n if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) {\n colInt++;\n }\n\n if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) {\n colInt++;\n\n if (colInt === I) {\n colInt++;\n }\n }\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n rollover = true;\n }\n else {\n rollover = false;\n }\n\n if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) {\n rowInt++;\n }\n\n if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) {\n rowInt++;\n\n if (rowInt === I) {\n rowInt++;\n }\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n }\n\n var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);\n return twoLetter;\n }\n\n /**\n * Decode the UTM parameters from a MGRS string.\n *\n * @private\n * @param {string} mgrsString an UPPERCASE coordinate string is expected.\n * @return {object} An object literal with easting, northing, zoneLetter,\n * zoneNumber and accuracy (in meters) properties.\n */\n function decode(mgrsString) {\n\n if (mgrsString && mgrsString.length === 0) {\n throw (\"MGRSPoint coverting from nothing\");\n }\n\n var length = mgrsString.length;\n\n var hunK = null;\n var sb = \"\";\n var testChar;\n var i = 0;\n\n // get Zone number\n while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) {\n if (i >= 2) {\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n sb += testChar;\n i++;\n }\n\n var zoneNumber = parseInt(sb, 10);\n\n if (i === 0 || i + 3 > length) {\n // A good MGRS string has to be 4-5 digits long,\n // ##AAA/#AAA at least.\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n\n var zoneLetter = mgrsString.charAt(i++);\n\n // Should we check the zone letter here? Why not.\n if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {\n throw (\"MGRSPoint zone letter \" + zoneLetter + \" not handled: \" + mgrsString);\n }\n\n hunK = mgrsString.substring(i, i += 2);\n\n var set = get100kSetForZone(zoneNumber);\n\n var east100k = getEastingFromChar(hunK.charAt(0), set);\n var north100k = getNorthingFromChar(hunK.charAt(1), set);\n\n // We have a bug where the northing may be 2000000 too low.\n // How\n // do we know when to roll over?\n\n while (north100k < getMinNorthing(zoneLetter)) {\n north100k += 2000000;\n }\n\n // calculate the char index for easting/northing separator\n var remainder = length - i;\n\n if (remainder % 2 !== 0) {\n throw (\"MGRSPoint has to have an even number \\nof digits after the zone letter and two 100km letters - front \\nhalf for easting meters, second half for \\nnorthing meters\" + mgrsString);\n }\n\n var sep = remainder / 2;\n\n var sepEasting = 0.0;\n var sepNorthing = 0.0;\n var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;\n if (sep > 0) {\n accuracyBonus = 100000.0 / Math.pow(10, sep);\n sepEastingString = mgrsString.substring(i, i + sep);\n sepEasting = parseFloat(sepEastingString) * accuracyBonus;\n sepNorthingString = mgrsString.substring(i + sep);\n sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;\n }\n\n easting = sepEasting + east100k;\n northing = sepNorthing + north100k;\n\n return {\n easting: easting,\n northing: northing,\n zoneLetter: zoneLetter,\n zoneNumber: zoneNumber,\n accuracy: accuracyBonus\n };\n }\n\n /**\n * Given the first letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the easting value that\n * should be added to the other, secondary easting value.\n *\n * @private\n * @param {char} e The first letter from a two-letter MGRS 100´k zone.\n * @param {number} set The MGRS table set for the zone number.\n * @return {number} The easting value for the given letter and set.\n */\n function getEastingFromChar(e, set) {\n // colOrigin is the letter at the origin of the set for the\n // column\n var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);\n var eastingValue = 100000.0;\n var rewindMarker = false;\n\n while (curCol !== e.charCodeAt(0)) {\n curCol++;\n if (curCol === I) {\n curCol++;\n }\n if (curCol === O) {\n curCol++;\n }\n if (curCol > Z) {\n if (rewindMarker) {\n throw (\"Bad character: \" + e);\n }\n curCol = A;\n rewindMarker = true;\n }\n eastingValue += 100000.0;\n }\n\n return eastingValue;\n }\n\n /**\n * Given the second letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the northing value that\n * should be added to the other, secondary northing value. You have to\n * remember that Northings are determined from the equator, and the vertical\n * cycle of letters mean a 2000000 additional northing meters. This happens\n * approx. every 18 degrees of latitude. This method does *NOT* count any\n * additional northings. You have to figure out how many 2000000 meters need\n * to be added for the zone letter of the MGRS coordinate.\n *\n * @private\n * @param {char} n Second letter of the MGRS 100k zone\n * @param {number} set The MGRS table set number, which is dependent on the\n * UTM zone number.\n * @return {number} The northing value for the given letter and set.\n */\n function getNorthingFromChar(n, set) {\n\n if (n > 'V') {\n throw (\"MGRSPoint given invalid Northing \" + n);\n }\n\n // rowOrigin is the letter at the origin of the set for the\n // column\n var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);\n var northingValue = 0.0;\n var rewindMarker = false;\n\n while (curRow !== n.charCodeAt(0)) {\n curRow++;\n if (curRow === I) {\n curRow++;\n }\n if (curRow === O) {\n curRow++;\n }\n // fixing a bug making whole application hang in this loop\n // when 'n' is a wrong character\n if (curRow > V) {\n if (rewindMarker) { // making sure that this loop ends\n throw (\"Bad character: \" + n);\n }\n curRow = A;\n rewindMarker = true;\n }\n northingValue += 100000.0;\n }\n\n return northingValue;\n }\n\n /**\n * The function getMinNorthing returns the minimum northing value of a MGRS\n * zone.\n *\n * Ported from Geotrans' c Lattitude_Band_Value structure table.\n *\n * @private\n * @param {char} zoneLetter The MGRS zone to get the min northing for.\n * @return {number}\n */\n function getMinNorthing(zoneLetter) {\n var northing;\n switch (zoneLetter) {\n case 'C':\n northing = 1100000.0;\n break;\n case 'D':\n northing = 2000000.0;\n break;\n case 'E':\n northing = 2800000.0;\n break;\n case 'F':\n northing = 3700000.0;\n break;\n case 'G':\n northing = 4600000.0;\n break;\n case 'H':\n northing = 5500000.0;\n break;\n case 'J':\n northing = 6400000.0;\n break;\n case 'K':\n northing = 7300000.0;\n break;\n case 'L':\n northing = 8200000.0;\n break;\n case 'M':\n northing = 9100000.0;\n break;\n case 'N':\n northing = 0.0;\n break;\n case 'P':\n northing = 800000.0;\n break;\n case 'Q':\n northing = 1700000.0;\n break;\n case 'R':\n northing = 2600000.0;\n break;\n case 'S':\n northing = 3500000.0;\n break;\n case 'T':\n northing = 4400000.0;\n break;\n case 'U':\n northing = 5300000.0;\n break;\n case 'V':\n northing = 6200000.0;\n break;\n case 'W':\n northing = 7000000.0;\n break;\n case 'X':\n northing = 7900000.0;\n break;\n default:\n northing = -1.0;\n }\n if (northing >= 0.0) {\n return northing;\n }\n else {\n throw (\"Invalid zone letter: \" + zoneLetter);\n }\n\n }\n\n function Point(x, y, z) {\n if (!(this instanceof Point)) {\n return new Point(x, y, z);\n }\n if (Array.isArray(x)) {\n this.x = x[0];\n this.y = x[1];\n this.z = x[2] || 0.0;\n } else if(typeof x === 'object') {\n this.x = x.x;\n this.y = x.y;\n this.z = x.z || 0.0;\n } else if (typeof x === 'string' && typeof y === 'undefined') {\n var coords = x.split(',');\n this.x = parseFloat(coords[0], 10);\n this.y = parseFloat(coords[1], 10);\n this.z = parseFloat(coords[2], 10) || 0.0;\n } else {\n this.x = x;\n this.y = y;\n this.z = z || 0.0;\n }\n console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');\n }\n\n Point.fromMGRS = function(mgrsStr) {\n return new Point(toPoint$1(mgrsStr));\n };\n Point.prototype.toMGRS = function(accuracy) {\n return forward$1([this.x, this.y], accuracy);\n };\n\n var C00 = 1;\n var C02 = 0.25;\n var C04 = 0.046875;\n var C06 = 0.01953125;\n var C08 = 0.01068115234375;\n var C22 = 0.75;\n var C44 = 0.46875;\n var C46 = 0.01302083333333333333;\n var C48 = 0.00712076822916666666;\n var C66 = 0.36458333333333333333;\n var C68 = 0.00569661458333333333;\n var C88 = 0.3076171875;\n\n var pj_enfn = function(es) {\n var en = [];\n en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));\n en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));\n var t = es * es;\n en[2] = t * (C44 - es * (C46 + es * C48));\n t *= es;\n en[3] = t * (C66 - es * C68);\n en[4] = t * es * C88;\n return en;\n };\n\n var pj_mlfn = function(phi, sphi, cphi, en) {\n cphi *= sphi;\n sphi *= sphi;\n return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4]))));\n };\n\n var MAX_ITER = 20;\n\n var pj_inv_mlfn = function(arg, es, en) {\n var k = 1 / (1 - es);\n var phi = arg;\n for (var i = MAX_ITER; i; --i) { /* rarely goes over 2 iterations */\n var s = Math.sin(phi);\n var t = 1 - es * s * s;\n //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;\n //phi -= t * (t * Math.sqrt(t)) * k;\n t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;\n phi -= t;\n if (Math.abs(t) < EPSLN) {\n return phi;\n }\n }\n //..reportError(\"cass:pj_inv_mlfn: Convergence error\");\n return phi;\n };\n\n // Heavily based on this tmerc projection implementation\n // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js\n\n function init$2() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = pj_enfn(this.es);\n this.ml0 = pj_mlfn(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n }\n\n /**\n Transverse Mercator Forward - long/lat to x/y\n long/lat in radians\n */\n function forward$2(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = adjust_lon(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < EPSLN) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > EPSLN) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = pj_mlfn(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n }\n\n /**\n Transverse Mercator Inverse - x/y to long/lat\n */\n function inverse$2(p) {\n var con, phi;\n var lat, lon;\n var x = (p.x - this.x0) * (1 / this.a);\n var y = (p.y - this.y0) * (1 / this.a);\n\n if (!this.es) {\n var f = Math.exp(x / this.k0);\n var g = 0.5 * (f - 1 / f);\n var temp = this.lat0 + y / this.k0;\n var h = Math.cos(temp);\n con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));\n lat = Math.asin(con);\n\n if (y < 0) {\n lat = -lat;\n }\n\n if ((g === 0) && (h === 0)) {\n lon = 0;\n }\n else {\n lon = adjust_lon(Math.atan2(g, h) + this.long0);\n }\n }\n else { // ellipsoidal form\n con = this.ml0 + y / this.k0;\n phi = pj_inv_mlfn(con, this.es, this.en);\n\n if (Math.abs(phi) < HALF_PI) {\n var sin_phi = Math.sin(phi);\n var cos_phi = Math.cos(phi);\n var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0;\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var t = Math.pow(tan_phi, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n var d = x * Math.sqrt(con) / this.k0;\n var ds = Math.pow(d, 2);\n con = con * tan_phi;\n\n lat = phi - (con * ds / (1 - this.es)) * 0.5 * (1 -\n ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs -\n ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c -\n ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));\n\n lon = adjust_lon(this.long0 + (d * (1 -\n ds / 6 * (1 + 2 * t + c -\n ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c -\n ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi));\n }\n else {\n lat = HALF_PI * sign(y);\n lon = 0;\n }\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n }\n\n var names$3 = [\"Fast_Transverse_Mercator\", \"Fast Transverse Mercator\"];\n var tmerc = {\n init: init$2,\n forward: forward$2,\n inverse: inverse$2,\n names: names$3\n };\n\n var sinh = function(x) {\n var r = Math.exp(x);\n r = (r - 1 / r) / 2;\n return r;\n };\n\n var hypot = function(x, y) {\n x = Math.abs(x);\n y = Math.abs(y);\n var a = Math.max(x, y);\n var b = Math.min(x, y) / (a ? a : 1);\n\n return a * Math.sqrt(1 + Math.pow(b, 2));\n };\n\n var log1py = function(x) {\n var y = 1 + x;\n var z = y - 1;\n\n return z === 0 ? x : x * Math.log(y) / z;\n };\n\n var asinhy = function(x) {\n var y = Math.abs(x);\n y = log1py(y * (1 + y / (hypot(1, y) + 1)));\n\n return x < 0 ? -y : y;\n };\n\n var gatg = function(pp, B) {\n var cos_2B = 2 * Math.cos(2 * B);\n var i = pp.length - 1;\n var h1 = pp[i];\n var h2 = 0;\n var h;\n\n while (--i >= 0) {\n h = -h2 + cos_2B * h1 + pp[i];\n h2 = h1;\n h1 = h;\n }\n\n return (B + h * Math.sin(2 * B));\n };\n\n var clens = function(pp, arg_r) {\n var r = 2 * Math.cos(arg_r);\n var i = pp.length - 1;\n var hr1 = pp[i];\n var hr2 = 0;\n var hr;\n\n while (--i >= 0) {\n hr = -hr2 + r * hr1 + pp[i];\n hr2 = hr1;\n hr1 = hr;\n }\n\n return Math.sin(arg_r) * hr;\n };\n\n var cosh = function(x) {\n var r = Math.exp(x);\n r = (r + 1 / r) / 2;\n return r;\n };\n\n var clens_cmplx = function(pp, arg_r, arg_i) {\n var sin_arg_r = Math.sin(arg_r);\n var cos_arg_r = Math.cos(arg_r);\n var sinh_arg_i = sinh(arg_i);\n var cosh_arg_i = cosh(arg_i);\n var r = 2 * cos_arg_r * cosh_arg_i;\n var i = -2 * sin_arg_r * sinh_arg_i;\n var j = pp.length - 1;\n var hr = pp[j];\n var hi1 = 0;\n var hr1 = 0;\n var hi = 0;\n var hr2;\n var hi2;\n\n while (--j >= 0) {\n hr2 = hr1;\n hi2 = hi1;\n hr1 = hr;\n hi1 = hi;\n hr = -hr2 + r * hr1 - i * hi1 + pp[j];\n hi = -hi2 + i * hr1 + r * hi1;\n }\n\n r = sin_arg_r * cosh_arg_i;\n i = cos_arg_r * sinh_arg_i;\n\n return [r * hr - i * hi, r * hi + i * hr];\n };\n\n // Heavily based on this etmerc projection implementation\n // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js\n\n function init$3() {\n if (!this.approx && (isNaN(this.es) || this.es <= 0)) {\n throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION[\"Fast_Transverse_Mercator\"] in the WKT.');\n }\n if (this.approx) {\n // When '+approx' is set, use tmerc instead\n tmerc.init.apply(this);\n this.forward = tmerc.forward;\n this.inverse = tmerc.inverse;\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = gatg(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));\n }\n\n function forward$3(p) {\n var Ce = adjust_lon(p.x - this.long0);\n var Cn = p.y;\n\n Cn = gatg(this.cbg, Cn);\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);\n Ce = Math.atan2(sin_Ce * cos_Cn, hypot(sin_Cn, cos_Cn * cos_Ce));\n Ce = asinhy(Math.tan(Ce));\n\n var tmp = clens_cmplx(this.gtu, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n\n var x;\n var y;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n x = this.a * (this.Qn * Ce) + this.x0;\n y = this.a * (this.Qn * Cn + this.Zb) + this.y0;\n }\n else {\n x = Infinity;\n y = Infinity;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n }\n\n function inverse$3(p) {\n var Ce = (p.x - this.x0) * (1 / this.a);\n var Cn = (p.y - this.y0) * (1 / this.a);\n\n Cn = (Cn - this.Zb) / this.Qn;\n Ce = Ce / this.Qn;\n\n var lon;\n var lat;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n var tmp = clens_cmplx(this.utg, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n Ce = Math.atan(sinh(Ce));\n\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));\n Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);\n\n lon = adjust_lon(Ce + this.long0);\n lat = gatg(this.cgb, Cn);\n }\n else {\n lon = Infinity;\n lat = Infinity;\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n }\n\n var names$4 = [\"Extended_Transverse_Mercator\", \"Extended Transverse Mercator\", \"etmerc\", \"Transverse_Mercator\", \"Transverse Mercator\", \"tmerc\"];\n var etmerc = {\n init: init$3,\n forward: forward$3,\n inverse: inverse$3,\n names: names$4\n };\n\n var adjust_zone = function(zone, lon) {\n if (zone === undefined) {\n zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1;\n\n if (zone < 0) {\n return 0;\n } else if (zone > 60) {\n return 60;\n }\n }\n return zone;\n };\n\n var dependsOn = 'etmerc';\n function init$4() {\n var zone = adjust_zone(this.zone, this.long0);\n if (zone === undefined) {\n throw new Error('unknown utm zone');\n }\n this.lat0 = 0;\n this.long0 = ((6 * Math.abs(zone)) - 183) * D2R;\n this.x0 = 500000;\n this.y0 = this.utmSouth ? 10000000 : 0;\n this.k0 = 0.9996;\n\n etmerc.init.apply(this);\n this.forward = etmerc.forward;\n this.inverse = etmerc.inverse;\n }\n\n var names$5 = [\"Universal Transverse Mercator System\", \"utm\"];\n var utm = {\n init: init$4,\n names: names$5,\n dependsOn: dependsOn\n };\n\n var srat = function(esinp, exp) {\n return (Math.pow((1 - esinp) / (1 + esinp), exp));\n };\n\n var MAX_ITER$1 = 20;\n function init$6() {\n var sphi = Math.sin(this.lat0);\n var cphi = Math.cos(this.lat0);\n cphi *= cphi;\n this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);\n this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));\n this.phic0 = Math.asin(sphi / this.C);\n this.ratexp = 0.5 * this.C * this.e;\n this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat(this.e * sphi, this.ratexp));\n }\n\n function forward$5(p) {\n var lon = p.x;\n var lat = p.y;\n\n p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + FORTPI), this.C) * srat(this.e * Math.sin(lat), this.ratexp)) - HALF_PI;\n p.x = this.C * lon;\n return p;\n }\n\n function inverse$5(p) {\n var DEL_TOL = 1e-14;\n var lon = p.x / this.C;\n var lat = p.y;\n var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C);\n for (var i = MAX_ITER$1; i > 0; --i) {\n lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - HALF_PI;\n if (Math.abs(lat - p.y) < DEL_TOL) {\n break;\n }\n p.y = lat;\n }\n /* convergence failed */\n if (!i) {\n return null;\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$7 = [\"gauss\"];\n var gauss = {\n init: init$6,\n forward: forward$5,\n inverse: inverse$5,\n names: names$7\n };\n\n function init$5() {\n gauss.init.apply(this);\n if (!this.rc) {\n return;\n }\n this.sinc0 = Math.sin(this.phic0);\n this.cosc0 = Math.cos(this.phic0);\n this.R2 = 2 * this.rc;\n if (!this.title) {\n this.title = \"Oblique Stereographic Alternative\";\n }\n }\n\n function forward$4(p) {\n var sinc, cosc, cosl, k;\n p.x = adjust_lon(p.x - this.long0);\n gauss.forward.apply(this, [p]);\n sinc = Math.sin(p.y);\n cosc = Math.cos(p.y);\n cosl = Math.cos(p.x);\n k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);\n p.x = k * cosc * Math.sin(p.x);\n p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);\n p.x = this.a * p.x + this.x0;\n p.y = this.a * p.y + this.y0;\n return p;\n }\n\n function inverse$4(p) {\n var sinc, cosc, lon, lat, rho;\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n if ((rho = Math.sqrt(p.x * p.x + p.y * p.y))) {\n var c = 2 * Math.atan2(rho, this.R2);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);\n lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n gauss.inverse.apply(this, [p]);\n p.x = adjust_lon(p.x + this.long0);\n return p;\n }\n\n var names$6 = [\"Stereographic_North_Pole\", \"Oblique_Stereographic\", \"Polar_Stereographic\", \"sterea\",\"Oblique Stereographic Alternative\",\"Double_Stereographic\"];\n var sterea = {\n init: init$5,\n forward: forward$4,\n inverse: inverse$4,\n names: names$6\n };\n\n function ssfn_(phit, sinphi, eccen) {\n sinphi *= eccen;\n return (Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen));\n }\n\n function init$7() {\n this.coslat0 = Math.cos(this.lat0);\n this.sinlat0 = Math.sin(this.lat0);\n if (this.sphere) {\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {\n this.k0 = 0.5 * (1 + sign(this.lat0) * Math.sin(this.lat_ts));\n }\n }\n else {\n if (Math.abs(this.coslat0) <= EPSLN) {\n if (this.lat0 > 0) {\n //North pole\n //trace('stere:north pole');\n this.con = 1;\n }\n else {\n //South pole\n //trace('stere:south pole');\n this.con = -1;\n }\n }\n this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {\n this.k0 = 0.5 * this.cons * msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / tsfnz(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));\n }\n this.ms1 = msfnz(this.e, this.sinlat0, this.coslat0);\n this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI;\n this.cosX0 = Math.cos(this.X0);\n this.sinX0 = Math.sin(this.X0);\n }\n }\n\n // Stereographic forward equations--mapping lat,long to x,y\n function forward$6(p) {\n var lon = p.x;\n var lat = p.y;\n var sinlat = Math.sin(lat);\n var coslat = Math.cos(lat);\n var A, X, sinX, cosX, ts, rh;\n var dlon = adjust_lon(lon - this.long0);\n\n if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {\n //case of the origine point\n //trace('stere:this is the origin point');\n p.x = NaN;\n p.y = NaN;\n return p;\n }\n if (this.sphere) {\n //trace('stere:sphere case');\n A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));\n p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;\n p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;\n return p;\n }\n else {\n X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI;\n cosX = Math.cos(X);\n sinX = Math.sin(X);\n if (Math.abs(this.coslat0) <= EPSLN) {\n ts = tsfnz(this.e, lat * this.con, this.con * sinlat);\n rh = 2 * this.a * this.k0 * ts / this.cons;\n p.x = this.x0 + rh * Math.sin(lon - this.long0);\n p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);\n //trace(p.toString());\n return p;\n }\n else if (Math.abs(this.sinlat0) < EPSLN) {\n //Eq\n //trace('stere:equateur');\n A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));\n p.y = A * sinX;\n }\n else {\n //other case\n //trace('stere:normal case');\n A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));\n p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;\n }\n p.x = A * cosX * Math.sin(dlon) + this.x0;\n }\n //trace(p.toString());\n return p;\n }\n\n //* Stereographic inverse equations--mapping x,y to lat/long\n function inverse$6(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat, ts, ce, Chi;\n var rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (this.sphere) {\n var c = 2 * Math.atan(rh / (2 * this.a * this.k0));\n lon = this.long0;\n lat = this.lat0;\n if (rh <= EPSLN) {\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);\n if (Math.abs(this.coslat0) < EPSLN) {\n if (this.lat0 > 0) {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));\n }\n }\n else {\n lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n if (Math.abs(this.coslat0) <= EPSLN) {\n if (rh <= EPSLN) {\n lat = this.lat0;\n lon = this.long0;\n p.x = lon;\n p.y = lat;\n //trace(p.toString());\n return p;\n }\n p.x *= this.con;\n p.y *= this.con;\n ts = rh * this.cons / (2 * this.a * this.k0);\n lat = this.con * phi2z(this.e, ts);\n lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));\n lon = this.long0;\n if (rh <= EPSLN) {\n Chi = this.X0;\n }\n else {\n Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);\n lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));\n }\n lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));\n }\n }\n p.x = lon;\n p.y = lat;\n\n //trace(p.toString());\n return p;\n\n }\n\n var names$8 = [\"stere\", \"Stereographic_South_Pole\", \"Polar Stereographic (variant B)\"];\n var stere = {\n init: init$7,\n forward: forward$6,\n inverse: inverse$6,\n names: names$8,\n ssfn_: ssfn_\n };\n\n /*\n references:\n Formules et constantes pour le Calcul pour la\n projection cylindrique conforme à axe oblique et pour la transformation entre\n des systèmes de référence.\n http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf\n */\n\n function init$8() {\n var phy0 = this.lat0;\n this.lambda0 = this.long0;\n var sinPhy0 = Math.sin(phy0);\n var semiMajorAxis = this.a;\n var invF = this.rf;\n var flattening = 1 / invF;\n var e2 = 2 * flattening - Math.pow(flattening, 2);\n var e = this.e = Math.sqrt(e2);\n this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));\n this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));\n this.b0 = Math.asin(sinPhy0 / this.alpha);\n var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));\n var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));\n var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));\n this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;\n }\n\n function forward$7(p) {\n var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));\n var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));\n var S = -this.alpha * (Sa1 + Sa2) + this.K;\n\n // spheric latitude\n var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);\n\n // spheric longitude\n var I = this.alpha * (p.x - this.lambda0);\n\n // psoeudo equatorial rotation\n var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));\n\n var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));\n\n p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;\n p.x = this.R * rotI + this.x0;\n return p;\n }\n\n function inverse$7(p) {\n var Y = p.x - this.x0;\n var X = p.y - this.y0;\n\n var rotI = Y / this.R;\n var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);\n\n var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));\n var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));\n\n var lambda = this.lambda0 + I / this.alpha;\n\n var S = 0;\n var phy = b;\n var prevPhy = -1000;\n var iteration = 0;\n while (Math.abs(phy - prevPhy) > 0.0000001) {\n if (++iteration > 20) {\n //...reportError(\"omercFwdInfinity\");\n return;\n }\n //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));\n S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));\n prevPhy = phy;\n phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;\n }\n\n p.x = lambda;\n p.y = phy;\n return p;\n }\n\n var names$9 = [\"somerc\"];\n var somerc = {\n init: init$8,\n forward: forward$7,\n inverse: inverse$7,\n names: names$9\n };\n\n var TOL = 1e-7;\n\n function isTypeA(P) {\n var typeAProjections = ['Hotine_Oblique_Mercator','Hotine_Oblique_Mercator_Azimuth_Natural_Origin'];\n var projectionName = typeof P.PROJECTION === \"object\" ? Object.keys(P.PROJECTION)[0] : P.PROJECTION;\n \n return 'no_uoff' in P || 'no_off' in P || typeAProjections.indexOf(projectionName) !== -1;\n }\n\n\n /* Initialize the Oblique Mercator projection\n ------------------------------------------*/\n function init$9() { \n var con, com, cosph0, D, F, H, L, sinph0, p, J, gamma = 0,\n gamma0, lamc = 0, lam1 = 0, lam2 = 0, phi1 = 0, phi2 = 0, alpha_c = 0;\n \n // only Type A uses the no_off or no_uoff property\n // https://github.com/OSGeo/proj.4/issues/104\n this.no_off = isTypeA(this);\n this.no_rot = 'no_rot' in this;\n \n var alp = false;\n if (\"alpha\" in this) {\n alp = true;\n }\n\n var gam = false;\n if (\"rectified_grid_angle\" in this) {\n gam = true;\n }\n\n if (alp) {\n alpha_c = this.alpha;\n }\n \n if (gam) {\n gamma = (this.rectified_grid_angle * D2R);\n }\n \n if (alp || gam) {\n lamc = this.longc;\n } else {\n lam1 = this.long1;\n phi1 = this.lat1;\n lam2 = this.long2;\n phi2 = this.lat2;\n \n if (Math.abs(phi1 - phi2) <= TOL || (con = Math.abs(phi1)) <= TOL ||\n Math.abs(con - HALF_PI) <= TOL || Math.abs(Math.abs(this.lat0) - HALF_PI) <= TOL ||\n Math.abs(Math.abs(phi2) - HALF_PI) <= TOL) {\n throw new Error();\n }\n }\n \n var one_es = 1.0 - this.es;\n com = Math.sqrt(one_es);\n \n if (Math.abs(this.lat0) > EPSLN) {\n sinph0 = Math.sin(this.lat0);\n cosph0 = Math.cos(this.lat0);\n con = 1 - this.es * sinph0 * sinph0;\n this.B = cosph0 * cosph0;\n this.B = Math.sqrt(1 + this.es * this.B * this.B / one_es);\n this.A = this.B * this.k0 * com / con;\n D = this.B * com / (cosph0 * Math.sqrt(con));\n F = D * D -1;\n \n if (F <= 0) {\n F = 0;\n } else {\n F = Math.sqrt(F);\n if (this.lat0 < 0) {\n F = -F;\n }\n }\n \n this.E = F += D;\n this.E *= Math.pow(tsfnz(this.e, this.lat0, sinph0), this.B);\n } else {\n this.B = 1 / com;\n this.A = this.k0;\n this.E = D = F = 1;\n }\n \n if (alp || gam) {\n if (alp) {\n gamma0 = Math.asin(Math.sin(alpha_c) / D);\n if (!gam) {\n gamma = alpha_c;\n }\n } else {\n gamma0 = gamma;\n alpha_c = Math.asin(D * Math.sin(gamma0));\n }\n this.lam0 = lamc - Math.asin(0.5 * (F - 1 / F) * Math.tan(gamma0)) / this.B;\n } else {\n H = Math.pow(tsfnz(this.e, phi1, Math.sin(phi1)), this.B);\n L = Math.pow(tsfnz(this.e, phi2, Math.sin(phi2)), this.B);\n F = this.E / H;\n p = (L - H) / (L + H);\n J = this.E * this.E;\n J = (J - L * H) / (J + L * H);\n con = lam1 - lam2;\n \n if (con < -Math.pi) {\n lam2 -=TWO_PI;\n } else if (con > Math.pi) {\n lam2 += TWO_PI;\n }\n \n this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B);\n gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0)) / (F - 1 / F));\n gamma = alpha_c = Math.asin(D * Math.sin(gamma0));\n }\n \n this.singam = Math.sin(gamma0);\n this.cosgam = Math.cos(gamma0);\n this.sinrot = Math.sin(gamma);\n this.cosrot = Math.cos(gamma);\n \n this.rB = 1 / this.B;\n this.ArB = this.A * this.rB;\n this.BrA = 1 / this.ArB;\n if (this.no_off) {\n this.u_0 = 0;\n } else {\n this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(D * D - 1) / Math.cos(alpha_c)));\n \n if (this.lat0 < 0) {\n this.u_0 = - this.u_0;\n } \n }\n \n F = 0.5 * gamma0;\n this.v_pole_n = this.ArB * Math.log(Math.tan(FORTPI - F));\n this.v_pole_s = this.ArB * Math.log(Math.tan(FORTPI + F));\n }\n\n\n /* Oblique Mercator forward equations--mapping lat,long to x,y\n ----------------------------------------------------------*/\n function forward$8(p) {\n var coords = {};\n var S, T, U, V, W, temp, u, v;\n p.x = p.x - this.lam0;\n \n if (Math.abs(Math.abs(p.y) - HALF_PI) > EPSLN) {\n W = this.E / Math.pow(tsfnz(this.e, p.y, Math.sin(p.y)), this.B);\n \n temp = 1 / W;\n S = 0.5 * (W - temp);\n T = 0.5 * (W + temp);\n V = Math.sin(this.B * p.x);\n U = (S * this.singam - V * this.cosgam) / T;\n \n if (Math.abs(Math.abs(U) - 1.0) < EPSLN) {\n throw new Error();\n }\n \n v = 0.5 * this.ArB * Math.log((1 - U)/(1 + U));\n temp = Math.cos(this.B * p.x);\n \n if (Math.abs(temp) < TOL) {\n u = this.A * p.x;\n } else {\n u = this.ArB * Math.atan2((S * this.cosgam + V * this.singam), temp);\n } \n } else {\n v = p.y > 0 ? this.v_pole_n : this.v_pole_s;\n u = this.ArB * p.y;\n }\n \n if (this.no_rot) {\n coords.x = u;\n coords.y = v;\n } else {\n u -= this.u_0;\n coords.x = v * this.cosrot + u * this.sinrot;\n coords.y = u * this.cosrot - v * this.sinrot;\n }\n \n coords.x = (this.a * coords.x + this.x0);\n coords.y = (this.a * coords.y + this.y0);\n \n return coords;\n }\n\n function inverse$8(p) {\n var u, v, Qp, Sp, Tp, Vp, Up;\n var coords = {};\n \n p.x = (p.x - this.x0) * (1.0 / this.a);\n p.y = (p.y - this.y0) * (1.0 / this.a);\n\n if (this.no_rot) {\n v = p.y;\n u = p.x;\n } else {\n v = p.x * this.cosrot - p.y * this.sinrot;\n u = p.y * this.cosrot + p.x * this.sinrot + this.u_0;\n }\n \n Qp = Math.exp(-this.BrA * v);\n Sp = 0.5 * (Qp - 1 / Qp);\n Tp = 0.5 * (Qp + 1 / Qp);\n Vp = Math.sin(this.BrA * u);\n Up = (Vp * this.cosgam + Sp * this.singam) / Tp;\n \n if (Math.abs(Math.abs(Up) - 1) < EPSLN) {\n coords.x = 0;\n coords.y = Up < 0 ? -HALF_PI : HALF_PI;\n } else {\n coords.y = this.E / Math.sqrt((1 + Up) / (1 - Up));\n coords.y = phi2z(this.e, Math.pow(coords.y, 1 / this.B));\n \n if (coords.y === Infinity) {\n throw new Error();\n }\n \n coords.x = -this.rB * Math.atan2((Sp * this.cosgam - Vp * this.singam), Math.cos(this.BrA * u));\n }\n \n coords.x += this.lam0;\n \n return coords;\n }\n\n var names$10 = [\"Hotine_Oblique_Mercator\", \"Hotine Oblique Mercator\", \"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\", \"Hotine_Oblique_Mercator_Two_Point_Natural_Origin\", \"Hotine_Oblique_Mercator_Azimuth_Center\", \"Oblique_Mercator\", \"omerc\"];\n var omerc = {\n init: init$9,\n forward: forward$8,\n inverse: inverse$8,\n names: names$10\n };\n\n function init$10() {\n \n //double lat0; /* the reference latitude */\n //double long0; /* the reference longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n \n //the above value can be set with proj4.defs\n //example: proj4.defs(\"EPSG:2154\",\"+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\");\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < EPSLN) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = msfnz(this.e, sin1, cos1);\n var ts1 = tsfnz(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = msfnz(this.e, sin2, cos2);\n var ts2 = tsfnz(this.e, this.lat2, sin2);\n\n var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > EPSLN) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n }\n\n // Lambert Conformal conic forward equations--mapping lat,long to x,y\n // -----------------------------------------------------------------\n function forward$9(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n // singular cases :\n if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) {\n lat = sign(lat) * (HALF_PI - 2 * EPSLN);\n }\n\n var con = Math.abs(Math.abs(lat) - HALF_PI);\n var ts, rh1;\n if (con > EPSLN) {\n ts = tsfnz(this.e, lat, Math.sin(lat));\n rh1 = this.a * this.f0 * Math.pow(ts, this.ns);\n }\n else {\n con = lat * this.ns;\n if (con <= 0) {\n return null;\n }\n rh1 = 0;\n }\n var theta = this.ns * adjust_lon(lon - this.long0);\n p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;\n p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;\n\n return p;\n }\n\n // Lambert Conformal Conic inverse equations--mapping x,y to lat/long\n // -----------------------------------------------------------------\n function inverse$9(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = phi2z(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -HALF_PI;\n }\n lon = adjust_lon(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$11 = [\n \"Lambert Tangential Conformal Conic Projection\",\n \"Lambert_Conformal_Conic\",\n \"Lambert_Conformal_Conic_1SP\",\n \"Lambert_Conformal_Conic_2SP\",\n \"lcc\"\n ];\n\n var lcc = {\n init: init$10,\n forward: forward$9,\n inverse: inverse$9,\n names: names$11\n };\n\n function init$11() {\n this.a = 6377397.155;\n this.es = 0.006674372230614;\n this.e = Math.sqrt(this.es);\n if (!this.lat0) {\n this.lat0 = 0.863937979737193;\n }\n if (!this.long0) {\n this.long0 = 0.7417649320975901 - 0.308341501185665;\n }\n /* if scale not set default to 0.9999 */\n if (!this.k0) {\n this.k0 = 0.9999;\n }\n this.s45 = 0.785398163397448; /* 45 */\n this.s90 = 2 * this.s45;\n this.fi0 = this.lat0;\n this.e2 = this.es;\n this.e = Math.sqrt(this.e2);\n this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2));\n this.uq = 1.04216856380474;\n this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);\n this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);\n this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;\n this.k1 = this.k0;\n this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));\n this.s0 = 1.37008346281555;\n this.n = Math.sin(this.s0);\n this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);\n this.ad = this.s90 - this.uq;\n }\n\n /* ellipsoid */\n /* calculate xy from lat/lon */\n /* Constants, identical to inverse transform function */\n function forward$10(p) {\n var gfi, u, deltav, s, d, eps, ro;\n var lon = p.x;\n var lat = p.y;\n var delta_lon = adjust_lon(lon - this.long0);\n /* Transformation */\n gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));\n u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);\n deltav = -delta_lon * this.alfa;\n s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));\n d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));\n eps = this.n * d;\n ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);\n p.y = ro * Math.cos(eps) / 1;\n p.x = ro * Math.sin(eps) / 1;\n\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n return (p);\n }\n\n /* calculate lat/lon from xy */\n function inverse$10(p) {\n var u, deltav, s, d, eps, ro, fi1;\n var ok;\n\n /* Transformation */\n /* revert y, x*/\n var tmp = p.x;\n p.x = p.y;\n p.y = tmp;\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n ro = Math.sqrt(p.x * p.x + p.y * p.y);\n eps = Math.atan2(p.y, p.x);\n d = eps / Math.sin(this.s0);\n s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);\n u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));\n deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));\n p.x = this.long0 - deltav / this.alfa;\n fi1 = u;\n ok = 0;\n var iter = 0;\n do {\n p.y = 2 * (Math.atan(Math.pow(this.k, - 1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);\n if (Math.abs(fi1 - p.y) < 0.0000000001) {\n ok = 1;\n }\n fi1 = p.y;\n iter += 1;\n } while (ok === 0 && iter < 15);\n if (iter >= 15) {\n return null;\n }\n\n return (p);\n }\n\n var names$12 = [\"Krovak\", \"krovak\"];\n var krovak = {\n init: init$11,\n forward: forward$10,\n inverse: inverse$10,\n names: names$12\n };\n\n var mlfn = function(e0, e1, e2, e3, phi) {\n return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi));\n };\n\n var e0fn = function(x) {\n return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x)));\n };\n\n var e1fn = function(x) {\n return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x)));\n };\n\n var e2fn = function(x) {\n return (0.05859375 * x * x * (1 + 0.75 * x));\n };\n\n var e3fn = function(x) {\n return (x * x * x * (35 / 3072));\n };\n\n var gN = function(a, e, sinphi) {\n var temp = e * sinphi;\n return a / Math.sqrt(1 - temp * temp);\n };\n\n var adjust_lat = function(x) {\n return (Math.abs(x) < HALF_PI) ? x : (x - (sign(x) * Math.PI));\n };\n\n var imlfn = function(ml, e0, e1, e2, e3) {\n var phi;\n var dphi;\n\n phi = ml / e0;\n for (var i = 0; i < 15; i++) {\n dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //..reportError(\"IMLFN-CONV:Latitude failed to converge after 15 iterations\");\n return NaN;\n };\n\n function init$12() {\n if (!this.sphere) {\n this.e0 = e0fn(this.es);\n this.e1 = e1fn(this.es);\n this.e2 = e2fn(this.es);\n this.e3 = e3fn(this.es);\n this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);\n }\n }\n\n /* Cassini forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\n function forward$11(p) {\n\n /* Forward equations\n -----------------*/\n var x, y;\n var lam = p.x;\n var phi = p.y;\n lam = adjust_lon(lam - this.long0);\n\n if (this.sphere) {\n x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));\n y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);\n }\n else {\n //ellipsoid\n var sinphi = Math.sin(phi);\n var cosphi = Math.cos(phi);\n var nl = gN(this.a, this.e, sinphi);\n var tl = Math.tan(phi) * Math.tan(phi);\n var al = lam * Math.cos(phi);\n var asq = al * al;\n var cl = this.es * cosphi * cosphi / (1 - this.es);\n var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);\n\n x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));\n y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);\n\n\n }\n\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$11(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var phi, lam;\n\n if (this.sphere) {\n var dd = y + this.lat0;\n phi = Math.asin(Math.sin(dd) * Math.cos(x));\n lam = Math.atan2(Math.tan(x), Math.cos(dd));\n }\n else {\n /* ellipsoid */\n var ml1 = this.ml0 / this.a + y;\n var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3);\n if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) {\n p.x = this.long0;\n p.y = HALF_PI;\n if (y < 0) {\n p.y *= -1;\n }\n return p;\n }\n var nl1 = gN(this.a, this.e, Math.sin(phi1));\n\n var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);\n var tl1 = Math.pow(Math.tan(phi1), 2);\n var dl = x * this.a / nl1;\n var dsq = dl * dl;\n phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);\n lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);\n\n }\n\n p.x = adjust_lon(lam + this.long0);\n p.y = adjust_lat(phi);\n return p;\n\n }\n\n var names$13 = [\"Cassini\", \"Cassini_Soldner\", \"cass\"];\n var cass = {\n init: init$12,\n forward: forward$11,\n inverse: inverse$11,\n names: names$13\n };\n\n var qsfnz = function(eccent, sinphi) {\n var con;\n if (eccent > 1.0e-7) {\n con = eccent * sinphi;\n return ((1 - eccent * eccent) * (sinphi / (1 - con * con) - (0.5 / eccent) * Math.log((1 - con) / (1 + con))));\n }\n else {\n return (2 * sinphi);\n }\n };\n\n /*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\n var S_POLE = 1;\n\n var N_POLE = 2;\n var EQUIT = 3;\n var OBLIQ = 4;\n\n /* Initialize the Lambert Azimuthal Equal Area projection\n ------------------------------------------------------*/\n function init$13() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - HALF_PI) < EPSLN) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < EPSLN) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = qsfnz(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = qsfnz(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n }\n\n /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\n function forward$12(p) {\n\n /* Forward equations\n -----------------*/\n var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;\n var lam = p.x;\n var phi = p.y;\n\n lam = adjust_lon(lam - this.long0);\n if (this.sphere) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n coslam = Math.cos(lam);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n y = (this.mode === this.EQUIT) ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n if (y <= EPSLN) {\n return null;\n }\n y = Math.sqrt(2 / y);\n x = y * cosphi * Math.sin(lam);\n y *= (this.mode === this.EQUIT) ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n coslam = -coslam;\n }\n if (Math.abs(phi + this.lat0) < EPSLN) {\n return null;\n }\n y = FORTPI - phi * 0.5;\n y = 2 * ((this.mode === this.S_POLE) ? Math.cos(y) : Math.sin(y));\n x = y * Math.sin(lam);\n y *= coslam;\n }\n }\n else {\n sinb = 0;\n cosb = 0;\n b = 0;\n coslam = Math.cos(lam);\n sinlam = Math.sin(lam);\n sinphi = Math.sin(phi);\n q = qsfnz(this.e, sinphi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinb = q / this.qp;\n cosb = Math.sqrt(1 - sinb * sinb);\n }\n switch (this.mode) {\n case this.OBLIQ:\n b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;\n break;\n case this.EQUIT:\n b = 1 + cosb * coslam;\n break;\n case this.N_POLE:\n b = HALF_PI + phi;\n q = this.qp - q;\n break;\n case this.S_POLE:\n b = phi - HALF_PI;\n q = this.qp + q;\n break;\n }\n if (Math.abs(b) < EPSLN) {\n return null;\n }\n switch (this.mode) {\n case this.OBLIQ:\n case this.EQUIT:\n b = Math.sqrt(2 / b);\n if (this.mode === this.OBLIQ) {\n y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);\n }\n else {\n y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;\n }\n x = this.xmf * b * cosb * sinlam;\n break;\n case this.N_POLE:\n case this.S_POLE:\n if (q >= 0) {\n x = (b = Math.sqrt(q)) * sinlam;\n y = coslam * ((this.mode === this.S_POLE) ? b : -b);\n }\n else {\n x = y = 0;\n }\n break;\n }\n }\n\n p.x = this.a * x + this.x0;\n p.y = this.a * y + this.y0;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$12(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var lam, phi, cCe, sCe, q, rho, ab;\n if (this.sphere) {\n var cosz = 0,\n rh, sinz = 0;\n\n rh = Math.sqrt(x * x + y * y);\n phi = rh * 0.5;\n if (phi > 1) {\n return null;\n }\n phi = 2 * Math.asin(phi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinz = Math.sin(phi);\n cosz = Math.cos(phi);\n }\n switch (this.mode) {\n case this.EQUIT:\n phi = (Math.abs(rh) <= EPSLN) ? 0 : Math.asin(y * sinz / rh);\n x *= sinz;\n y = cosz * rh;\n break;\n case this.OBLIQ:\n phi = (Math.abs(rh) <= EPSLN) ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);\n x *= sinz * this.cosph0;\n y = (cosz - Math.sin(phi) * this.sinph0) * rh;\n break;\n case this.N_POLE:\n y = -y;\n phi = HALF_PI - phi;\n break;\n case this.S_POLE:\n phi -= HALF_PI;\n break;\n }\n lam = (y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ)) ? 0 : Math.atan2(x, y);\n }\n else {\n ab = 0;\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n x /= this.dd;\n y *= this.dd;\n rho = Math.sqrt(x * x + y * y);\n if (rho < EPSLN) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n sCe = 2 * Math.asin(0.5 * rho / this.rq);\n cCe = Math.cos(sCe);\n x *= (sCe = Math.sin(sCe));\n if (this.mode === this.OBLIQ) {\n ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;\n q = this.qp * ab;\n y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;\n }\n else {\n ab = y * sCe / rho;\n q = this.qp * ab;\n y = rho * cCe;\n }\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n y = -y;\n }\n q = (x * x + y * y);\n if (!q) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n ab = 1 - q / this.qp;\n if (this.mode === this.S_POLE) {\n ab = -ab;\n }\n }\n lam = Math.atan2(x, y);\n phi = authlat(Math.asin(ab), this.apa);\n }\n\n p.x = adjust_lon(this.long0 + lam);\n p.y = phi;\n return p;\n }\n\n /* determine latitude from authalic latitude */\n var P00 = 0.33333333333333333333;\n\n var P01 = 0.17222222222222222222;\n var P02 = 0.10257936507936507936;\n var P10 = 0.06388888888888888888;\n var P11 = 0.06640211640211640211;\n var P20 = 0.01641501294219154443;\n\n function authset(es) {\n var t;\n var APA = [];\n APA[0] = es * P00;\n t = es * es;\n APA[0] += t * P01;\n APA[1] = t * P10;\n t *= es;\n APA[0] += t * P02;\n APA[1] += t * P11;\n APA[2] = t * P20;\n return APA;\n }\n\n function authlat(beta, APA) {\n var t = beta + beta;\n return (beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t));\n }\n\n var names$14 = [\"Lambert Azimuthal Equal Area\", \"Lambert_Azimuthal_Equal_Area\", \"laea\"];\n var laea = {\n init: init$13,\n forward: forward$12,\n inverse: inverse$12,\n names: names$14,\n S_POLE: S_POLE,\n N_POLE: N_POLE,\n EQUIT: EQUIT,\n OBLIQ: OBLIQ\n };\n\n var asinz = function(x) {\n if (Math.abs(x) > 1) {\n x = (x > 1) ? 1 : -1;\n }\n return Math.asin(x);\n };\n\n function init$14() {\n\n if (Math.abs(this.lat1 + this.lat2) < EPSLN) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po);\n this.qs1 = qsfnz(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po);\n this.qs2 = qsfnz(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = qsfnz(this.e3, this.sin_po, this.cos_po);\n\n if (Math.abs(this.lat1 - this.lat2) > EPSLN) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n }\n\n /* Albers Conical Equal Area forward equations--mapping lat,long to x,y\n -------------------------------------------------------------------*/\n function forward$13(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n this.sin_phi = Math.sin(lat);\n this.cos_phi = Math.cos(lat);\n\n var qs = qsfnz(this.e3, this.sin_phi, this.cos_phi);\n var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;\n var theta = this.ns0 * adjust_lon(lon - this.long0);\n var x = rh1 * Math.sin(theta) + this.x0;\n var y = this.rh - rh1 * Math.cos(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$13(p) {\n var rh1, qs, con, theta, lon, lat;\n\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n if (this.ns0 >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n con = rh1 * this.ns0 / this.a;\n if (this.sphere) {\n lat = Math.asin((this.c - con * con) / (2 * this.ns0));\n }\n else {\n qs = (this.c - con * con) / this.ns0;\n lat = this.phi1z(this.e3, qs);\n }\n\n lon = adjust_lon(theta / this.ns0 + this.long0);\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n /* Function to compute phi1, the latitude for the inverse of the\n Albers Conical Equal-Area projection.\n -------------------------------------------*/\n function phi1z(eccent, qs) {\n var sinphi, cosphi, con, com, dphi;\n var phi = asinz(0.5 * qs);\n if (eccent < EPSLN) {\n return phi;\n }\n\n var eccnts = eccent * eccent;\n for (var i = 1; i <= 25; i++) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n con = eccent * sinphi;\n com = 1 - con * con;\n dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi = phi + dphi;\n if (Math.abs(dphi) <= 1e-7) {\n return phi;\n }\n }\n return null;\n }\n\n var names$15 = [\"Albers_Conic_Equal_Area\", \"Albers\", \"aea\"];\n var aea = {\n init: init$14,\n forward: forward$13,\n inverse: inverse$13,\n names: names$15,\n phi1z: phi1z\n };\n\n /*\n reference:\n Wolfram Mathworld \"Gnomonic Projection\"\n http://mathworld.wolfram.com/GnomonicProjection.html\n Accessed: 12th November 2009\n */\n function init$15() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n }\n\n /* Gnomonic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\n function forward$14(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g;\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = adjust_lon(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= EPSLN)) {\n x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;\n }\n else {\n\n // Point is in the opposing hemisphere and is unprojectable\n // We still need to return a reasonable point, so we project\n // to infinity, on a bearing\n // equivalent to the northern hemisphere equivalent\n // This is a reasonable approximation for short shapes and lines that\n // straddle the horizon.\n\n x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);\n y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n\n }\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$14(p) {\n var rh; /* Rho */\n var sinc, cosc;\n var c;\n var lon, lat;\n\n /* Inverse equations\n -----------------*/\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n\n if ((rh = Math.sqrt(p.x * p.x + p.y * p.y))) {\n c = Math.atan2(rh, this.rc);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n\n lat = asinz(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh);\n lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);\n lon = adjust_lon(this.long0 + lon);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$16 = [\"gnom\"];\n var gnom = {\n init: init$15,\n forward: forward$14,\n inverse: inverse$14,\n names: names$16\n };\n\n var iqsfnz = function(eccent, q) {\n var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));\n if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {\n if (q < 0) {\n return (-1 * HALF_PI);\n }\n else {\n return HALF_PI;\n }\n }\n //var phi = 0.5* q/(1-eccent*eccent);\n var phi = Math.asin(0.5 * q);\n var dphi;\n var sin_phi;\n var cos_phi;\n var con;\n for (var i = 0; i < 30; i++) {\n sin_phi = Math.sin(phi);\n cos_phi = Math.cos(phi);\n con = eccent * sin_phi;\n dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //console.log(\"IQSFN-CONV:Latitude failed to converge after 30 iterations\");\n return NaN;\n };\n\n /*\n reference:\n \"Cartographic Projection Procedures for the UNIX Environment-\n A User's Manual\" by Gerald I. Evenden,\n USGS Open File Report 90-284and Release 4 Interim Reports (2003)\n */\n function init$16() {\n //no-op\n if (!this.sphere) {\n this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n\n /* Cylindrical Equal Area forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\n function forward$15(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y;\n /* Forward equations\n -----------------*/\n var dlon = adjust_lon(lon - this.long0);\n if (this.sphere) {\n x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);\n y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);\n }\n else {\n var qs = qsfnz(this.e, Math.sin(lat));\n x = this.x0 + this.a * this.k0 * dlon;\n y = this.y0 + this.a * qs * 0.5 / this.k0;\n }\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\n function inverse$15(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);\n lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$17 = [\"cea\"];\n var cea = {\n init: init$16,\n forward: forward$15,\n inverse: inverse$15,\n names: names$17\n };\n\n function init$17() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Equidistant Cylindrical (Plate Carre)\";\n\n this.rc = Math.cos(this.lat_ts);\n }\n\n // forward equations--mapping lat,long to x,y\n // -----------------------------------------------------------------\n function forward$16(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n var dlon = adjust_lon(lon - this.long0);\n var dlat = adjust_lat(lat - this.lat0);\n p.x = this.x0 + (this.a * dlon * this.rc);\n p.y = this.y0 + (this.a * dlat);\n return p;\n }\n\n // inverse equations--mapping x,y to lat/long\n // -----------------------------------------------------------------\n function inverse$16(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n }\n\n var names$18 = [\"Equirectangular\", \"Equidistant_Cylindrical\", \"eqc\"];\n var eqc = {\n init: init$17,\n forward: forward$16,\n inverse: inverse$16,\n names: names$18\n };\n\n var MAX_ITER$2 = 20;\n\n function init$18() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles\n this.e = Math.sqrt(this.es);\n this.e0 = e0fn(this.es);\n this.e1 = e1fn(this.es);\n this.e2 = e2fn(this.es);\n this.e3 = e3fn(this.es);\n this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas\n }\n\n /* Polyconic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\n function forward$17(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y, el;\n var dlon = adjust_lon(lon - this.long0);\n el = dlon * Math.sin(lat);\n if (this.sphere) {\n if (Math.abs(lat) <= EPSLN) {\n x = this.a * dlon;\n y = -1 * this.a * this.lat0;\n }\n else {\n x = this.a * Math.sin(el) / Math.tan(lat);\n y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));\n }\n }\n else {\n if (Math.abs(lat) <= EPSLN) {\n x = this.a * dlon;\n y = -1 * this.ml0;\n }\n else {\n var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat);\n x = nl * Math.sin(el);\n y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));\n }\n\n }\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$17(p) {\n var lon, lat, x, y, i;\n var al, bl;\n var phi, dphi;\n x = p.x - this.x0;\n y = p.y - this.y0;\n\n if (this.sphere) {\n if (Math.abs(y + this.a * this.lat0) <= EPSLN) {\n lon = adjust_lon(x / this.a + this.long0);\n lat = 0;\n }\n else {\n al = this.lat0 + y / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var tanphi;\n for (i = MAX_ITER$2; i; --i) {\n tanphi = Math.tan(phi);\n dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);\n phi += dphi;\n if (Math.abs(dphi) <= EPSLN) {\n lat = phi;\n break;\n }\n }\n lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat));\n }\n }\n else {\n if (Math.abs(y + this.ml0) <= EPSLN) {\n lat = 0;\n lon = adjust_lon(this.long0 + x / this.a);\n }\n else {\n\n al = (this.ml0 + y) / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var cl, mln, mlnp, ma;\n var con;\n for (i = MAX_ITER$2; i; --i) {\n con = this.e * Math.sin(phi);\n cl = Math.sqrt(1 - con * con) * Math.tan(phi);\n mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);\n mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);\n ma = mln / this.a;\n dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);\n phi -= dphi;\n if (Math.abs(dphi) <= EPSLN) {\n lat = phi;\n break;\n }\n }\n\n //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);\n cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);\n lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$19 = [\"Polyconic\", \"poly\"];\n var poly = {\n init: init$18,\n forward: forward$17,\n inverse: inverse$17,\n names: names$19\n };\n\n /*\n reference\n Department of Land and Survey Technical Circular 1973/32\n http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf\n OSG Technical Report 4.1\n http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf\n */\n\n /**\n * iterations: Number of iterations to refine inverse transform.\n * 0 -> km accuracy\n * 1 -> m accuracy -- suitable for most mapping applications\n * 2 -> mm accuracy\n */\n\n\n function init$19() {\n this.A = [];\n this.A[1] = 0.6399175073;\n this.A[2] = -0.1358797613;\n this.A[3] = 0.063294409;\n this.A[4] = -0.02526853;\n this.A[5] = 0.0117879;\n this.A[6] = -0.0055161;\n this.A[7] = 0.0026906;\n this.A[8] = -0.001333;\n this.A[9] = 0.00067;\n this.A[10] = -0.00034;\n\n this.B_re = [];\n this.B_im = [];\n this.B_re[1] = 0.7557853228;\n this.B_im[1] = 0;\n this.B_re[2] = 0.249204646;\n this.B_im[2] = 0.003371507;\n this.B_re[3] = -0.001541739;\n this.B_im[3] = 0.041058560;\n this.B_re[4] = -0.10162907;\n this.B_im[4] = 0.01727609;\n this.B_re[5] = -0.26623489;\n this.B_im[5] = -0.36249218;\n this.B_re[6] = -0.6870983;\n this.B_im[6] = -1.1651967;\n\n this.C_re = [];\n this.C_im = [];\n this.C_re[1] = 1.3231270439;\n this.C_im[1] = 0;\n this.C_re[2] = -0.577245789;\n this.C_im[2] = -0.007809598;\n this.C_re[3] = 0.508307513;\n this.C_im[3] = -0.112208952;\n this.C_re[4] = -0.15094762;\n this.C_im[4] = 0.18200602;\n this.C_re[5] = 1.01418179;\n this.C_im[5] = 1.64497696;\n this.C_re[6] = 1.9660549;\n this.C_im[6] = 2.5127645;\n\n this.D = [];\n this.D[1] = 1.5627014243;\n this.D[2] = 0.5185406398;\n this.D[3] = -0.03333098;\n this.D[4] = -0.1052906;\n this.D[5] = -0.0368594;\n this.D[6] = 0.007317;\n this.D[7] = 0.01220;\n this.D[8] = 0.00394;\n this.D[9] = -0.0013;\n }\n\n /**\n New Zealand Map Grid Forward - long/lat to x/y\n long/lat in radians\n */\n function forward$18(p) {\n var n;\n var lon = p.x;\n var lat = p.y;\n\n var delta_lat = lat - this.lat0;\n var delta_lon = lon - this.long0;\n\n // 1. Calculate d_phi and d_psi ... // and d_lambda\n // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.\n var d_phi = delta_lat / SEC_TO_RAD * 1E-5;\n var d_lambda = delta_lon;\n var d_phi_n = 1; // d_phi^0\n\n var d_psi = 0;\n for (n = 1; n <= 10; n++) {\n d_phi_n = d_phi_n * d_phi;\n d_psi = d_psi + this.A[n] * d_phi_n;\n }\n\n // 2. Calculate theta\n var th_re = d_psi;\n var th_im = d_lambda;\n\n // 3. Calculate z\n var th_n_re = 1;\n var th_n_im = 0; // theta^0\n var th_n_re1;\n var th_n_im1;\n\n var z_re = 0;\n var z_im = 0;\n for (n = 1; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;\n z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;\n }\n\n // 4. Calculate easting and northing\n p.x = (z_im * this.a) + this.x0;\n p.y = (z_re * this.a) + this.y0;\n\n return p;\n }\n\n /**\n New Zealand Map Grid Inverse - x/y to long/lat\n */\n function inverse$18(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * SEC_TO_RAD * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n }\n\n var names$20 = [\"New_Zealand_Map_Grid\", \"nzmg\"];\n var nzmg = {\n init: init$19,\n forward: forward$18,\n inverse: inverse$18,\n names: names$20\n };\n\n /*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\n\n /* Initialize the Miller Cylindrical projection\n -------------------------------------------*/\n function init$20() {\n //no-op\n }\n\n /* Miller Cylindrical forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\n function forward$19(p) {\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n var dlon = adjust_lon(lon - this.long0);\n var x = this.x0 + this.a * dlon;\n var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25;\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Miller Cylindrical inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\n function inverse$19(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = adjust_lon(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$21 = [\"Miller_Cylindrical\", \"mill\"];\n var mill = {\n init: init$20,\n forward: forward$19,\n inverse: inverse$19,\n names: names$21\n };\n\n var MAX_ITER$3 = 20;\n function init$21() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n\n\n if (!this.sphere) {\n this.en = pj_enfn(this.es);\n }\n else {\n this.n = 1;\n this.m = 0;\n this.es = 0;\n this.C_y = Math.sqrt((this.m + 1) / this.n);\n this.C_x = this.C_y / (this.m + 1);\n }\n\n }\n\n /* Sinusoidal forward equations--mapping lat,long to x,y\n -----------------------------------------------------*/\n function forward$20(p) {\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n lon = adjust_lon(lon - this.long0);\n\n if (this.sphere) {\n if (!this.m) {\n lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;\n }\n else {\n var k = this.n * Math.sin(lat);\n for (var i = MAX_ITER$3; i; --i) {\n var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));\n lat -= V;\n if (Math.abs(V) < EPSLN) {\n break;\n }\n }\n }\n x = this.a * this.C_x * lon * (this.m + Math.cos(lat));\n y = this.a * this.C_y * lat;\n\n }\n else {\n\n var s = Math.sin(lat);\n var c = Math.cos(lat);\n y = this.a * pj_mlfn(lat, s, c, this.en);\n x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);\n }\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$20(p) {\n var lat, temp, lon, s;\n\n p.x -= this.x0;\n lon = p.x / this.a;\n p.y -= this.y0;\n lat = p.y / this.a;\n\n if (this.sphere) {\n lat /= this.C_y;\n lon = lon / (this.C_x * (this.m + Math.cos(lat)));\n if (this.m) {\n lat = asinz((this.m * lat + Math.sin(lat)) / this.n);\n }\n else if (this.n !== 1) {\n lat = asinz(Math.sin(lat) / this.n);\n }\n lon = adjust_lon(lon + this.long0);\n lat = adjust_lat(lat);\n }\n else {\n lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);\n s = Math.abs(lat);\n if (s < HALF_PI) {\n s = Math.sin(lat);\n temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));\n //temp = this.long0 + p.x / (this.a * Math.cos(lat));\n lon = adjust_lon(temp);\n }\n else if ((s - EPSLN) < HALF_PI) {\n lon = this.long0;\n }\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$22 = [\"Sinusoidal\", \"sinu\"];\n var sinu = {\n init: init$21,\n forward: forward$20,\n inverse: inverse$20,\n names: names$22\n };\n\n function init$22() {}\n /* Mollweide forward equations--mapping lat,long to x,y\n ----------------------------------------------------*/\n function forward$21(p) {\n\n /* Forward equations\n -----------------*/\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = adjust_lon(lon - this.long0);\n var theta = lat;\n var con = Math.PI * Math.sin(lat);\n\n /* Iterate using the Newton-Raphson method to find theta\n -----------------------------------------------------*/\n while (true) {\n var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));\n theta += delta_theta;\n if (Math.abs(delta_theta) < EPSLN) {\n break;\n }\n }\n theta /= 2;\n\n /* If the latitude is 90 deg, force the x coordinate to be \"0 + false easting\"\n this is done here because of precision problems with \"cos(theta)\"\n --------------------------------------------------------------------------*/\n if (Math.PI / 2 - Math.abs(lat) < EPSLN) {\n delta_lon = 0;\n }\n var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;\n var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$21(p) {\n var theta;\n var arg;\n\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n arg = p.y / (1.4142135623731 * this.a);\n\n /* Because of division by zero problems, 'arg' can not be 1. Therefore\n a number very close to one is used instead.\n -------------------------------------------------------------------*/\n if (Math.abs(arg) > 0.999999999999) {\n arg = 0.999999999999;\n }\n theta = Math.asin(arg);\n var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));\n if (lon < (-Math.PI)) {\n lon = -Math.PI;\n }\n if (lon > Math.PI) {\n lon = Math.PI;\n }\n arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;\n if (Math.abs(arg) > 1) {\n arg = 1;\n }\n var lat = Math.asin(arg);\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$23 = [\"Mollweide\", \"moll\"];\n var moll = {\n init: init$22,\n forward: forward$21,\n inverse: inverse$21,\n names: names$23\n };\n\n function init$23() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < EPSLN) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = e0fn(this.es);\n this.e1 = e1fn(this.es);\n this.e2 = e2fn(this.es);\n this.e3 = e3fn(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = msfnz(this.e, this.sinphi, this.cosphi);\n this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < EPSLN) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = msfnz(this.e, this.sinphi, this.cosphi);\n this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n }\n\n /* Equidistant Conic forward equations--mapping lat,long to x,y\n -----------------------------------------------------------*/\n function forward$22(p) {\n var lon = p.x;\n var lat = p.y;\n var rh1;\n\n /* Forward equations\n -----------------*/\n if (this.sphere) {\n rh1 = this.a * (this.g - lat);\n }\n else {\n var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);\n rh1 = this.a * (this.g - ml);\n }\n var theta = this.ns * adjust_lon(lon - this.long0);\n var x = this.x0 + rh1 * Math.sin(theta);\n var y = this.y0 + this.rh - rh1 * Math.cos(theta);\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$22(p) {\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n var con, rh1, lat, lon;\n if (this.ns >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n\n if (this.sphere) {\n lon = adjust_lon(this.long0 + theta / this.ns);\n lat = adjust_lat(this.g - rh1 / this.a);\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n var ml = this.g - rh1 / this.a;\n lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);\n lon = adjust_lon(this.long0 + theta / this.ns);\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n }\n\n var names$24 = [\"Equidistant_Conic\", \"eqdc\"];\n var eqdc = {\n init: init$23,\n forward: forward$22,\n inverse: inverse$22,\n names: names$24\n };\n\n /* Initialize the Van Der Grinten projection\n ----------------------------------------*/\n function init$24() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n }\n\n function forward$23(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n /* Forward equations\n -----------------*/\n var dlon = adjust_lon(lon - this.long0);\n var x, y;\n\n if (Math.abs(lat) <= EPSLN) {\n x = this.x0 + this.R * dlon;\n y = this.y0;\n }\n var theta = asinz(2 * Math.abs(lat / Math.PI));\n if ((Math.abs(dlon) <= EPSLN) || (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN)) {\n x = this.x0;\n if (lat >= 0) {\n y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);\n }\n else {\n y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);\n }\n // return(OK);\n }\n var al = 0.5 * Math.abs((Math.PI / dlon) - (dlon / Math.PI));\n var asq = al * al;\n var sinth = Math.sin(theta);\n var costh = Math.cos(theta);\n\n var g = costh / (sinth + costh - 1);\n var gsq = g * g;\n var m = g * (2 / sinth - 1);\n var msq = m * m;\n var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);\n if (dlon < 0) {\n con = -con;\n }\n x = this.x0 + con;\n //con = Math.abs(con / (Math.PI * this.R));\n var q = asq + g;\n con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);\n if (lat >= 0) {\n //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 + con;\n }\n else {\n //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 - con;\n }\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Van Der Grinten inverse equations--mapping x,y to lat/long\n ---------------------------------------------------------*/\n function inverse$23(p) {\n var lon, lat;\n var xx, yy, xys, c1, c2, c3;\n var a1;\n var m1;\n var con;\n var th1;\n var d;\n\n /* inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n con = Math.PI * this.R;\n xx = p.x / con;\n yy = p.y / con;\n xys = xx * xx + yy * yy;\n c1 = -Math.abs(yy) * (1 + xys);\n c2 = c1 - 2 * yy * yy + xx * xx;\n c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;\n d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;\n a1 = (c1 - c2 * c2 / 3 / c3) / c3;\n m1 = 2 * Math.sqrt(-a1 / 3);\n con = ((3 * d) / a1) / m1;\n if (Math.abs(con) > 1) {\n if (con >= 0) {\n con = 1;\n }\n else {\n con = -1;\n }\n }\n th1 = Math.acos(con) / 3;\n if (p.y >= 0) {\n lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n else {\n lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n\n if (Math.abs(xx) < EPSLN) {\n lon = this.long0;\n }\n else {\n lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$25 = [\"Van_der_Grinten_I\", \"VanDerGrinten\", \"vandg\"];\n var vandg = {\n init: init$24,\n forward: forward$23,\n inverse: inverse$23,\n names: names$25\n };\n\n function init$25() {\n this.sin_p12 = Math.sin(this.lat0);\n this.cos_p12 = Math.cos(this.lat0);\n }\n\n function forward$24(p) {\n var lon = p.x;\n var lat = p.y;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var dlon = adjust_lon(lon - this.long0);\n var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;\n if (this.sphere) {\n if (Math.abs(this.sin_p12 - 1) <= EPSLN) {\n //North Pole case\n p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon);\n p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {\n //South Pole case\n p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon);\n p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon);\n return p;\n }\n else {\n //default case\n cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);\n c = Math.acos(cos_c);\n kp = c ? c / Math.sin(c) : 1;\n p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);\n p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));\n return p;\n }\n }\n else {\n e0 = e0fn(this.es);\n e1 = e1fn(this.es);\n e2 = e2fn(this.es);\n e3 = e3fn(this.es);\n if (Math.abs(this.sin_p12 - 1) <= EPSLN) {\n //North Pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n Ml = this.a * mlfn(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);\n p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {\n //South Pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n Ml = this.a * mlfn(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);\n p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);\n return p;\n }\n else {\n //Default case\n tanphi = sinphi / cosphi;\n Nl1 = gN(this.a, this.e, this.sin_p12);\n Nl = gN(this.a, this.e, sinphi);\n psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));\n Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));\n if (Az === 0) {\n s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) {\n s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else {\n s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));\n }\n G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);\n H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);\n GH = G * H;\n Hs = H * H;\n s2 = s * s;\n s3 = s2 * s;\n s4 = s3 * s;\n s5 = s4 * s;\n c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);\n p.x = this.x0 + c * Math.sin(Az);\n p.y = this.y0 + c * Math.cos(Az);\n return p;\n }\n }\n\n\n }\n\n function inverse$24(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi;\n if (this.sphere) {\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (rh > (2 * HALF_PI * this.a)) {\n return;\n }\n z = rh / this.a;\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= EPSLN) {\n lat = this.lat0;\n }\n else {\n lat = asinz(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh);\n con = Math.abs(this.lat0) - HALF_PI;\n if (Math.abs(con) <= EPSLN) {\n if (this.lat0 >= 0) {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));\n }\n }\n else {\n /*con = cosz - this.sin_p12 * Math.sin(lat);\n if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {\n //no-op, just keep the lon value as is\n } else {\n var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));\n lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));\n }*/\n lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n e0 = e0fn(this.es);\n e1 = e1fn(this.es);\n e2 = e2fn(this.es);\n e3 = e3fn(this.es);\n if (Math.abs(this.sin_p12 - 1) <= EPSLN) {\n //North pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = Mlp - rh;\n lat = imlfn(M / this.a, e0, e1, e2, e3);\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - 1 * p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {\n //South pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = rh - Mlp;\n\n lat = imlfn(M / this.a, e0, e1, e2, e3);\n lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n //default case\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n Az = Math.atan2(p.x, p.y);\n N1 = gN(this.a, this.e, this.sin_p12);\n cosAz = Math.cos(Az);\n tmp = this.e * this.cos_p12 * cosAz;\n A = -tmp * tmp / (1 - this.es);\n B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);\n D = rh / N1;\n Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;\n F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;\n psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);\n lon = adjust_lon(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));\n sinpsi = Math.sin(psi);\n lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));\n p.x = lon;\n p.y = lat;\n return p;\n }\n }\n\n }\n\n var names$26 = [\"Azimuthal_Equidistant\", \"aeqd\"];\n var aeqd = {\n init: init$25,\n forward: forward$24,\n inverse: inverse$24,\n names: names$26\n };\n\n function init$26() {\n //double temp; /* temporary variable */\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n }\n\n /* Orthographic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\n function forward$25(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g, x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = adjust_lon(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= EPSLN)) {\n x = this.a * ksp * cosphi * Math.sin(dlon);\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$25(p) {\n var rh; /* height above ellipsoid */\n var z; /* angle */\n var sinz, cosz; /* sin of z and cos of z */\n var con;\n var lon, lat;\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n z = asinz(rh / this.a);\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= EPSLN) {\n lat = this.lat0;\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = asinz(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh);\n con = Math.abs(this.lat0) - HALF_PI;\n if (Math.abs(con) <= EPSLN) {\n if (this.lat0 >= 0) {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$27 = [\"ortho\"];\n var ortho = {\n init: init$26,\n forward: forward$25,\n inverse: inverse$25,\n names: names$27\n };\n\n // QSC projection rewritten from the original PROJ4\n // https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c\n\n /* constants */\n var FACE_ENUM = {\n FRONT: 1,\n RIGHT: 2,\n BACK: 3,\n LEFT: 4,\n TOP: 5,\n BOTTOM: 6\n };\n\n var AREA_ENUM = {\n AREA_0: 1,\n AREA_1: 2,\n AREA_2: 3,\n AREA_3: 4\n };\n\n function init$27() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Quadrilateralized Spherical Cube\";\n\n /* Determine the cube face from the center of projection. */\n if (this.lat0 >= HALF_PI - FORTPI / 2.0) {\n this.face = FACE_ENUM.TOP;\n } else if (this.lat0 <= -(HALF_PI - FORTPI / 2.0)) {\n this.face = FACE_ENUM.BOTTOM;\n } else if (Math.abs(this.long0) <= FORTPI) {\n this.face = FACE_ENUM.FRONT;\n } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) {\n this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;\n } else {\n this.face = FACE_ENUM.BACK;\n }\n\n /* Fill in useful values for the ellipsoid <-> sphere shift\n * described in [LK12]. */\n if (this.es !== 0) {\n this.one_minus_f = 1 - (this.a - this.b) / this.a;\n this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;\n }\n }\n\n // QSC forward equations--mapping lat,long to x,y\n // -----------------------------------------------------------------\n function forward$26(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = HALF_PI - lat;\n if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - HALF_PI;\n } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - SPI : lon + SPI);\n } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + HALF_PI;\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = HALF_PI + lat;\n if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + HALF_PI;\n } else if (lon < FORTPI && lon >= -FORTPI) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - HALF_PI;\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + SPI : -lon - SPI);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +HALF_PI);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +SPI);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -HALF_PI);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / SPI) * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += HALF_PI;\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += SPI;\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * SPI;\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n }\n\n // QSC inverse equations--mapping x,y to lat/long\n // -----------------------------------------------------------------\n function inverse$26(p) {\n var lp = {lam: 0, phi: 0};\n var mu, nu, cosmu, tannu;\n var tantheta, theta, cosphi, phi;\n var t;\n var area = {value: 0};\n\n /* de-offset */\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n /* Convert the input x, y to the mu and nu angles as used by QSC.\n * This depends on the area of the cube face. */\n nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));\n mu = Math.atan2(p.y, p.x);\n if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_0;\n } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {\n area.value = AREA_ENUM.AREA_1;\n mu -= HALF_PI;\n } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_2;\n mu = (mu < 0.0 ? mu + SPI : mu - SPI);\n } else {\n area.value = AREA_ENUM.AREA_3;\n mu += HALF_PI;\n }\n\n /* Compute phi and theta for the area of definition.\n * The inverse projection is not described in the original paper, but some\n * good hints can be found here (as of 2011-12-14):\n * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302\n * (search for \"Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>\") */\n t = (SPI / 12) * Math.tan(mu);\n tantheta = Math.sin(t) / (Math.cos(t) - (1 / Math.sqrt(2)));\n theta = Math.atan(tantheta);\n cosmu = Math.cos(mu);\n tannu = Math.tan(nu);\n cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));\n if (cosphi < -1) {\n cosphi = -1;\n } else if (cosphi > +1) {\n cosphi = +1;\n }\n\n /* Apply the result to the real area on the cube face.\n * For the top and bottom face, we can compute phi and lam directly.\n * For the other faces, we must use unit sphere cartesian coordinates\n * as an intermediate step. */\n if (this.face === FACE_ENUM.TOP) {\n phi = Math.acos(cosphi);\n lp.phi = HALF_PI - phi;\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = theta + HALF_PI;\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = (theta < 0.0 ? theta + SPI : theta - SPI);\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = theta - HALF_PI;\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = theta;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = Math.acos(cosphi);\n lp.phi = phi - HALF_PI;\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = -theta + HALF_PI;\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = -theta;\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = -theta - HALF_PI;\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = (theta < 0.0 ? -theta - SPI : -theta + SPI);\n }\n } else {\n /* Compute phi and lam via cartesian unit sphere coordinates. */\n var q, r, s;\n q = cosphi;\n t = q * q;\n if (t >= 1) {\n s = 0;\n } else {\n s = Math.sqrt(1 - t) * Math.sin(theta);\n }\n t += s * s;\n if (t >= 1) {\n r = 0;\n } else {\n r = Math.sqrt(1 - t);\n }\n /* Rotate q,r,s into the correct area. */\n if (area.value === AREA_ENUM.AREA_1) {\n t = r;\n r = -s;\n s = t;\n } else if (area.value === AREA_ENUM.AREA_2) {\n r = -r;\n s = -s;\n } else if (area.value === AREA_ENUM.AREA_3) {\n t = r;\n r = s;\n s = -t;\n }\n /* Rotate q,r,s into the correct cube face. */\n if (this.face === FACE_ENUM.RIGHT) {\n t = q;\n q = -r;\n r = t;\n } else if (this.face === FACE_ENUM.BACK) {\n q = -q;\n r = -r;\n } else if (this.face === FACE_ENUM.LEFT) {\n t = q;\n q = r;\n r = -t;\n }\n /* Now compute phi and lam from the unit sphere coordinates. */\n lp.phi = Math.acos(-s) - HALF_PI;\n lp.lam = Math.atan2(r, q);\n if (this.face === FACE_ENUM.RIGHT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI);\n } else if (this.face === FACE_ENUM.BACK) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -SPI);\n } else if (this.face === FACE_ENUM.LEFT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI);\n }\n }\n\n /* Apply the shift from the sphere to the ellipsoid as described\n * in [LK12]. */\n if (this.es !== 0) {\n var invert_sign;\n var tanphi, xa;\n invert_sign = (lp.phi < 0 ? 1 : 0);\n tanphi = Math.tan(lp.phi);\n xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);\n lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));\n if (invert_sign) {\n lp.phi = -lp.phi;\n }\n }\n\n lp.lam += this.long0;\n p.x = lp.lam;\n p.y = lp.phi;\n return p;\n }\n\n /* Helper function for forward projection: compute the theta angle\n * and determine the area number. */\n function qsc_fwd_equat_face_theta(phi, y, x, area) {\n var theta;\n if (phi < EPSLN) {\n area.value = AREA_ENUM.AREA_0;\n theta = 0.0;\n } else {\n theta = Math.atan2(y, x);\n if (Math.abs(theta) <= FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_1;\n theta -= HALF_PI;\n } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_2;\n theta = (theta >= 0.0 ? theta - SPI : theta + SPI);\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta += HALF_PI;\n }\n }\n return theta;\n }\n\n /* Helper function: shift the longitude. */\n function qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -SPI) {\n slon += TWO_PI;\n } else if (slon > +SPI) {\n slon -= TWO_PI;\n }\n return slon;\n }\n\n var names$28 = [\"Quadrilateralized Spherical Cube\", \"Quadrilateralized_Spherical_Cube\", \"qsc\"];\n var qsc = {\n init: init$27,\n forward: forward$26,\n inverse: inverse$26,\n names: names$28\n };\n\n // Robinson projection\n // Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c\n // Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039\n\n var COEFS_X = [\n [1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06],\n [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06],\n [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07],\n [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06],\n [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06],\n [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08],\n [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06],\n [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06],\n [0.9216, -0.00467746, -0.00010457, 4.81243e-06],\n [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06],\n [0.8679, -0.00609363, -0.000113898, 3.32484e-06],\n [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07],\n [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07],\n [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06],\n [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06],\n [0.6732, -0.00986209, -0.000199569, 1.91974e-05],\n [0.6213, -0.010418, 8.83923e-05, 6.24051e-06],\n [0.5722, -0.00906601, 0.000182, 6.24051e-06],\n [0.5322, -0.00677797, 0.000275608, 6.24051e-06]\n ];\n\n var COEFS_Y = [\n [-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11],\n [0.0620, 0.0124, -1.26793e-09, 4.22642e-10],\n [0.1240, 0.0124, 5.07171e-09, -1.60604e-09],\n [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09],\n [0.2480, 0.0124002, 7.10039e-08, -2.24e-08],\n [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08],\n [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07],\n [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07],\n [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07],\n [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07],\n [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07],\n [0.6769, 0.011713, -3.20223e-05, -5.16405e-07],\n [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07],\n [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06],\n [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09],\n [0.8936, 0.00969686, -6.4636e-05, -8.547e-06],\n [0.9394, 0.00840947, -0.000192841, -4.2106e-06],\n [0.9761, 0.00616527, -0.000256, -4.2106e-06],\n [1.0000, 0.00328947, -0.000319159, -4.2106e-06]\n ];\n\n var FXC = 0.8487;\n var FYC = 1.3523;\n var C1 = R2D/5; // rad to 5-degree interval\n var RC1 = 1/C1;\n var NODES = 18;\n\n var poly3_val = function(coefs, x) {\n return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));\n };\n\n var poly3_der = function(coefs, x) {\n return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);\n };\n\n function newton_rapshon(f_df, start, max_err, iters) {\n var x = start;\n for (; iters; --iters) {\n var upd = f_df(x);\n x -= upd;\n if (Math.abs(upd) < max_err) {\n break;\n }\n }\n return x;\n }\n\n function init$28() {\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.long0 = this.long0 || 0;\n this.es = 0;\n this.title = this.title || \"Robinson\";\n }\n\n function forward$27(ll) {\n var lon = adjust_lon(ll.x - this.long0);\n\n var dphi = Math.abs(ll.y);\n var i = Math.floor(dphi * C1);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n dphi = R2D * (dphi - RC1 * i);\n var xy = {\n x: poly3_val(COEFS_X[i], dphi) * lon,\n y: poly3_val(COEFS_Y[i], dphi)\n };\n if (ll.y < 0) {\n xy.y = -xy.y;\n }\n\n xy.x = xy.x * this.a * FXC + this.x0;\n xy.y = xy.y * this.a * FYC + this.y0;\n return xy;\n }\n\n function inverse$27(xy) {\n var ll = {\n x: (xy.x - this.x0) / (this.a * FXC),\n y: Math.abs(xy.y - this.y0) / (this.a * FYC)\n };\n\n if (ll.y >= 1) { // pathologic case\n ll.x /= COEFS_X[NODES][0];\n ll.y = xy.y < 0 ? -HALF_PI : HALF_PI;\n } else {\n // find table interval\n var i = Math.floor(ll.y * NODES);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n for (;;) {\n if (COEFS_Y[i][0] > ll.y) {\n --i;\n } else if (COEFS_Y[i+1][0] <= ll.y) {\n ++i;\n } else {\n break;\n }\n }\n // linear interpolation in 5 degree interval\n var coefs = COEFS_Y[i];\n var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i+1][0] - coefs[0]);\n // find t so that poly3_val(coefs, t) = ll.y\n t = newton_rapshon(function(x) {\n return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);\n }, t, EPSLN, 100);\n\n ll.x /= poly3_val(COEFS_X[i], t);\n ll.y = (5 * i + t) * D2R;\n if (xy.y < 0) {\n ll.y = -ll.y;\n }\n }\n\n ll.x = adjust_lon(ll.x + this.long0);\n return ll;\n }\n\n var names$29 = [\"Robinson\", \"robin\"];\n var robin = {\n init: init$28,\n forward: forward$27,\n inverse: inverse$27,\n names: names$29\n };\n\n function init$29() {\n this.name = 'geocent';\n\n }\n\n function forward$28(p) {\n var point = geodeticToGeocentric(p, this.es, this.a);\n return point;\n }\n\n function inverse$28(p) {\n var point = geocentricToGeodetic(p, this.es, this.a, this.b);\n return point;\n }\n\n var names$30 = [\"Geocentric\", 'geocentric', \"geocent\", \"Geocent\"];\n var geocent = {\n init: init$29,\n forward: forward$28,\n inverse: inverse$28,\n names: names$30\n };\n\n var mode = {\n N_POLE: 0,\n S_POLE: 1,\n EQUIT: 2,\n OBLIQ: 3\n };\n\n var params = {\n h: { def: 100000, num: true }, // default is Karman line, no default in PROJ.7\n azi: { def: 0, num: true, degrees: true }, // default is North\n tilt: { def: 0, num: true, degrees: true }, // default is Nadir\n long0: { def: 0, num: true }, // default is Greenwich, conversion to rad is automatic\n lat0: { def: 0, num: true } // default is Equator, conversion to rad is automatic\n };\n\n function init$30() {\n Object.keys(params).forEach(function (p) {\n if (typeof this[p] === \"undefined\") {\n this[p] = params[p].def;\n } else if (params[p].num && isNaN(this[p])) {\n throw new Error(\"Invalid parameter value, must be numeric \" + p + \" = \" + this[p]);\n } else if (params[p].num) {\n this[p] = parseFloat(this[p]);\n }\n if (params[p].degrees) {\n this[p] = this[p] * D2R;\n }\n }.bind(this));\n\n if (Math.abs((Math.abs(this.lat0) - HALF_PI)) < EPSLN) {\n this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE;\n } else if (Math.abs(this.lat0) < EPSLN) {\n this.mode = mode.EQUIT;\n } else {\n this.mode = mode.OBLIQ;\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n\n this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius\n\n if (this.pn1 <= 0 || this.pn1 > 1e10) {\n throw new Error(\"Invalid height\");\n }\n \n this.p = 1 + this.pn1;\n this.rp = 1 / this.p;\n this.h1 = 1 / this.pn1;\n this.pfact = (this.p + 1) * this.h1;\n this.es = 0;\n\n var omega = this.tilt;\n var gamma = this.azi;\n this.cg = Math.cos(gamma);\n this.sg = Math.sin(gamma);\n this.cw = Math.cos(omega);\n this.sw = Math.sin(omega);\n }\n\n function forward$29(p) {\n p.x -= this.long0;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var coslam = Math.cos(p.x);\n var x, y;\n switch (this.mode) {\n case mode.OBLIQ:\n y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y = cosphi * coslam;\n break;\n case mode.S_POLE:\n y = -sinphi;\n break;\n case mode.N_POLE:\n y = sinphi;\n break;\n }\n y = this.pn1 / (this.p - y);\n x = y * cosphi * Math.sin(p.x);\n\n switch (this.mode) {\n case mode.OBLIQ:\n y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y *= sinphi;\n break;\n case mode.N_POLE:\n y *= -(cosphi * coslam);\n break;\n case mode.S_POLE:\n y *= cosphi * coslam;\n break;\n }\n\n // Tilt \n var yt, ba;\n yt = y * this.cg + x * this.sg;\n ba = 1 / (yt * this.sw * this.h1 + this.cw);\n x = (x * this.cg - y * this.sg) * this.cw * ba;\n y = yt * ba;\n\n p.x = x * this.a;\n p.y = y * this.a;\n return p;\n }\n\n function inverse$29(p) {\n p.x /= this.a;\n p.y /= this.a;\n var r = { x: p.x, y: p.y };\n\n // Un-Tilt\n var bm, bq, yt;\n yt = 1 / (this.pn1 - p.y * this.sw);\n bm = this.pn1 * p.x * yt;\n bq = this.pn1 * p.y * this.cw * yt;\n p.x = bm * this.cg + bq * this.sg;\n p.y = bq * this.cg - bm * this.sg;\n\n var rh = hypot(p.x, p.y);\n if (Math.abs(rh) < EPSLN) {\n r.x = 0;\n r.y = p.y;\n } else {\n var cosz, sinz;\n sinz = 1 - rh * rh * this.pfact;\n sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1);\n cosz = Math.sqrt(1 - sinz * sinz);\n switch (this.mode) {\n case mode.OBLIQ:\n r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh);\n p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh;\n p.x *= sinz * this.cosph0;\n break;\n case mode.EQUIT:\n r.y = Math.asin(p.y * sinz / rh);\n p.y = cosz * rh;\n p.x *= sinz;\n break;\n case mode.N_POLE:\n r.y = Math.asin(cosz);\n p.y = -p.y;\n break;\n case mode.S_POLE:\n r.y = -Math.asin(cosz);\n break;\n }\n r.x = Math.atan2(p.x, p.y);\n }\n\n p.x = r.x + this.long0;\n p.y = r.y;\n return p;\n }\n\n var names$31 = [\"Tilted_Perspective\", \"tpers\"];\n var tpers = {\n init: init$30,\n forward: forward$29,\n inverse: inverse$29,\n names: names$31\n };\n\n var includedProjections = function(proj4){\n proj4.Proj.projections.add(tmerc);\n proj4.Proj.projections.add(etmerc);\n proj4.Proj.projections.add(utm);\n proj4.Proj.projections.add(sterea);\n proj4.Proj.projections.add(stere);\n proj4.Proj.projections.add(somerc);\n proj4.Proj.projections.add(omerc);\n proj4.Proj.projections.add(lcc);\n proj4.Proj.projections.add(krovak);\n proj4.Proj.projections.add(cass);\n proj4.Proj.projections.add(laea);\n proj4.Proj.projections.add(aea);\n proj4.Proj.projections.add(gnom);\n proj4.Proj.projections.add(cea);\n proj4.Proj.projections.add(eqc);\n proj4.Proj.projections.add(poly);\n proj4.Proj.projections.add(nzmg);\n proj4.Proj.projections.add(mill);\n proj4.Proj.projections.add(sinu);\n proj4.Proj.projections.add(moll);\n proj4.Proj.projections.add(eqdc);\n proj4.Proj.projections.add(vandg);\n proj4.Proj.projections.add(aeqd);\n proj4.Proj.projections.add(ortho);\n proj4.Proj.projections.add(qsc);\n proj4.Proj.projections.add(robin);\n proj4.Proj.projections.add(geocent);\n proj4.Proj.projections.add(tpers);\n };\n\n proj4$1.defaultDatum = 'WGS84'; //default datum\n proj4$1.Proj = Projection;\n proj4$1.WGS84 = new proj4$1.Proj('WGS84');\n proj4$1.Point = Point;\n proj4$1.toPoint = toPoint;\n proj4$1.defs = defs;\n proj4$1.nadgrid = nadgrid;\n proj4$1.transform = transform;\n proj4$1.mgrs = mgrs;\n proj4$1.version = '2.7.5';\n includedProjections(proj4$1);\n\n return proj4$1;\n\n})));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9wcm9qNC9kaXN0L3Byb2o0LXNyYy5qcz8xMzVjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0EsSUFBSSxLQUE0RDtBQUNoRSxJQUFJLFNBQzBCO0FBQzlCLENBQUMscUJBQXFCOztBQUV0QjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLDRDQUE0QztBQUM1QztBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxzQkFBc0I7QUFDdEIsd0JBQXdCO0FBQ3hCLHdDQUF3QztBQUN4QywwQ0FBMEM7QUFDMUMsbURBQW1EO0FBQ25EO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsOEJBQThCO0FBQzlCLHVDQUF1QztBQUN2QyxxQ0FBcUM7QUFDckMsd0NBQXdDO0FBQ3hDLHVDQUF1QztBQUN2QyxxQ0FBcUM7QUFDckMsb0NBQW9DO0FBQ3BDLHlDQUF5QztBQUN6Qyx1Q0FBdUM7QUFDdkMsa0NB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X3RzOiBmdW5jdGlvbih2KSB7XG4gICAgICAgICAgc2VsZi5sYXRfdHMgPSB2ICogRDJSO1xuICAgICAgICB9LFxuICAgICAgICBsb25fMDogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYubG9uZzAgPSB2ICogRDJSO1xuICAgICAgICB9LFxuICAgICAgICBsb25fMTogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYubG9uZzEgPSB2ICogRDJSO1xuICAgICAgICB9LFxuICAgICAgICBsb25fMjogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYubG9uZzIgPSB2ICogRDJSO1xuICAgICAgICB9LFxuICAgICAgICBhbHBoYTogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYuYWxwaGEgPSBwYXJzZUZsb2F0KHYpICogRDJSO1xuICAgICAgICB9LFxuICAgICAgICBnYW1tYTogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYucmVjdGlmaWVkX2dyaWRfYW5nbGUgPSBwYXJzZUZsb2F0KHYpO1xuICAgICAgICB9LFxuICAgICAgICBsb25jOiBmdW5jdGlvbih2KSB7XG4gICAgICAgICAgc2VsZi5sb25nYyA9IHYgKiBEMlI7XG4gICAgICAgIH0sXG4gICAgICAgIHhfMDogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYueDAgPSBwYXJzZUZsb2F0KHYpO1xuICAgICAgICB9LFxuICAgICAgICB5XzA6IGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICBzZWxmLnkwID0gcGFyc2VGbG9hdCh2KTtcbiAgICAgICAgfSxcbiAgICAgICAga18wOiBmdW5jdGlvbih2KSB7XG4gICAgICAgICAgc2VsZi5rMCA9IHBhcnNlRmxvYXQodik7XG4gICAgICAgIH0sXG4gICAgICAgIGs6IGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICBzZWxmLmswID0gcGFyc2VGbG9hdCh2KTtcbiAgICAgICAgfSxcbiAgICAgICAgYTogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYuYSA9IHBhcnNlRmxvYXQodik7XG4gICAgICAgIH0sXG4gICAgICAgIGI6IGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICBzZWxmLmIgPSBwYXJzZUZsb2F0KHYpO1xuICAgICAgICB9LFxuICAgICAgICByX2E6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHNlbGYuUl9BID0gdHJ1ZTtcbiAgICAgICAgfSxcbiAgICAgICAgem9uZTogZnVuY3Rpb24odikge1xuICAgICAgICAgIHNlbGYuem9uZSA9IHBhcnNlSW50KHYsIDEwKTtcbiAgICAgICAgfSxcbiAgICAgICAgc291dGg6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHNlbGYudXRtU291dGggPSB0cnVlO1xuICAgICAgICB9LFxuICAgICAgICB0b3dnczg0OiBmdW5jdGlvbih2KSB7XG4gICAgICAgICAgc2VsZi5kYXR1bV9wYXJhbXMgPSB2LnNwbGl0KFwiLFwiKS5tYXAoZnVuY3Rpb24oYSkge1xuICAgICAgICAgICAgcmV0dXJuIHBhcnNlRmxvYXQoYSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHRvX21ldGVyOiBmdW5jdGlvbih2KSB7XG4gICAgICAgICAgc2VsZi50b19tZXRlciA9IHBhcnNlRmxvYXQodik7XG4gICAgICAgIH0sXG4gICAgICAgIHVuaXRzOiBmdW5jdGlvbih2KSB7XG4gICAgICAgICAgc2VsZi51bml0cyA9IHY7XG4gICAgICAgICAgdmFyIHVuaXQgPSBtYXRjaCh1bml0cywgdik7XG4gICAgICAgICAgaWYgKHVuaXQpIHtcbiAgICAgICAgICAgIHNlbGYudG9fbWV0ZXIgPSB1bml0LnRvX21ldGVyO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZnJvbV9ncmVlbndpY2g6IGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICBzZWxmLmZyb21fZ3JlZW53aWNoID0gdiAqIEQyUjtcbiAgICAgICAgfSxcbiAgICAgICAgcG06IGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICB2YXIgcG0gPSBtYXRjaChleHBvcnRzJDEsIHYpO1xuICAgICAgICAgIHNlbGYuZnJvbV9ncmVlbndpY2ggPSAocG0gPyBwbSA6IHBhcnNlRmxvYXQodikpICogRDJSO1xuICAgICAgICB9LFxuICAgICAgICBuYWRncmlkczogZnVuY3Rpb24odikge1xuICAgICAgICAgIGlmICh2ID09PSAnQG51bGwnKSB7XG4gICAgICAgICAgICBzZWxmLmRhdHVtQ29kZSA9ICdub25lJztcbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzZWxmLm5hZGdyaWRzID0gdjtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGF4aXM6IGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICB2YXIgbGVnYWxBeGlzID0gXCJld25zdWRcIjtcbiAgICAgICAgICBpZiAodi5sZW5ndGggPT09IDMgJiYgbGVnYWxBeGlzLmluZGV4T2Yodi5zdWJzdHIoMCwgMSkpICE9PSAtMSAmJiBsZWdhbEF4aXMuaW5kZXhPZih2LnN1YnN0cigxLCAxKSkgIT09IC0xICYmIGxlZ2FsQXhpcy5pbmRleE9mKHYuc3Vic3RyKDIsIDEpKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIHNlbGYuYXhpcyA9IHY7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBhcHByb3g6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHNlbGYuYXBwcm94ID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZvciAocGFyYW1OYW1lIGluIHBhcmFtT2JqKSB7XG4gICAgICAgIHBhcmFtVmFsID0gcGFyYW1PYmpbcGFyYW1OYW1lXTtcbiAgICAgICAgaWYgKHBhcmFtTmFtZSBpbiBwYXJhbXMpIHtcbiAgICAgICAgICBwYXJhbU91d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PVEU6XG4gICAgICAgICAgcmV0dXJuIHRoaXMuYWZ0ZXJxdW90ZShjaGFyKTtcbiAgICAgICAgY2FzZSBOVU1CRVI6XG4gICAgICAgICAgcmV0dXJuIHRoaXMubnVtYmVyKGNoYXIpO1xuICAgICAgICBjYXNlIEVOREVEOlxuICAgICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICB9O1xuICAgIFBhcnNlci5wcm90b3R5cGUuYWZ0ZXJxdW90ZSA9IGZ1bmN0aW9uKGNoYXIpIHtcbiAgICAgIGlmIChjaGFyID09PSAnXCInKSB7XG4gICAgICAgIHRoaXMud29yZCArPSAnXCInO1xuICAgICAgICB0aGlzLnN0YXRlID0gUVVPVEVEO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBpZiAoZW5kVGhpbmdzLnRlc3QoY2hhcikpIHtcbiAgICAgICAgdGhpcy53b3JkID0gdGhpcy53b3JkLnRyaW0oKTtcbiAgICAgICAgdGhpcy5hZnRlckl0ZW0oY2hhcik7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIHRocm93IG5ldyBFcnJvcignaGF2blxcJ3QgaGFuZGxlZCBcIicgK2NoYXIgKyAnXCIgaW4gYWZ0ZXJxdW90ZSB5ZXQsIGluZGV4ICcgKyB0aGlzLnBsYWNlKTtcbiAgICB9O1xuICAgIFBhcnNlci5wcm90b3R5cGUuYWZ0ZXJJdGVtID0gZnVuY3Rpb24oY2hhcikge1xuICAgICAgaWYgKGNoYXIgPT09ICcsJykge1xuICAgICAgICBpZiAodGhpcy53b3JkICE9PSBudWxsKSB7XG4gICAgICAgICAgdGhpcy5jdXJyZW50T2JqZWN0LnB1c2godGhpcy53b3JkKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLndvcmQgPSBudWxsO1xuICAgICAgICB0aGlzLnN0YXRlID0gTkVVVFJBTDtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgaWYgKGNoYXIgPT09ICddJykge1xuICAgICAgICB0aGlzLmxldmVsLS07XG4gICAgICAgIGlmICh0aGlzLndvcmQgIT09IG51bGwpIHtcbiAgICAgICAgICB0aGlzLmN1cnJlbnRPYmplY3QucHVzaCh0aGlzLndvcmQpO1xuICAgICAgICAgIHRoaXMud29yZCA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5zdGF0ZSA9IE5FVVRSQUw7XG4gICAgICAgIHRoaXMuY3VycmVudE9iamVjdCA9IHRoaXMuc3RhY2sucG9wKCk7XG4gICAgICAgIGlmICghdGhpcy5jdXJyZW50T2JqZWN0KSB7XG4gICAgICAgICAgdGhpcy5zdGF0ZSA9IEVOREVEO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgIH07XG4gICAgUGFyc2VyLnByb3RvdHlwZS5udW1iZXIgPSBmdW5jdGlvbihjaGFyKSB7XG4gICAgICBpZiAoZGlnZXRzLnRlc3QoY2hhcikpIHtcbiAgICAgICAgdGhpcy53b3JkICs9IGNoYXI7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGlmIChlbmRUaGluZ3MudGVzdChjaGFyKSkge1xuICAgICAgICB0aGlzLndvcmQgPSBwYXJzZUZsb2F0KHRoaXMud29yZCk7XG4gICAgICAgIHRoaXMuYWZ0ZXJJdGVtKGNoYXIpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ2hhdm5cXCd0IGhhbmRsZWQgXCInICtjaGFyICsgJ1wiIGluIG51bWJlciB5ZXQsIGluZGV4ICcgKyB0aGlzLnBsYWNlKTtcbiAgICB9O1xuICAgIFBhcnNlci5wcm90b3R5cGUucXVvdGVkID0gZnVuY3Rpb24oY2hhcikge1xuICAgICAgaWYgKGNoYXIgPT09ICdcIicpIHtcbiAgICAgICAgdGhpcy5zdGF0ZSA9IEFGVEVSUVVPVEU7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIHRoaXMud29yZCArPSBjaGFyO1xuICAgICAgcmV0dXJuO1xuICAgIH07XG4gICAgUGFyc2VyLnByb3RvdHlwZS5rZXl3b3JkID0gZnVuY3Rpb24oY2hhcikge1xuICAgICAgaWYgKGtleXdvcmQudGVzdChjaGFyKSkge1xuICAgICAgICB0aGlzLndvcmQgKz0gY2hhcjtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgaWYgKGNoYXIgPT09ICdbJykge1xuICAgICAgICB2YXIgbmV3T2JqZWN0cyA9IFtdO1xuICAgICAgICBuZXdPYmplY3RzLnB1c2godGhpcy53b3JkKTtcbiAgICAgICAgdGhpcy5sZXZlbCsrO1xuICAgICAgICBpZiAodGhpcy5yb290ID09PSBudWxsKSB7XG4gICAgICAgICAgdGhpcy5yb290ID0gbmV3T2JqZWN0cztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLmN1cnJlbnRPYmplY3QucHVzaChuZXdPYmplY3RzKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnN0YWNrLnB1c2godGhpcy5jdXJyZW50T2JqZWN0KTtcbiAgICAgICAgdGhpcy5jdXJyZW50T2JqZWN0ID0gbmV3T2JqZWN0cztcbiAgICAgICAgdGhpcy5zdGF0ZSA9IE5FVVRSQUw7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGlmIChlbmRUaGluZ3MudGVzdChjaGFyKSkge1xuICAgICAgICB0aGlzLmFmdGVySXRlbShjaGFyKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgdGhyb3cgbmV3IEVycm9yKCdoYXZuXFwndCBoYW5kbGVkIFwiJyArY2hhciArICdcIiBpbiBrZXl3b3JkIHlldCwgaW5kZXggJyArIHRoaXMucGxhY2UpO1xuICAgIH07XG4gICAgUGFyc2VyLnByb3RvdHlwZS5uZXV0cmFsID0gZnVuY3Rpb24oY2hhcikge1xuICAgICAgaWYgKGxhdGluLnRlc3QoY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yc2VTdHJpbmcodHh0KSB7XG4gICAgICB2YXIgcGFyc2VyID0gbmV3IFBhcnNlcih0eHQpO1xuICAgICAgcmV0dXJuIHBhcnNlci5vdXRwdXQoKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtYXBpdChvYmosIGtleSwgdmFsdWUpIHtcbiAgICAgIGlmIChBcnJheS5pc0FycmF5KGtleSkpIHtcbiAgICAgICAgdmFsdWUudW5zaGlmdChrZXkpO1xuICAgICAgICBrZXkgPSBudWxsO1xuICAgICAgfVxuICAgICAgdmFyIHRoaW5nID0ga2V5ID8ge30gOiBvYmo7XG5cbiAgICAgIHZhciBvdXQgPSB2YWx1ZS5yZWR1Y2UoZnVuY3Rpb24obmV3T2JqLCBpdGVtKSB7XG4gICAgICAgIHNFeHByKGl0ZW0sIG5ld09iaik7XG4gICAgICAgIHJldHVybiBuZXdPYmpcbiAgICAgIH0sIHRoaW5nKTtcbiAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgb2JqW2tleV0gPSBvdXQ7XG4gICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc0V4cHIodiwgb2JqKSB7XG4gICAgICBpZiAoIUFycmF5LmlzQXJyYXkodikpIHtcbiAgICAgICAgb2JqW3ZdID0gdHJ1ZTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgdmFyIGtleSA9IHYuc2hpZnQoKTtcbiAgICAgIGlmIChrZXkgPT09ICdQQVJBTUVURVInKSB7XG4gICAgICAgIGtleSA9IHYuc2hpZnQoKTtcbiAgICAgIH1cbiAgICAgIGlmICh2Lmxlbmd0aCA9PT0gMSkge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh2WzBdKSkge1xuICAgICAgICAgIG9ialtrZXldID0ge307XG4gICAgICAgICAgc0V4cHIodlswXSwgb2JqW2tleV0pO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBvYmpba2V5XSA9IHZbMF07XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGlmICghdi5sZW5ndGgpIHtcbiAgICAgICAgb2JqW2tleV0gPSB0cnVlO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBpZiAoa2V5ID09PSAnVE9XR1M4NCcpIHtcbiAgICAgICAgb2JqW2tleV0gPSB2O1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBpZiAoa2V5ID09PSAnQVhJUycpIHtcbiAgICAgICAgaWYgKCEoa2V5IGluIG9iaikpIHtcbiAgICAgICAgICBvYmpba2V5XSA9IFtdO1xuICAgICAgICB9XG4gICAgICAgIG9ialtrZXldLnB1c2godik7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGlmICghQXJyYXkuaXNBcnJheShrZXkpKSB7XG4gICAgICAgIG9ialtrZXldID0ge307XG4gICAgICB9XG5cbiAgICAgIHZhciBpO1xuICAgICAgc3dpdGNoIChrZXkpIHtcbiAgICAgICAgY2FzZSAnVU5JVCc6XG4gICAgICAgIGNhc2UgJ1BSSU1FTSc6XG4gICAgICAgIGNhc2UgJ1ZFUlRfREFUVU0nOlxuICAgICAgICAgIG9ialtrZXldID0ge1xuICAgICAgICAgICAgbmFtZTogdlswXS50b0xvd2VyQ2FzZSgpLFxuICAgICAgICAgICAgY29udmVydDogdlsxXVxuICAgICAgICAgIH07XG4gICAgICAgICAgaWYgKHYubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgICBzRXhwcih2WzJdLCBvYmpba2V5XSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgY2FzZSAnU1BIRVJPSUQnOlxuICAgICAgICBjYXNlICdFTExJUFNPSUQnOlxuICAgICAgICAgIG9ialtrZXldID0ge1xuICAgICAgICAgICAgbmFtZTogdlswXSxcbiAgICAgICAgICAgIGE6IHZbMV0sXG4gICAgICAgICAgICByZjogdlsyXVxuICAgICAgICAgIH07XG4gICAgICAgICAgaWYgKHYubGVu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5KHZbaV0pKSB7XG4gICAgICAgICAgICAgIHJldHVybiBzRXhwcih2LCBvYmpba2V5XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBtYXBpdChvYmosIGtleSwgdik7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIEQyUiQxID0gMC4wMTc0NTMyOTI1MTk5NDMyOTU3NztcbiAgICBmdW5jdGlvbiByZW5hbWUob2JqLCBwYXJhbXMpIHtcbiAgICAgIHZhciBvdXROYW1lID0gcGFyYW1zWzBdO1xuICAgICAgdmFyIGluTmFtZSA9IHBhcmFtc1sxXTtcbiAgICAgIGlmICghKG91dE5hbWUgaW4gb2JqKSAmJiAoaW5OYW1lIGluIG9iaikpIHtcbiAgICAgICAgb2JqW291dE5hbWVdID0gb2JqW2luTmFtZV07XG4gICAgICAgIGlmIChwYXJhbXMubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgb2JqW291dE5hbWVdID0gcGFyYW1zWzJdKG9ialtvdXROYW1lXSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBkMnIoaW5wdXQpIHtcbiAgICAgIHJldHVybiBpbnB1dCAqIEQyUiQxO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNsZWFuV0tUKHdrdCkge1xuICAgICAgaWYgKHdrdC50eXBlID09PSAnR0VPR0NTJykge1xuICAgICAgICB3a3QucHJvak5hbWUgPSAnbG9uZ2xhdCc7XG4gICAgICB9IGVsc2UgaWYgKHdrdC50eXBlID09PSAnTE9DQUxfQ1MnKSB7XG4gICAgICAgIHdrdC5wcm9qTmFtZSA9ICdpZGVudGl0eSc7XG4gICAgICAgIHdrdC5sb2NhbCA9IHRydWU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAodHlwZW9mIHdrdC5QUk9KRUNUSU9OID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgIHdrdC5wcm9qTmFtZSA9IE9iam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bMF0gPT09ICdsb24nKSAmJiBheGlzWzFdID09PSAnd2VzdCcpKSB7XG4gICAgICAgICAgICBheGlzT3JkZXIgKz0gJ3cnO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoYXhpc09yZGVyLmxlbmd0aCA9PT0gMikge1xuICAgICAgICAgIGF4aXNPcmRlciArPSAndSc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGF4aXNPcmRlci5sZW5ndGggPT09IDMpIHtcbiAgICAgICAgICB3a3QuYXhpcyA9IGF4aXNPcmRlcjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHdrdC5VTklUKSB7XG4gICAgICAgIHdrdC51bml0cyA9IHdrdC5VTklULm5hbWUudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgaWYgKHdrdC51bml0cyA9PT0gJ21ldHJlJykge1xuICAgICAgICAgIHdrdC51bml0cyA9ICdtZXRlcic7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdrdC5VTklULmNvbnZlcnQpIHtcbiAgICAgICAgICBpZiAod2t0LnR5cGUgPT09ICdHRU9HQ1MnKSB7XG4gICAgICAgICAgICBpZiAod2t0LkRBVFVNICYmIHdrdC5EQVRVTS5TUEhFUk9JRCkge1xuICAgICAgICAgICAgICB3a3QudG9fbWV0ZXIgPSB3a3QuVU5JVC5jb252ZXJ0KndrdC5EQVRVTS5TUEhFUk9JRC5hO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB3a3QudG9fbWV0ZXIgPSB3a3QuVU5JVC5jb252ZXJ0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIGdlb2djcyA9IHdrdC5HRU9HQ1M7XG4gICAgICBpZiAod2t0LnR5cGUgPT09ICdHRU9HQ1MnKSB7XG4gICAgICAgIGdlb2djcyA9IHdrdDtcbiAgICAgIH1cbiAgICAgIGlmIChnZW9nY3MpIHtcbiAgIC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9iaiA9IHt9O1xuICAgICAgc0V4cHIobGlzcCwgb2JqKTtcbiAgICAgIGNsZWFuV0tUKG9iaik7XG4gICAgICByZXR1cm4gb2JqO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBkZWZzKG5hbWUpIHtcbiAgICAgIC8qZ2xvYmFsIGNvbnNvbGUqL1xuICAgICAgdmFyIHRoYXQgPSB0aGlzO1xuICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgdmFyIGRlZiA9IGFyZ3VtZW50c1sxXTtcbiAgICAgICAgaWYgKHR5cGVvZiBkZWYgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgaWYgKGRlZi5jaGFyQXQoMCkgPT09ICcrJykge1xuICAgICAgICAgICAgZGVmc1tuYW1lXSA9IHBhcnNlUHJvaihhcmd1bWVudHNbMV0pO1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGRlZnNbbmFtZV0gPSB3a3QoYXJndW1lbnRzWzFdKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZGVmc1tuYW1lXSA9IGRlZjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZWxzZSBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShuYW1lKSkge1xuICAgICAgICAgIHJldHVybiBuYW1lLm1hcChmdW5jdGlvbih2KSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh2KSkge1xuICAgICAgICAgICAgICBkZWZzLmFwcGx5KHRoYXQsIHYpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIGRlZnModik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodHlwZW9mIG5hbWUgPT09ICdzdHJpbm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KTtcbiAgICAgICAgICAvLyB0ZXN0IG9mIHNwZXRpYWwgY2FzZSwgZHVlIHRvIHRoaXMgYmVpbmcgYSB2ZXJ5IGNvbW1vbiBhbmQgb2Z0ZW4gbWFsZm9ybWVkXG4gICAgICAgICAgaWYgKGNoZWNrTWVyY2F0b3Iob3V0KSkge1xuICAgICAgICAgICAgcmV0dXJuIGRlZnNbJ0VQU0c6Mzg1NyddO1xuICAgICAgICAgIH1cbiAgICAgICAgICB2YXIgbWF5YmVQcm9qU3RyID0gY2hlY2tQcm9qU3RyKG91dCk7XG4gICAgICAgICAgaWYgKG1heWJlUHJvalN0cikge1xuICAgICAgICAgICAgcmV0dXJuIHBhcnNlUHJvaihtYXliZVByb2pTdHIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gb3V0O1xuICAgICAgICB9XG4gICAgICAgIGlmICh0ZXN0UHJvaihjb2RlKSkge1xuICAgICAgICAgIHJldHVybiBwYXJzZVByb2ooY29kZSk7XG4gICAgICAgIH1cbiAgICAgIH1lbHNle1xuICAgICAgICByZXR1cm4gY29kZTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgZXh0ZW5kID0gZnVuY3Rpb24oZGVzdGluYXRpb24sIHNvdXJjZSkge1xuICAgICAgZGVzdGluYXRpb24gPSBkZXN0aW5hdGlvbiB8fCB7fTtcbiAgICAgIHZhciB2YWx1ZSwgcHJvcGVydHk7XG4gICAgICBpZiAoIXNvdXJjZSkge1xuICAgICAgICByZXR1cm4gZGVzdGluYXRpb247XG4gICAgICB9XG4gICAgICBmb3IgKHByb3BlcnR5IGluIHNvdXJjZSkge1xuICAgICAgICB2YWx1ZSA9IHNvdXJjZVtwcm9wZXJ0eV07XG4gICAgICAgIGlmICh2YWx1ZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgZGVzdGluYXRpb25bcHJvcGVydHldID0gdmFsdWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBkZXN0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ih0cyAqIChNYXRoLnBvdygoKDEgLSBjb24pIC8gKDEgKyBjb24pKSwgZWNjbnRoKSkpIC0gcGhpO1xuICAgICAgICBwaGkgKz0gZHBoaTtcbiAgICAgICAgaWYgKE1hdGguYWJzKGRwaGkpIDw9IDAuMDAwMDAwMDAwMSkge1xuICAgICAgICAgIHJldHVybiBwaGk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIC8vY29uc29sZS5sb2coXCJwaGkyeiBoYXMgTm9Db252ZXJnZW5jZVwiKTtcbiAgICAgIHJldHVybiAtOTk5OTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gaW5pdCgpIHtcbiAgICAgIHZhciBjb24gPSB0aGlzLmIgLyB0aGlzLmE7XG4gICAgICB0aGlzLmVzID0gMSAtIGNvbiAqIGNvbjtcbiAgICAgIGlmKCEoJ3gwJyBpbiB0aGlzKSl7XG4gICAgICAgIHRoaXMueDAgPSAwO1xuICAgICAgfVxuICAgICAgaWYoISgneTAnIGluIHRoaXMpKXtcbiAgICAgICAgdGhpcy55MCA9IDA7XG4gICAgICB9XG4gICAgICB0aGlzLmUgPSBNYXRoLnNxcnQodGhpcy5lcyk7XG4gICAgICBpZiAodGhpcy5sYXRfdHMpIHtcbiAgICAgICAgaWYgKHRoaXMuc3BoZXJlKSB7XG4gICAgICAgICAgdGhpcy5rMCA9IE1hdGguY29zKHRoaXMubGF0X3RzKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICB0aGlzLmswID0gbXNmbnoodGhpcy5lLCBNYXRoLnNpbih0aGlzLmxhdF90cyksIE1hdGguY29zKHRoaXMubGF0X3RzKSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBpZiAoIXRoaXMuazApIHtcbiAgICAgICAgICBpZiAodGhpcy5rKSB7XG4gICAgICAgICAgICB0aGlzLmswID0gdGhpcy5rO1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuazAgPSAxO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIC8qIE1lcmNhdG9yIGZvcndhcmQgZXF1YXRpb25zLS1tYXBwaW5nIGxhdCxsb25nIHRvIHgseVxuICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qL1xuXG4gICAgZnVuY3Rpb24gZm9yd2FyZChwKSB7XG4gICAgICB2YXIgbG9uID0gcC54O1xuICAgICAgdmFyIGxhdCA9IHAueTtcbiAgICAgIC8vIGNvbnZlcnQgdG8gcmFkaWFuc1xuICAgICAgaWYgKGxhdCAqIFIyRCA+IDkwICYmIGxhdCAqIFIyRCA8IC05MCAmJiBsb24gKiBSMkQgPiAxODAgJiYgbG9uICogUjJEIDwgLTE4MCkge1xuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgIH1cblxuICAgICAgdmFyIHgsIHk7XG4gICAgICBpZiAoTWF0aC5hYnMoTWF0aC5hYnMobGF0KSAtIEhBTEZfUEkpIDw9IEVQU0xOKSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIGlmICh0aGlzLnNwaGVyZSkge1xuICAgICAgICAgIHggPSB0aGlzLngwICsgdGhpcy5hICogdGhpcy5rMCAqIGFkanVzdF9sb24obG9uIC0gdGhpcy5sb25nMCk7XG4gICAgICAgICAgeSA9IHRoaXMueTAgKyB0aGlzLmEgKiB0aGlzLmswICogTWF0aC5sb2coTWF0aC50YW4oRk9SVFBJICsgMC41ICogbGF0KSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgdmFyIHNpbnBoaSA9IE1hdGguc2luKGxhdCk7XG4gICAgICAgICAgdmFyIHRzID0gdHNmbnoodGhpcy5lLCBsYXQsIHNpbnBoaSk7XG4gICAgICAgICAgeCA9IHRo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pbnN0YW5jZW9mIFByb2plY3Rpb24pKSB7XG4gICAgICAgIHJldHVybiBuZXcgUHJvamVjdGlvbihzcnNDb2RlKTtcbiAgICAgIH1cbiAgICAgIGNhbGxiYWNrID0gY2FsbGJhY2sgfHwgZnVuY3Rpb24oZXJyb3Ipe1xuICAgICAgICBpZihlcnJvcil7XG4gICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICB2YXIganNvbiA9IHBhcnNlKHNyc0NvZGUpO1xuICAgICAgaWYodHlwZW9mIGpzb24gIT09ICdvYmplY3QnKXtcbiAgICAgICAgY2FsbGJhY2soc3JzQ29kZSk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIHZhciBvdXJQcm9qID0gUHJvamVjdGlvbi5wcm9qZWN0aW9ucy5nZXQoanNvbi5wcm9qTmFtZSk7XG4gICAgICBpZighb3VyUHJvail7XG4gICAgICAgIGNhbGxiYWNrKHNyc0NvZGUpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBpZiAoanNvbi5kYXR1bUNvZGUgJiYganNvbi5kYXR1bUNvZGUgIT09ICdub25lJykge1xuICAgICAgICB2YXIgZGF0dW1EZWYgPSBtYXRjaChleHBvcnRzJDMsIGpzb24uZGF0dW1Db2RlKTtcbiAgICAgICAgaWYgKGRhdHVtRGVmKSB7XG4gICAgICAgICAganNvbi5kYXR1bV9wYXJhbXMgPSBqc29uLmRhdHVtX3BhcmFtcyB8fCAoZGF0dW1EZWYudG93Z3M4NCA/IGRhdHVtRGVmLnRvd2dzODQuc3BsaXQoJywnKSA6IG51bGwpO1xuICAgICAgICAgIGpzb24uZWxscHMgPSBkYXR1bURlZi5lbGxpcHNlO1xuICAgICAgICAgIGpzb24uZGF0dW1OYW1lID0gZGF0dW1EZWYuZGF0dW1OYW1lID8gZGF0dW1EZWYuZGF0dW1OYW1lIDoganNvbi5kYXR1bUNvZGU7XG4gICAgICAgIH1cbiAgICAg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LmRhdHVtX3BhcmFtc1s2XSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gdHJ1ZTsgLy8gZGF0dW1zIGFyZSBlcXVhbFxuICAgICAgfVxuICAgIH0gLy8gY3NfY29tcGFyZV9kYXR1bXMoKVxuXG4gICAgLypcbiAgICAgKiBUaGUgZnVuY3Rpb24gQ29udmVydF9HZW9kZXRpY19Ub19HZW9jZW50cmljIGNvbnZlcnRzIGdlb2RldGljIGNvb3JkaW5hdGVzXG4gICAgICogKGxhdGl0dWRlLCBsb25naXR1ZGUsIGFuZCBoZWlnaHQpIHRvIGdlb2NlbnRyaWMgY29vcmRpbmF0ZXMgKFgsIFksIFopLFxuICAgICAqIGFjY29yZGluZyB0byB0aGUgY3VycmVudCBlbGxpcHNvaWQgcGFyYW1ldGVycy5cbiAgICAgKlxuICAgICAqICAgIExhdGl0dWRlICA6IEdlb2RldGljIGxhdGl0dWRlIGluIHJhZGlhbnMgICAgICAgICAgICAgICAgICAgICAoaW5wdXQpXG4gICAgICogICAgTG9uZ2l0dWRlIDogR2VvZGV0aWMgbG9uZ2l0dWRlIGluIHJhZGlhbnMgICAgICAgICAgICAgICAgICAgIChpbnB1dClcbiAgICAgKiAgICBIZWlnaHQgICAgOiBHZW9kZXRpYyBoZWlnaHQsIGluIG1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgKGlucHV0KVxuICAgICAqICAgIFggICAgICAgICA6IENhbGN1bGF0ZWQgR2VvY2VudHJpYyBYIGNvb3JkaW5hdGUsIGluIG1ldGVycyAgICAob3V0cHV0KVxuICAgICAqICAgIFkgICAgICAgICA6IENhbGN1bGF0ZWQgR2VvY2VudHJpYyBZIGNvb3JkaW5hdGUsIGluIG1ldGVycyAgICAob3V0cHV0KVxuICAgICAqICAgIFogICAgICAgICA6IENhbGN1bGF0ZWQgR2VvY2VudHJpYyBaIGNvb3JkaW5hdGUsIGluIG1ldGVycyAgICAob3V0cHV0KVxuICAgICAqXG4gICAgICovXG4gIC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sgZGF0dW1fcGFyYW1zWzFdLFxuICAgICAgICAgIHo6IHAueiArIGRhdHVtX3BhcmFtc1syXSxcbiAgICAgICAgfTtcbiAgICAgIH0gZWxzZSBpZiAoZGF0dW1fdHlwZSA9PT0gUEpEXzdQQVJBTSkge1xuICAgICAgICB2YXIgRHhfQkYgPSBkYXR1bV9wYXJhbXNbMF07XG4gICAgICAgIHZhciBEeV9CRiA9IGRhdHVtX3BhcmFtc1sxXTtcbiAgICAgICAgdmFyIER6X0JGID0gZGF0dW1fcGFyYW1zWzJdO1xuICAgICAgICB2YXIgUnhfQkYgPSBkYXR1bV9wYXJhbXNbM107XG4gICAgICAgIHZhciBSeV9CRiA9IGRhdHVtX3BhcmFtc1s0XTtcbiAgICAgICAgdmFyIFJ6X0JGID0gZGF0dW1fcGFyYW1zWzVdO1xuICAgICAgICB2YXIgTV9CRiA9IGRhdHVtX3BhcmFtc1s2XTtcbiAgICAgICAgLy8gaWYoIHhbaW9dID09PSBIVUdFX1ZBTCApXG4gICAgICAgIC8vICAgIGNvbnRpbnVlO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHg6IE1fQkYgKiAocC54IC0gUnpfQkYgKiBwLnkgKyBSeV9CRiAqIHAueikgKyBEeF9CRixcbiAgICAgICAgICB5OiBNX0JGICogKFJ6X0JGICogcC54ICsgcC55IC0gUnhfQkYgKiBwLnopICsgRHlfQkYsXG4gICAgICAgICAgejogTV9CRiAqICgtUnlfQkYgKiBwLnggKyBSeF9CRiAqIHAueSArIHAueikgKyBEel9CRlxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH0gLy8gY3NfZ2VvY2VudHJpY190b193Z3M4NFxuXG4gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXG4gICAgLy8gcGpfZ2VvY2VudGljX2Zyb21fd2dzODQoKVxuICAgIC8vICBjb29yZGluYXRlIHN5c3RlbSBkZWZpbml0aW9uLFxu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pZCBzaGlmdCBpdGVyYXRpb24gZmFpbGVkLCBwcmVzdW1hYmx5IGF0IGdyaWQgZWRnZS4gIFVzaW5nIGZpcnN0IGFwcHJveGltYXRpb24uXCIpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIGRpZiA9IHt4OiB0Yi54IC0gKGRlbC54ICsgdC54KSwgeTogdGIueSAtIChkZWwueSArIHQueSl9O1xuICAgICAgICAgIHQueCArPSBkaWYueDtcbiAgICAgICAgICB0LnkgKz0gZGlmLnk7XG4gICAgICAgIH0gd2hpbGUgKGktLSAmJiBNYXRoLmFicyhkaWYueCkgPiB0b2wgJiYgTWF0aC5hYnMoZGlmLnkpID4gdG9sKTtcbiAgICAgICAgaWYgKGkgPCAwKSB7XG4gICAgICAgICAgY29uc29sZS5sb2coXCJJbnZlcnNlIGdyaWQgc2hpZnQgaXRlcmF0b3IgZmFpbGVkIHRvIGNvbnZlcmdlLlwiKTtcbiAgICAgICAgICByZXR1cm4gdmFsO1xuICAgICAgICB9XG4gICAgICAgIHZhbC54ID0gYWRqdXN0X2xvbih0LnggKyBjdC5sbFswXSk7XG4gICAgICAgIHZhbC55ID0gdC55ICsgY3QubGxbMV07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoIWlzTmFOKHQueCkpIHtcbiAgICAgICAgICB2YWwueCA9IHBpbi54ICsgdC54O1xuICAgICAgICAgIHZhbC55ID0gcGluLnkgKyB0Lnk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiB2YWw7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbmFkSW50ZXJwb2xhdGUocGluLCBjdCkge1xuICAgICAgdmFyIHQgPSB7eDogcGluLnggLyBjdC5kZWxbMF0sIHk6IHBpbi55IC8gY3QuZGVsWzFdfTtcbiAgICAgIHZhciBpbmR4ID0ge3g6IE1hdGguZmxvb3IodC54KSwgeTogTWF0aC5mbG9vcih0LnkpfTtcbiAgICAgIHZhciBmcmN0ID0ge3g6IHQueCAtIDEuMCAqIGluZHgueCwgeTogdC55IC0gMS4wICogaW5keC55fTtcbiAgICAgIHZhciB2YWw9IHt4OiBOdW1iZXIuTmFOLCB5OiBOdW1iZXIuTmFOfTtcbiAgICAgIHZhciBpbng7XG4gICAgICBpZiAoaW5keC54IDwgMCB8fCBpbmR4LnggPj0gY3QubGltWzBdKSB7XG4gICAgICAgIHJldHVybiB2YWw7XG4gICAgICB9XG4gICAgICBpZiAoaW5keC55IDwgMCB8fCBpbmR4LnkgPj0gY3QubGltWzFdKSB7XG4gICAgICAgIHJldHVybiB2YWw7XG4gICAgICB9XG4gICAgICBpbnggPSAoaW5keC55ICogY3QubGltWzBdKSArIGluZHgueDtcbiAgICAgIHZhciBmMDAgPSB7eDogY3QuY3ZzW2lueF1bMF0sIHk6IGN0LmN2c1tpbnhdWzFdfTtcbiAgICAgIGlueCsrO1xuICAgICAgdmFyIGYxMD0ge3g6IGN0LmN2c1tpbnhdWzBdLCB5OiBjdC5jdnNbaW54XVsxXX07XG4gICAgICBpbnggKz0gY3QubGltWzBdO1xuICAgICAgdmFyIGYxMSA9IHt4OiBjdC5jdnNbaW54XVswXSwgeTogY3QuY3ZzW2lueF1bMV19O1xuICAgICAgaW54LS07XG4gICAgICB2YXIgZjAxID0ge3g6IGN0LmN2c1tpbnhdWzBdLCB5OiBjdC5jdnNbaW54XVsxXX07XG4gICAgICB2YXIgbTExID0gZnJjdC54ICogZnJjdC55LCBtMTAgPSBmcmN0LnggKiAoMS4wIC0gZnJjdC55KSxcbiAgICAgICAgbTAwID0gKDEuMCAtIGZyY3QueCkgKiAoMS4wIC0gZnJjdC55KSwgbTAxID0gKDEuMCAtIGZyY3QueCkgKiBmcmN0Lnk7XG4gICAgICB2YWwueCA9IChtMDAgKiBmMDAueCArIG0xMCAqIGYxMC54ICsgbTAxICogZjAxLnggKyBtMTEgKiBmMTEueCk7XG4gICAgICB2YWwueSA9IChtMDAgKiBmMDAueSArIG0xMCAqIGYxMC55ICsgbTAxICogZjAxLnkgKyBtMTEgKiBmMTEueSk7XG4gICAgICByZXR1cm4gdmFsO1xuICAgIH1cblxuICAgIHZhciBhZGp1c3RfYXhpcyA9IGZ1bmN0aW9uKGNycywgZGVub3JtLCBwb2ludCkge1xuICAgICAgdmFyIHhpbiA9IHBvaW50LngsXG4gICAgICAgIHlpbiA9IHBvaW50LnksXG4gICAgICAgIHppbiA9IHBvaW50LnogfHwgMC4wO1xuICAgICAgdmFyIHYsIHQsIGk7XG4gICAgICB2YXIgb3V0ID0ge307XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKSB7XG4gICAgICAgIGlmIChkZW5vcm0gJiYgaSA9PT0gMiAmJiBwb2ludC56ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaSA9PT0gMCkge1xuICAgICAgICAgIHYgPSB4aW47XG4gICAgICAgICAgaWYgKFwiZXdcIi5pbmRleE9mKGNycy5heGlzW2ldKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIHQgPSAneCc7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHQgPSAneSc7XG4gICAgICAgICAgfVxuXG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoaSA9PT0gMSkge1xuICAgICAgICAgIHYgPSB5aW47XG4gICAgICAgICAgaWYgKFwibnNcIi5pbmRleE9mKGNycy5heGlzW2ldKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIHQgPSAneSc7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHQgPSAneCc7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHYgPSB6aW47XG4gICAgICAgICAgdCA9ICd6JztcbiAgICAgICAgfVxuICAgICAgICBzd2l0Y2ggKGNycy5heGlzW2ldKSB7XG4gICAgICAgIGNhc2UgJ2UnOlxuICAgICAgICAgIG91dFt0XSA9IHY7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgJ3cnOlxuICAgICAgICAgIG91dFt0XSA9IC12O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlICduJzpcbiAgICAgICAgICBvdXRbdF0gPSB2O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICBvdXRbdF0gPSAtdjtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAndSc6XG4gICAgICAgICAgaWYgKHBvaW50W3RdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIG91dC56ID0gdjtcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgIGlmIChwb2ludFt0XSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBvdXQueiA9IC12O1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiRVJST1I6IHVua25vdyBheGlzIChcIitjcnMuYXhpc1tpXStcIikgLSBjaGVjayBkZWZpbml0aW9uIG9mIFwiK2Nycy5wcm9qTmFtZSk7XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBvdXQ7XG4gICAgfTtcblxuICAgIHZhciB0b1BvaW50ID0gZnVuY3Rpb24gKGFycmF5KXtcbiAgICAgIHZhciBvdXQgPSB7XG4gICAgICAgIHg6IGFycmF5WzBdLFxuICAgICAgICB5OiBhcnJheVsxXVxuICAgICAgfTtcbiAgICAgIGlmIChhcnJheS5sZW5ndGg+Mikge1xuICAgICAgICBvdXQueiA9IGFycmF5WzJdO1xuICAgICAgfVxuICAgICAgaWYgKGFycmF5Lmxlbmd0aD4zKSB7XG4gICAgICAgIG91dC5tID0gYXJyYX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G9pbnQueiB8fCAwXG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoc291cmNlLnRvX21ldGVyKSB7XG4gICAgICAgICAgcG9pbnQgPSB7XG4gICAgICAgICAgICB4OiBwb2ludC54ICogc291cmNlLnRvX21ldGVyLFxuICAgICAgICAgICAgeTogcG9pbnQueSAqIHNvdXJjZS50b19tZXRlcixcbiAgICAgICAgICAgIHo6IHBvaW50LnogfHwgMFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcG9pbnQgPSBzb3VyY2UuaW52ZXJzZShwb2ludCk7IC8vIENvbnZlcnQgQ2FydGVzaWFuIHRvIGxvbmdsYXRcbiAgICAgICAgaWYgKCFwb2ludCkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgLy8gQWRqdXN0IGZvciB0aGUgcHJpbWUgbWVyaWRpYW4gaWYgbmVjZXNzYXJ5XG4gICAgICBpZiAoc291cmNlLmZyb21fZ3JlZW53aWNoKSB7XG4gICAgICAgIHBvaW50LnggKz0gc291cmNlLmZyb21fZ3JlZW53aWNoO1xuICAgICAgfVxuXG4gICAgICAvLyBDb252ZXJ0IGRhdHVtcyBpZiBuZWVkZWQsIGFuZCBpZiBwb3NzaWJsZS5cbiAgICAgIHBvaW50ID0gZGF0dW1fdHJhbnNmb3JtKHNvdXJjZS5kYXR1bSwgZGVzdC5kYXR1bSwgcG9pbnQpO1xuICAgICAgaWYgKCFwb2ludCkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIC8vIEFkanVzdCBmb3IgdGhlIHByaW1lIG1lcmlkaWFuIGlmIG5lY2Vzc2FyeVxuICAgICAgaWYgKGRlc3QuZnJvbV9ncmVlbndpY2gpIHtcbiAgICAgICAgcG9pbnQgPSB7XG4gICAgICAgICAgeDogcG9pbnQueCAtIGRlc3QuZnJvbV9ncmVlbndpY2gsXG4gICAgICAgICAgeTogcG9pbnQueSxcbiAgICAgICAgICB6OiBwb2ludC56IHx8IDBcbiAgICAgICAgfTtcbiAgICAgIH1cblxuICAgICAgaWYgKGRlc3QucHJvak5hbWUgPT09ICdsb25nbGF0Jykge1xuICAgICAgICAvLyBjb252ZXJ0IHJhZGlhbnMgdG8gZGVjaW1hbCBkZWdyZWVzXG4gICAgICAgIHBvaW50ID0ge1xuICAgICAgICAgIHg6IHBvaW50LnggKiBSMkQsXG4gICAgICAgICAgeTogcG9pbnQueSAqIFIyRCxcbiAgICAgICAgICB6OiBwb2ludC56IHx8IDBcbiAgICAgICAgfTtcbiAgICAgIH0gZWxzZSB7IC8vIGVsc2UgcHJvamVjdFxuICAgICAgICBwb2ludCA9IGRlc3QuZm9yd2FyZChwb2ludCk7XG4gICAgICAgIGlmIChkZXN0LnRvX21ldGVyKSB7XG4gICAgICAgICAgcG9pbnQgPSB7XG4gICAgICAgICAgICB4OiBwb2ludC54IC8gZGVzdC50b19tZXRlcixcbiAgICAgICAgICAgIHk6IHBvaW50LnkgLyBkZXN0LnRvX21ldGVyLFxuICAgICAgICAgICAgejogcG9pbnQueiB8fCAwXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBER1IsIDIwMTAvMTEvMTJcbiAgICAgIGlmIChlbmZvcmNlQXhpcyAmJiBkZXN0LmF4aXMgIT09ICdlbnUnKSB7XG4gICAgICAgIHJldHVybiBhZGp1c3RfYXhpcyhkZXN0LCB0cnVlLCBwb2ludCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBwb2ludDtcbiAgICB9XG5cbiAgICB2YXIgd2dzODQgPSBQcm9qZWN0aW9uKCdXR1M4NCcpO1xuXG4gICAgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZnJvbSwgdG8sIGNvb3JkcywgZW5mb3JjZUF4aXMpIHtcbiAgICAgIHZhciB0cmFuc2Zvcm1lZEFycmF5LCBvdXQsIGtleXM7XG4gICAgICBpZiAoQXJyYXkuaXNBcnJheShj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m9tLCB0bywgY29vcmRzLCBlbmZvcmNlQXhpcyk7XG4gICAgICAgIGtleXMgPSBPYmplY3Qua2V5cyhjb29yZHMpO1xuICAgICAgICBpZiAoa2V5cy5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgICByZXR1cm4gb3V0O1xuICAgICAgICB9XG4gICAgICAgIGtleXMuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgaWYgKCh0eXBlb2YgZnJvbS5uYW1lICE9PSAndW5kZWZpbmVkJyAmJiBmcm9tLm5hbWUgPT09ICdnZW9jZW50JykgfHwgKHR5cGVvZiB0by5uYW1lICE9PSAndW5kZWZpbmVkJyAmJiB0by5uYW1lID09PSAnZ2VvY2VudCcpKSB7XG4gICAgICAgICAgICBpZiAoa2V5ID09PSAneCcgfHwga2V5ID09PSAneScgfHwga2V5ID09PSAneicpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoa2V5ID09PSAneCcgfHwga2V5ID09PSAneScpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBvdXRba2V5XSA9IGNvb3Jkc1trZXldO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIG91dDtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjaGVja1Byb2ooaXRlbSkge1xuICAgICAgaWYgKGl0ZW0gaW5zdGFuY2VvZiBQcm9qZWN0aW9uKSB7XG4gICAgICAgIHJldHVybiBpdGVtO1xuICAgICAgfVxuICAgICAgaWYgKGl0ZW0ub1Byb2opIHtcbiAgICAgICAgcmV0dXJuIGl0ZW0ub1Byb2o7XG4gICAgICB9XG4gICAgICByZXR1cm4gUHJvamVjdGlvbihpdGVtKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwcm9qNCQxKGZyb21Qcm9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gIExldHRlckRlc2lnbmF0b3IgPSAnVic7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoNTYgPiBsYXQpICYmIChsYXQgPj0gNDgpKSB7XG4gICAgICAgIExldHRlckRlc2lnbmF0b3IgPSAnVSc7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoNDggPiBsYXQpICYmIChsYXQgPj0gNDApKSB7XG4gICAgICAgIExldHRlckRlc2lnbmF0b3IgPSAnVCc7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoNDAgPiBsYXQpICYmIChsYXQgPj0gMzIpKSB7XG4gICAgICAgIExldHRlckRlc2lnbmF0b3IgPSAnUyc7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoMzIgPiBsYXQpICYmIChsYXQgPj0gMjQpKSB7XG4gICAgICAgIExldHRlckRlc2lnbmF0b3IgPSAnUic7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoMjQgPiBsYXQpICYmIChsYXQgPj0gMTYpKSB7XG4gICAgICAgIExldHRlckRlc2lnbmF0b3IgPSAnUSc7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoMTYgPiBsYXQpICYmIChsYXQgPj0gOCkpIHtcbiAgICAgICAgTGV0dGVyRGVzaWduYXRvciA9ICdQJztcbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKCg4ID4gbGF0KSAmJiAobGF0ID49IDApKSB7XG4gICAgICAgIExldHRlckRlc2lnbmF0b3IgPSAnTic7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoMCA+IGxhdCkgJiYgKGxhdCA+PSAtOCkpIHtcbiAgICAgICAgTGV0dGVyRGVzaWduYXRvciA9ICdNJztcbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKCgtOCA+IGxhdCkgJiYgKGxhdCA+PSAtMTYpKSB7XG4gICAgICAgIExldHRlckRlc2lnbmF0b3IgPSAnTCc7XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgoLTE2ID4gbGF0KSAmJiAobGF0ID49I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iAgICAgIHZhciBpbmRleCA9IHBhcm0gLSAxO1xuICAgICAgdmFyIGNvbE9yaWdpbiA9IFNFVF9PUklHSU5fQ09MVU1OX0xFVFRFUlMuY2hhckNvZGVBdChpbmRleCk7XG4gICAgICB2YXIgcm93T3JpZ2luID0gU0VUX09SSUdJTl9ST1dfTEVUVEVSUy5jaGFyQ29kZUF0KGluZGV4KTtcblxuICAgICAgLy8gY29sSW50IGFuZCByb3dJbnQgYXJlIHRoZSBsZXR0ZXJzIHRvIGJ1aWxkIHRvIHJldHVyblxuICAgICAgdmFyIGNvbEludCA9IGNvbE9yaWdpbiArIGNvbHVtbiAtIDE7XG4gICAgICB2YXIgcm93SW50ID0gcm93T3JpZ2luICsgcm93O1xuICAgICAgdmFyIHJvbGxvdmVyID0gZmFsc2U7XG5cbiAgICAgIGlmIChjb2xJbnQgPiBaKSB7XG4gICAgICAgIGNvbEludCA9IGNvbEludCAtIFogKyBBIC0gMTtcbiAgICAgICAgcm9sbG92ZXIgPSB0cnVlO1xuICAgICAgfVxuXG4gICAgICBpZiAoY29sSW50ID09PSBJIHx8IChjb2xPcmlnaW4gPCBJICYmIGNvbEludCA+IEkpIHx8ICgoY29sSW50ID4gSSB8fCBjb2xPcmlnaW4gPCBJKSAmJiByb2xsb3ZlcikpIHtcbiAgICAgICAgY29sSW50Kys7XG4gICAgICB9XG5cbiAgICAgIGlmIChjb2xJbnQgPT09IE8gfHwgKGNvbE9yaWdpbiA8IE8gJiYgY29sSW50ID4gTykgfHwgKChjb2xJbnQgPiBPIHx8IGNvbE9yaWdpbiA8IE8pICYmIHJvbGxvdmVyKSkge1xuICAgICAgICBjb2xJbnQrKztcblxuICAgICAgICBpZiAoY29sSW50ID09PSBJKSB7XG4gICAgICAgICAgY29sSW50Kys7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGNvbEludCA+IFopIHtcbiAgICAgICAgY29sSW50ID0gY29sSW50IC0gWiArIEEgLSAxO1xuICAgICAgfVxuXG4gICAgICBpZiAocm93SW50ID4gVikge1xuICAgICAgICByb3dJbnQgPSByb3dJbnQgLSBWICsgQSAtIDE7XG4gICAgICAgIHJvbGxvdmVyID0gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICByb2xsb3ZlciA9IGZhbHNlO1xuICAgICAgfVxuXG4gICAgICBpZiAoKChyb3dJbnQgPT09IEkpIHx8ICgocm93T3JpZ2luIDwgSSkgJiYgKHJvd0ludCA+IEkpKSkgfHwgKCgocm93SW50ID4gSSkgfHwgKHJvd09yaWdpbiA8IEkpKSAmJiByb2xsb3ZlcikpIHtcbiAgICAgICAgcm93SW50Kys7XG4gICAgICB9XG5cbiAgICAgIGlmICgoKHJvd0ludCA9PT0gTykgfHwgKChyb3dPcmlnaW4gPCBPKSAmJiAocm93SW50ID4gTykpKSB8fCAoKChyb3dJbnQgPiBPKSB8fCAocm93T3JpZ2luIDwgTykpICYmIHJvbGxvdmVyKSkge1xuICAgICAgICByb3dJbnQrKztcblxuICAgICAgICBpZiAocm93SW50ID09PSBJKSB7XG4gICAgICAgICAgcm93SW50Kys7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHJvd0ludCA+IFYpIHtcbiAgICAgICAgcm93SW50ID0gcm93SW50IC0gViArIEEgLSAxO1xuICAgICAgfVxuXG4gICAgICB2YXIgdHdvTGV0dGVyID0gU3RyaW5nLmZyb21DaGFyQ29kZShjb2xJbnQpICsgU3RyaW5nLmZyb21DaGFyQ29kZShyb3dJbnQpO1xuICAgICAgcmV0dXJuIHR3b0xldHRlcjtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBEZWNvZGUgdGhlIFVUTSBwYXJhbWV0ZXJzIGZyb20gYSBNR1JTIHN0cmluZy5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG1ncnNTdHJpbmcgYW4gVVBQRVJDQVNFIGNvb3JkaW5hdGUgc3RyaW5n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ICAgIGNhc2UgJ0cnOlxuICAgICAgICBub3J0aGluZyA9IDQ2MDAwMDAuMDtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdIJzpcbiAgICAgICAgbm9ydGhpbmcgPSA1NTAwMDAwLjA7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnSic6XG4gICAgICAgIG5vcnRoaW5nID0gNjQwMDAwMC4wO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ0snOlxuICAgICAgICBub3J0aGluZyA9IDczMDAwMDAuMDtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdMJzpcbiAgICAgICAgbm9ydGhpbmcgPSA4MjAwMDAwLjA7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnTSc6XG4gICAgICAgIG5vcnRoaW5nID0gOTEwMDAwMC4wO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ04nOlxuICAgICAgICBub3J0aGluZyA9IDAuMDtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdQJzpcbiAgICAgICAgbm9ydGhpbmcgPSA4MDAwMDAuMDtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdRJzpcbiAgICAgICAgbm9ydGhpbmcgPSAxNzAwMDAwLjA7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnUic6XG4gICAgICAgIG5vcnRoaW5nID0gMjYwMDAwMC4wO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ1MnOlxuICAgICAgICBub3J0aGluZyA9IDM1MDAwMDAuMDtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdUJzpcbiAgICAgICAgbm9ydGhpbmcgPSA0NDAwMDAwLjA7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnVSc6XG4gICAgICAgIG5vcnRoaW5nID0gNTMwMDAwMC4wO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ1YnOlxuICAgICAgICBub3J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6IDA7XG5cbiAgICAgIGlmICh0aGlzLmVzKSB7XG4gICAgICAgIHRoaXMuZW4gPSBwal9lbmZuKHRoaXMuZXMpO1xuICAgICAgICB0aGlzLm1sMCA9IHBqX21sZm4odGhpcy5sYXQwLCBNYXRoLnNpbih0aGlzLmxhdDApLCBNYXRoLmNvcyh0aGlzLmxhdDApLCB0aGlzLmVuKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgICAgVHJhbnN2ZXJzZSBNZXJjYXRvciBGb3J3YXJkICAtIGxvbmcvbGF0IHRvIHgveVxuICAgICAgICBsb25nL2xhdCBpbiByYWRpYW5zXG4gICAgICAqL1xuICAgIGZ1bmN0aW9uIGZvcndhcmQkMihwKSB7XG4gICAgICB2YXIgbG9uID0gcC54O1xuICAgICAgdmFyIGxhdCA9IHAueTtcblxuICAgICAgdmFyIGRlbHRhX2xvbiA9IGFkanVzdF9sb24obG9uIC0gdGhpcy5sb25nMCk7XG4gICAgICB2YXIgY29uO1xuICAgICAgdmFyIHgsIHk7XG4gICAgICB2YXIgc2luX3BoaSA9IE1hdGguc2luKGxhdCk7XG4gICAgICB2YXIgY29zX3BoaSA9IE1hdGguY29zKGxhdCk7XG5cbiAgICAgIGlmICghdGhpcy5lcykge1xuICAgICAgICB2YXIgYiA9IGNvc19waGkgKiBNYXRoLnNpbihkZWx0YV9sb24pO1xuXG4gICAgICAgIGlmICgoTWF0aC5hYnMoTWF0aC5hYnMoYikgLSAxKSkgPCBFUFNMTikge1xuICAgICAgICAgIHJldHVybiAoOTMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHggPSAwLjUgKiB0aGlzLmEgKiB0aGlzLmswICogTWF0aC5sb2coKDEgKyBiKSAvICgxIC0gYikpICsgdGhpcy54MDtcbiAgICAgICAgICB5ID0gY29zX3BoaSAqIE1hdGguY29zKGRlbHRhX2xvbikgLyBNYXRoLnNxcnQoMSAtIE1hdGgucG93KGIsIDIpKTtcbiAgICAgICAgICBiID0gTWF0aC5hYnMoeSk7XG5cbiAgICAgICAgICBpZiAoYiA+PSAxKSB7XG4gICAgICAgICAgICBpZiAoKGIgLSAxKSA+IEVQU0xOKSB7XG4gICAgICAgICAgICAgIHJldHVybiAoOTMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIHkgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHkgPSBNYXRoLmFjb3MoeSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGxhdCA8IDApIHtcbiAgICAgICAgICAgIHkgPSAteTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB5ID0gdGhpcy5hICogdGhpcy5rMCAqICh5IC0gdGhpcy5sYXQwKSArIHRoaXMueTA7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICB2YXIgYWwgPSBjb3NfcGhpICogZGVsdGFfbG9uO1xuICAgICAgICB2YXIgYWxzID0gTWF0aC5wb3coYWwsIDIpO1xuICAgICAgICB2YXIgYyA9IHRoaXMuZXAyICogTWF0aC5wb3coY29zX3BoaSwgMik7XG4gICAgICAgIHZhciBjcyA9IE1hdGgucG93KGMsIDIpO1xuICAgICAgICB2YXIgdHEgPSBNYXRoLmFicyhjb3NfcGhpKSA+IEVQU0xOID8gTWF0aC50YW4obGF0KSA6IDA7XG4gICAgICAgIHZhciB0ID0gTWF0aC5wb3codHEsIDIpO1xuICAgICAgICB2YXIgdHMgPSBNYXRoLnBvdyh0LCAyKTtcbiAgICAgICAgY29uID0gMSAtIHRoaXMuZXMgKiBNYXRoLnBvdyhzaW5fcGhpLCAyKTtcbiAgICAgICAgYWwgPSBhbCAvIE1hdGguc3FydChjb24pO1xuICAgICAgICB2YXIgbWwgPSBwal9tbGZuKGxhdCwgc2luX3BoaSwgY29zX3BoaSwgdGhpcy5lbik7XG5cbiAgICAgICAgeCA9IHRoaXMuYSAqICh0aGlzLmswICogYWwgKiAoMSArXG4gICAgICAgICAgYWxzIC8gNiAqICgxIC0gdCArIGMgK1xuICAgICAgICAgIGFscyAvIDIwICogKDUgLSAxOCAqIHQgKyB0cyArIDE0ICogYyAtIDU4ICogdCAqIGMgK1xuICAgICAgICAgIGFscyAvIDQyICogKDYxICsgMTc5ICogdHMgLSB0cyAqIHQgLSA0NzkgKiB0KSkpKSkgK1xuICAgICAgICAgIHRoaXMueDA7XG5cbiAgICAgICAgeSA9IHRoaXMuYSAqICh0aGlzLmswICogKG1sIC0gdGhpcy5tbDAgK1xuICAgICAgICAgIHNpbl9waGkgKiBkZWx0YV9sb24gKiBhbCAvIDIgKiAoMSArXG4gICAgICAgICAgYWxzIC8gMTIgKiAoNSAtIHQgKyA5ICogYyArIDQgKiBjcyArXG4gICAgICAgICAgYWxzIC8gMzAgKiAoNjEgKyB0cyAtIDU4ICogdCArIDI3MCAqIGMgLSAzMzAgKiB0ICogYyArXG4gICAgICAgICAgYWxzIC8gNTYgKiAoMTM4NSArIDU0MyAqIHRzIC0gdHMgKiB0IC0gMzExMSAqIHQpKSkpKSkgK1xuICAgICAgICAgIHRoaXMueTA7XG4gICAgICB9XG5cbiAgICAgIHAueCA9IHg7XG4gICAgICBwLnkgPSB5O1xuXG4gICAgICByZXR1cm4gcDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgICAgVHJhbnN2ZXJzZSBNZXJjYXRvciBJbnZlcnNlICAtICB4L3kgdG8gbG9uZy9sYXRcbiAgICAgICovXG4gICAgZnVuY3Rpb24gaW52ZXJzZSQyKHApIHtcbiAgICAgIHZhciBjb24sIHBoaTtcbiAgICAgIHZhciBsYXQsIGxvbjtcbiAgICAgIHZhciB4ID0gKHAueCAtIHRoaXMueDApICogKDEgLyB0aGlzLmEpO1xuICAgICAgdmFyIHkgPSAocC55IC0gdGhpcy55MCkgKiAoMSAvIHRoaXMuYSk7XG5cbiAgICAgIGlmICghdGhpcy5lcykge1xuICAgICAgICB2YXIgZiA9IE1hdGguZXhwKHggLyB0aGlzLmswKTtcbiAgICAgICAgdmFyIGcgPSAwLjUgKiAoZiAtIDEgLyBmKTtcbiAgICAgICAgdmFyIHRlbXAgPSB0aGlzLmxhdDAgKyB5IC8gdGhpcy5rMDtcbiAgICAgICAgdmFyIGggPSBNYXRoLmNvcyh0ZW1wKTtcbiAgICAgICAgY29uID0gTWF0aC5zcXJ0KCgxIC0gTWF0aC5wb3coaCwgMikpIC8gKDEgKyBNYXRoLnBvdyhnLCAyKSkpO1xuICAgICAgICBsYXQgPSBNYXRoLmFzaW4oY29uKTtcblxuICAgICAgICBpZiAoeSA8IDApIHtcbiAgICAgICAgICBsYXQgPSAtbGF0O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKChnID09PSAwKSAmJiAoaCA9PT0gMCkpIHtcbiAgICAgICAgICBsb24gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIGxvbiA9IGFkanVzdF9sb24oTWF0aC5hdGFuMihnLCBoKSArIHRoaXMubG9uZzApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHsgLy8gZWxsaXBzb2lkYWwgZm9ybVxuICAgICAgICBjb24gPSB0aGlzLm1sMCArIHkgLyB0aGlzLmswO1xuICAgICAgICBwaGkgPSBwal9pbnZfbWxmbihjb24sIHRoaXMuZXMsIHRoaXMuZW4pO1xuXG4gICAgICAgIGlmIChNYXRoLmFicyhwaGkpIDwgSEFMRl9QSSkge1xuICAgICAgICAgIHZhciBzaW5fcGhpID0gTWF0aC5zaW4ocGhpKTtcbiAgICAgICAgICB2YXIgY29zX3BoaSA9IE1hdGguY29zKHBoaSk7XG4gICAgICAgICAgdmFyIHRhbl9waGkgPSBNYXRoLmFicyhjb3NfcGhpKSA+IEVQU0xOID8gTWF0aC50YW4ocGhpKSA6IDA7XG4gICAgICAgICAgdmFyIGMgPSB0aGlzLmVwMiAqIE1hdGgucG93KGNvc19waGksIDIpO1xuICAgICAgICAgIHZhciBjcyA9IE1hdGgucG93KGMsIDIpO1xuICAgICAgICAgIHZhciB0ID0gTWF0aC5wb3codGFuX3BoaSwgMik7XG4gICAgICAgICAgdmFyIHRzID0gTWF0aC5wb3codCwgMik7XG4gICAgICAgICAgY29uID0gMSAtIHRoaXMuZXMgKiBNYXRoLnBvdyhzaW5fcGhpLCAyKTtcbiAgICAgICAgICB2YXIgZCA9IHggKiBNYXRoLnNxcnQoY29uKSAvIHRoaXMuazA7XG4gICAgICAgICAgdmFyIGRzID0gTWF0aC5wb3coZCwgMik7XG4gICAgICAgICAgY29uID0gY29uICogdGFuX3BoaTtcblxuICAgICAgICAgIGxhdCA9IHBoaSAtIChjb24gKiBkcyAvICgxIC0gdGhpcy5lcykpICogMC41ICogKDEgLVxuICAgICAgICAgICAgZHMgLyAxMiAqICg1ICsgMyAqIHQgLSA5ICogYyAqIHQgKyBjIC0gNCAqIGNzIC1cbiAgICAgICAgICAgIGRzIC8gMzAgKiAoNjEgKyA5MCAqIHQgLSAyNTIgKiBjICogdCArIDQ1ICogdHMgKyA0NiAqIGMgLVxuICAgICAgICAgICAgZHMgLyA1NiAqICgxMzg1ICsgMzYzMyAqIHQgKyA0MDk1ICogdHMgKyAxNTc0ICogdHMgKiB0KSkpKTtcblxuICAgICAgICAgIGxvbiA9IGFkanVzdF9sb24odGhpcy5sb25nMCArIChkICogKDEgLVxuICAgICAgICAgICAgZHMgLyA2ICogKDEgKyAyICogdCArIGMgLVxuICAgICAgICAgICAgZHMgLyAyMCAqICg1ICsgMjggKiB0ICsgMjQgKiB0cyArIDggKiBjICogdCArIDYgKiBjIC1cbiAgICAgICAgICAgIGRzIC8gNDIgKiAoNjEgKyA2NjIgKiB0ICsgMTMyMCAqIHRzICsgNzIwICogdHMgKiB0KSkpKSAvIGNvc19waGkpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBsYXQgPSBIQUxGX1BJ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dGguYWJzKHgpO1xuICAgICAgeSA9IGxvZzFweSh5ICogKDEgKyB5IC8gKGh5cG90KDEsIHkpICsgMSkpKTtcblxuICAgICAgcmV0dXJuIHggPCAwID8gLXkgOiB5O1xuICAgIH07XG5cbiAgICB2YXIgZ2F0ZyA9IGZ1bmN0aW9uKHBwLCBCKSB7XG4gICAgICB2YXIgY29zXzJCID0gMiAqIE1hdGguY29zKDIgKiBCKTtcbiAgICAgIHZhciBpID0gcHAubGVuZ3RoIC0gMTtcbiAgICAgIHZhciBoMSA9IHBwW2ldO1xuICAgICAgdmFyIGgyID0gMDtcbiAgICAgIHZhciBoO1xuXG4gICAgICB3aGlsZSAoLS1pID49IDApIHtcbiAgICAgICAgaCA9IC1oMiArIGNvc18yQiAqIGgxICsgcHBbaV07XG4gICAgICAgIGgyID0gaDE7XG4gICAgICAgIGgxID0gaDtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIChCICsgaCAqIE1hdGguc2luKDIgKiBCKSk7XG4gICAgfTtcblxuICAgIHZhciBjbGVucyA9IGZ1bmN0aW9uKHBwLCBhcmdfcikge1xuICAgICAgdmFyIHIgPSAyICogTWF0aC5jb3MoYXJnX3IpO1xuICAgICAgdmFyIGkgPSBwcC5sZW5ndGggLSAxO1xuICAgICAgdmFyIGhyMSA9IHBwW2ldO1xuICAgICAgdmFyIGhyMiA9IDA7XG4gICAgICB2YXIgaHI7XG5cbiAgICAgIHdoaWxlICgtLWkgPj0gMCkge1xuICAgICAgICBociA9IC1ocjIgKyByICogaHIxICsgcHBbaV07XG4gICAgICAgIGhyMiA9IGhyMTtcbiAgICAgICAgaHIxID0gaHI7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBNYXRoLnNpbihhcmdfcikgKiBocjtcbiAgICB9O1xuXG4gICAgdmFyIGNvc2ggPSBmdW5jdGlvbih4KSB7XG4gICAgICB2YXIgciA9IE1hdGguZXhwKHgpO1xuICAgICAgciA9IChyICsgMSAvIHIpIC8gMjtcbiAgICAgIHJldHVybiByO1xuICAgIH07XG5cbiAgICB2YXIgY2xlbnNfY21wbHggPSBmdW5jdGlvbihwcCwgYXJnX3IsIGFyZ19pKSB7XG4gICAgICB2YXIgc2luX2FyZ19yID0gTWF0aC5zaW4oYXJnX3IpO1xuICAgICAgdmFyIGNvc19hcmdfciA9IE1hdGguY29zKGFyZ19yKTtcbiAgICAgIHZhciBzaW5oX2FyZ19pID0gc2luaChhcmdfaSk7XG4gICAgICB2YXIgY29zaF9hcmdfaSA9IGNvc2goYXJnX2kpO1xuICAgICAgdmFyIHIgPSAyICogY29zX2FyZ19yICogY29zaF9hcmdfaTtcbiAgICAgIHZhciBpID0gLTIgKiBzaW5fYXJnX3IgKiBzaW5oX2FyZ19pO1xuICAgICAgdmFyIGogPSBwcC5sZW5ndGggLSAxO1xuICAgICAgdmFyIGhyID0gcHBbal07XG4gICAgICB2YXIgaGkxID0gMDtcbiAgICAgIHZhciBocjEgPSAwO1xuICAgICAgdmFyIGhpID0gMDtcbiAgICAgIHZhciBocjI7XG4gICAgICB2YXIgaGkyO1xuXG4gICAgICB3aGlsZSAoLS1qID49IDApIHtcbiAgICAgICAgaHIyID0gaHIxO1xuICAgICAgICBoaTIgPSBoaTE7XG4gICAgICAgIGhyMSA9IGhyO1xuICAgICAgICBoaTEgPSBoaTtcbiAgICAgICAgaHIgPSAtaHIyICsgciAqIGhyMSAtIGkgKiBoaTEgKyBwcFtqXTtcbiAgICAgICAgaGkgPSAtaGkyICsgaSAqIGhyMSArIHIgKiBoaTE7XG4gICAgICB9XG5cbiAgICAgIHIgPSBzaW5fYXJnX3IgKiBjb3NoX2FyZ19pO1xuICAgICAgaSA9IGNvc19hcmdfciAqIHNpbmhfYXJnX2k7XG5cbiAgICAgIHJldHVybiBbciAqIGhyIC0gaSAqIGhpLCByICogaGkgKyBpICogaHJdO1xuICAgIH07XG5cbiAgICAvLyBIZWF2aWx5IGJhc2VkIG9uIHRoaXMgZXRtZXJjIHByb2plY3Rpb24gaW1wbGVtZW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xuICAgICAgICBYID0gMiAqIE1hdGguYXRhbih0aGlzLnNzZm5fKGxhdCwgc2lubGF0LCB0aGlzLmUpKSAtIEhBTEZfUEk7XG4gICAgICAgIGNvc1ggPSBNYXRoLmNvcyhYKTtcbiAgICAgICAgc2luWCA9IE1hdGguc2luKFgpO1xuICAgICAgICBpZiAoTWF0aC5hYnModGhpcy5jb3NsYXQwKSA8PSBFUFNMTikge1xuICAgICAgICAgIHRzID0gdHNmbnoodGhpcy5lLCBsYXQgKiB0aGlzLmNvbiwgdGhpcy5jb24gKiBzaW5sYXQpO1xuICAgICAgICAgIHJoID0gMiAqIHRoaXMuYSAqIHRoaXMuazAgKiB0cyAvIHRoaXMuY29ucztcbiAgICAgICAgICBwLnggPSB0aGlzLngwICsgcmggKiBNYXRoLnNpbihsb24gLSB0aGlzLmxvbmcwKTtcbiAgICAgICAgICBwLnkgPSB0aGlzLnkwIC0gdGhpcy5jb24gKiByaCAqIE1hdGguY29zKGxvbiAtIHRoaXMubG9uZzApO1xuICAgICAgICAgIC8vdHJhY2UocC50b1N0cmluZygpKTtcbiAgICAgICAgICByZXR1cm4gcDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChNYXRoLmFicyh0aGlzLnNpbmxhdDApIDwgRVBTTE4pIHtcbiAgICAgICAgICAvL0VxXG4gICAgICAgICAgLy90cmFjZSgnc3RlcmU6ZXF1YXRldXInKTtcbiAgICAgICAgICBBID0gMiAqIHRoaXMuYSAqIHRoaXMuazAgLyAoMSArIGNvc1ggKiBNYXRoLmNvcyhkbG9uKSk7XG4gICAgICAgICAgcC55ID0gQSAqIHNpblg7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgLy9vdGhlciBjYXNlXG4gICAgICAgICAgLy90cmFjZSgnc3RlcmU6bm9ybWFsIGNhc2UnKTtcbiAgICAgICAgICBBID0gMiAqIHRoaXMuYSAqIHRoaXMuazAgKiB0aGlzLm1zMSAvICh0aGlzLmNvc1gwICog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MCAvIHJoKTtcbiAgICAgICAgaWYgKE1hdGguYWJzKHRoaXMuY29zbGF0MCkgPCBFUFNMTikge1xuICAgICAgICAgIGlmICh0aGlzLmxhdDAgPiAwKSB7XG4gICAgICAgICAgICBsb24gPSBhZGp1c3RfbG9uKHRoaXMubG9uZzAgKyBNYXRoLmF0YW4yKHAueCwgLSAxICogcC55KSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgTWF0aC5hdGFuMihwLngsIHAueSkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBsb24gPSBhZGp1c3RfbG9uKHRoaXMubG9uZzAgKyBNYXRoLmF0YW4yKHAueCAqIE1hdGguc2luKGMpLCByaCAqIHRoaXMuY29zbGF0MCAqIE1hdGguY29zKGMpIC0gcC55ICogdGhpcy5zaW5sYXQwICogTWF0aC5zaW4oYykpKTtcbiAgICAgICAgfVxuICAgICAgICBwLnggPSBsb247XG4gICAgICAgIHAueSA9IGxhdDtcbiAgICAgICAgcmV0dXJuIHA7XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgaWYgKE1hdGguYWJzKHRoaXMuY29zbGF0MCkgPD0gRVBTTE4pIHtcbiAgICAgICAgICBpZiAocmggPD0gRVBTTE4pIHtcbiAgICAgICAgICAgIGxhdCA9IHRoaXMubGF0MDtcbiAgICAgICAgICAgIGxvbiA9IHRoaXMubG9uZzA7XG4gICAgICAgICAgICBwLnggPSBsb247XG4gICAgICAgICAgICBwLnkgPSBsYXQ7XG4gICAgICAgICAgICAvL3RyYWNlKHAudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICByZXR1cm4gcDtcbiAgICAgICAgICB9XG4gICAgICAgICAgcC54ICo9IHRoaXMuY29uO1xuICAgICAgICAgIHAueSAqPSB0aGlzLmNvbjtcbiAgICAgICAgICB0cyA9IHJoICogdGhpcy5jb25zIC8gKDIgKiB0aGlzLmEgKiB0aGlzLmswKTtcbiAgICAgICAgICBsYXQgPSB0aGlzLmNvbiAqIHBoaTJ6KHRoaXMuZSwgdHMpO1xuICAgICAgICAgIGxvbiA9IHRoaXMuY29uICogYWRqdXN0X2xvbih0aGlzLmNvbiAqIHRoaXMubG9uZzAgKyBNYXRoLmF0YW4yKHAueCwgLSAxICogcC55KSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgY2UgPSAyICogTWF0aC5hdGFuKHJoICogdGhpcy5jb3NYMCAvICgyICogdGhpcy5hICogdGhpcy5rMCAqIHRoaXMubXMxKSk7XG4gICAgICAgICAgbG9uID0gdGhpcy5sb25nMDtcbiAgICAgICAgICBpZiAocmggPD0gRVBTTE4pIHtcbiAgICAgICAgICAgIENoaSA9IHRoaXMuWDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgQ2hpID0gTWF0aC5hc2luKE1hdGguY29zKGNlKSAqIHRoaXMuc2luWDAgKyBwLnkgKiBNYXRoLnNpbihjZSkgKiB0aGlzLmNvc1gwIC8gcmgpO1xuICAgICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgTWF0aC5hdGFuMihwLnggKiBNYXRoLnNpbihjZSksIHJoICogdGhpcy5jb3NYMCAqIE1hdGguY29zKGNlKSAtIHAueSAqIHRoaXMuc2luWDAgKiBNYXRoLnNpbihjZSkpKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgbGF0ID0gLTEgKiBwaGkyeih0aGlzLmUsIE1hdGgudGFuKDAuNSAqIChIQUxGX1BJICsgQ2hpKSkpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBwLnggPSBsb247XG4gICAgICBwLnkgPSBsYXQ7XG5cbiAgICAgIC8vdHJhY2UocC50b1N0cmluZygpKTtcbiAgICAgIHJldHVybiBwO1xuXG4gICAgfVxuXG4gICAgdmFyIG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wLnkpKSwgdGhpcy5CKTtcbiAgICAgICAgXG4gICAgICAgIHRlbXAgPSAxIC8gVztcbiAgICAgICAgUyA9IDAuNSAqIChXIC0gdGVtcCk7XG4gICAgICAgIFQgPSAwLjUgKiAoVyArIHRlbXApO1xuICAgICAgICBWID0gTWF0aC5zaW4odGhpcy5CICogcC54KTtcbiAgICAgICAgVSA9IChTICogdGhpcy5zaW5nYW0gLSBWICogdGhpcy5jb3NnYW0pIC8gVDtcbiAgICAgICAgICAgIFxuICAgICAgICBpZiAoTWF0aC5hYnMoTWF0aC5hYnMoVSkgLSAxLjApIDwgRVBTTE4pIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoKTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgdiA9IDAuNSAqIHRoaXMuQXJCICogTWF0aC5sb2coKDEgLSBVKS8oMSArIFUpKTtcbiAgICAgICAgdGVtcCA9IE1hdGguY29zKHRoaXMuQiAqIHAueCk7XG4gICAgICAgIFxuICAgICAgICBpZiAoTWF0aC5hYnModGVtcCkgPCBUT0wpIHtcbiAgICAgICAgICB1ID0gdGhpcy5BICogcC54O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHUgPSB0aGlzLkFyQiAqIE1hdGguYXRhbjIoKFMgKiB0aGlzLmNvc2dhbSArIFYgKiB0aGlzLnNpbmdhbSksIHRlbXApO1xuICAgICAgICB9ICAgIFxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdiA9IHAueSA+IDAgPyB0aGlzLnZfcG9sZV9uIDogdGhpcy52X3BvbGVfcztcbiAgICAgICAgdSA9IHRoaXMuQXJCICogcC55O1xuICAgICAgfVxuICAgICAgICAgXG4gICAgICBpZiAodGhpcy5ub19yb3QpIHtcbiAgICAgICAgY29vcmRzLnggPSB1O1xuICAgICAgICBjb29yZHMueSA9IHY7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB1IC09IHRoaXMudV8wO1xuICAgICAgICBjb29yZHMueCA9IHYgK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gICAgdmFyIG9tZXJjID0ge1xuICAgICAgaW5pdDogaW5pdCQ5LFxuICAgICAgZm9yd2FyZDogZm9yd2FyZCQ4LFxuICAgICAgaW52ZXJzZTogaW52ZXJzZSQ4LFxuICAgICAgbmFtZXM6IG5hbWVzJDEwXG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIGluaXQkMTAoKSB7XG4gICAgICBcbiAgICAgIC8vZG91YmxlIGxhdDA7ICAgICAgICAgICAgICAgICAgICAvKiB0aGUgcmVmZXJlbmNlIGxhdGl0dWRlICAgICAgICAgICAgICAgKi9cbiAgICAgIC8vZG91YmxlIGxvbmcwOyAgICAgICAgICAgICAgICAgICAvKiB0aGUgcmVmZXJlbmNlIGxvbmdpdHVkZSAgICAgICAgICAgICAgKi9cbiAgICAgIC8vZG91YmxlIGxhdDE7ICAgICAgICAgICAgICAgICAgICAvKiBmaXJzdCBzdGFuZGFyZCBwYXJhbGxlbCAgICAgICAgICAgICAgKi9cbiAgICAgIC8vZG91YmxlIGxhdDI7ICAgICAgICAgICAgICAgICAgICAvKiBzZWNvbmQgc3RhbmRhcmQgcGFyYWxsZWwgICAgICAgICAgICAgKi9cbiAgICAgIC8vZG91YmxlIHJfbWFqOyAgICAgICAgICAgICAgICAgICAvKiBtYWpvciBheGlzICAgICAgICAgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgIC8vZG91YmxlIHJfbWluOyAgICAgICAgICAgICAgICAgICAvKiBtaW5vciBheGlzICAgICAgICAgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgIC8vZG91YmxlIGZhbHNlX2Vhc3Q7ICAgICAgICAgICAgICAvKiB4IG9mZnNldCBpbiBtZXRlcnMgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgIC8vZG91YmxlIGZhbHNlX25vcnRoOyAgICAgICAgICAgICAvKiB5IG9mZnNldCBpbiBtZXRlcnMgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgIFxuICAgICAgLy90aGUgYWJvdmUgdmFsdWUgY2F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O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIHRoaXMuRVFVSVQ6XG4gICAgICAgICAgdGhpcy5ycSA9IE1hdGguc3FydCgwLjUgKiB0aGlzLnFwKTtcbiAgICAgICAgICB0aGlzLmRkID0gMSAvIHRoaXMucnE7XG4gICAgICAgICAgdGhpcy54bWYgPSAxO1xuICAgICAgICAgIHRoaXMueW1mID0gMC41ICogdGhpcy5xcDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSB0aGlzLk9CTElROlxuICAgICAgICAgIHRoaXMucnEgPSBNYXRoLnNxcnQoMC41ICogdGhpcy5xcCk7XG4gICAgICAgICAgc2lucGhpID0gTWF0aC5zaW4odGhpcy5sYXQwKTtcbiAgICAgICAgICB0aGlzLnNpbmIxID0gcXNmbnoodGhpcy5lLCBzaW5waGkpIC8gdGhpcy5xcDtcbiAgICAgICAgICB0aGlzLmNvc2IxID0gTWF0aC5zcXJ0KDEgLSB0aGlzLnNpbmIxICogdGhpcy5zaW5iMSk7XG4gICAgICAgICAgdGhpcy5kZCA9IE1hdGguY29zKHRoaXMubGF0MCkgLyAoTWF0aC5zcXJ0KDEgLSB0aGlzLmVzICogc2lucGhpICogc2lucGhpKSAqIHRoaXMucnEgKiB0aGlzLmNvc2IxKTtcbiAgICAgICAgICB0aGlzLnltZiA9ICh0aGlzLnhtZiA9IHRoaXMucnEpIC8gdGhpcy5kZDtcbiAgICAgICAgICB0aGlzLnhtZiAqPSB0aGlzLmRkO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgaWYgKHRoaXMubW9kZSA9PT0gdGhpcy5PQkxJUSkge1xuICAgICAgICAgIHRoaXMuc2lucGgwID0gTWF0aC5zaW4odGhpcy5sYXQwKTtcbiAgICAgICAgICB0aGlzLmNvc3BoMCA9IE1hdGguY29zKHRoaXMubGF0MCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9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kpO1xuICAgICAgICAgIHggPSB5ICogY29zcGhpICogTWF0aC5zaW4obGFtKTtcbiAgICAgICAgICB5ICo9ICh0aGlzLm1vZGUgPT09IHRoaXMuRVFVSVQpID8gc2lucGhpIDogdGhpcy5jb3NwaDAgKiBzaW5waGkgLSB0aGlzLnNpbnBoMCAqIGNvc3BoaSAqIGNvc2xhbTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGlzLm1vZGUgPT09IHRoaXMuTl9QT0xFIHx8IHRoaXMubW9kZSA9PT0gdGhpcy5TX1BPTEUpIHtcbiAgICAgICAgICBpZiAodGhpcy5tb2RlID09PSB0aGlzLk5fUE9MRSkge1xuICAgICAgICAgICAgY29zbGFtID0gLWNvc2xhbTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKE1hdGguYWJzKHBoaSArIHRoaXMubGF0MCkgPCBFUFNMTikge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICAgIHkgPSBGT1JUUEkgLSBwaGkgKiAwLjU7XG4gICAgICAgICAgeSA9IDIgKiAoKHRoaXMubW9kZSA9PT0gdGhpcy5TX1BPTEUpID8gTWF0aC5jb3MoeSkgOiBNYXRoLnNpbih5KSk7XG4gICAgICAgICAgeCA9IHkgKiBNYXRoLnNpbihsYW0pO1xuICAgICAgICAgIHkgKj0gY29zbGFtO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgc2luYiA9IDA7XG4gICAgICAgIGNvc2IgPSAwO1xuICAgICAgICBiID0gMDtcbiAgICAgICAgY29zbGFtID0gTWF0aC5jb3MobGFtKTtcbiAgICAgICAgc2lubGFtID0gTWF0aC5zaW4obGFtKTtcbiAgICAgICAgc2lucGhpID0gTWF0aC5zaW4ocGhpKTtcbiAgICAgICAgcSA9IHFzZm56KHRoaXMuZSwgc2lucGhpKTtcbiAgICAgICAgaWYgKHRoaXMubW9kZSA9PT0gdGhpcy5PQkxJUSB8fCB0aGlzLm1vZGUgPT09IHRoaXMuRVFVSVQpIHtcbiAgICAgICAgICBzaW5iID0gcSAvIHRoaXMucXA7XG4gICAgICAgICAgY29zYiA9IE1hdGguc3FydCgxIC0gc2luYiAqIHNpbmIpO1xuICAgICAgICB9XG4gICAgICAgIHN3aXRjaCAodGhpcy5tb2RlKSB7XG4gICAgICAgIGNhc2UgdGhpcy5PQkxJUTpcbiAgICAgICAgICBiID0gMSArIHRoaXMuc2luYjEgKiBzaW5iICsgdGhpcy5jb3NiMSAqIGNvc2IgKiBjb3NsYW07XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgdGhpcy5FUVVJVDpcbiAgICAgICAgICBiID0gMSArIGNvc2IgKiBjb3NsYW07XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgdGhpcy5OX1BPTEU6XG4gICAgICAgICAgYiA9IEhBTEZfUEkgKyBwaGk7XG4gICAgICAgICAgcSA9IHRoaXMucXAgLSBxO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIHRoaXMuU19QT0xFOlxuICAgICAgICAgIGIgPSBwaGkgLSBIQUxGX1BJO1xuICAgICAgICAgIHEgPSB0aGlzLnFwICsgcTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAoTWF0aC5hYnMoYikgPCBFUFNMTikge1xuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHN3aXRjaCAodGhpcy5tb2RlKSB7XG4gICAgICAgIGNhc2UgdGhpcy5PQkxJUTpcbiAgICAgICAgY2FzZSB0aGlzLkVRVUlUOlxuICAgICAgICAgIGIgPSBNYXRoLnNxcnQoMiAvIGIpO1xuICAgICAgICAgIGlmICh0aGlzLm1vZGUgPT09IHRoaXMuT0JMSVEpIHtcbiAgICAgICAgICAgIHkgPSB0aGlzLnltZiAqIGIgKiAodGhpcy5jb3NiMSAqIHNpbmIgLSB0aGlzLnNpbmIxICogY29zYiAqIGNvc2xhbSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgeSA9IChiID0gTWF0aC5zcXJ0KDIgLyAoMSArIGNvc2IgKiBjb3NsYW0pKSkgKiBzaW5iICogdGhpcy55bWY7XG4gICAgICAgICAgfVxuICAgICAgICAgIHggPSB0aGlzLnhtZiAqIGIgKiBjb3NiICogc2lubGFtO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIHRoaXMuTl9QT0xFOlxuICAgICAgICBjYXNlIHRoaXMuU19QT0xFOlxuICAgICAgICAgIGlmIChxID49IDApIHtcbiAgICAgICAgICAgIHggPSAoYiA9IE1hdGguc3FydChxKSkgKiBzaW5sYW07XG4gICAgICAgICAgICB5ID0gY29zbGFtICogKCh0aGlzLm1vZGUgPT09IHRoaXMuU19QT0xFKSA/IGIgOiAtYik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgeCA9IHkgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBwLnggPSB0aGlzLmEgKiB4ICsgdGhpcy54MDtcbiAgICAgIHAueSA9IHRoaXMuYSAqIHkgKyB0aGlzLnkwO1xuICAgICAgcmV0dXJuIHA7XG4gICAgfVxuXG4gICAgLyogSW52ZXJzZSBlcXVhdGlvbnNcbiAgICAgIC0tLS0tLS0tLS0tLS0tLS0tKi9cbiAgICBmdW5jdGlvbiBpbnZlcnNlJDEyKHApIHtcbiAgICAgIHAueCAtPSB0aGlzLngwO1xuICAgICAgcC55IC09IHRoaXMueTA7XG4gICAgICB2YXIgeCA9IHAueCAvIHRoaXMuYTtcbiAgICAgIHZhciB5ID0gcC55IC8gdGhpcy5hO1xuICAgICAgdmFyIGxhbSwgcGhpLCBjQ2UsIHNDZSwgcSwgcmhvLCBhYjtcbiAgICAgIGlmICh0aGlzLnNwaGVyZSkge1xuICAgICAgICB2YXIgY29zeiA9IDAsXG4gICAgICAgICAgcmgsIHNpbnogPSAwO1xuXG4gICAgICAgIHJoID0gTWF0aC5zcXJ0KHggKiB4ICsgeSAqIHkpO1xuICAgICAgICBwaGkgPSByaCAqIDAuNTtcbiAgICAgICAgaWYgKHBoaSA+IDEpIHtcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBwaGkgPSAyICogTWF0aC5hc2luKHBoaSk7XG4gICAgICAgIGlmICh0aGlzLm1vZGUgPT09IHRoaXMuT0JMSVEgfHwgdGhpcy5tb2RlID09PSB0aGlzLkVRVUlUKSB7XG4gICAgICAgICAgc2lueiA9IE1hdGguc2luKHBoaSk7XG4gICAgICAgICAgY29zeiA9IE1hdGguY29zKHBoaSk7XG4gICAgICAgIH1cbiAgICAgICAgc3dpdGNoICh0aGlzLm1vZGUpIHtcbiAgICAgICAgY2FzZSB0aGlzLkVRVUlUOlxuICAgICAgICAgIHBoaSA9IChNYXRoLmFicyhyaCkgPD0gRVBTTE4pID8gMCA6IE1hdGguYXNpbih5ICogc2lueiAvIHJoKTtcbiAgICAgICAgICB4ICo9IHNpbno7XG4gICAgICAgICAgeSA9IGNvc3ogKiByaDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSB0aGlzLk9CTElROlxuICAgICAgICAgIHBoaSA9IChNYXRoLmFicyhyaCkgPD0gRVBTTE4pID8gdGhpcy5sYXQwIDogTWF0aC5hc2luKGNvc3ogKiB0aGlzLnNpbnBoMCArIHkgKiBzaW56ICogdGhpcy5jb3NwaDAgLyByaCk7XG4gICAgICAgICAgeCAqPSBzaW56ICogdGhpcy5jb3NwaDA7XG4gICAgICAgICAgeSA9IChjb3N6IC0gTWF0aC5zaW4ocGhpKSAqIHRoaXMuc2lucGgwKSAqIHJoO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIHRoaXMuTl9QT0xFOlxuICAgICAgICAgIHkgPSAteTtcbiAgICAgICAgICBwaGkgPSBIQUxGX1BJIC0gcGhpO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIHRoaXMuU19QT0xFOlxuICAgICAgICAgIHBoaSAtPSBIQUxGX1BJO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGxhbSA9ICh5ID09PSAwICYmICh0aGlzLm1vZGUgPT09IHRoaXMuRVFVSVQgfHwgdGhpcy5tb2RlID09PSB0aGlzLk9CTElRKSkgPyAwIDogTWF0aC5hdGFuMih4LCB5KTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBhYiA9IDA7XG4gICAgICAgIGlmICh0aGlzLm1vZGUgPT09IHRoaXMuT0JMSVEgfHwgdGhpcy5tb2RlID09PSB0aGlzLkVRVUlUKSB7XG4gICAgICAgICAgeCAvPSB0aGlzLmRkO1xuICAgICAgICAgIHkgKj0gdGhpcy5kZDtcbiAgICAgICAgICByaG8gPSBNYXRoLnNxcnQoeCAqIHggKyB5ICogeSk7XG4gICAgICAgICAgaWYgKHJobyA8IEVQU0xOKSB7XG4gICAgICAgICAgICBwLnggPSB0aGlzLmxvbmcwO1xuICAgICAgICAgICAgcC55ID0gdGhpcy5sYXQwO1xuICAgICAgICAgICAgcmV0dXJuIHA7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNDZSA9IDIgKiBNYXRoLmFzaW4oMC41ICogcmhvIC8gdGhpcy5ycSk7XG4gICAgICAgICAgY0NlID0gTWF0aC5jb3Moc0NlKTtcbiAgICAgICAgICB4ICo9IChzQ2UgPSBNYXRoLnNpbihzQ2UpKTtcbiAgICAgICAgICBpZiAodGhpcy5tb2RlID09PSB0aGlzLk9CTElRKSB7XG4gICAgICAgICAgICBhYiA9IGNDZSAqIHRoaXMuc2luYjEgKyB5ICogc0NlICogdGhpcy5jb3NiMSAvIHJobztcbiAgICAgICAgICAgIHEgPSB0aGlzLnFwICogYWI7XG4gICAgICAgICAgICB5ID0gcmhvICogdGhpcy5jb3NiMSAqIGNDZSAtIHkgKiB0aGlzLnNpbmIxICogc0NlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGFiID0geSAqIHNDZSAvIHJobztcbiAgICAgICAgICAgIHEgPSB0aGlzLnFwICogYWI7XG4gICAgICAgICAgICB5ID0gcmhvICogY0NlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGlzLm1vZGUgPT09IHRoaXMuTl9QT0xFIHx8IHRoaXMubW9kZSA9PT0gdGhpcy5TX1BPTEUpIHtcbiAgICAgICAgICBpZiAodGhpcy5tb2RlID09PSB0aGlzLk5fUE9MRSkge1xuICAgICAgICAgICAgeSA9IC15O1xuICAgICAgICAgIH1cbiAgICAgICAgICBxID0gKHggKiB4ICsgeSAqIHkpO1xuICAgICAgICAgIGlmICghcSkge1xuICAgICAgICAgICAgcC54ID0gdGhpcy5sb25nMDtcbiAgICAgICAgICAgIHAueSA9IHRoaXMubGF0MDtcbiAgICAgICAgICAgIHJldHVybiBwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBhYiA9IDEgLSBxIC8gdGhpcy5xcDtcbiAgICAgICAgICBpZiAodGhpcy5tb2RlID09PSB0aGlzLlNfUE9MRSkge1xuICAgICAgICAgICAgYWIgPSAtYWI7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxhbSA9IE1hdGguYXRhbjIoeCwgeSk7XG4gICAgICAgIHBoaSA9IGF1dGhsYXQoTWF0aC5hc2luKGFiKSwgdGhpcy5hcGEpO1xuICAgICAgfVxuXG4gICAgICBwLnggPSBhZGp1c3RfbG9uKHRoaXMubG9uZzAgKyBsYW0pO1xuICAgICAgcC55ID0gcGhpO1xuICAgICAgcmV0dXJuIHA7XG4gICAgfVxuXG4gICAgLyogZGV0ZXJtaW5lIGxhdGl0dWRlIGZyb20gYXV0aGFsaWMgbGF0aXR1ZGUgKi9cbiAgICB2YXIgUDAwID0g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IHBoaTtcbiAgICAgIH1cblxuICAgICAgdmFyIGVjY250cyA9IGVjY2VudCAqIGVjY2VudDtcbiAgICAgIGZvciAodmFyIGkgPSAxOyBpIDw9IDI1OyBpKyspIHtcbiAgICAgICAgc2lucGhpID0gTWF0aC5zaW4ocGhpKTtcbiAgICAgICAgY29zcGhpID0gTWF0aC5jb3MocGhpKTtcbiAgICAgICAgY29uID0gZWNjZW50ICogc2lucGhpO1xuICAgICAgICBjb20gPSAxIC0gY29uICogY29uO1xuICAgICAgICBkcGhpID0gMC41ICogY29tICogY29tIC8gY29zcGhpICogKHFzIC8gKDEgLSBlY2NudHMpIC0gc2lucGhpIC8gY29tICsgMC41IC8gZWNjZW50ICogTWF0aC5sb2coKDEgLSBjb24pIC8gKDEgKyBjb24pKSk7XG4gICAgICAgIHBoaSA9IHBoaSArIGRwaGk7XG4gICAgICAgIGlmIChNYXRoLmFicyhkcGhpKSA8PSAxZS03KSB7XG4gICAgICAgICAgcmV0dXJuIHBoaTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgdmFyIG5hbWVzJDE1ID0gW1wiQWxiZXJzX0NvbmljX0VxdWFsX0FyZWFcIiwgXCJBbGJlcnNcIiwgXCJhZWFcIl07XG4gICAgdmFyIGFlYSA9IHtcbiAgICAgIGluaXQ6IGluaXQkMTQsXG4gICAgICBmb3J3YXJkOiBmb3J3YXJkJDEzLFxuICAgICAgaW52ZXJzZTogaW52ZXJzZSQxMyxcbiAgICAgIG5hbWVzOiBuYW1lcyQxNSxcbiAgICAgIHBoaTF6OiBwaGkxelxuICAgIH07XG5cbiAgICAvKlxuICAgICAgcmVmZXJlbmNlOlxuICAgICAgICBXb2xmcmFtIE1hdGh3b3JsZCBcIkdub21vbmljIFByb2plY3Rpb25cIlxuICAgICAgICBodHRwOi8vbWF0aHdvcmxkLndvbGZyYW0uY29tL0dub21vbmljUHJvamVjdGlvbi5odG1sXG4gICAgICAgIE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Nob3J0IHNoYXBlcyBhbmQgbGluZXMgdGhhdFxuICAgICAgICAvLyBzdHJhZGRsZSB0aGUgaG9yaXpvbi5cblxuICAgICAgICB4ID0gdGhpcy54MCArIHRoaXMuaW5maW5pdHlfZGlzdCAqIGNvc3BoaSAqIE1hdGguc2luKGRsb24pO1xuICAgICAgICB5ID0gdGhpcy55MCArIHRoaXMuaW5maW5pdHlfZGlzdCAqICh0aGlzLmNvc19wMTQgKiBzaW5waGkgLSB0aGlzLnNpbl9wMTQgKiBjb3NwaGkgKiBjb3Nsb24pO1xuXG4gICAgICB9XG4gICAgICBwLnggPSB4O1xuICAgICAgcC55ID0geTtcbiAgICAgIHJldHVybiBwO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGludmVyc2UkMTQocCkge1xuICAgICAgdmFyIHJoOyAvKiBSaG8gKi9cbiAgICAgIHZhciBzaW5jLCBjb3NjO1xuICAgICAgdmFyIGM7XG4gICAgICB2YXIgbG9uLCBsYXQ7XG5cbiAgICAgIC8qIEludmVyc2UgZXF1YXRpb25zXG4gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0qL1xuICAgICAgcC54ID0gKHAueCAtIHRoaXMueDApIC8gdGhpcy5hO1xuICAgICAgcC55ID0gKHAueSAtIHRoaXMueTApIC8gdGhpcy5hO1xuXG4gICAgICBwLnggLz0gdGhpcy5rMDtcbiAgICAgIHAueSAvPSB0aGlzLmswO1xuXG4gICAgICBpZiAoKHJoID0gTWF0aC5zcXJ0KHAueCAqIHAueCArIHAueSAqIHAueSkpKSB7XG4gICAgICAgIGMgPSBNYXRoLmF0YW4yKHJoLCB0aGlzLnJjKTtcbiAgICAgICAgc2luYyA9IE1hdGguc2luKGMpO1xuICAgICAgICBjb3NjID0gTWF0aC5jb3MoYyk7XG5cbiAgICAgICAgbGF0ID0gYXNpbnooY29zYyAqIHRoaXMuc2luX3AxNCArIChwLnkgKiBzaW5jICogdGhpcy5jb3NfcDE0KSAvIHJoKTtcbiAgICAgICAgb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lmIChNYXRoLmFicyh5ICsgdGhpcy5hICogdGhpcy5sYXQwKSA8PSBFUFNMTikge1xuICAgICAgICAgIGxvbiA9IGFkanVzdF9sb24oeCAvIHRoaXMuYSArIHRoaXMubG9uZzApO1xuICAgICAgICAgIGxhdCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgYWwgPSB0aGlzLmxhdDAgKyB5IC8gdGhpcy5hO1xuICAgICAgICAgIGJsID0geCAqIHggLyB0aGlzLmEgLyB0aGlzLmEgKyBhbCAqIGFsO1xuICAgICAgICAgIHBoaSA9IGFsO1xuICAgICAgICAgIHZhciB0YW5waGk7XG4gICAgICAgICAgZm9yIChpID0gTUFYX0lURVIkMjsgaTsgLS1pKSB7XG4gICAgICAgICAgICB0YW5waGkgPSBNYXRoLnRhbihwaGkpO1xuICAgICAgICAgICAgZHBoaSA9IC0xICogKGFsICogKHBoaSAqIHRhbnBoaSArIDEpIC0gcGhpIC0gMC41ICogKHBoaSAqIHBoaSArIGJsKSAqIHRhbnBoaSkgLyAoKHBoaSAtIGFsKSAvIHRhbnBoaSAtIDEpO1xuICAgICAgICAgICAgcGhpICs9IGRwaGk7XG4gICAgICAgICAgICBpZiAoTWF0aC5hYnMoZHBoaSkgPD0gRVBTTE4pIHtcbiAgICAgICAgICAgICAgbGF0ID0gcGhpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgKE1hdGguYXNpbih4ICogTWF0aC50YW4ocGhpKSAvIHRoaXMuYSkpIC8gTWF0aC5zaW4obGF0KSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBpZiAoTWF0aC5hYnMoeSArIHRoaXMubWwwKSA8PSBFUFNMTikge1xuICAgICAgICAgIGxhdCA9IDA7XG4gICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgeCAvIHRoaXMuYSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG5cbiAgICAgICAgICBhbCA9ICh0aGlzLm1sMCArIHkpIC8gdGhpcy5hO1xuICAgICAgICAgIGJsID0geCAqIHggLyB0aGlzLmEgLyB0aGlzLmEgKyBhbCAqIGFsO1xuICAgICAgICAgIHBoaSA9IGFsO1xuICAgICAgICAgIHZhciBjbCwgbWxuLCBtbG5wLCBtYTtcbiAgICAgICAgICB2YXIgY29uO1xuICAgICAgICAgIGZvciAoaSA9IE1BWF9JVEVSJDI7IGk7IC0taSkge1xuICAgICAgICAgICAgY29uID0gdGhpcy5lICogTWF0aC5zaW4ocGhpKTtcbiAgICAgICAgICAgIGNsID0gTWF0aC5zcXJ0KDEgLSBjb24gKiBjb24pICogTWF0aC50YW4ocGhpKTtcbiAgICAgICAgICAgIG1sbiA9IHRoaXMuYSAqIG1sZm4odGhpcy5lMCwgdGhpcy5lMSwgdGhpcy5lMiwgdGhpcy5lMywgcGhpKTtcbiAgICAgICAgICAgIG1sbnAgPSB0aGlzLmUwIC0gMiAqIHRoaXMuZTEgKiBNYXRoLmNvcygyICogcGhpKSArIDQgKiB0aGlzLmUyICogTWF0aC5jb3MoNCAqIHBoaSkgLSA2ICogdGhpcy5lMyAqIE1hdGguY29zKDYgKiBwaGkpO1xuICAgICAgICAgICAgbWEgPSBtbG4gLyB0aGlzLmE7XG4gICAgICAgICAgICBkcGhpID0gKGFsICogKGNsICogbWEgKyAxKSAtIG1hIC0gMC41ICogY2wgKiAobWEgKiBtYSArIGJsKSkgLyAodGhpcy5lcyAqIE1hdGguc2luKDIgKiBwaGkpICogKG1hICogbWEgKyBibCAtIDIgKiBhbCAqIG1hKSAvICg0ICogY2wpICsgKGFsIC0gbWEpICogKGNsICogbWxucCAtIDIgLyBNYXRoLnNpbigyICogcGhpKSkgLSBtbG5wKTtcbiAgICAgICAgICAgIHBoaSAtPSBkcGhpO1xuICAgICAgICA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luKGxhdCk7XG4gICAgICAgICAgZm9yICh2YXIgaSA9IE1BWF9JVEVSJDM7IGk7IC0taSkge1xuICAgICAgICAgICAgdmFyIFYgPSAodGhpcy5tICogbGF0ICsgTWF0aC5zaW4obGF0KSAtIGspIC8gKHRoaXMubSArIE1hdGguY29zKGxhdCkpO1xuICAgICAgICAgICAgbGF0IC09IFY7XG4gICAgICAgICAgICBpZiAoTWF0aC5hYnMoVikgPCBFUFNMTikge1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgeCA9IHRoaXMuYSAqIHRoaXMuQ194ICogbG9uICogKHRoaXMubSArIE1hdGguY29zKGxhdCkpO1xuICAgICAgICB5ID0gdGhpcy5hICogdGhpcy5DX3kgKiBsYXQ7XG5cbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuXG4gICAgICAgIHZhciBzID0gTWF0aC5zaW4obGF0KTtcbiAgICAgICAgdmFyIGMgPSBNYXRoLmNvcyhsYXQpO1xuICAgICAgICB5ID0gdGhpcy5hICogcGpfbWxmbihsYXQsIHMsIGMsIHRoaXMuZW4pO1xuICAgICAgICB4ID0gdGhpcy5hICogbG9uICogYyAvIE1hdGguc3FydCgxIC0gdGhpcy5lcyAqIHMgKiBzKTtcbiAgICAgIH1cblxuICAgICAgcC54ID0geDtcbiAgICAgIHAueSA9IHk7XG4gICAgICByZXR1cm4gcDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpbnZlcnNlJDIwKHApIHtcbiAgICAgIHZhciBsYXQsIHRlbXAsIGxvbiwgcztcblxuICAgICAgcC54IC09IHRoaXMueDA7XG4gICAgICBsb24gPSBwLnggLyB0aGlzLmE7XG4gICAgICBwLnkgLT0gdGhpcy55MDtcbiAgICAgIGxhdCA9IHAueSAvIHRoaXMuYTtcblxuICAgICAgaWYgKHRoaXMuc3BoZXJlKSB7XG4gICAgICAgIGxhdCAvPSB0aGlzLkNfeTtcbiAgICAgICAgbG9uID0gbG9uIC8gKHRoaXMuQ194ICogKHRoaXMubSArIE1hdGguY29zKGxhdCkpKTtcbiAgICAgICAgaWYgKHRoaXMubSkge1xuICAgICAgICAgIGxhdCA9IGFzaW56KCh0aGlzLm0gKiBsYXQgKyBNYXRoLnNpbihsYXQpKSAvIHRoaXMubik7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodGhpcy5uICE9PSAxKSB7XG4gICAgICAgICAgbGF0ID0gYXNpbnooTWF0aC5zaW4obGF0KSAvIHRoaXMubik7XG4gICAgICAgIH1cbiAgICAgICAgbG9uID0gYWRqdXN0X2xvbihsb24gKyB0aGlzLmxvbmcwKTtcbiAgICAgICAgbGF0ID0gYWRqdXN0X2xhdChsYXQpO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIGxhdCA9IHBqX2ludl9tbGZuKHAueSAvIHRoaXMuYSwgdGhpcy5lcywgdGhpcy5lbik7XG4gICAgICAgIHMgPSBNYXRoLmFicyhsYXQpO1xuICAgICAgICBpZiAocyA8IEhBTEZfUEkpIHtcbiAgICAgICAgICBzID0gTWF0aC5zaW4obGF0KTtcbiAgICAgICAgICB0ZW1wID0gdGhpcy5sb25nMCArIHAueCAqIE1hdGguc3FydCgxIC0gdGhpcy5lcyAqIHMgKiBzKSAvICh0aGlzLmEgKiBNYXRoLmNvcyhsYXQpKTtcbiAgICAgICAgICAvL3RlbXAgPSB0aGlzLmxvbmcwICsgcC54IC8gKHRoaXMuYSAqIE1hdGguY29zKGxhdCkpO1xuICAgICAgICAgIGxvbiA9IGFkanVzdF9sb24odGVtcCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoKHMgLSBFUFNMTikgPCBIQUxGX1BJKSB7XG4gICAgICAgICAgbG9uID0gdGhpcy5sb25nMDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcC54ID0gbG9uO1xuICAgICAgcC55ID0gbGF0O1xuICAgICAgcmV0dXJuIHA7XG4gIC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RoaXMuUiAqIE1hdGgudGFuKDAuNSAqIHRoZXRhKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICB5ID0gdGhpcy55MCArIE1hdGguUEkgKiB0aGlzLlIgKiAtTWF0aC50YW4oMC41ICogdGhldGEpO1xuICAgICAgICB9XG4gICAgICAgIC8vICByZXR1cm4oT0spO1xuICAgICAgfVxuICAgICAgdmFyIGFsID0gMC41ICogTWF0aC5hYnMoKE1hdGguUEkgLyBkbG9uKSAtIChkbG9uIC8gTWF0aC5QSSkpO1xuICAgICAgdmFyIGFzcSA9IGFsICogYWw7XG4gICAgICB2YXIgc2ludGggPSBNYXRoLnNpbih0aGV0YSk7XG4gICAgICB2YXIgY29zdGggPSBNYXRoLmNvcyh0aGV0YSk7XG5cbiAgICAgIHZhciBnID0gY29zdGggLyAoc2ludGggKyBjb3N0aCAtIDEpO1xuICAgICAgdmFyIGdzcSA9IGcgKiBnO1xuICAgICAgdmFyIG0gPSBnICogKDIgLyBzaW50aCAtIDEpO1xuICAgICAgdmFyIG1zcSA9IG0gKiBtO1xuICAgICAgdmFyIGNvbiA9IE1hdGguUEkgKiB0aGlzLlIgKiAoYWwgKiAoZyAtIG1zcSkgKyBNYXRoLnNxcnQoYXNxICogKGcgLSBtc3EpICogKGcgLSBtc3EpIC0gKG1zcSArIGFzcSkgKiAoZ3NxIC0gbXNxKSkpIC8gKG1zcSArIGFzcSk7XG4gICAgICBpZiAoZGxvbiA8IDApIHtcbiAgICAgICAgY29uID0gLWNvbjtcbiAgICAgIH1cbiAgICAgIHggPSB0aGlzLngwICsgY29uO1xuICAgICAgLy9jb24gPSBNYXRoLmFicyhjb24gLyAoTWF0aC5QSSAqIHRoaXMuUikpO1xuICAgICAgdmFyIHEgPSBhc3EgKyBnO1xuICAgICAgY29uID0gTWF0aC5QSSAqIHRoaXMuUiAqIChtICogcSAtIGFsICogTWF0aC5zcXJ0KChtc3EgKyBhc3EpICogKGFzcSArIDEpIC0gcSAqI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ICAgICB4eXMgPSB4eCAqIHh4ICsgeXkgKiB5eTtcbiAgICAgIGMxID0gLU1hdGguYWJzKHl5KSAqICgxICsgeHlzKTtcbiAgICAgIGMyID0gYzEgLSAyICogeXkgKiB5eSArIHh4ICogeHg7XG4gICAgICBjMyA9IC0yICogYzEgKyAxICsgMiAqIHl5ICogeXkgKyB4eXMgKiB4eXM7XG4gICAgICBkID0geXkgKiB5eSAvIGMzICsgKDIgKiBjMiAqIGMyICogYzIgLyBjMyAvIGMzIC8gYzMgLSA5ICogYzEgKiBjMiAvIGMzIC8gYzMpIC8gMjc7XG4gICAgICBhMSA9IChjMSAtIGMyICogYzIgLyAzIC8gYzMpIC8gYzM7XG4gICAgICBtMSA9IDIgKiBNYXRoLnNxcnQoLWExIC8gMyk7XG4gICAgICBjb24gPSAoKDMgKiBkKSAvIGExKSAvIG0xO1xuICAgICAgaWYgKE1hdGguYWJzKGNvbikgPiAxKSB7XG4gICAgICAgIGlmIChjb24gPj0gMCkge1xuICAgICAgICAgIGNvbiA9IDE7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgY29uID0gLTE7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHRoMSA9IE1hdGguYWNvcyhjb24pIC8gMztcbiAgICAgIGlmIChwLnkgPj0gMCkge1xuICAgICAgICBsYXQgPSAoLW0xICogTWF0aC5jb3ModGgxICsgTWF0aC5QSSAvIDMpIC0gYzIgLyAzIC8gYzMpICogTWF0aC5QSTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBsYXQgPSAtKC1tMSAqIE1hdGguY29zKHRoMSArIE1hdGguUEkgLyAzKSAtIGMyIC8gMyAvIGMzKSAqIE1hdGguUEk7XG4gICAgICB9XG5cbiAgICAgIGlmIChNYXRoLmFicyh4eCkgPCBFUFNMTikge1xuICAgICAgICBsb24gPSB0aGlzLmxvbmcwO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIGxvbi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KSB7XG4gICAgICAgIGlmIChNYXRoLmFicyh0aGlzLnNpbl9wMTIgLSAxKSA8PSBFUFNMTikge1xuICAgICAgICAgIC8vTm9ydGggUG9sZSBjYXNlXG4gICAgICAgICAgcC54ID0gdGhpcy54MCArIHRoaXMuYSAqIChIQUxGX1BJIC0gbGF0KSAqIE1hdGguc2luKGRsb24pO1xuICAgICAgICAgIHAueSA9IHRoaXMueTAgLSB0aGlzLmEgKiAoSEFMRl9QSSAtIGxhdCkgKiBNYXRoLmNvcyhkbG9uKTtcbiAgICAgICAgICByZXR1cm4gcDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChNYXRoLmFicyh0aGlzLnNpbl9wMTIgKyAxKSA8PSBFUFNMTikge1xuICAgICAgICAgIC8vU291dGggUG9sZSBjYXNlXG4gICAgICAgICAgcC54ID0gdGhpcy54MCArIHRoaXMuYSAqIChIQUxGX1BJICsgbGF0KSAqIE1hdGguc2luKGRsb24pO1xuICAgICAgICAgIHAueSA9IHRoaXMueTAgKyB0aGlzLmEgKiAoSEFMRl9QSSArIGxhdCkgKiBNYXRoLmNvcyhkbG9uKTtcbiAgICAgICAgICByZXR1cm4gcDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAvL2RlZmF1bHQgY2FzZVxuICAgICAgICAgIGNvc19jID0gdGhpcy5zaW5fcDEyICogc2lucGhpICsgdGhpcy5jb3NfcDEyICogY29zcGhpICogTWF0aC5jb3MoZGxvbik7XG4gICAgICAgICAgYyA9IE1hdGguYWNvcyhjb3NfYyk7XG4gICAgICAgICAga3AgPSBjID8gYyAvIE1hdGguc2luKGMpIDogMTtcbiAgICAgICAgICBwLnggPSB0aGlzLngwICsgdGhpcy5hICoga3AgKiBjb3NwaGkgKiBNYXRoLnNpbihkbG9uKTtcbiAgICAgICAgICBwLnkgPSB0aGlzLnkwICsgdGhpcy5hICoga3AgKiAodGhpcy5jb3NfcDEyICogc2lucGhpIC0gdGhpcy5zaW5fcDEyICogY29zcGhpICogTWF0aC5jb3MoZGxvbikpO1xuICAgICAgICAgIHJldHVybiBwO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgZTAgPSBlMGZuKHRoaXMuZXMpO1xuICAgICAgICBlMSA9IGUxZm4odGhpcy5lcyk7XG4gICAgICAgIGUyID0gZTJmbih0aGlzLmVzKTtcbiAgICAgICAgZTMgPSBlM2ZuKHRoaXMuZXMpO1xuICAgICAgICBpZiAoTWF0aC5hYnModGhpcy5zaW5fcDEyIC0gMSkgPD0gRVBTTE4pIHtcbiAgICAgICAgICAvL05vcnRoIFBvbGUgY2FzZVxuICAgICAgICAgIE1scCA9IHRoaXMuYSAqIG1sZm4oZTAsIGUxLCBlMiwgZTMsIEhBTEZfUEkpO1xuICAgICAgICAgIE1sID0gdGhpcy5hICogbWxmbihlMCwgZTEsIGUyLCBlMywgbGF0KTtcbiAgICAgICAgICBwLnggPSB0aGlzLngwICsgKE1scCAtIE1sKSAqIE1hdGguc2luKGRsb24pO1xuICAgICAgICAgIHAueSA9IHRoaXMueTAgLSAoTWxwIC0gTWwpICogTWF0aC5jb3MoZGxvbik7XG4gICAgICAgICAgcmV0dXJuIHA7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoTWF0aC5hYnModGhpcy5zaW5fcDEyICsgMSkgPD0gRVBTTE4pIHtcbiAgICAgICAgICAvL1NvdXRoIFBvbGUgY2FzZVxuICAgICAgICAgIE1scCA9IHRoaXMuYSAqIG1sZm4oZTAsIGUxLCBlMiwgZTMsIEhBTEZfUEkpO1xuICAgICAgICAgIE1sID0gdGhpcy5hICogbWxmbihlMCwgZTEsIGUyLCBlMywgbGF0KTtcbiAgICAgICAgICBwLnggPSB0aGlzLngwICsgKE1scCArIE1sKSAqIE1hdGguc2luKGRsb24pO1xuICAgICAgICAgIHAueSA9IHRoaXMueTAgKyAoTWxwICsgTWwpICogTWF0aC5jb3MoZGxvbik7XG4gICAgICAgICAgcmV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MTIgLyBNYXRoLnNxcnQoMSAtIHRoaXMuZXMpO1xuICAgICAgICAgIEggPSB0aGlzLmUgKiB0aGlzLmNvc19wMTIgKiBNYXRoLmNvcyhBeikgLyBNYXRoLnNxcnQoMSAtIHRoaXMuZXMpO1xuICAgICAgICAgIEdIID0gRyAqIEg7XG4gICAgICAgICAgSHMgPSBIICogSDtcbiAgICAgICAgICBzMiA9IHMgKiBzO1xuICAgICAgICAgIHMzID0gczIgKiBzO1xuICAgICAgICAgIHM0ID0gczMgKiBzO1xuICAgICAgICAgIHM1ID0gczQgKiBzO1xuICAgICAgICAgIGMgPSBObDEgKiBzICogKDEgLSBzMiAqIEhzICogKDEgLSBIcykgLyA2ICsgczMgLyA4ICogR0ggKiAoMSAtIDIgKiBIcykgKyBzNCAvIDEyMCAqIChIcyAqICg0IC0gNyAqIEhzKSAtIDMgKiBHICogRyAqICgxIC0gNyAqIEhzKSkgLSBzNSAvIDQ4ICogR0gpO1xuICAgICAgICAgIHAueCA9IHRoaXMueDAgKyBjICogTWF0aC5zaW4oQXopO1xuICAgICAgICAgIHAueSA9IHRoaXMueTAgKyBjICogTWF0aC5jb3MoQXopO1xuICAgICAgICAgIHJldHVybiBwO1xuICAgICAgICB9XG4gICAgICB9XG5cblxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGludmVyc2UkMjQocCkge1xuICAgICAgcC54IC09IHRoaXMueDA7XG4gICAgICBwLnkgLT0gdGhpcy55MDtcbiAgICAgIHZhciByaCwgeiwgc2lueiwgY29zeiwgbG9uLCBsYXQsIGNvbiwgZTAsIGUxLCBlMiwgZTMsIE1scCwgTSwgTjEsIHBzaSwgQXosIGNvc0F6LCB0bXAsIEEsIEIsIEQsIEVlLCBGLCBzaW5wc2k7XG4gICAgICBpZiAodGhpcy5zcGhlcmUpIHtcbiAgICAgICAgcmggPSBNYXRoLnNxcnQocC54ICogcC54ICsgcC55ICogcC55KTtcbiAgICAgICAgaWYgKHJoID4gKDIgKiBIQUxGX1BJICogdGhpcy5hKSkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB6ID0gcmggLyB0aGlzLmE7XG5cbiAgICAgICAgc2lueiA9IE1hdGguc2luKHopO1xuICAgICAgICBjb3N6ID0gTWF0aC5jb3Moeik7XG5cbiAgICAgICAgbG9uID0gdGhpcy5sb25nMDtcbiAgICAgICAgaWYgKE1hdGguYWJzKHJoKSA8PSBFUFNMTikge1xuICAgICAgICAgIGxhdCA9IHRoaXMubGF0MDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBsYXQgPSBhc2lueihjb3N6ICogdGhpcy5zaW5fcDEyICsgKHAueSAqIHNpbnogKiB0aGlzLmNvc19wMTIpIC8gcmgpO1xuICAgICAgICAgIGNvbiA9IE1hdGguYWJzKHRoaXMubGF0MCkgLSBIQUxGX1BJO1xuICAgICAgICAgIGlmIChNYXRoLmFicyhjb24pIDw9IEVQU0xOKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXQwID49IDApIHtcbiAgICAgICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgTWF0aC5hdGFuMihwLngsIC0gcC55KSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwIC0gTWF0aC5hdGFuMigtcC54LCBwLnkpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvKmNvbiA9IGNvc3ogLSB0aGlzLnNpbl9wMTIgKiBNYXRoLnNpbihsYXQpO1xuICAgICAgICAgICAgaWYgKChNYXRoLmFicyhjb24pIDwgRVBTTE4pICYmIChNYXRoLmFicyhwLngpIDwgRVBTTE4pKSB7XG4gICAgICAgICAgICAgIC8vbm8tb3AsIGp1c3Qga2VlcCB0aGUgbG9uIHZhbHVlIGFzIGlzXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgdGVtcCA9IE1hdGguYXRhbjIoKHAueCAqIHNpbnogKiB0aGlzLmNvc19wMTIpLCAoY29uICogcmgpKTtcbiAgICAgICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgTWF0aC5hdGFuMigocC54ICogc2lueiAqIHRoaXMuY29zX3AxMiksIChjb24gKiByaCkpKTtcbiAgICAgICAgICAgIH0qL1xuICAgICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgTWF0aC5hdGFuMihwLnggKiBzaW56LCByaCAqIHRoaXMuY29zX3AxMiAqIGNvc3ogLSBwLnkgKiB0aGlzLnNpbl9wMTIgKiBzaW56KSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcC54ID0gbG9uO1xuICAgICAgICBwLnkgPSBsYXQ7XG4gICAgICAgIHJldHVybiBwO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIGUwID0gZTBmbih0aGlzLmVzKTtcbiAgICAgICAgZTEgPSBlMWZuKHRoaXMuZXMpO1xuICAgICAgICBlMiA9IGUyZm4odGhpcy5lcyk7XG4gICAgICAgIGUzID0gZTNmbih0aGlzLmVzKTtcbiAgICAgICAgaWYgKE1hdGguYWJzKHRoaXMuc2luX3AxMiAtIDEpIDw9IEVQU0xOKSB7XG4gICAgICAgICAgLy9Ob3J0aCBwb2xlIGNhc2VcbiAgICAgICAgICBNbHAgPSB0aGlzLmEgKiBtbGZuKGUwLCBlMSwgZTIsIGUzLCBIQUxGX1BJKTtcbiAgICAgICAgICByaCA9IE1hdGguc3FydChwLnggKiBwLnggKyBwLnkgKiBwLnkpO1xuICAgICAgICAgIE0gPSBNbHAgLSByaDtcbiAgICAgICAgICBsYXQgPSBpbWxmbihNIC8gdGhpcy5hLCBlMCwgZTEsIGUyLCBlMyk7XG4gICAgICAgICAgbG9uID0gYWRqdXN0X2xvbih0aGlzLmxvbmcwICsgTWF0aC5hdGFuMihwLngsIC0gMSAqIHAueSkpO1xuICAgICAgICAgIHAueCA9IGxvbjtcbiAgICAgICAgICBwLnkgPSBsYXQ7XG4gICAgICAgICAgcmV0dXJuIHA7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoTWF0aC5hYnModGhpcy5zaW5fcDEyICsgMSkgPD0gRVBTTE4pIHtcbiAgICAgICAgICAvL1NvdXRoIHBvbGUgY2FzZVxuICAgICAgICAgIE1scCA9IHRoaXMuYSAqIG1sZm4oZTAsIGUxLCBlMiwgZTMsIEhBTEZfUEkpO1xuICAgICAgICAgIHJoID0gTWF0aC5zcXJ0KHAueCAqIHAueCArIHAueSAqIHAueSk7XG4gICAgICAgICAgTSA9IHJoIC0gTWxwO1xuXG4gICAgICAgICAgbGF0ID0gaW1sZm4oTSAvIHRoaXMuYSwgZTAsIGUxLCBlMiwgZTMpO1xuICAgICAgICAgIGxvbiA9IGFkanVzdF9sb24odGhpcy5sb25nMCArIE1hdGguYXRhbjIocC54LCBwLnkpKTtcbiAgICAgICAgICBwLnggPSBsb247XG4gICAgICAgICAgcC55ID0gbGF0O1xuICAgICAgICAgIHJldHVybiBwO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIC8vZGVmYXVsdCBjYXNlXG4gICAgICAgICAgcmggPSBNYXRoLnNxcnQocC54ICogcC54ICsgcC55ICogcC55KTtcbiAgICAgICAgICBBeiA9IE1hdGguYXRhbjIocC54LCBwLnkpO1xuICAgICAgICAgIE4xID0gZ04odGhpcy5hLCB0aGlzLmUsIHRoaXMuc2luX3AxMik7XG4gICAgICAgICAgY29zQXogPSBNYXRoLmNvcyhBeik7XG4gICAgICAgICAgdG1wID0gdGhpcy5lICogdGhpcy5jb3NfcDEyICogY29zQXo7XG4gICAgICAgICAgQSA9IC10bXAgKiB0bXAgLyAoMSAtIHRoaXMuZXMpO1xuICAgICAgICAgIEIgPSAzICogdGhpcy5lcyAqICg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24obG9uIC0gdGhpcy5sb25nMCk7XG5cbiAgICAgIHNpbnBoaSA9IE1hdGguc2luKGxhdCk7XG4gICAgICBjb3NwaGkgPSBNYXRoLmNvcyhsYXQpO1xuXG4gICAgICBjb3Nsb24gPSBNYXRoLmNvcyhkbG9uKTtcbiAgICAgIGcgPSB0aGlzLnNpbl9wMTQgKiBzaW5waGkgKyB0aGlzLmNvc19wMTQgKiBjb3NwaGkgKiBjb3Nsb247XG4gICAgICBrc3AgPSAxO1xuICAgICAgaWYgKChnID4gMCkgfHwgKE1hdGguYWJzKGcpIDw9IEVQU0xOKSkge1xuICAgICAgICB4ID0gdGhpcy5hICoga3NwICogY29zcGhpICogTWF0aC5zaW4oZGxvbik7XG4gICAgICAgIHkgPSB0aGlzLnkwICsgdGhpcy5hICoga3NwICogKHRoaXMuY29zX3AxNCAqIHNpbnBoaSAtIHRoaXMuc2luX3AxNCAqIGNvc3BoaSAqIGNvc2xvbik7XG4gICAgICB9XG4gICAgICBwLnggPSB4O1xuICAgICAgcC55ID0geTtcbiAgICAgIHJldHVybiBwO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGludmVyc2UkMjUocCkge1xuICAgICAgdmFyIHJoOyAvKiBoZWlnaHQgYWJvdmUgZWxsaXBzb2lkICAgICAgKi9cbiAgICAgIHZhciB6OyAvKiBhbmdsZSAgICAgICAgICAqL1xuICAgICAgdmFyIHNpbnosIGNvc3o7IC8qIHNpbiBvZiB6IGFuZCBjb3Mgb2YgeiAgICAgICovXG4gICAgICB2YXIgY29uO1xuICAgICAgdmFyIGxvbiwgbGF0O1xuICAgICAgLyogSW52ZXJzZSBlcXVhdGlvbnNcbiAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLSovXG4gICAgICBwLnggLT0gdGhpcy54MDtcbiAgICAgIHAueSAtPSB0aGlzLnkwO1xuICAgICAgcmggPSBNYXRoLnNxcnQocC54ICogcC54ICsgcC55ICogcC55KTtcbiAgICAgIHogPSBhc2lueihyaCAvIHRoaXMuYSk7XG5cbiAgICAgIHNpbnogPSBNYXRoLnNpbih6KTtcbiAgICAgIGNvc3ogPSBNYXRoLmNvcyh6KTtcblxuICAgICAgbG9uID0gdGhpcy5sb25nMDtcbiAgICAgIGlmIChNYXRoLmFicyhyaCkgPD0gRVBTTE4pIHtcbiAgICAgICAgbGF0ID0gdGhpcy5sYXQwO1xuICAgICAgICBwLnggPSBsb247XG4gICAgICAgIHAueSA9IGxhdDtcbiAgICAgICAgcmV0dXJuIHA7XG4gICAgICB9XG4gICAgICBsYXQgPSBhc2lueihjb3N6ICogdGhpcy5zaW5fcDE0ICsgKHAueSAqIHNpbnogKiB0aGlzLmNvc19wMTQpIC8gcmgpO1xuICAgICAgY29uID0gTWF0aC5hYnModGhpcy5sYXQwKSAtIEhBTEZfUEk7XG4gICAgICBpZiAoTWF0aC5hYnMoY29uKSA8PSBFUFNMTikge1xuICAgICAgICBpZiAodGhpcy5sYXQwID49IDApIHtcbiAgICAgICAgICBsb24gPSBhZGp1c3RfbG9uKHRoaXMubG9uZzAgKyBNYXRoLmF0YW4yKHAueCwgLSBwLnkpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBsb24gPSBhZGp1c3RfbG9uKHRoaXMubG9uZzAgLSBNYXRoLmF0YW4yKC1wLngsIHAueSkpO1xuICAgICAgICB9XG4gICAgICAgIHAueCA9IGxvbjtcbiAgICAgICAgcC55ID0gbGF0O1xuICAgICAgICByZXR1cm4gcDtcbiAgICAgIH1cbiAgICAgIGxvbiA9IGFkanVzdF9sb24odGhpcy5sb25nMCArIE1hdGguYXRhbjIoKHAueCAqIHNpbnopLCByaCAqIHRoaXMuY29zX3AxNCAqIGNvc3ogLSBwLnkgKiB0aGlzLnNpbl9wMTQgKiBzaW56KSk7XG4gICAgICBwLnggPSBsb247XG4gICAgICBwLnkgPSBsYXQ7XG4gICAgICByZXR1cm4gcDtcbiAgICB9XG5cbiAgICB2YXIgbmFtZXMkMjcgPSBbXCJv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ICByID0gLXI7XG4gICAgICAgICAgcyA9IC1zO1xuICAgICAgICB9IGVsc2UgaWYgKGFyZWEudmFsdWUgPT09IEFSRUFfRU5VTS5BUkVBXzMpIHtcbiAgICAgICAgICB0ID0gcjtcbiAgICAgICAgICByID0gcztcbiAgICAgICAgICBzID0gLXQ7XG4gICAgICAgIH1cbiAgICAgICAgLyogUm90YXRlIHEscixzIGludG8gdGhlIGNvcnJlY3QgY3ViZSBmYWNlLiAqL1xuICAgICAgICBpZiAodGhpcy5mYWNlID09PSBGQUNFX0VOVU0uUklHSFQpIHtcbiAgICAgICAgICB0ID0gcTtcbiAgICAgICAgICBxID0gLXI7XG4gICAgICAgICAgciA9IHQ7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5mYWNlID09PSBGQUNFX0VOVU0uQkFDSykge1xuICAgICAgICAgIHEgPSAtcTtcbiAgICAgICAgICByID0gLXI7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5mYWNlID09PSBGQUNFX0VOVU0uTEVGVCkge1xuICAgICAgICAgIHQgPSBxO1xuICAgICAgICAgIHEgPSByO1xuICAgICAgICAgIHIgPSAtdDtcbiAgICAgICAgfVxuICAgICAgICAvKiBOb3cgY29tcHV0ZSBwaGkgYW5kIGxhbSBmcm9tIHRoZSB1bml0IHNwaGVyZSBjb29yZGluYXRlcy4gKi9cbiAgICAgICAgbHAucGhpID0gTWF0aC5hY29zKC1zKSAtIEhBTEZfUEk7XG4gICAgICAgIGxwLmxhbSA9IE1hdGguYXRhbjIociwgcSk7XG4gICAgICAgIGlmICh0aGlzLmZhY2UgPT09IEZBQ0VfRU5VTS5SSUdIVCkge1xuICAgICAgICAgIGxwLmxhbSA9IHFzY19zaGlmdF9sb25fb3JpZ2luKGxwLmxhbSwgLUhBTEZfUEkpO1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuZmFjZSA9PT0gRkFDRV9FTlVNLkJBQ0spIHtcbiAgICAgICAgICBscC5sYW0gPSBxc2Nfc2hpZnRfbG9uX29yaWdpbihscC5sYW0sIC1TUEkpO1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuZmFjZSA9PT0gRkFDRV9FTlVNLkxFRlQpIHtcbiAgICAgICAgICBscC5sYW0gPSBxc2Nfc2hpZnRfbG9uX29yaWdpbihscC5sYW0sICtIQUxGX1BJKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvKiBBcHBseSB0aGUgc2hpZnQgZnJvbSB0aGUgc3BoZXJlIHRvIHRoZSBlbGxpcHNvaWQgYXMgZGVzY3JpYmVkXG4gICAgICAgKiBpbiBbTEsxMl0uICovXG4gICAgICBpZiAodGhpcy5lcyAhPT0gMCkge1xuICAgICAgICB2YXIgaW52ZXJ0X3NpZ247XG4gICAgICAgIHZhciB0YW5waGksIHhhO1xuICAgICAgICBpbnZlcnRfc2lnbiA9IChscC5waGkgPCAwID8gMSA6IDApO1xuICAgICAgICB0YW5waGkgPSBNYXRoLnRhbihscC5waGkpO1xuICAgICAgICB4YSA9IHRoaXMuYiAvIE1hdGguc3FydCh0YW5waGkgKiB0YW5waGkgKyB0aGlzLm9uZV9taW51c19mX3NxdWFyZWQpO1xuICAgICAgICBscC5waGkgPSBNYXRoLmF0YW4oTWF0aC5zcXJ0KHRoaXMuYSAqIHRoaXMuYSAtIHhhICogeGEpIC8gKHRoaXMub25lX21pbnVzX2YgKiB4YSkpO1xuICAgICAgICBpZiAoaW52ZXJ0X3NpZ24pIHtcbiAgICAgICAgICBscC5waGkgPSAtbHAucGhpO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGxwLmxhbSArPSB0aGlzLmxvbmcwO1xuICAgICAgcC54ID0gbHAubGFtO1xuICAgICAgcC55ID0gbHAucGhpO1xuICAgICAgcmV0dXJuIHA7XG4gICAgfVxuXG4gICAgLyogSGVscGVyIGZ1bmN0aW9uIGZvciBmb3J3YXJkIHByb2plY3Rpb246IGNvbXB1dGUgdGhlIHRoZXRhIGFuZ2xlXG4gICAgICogYW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ICsgeCAqICgyICogY29lZnNbMl0gKyB4ICogMyAqIGNvZWZzWzNdKTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gbmV3dG9uX3JhcHNob24oZl9kZiwgc3RhcnQsIG1heF9lcnIsIGl0ZXJzKSB7XG4gICAgICAgIHZhciB4ID0gc3RhcnQ7XG4gICAgICAgIGZvciAoOyBpdGVyczsgLS1pdGVycykge1xuICAgICAgICAgICAgdmFyIHVwZCA9IGZfZGYoeCk7XG4gICAgICAgICAgICB4IC09IHVwZDtcbiAgICAgICAgICAgIGlmIChNYXRoLmFicyh1cGQpIDwgbWF4X2Vycikge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB4O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGluaXQkMjgoKSB7XG4gICAgICAgIHRoaXMueDAgPSB0aGlzLngwIHx8IDA7XG4gICAgICAgIHRoaXMueTAgPSB0aGlzLnkwIHx8IDA7XG4gICAgICAgIHRoaXMubG9uZzAgPSB0aGlzLmxvbmcwIHx8IDA7XG4gICAgICAgIHRoaXMuZXMgPSAwO1xuICAgICAgICB0aGlzLnRpdGxlID0gdGhpcy50aXRsZSB8fCBcIlJvYmluc29uXCI7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZm9yd2FyZCQyNyhsbCkge1xuICAgICAgICB2YXIgbG9uID0gYWRqdXN0X2xvbihsbC54IC0gdGhpcy5sb25nMCk7XG5cbiAgICAgICAgdmFyIGRwaGkgPSBNYXRoLmFicyhsbC55KTtcbiAgICAgICAgdmFyIGkgPSBNYXRoLmZsb29yKGRwaGkgKiBDMSk7XG4gICAgICAgIGlmIChpIDwgMCkge1xuICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgIH0gZWxzZSBpZiAoaSA+PSBOT0RFUykge1xuICAgICAgICAgICAgaSA9IE5PREVTIC0gMTtcbiAgICAgICAgfVxuICAgICAgICBkcGhpID0gUjJEICogKGRwaGkgLSBSQzEgKiBpKTtcbiAgICAgICAgdmFyIHh5ID0ge1xuICAgICAgICAgICAgeDogcG9seTNfdmFsKENPRUZTX1hbaV0sIGRwaGkpICogbG9uLFxuICAgICAgICAgICAgeTogcG9seTNfdmFsKENPRUZTX1lbaV0sIGRwaGkpXG4gICAgICAgIH07XG4gICAgICAgIGlmIChsbC55IDwgMCkge1xuICAgICAgICAgICAgeHkueSA9IC14eS55O1xuICAgICAgICB9XG5cbiAgICAgICAgeHkueCA9IHh5LnggKiB0aGlzLmEgKiBGWEMgKyB0aGlzLngwO1xuICAgICAgICB4eS55ID0geHkueSAqIHRoaXMuYSAqIEZZQyArIHRoaXMueTA7XG4gICAgICAgIHJldHVybiB4eTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpbnZlcnNlJDI3KHh5KSB7XG4gICAgICAgIHZhciBsbCA9IHtcbiAgICAgICAgICAgIHg6ICh4eS54IC0gdGhpcy54MCkgLyAodGhpcy5hICogRlhDKSxcbiAgICAgICAgICAgIHk6IE1hdGguYWJzKHh5LnkgLSB0aGlzLnkwKSAvICh0aGlzLmEgKiBGWUMpXG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKGxsLnkgPj0gMSkgeyAvLyBwYXRob2xvZ2ljIGNhc2VcbiAgICAgICAgICAgIGxsLnggLz0gQ09FRlNfWFtOT0RFU11bMF07XG4gICAgICAgICAgICBsbC55ID0geHkueSA8IDAgPyAtSEFMRl9QSSA6IEhBTEZfUEk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBmaW5kIHRhYmxlIGludGVydmFsXG4gICAgICAgICAgICB2YXIgaSA9IE1hdGguZmxvb3IobGwueSAqIE5PREVTKTtcbiAgICAgICAgICAgIGlmIChpIDwgMCkge1xuICAgICAgICAgICAgICAgIGkgPSAwO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChpID49IE5PREVTKSB7XG4gICAgICAgICAgICAgICAgaSA9IE5PREVTIC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgICAgICBpZiAoQ09FRlNfWVtpXVswXSA+IGxsLnkpIHtcbiAgICAgICAgICAgICAgICAgICAgLS1pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQ09FRlNfWVtpKzFdWzBdIDw9IGxsLnkpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGxpbmVhciBpbnRlcnBvbGF0aW9uIGluIDUgZGVncmVlIGludGVydmFsXG4gICAgICAgICAgICB2YXIgY29lZnMgPSBDT0VGU19ZW2ldO1xuICAgICAgICAgICAgdmFyIHQgPSA1ICogKGxsLnkgLSBjb2Vmc1swXSkgLyAoQ09FRlNfWVtpKzFdWzBdIC0gY29lZnNbMF0pO1xuICAgICAgICAgICAgLy8gZmluZCB0IHNvIHRoYXQgcG9seTNfdmFsKGNvZWZzLCB0KSA9IGxsLnlcbiAgICAgICAgICAgIHQgPSBuZXd0b25fcmFwc2hvbihmdW5jdGlvbih4KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChwb2x5M192YWwoY29lZnMsIHgpIC0gbGwueSkgLyBwb2x5M19kZXIoY29lZnMsIHgpO1xuICAgICAgICAgICAgfSwgdCwgRVBTTE4sIDEwMCk7XG5cbiAgICAgICAgICAgIGxsLnggLz0gcG9seTNfdmFsKENPRUZTX1hbaV0sIHQpO1xuICAgICAgICAgICAgbGwueSA9ICg1ICogaSArIHQpICogRDJSO1xuICAgICAgICAgICAgaWYgKHh5LnkgPCAwKSB7XG4gICAgICAgICAgICAgICAgbGwueSA9IC1sbC55O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGwueCA9IGFkanVzdF9sb24obGwueCArIHRoa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HRcbiAgICAgIHZhciBibSwgYnEsIHl0O1xuICAgICAgeXQgPSAxIC8gKHRoaXMucG4xIC0gcC55ICogdGhpcy5zdyk7XG4gICAgICBibSA9IHRoaXMucG4xICogcC54ICogeXQ7XG4gICAgICBicSA9IHRoaXMucG4xICogcC55ICogdGhpcy5jdyAqIHl0O1xuICAgICAgcC54ID0gYm0gKiB0aGlzLmNnICsgYnEgKiB0aGlzLnNnO1xuICAgICAgcC55ID0gYnEgKiB0aGlzLmNnIC0gYm0gKiB0aGlzLnNnO1xuXG4gICAgICB2YXIgcmggPSBoeXBvdChwLngsIHAueSk7XG4gICAgICBpZiAoTWF0aC5hYnMocmgpIDwgRVBTTE4pIHtcbiAgICAgICAgci54ID0gMDtcbiAgICAgICAgci55ID0gcC55O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIGNvc3osIHNpbno7XG4gICAgICAgIHNpbnogPSAxIC0gcmggKiByaCAqIHRoaXMucGZhY3Q7XG4gICAgICAgIHNpbnogPSAodGhpcy5wIC0gTWF0aC5zcXJ0KHNpbnopKSAvICh0aGlzLnBuMSAvIHJoICsgcmggLyB0aGlzLnBuMSk7XG4gICAgICAgIGNvc3ogPSBNYXRoLnNxcnQoMSAtIHNpbnogKiBzaW56KTtcbiAgICAgICAgc3dpdGNoICh0aGlzLm1vZGUpIHtcbiAgICAgICAgICBjYXNlIG1vZGUuT0JMSVE6XG4gICAgICAgICAgICByLnkgPSBNYXRoLmFzaW4oY29zeiAqIHRoaXMuc2lucGgwICsgcC55ICogc2lueiAqIHRoaXMuY29zcGgwIC8gcmgpO1xuICAgICAgICAgICAgcC55ID0gKGNvc3ogLSB0aGlzLnNpbnBoMCAqIE1hdGguc2luKHIueSkpICogcmg7XG4gICAgICAgICAgICBwLnggKj0gc2lueiAqIHRoaXMuY29zcGgwO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSBtb2RlLkVRVUlUOlxuICAgICAgICAgICAgci55ID0gTWF0aC5hc2luKHAueSAqIHNpbnogLyByaCk7XG4gICAgICAgICAgICBwLnkgPSBjb3N6ICogcmg7XG4gICAgICAgICAgICBwLnggKj0gc2luejtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgbW9kZS5OX1BPTEU6XG4gICAgICAgICAgICByLnkgPSBNYXRoLmFzaW4oY29zeik7XG4gICAgICAgICAgICBwLnkgPSAtcC55O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSBtb2RlLlNfUE9MRTpcbiAgICAgICAgICAgIHIueSA9IC1NYXRoLmFzaW4oY29zeik7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICByLnggPSBNYXRoLmF0YW4yKHAueCwgcC55KTtcbiAgICAgIH1cblxuICAgICAgcC54ID0gci54ICsgdGhpcy5sb25nMDtcbiAgICAgIHAueSA9IHIueTtcbiAgICAgIHJldHVybiBwO1xuICAgIH1cblxuICAgIHZhciBuYW1lcyQzMSA9IFtcIlRpbHRlZF9QZXJzcGVjdGl2ZVwiLCBcInRwZXJzXCJdO1xuICAgIHZhciB0cGVycyA9IHtcbiAgICAgIGluaXQ6IGluaXQkMzAsXG4gICAgICBmb3J3YXJkOiBmb3J3YXJkJDI5LFxuICAgICAgaW52ZXJzZTogaW52ZXJzZSQyOSxcbiAgICAgIG5hbWVzOiBuYW1lcyQzMVxuICAgIH07XG5cbiAgICB2YXIgaW5jbHVkZWRQcm9qZWN0aW9ucyA9IGZ1bmN0aW9uKHByb2o0KXtcbiAgICAgIHByb2o0LlByb2oucHJvamVjdGlvbnMuYWRkKHRtZXJjKTtcbiAgICAgIHByb2o0LlByb2oucHJvamVjdGlvbnMuYWRkKGV0bWVyYyk7XG4gICAgICBwcm9qNC5Qcm9qLnByb2plY3Rpb25zLmFkZCh1dG0pO1xuICAgICAgcHJvajQuUHJvai5wcm9qZWN0aW9ucy5hZGQoc3RlcmVhKTtcbiAgICAgIHByb2o0LlByb2oucHJvamV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NjKTtcbiAgICAgIHByb2o0LlByb2oucHJvamVjdGlvbnMuYWRkKHJvYmluKTtcbiAgICAgIHByb2o0LlByb2oucHJvamVjdGlvbnMuYWRkKGdlb2NlbnQpO1xuICAgICAgcHJvajQuUHJvai5wcm9qZWN0aW9ucy5hZGQodHBlcnMpO1xuICAgIH07XG5cbiAgICBwcm9qNCQxLmRlZmF1bHREYXR1bSA9ICdXR1M4NCc7IC8vZGVmYXVsdCBkYXR1bVxuICAgIHByb2o0JDEuUHJvaiA9IFByb2plY3Rpb247XG4gICAgcHJvajQkMS5XR1M4NCA9IG5ldyBwcm9qNCQxLlByb2ooJ1dHUzg0Jyk7XG4gICAgcHJvajQkMS5Qb2ludCA9IFBvaW50O1xuICAgIHByb2o0JDEudG9Qb2ludCA9IHRvUG9pbnQ7XG4gICAgcHJvajQkMS5kZWZzID0gZGVmcztcbiAgICBwcm9qNCQxLm5hZGdyaWQgPSBuYWRncmlkO1xuICAgIHByb2o0JDEudHJhbnNmb3JtID0gdHJhbnNmb3JtO1xuICAgIHByb2o0JDEubWdycyA9IG1ncnM7XG4gICAgcHJvajQkMS52ZXJzaW9uID0gJzIuNy41JztcbiAgICBpbmNsdWRlZFByb2plY3Rpb25zKHByb2o0JDEpO1xuXG4gICAgcmV0dXJuIHByb2o0JDE7XG5cbn0pKSk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/proj4/dist/proj4-src.js\n"); + +/***/ }), + +/***/ "./node_modules/proj4/dist/proj4-src.js-exposed": +/*!******************************************************!*\ + !*** ./node_modules/proj4/dist/proj4-src.js-exposed ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(global) {module.exports = global[\"proj4\"] = __webpack_require__(/*! -!./proj4-src.js */ \"./node_modules/proj4/dist/proj4-src.js\");\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy9wcm9qNC9kaXN0L3Byb2o0LXNyYy5qcy1leHBvc2VkPzkzMzQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUZBQW1DLG1CQUFPLENBQUMsZ0VBQWtCLEUiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvcHJvajQvZGlzdC9wcm9qNC1zcmMuanMtZXhwb3NlZC5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZ2xvYmFsW1wicHJvajRcIl0gPSByZXF1aXJlKFwiLSEuL3Byb2o0LXNyYy5qc1wiKTsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/proj4/dist/proj4-src.js-exposed\n"); + +/***/ }), + +/***/ "./node_modules/sortablejs/modular/sortable.esm.js": +/*!*********************************************************!*\ + !*** ./node_modules/sortablejs/modular/sortable.esm.js ***! + \*********************************************************/ +/*! exports provided: default, MultiDrag, Sortable, Swap */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MultiDrag\", function() { return MultiDragPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Sortable\", function() { return Sortable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Swap\", function() { return SwapPlugin; });\n/**!\n * Sortable 1.14.0\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.14.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\n * @param {Number} x X position\n * @param {Number} y Y position\n * @return {HTMLElement} Element of the first found nearest Sortable\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\n * @class Sortable\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // if there is a last element, it is the target\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n el.appendChild(dragEl);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n\n if (firstChild === dragEl) {\n return completed(false);\n }\n\n target = firstChild;\n targetRect = getRect(target);\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\n * Serializes the item into an array of string.\n * @returns {String[]}\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\n * Sorts the elements according to the array.\n * @param {String[]} order order of the items\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\n * Save the current sorting\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\n * @param {HTMLElement} el\n * @param {String} [selector] default: `options.draggable`\n * @returns {HTMLElement|null}\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\n * Set/get option\n * @param {string} name\n * @param {*} [value]\n * @returns {*}\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\n * Destroy\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var spacer = 10;\n return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\n * Gets the direction dragEl must be swapped relative to target in order to make it\n * seem that dragEl has been \"inserted\" into that element's position\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\n * @return {Number} Direction dragEl must be swapped\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\n * Generate id\n * @param {HTMLElement} el\n * @returns {String}\n * @private\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\n * Get the Sortable instance of an element\n * @param {HTMLElement} element The element\n * @return {Sortable|undefined} The instance of Sortable\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\n * Mount a plugin to Sortable\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\n * Create sortable instance\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvt: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvt: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvt: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n folding = false; // Do not \"unfold\" after around dragEl if reverted\n\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvt: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\n * Selects the provided multi-drag item\n * @param {HTMLElement} el The element to be selected\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\n * Deselects the provided multi-drag item\n * @param {HTMLElement} el The element to be deselected\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\n * Insert multi-drag clones\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\n * @param {HTMLElement} rootEl\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sortable);\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Hc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H1cblxuICAgICAgICAgIF90aGlzLmFuaW1hdGUodGFyZ2V0LCBhbmltYXRpbmdSZWN0LCB0b1JlY3QsIHRpbWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRpbWUpIHtcbiAgICAgICAgICBhbmltYXRpbmcgPSB0cnVlO1xuICAgICAgICAgIGFuaW1hdGlvblRpbWUgPSBNYXRoLm1heChhbmltYXRpb25UaW1lLCB0aW1lKTtcbiAgICAgICAgICBjbGVhclRpbWVvdXQodGFyZ2V0LmFuaW1hdGlvblJlc2V0VGltZXIpO1xuICAgICAgICAgIHRhcmdldC5hbmltYXRpb25SZXNldFRpbWVyID0gc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0YXJnZXQuYW5pbWF0aW9uVGltZSA9IDA7XG4gICAgICAgICAgICB0YXJnZXQucHJldkZyb21SZWN0ID0gbnVsbDtcbiAgICAgICAgICAgIHRhcmdldC5mcm9tUmVjdCA9IG51bGw7XG4gICAgICAgICAgICB0YXJnZXQucHJldlRvUmVjdCA9IG51bGw7XG4gICAgICAgICAgICB0YXJnZXQudGhpc0FuaW1hdGlvbkR1cmF0aW9uID0gbnVsbDtcbiAgICAgICAgICB9LCB0aW1lKTtcbiAgICAgICAgICB0YXJnZXQudGhpc0FuaW1hdGlvbkR1cmF0aW9uID0gdGltZTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICBjbGVhclRpbWVvdXQoYW5pbWF0aW9uQ2FsbGJhY2tJZCk7XG5cbiAgICAgIGlmICghYW5pbWF0aW5nKSB7XG4gICAgICAgIGlmICh0eXBlb2YgY2FsbGJhY2sgPT09ICdmdW5jdGlvbicpIGNhbGxiYWNrKCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBhbmltYXRpb25DYWxsYmFja0lkID0gc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBjYWxsYmFjayA9PT0gJ2Z1bmN0aW9uJykgY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ICAgICAgICBldnQ6IGV2dFxuICAgICAgICB9KTtcbiAgICAgICAgcHJldmVudE9uRmlsdGVyICYmIGV2dC5jYW5jZWxhYmxlICYmIGV2dC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICByZXR1cm47IC8vIGNhbmNlbCBkbmRcbiAgICAgIH1cbiAgICB9IGVsc2UgaWYgKGZpbHRlcikge1xuICAgICAgZmlsdGVyID0gZmlsdGVyLnNwbGl0KCcsJykuc29tZShmdW5jdGlvbiAoY3JpdGVyaWEpIHtcbiAgICAgICAgY3JpdGVyaWEgPSBjbG9zZXN0KG9yaWdpbmFsVGFyZ2V0LCBjcml0ZXJpYS50cmltKCksIGVsLCBmYWxzZSk7XG5cbiAgICAgICAgaWYgKGNyaXRlcmlhKSB7XG4gICAgICAgICAgX2Rpc3BhdGNoRXZlbnQoe1xuICAgICAgICAgICAgc29ydGFibGU6IF90aGlzLFxuICAgICAgICAgICAgcm9vdEVsOiBjcml0ZXJpYSxcbiAgICAgICAgICAgIG5hbWU6ICdmaWx0ZXInLFxuICAgICAgICAgICAgdGFyZ2V0RWw6IHRhcmdldCxcbiAgICAgICAgICAgIGZyb21FbDogZWwsXG4gICAgICAgICAgICB0b0VsOiBlbFxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcGx1Z2luRXZlbnQoJ2ZpbHRlcicsIF90aGlzLCB7XG4gICAgICAgICAgICBldnQ6IGV2dFxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgaWYgKGZpbHRlcikge1xuICAgICAgICBwcmV2ZW50T25GaWx0ZXIgJiYgZXZ0LmNhbmNlbGFibGUgJiYgZXZ0LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIHJldHVybjsgLy8gY2FuY2VsIGRuZFxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChvcHRpb25zLmhhbmRsZSAmJiAhY2xvc2VzdChvcmlnaW5hbF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1xuICAgICAgICAgIGdob3N0TWF0cml4LmUgKz0gZHggLSAobGFzdER4IHx8IDApO1xuICAgICAgICAgIGdob3N0TWF0cml4LmYgKz0gZHkgLSAobGFzdER5IHx8IDApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGdob3N0TWF0cml4ID0ge1xuICAgICAgICAgICAgYTogMSxcbiAgICAgICAgICAgIGI6IDAsXG4gICAgICAgICAgICBjOiAwLFxuICAgICAgICAgICAgZDogMSxcbiAgICAgICAgICAgIGU6IGR4LFxuICAgICAgICAgICAgZjogZHlcbiAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGNzc01hdHJpeCA9IFwibWF0cml4KFwiLmNvbmNhdChnaG9zdE1hdHJpeC5hLCBcIixcIikuY29uY2F0KGdob3N0TWF0cml4LmIsIFwiLFwiKS5jb25jYXQoZ2hvc3RNYXRyaXguYywgXCIsXCIpLmNvbmNhdChnaG9zdE1hdHJpeC5kLCBcIixcIikuY29uY2F0KGdob3N0TWF0cml4LmUsIFwiLFwiKS5jb25jYXQoZ2hvc3RNYXRyaXguZiwgXCIpXCIpO1xuICAgICAgICBjc3MoZ2hvc3RFbCwgJ3dlYmtpdFRyYW5zZm9ybScsIGNzc01hdHJpeCk7XG4gICAgICAgIGNzcyhnaG9zdEVsLCAnbW96VHJhbnNmb3JtJywgY3NzTWF0cml4KTtcbiAgICAgICAgY3NzKGdob3N0RWwsICdtc1RyYW5zZm9ybScsIGNzc01hdHJpeCk7XG4gICAgICAgIGNzcyhnaG9zdEVsLCAndHJhbnNmb3JtJywgY3NzTWF0cml4KTtcbiAgICAgICAgbGFzdER4ID0gZHg7XG4gICAgICAgIGxhc3REeSA9IGR5O1xuICAgICAgICB0b3VjaEV2dCA9IHRvdWNoO1xuICAgICAgfVxuXG4gICAgICBldnQuY2FuY2VsYWJsZSAmJiBldnQucHJldmVudERlZmF1bHQoKTtcbiAgICB9XG4gIH0sXG4gIF9hcHBlbmRHaG9zdDogZ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50KHtcbiAgICAgICAgICAgICAgcm9vdEVsOiBwYXJlbnRFbCxcbiAgICAgICAgICAgICAgbmFtZTogJ2FkZCcsXG4gICAgICAgICAgICAgIHRvRWw6IHBhcmVudEVsLFxuICAgICAgICAgICAgICBmcm9tRWw6IHJvb3RFbCxcbiAgICAgICAgICAgICAgb3JpZ2luYWxFdmVudDogZXZ0XG4gICAgICAgICAgICB9KTsgLy8gUmVtb3ZlIGV2ZW50XG5cblxuICAgICAgICAgICAgX2Rpc3BhdGNoRXZlbnQoe1xuICAgICAgICAgICAgICBzb3J0YWJsZTogdGhpcyxcbiAgICAgICAgICAgICAgbmFtZTogJ3JlbW92ZScsXG4gICAgICAgICAgICAgIHRvRWw6IHBhcmVudEVsLFxuICAgICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBldnRcbiAgICAgICAgICAgIH0pOyAvLyBkcmFnIGZyb20gb25lIGxpc3QgYW5kIGRyb3AgaW50byBhbm90aGVyXG5cblxuICAgICAgICAgICAgX2Rpc3BhdGNoRXZlbnQoe1xuICAgICAgICAgICAgICByb290RWw6IHBhcmVudEVsLFxuICAgICAgICAgICAgICBuYW1lOiAnc29ydCcsXG4gICAgICAgICAgICAgIHRvRWw6IHBhcmVudEVsLFxuICAgICAgICAgICAgICBmcm9tRWw6IHJvb3RFbCxcbiAgICAgICAgICAgICAgb3JpZ2luYWxFdmVudDogZXZ0XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgX2Rpc3BhdGNoRXZlbnQoe1xuICAgICAgICAgICAgICBzb3J0YWJsZTogdGhpcyxcbiAgICAgICAgICAgICAgbmFtZTogJ3NvcnQnLFxuICAgICAgICAgICAgICB0b0VsOiBwYXJlbnRFbCxcbiAgICAgICAgICAgICAgb3JpZ2luYWxFdmVudDogZXZ0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBwdXRTb3J0YWJsZSAmJiBwdXRTb3J0YWJsZS5zYXZlKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKG5ld0luZGV4ICE9PSBvbGRJbmRleCkge1xuICAgICAgICAgICAgaWYgKG5ld0luZGV4ID49IDApIHtcbiAgICAgICAgICAgICAgLy8gZHJhZyAmIGRyb3Agd2l0aGluIHRoZSBzYW1lIGxpc3RcbiAgICAgICAgICAgICAgX2Rpc3BhdGNoRXZlbnQoe1xuICAgICAgICAgICAgICAgIHNvcnRhYmxlOiB0aGlzLFxuICAgICAgICAgICAgICAgIG5hbWU6ICd1cGRhdGUnLFxuICAgICAgICAgICAgICAgIHRvRWw6IHBhcmVudEVsLFxuICAgICAgICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGV2dFxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBfZGlzcGF0Y2hFdmVudCh7XG4gICAgICAgICAgICAgICAgc29ydGFibGU6IHRoaXMsXG4gICAgICAgICAgICAgICAgbmFtZTogJ3NvcnQnLFxuICAgICAgICAgICAgICAgIHRvRWw6IHBhcmVudEVsLFxuICAgICAgICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGV2dFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoU29ydGFibGUuYWN0aXZlKSB7XG4gICAgICAgICAgLyoganNoaW50IGVxbnVsbDp0cnVlICovXG4gICAgICAgICAgaWYgKG5ld0luZGV4ID09IG51bGwgfHwgbmV3SW5kZXggPT09IC0xKSB7XG4gICAgICAgICAgICBuZXdJbmRleCA9IG9sZEluZGV4O1xuICAgICAgICAgICAgbmV3RHJhZ2dhYmxlSW5kZXggPSBvbGREcmFnZ2FibGVJbmRleDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBfZGlzcGF0Y2hFdmVudCh7XG4gICAgICAgICAgICBzb3J0YWJsZTogdGhpcyxcbiAgICAgICAgICAgIG5hbWU6ICdlbmQnLFxuICAgICAgICAgICAgdG9FbDogc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gICAgICAgICAgICAgLy8gTXVzdCBpbmNsdWRlIGxhc3RNdWx0aURyYWdTZWxlY3QgKHNlbGVjdCBpdCksIGluIGNhc2UgbW9kaWZpZWQgc2VsZWN0aW9uIGZyb20gbm8gc2VsZWN0aW9uXG4gICAgICAgICAgICAgIC8vIChidXQgcHJldmlvdXMgc2VsZWN0aW9uIGV4aXN0ZWQpXG4gICAgICAgICAgICAgIHZhciBuLCBpO1xuXG4gICAgICAgICAgICAgIGlmIChjdXJyZW50SW5kZXggPiBsYXN0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICBpID0gbGFzdEluZGV4O1xuICAgICAgICAgICAgICAgIG4gPSBjdXJyZW50SW5kZXg7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaSA9IGN1cnJlbnRJbmRleDtcbiAgICAgICAgICAgICAgICBuID0gbGFzdEluZGV4ICsgMTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGZvciAoOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKH5tdWx0aURyYWdFbGVtZW50cy5pbmRleE9mKGNoaWxkcmVuW2ldKSkgY29udGludWU7XG4gICAgICAgICAgICAgICAgdG9nZ2xlQ2xhc3MoY2hpbGRyZW5baV0sIG9wdGlvbnMuc2VsZWN0ZWRDbGFzcywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgbXVsdGlEcmFnRWxlbWVudHMucHVzaChjaGlsZHJlbltpXSk7XG4gICAgICAgICAgICAgICAgZGlzcGF0Y2hFdmVudCh7XG4gICAgICAgICAgICAgICAgICBzb3J0YWJsZTogc29ydGFibGUsXG4gICAgICAgICAgICAgICAgICByb290RWw6IHJvb3RFbCxcbiAgICAgICAgICAgICAgICAgIG5hbWU6ICdzZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgdGFyZ2V0RWw6IGNoaWxkcmVuW2ldLFxuICAgICAgICAgICAgICAgICAgb3JpZ2luYWxFdnQ6I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gICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IC8vIE11bHRpIGRyYWcgZWxlbWVudHMgYXJlIG5vdCBuZWNlc3NhcmlseSByZW1vdmVkIGZyb20gdGhlIERPTSBvbiBkcm9wLCBzbyB0byByZWluc2VydFxuICAgICAgICAgICAgLy8gcHJvcGVybHkgdGhleSBtdXN0IGFsbCBiZSByZW1vdmVkXG5cblxuICAgICAgICAgICAgcmVtb3ZlTXVsdGlEcmFnRWxlbWVudHMoKTtcbiAgICAgICAgICAgIG11bHRpRHJhZ0VsZW1lbnRzLmZvckVhY2goZnVuY3Rpb24gKG11bHRpRHJhZ0VsZW1lbnQpIHtcbiAgICAgICAgICAgICAgaWYgKGNoaWxkcmVuW211bHRpRHJhZ0luZGV4XSkge1xuICAgICAgICAgICAgICAgIHBhcmVudEVsLmluc2VydEJlZm9yZShtdWx0aURyYWdFbGVtZW50LCBjaGlsZHJlblttdWx0aURyYWdJbmRleF0pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHBhcmVudEVsLmFwcGVuZENoaWxkKG11bHRpRHJhZ0VsZW1lbnQpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgbXVsdGlEcmFnSW5kZXgrKztcbiAgICAgICAgICAgIH0pOyAvLyBJZiBpbml0aWFsIGZvbGRpbmcgaXMgZG9uZSwgdGhlIGVsZW1lbnRzIG1heSBoYXZlIGNoYW5nZWQgcG9zaXRpb24gYmVjYXVzZSB0aGV5IGFyZSBub3dcbiAgICAgICAgICAgIC8vIHVuZm9sZGluZyBhcm91bmQgZHJhZ0VsLCBldmVuIHRob3VnaCBkcmFnRWwgbWF5IG5vdCBoYXZlIGhpcyBpbmRleCBjaGFuZ2VkLCBzbyB1cGRhdGUgZXZlbnRcbiAgICAgICAgICAgIC8vIG11c3QgYmUgZmlyZWQgaGVyZSBhcyBTb3J0YWJsZSB3aWxsIG5vdC5cblxuICAgICAgICAgICAgaWYgKG9sZEluZGV4ID09PSBpbmRleChkcmFnRWwkMSkpIHtcbiAgICAgICAgICAgICAgdmFyIHVwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICBtdWx0aURyYWdFbGVtZW50cy5mb3JFYWNoKGZ1bmN0aW9uIChtdWx0aURyYWdFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgaWYgKG11bHRpRHJhZ0VsZW1lbnQuc29ydGFibGVJbmRleCAhPT0gaW5kZXgobXVsdGlEcmFnRWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICAgIHVwZGF0ZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBpZiAodXBkYXRlKSB7XG4gICAgICAgICAgICAgICAgZGlzcGF0Y2hTb3J0YWJsZUV2ZW50KCd1cGRhdGUnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gLy8gTXVzdCBiZSBkb25lIGFmdGVyIGNhcHR1cmluZyBpbmRpdmlkdWFsIHJlY3RzIChzY3JvbGwgYmFyKVxuXG5cbiAgICAgICAgICBtdWx0aURyYWdFbGVtZW50cy5mb3JFYWNoKGZ1bmN0aW9uIChtdWx0aURyYWdFbGVtZW50KSB7XG4gICAgICAgICAgICB1bnNldFJlY3QobXVsdGlEcmFnRWxlbWVudCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgdG9Tb3J0YWJsZS5hbmltYXRlQWxsKCk7XG4gICAgICAgIH1cblxuICAgICAgICBtdWx0aURyYWdTb3J0YWJsZSA9IHRvU29ydGFibGU7XG4gICAgICB9IC8vIFJlbW92ZSBjbG9uZXMgaWYgbmVjZXNzYXJ5XG5cblxuICAgICAgaWYgKHJvb3RFbCA9PT0gcGFyZW50RWwgfHwgcHV0U29ydGFibGUgJiYgcHV0U29ydGF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gICAgICBtdWx0aURyYWdFbGVtZW50OiBtdWx0aURyYWdFbGVtZW50LFxuICAgICAgICAgIGluZGV4OiBtdWx0aURyYWdFbGVtZW50LnNvcnRhYmxlSW5kZXhcbiAgICAgICAgfSk7IC8vIG11bHRpRHJhZ0VsZW1lbnRzIHdpbGwgYWxyZWFkeSBiZSBzb3J0ZWQgaWYgZm9sZGluZ1xuXG4gICAgICAgIHZhciBuZXdJbmRleDtcblxuICAgICAgICBpZiAoZm9sZGluZyAmJiBtdWx0aURyYWdFbGVtZW50ICE9PSBkcmFnRWwkMSkge1xuICAgICAgICAgIG5ld0luZGV4ID0gLTE7XG4gICAgICAgIH0gZWxzZSBpZiAoZm9sZGluZykge1xuICAgICAgICAgIG5ld0luZGV4ID0gaW5kZXgobXVsdGlEcmFnRWxlbWVudCwgJzpub3QoLicgKyBfdGhpczMub3B0aW9ucy5zZWxlY3RlZENsYXNzICsgJyknKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXdJbmRleCA9IGluZGV4KG11bHRpRHJhZ0VsZW1lbnQpO1xuICAgICAgICB9XG5cbiAgICAgICAgbmV3SW5kaWNpZXMucHVzaCh7XG4gICAgICAgICAgbXVsdGlEcmFnRWxlbWVudDogbXVsdGlEcmFnRWxlbWVudCxcbiAgICAgICAgICBpbmRleDogbmV3SW5kZXhcbiAgICAgICAgfSk7XG4gICAgICB9KTtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIGl0ZW1zOiBfdG9Db25zdW1hYmxlQXJyYXkobXVsdGlEcmFnRWxlbWVudHMpLFxuICAgICAgICBjbG9uZXM6IFtdLmNvbmNhdChtdWx0aURyYWdDbG9uZXMpLFxuICAgICAgICBvbGRJbmRpY2llczogb2xkSW5kaWNpZXMsXG4gICAgICAgIG5ld0luZGljaWVzOiBuZXdJbmRpY2llc1xuICAgICAgfTtcbiAgICB9LFxuICAgIG9wdGlvbkxpc3RlbmVyczoge1xuICAgICAgbXVsdGlEcmFnS2V5OiBmd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NdWx0aURyYWdDbG9uZXMoZWxlbWVudHNJbnNlcnRlZCwgcm9vdEVsKSB7XG4gIG11bHRpRHJhZ0Nsb25lcy5mb3JFYWNoKGZ1bmN0aW9uIChjbG9uZSwgaSkge1xuICAgIHZhciB0YXJnZXQgPSByb290RWwuY2hpbGRyZW5bY2xvbmUuc29ydGFibGVJbmRleCArIChlbGVtZW50c0luc2VydGVkID8gTnVtYmVyKGkpIDogMCldO1xuXG4gICAgaWYgKHRhcmdldCkge1xuICAgICAgcm9vdEVsLmluc2VydEJlZm9yZShjbG9uZSwgdGFyZ2V0KTtcbiAgICB9IGVsc2Uge1xuICAgICAgcm9vdEVsLmFwcGVuZENoaWxkKGNsb25lKTtcbiAgICB9XG4gIH0pO1xufVxuXG5mdW5jdGlvbiByZW1vdmVNdWx0aURyYWdFbGVtZW50cygpIHtcbiAgbXVsdGlEcmFnRWxlbWVudHMuZm9yRWFjaChmdW5jdGlvbiAobXVsdGlEcmFnRWxlbWVudCkge1xuICAgIGlmIChtdWx0aURyYWdFbGVtZW50ID09PSBkcmFnRWwkMSkgcmV0dXJuO1xuICAgIG11bHRpRHJhZ0VsZW1lbnQucGFyZW50Tm9kZSAmJiBtdWx0aURyYWdFbGVtZW50LnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQobXVsdGlEcmFnRWxlbWVudCk7XG4gIH0pO1xufVxuXG5Tb3J0YWJsZS5tb3VudChuZXcgQXV0b1Njcm9sbFBsdWdpbigpKTtcblNvcnRhYmxlLm1vdW50KFJlbW92ZSwgUmV2ZXJ0KTtcblxuZXhwb3J0IGRlZmF1bHQgU29ydGFibGU7XG5leHBvcnQgeyBNdWx0aURyYWdQbHVnaW4gYXMgTXVsdGlEcmFnLCBTb3J0YWJsZSwgU3dhcFBsdWdpbiBhcyBTd2FwIH07XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/sortablejs/modular/sortable.esm.js\n"); + +/***/ }), + +/***/ "./node_modules/three/build/three.module.js": +/*!**************************************************!*\ + !*** ./node_modules/three/build/three.module.js ***! + \**************************************************/ +/*! exports provided: ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, AxisHelper, BackSide, BasicDepthPacking, BasicShadowMap, BinaryTextureLoader, Bone, BooleanKeyframeTrack, BoundingBoxHelper, Box2, Box3, Box3Helper, BoxBufferGeometry, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasRenderer, CanvasTexture, CatmullRomCurve3, CineonToneMapping, CircleBufferGeometry, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, CompressedTexture, CompressedTextureLoader, ConeBufferGeometry, ConeGeometry, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubeUVRefractionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderBufferGeometry, CylinderGeometry, Cylindrical, DataTexture, DataTexture2DArray, DataTexture3D, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronBufferGeometry, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicBufferAttribute, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EdgesHelper, EllipseCurve, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeBufferGeometry, ExtrudeGeometry, FaceColors, FileLoader, FlatShading, Float16BufferAttribute, Float32Attribute, Float32BufferAttribute, Float64Attribute, Float64BufferAttribute, FloatType, Fog, FogExp2, Font, FontLoader, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterDepth, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronBufferGeometry, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, ImmediateRenderObject, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16Attribute, Int16BufferAttribute, Int32Attribute, Int32BufferAttribute, Int8Attribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, JSONLoader, KeepStencilOp, KeyframeTrack, LOD, LatheBufferGeometry, LatheGeometry, Layers, LensFlare, LessDepth, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LinePieces, LineSegments, LineStrip, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearToneMapping, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, Math, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshFaceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiMaterial, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverDepth, NeverStencilFunc, NoBlending, NoColors, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronBufferGeometry, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, ParametricGeometry, Particle, ParticleBasicMaterial, ParticleSystem, ParticleSystemMaterial, Path, PerspectiveCamera, Plane, PlaneBufferGeometry, PlaneGeometry, PlaneHelper, PointCloud, PointCloudMaterial, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronBufferGeometry, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBFormat, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingBufferGeometry, RingGeometry, Scene, SceneUtils, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeBufferGeometry, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, SmoothShading, Sphere, SphereBufferGeometry, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronBufferGeometry, TetrahedronGeometry, TextGeometry, Texture, TextureLoader, TorusBufferGeometry, TorusGeometry, TorusKnotBufferGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeBufferGeometry, TubeGeometry, UVMapping, Uint16Attribute, Uint16BufferAttribute, Uint32Attribute, Uint32BufferAttribute, Uint8Attribute, Uint8BufferAttribute, Uint8ClampedAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, Vertex, VertexColors, VideoTexture, WebGL1Renderer, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLMultisampleRenderTarget, WebGLRenderTarget, WebGLRenderTargetCube, WebGLRenderer, WebGLUtils, WireframeGeometry, WireframeHelper, WrapAroundEnding, XHRLoader, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, sRGBEncoding */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ACESFilmicToneMapping\", function() { return ACESFilmicToneMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AddEquation\", function() { return AddEquation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AddOperation\", function() { return AddOperation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AdditiveAnimationBlendMode\", function() { return AdditiveAnimationBlendMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AdditiveBlending\", function() { return AdditiveBlending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AlphaFormat\", function() { return AlphaFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AlwaysDepth\", function() { return AlwaysDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AlwaysStencilFunc\", function() { return AlwaysStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AmbientLight\", function() { return AmbientLight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AmbientLightProbe\", function() { return AmbientLightProbe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnimationClip\", function() { return AnimationClip; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnimationLoader\", function() { return AnimationLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnimationMixer\", function() { return AnimationMixer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnimationObjectGroup\", function() { return AnimationObjectGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnimationUtils\", function() { return AnimationUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ArcCurve\", function() { return ArcCurve; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ArrayCamera\", function() { return ArrayCamera; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ArrowHelper\", function() { return ArrowHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Audio\", function() { return Audio; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AudioAnalyser\", function() { return AudioAnalyser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AudioContext\", function() { return AudioContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AudioListener\", function() { return AudioListener; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AudioLoader\", function() { return AudioLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AxesHelper\", function() { return AxesHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AxisHelper\", function() { return AxisHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BackSide\", function() { return BackSide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BasicDepthPacking\", function() { return BasicDepthPacking; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BasicShadowMap\", function() { return BasicShadowMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BinaryTextureLoader\", function() { return BinaryTextureLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Bone\", function() { return Bone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BooleanKeyframeTrack\", function() { return BooleanKeyframeTrack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BoundingBoxHelper\", function() { return BoundingBoxHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Box2\", function() { return Box2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Box3\", function() { return Box3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Box3Helper\", function() { return Box3Helper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BoxBufferGeometry\", function() { return BoxGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BoxGeometry\", function() { return BoxGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BoxHelper\", function() { return BoxHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BufferAttribute\", function() { return BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BufferGeometry\", function() { return BufferGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BufferGeometryLoader\", function() { return BufferGeometryLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ByteType\", function() { return ByteType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Cache\", function() { return Cache; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Camera\", function() { return Camera; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CameraHelper\", function() { return CameraHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CanvasRenderer\", function() { return CanvasRenderer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CanvasTexture\", function() { return CanvasTexture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CatmullRomCurve3\", function() { return CatmullRomCurve3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CineonToneMapping\", function() { return CineonToneMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CircleBufferGeometry\", function() { return CircleGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CircleGeometry\", function() { return CircleGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ClampToEdgeWrapping\", function() { return ClampToEdgeWrapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Clock\", function() { return Clock; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Color\", function() { return Color; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ColorKeyframeTrack\", function() { return ColorKeyframeTrack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CompressedTexture\", function() { return CompressedTexture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CompressedTextureLoader\", function() { return CompressedTextureLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConeBufferGeometry\", function() { return ConeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConeGeometry\", function() { return ConeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubeCamera\", function() { return CubeCamera; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubeReflectionMapping\", function() { return CubeReflectionMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubeRefractionMapping\", function() { return CubeRefractionMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubeTexture\", function() { return CubeTexture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubeTextureLoader\", function() { return CubeTextureLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubeUVReflectionMapping\", function() { return CubeUVReflectionMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubeUVRefractionMapping\", function() { return CubeUVRefractionMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubicBezierCurve\", function() { return CubicBezierCurve; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubicBezierCurve3\", function() { return CubicBezierCurve3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CubicInterpolant\", function() { return CubicInterpolant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CullFaceBack\", function() { return CullFaceBack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CullFaceFront\", function() { return CullFaceFront; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CullFaceFrontBack\", function() { return CullFaceFrontBack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CullFaceNone\", function() { return CullFaceNone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Curve\", function() { return Curve; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CurvePath\", function() { return CurvePath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CustomBlending\", function() { return CustomBlending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CustomToneMapping\", function() { return CustomToneMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CylinderBufferGeometry\", function() { return CylinderGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CylinderGeometry\", function() { return CylinderGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Cylindrical\", function() { return Cylindrical; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataTexture\", function() { return DataTexture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataTexture2DArray\", function() { return DataTexture2DArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataTexture3D\", function() { return DataTexture3D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataTextureLoader\", function() { return DataTextureLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataUtils\", function() { return DataUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DecrementStencilOp\", function() { return DecrementStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DecrementWrapStencilOp\", function() { return DecrementWrapStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefaultLoadingManager\", function() { return DefaultLoadingManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DepthFormat\", function() { return DepthFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DepthStencilFormat\", function() { return DepthStencilFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DepthTexture\", function() { return DepthTexture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DirectionalLight\", function() { return DirectionalLight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DirectionalLightHelper\", function() { return DirectionalLightHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DiscreteInterpolant\", function() { return DiscreteInterpolant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DodecahedronBufferGeometry\", function() { return DodecahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DodecahedronGeometry\", function() { return DodecahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DoubleSide\", function() { return DoubleSide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DstAlphaFactor\", function() { return DstAlphaFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DstColorFactor\", function() { return DstColorFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DynamicBufferAttribute\", function() { return DynamicBufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DynamicCopyUsage\", function() { return DynamicCopyUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DynamicDrawUsage\", function() { return DynamicDrawUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DynamicReadUsage\", function() { return DynamicReadUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EdgesGeometry\", function() { return EdgesGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EdgesHelper\", function() { return EdgesHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EllipseCurve\", function() { return EllipseCurve; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EqualDepth\", function() { return EqualDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EqualStencilFunc\", function() { return EqualStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EquirectangularReflectionMapping\", function() { return EquirectangularReflectionMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EquirectangularRefractionMapping\", function() { return EquirectangularRefractionMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Euler\", function() { return Euler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EventDispatcher\", function() { return EventDispatcher; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtrudeBufferGeometry\", function() { return ExtrudeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtrudeGeometry\", function() { return ExtrudeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FaceColors\", function() { return FaceColors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FileLoader\", function() { return FileLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlatShading\", function() { return FlatShading; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Float16BufferAttribute\", function() { return Float16BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Float32Attribute\", function() { return Float32Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Float32BufferAttribute\", function() { return Float32BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Float64Attribute\", function() { return Float64Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Float64BufferAttribute\", function() { return Float64BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FloatType\", function() { return FloatType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Fog\", function() { return Fog; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FogExp2\", function() { return FogExp2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Font\", function() { return Font; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FontLoader\", function() { return FontLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FramebufferTexture\", function() { return FramebufferTexture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FrontSide\", function() { return FrontSide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Frustum\", function() { return Frustum; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GLBufferAttribute\", function() { return GLBufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GLSL1\", function() { return GLSL1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GLSL3\", function() { return GLSL3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GreaterDepth\", function() { return GreaterDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GreaterEqualDepth\", function() { return GreaterEqualDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GreaterEqualStencilFunc\", function() { return GreaterEqualStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GreaterStencilFunc\", function() { return GreaterStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GridHelper\", function() { return GridHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Group\", function() { return Group; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HalfFloatType\", function() { return HalfFloatType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HemisphereLight\", function() { return HemisphereLight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HemisphereLightHelper\", function() { return HemisphereLightHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HemisphereLightProbe\", function() { return HemisphereLightProbe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IcosahedronBufferGeometry\", function() { return IcosahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IcosahedronGeometry\", function() { return IcosahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ImageBitmapLoader\", function() { return ImageBitmapLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ImageLoader\", function() { return ImageLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ImageUtils\", function() { return ImageUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ImmediateRenderObject\", function() { return ImmediateRenderObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IncrementStencilOp\", function() { return IncrementStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IncrementWrapStencilOp\", function() { return IncrementWrapStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InstancedBufferAttribute\", function() { return InstancedBufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InstancedBufferGeometry\", function() { return InstancedBufferGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InstancedInterleavedBuffer\", function() { return InstancedInterleavedBuffer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InstancedMesh\", function() { return InstancedMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Int16Attribute\", function() { return Int16Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Int16BufferAttribute\", function() { return Int16BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Int32Attribute\", function() { return Int32Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Int32BufferAttribute\", function() { return Int32BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Int8Attribute\", function() { return Int8Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Int8BufferAttribute\", function() { return Int8BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IntType\", function() { return IntType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterleavedBuffer\", function() { return InterleavedBuffer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterleavedBufferAttribute\", function() { return InterleavedBufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Interpolant\", function() { return Interpolant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterpolateDiscrete\", function() { return InterpolateDiscrete; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterpolateLinear\", function() { return InterpolateLinear; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterpolateSmooth\", function() { return InterpolateSmooth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InvertStencilOp\", function() { return InvertStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JSONLoader\", function() { return JSONLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KeepStencilOp\", function() { return KeepStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KeyframeTrack\", function() { return KeyframeTrack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOD\", function() { return LOD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LatheBufferGeometry\", function() { return LatheGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LatheGeometry\", function() { return LatheGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Layers\", function() { return Layers; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LensFlare\", function() { return LensFlare; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LessDepth\", function() { return LessDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LessEqualDepth\", function() { return LessEqualDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LessEqualStencilFunc\", function() { return LessEqualStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LessStencilFunc\", function() { return LessStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Light\", function() { return Light; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LightProbe\", function() { return LightProbe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Line\", function() { return Line; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Line3\", function() { return Line3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LineBasicMaterial\", function() { return LineBasicMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LineCurve\", function() { return LineCurve; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LineCurve3\", function() { return LineCurve3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LineDashedMaterial\", function() { return LineDashedMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LineLoop\", function() { return LineLoop; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinePieces\", function() { return LinePieces; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LineSegments\", function() { return LineSegments; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LineStrip\", function() { return LineStrip; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearEncoding\", function() { return LinearEncoding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearFilter\", function() { return LinearFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearInterpolant\", function() { return LinearInterpolant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearMipMapLinearFilter\", function() { return LinearMipMapLinearFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearMipMapNearestFilter\", function() { return LinearMipMapNearestFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearMipmapLinearFilter\", function() { return LinearMipmapLinearFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearMipmapNearestFilter\", function() { return LinearMipmapNearestFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinearToneMapping\", function() { return LinearToneMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Loader\", function() { return Loader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LoaderUtils\", function() { return LoaderUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LoadingManager\", function() { return LoadingManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LoopOnce\", function() { return LoopOnce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LoopPingPong\", function() { return LoopPingPong; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LoopRepeat\", function() { return LoopRepeat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LuminanceAlphaFormat\", function() { return LuminanceAlphaFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LuminanceFormat\", function() { return LuminanceFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MOUSE\", function() { return MOUSE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Material\", function() { return Material; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MaterialLoader\", function() { return MaterialLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Math\", function() { return MathUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MathUtils\", function() { return MathUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Matrix3\", function() { return Matrix3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Matrix4\", function() { return Matrix4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MaxEquation\", function() { return MaxEquation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Mesh\", function() { return Mesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshBasicMaterial\", function() { return MeshBasicMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshDepthMaterial\", function() { return MeshDepthMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshDistanceMaterial\", function() { return MeshDistanceMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshFaceMaterial\", function() { return MeshFaceMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshLambertMaterial\", function() { return MeshLambertMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshMatcapMaterial\", function() { return MeshMatcapMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshNormalMaterial\", function() { return MeshNormalMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshPhongMaterial\", function() { return MeshPhongMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshPhysicalMaterial\", function() { return MeshPhysicalMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshStandardMaterial\", function() { return MeshStandardMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshToonMaterial\", function() { return MeshToonMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MinEquation\", function() { return MinEquation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MirroredRepeatWrapping\", function() { return MirroredRepeatWrapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MixOperation\", function() { return MixOperation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MultiMaterial\", function() { return MultiMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MultiplyBlending\", function() { return MultiplyBlending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MultiplyOperation\", function() { return MultiplyOperation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NearestFilter\", function() { return NearestFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NearestMipMapLinearFilter\", function() { return NearestMipMapLinearFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NearestMipMapNearestFilter\", function() { return NearestMipMapNearestFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NearestMipmapLinearFilter\", function() { return NearestMipmapLinearFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NearestMipmapNearestFilter\", function() { return NearestMipmapNearestFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NeverDepth\", function() { return NeverDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NeverStencilFunc\", function() { return NeverStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NoBlending\", function() { return NoBlending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NoColors\", function() { return NoColors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NoToneMapping\", function() { return NoToneMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NormalAnimationBlendMode\", function() { return NormalAnimationBlendMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NormalBlending\", function() { return NormalBlending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NotEqualDepth\", function() { return NotEqualDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NotEqualStencilFunc\", function() { return NotEqualStencilFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NumberKeyframeTrack\", function() { return NumberKeyframeTrack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Object3D\", function() { return Object3D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObjectLoader\", function() { return ObjectLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObjectSpaceNormalMap\", function() { return ObjectSpaceNormalMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OctahedronBufferGeometry\", function() { return OctahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OctahedronGeometry\", function() { return OctahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OneFactor\", function() { return OneFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OneMinusDstAlphaFactor\", function() { return OneMinusDstAlphaFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OneMinusDstColorFactor\", function() { return OneMinusDstColorFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OneMinusSrcAlphaFactor\", function() { return OneMinusSrcAlphaFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OneMinusSrcColorFactor\", function() { return OneMinusSrcColorFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OrthographicCamera\", function() { return OrthographicCamera; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PCFShadowMap\", function() { return PCFShadowMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PCFSoftShadowMap\", function() { return PCFSoftShadowMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PMREMGenerator\", function() { return PMREMGenerator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ParametricGeometry\", function() { return ParametricGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Particle\", function() { return Particle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ParticleBasicMaterial\", function() { return ParticleBasicMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ParticleSystem\", function() { return ParticleSystem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ParticleSystemMaterial\", function() { return ParticleSystemMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Path\", function() { return Path; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PerspectiveCamera\", function() { return PerspectiveCamera; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Plane\", function() { return Plane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PlaneBufferGeometry\", function() { return PlaneGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PlaneGeometry\", function() { return PlaneGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PlaneHelper\", function() { return PlaneHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PointCloud\", function() { return PointCloud; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PointCloudMaterial\", function() { return PointCloudMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PointLight\", function() { return PointLight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PointLightHelper\", function() { return PointLightHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Points\", function() { return Points; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PointsMaterial\", function() { return PointsMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PolarGridHelper\", function() { return PolarGridHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PolyhedronBufferGeometry\", function() { return PolyhedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PolyhedronGeometry\", function() { return PolyhedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PositionalAudio\", function() { return PositionalAudio; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PropertyBinding\", function() { return PropertyBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PropertyMixer\", function() { return PropertyMixer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"QuadraticBezierCurve\", function() { return QuadraticBezierCurve; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"QuadraticBezierCurve3\", function() { return QuadraticBezierCurve3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Quaternion\", function() { return Quaternion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"QuaternionKeyframeTrack\", function() { return QuaternionKeyframeTrack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"QuaternionLinearInterpolant\", function() { return QuaternionLinearInterpolant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"REVISION\", function() { return REVISION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBADepthPacking\", function() { return RGBADepthPacking; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBAFormat\", function() { return RGBAFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBAIntegerFormat\", function() { return RGBAIntegerFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_10x10_Format\", function() { return RGBA_ASTC_10x10_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_10x5_Format\", function() { return RGBA_ASTC_10x5_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_10x6_Format\", function() { return RGBA_ASTC_10x6_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_10x8_Format\", function() { return RGBA_ASTC_10x8_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_12x10_Format\", function() { return RGBA_ASTC_12x10_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_12x12_Format\", function() { return RGBA_ASTC_12x12_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_4x4_Format\", function() { return RGBA_ASTC_4x4_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_5x4_Format\", function() { return RGBA_ASTC_5x4_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_5x5_Format\", function() { return RGBA_ASTC_5x5_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_6x5_Format\", function() { return RGBA_ASTC_6x5_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_6x6_Format\", function() { return RGBA_ASTC_6x6_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_8x5_Format\", function() { return RGBA_ASTC_8x5_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_8x6_Format\", function() { return RGBA_ASTC_8x6_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ASTC_8x8_Format\", function() { return RGBA_ASTC_8x8_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_BPTC_Format\", function() { return RGBA_BPTC_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_ETC2_EAC_Format\", function() { return RGBA_ETC2_EAC_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_PVRTC_2BPPV1_Format\", function() { return RGBA_PVRTC_2BPPV1_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_PVRTC_4BPPV1_Format\", function() { return RGBA_PVRTC_4BPPV1_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_S3TC_DXT1_Format\", function() { return RGBA_S3TC_DXT1_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_S3TC_DXT3_Format\", function() { return RGBA_S3TC_DXT3_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBA_S3TC_DXT5_Format\", function() { return RGBA_S3TC_DXT5_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGBFormat\", function() { return RGBFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGB_ETC1_Format\", function() { return RGB_ETC1_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGB_ETC2_Format\", function() { return RGB_ETC2_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGB_PVRTC_2BPPV1_Format\", function() { return RGB_PVRTC_2BPPV1_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGB_PVRTC_4BPPV1_Format\", function() { return RGB_PVRTC_4BPPV1_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGB_S3TC_DXT1_Format\", function() { return RGB_S3TC_DXT1_Format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGFormat\", function() { return RGFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RGIntegerFormat\", function() { return RGIntegerFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RawShaderMaterial\", function() { return RawShaderMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Ray\", function() { return Ray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Raycaster\", function() { return Raycaster; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RectAreaLight\", function() { return RectAreaLight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RedFormat\", function() { return RedFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RedIntegerFormat\", function() { return RedIntegerFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReinhardToneMapping\", function() { return ReinhardToneMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RepeatWrapping\", function() { return RepeatWrapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReplaceStencilOp\", function() { return ReplaceStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReverseSubtractEquation\", function() { return ReverseSubtractEquation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RingBufferGeometry\", function() { return RingGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RingGeometry\", function() { return RingGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Scene\", function() { return Scene; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SceneUtils\", function() { return SceneUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShaderChunk\", function() { return ShaderChunk; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShaderLib\", function() { return ShaderLib; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShaderMaterial\", function() { return ShaderMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShadowMaterial\", function() { return ShadowMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return Shape; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShapeBufferGeometry\", function() { return ShapeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShapeGeometry\", function() { return ShapeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShapePath\", function() { return ShapePath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShapeUtils\", function() { return ShapeUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShortType\", function() { return ShortType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Skeleton\", function() { return Skeleton; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SkeletonHelper\", function() { return SkeletonHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SkinnedMesh\", function() { return SkinnedMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SmoothShading\", function() { return SmoothShading; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Sphere\", function() { return Sphere; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SphereBufferGeometry\", function() { return SphereGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SphereGeometry\", function() { return SphereGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Spherical\", function() { return Spherical; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SphericalHarmonics3\", function() { return SphericalHarmonics3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SplineCurve\", function() { return SplineCurve; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SpotLight\", function() { return SpotLight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SpotLightHelper\", function() { return SpotLightHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Sprite\", function() { return Sprite; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SpriteMaterial\", function() { return SpriteMaterial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SrcAlphaFactor\", function() { return SrcAlphaFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SrcAlphaSaturateFactor\", function() { return SrcAlphaSaturateFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SrcColorFactor\", function() { return SrcColorFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StaticCopyUsage\", function() { return StaticCopyUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StaticDrawUsage\", function() { return StaticDrawUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StaticReadUsage\", function() { return StaticReadUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StereoCamera\", function() { return StereoCamera; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StreamCopyUsage\", function() { return StreamCopyUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StreamDrawUsage\", function() { return StreamDrawUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StreamReadUsage\", function() { return StreamReadUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StringKeyframeTrack\", function() { return StringKeyframeTrack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SubtractEquation\", function() { return SubtractEquation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SubtractiveBlending\", function() { return SubtractiveBlending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TOUCH\", function() { return TOUCH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TangentSpaceNormalMap\", function() { return TangentSpaceNormalMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TetrahedronBufferGeometry\", function() { return TetrahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TetrahedronGeometry\", function() { return TetrahedronGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TextGeometry\", function() { return TextGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Texture\", function() { return Texture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TextureLoader\", function() { return TextureLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TorusBufferGeometry\", function() { return TorusGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TorusGeometry\", function() { return TorusGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TorusKnotBufferGeometry\", function() { return TorusKnotGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TorusKnotGeometry\", function() { return TorusKnotGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Triangle\", function() { return Triangle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TriangleFanDrawMode\", function() { return TriangleFanDrawMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TriangleStripDrawMode\", function() { return TriangleStripDrawMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TrianglesDrawMode\", function() { return TrianglesDrawMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TubeBufferGeometry\", function() { return TubeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TubeGeometry\", function() { return TubeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UVMapping\", function() { return UVMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint16Attribute\", function() { return Uint16Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint16BufferAttribute\", function() { return Uint16BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint32Attribute\", function() { return Uint32Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint32BufferAttribute\", function() { return Uint32BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint8Attribute\", function() { return Uint8Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint8BufferAttribute\", function() { return Uint8BufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint8ClampedAttribute\", function() { return Uint8ClampedAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uint8ClampedBufferAttribute\", function() { return Uint8ClampedBufferAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Uniform\", function() { return Uniform; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UniformsLib\", function() { return UniformsLib; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UniformsUtils\", function() { return UniformsUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UnsignedByteType\", function() { return UnsignedByteType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UnsignedInt248Type\", function() { return UnsignedInt248Type; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UnsignedIntType\", function() { return UnsignedIntType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UnsignedShort4444Type\", function() { return UnsignedShort4444Type; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UnsignedShort5551Type\", function() { return UnsignedShort5551Type; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UnsignedShortType\", function() { return UnsignedShortType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VSMShadowMap\", function() { return VSMShadowMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Vector2\", function() { return Vector2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Vector3\", function() { return Vector3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Vector4\", function() { return Vector4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VectorKeyframeTrack\", function() { return VectorKeyframeTrack; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Vertex\", function() { return Vertex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VertexColors\", function() { return VertexColors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VideoTexture\", function() { return VideoTexture; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGL1Renderer\", function() { return WebGL1Renderer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLCubeRenderTarget\", function() { return WebGLCubeRenderTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLMultipleRenderTargets\", function() { return WebGLMultipleRenderTargets; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLMultisampleRenderTarget\", function() { return WebGLMultisampleRenderTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLRenderTarget\", function() { return WebGLRenderTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLRenderTargetCube\", function() { return WebGLRenderTargetCube; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLRenderer\", function() { return WebGLRenderer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLUtils\", function() { return WebGLUtils; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WireframeGeometry\", function() { return WireframeGeometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WireframeHelper\", function() { return WireframeHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WrapAroundEnding\", function() { return WrapAroundEnding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"XHRLoader\", function() { return XHRLoader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ZeroCurvatureEnding\", function() { return ZeroCurvatureEnding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ZeroFactor\", function() { return ZeroFactor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ZeroSlopeEnding\", function() { return ZeroSlopeEnding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ZeroStencilOp\", function() { return ZeroStencilOp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_SRGBAFormat\", function() { return _SRGBAFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sRGBEncoding\", function() { return sRGBEncoding; });\n/**\n * @license\n * Copyright 2010-2022 Three.js Authors\n * SPDX-License-Identifier: MIT\n */\nconst REVISION = '137';\nconst MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };\nconst TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst FlatShading = 1;\nconst SmoothShading = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\n\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst CubeUVRefractionMapping = 307;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022;\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBAIntegerFormat = 1033;\n\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1;\n\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\n\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\n\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\n\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\n\nconst _SRGBAFormat = 1035; // fallback for WebGL 1\n\n/**\n * https://github.com/mrdoob/eventdispatcher.js/\n */\n\nclass EventDispatcher {\n\n\taddEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) this._listeners = {};\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners[ type ] === undefined ) {\n\n\t\t\tlisteners[ type ] = [];\n\n\t\t}\n\n\t\tif ( listeners[ type ].indexOf( listener ) === - 1 ) {\n\n\t\t\tlisteners[ type ].push( listener );\n\n\t\t}\n\n\t}\n\n\thasEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) return false;\n\n\t\tconst listeners = this._listeners;\n\n\t\treturn listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1;\n\n\t}\n\n\tremoveEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) return;\n\n\t\tconst listeners = this._listeners;\n\t\tconst listenerArray = listeners[ type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tconst index = listenerArray.indexOf( listener );\n\n\t\t\tif ( index !== - 1 ) {\n\n\t\t\t\tlistenerArray.splice( index, 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tdispatchEvent( event ) {\n\n\t\tif ( this._listeners === undefined ) return;\n\n\t\tconst listeners = this._listeners;\n\t\tconst listenerArray = listeners[ event.type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tevent.target = this;\n\n\t\t\t// Make a copy, in case listeners are removed while iterating.\n\t\t\tconst array = listenerArray.slice( 0 );\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tarray[ i ].call( this, event );\n\n\t\t\t}\n\n\t\t\tevent.target = null;\n\n\t\t}\n\n\t}\n\n}\n\nconst _lut = [];\n\nfor ( let i = 0; i < 256; i ++ ) {\n\n\t_lut[ i ] = ( i < 16 ? '0' : '' ) + ( i ).toString( 16 );\n\n}\n\nlet _seed = 1234567;\n\n\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI;\n\n// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\nfunction generateUUID() {\n\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[ d0 & 0xff ] + _lut[ d0 >> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] +\n\t\t\t_lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ];\n\n\t// .toUpperCase() here flattens concatenated strings to save heap memory space.\n\treturn uuid.toUpperCase();\n\n}\n\nfunction clamp( value, min, max ) {\n\n\treturn Math.max( min, Math.min( max, value ) );\n\n}\n\n// compute euclidian modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\nfunction euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}\n\n// Linear mapping from range to range \nfunction mapLinear( x, a1, a2, b1, b2 ) {\n\n\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n}\n\n// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\nfunction inverseLerp( x, y, value ) {\n\n\tif ( x !== y ) {\n\n\t\treturn ( value - x ) / ( y - x );\n\n\t} else {\n\n\t\treturn 0;\n\n\t}\n\n}\n\n// https://en.wikipedia.org/wiki/Linear_interpolation\nfunction lerp( x, y, t ) {\n\n\treturn ( 1 - t ) * x + t * y;\n\n}\n\n// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\nfunction damp( x, y, lambda, dt ) {\n\n\treturn lerp( x, y, 1 - Math.exp( - lambda * dt ) );\n\n}\n\n// https://www.desmos.com/calculator/vcsjnyz7x4\nfunction pingpong( x, length = 1 ) {\n\n\treturn length - Math.abs( euclideanModulo( x, length * 2 ) - length );\n\n}\n\n// http://en.wikipedia.org/wiki/Smoothstep\nfunction smoothstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * ( 3 - 2 * x );\n\n}\n\nfunction smootherstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n}\n\n// Random integer from interval\nfunction randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}\n\n// Random float from interval\nfunction randFloat( low, high ) {\n\n\treturn low + Math.random() * ( high - low );\n\n}\n\n// Random float from <-range/2, range/2> interval\nfunction randFloatSpread( range ) {\n\n\treturn range * ( 0.5 - Math.random() );\n\n}\n\n// Deterministic pseudo-random float in the interval [ 0, 1 ]\nfunction seededRandom( s ) {\n\n\tif ( s !== undefined ) _seed = s % 2147483647;\n\n\t// Park-Miller algorithm\n\n\t_seed = _seed * 16807 % 2147483647;\n\n\treturn ( _seed - 1 ) / 2147483646;\n\n}\n\nfunction degToRad( degrees ) {\n\n\treturn degrees * DEG2RAD;\n\n}\n\nfunction radToDeg( radians ) {\n\n\treturn radians * RAD2DEG;\n\n}\n\nfunction isPowerOfTwo( value ) {\n\n\treturn ( value & ( value - 1 ) ) === 0 && value !== 0;\n\n}\n\nfunction ceilPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );\n\n}\n\nfunction floorPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );\n\n}\n\nfunction setQuaternionFromProperEuler( q, a, b, c, order ) {\n\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\n\tconst c2 = cos( b / 2 );\n\tconst s2 = sin( b / 2 );\n\n\tconst c13 = cos( ( a + c ) / 2 );\n\tconst s13 = sin( ( a + c ) / 2 );\n\n\tconst c1_3 = cos( ( a - c ) / 2 );\n\tconst s1_3 = sin( ( a - c ) / 2 );\n\n\tconst c3_1 = cos( ( c - a ) / 2 );\n\tconst s3_1 = sin( ( c - a ) / 2 );\n\n\tswitch ( order ) {\n\n\t\tcase 'XYX':\n\t\t\tq.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );\n\n\t}\n\n}\n\nvar MathUtils = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler\n});\n\nclass Vector2 {\n\n\tconstructor( x = 0, y = 0 ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t}\n\n\tget width() {\n\n\t\treturn this.x;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.x = value;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.y;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.y = value;\n\n\t}\n\n\tset( x, y ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );\n\t\t\treturn this.addVectors( v, w );\n\n\t\t}\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );\n\t\t\treturn this.subVectors( v, w );\n\n\t\t}\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ];\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ];\n\n\t\treturn this;\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );\n\t\tthis.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y;\n\n\t}\n\n\tcross( v ) {\n\n\t\treturn this.x * v.y - this.y * v.x;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tangle() {\n\n\t\t// computes the angle in radians with respect to the positive x-axis\n\n\t\tconst angle = Math.atan2( - this.y, - this.x ) + Math.PI;\n\n\t\treturn angle;\n\n\t}\n\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\n\t}\n\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index, offset ) {\n\n\t\tif ( offset !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' );\n\n\t\t}\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\n\t\treturn this;\n\n\t}\n\n\trotateAround( center, angle ) {\n\n\t\tconst c = Math.cos( angle ), s = Math.sin( angle );\n\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\n\t}\n\n}\n\nVector2.prototype.isVector2 = true;\n\nclass Matrix3 {\n\n\tconstructor() {\n\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t];\n\n\t\tif ( arguments.length > 0 ) {\n\n\t\t\tconsole.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' );\n\n\t\t}\n\n\t}\n\n\tset( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31;\n\t\tte[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32;\n\t\tte[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33;\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ];\n\t\tte[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ];\n\t\tte[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrix3Column( this, 0 );\n\t\tyAxis.setFromMatrix3Column( this, 1 );\n\t\tzAxis.setFromMatrix3Column( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrix4( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 4 ], me[ 8 ],\n\t\t\tme[ 1 ], me[ 5 ], me[ 9 ],\n\t\t\tme[ 2 ], me[ 6 ], me[ 10 ]\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s;\n\t\tte[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s;\n\t\tte[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst a = te[ 0 ], b = te[ 1 ], c = te[ 2 ],\n\t\t\td = te[ 3 ], e = te[ 4 ], f = te[ 5 ],\n\t\t\tg = te[ 6 ], h = te[ 7 ], i = te[ 8 ];\n\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\n\t}\n\n\tinvert() {\n\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ],\n\t\t\tn12 = te[ 3 ], n22 = te[ 4 ], n32 = te[ 5 ],\n\t\t\tn13 = te[ 6 ], n23 = te[ 7 ], n33 = te[ 8 ],\n\n\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\tt13 = n23 * n12 - n22 * n13,\n\n\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv;\n\t\tte[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv;\n\n\t\tte[ 3 ] = t12 * detInv;\n\t\tte[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv;\n\t\tte[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv;\n\n\t\tte[ 6 ] = t13 * detInv;\n\t\tte[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv;\n\t\tte[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\ttranspose() {\n\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\n\t\ttmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp;\n\t\ttmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp;\n\t\ttmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\tgetNormalMatrix( matrix4 ) {\n\n\t\treturn this.setFromMatrix4( matrix4 ).invert().transpose();\n\n\t}\n\n\ttransposeIntoArray( r ) {\n\n\t\tconst m = this.elements;\n\n\t\tr[ 0 ] = m[ 0 ];\n\t\tr[ 1 ] = m[ 3 ];\n\t\tr[ 2 ] = m[ 6 ];\n\t\tr[ 3 ] = m[ 1 ];\n\t\tr[ 4 ] = m[ 4 ];\n\t\tr[ 5 ] = m[ 7 ];\n\t\tr[ 6 ] = m[ 2 ];\n\t\tr[ 7 ] = m[ 5 ];\n\t\tr[ 8 ] = m[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetUvTransform( tx, ty, sx, sy, rotation, cx, cy ) {\n\n\t\tconst c = Math.cos( rotation );\n\t\tconst s = Math.sin( rotation );\n\n\t\tthis.set(\n\t\t\tsx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx,\n\t\t\t- sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty,\n\t\t\t0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tscale( sx, sy ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx;\n\t\tte[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy;\n\n\t\treturn this;\n\n\t}\n\n\trotate( theta ) {\n\n\t\tconst c = Math.cos( theta );\n\t\tconst s = Math.sin( theta );\n\n\t\tconst te = this.elements;\n\n\t\tconst a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ];\n\t\tconst a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ];\n\n\t\tte[ 0 ] = c * a11 + s * a21;\n\t\tte[ 3 ] = c * a12 + s * a22;\n\t\tte[ 6 ] = c * a13 + s * a23;\n\n\t\tte[ 1 ] = - s * a11 + c * a21;\n\t\tte[ 4 ] = - s * a12 + c * a22;\n\t\tte[ 7 ] = - s * a13 + c * a23;\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( tx, ty ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ];\n\t\tte[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\n\t\treturn array;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().fromArray( this.elements );\n\n\t}\n\n}\n\nMatrix3.prototype.isMatrix3 = true;\n\nfunction arrayNeedsUint32( array ) {\n\n\t// assumes larger values usually on last\n\n\tfor ( let i = array.length - 1; i >= 0; -- i ) {\n\n\t\tif ( array[ i ] > 65535 ) return true;\n\n\t}\n\n\treturn false;\n\n}\n\nconst TYPED_ARRAYS = {\n\tInt8Array: Int8Array,\n\tUint8Array: Uint8Array,\n\tUint8ClampedArray: Uint8ClampedArray,\n\tInt16Array: Int16Array,\n\tUint16Array: Uint16Array,\n\tInt32Array: Int32Array,\n\tUint32Array: Uint32Array,\n\tFloat32Array: Float32Array,\n\tFloat64Array: Float64Array\n};\n\nfunction getTypedArray( type, buffer ) {\n\n\treturn new TYPED_ARRAYS[ type ]( buffer );\n\n}\n\nfunction createElementNS( name ) {\n\n\treturn document.createElementNS( 'http://www.w3.org/1999/xhtml', name );\n\n}\n\nconst _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };\n\nconst _hslA = { h: 0, s: 0, l: 0 };\nconst _hslB = { h: 0, s: 0, l: 0 };\n\nfunction hue2rgb( p, q, t ) {\n\n\tif ( t < 0 ) t += 1;\n\tif ( t > 1 ) t -= 1;\n\tif ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;\n\tif ( t < 1 / 2 ) return q;\n\tif ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );\n\treturn p;\n\n}\n\nfunction SRGBToLinear( c ) {\n\n\treturn ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 );\n\n}\n\nfunction LinearToSRGB( c ) {\n\n\treturn ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055;\n\n}\n\nclass Color {\n\n\tconstructor( r, g, b ) {\n\n\t\tif ( g === undefined && b === undefined ) {\n\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set( r );\n\n\t\t}\n\n\t\treturn this.setRGB( r, g, b );\n\n\t}\n\n\tset( value ) {\n\n\t\tif ( value && value.isColor ) {\n\n\t\t\tthis.copy( value );\n\n\t\t} else if ( typeof value === 'number' ) {\n\n\t\t\tthis.setHex( value );\n\n\t\t} else if ( typeof value === 'string' ) {\n\n\t\t\tthis.setStyle( value );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetHex( hex ) {\n\n\t\thex = Math.floor( hex );\n\n\t\tthis.r = ( hex >> 16 & 255 ) / 255;\n\t\tthis.g = ( hex >> 8 & 255 ) / 255;\n\t\tthis.b = ( hex & 255 ) / 255;\n\n\t\treturn this;\n\n\t}\n\n\tsetRGB( r, g, b ) {\n\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\n\t\treturn this;\n\n\t}\n\n\tsetHSL( h, s, l ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo( h, 1 );\n\t\ts = clamp( s, 0, 1 );\n\t\tl = clamp( l, 0, 1 );\n\n\t\tif ( s === 0 ) {\n\n\t\t\tthis.r = this.g = this.b = l;\n\n\t\t} else {\n\n\t\t\tconst p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );\n\t\t\tconst q = ( 2 * l ) - p;\n\n\t\t\tthis.r = hue2rgb( q, p, h + 1 / 3 );\n\t\t\tthis.g = hue2rgb( q, p, h );\n\t\t\tthis.b = hue2rgb( q, p, h - 1 / 3 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetStyle( style ) {\n\n\t\tfunction handleAlpha( string ) {\n\n\t\t\tif ( string === undefined ) return;\n\n\t\t\tif ( parseFloat( string ) < 1 ) {\n\n\t\t\t\tconsole.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tlet m;\n\n\t\tif ( m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec( style ) ) {\n\n\t\t\t// rgb / hsl\n\n\t\t\tlet color;\n\t\t\tconst name = m[ 1 ];\n\t\t\tconst components = m[ 2 ];\n\n\t\t\tswitch ( name ) {\n\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\tthis.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255;\n\t\t\t\t\t\tthis.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255;\n\t\t\t\t\t\tthis.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255;\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\tthis.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100;\n\t\t\t\t\t\tthis.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100;\n\t\t\t\t\t\tthis.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100;\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\tconst h = parseFloat( color[ 1 ] ) / 360;\n\t\t\t\t\t\tconst s = parseInt( color[ 2 ], 10 ) / 100;\n\t\t\t\t\t\tconst l = parseInt( color[ 3 ], 10 ) / 100;\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setHSL( h, s, l );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t} else if ( m = /^\\#([A-Fa-f\\d]+)$/.exec( style ) ) {\n\n\t\t\t// hex color\n\n\t\t\tconst hex = m[ 1 ];\n\t\t\tconst size = hex.length;\n\n\t\t\tif ( size === 3 ) {\n\n\t\t\t\t// #ff0\n\t\t\t\tthis.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255;\n\t\t\t\tthis.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255;\n\t\t\t\tthis.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255;\n\n\t\t\t\treturn this;\n\n\t\t\t} else if ( size === 6 ) {\n\n\t\t\t\t// #ff0000\n\t\t\t\tthis.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255;\n\t\t\t\tthis.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255;\n\t\t\t\tthis.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255;\n\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( style && style.length > 0 ) {\n\n\t\t\treturn this.setColorName( style );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetColorName( style ) {\n\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[ style.toLowerCase() ];\n\n\t\tif ( hex !== undefined ) {\n\n\t\t\t// red\n\t\t\tthis.setHex( hex );\n\n\t\t} else {\n\n\t\t\t// unknown color\n\t\t\tconsole.warn( 'THREE.Color: Unknown color ' + style );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.r, this.g, this.b );\n\n\t}\n\n\tcopy( color ) {\n\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\n\t\treturn this;\n\n\t}\n\n\tcopySRGBToLinear( color ) {\n\n\t\tthis.r = SRGBToLinear( color.r );\n\t\tthis.g = SRGBToLinear( color.g );\n\t\tthis.b = SRGBToLinear( color.b );\n\n\t\treturn this;\n\n\t}\n\n\tcopyLinearToSRGB( color ) {\n\n\t\tthis.r = LinearToSRGB( color.r );\n\t\tthis.g = LinearToSRGB( color.g );\n\t\tthis.b = LinearToSRGB( color.b );\n\n\t\treturn this;\n\n\t}\n\n\tconvertSRGBToLinear() {\n\n\t\tthis.copySRGBToLinear( this );\n\n\t\treturn this;\n\n\t}\n\n\tconvertLinearToSRGB() {\n\n\t\tthis.copyLinearToSRGB( this );\n\n\t\treturn this;\n\n\t}\n\n\tgetHex() {\n\n\t\treturn ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0;\n\n\t}\n\n\tgetHexString() {\n\n\t\treturn ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 );\n\n\t}\n\n\tgetHSL( target ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\n\t\tconst r = this.r, g = this.g, b = this.b;\n\n\t\tconst max = Math.max( r, g, b );\n\t\tconst min = Math.min( r, g, b );\n\n\t\tlet hue, saturation;\n\t\tconst lightness = ( min + max ) / 2.0;\n\n\t\tif ( min === max ) {\n\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\n\t\t} else {\n\n\t\t\tconst delta = max - min;\n\n\t\t\tsaturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );\n\n\t\t\tswitch ( max ) {\n\n\t\t\t\tcase r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break;\n\t\t\t\tcase g: hue = ( b - r ) / delta + 2; break;\n\t\t\t\tcase b: hue = ( r - g ) / delta + 4; break;\n\n\t\t\t}\n\n\t\t\thue /= 6;\n\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\n\t\treturn target;\n\n\t}\n\n\tgetStyle() {\n\n\t\treturn 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';\n\n\t}\n\n\toffsetHSL( h, s, l ) {\n\n\t\tthis.getHSL( _hslA );\n\n\t\t_hslA.h += h; _hslA.s += s; _hslA.l += l;\n\n\t\tthis.setHSL( _hslA.h, _hslA.s, _hslA.l );\n\n\t\treturn this;\n\n\t}\n\n\tadd( color ) {\n\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\n\t\treturn this;\n\n\t}\n\n\taddColors( color1, color2 ) {\n\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( color ) {\n\n\t\tthis.r = Math.max( 0, this.r - color.r );\n\t\tthis.g = Math.max( 0, this.g - color.g );\n\t\tthis.b = Math.max( 0, this.b - color.b );\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( color ) {\n\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\n\t\treturn this;\n\n\t}\n\n\tlerp( color, alpha ) {\n\n\t\tthis.r += ( color.r - this.r ) * alpha;\n\t\tthis.g += ( color.g - this.g ) * alpha;\n\t\tthis.b += ( color.b - this.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpColors( color1, color2, alpha ) {\n\n\t\tthis.r = color1.r + ( color2.r - color1.r ) * alpha;\n\t\tthis.g = color1.g + ( color2.g - color1.g ) * alpha;\n\t\tthis.b = color1.b + ( color2.b - color1.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpHSL( color, alpha ) {\n\n\t\tthis.getHSL( _hslA );\n\t\tcolor.getHSL( _hslB );\n\n\t\tconst h = lerp( _hslA.h, _hslB.h, alpha );\n\t\tconst s = lerp( _hslA.s, _hslB.s, alpha );\n\t\tconst l = lerp( _hslA.l, _hslB.l, alpha );\n\n\t\tthis.setHSL( h, s, l );\n\n\t\treturn this;\n\n\t}\n\n\tequals( c ) {\n\n\t\treturn ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.r = array[ offset ];\n\t\tthis.g = array[ offset + 1 ];\n\t\tthis.b = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.r;\n\t\tarray[ offset + 1 ] = this.g;\n\t\tarray[ offset + 2 ] = this.b;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.r = attribute.getX( index );\n\t\tthis.g = attribute.getY( index );\n\t\tthis.b = attribute.getZ( index );\n\n\t\tif ( attribute.normalized === true ) {\n\n\t\t\t// assuming Uint8Array\n\n\t\t\tthis.r /= 255;\n\t\t\tthis.g /= 255;\n\t\t\tthis.b /= 255;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.getHex();\n\n\t}\n\n}\n\nColor.NAMES = _colorKeywords;\n\nColor.prototype.isColor = true;\nColor.prototype.r = 1;\nColor.prototype.g = 1;\nColor.prototype.b = 1;\n\nlet _canvas;\n\nclass ImageUtils {\n\n\tstatic getDataURL( image ) {\n\n\t\tif ( /^data:/i.test( image.src ) ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tif ( typeof HTMLCanvasElement == 'undefined' ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tlet canvas;\n\n\t\tif ( image instanceof HTMLCanvasElement ) {\n\n\t\t\tcanvas = image;\n\n\t\t} else {\n\n\t\t\tif ( _canvas === undefined ) _canvas = createElementNS( 'canvas' );\n\n\t\t\t_canvas.width = image.width;\n\t\t\t_canvas.height = image.height;\n\n\t\t\tconst context = _canvas.getContext( '2d' );\n\n\t\t\tif ( image instanceof ImageData ) {\n\n\t\t\t\tcontext.putImageData( image, 0, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\t}\n\n\t\t\tcanvas = _canvas;\n\n\t\t}\n\n\t\tif ( canvas.width > 2048 || canvas.height > 2048 ) {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image );\n\n\t\t\treturn canvas.toDataURL( 'image/jpeg', 0.6 );\n\n\t\t} else {\n\n\t\t\treturn canvas.toDataURL( 'image/png' );\n\n\t\t}\n\n\t}\n\n\tstatic sRGBToLinear( image ) {\n\n\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t\tconst canvas = createElementNS( 'canvas' );\n\n\t\t\tcanvas.width = image.width;\n\t\t\tcanvas.height = image.height;\n\n\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\tconst imageData = context.getImageData( 0, 0, image.width, image.height );\n\t\t\tconst data = imageData.data;\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] / 255 ) * 255;\n\n\t\t\t}\n\n\t\t\tcontext.putImageData( imageData, 0, 0 );\n\n\t\t\treturn canvas;\n\n\t\t} else if ( image.data ) {\n\n\t\t\tconst data = image.data.slice( 0 );\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tif ( data instanceof Uint8Array || data instanceof Uint8ClampedArray ) {\n\n\t\t\t\t\tdata[ i ] = Math.floor( SRGBToLinear( data[ i ] / 255 ) * 255 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// assuming float\n\n\t\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdata: data,\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );\n\t\t\treturn image;\n\n\t\t}\n\n\t}\n\n}\n\nlet textureId = 0;\n\nclass Texture extends EventDispatcher {\n\n\tconstructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {\n\n\t\tsuper();\n\n\t\tObject.defineProperty( this, 'id', { value: textureId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\n\t\tthis.image = image;\n\t\tthis.mipmaps = [];\n\n\t\tthis.mapping = mapping;\n\n\t\tthis.wrapS = wrapS;\n\t\tthis.wrapT = wrapT;\n\n\t\tthis.magFilter = magFilter;\n\t\tthis.minFilter = minFilter;\n\n\t\tthis.anisotropy = anisotropy;\n\n\t\tthis.format = format;\n\t\tthis.internalFormat = null;\n\t\tthis.type = type;\n\n\t\tthis.offset = new Vector2( 0, 0 );\n\t\tthis.repeat = new Vector2( 1, 1 );\n\t\tthis.center = new Vector2( 0, 0 );\n\t\tthis.rotation = 0;\n\n\t\tthis.matrixAutoUpdate = true;\n\t\tthis.matrix = new Matrix3();\n\n\t\tthis.generateMipmaps = true;\n\t\tthis.premultiplyAlpha = false;\n\t\tthis.flipY = true;\n\t\tthis.unpackAlignment = 4;\t// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\n\t\t// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.\n\t\t//\n\t\t// Also changing the encoding after already used by a Material will not automatically make the Material\n\t\t// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.\n\t\tthis.encoding = encoding;\n\n\t\tthis.userData = {};\n\n\t\tthis.version = 0;\n\t\tthis.onUpdate = null;\n\n\t\tthis.isRenderTargetTexture = false; // indicates whether a texture belongs to a render target or not\n\t\tthis.needsPMREMUpdate = false; // indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target textures)\n\n\t}\n\n\tupdateMatrix() {\n\n\t\tthis.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.image = source.image;\n\t\tthis.mipmaps = source.mipmaps.slice( 0 );\n\n\t\tthis.mapping = source.mapping;\n\n\t\tthis.wrapS = source.wrapS;\n\t\tthis.wrapT = source.wrapT;\n\n\t\tthis.magFilter = source.magFilter;\n\t\tthis.minFilter = source.minFilter;\n\n\t\tthis.anisotropy = source.anisotropy;\n\n\t\tthis.format = source.format;\n\t\tthis.internalFormat = source.internalFormat;\n\t\tthis.type = source.type;\n\n\t\tthis.offset.copy( source.offset );\n\t\tthis.repeat.copy( source.repeat );\n\t\tthis.center.copy( source.center );\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\tthis.matrix.copy( source.matrix );\n\n\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\tthis.flipY = source.flipY;\n\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\tthis.encoding = source.encoding;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.textures[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.5,\n\t\t\t\ttype: 'Texture',\n\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t},\n\n\t\t\tuuid: this.uuid,\n\t\t\tname: this.name,\n\n\t\t\tmapping: this.mapping,\n\n\t\t\trepeat: [ this.repeat.x, this.repeat.y ],\n\t\t\toffset: [ this.offset.x, this.offset.y ],\n\t\t\tcenter: [ this.center.x, this.center.y ],\n\t\t\trotation: this.rotation,\n\n\t\t\twrap: [ this.wrapS, this.wrapT ],\n\n\t\t\tformat: this.format,\n\t\t\ttype: this.type,\n\t\t\tencoding: this.encoding,\n\n\t\t\tminFilter: this.minFilter,\n\t\t\tmagFilter: this.magFilter,\n\t\t\tanisotropy: this.anisotropy,\n\n\t\t\tflipY: this.flipY,\n\n\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\tunpackAlignment: this.unpackAlignment\n\n\t\t};\n\n\t\tif ( this.image !== undefined ) {\n\n\t\t\t// TODO: Move to THREE.Image\n\n\t\t\tconst image = this.image;\n\n\t\t\tif ( image.uuid === undefined ) {\n\n\t\t\t\timage.uuid = generateUUID(); // UGH\n\n\t\t\t}\n\n\t\t\tif ( ! isRootObject && meta.images[ image.uuid ] === undefined ) {\n\n\t\t\t\tlet url;\n\n\t\t\t\tif ( Array.isArray( image ) ) {\n\n\t\t\t\t\t// process array of images e.g. CubeTexture\n\n\t\t\t\t\turl = [];\n\n\t\t\t\t\tfor ( let i = 0, l = image.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t// check cube texture with data textures\n\n\t\t\t\t\t\tif ( image[ i ].isDataTexture ) {\n\n\t\t\t\t\t\t\turl.push( serializeImage( image[ i ].image ) );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\turl.push( serializeImage( image[ i ] ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// process single image\n\n\t\t\t\t\turl = serializeImage( image );\n\n\t\t\t\t}\n\n\t\t\t\tmeta.images[ image.uuid ] = {\n\t\t\t\t\tuuid: image.uuid,\n\t\t\t\t\turl: url\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\toutput.image = image.uuid;\n\n\t\t}\n\n\t\tif ( JSON.stringify( this.userData ) !== '{}' ) output.userData = this.userData;\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.textures[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\ttransformUv( uv ) {\n\n\t\tif ( this.mapping !== UVMapping ) return uv;\n\n\t\tuv.applyMatrix3( this.matrix );\n\n\t\tif ( uv.x < 0 || uv.x > 1 ) {\n\n\t\t\tswitch ( this.wrapS ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.x = uv.x < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.x = Math.ceil( uv.x ) - uv.x;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( uv.y < 0 || uv.y > 1 ) {\n\n\t\t\tswitch ( this.wrapT ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.y = uv.y < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.y = Math.ceil( uv.y ) - uv.y;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.flipY ) {\n\n\t\t\tuv.y = 1 - uv.y;\n\n\t\t}\n\n\t\treturn uv;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n}\n\nTexture.DEFAULT_IMAGE = undefined;\nTexture.DEFAULT_MAPPING = UVMapping;\n\nTexture.prototype.isTexture = true;\n\nfunction serializeImage( image ) {\n\n\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t// default images\n\n\t\treturn ImageUtils.getDataURL( image );\n\n\t} else {\n\n\t\tif ( image.data ) {\n\n\t\t\t// images of DataTexture\n\n\t\t\treturn {\n\t\t\t\tdata: Array.prototype.slice.call( image.data ),\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height,\n\t\t\t\ttype: image.data.constructor.name\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Texture: Unable to serialize Texture.' );\n\t\t\treturn {};\n\n\t\t}\n\n\t}\n\n}\n\nclass Vector4 {\n\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t}\n\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );\n\t\t\treturn this.addVectors( v, w );\n\n\t\t}\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );\n\t\t\treturn this.subVectors( v, w );\n\n\t\t}\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s < 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\t\tthis.w = Math.max( min.w, Math.min( max.w, this.w ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\t\tthis.z = Math.max( minVal, Math.min( maxVal, this.z ) );\n\t\tthis.w = Math.max( minVal, Math.min( maxVal, this.w ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );\n\t\tthis.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );\n\t\tthis.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );\n\t\tthis.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index, offset ) {\n\n\t\tif ( offset !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' );\n\n\t\t}\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\nVector4.prototype.isVector4 = true;\n\n/*\n In options, we can specify:\n * Texture parameters for an auto-generated target texture\n * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n*/\nclass WebGLRenderTarget extends EventDispatcher {\n\n\tconstructor( width, height, options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tthis.depth = 1;\n\n\t\tthis.scissor = new Vector4( 0, 0, width, height );\n\t\tthis.scissorTest = false;\n\n\t\tthis.viewport = new Vector4( 0, 0, width, height );\n\n\t\tthis.texture = new Texture( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t\tthis.texture.image = { width: width, height: height, depth: 1 };\n\n\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\tthis.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null;\n\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\n\t\tthis.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;\n\t\tthis.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false;\n\t\tthis.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;\n\n\t}\n\n\tsetTexture( texture ) {\n\n\t\ttexture.image = {\n\t\t\twidth: this.width,\n\t\t\theight: this.height,\n\t\t\tdepth: this.depth\n\t\t};\n\n\t\tthis.texture = texture;\n\n\t}\n\n\tsetSize( width, height, depth = 1 ) {\n\n\t\tif ( this.width !== width || this.height !== height || this.depth !== depth ) {\n\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = depth;\n\n\t\t\tthis.texture.image.width = width;\n\t\t\tthis.texture.image.height = height;\n\t\t\tthis.texture.image.depth = depth;\n\n\t\t\tthis.dispose();\n\n\t\t}\n\n\t\tthis.viewport.set( 0, 0, width, height );\n\t\tthis.scissor.set( 0, 0, width, height );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\t\tthis.depth = source.depth;\n\n\t\tthis.viewport.copy( source.viewport );\n\n\t\tthis.texture = source.texture.clone();\n\n\t\t// ensure image object is not shared, see #20328\n\n\t\tthis.texture.image = Object.assign( {}, source.texture.image );\n\n\t\tthis.depthBuffer = source.depthBuffer;\n\t\tthis.stencilBuffer = source.stencilBuffer;\n\t\tthis.depthTexture = source.depthTexture;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nWebGLRenderTarget.prototype.isWebGLRenderTarget = true;\n\nclass WebGLMultipleRenderTargets extends WebGLRenderTarget {\n\n\tconstructor( width, height, count ) {\n\n\t\tsuper( width, height );\n\n\t\tconst texture = this.texture;\n\n\t\tthis.texture = [];\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.texture[ i ] = texture.clone();\n\n\t\t}\n\n\t}\n\n\tsetSize( width, height, depth = 1 ) {\n\n\t\tif ( this.width !== width || this.height !== height || this.depth !== depth ) {\n\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = depth;\n\n\t\t\tfor ( let i = 0, il = this.texture.length; i < il; i ++ ) {\n\n\t\t\t\tthis.texture[ i ].image.width = width;\n\t\t\t\tthis.texture[ i ].image.height = height;\n\t\t\t\tthis.texture[ i ].image.depth = depth;\n\n\t\t\t}\n\n\t\t\tthis.dispose();\n\n\t\t}\n\n\t\tthis.viewport.set( 0, 0, width, height );\n\t\tthis.scissor.set( 0, 0, width, height );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.dispose();\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\t\tthis.depth = source.depth;\n\n\t\tthis.viewport.set( 0, 0, this.width, this.height );\n\t\tthis.scissor.set( 0, 0, this.width, this.height );\n\n\t\tthis.depthBuffer = source.depthBuffer;\n\t\tthis.stencilBuffer = source.stencilBuffer;\n\t\tthis.depthTexture = source.depthTexture;\n\n\t\tthis.texture.length = 0;\n\n\t\tfor ( let i = 0, il = source.texture.length; i < il; i ++ ) {\n\n\t\t\tthis.texture[ i ] = source.texture[ i ].clone();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nWebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true;\n\nclass WebGLMultisampleRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( width, height, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\tthis.samples = 4;\n\n\t\tthis.ignoreDepthForMultisampleCopy = options.ignoreDepth !== undefined ? options.ignoreDepth : true;\n\t\tthis.useRenderToTexture = ( options.useRenderToTexture !== undefined ) ? options.useRenderToTexture : false;\n\t\tthis.useRenderbuffer = this.useRenderToTexture === false;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy.call( this, source );\n\n\t\tthis.samples = source.samples;\n\t\tthis.useRenderToTexture = source.useRenderToTexture;\n\t\tthis.useRenderbuffer = source.useRenderbuffer;\n\n\t\treturn this;\n\n\t}\n\n}\n\nWebGLMultisampleRenderTarget.prototype.isWebGLMultisampleRenderTarget = true;\n\nclass Quaternion {\n\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t}\n\n\tstatic slerp( qa, qb, qm, t ) {\n\n\t\tconsole.warn( 'THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.' );\n\t\treturn qm.slerpQuaternions( qa, qb, t );\n\n\t}\n\n\tstatic slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {\n\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\n\t\tlet x0 = src0[ srcOffset0 + 0 ],\n\t\t\ty0 = src0[ srcOffset0 + 1 ],\n\t\t\tz0 = src0[ srcOffset0 + 2 ],\n\t\t\tw0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 + 0 ],\n\t\t\ty1 = src1[ srcOffset1 + 1 ],\n\t\t\tz1 = src1[ srcOffset1 + 2 ],\n\t\t\tw1 = src1[ srcOffset1 + 3 ];\n\n\t\tif ( t === 0 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x0;\n\t\t\tdst[ dstOffset + 1 ] = y0;\n\t\t\tdst[ dstOffset + 2 ] = z0;\n\t\t\tdst[ dstOffset + 3 ] = w0;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( t === 1 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x1;\n\t\t\tdst[ dstOffset + 1 ] = y1;\n\t\t\tdst[ dstOffset + 2 ] = z1;\n\t\t\tdst[ dstOffset + 3 ] = w1;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {\n\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\tdir = ( cos >= 0 ? 1 : - 1 ),\n\t\t\t\tsqrSin = 1 - cos * cos;\n\n\t\t\t// Skip the Slerp for tiny steps to avoid numeric problems:\n\t\t\tif ( sqrSin > Number.EPSILON ) {\n\n\t\t\t\tconst sin = Math.sqrt( sqrSin ),\n\t\t\t\t\tlen = Math.atan2( sin, cos * dir );\n\n\t\t\t\ts = Math.sin( s * len ) / sin;\n\t\t\t\tt = Math.sin( t * len ) / sin;\n\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir;\n\n\t\t\t// Normalize in case we just did a lerp:\n\t\t\tif ( s === 1 - t ) {\n\n\t\t\t\tconst f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );\n\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\n\t\t\t}\n\n\t\t}\n\n\t\tdst[ dstOffset ] = x0;\n\t\tdst[ dstOffset + 1 ] = y0;\n\t\tdst[ dstOffset + 2 ] = z0;\n\t\tdst[ dstOffset + 3 ] = w0;\n\n\t}\n\n\tstatic multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) {\n\n\t\tconst x0 = src0[ srcOffset0 ];\n\t\tconst y0 = src0[ srcOffset0 + 1 ];\n\t\tconst z0 = src0[ srcOffset0 + 2 ];\n\t\tconst w0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 ];\n\t\tconst y1 = src1[ srcOffset1 + 1 ];\n\t\tconst z1 = src1[ srcOffset1 + 2 ];\n\t\tconst w1 = src1[ srcOffset1 + 3 ];\n\n\t\tdst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\n\t\treturn dst;\n\n\t}\n\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget w() {\n\n\t\treturn this._w;\n\n\t}\n\n\tset w( value ) {\n\n\t\tthis._w = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tset( x, y, z, w ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._w );\n\n\t}\n\n\tcopy( quaternion ) {\n\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromEuler( euler, update ) {\n\n\t\tif ( ! ( euler && euler.isEuler ) ) {\n\n\t\t\tthrow new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' );\n\n\t\t}\n\n\t\tconst x = euler._x, y = euler._y, z = euler._z, order = euler._order;\n\n\t\t// http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\n\t\tconst c1 = cos( x / 2 );\n\t\tconst c2 = cos( y / 2 );\n\t\tconst c3 = cos( z / 2 );\n\n\t\tconst s1 = sin( x / 2 );\n\t\tconst s2 = sin( y / 2 );\n\t\tconst s3 = sin( z / 2 );\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tif ( update !== false ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromAxisAngle( axis, angle ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\n\t\t// assumes axis is normalized\n\n\t\tconst halfAngle = angle / 2, s = Math.sin( halfAngle );\n\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos( halfAngle );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],\n\n\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif ( trace > 0 ) {\n\n\t\t\tconst s = 0.5 / Math.sqrt( trace + 1.0 );\n\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = ( m32 - m23 ) * s;\n\t\t\tthis._y = ( m13 - m31 ) * s;\n\t\t\tthis._z = ( m21 - m12 ) * s;\n\n\t\t} else if ( m11 > m22 && m11 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );\n\n\t\t\tthis._w = ( m32 - m23 ) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = ( m12 + m21 ) / s;\n\t\t\tthis._z = ( m13 + m31 ) / s;\n\n\t\t} else if ( m22 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );\n\n\t\t\tthis._w = ( m13 - m31 ) / s;\n\t\t\tthis._x = ( m12 + m21 ) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = ( m23 + m32 ) / s;\n\n\t\t} else {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );\n\n\t\t\tthis._w = ( m21 - m12 ) / s;\n\t\t\tthis._x = ( m13 + m31 ) / s;\n\t\t\tthis._y = ( m23 + m32 ) / s;\n\t\t\tthis._z = 0.25 * s;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromUnitVectors( vFrom, vTo ) {\n\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\n\t\tlet r = vFrom.dot( vTo ) + 1;\n\n\t\tif ( r < Number.EPSILON ) {\n\n\t\t\t// vFrom and vTo point in opposite directions\n\n\t\t\tr = 0;\n\n\t\t\tif ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {\n\n\t\t\t\tthis._x = - vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = - vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\n\t\t}\n\n\t\treturn this.normalize();\n\n\t}\n\n\tangleTo( q ) {\n\n\t\treturn 2 * Math.acos( Math.abs( clamp( this.dot( q ), - 1, 1 ) ) );\n\n\t}\n\n\trotateTowards( q, step ) {\n\n\t\tconst angle = this.angleTo( q );\n\n\t\tif ( angle === 0 ) return this;\n\n\t\tconst t = Math.min( 1, step / angle );\n\n\t\tthis.slerp( q, t );\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\treturn this.set( 0, 0, 0, 1 );\n\n\t}\n\n\tinvert() {\n\n\t\t// quaternion is assumed to have unit length\n\n\t\treturn this.conjugate();\n\n\t}\n\n\tconjugate() {\n\n\t\tthis._x *= - 1;\n\t\tthis._y *= - 1;\n\t\tthis._z *= - 1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );\n\n\t}\n\n\tnormalize() {\n\n\t\tlet l = this.length();\n\n\t\tif ( l === 0 ) {\n\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\n\t\t} else {\n\n\t\t\tl = 1 / l;\n\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( q, p ) {\n\n\t\tif ( p !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' );\n\t\t\treturn this.multiplyQuaternions( q, p );\n\n\t\t}\n\n\t\treturn this.multiplyQuaternions( this, q );\n\n\t}\n\n\tpremultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( q, this );\n\n\t}\n\n\tmultiplyQuaternions( a, b ) {\n\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\n\t\tconst qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;\n\t\tconst qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;\n\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tslerp( qb, t ) {\n\n\t\tif ( t === 0 ) return this;\n\t\tif ( t === 1 ) return this.copy( qb );\n\n\t\tconst x = this._x, y = this._y, z = this._z, w = this._w;\n\n\t\t// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif ( cosHalfTheta < 0 ) {\n\n\t\t\tthis._w = - qb._w;\n\t\t\tthis._x = - qb._x;\n\t\t\tthis._y = - qb._y;\n\t\t\tthis._z = - qb._z;\n\n\t\t\tcosHalfTheta = - cosHalfTheta;\n\n\t\t} else {\n\n\t\t\tthis.copy( qb );\n\n\t\t}\n\n\t\tif ( cosHalfTheta >= 1.0 ) {\n\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif ( sqrSinHalfTheta <= Number.EPSILON ) {\n\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\n\t\t\tthis.normalize();\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt( sqrSinHalfTheta );\n\t\tconst halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );\n\t\tconst ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,\n\t\t\tratioB = Math.sin( t * halfTheta ) / sinHalfTheta;\n\n\t\tthis._w = ( w * ratioA + this._w * ratioB );\n\t\tthis._x = ( x * ratioA + this._x * ratioB );\n\t\tthis._y = ( y * ratioA + this._y * ratioB );\n\t\tthis._z = ( z * ratioA + this._z * ratioB );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tslerpQuaternions( qa, qb, t ) {\n\n\t\treturn this.copy( qa ).slerp( qb, t );\n\n\t}\n\n\trandom() {\n\n\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t// Note, this source uses w, x, y, z ordering,\n\t\t// so we swap the order below.\n\n\t\tconst u1 = Math.random();\n\t\tconst sqrt1u1 = Math.sqrt( 1 - u1 );\n\t\tconst sqrtu1 = Math.sqrt( u1 );\n\n\t\tconst u2 = 2 * Math.PI * Math.random();\n\n\t\tconst u3 = 2 * Math.PI * Math.random();\n\n\t\treturn this.set(\n\t\t\tsqrt1u1 * Math.cos( u2 ),\n\t\t\tsqrtu1 * Math.sin( u3 ),\n\t\t\tsqrtu1 * Math.cos( u3 ),\n\t\t\tsqrt1u1 * Math.sin( u2 ),\n\t\t);\n\n\t}\n\n\tequals( quaternion ) {\n\n\t\treturn ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis._x = array[ offset ];\n\t\tthis._y = array[ offset + 1 ];\n\t\tthis._z = array[ offset + 2 ];\n\t\tthis._w = array[ offset + 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._w;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis._x = attribute.getX( index );\n\t\tthis._y = attribute.getY( index );\n\t\tthis._z = attribute.getZ( index );\n\t\tthis._w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n}\n\nQuaternion.prototype.isQuaternion = true;\n\nclass Vector3 {\n\n\tconstructor( x = 0, y = 0, z = 0 ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t}\n\n\tset( x, y, z ) {\n\n\t\tif ( z === undefined ) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );\n\t\t\treturn this.addVectors( v, w );\n\n\t\t}\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );\n\t\t\treturn this.subVectors( v, w );\n\n\t\t}\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' );\n\t\t\treturn this.multiplyVectors( v, w );\n\n\t\t}\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyVectors( a, b ) {\n\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyEuler( euler ) {\n\n\t\tif ( ! ( euler && euler.isEuler ) ) {\n\n\t\t\tconsole.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );\n\n\t\t}\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromEuler( euler ) );\n\n\t}\n\n\tapplyAxisAngle( axis, angle ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromAxisAngle( axis, angle ) );\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\treturn this.applyMatrix3( m ).normalize();\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tconst w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] );\n\n\t\tthis.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w;\n\t\tthis.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w;\n\t\tthis.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w;\n\n\t\treturn this;\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst qx = q.x, qy = q.y, qz = q.z, qw = q.w;\n\n\t\t// calculate quat * vector\n\n\t\tconst ix = qw * x + qy * z - qz * y;\n\t\tconst iy = qw * y + qz * x - qx * z;\n\t\tconst iz = qw * z + qx * y - qy * x;\n\t\tconst iw = - qx * x - qy * y - qz * z;\n\n\t\t// calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * - qx + iy * - qz - iz * - qy;\n\t\tthis.y = iy * qw + iw * - qy + iz * - qx - ix * - qz;\n\t\tthis.z = iz * qw + iw * - qz + ix * - qy - iy * - qx;\n\n\t\treturn this;\n\n\t}\n\n\tproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\n\t}\n\n\tunproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;\n\n\t\treturn this.normalize();\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\t\tthis.z = Math.max( minVal, Math.min( maxVal, this.z ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );\n\t\tthis.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );\n\t\tthis.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\n\t}\n\n\t// TODO lengthSquared?\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tcross( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' );\n\t\t\treturn this.crossVectors( v, w );\n\n\t\t}\n\n\t\treturn this.crossVectors( this, v );\n\n\t}\n\n\tcrossVectors( a, b ) {\n\n\t\tconst ax = a.x, ay = a.y, az = a.z;\n\t\tconst bx = b.x, by = b.y, bz = b.z;\n\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\n\t\treturn this;\n\n\t}\n\n\tprojectOnVector( v ) {\n\n\t\tconst denominator = v.lengthSq();\n\n\t\tif ( denominator === 0 ) return this.set( 0, 0, 0 );\n\n\t\tconst scalar = v.dot( this ) / denominator;\n\n\t\treturn this.copy( v ).multiplyScalar( scalar );\n\n\t}\n\n\tprojectOnPlane( planeNormal ) {\n\n\t\t_vector$c.copy( this ).projectOnVector( planeNormal );\n\n\t\treturn this.sub( _vector$c );\n\n\t}\n\n\treflect( normal ) {\n\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\n\t\treturn this.sub( _vector$c.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );\n\n\t}\n\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, - 1, 1 ) );\n\n\t}\n\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;\n\n\t\treturn dx * dx + dy * dy + dz * dz;\n\n\t}\n\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );\n\n\t}\n\n\tsetFromSpherical( s ) {\n\n\t\treturn this.setFromSphericalCoords( s.radius, s.phi, s.theta );\n\n\t}\n\n\tsetFromSphericalCoords( radius, phi, theta ) {\n\n\t\tconst sinPhiRadius = Math.sin( phi ) * radius;\n\n\t\tthis.x = sinPhiRadius * Math.sin( theta );\n\t\tthis.y = Math.cos( phi ) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCylindrical( c ) {\n\n\t\treturn this.setFromCylindricalCoords( c.radius, c.theta, c.y );\n\n\t}\n\n\tsetFromCylindricalCoords( radius, theta, y ) {\n\n\t\tthis.x = radius * Math.sin( theta );\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixScale( m ) {\n\n\t\tconst sx = this.setFromMatrixColumn( m, 0 ).length();\n\t\tconst sy = this.setFromMatrixColumn( m, 1 ).length();\n\t\tconst sz = this.setFromMatrixColumn( m, 2 ).length();\n\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixColumn( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 4 );\n\n\t}\n\n\tsetFromMatrix3Column( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 3 );\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index, offset ) {\n\n\t\tif ( offset !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' );\n\n\t\t}\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\trandomDirection() {\n\n\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\n\t\tconst u = ( Math.random() - 0.5 ) * 2;\n\t\tconst t = Math.random() * Math.PI * 2;\n\t\tconst f = Math.sqrt( 1 - u ** 2 );\n\n\t\tthis.x = f * Math.cos( t );\n\t\tthis.y = f * Math.sin( t );\n\t\tthis.z = u;\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\n\t}\n\n}\n\nVector3.prototype.isVector3 = true;\n\nconst _vector$c = /*@__PURE__*/ new Vector3();\nconst _quaternion$4 = /*@__PURE__*/ new Quaternion();\n\nclass Box3 {\n\n\tconstructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) {\n\n\t\tthis.min = min;\n\t\tthis.max = max;\n\n\t}\n\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromArray( array ) {\n\n\t\tlet minX = + Infinity;\n\t\tlet minY = + Infinity;\n\t\tlet minZ = + Infinity;\n\n\t\tlet maxX = - Infinity;\n\t\tlet maxY = - Infinity;\n\t\tlet maxZ = - Infinity;\n\n\t\tfor ( let i = 0, l = array.length; i < l; i += 3 ) {\n\n\t\t\tconst x = array[ i ];\n\t\t\tconst y = array[ i + 1 ];\n\t\t\tconst z = array[ i + 2 ];\n\n\t\t\tif ( x < minX ) minX = x;\n\t\t\tif ( y < minY ) minY = y;\n\t\t\tif ( z < minZ ) minZ = z;\n\n\t\t\tif ( x > maxX ) maxX = x;\n\t\t\tif ( y > maxY ) maxY = y;\n\t\t\tif ( z > maxZ ) maxZ = z;\n\n\t\t}\n\n\t\tthis.min.set( minX, minY, minZ );\n\t\tthis.max.set( maxX, maxY, maxZ );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromBufferAttribute( attribute ) {\n\n\t\tlet minX = + Infinity;\n\t\tlet minY = + Infinity;\n\t\tlet minZ = + Infinity;\n\n\t\tlet maxX = - Infinity;\n\t\tlet maxY = - Infinity;\n\t\tlet maxZ = - Infinity;\n\n\t\tfor ( let i = 0, l = attribute.count; i < l; i ++ ) {\n\n\t\t\tconst x = attribute.getX( i );\n\t\t\tconst y = attribute.getY( i );\n\t\t\tconst z = attribute.getZ( i );\n\n\t\t\tif ( x < minX ) minX = x;\n\t\t\tif ( y < minY ) minY = y;\n\t\t\tif ( z < minZ ) minZ = z;\n\n\t\t\tif ( x > maxX ) maxX = x;\n\t\t\tif ( y > maxY ) maxY = y;\n\t\t\tif ( z > maxZ ) maxZ = z;\n\n\t\t}\n\n\t\tthis.min.set( minX, minY, minZ );\n\t\tthis.max.set( maxX, maxY, maxZ );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$b.copy( size ).multiplyScalar( 0.5 );\n\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromObject( object, precise = false ) {\n\n\t\tthis.makeEmpty();\n\n\t\treturn this.expandByObject( object, precise );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = this.min.z = + Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z );\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\texpandByObject( object, precise = false ) {\n\n\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t// accounting for both the object's, and children's, world transforms\n\n\t\tobject.updateWorldMatrix( false, false );\n\n\t\tconst geometry = object.geometry;\n\n\t\tif ( geometry !== undefined ) {\n\n\t\t\tif ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) {\n\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tfor ( let i = 0, l = position.count; i < l; i ++ ) {\n\n\t\t\t\t\t_vector$b.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );\n\t\t\t\t\tthis.expandByPoint( _vector$b );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\t\t\tgeometry.computeBoundingBox();\n\n\t\t\t\t}\n\n\t\t\t\t_box$3.copy( geometry.boundingBox );\n\t\t\t\t_box$3.applyMatrix4( object.matrixWorld );\n\n\t\t\t\tthis.union( _box$3 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tthis.expandByObject( children[ i ], precise );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn point.x < this.min.x || point.x > this.max.x ||\n\t\t\tpoint.y < this.min.y || point.y > this.max.y ||\n\t\t\tpoint.z < this.min.z || point.z > this.max.z ? false : true;\n\n\t}\n\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y &&\n\t\t\tthis.min.z <= box.min.z && box.max.z <= this.max.z;\n\n\t}\n\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y ),\n\t\t\t( point.z - this.min.z ) / ( this.max.z - this.min.z )\n\t\t);\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x ||\n\t\t\tbox.max.y < this.min.y || box.min.y > this.max.y ||\n\t\t\tbox.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint( sphere.center, _vector$b );\n\n\t\t// If that point is inside the sphere, the AABB and sphere intersect.\n\t\treturn _vector$b.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\n\t\tlet min, max;\n\n\t\tif ( plane.normal.x > 0 ) {\n\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\n\t\t} else {\n\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\n\t\t}\n\n\t\tif ( plane.normal.y > 0 ) {\n\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\n\t\t}\n\n\t\tif ( plane.normal.z > 0 ) {\n\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\n\t\t}\n\n\t\treturn ( min <= - plane.constant && max >= - plane.constant );\n\n\t}\n\n\tintersectsTriangle( triangle ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// compute box center and extents\n\t\tthis.getCenter( _center );\n\t\t_extents.subVectors( this.max, _center );\n\n\t\t// translate triangle to aabb origin\n\t\t_v0$2.subVectors( triangle.a, _center );\n\t\t_v1$7.subVectors( triangle.b, _center );\n\t\t_v2$3.subVectors( triangle.c, _center );\n\n\t\t// compute edge vectors for triangle\n\t\t_f0.subVectors( _v1$7, _v0$2 );\n\t\t_f1.subVectors( _v2$3, _v1$7 );\n\t\t_f2.subVectors( _v0$2, _v2$3 );\n\n\t\t// test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\t\tlet axes = [\n\t\t\t0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y,\n\t\t\t_f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x,\n\t\t\t- _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0\n\t\t];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// test 3 face normals from the aabb\n\t\taxes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\t\t_triangleNormal.crossVectors( _f0, _f1 );\n\t\taxes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ];\n\n\t\treturn satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents );\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\tconst clampedPoint = _vector$b.copy( point ).clamp( this.min, this.max );\n\n\t\treturn clampedPoint.sub( point ).length();\n\n\t}\n\n\tgetBoundingSphere( target ) {\n\n\t\tthis.getCenter( target.center );\n\n\t\ttarget.radius = this.getSize( _vector$b ).length() * 0.5;\n\n\t\treturn target;\n\n\t}\n\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\t// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\t// transform of empty box is an empty box.\n\t\tif ( this.isEmpty() ) return this;\n\n\t\t// NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\t\t_points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000\n\t\t_points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001\n\t\t_points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010\n\t\t_points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011\n\t\t_points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100\n\t\t_points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101\n\t\t_points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110\n\t\t_points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111\n\n\t\tthis.setFromPoints( _points );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n}\n\nBox3.prototype.isBox3 = true;\n\nconst _points = [\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3()\n];\n\nconst _vector$b = /*@__PURE__*/ new Vector3();\n\nconst _box$3 = /*@__PURE__*/ new Box3();\n\n// triangle centered vertices\n\nconst _v0$2 = /*@__PURE__*/ new Vector3();\nconst _v1$7 = /*@__PURE__*/ new Vector3();\nconst _v2$3 = /*@__PURE__*/ new Vector3();\n\n// triangle edge vectors\n\nconst _f0 = /*@__PURE__*/ new Vector3();\nconst _f1 = /*@__PURE__*/ new Vector3();\nconst _f2 = /*@__PURE__*/ new Vector3();\n\nconst _center = /*@__PURE__*/ new Vector3();\nconst _extents = /*@__PURE__*/ new Vector3();\nconst _triangleNormal = /*@__PURE__*/ new Vector3();\nconst _testAxis = /*@__PURE__*/ new Vector3();\n\nfunction satForAxes( axes, v0, v1, v2, extents ) {\n\n\tfor ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) {\n\n\t\t_testAxis.fromArray( axes, i );\n\t\t// project the aabb onto the seperating axis\n\t\tconst r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z );\n\t\t// project all 3 vertices of the triangle onto the seperating axis\n\t\tconst p0 = v0.dot( _testAxis );\n\t\tconst p1 = v1.dot( _testAxis );\n\t\tconst p2 = v2.dot( _testAxis );\n\t\t// actual test, basically see if either of the most extreme of the triangle points intersects r\n\t\tif ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) {\n\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is seperating and we can exit\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n\treturn true;\n\n}\n\nconst _box$2 = /*@__PURE__*/ new Box3();\nconst _v1$6 = /*@__PURE__*/ new Vector3();\nconst _toFarthestPoint = /*@__PURE__*/ new Vector3();\nconst _toPoint = /*@__PURE__*/ new Vector3();\n\nclass Sphere {\n\n\tconstructor( center = new Vector3(), radius = - 1 ) {\n\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\n\t}\n\n\tset( center, radius ) {\n\n\t\tthis.center.copy( center );\n\t\tthis.radius = radius;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points, optionalCenter ) {\n\n\t\tconst center = this.center;\n\n\t\tif ( optionalCenter !== undefined ) {\n\n\t\t\tcenter.copy( optionalCenter );\n\n\t\t} else {\n\n\t\t\t_box$2.setFromPoints( points ).getCenter( center );\n\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );\n\n\t\t}\n\n\t\tthis.radius = Math.sqrt( maxRadiusSq );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( sphere ) {\n\n\t\tthis.center.copy( sphere.center );\n\t\tthis.radius = sphere.radius;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\treturn ( this.radius < 0 );\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.center.set( 0, 0, 0 );\n\t\tthis.radius = - 1;\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn ( point.distanceTo( this.center ) - this.radius );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\tconst radiusSum = this.radius + sphere.radius;\n\n\t\treturn sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsSphere( this );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\treturn Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius;\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\tconst deltaLengthSq = this.center.distanceToSquared( point );\n\n\t\ttarget.copy( point );\n\n\t\tif ( deltaLengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\ttarget.sub( this.center ).normalize();\n\t\t\ttarget.multiplyScalar( this.radius ).add( this.center );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\tgetBoundingBox( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\n\t\t}\n\n\t\ttarget.set( this.center, this.center );\n\t\ttarget.expandByScalar( this.radius );\n\n\t\treturn target;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.center.applyMatrix4( matrix );\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.center.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\t// from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\n\t\t_toPoint.subVectors( point, this.center );\n\n\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\tif ( lengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\tconst length = Math.sqrt( lengthSq );\n\t\t\tconst missingRadiusHalf = ( length - this.radius ) * 0.5;\n\n\t\t\t// Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\tthis.center.add( _toPoint.multiplyScalar( missingRadiusHalf / length ) );\n\t\t\tthis.radius += missingRadiusHalf;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tunion( sphere ) {\n\n\t\t// from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\n\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\n\t\t if ( this.center.equals( sphere.center ) === true ) {\n\n\t\t\t _toFarthestPoint.set( 0, 0, 1 ).multiplyScalar( sphere.radius );\n\n\n\t\t} else {\n\n\t\t\t_toFarthestPoint.subVectors( sphere.center, this.center ).normalize().multiplyScalar( sphere.radius );\n\n\t\t}\n\n\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).add( _toFarthestPoint ) );\n\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).sub( _toFarthestPoint ) );\n\n\t\treturn this;\n\n\t}\n\n\tequals( sphere ) {\n\n\t\treturn sphere.center.equals( this.center ) && ( sphere.radius === this.radius );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$a = /*@__PURE__*/ new Vector3();\nconst _segCenter = /*@__PURE__*/ new Vector3();\nconst _segDir = /*@__PURE__*/ new Vector3();\nconst _diff = /*@__PURE__*/ new Vector3();\n\nconst _edge1 = /*@__PURE__*/ new Vector3();\nconst _edge2 = /*@__PURE__*/ new Vector3();\nconst _normal$1 = /*@__PURE__*/ new Vector3();\n\nclass Ray {\n\n\tconstructor( origin = new Vector3(), direction = new Vector3( 0, 0, - 1 ) ) {\n\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\n\t}\n\n\tset( origin, direction ) {\n\n\t\tthis.origin.copy( origin );\n\t\tthis.direction.copy( direction );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( ray ) {\n\n\t\tthis.origin.copy( ray.origin );\n\t\tthis.direction.copy( ray.direction );\n\n\t\treturn this;\n\n\t}\n\n\tat( t, target ) {\n\n\t\treturn target.copy( this.direction ).multiplyScalar( t ).add( this.origin );\n\n\t}\n\n\tlookAt( v ) {\n\n\t\tthis.direction.copy( v ).sub( this.origin ).normalize();\n\n\t\treturn this;\n\n\t}\n\n\trecast( t ) {\n\n\t\tthis.origin.copy( this.at( t, _vector$a ) );\n\n\t\treturn this;\n\n\t}\n\n\tclosestPointToPoint( point, target ) {\n\n\t\ttarget.subVectors( point, this.origin );\n\n\t\tconst directionDistance = target.dot( this.direction );\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn target.copy( this.origin );\n\n\t\t}\n\n\t\treturn target.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn Math.sqrt( this.distanceSqToPoint( point ) );\n\n\t}\n\n\tdistanceSqToPoint( point ) {\n\n\t\tconst directionDistance = _vector$a.subVectors( point, this.origin ).dot( this.direction );\n\n\t\t// point behind the ray\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn this.origin.distanceToSquared( point );\n\n\t\t}\n\n\t\t_vector$a.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin );\n\n\t\treturn _vector$a.distanceToSquared( point );\n\n\t}\n\n\tdistanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\n\t\t_segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 );\n\t\t_segDir.copy( v1 ).sub( v0 ).normalize();\n\t\t_diff.copy( this.origin ).sub( _segCenter );\n\n\t\tconst segExtent = v0.distanceTo( v1 ) * 0.5;\n\t\tconst a01 = - this.direction.dot( _segDir );\n\t\tconst b0 = _diff.dot( this.direction );\n\t\tconst b1 = - _diff.dot( _segDir );\n\t\tconst c = _diff.lengthSq();\n\t\tconst det = Math.abs( 1 - a01 * a01 );\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif ( det > 0 ) {\n\n\t\t\t// The ray and segment are not parallel.\n\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif ( s0 >= 0 ) {\n\n\t\t\t\tif ( s1 >= - extDet ) {\n\n\t\t\t\t\tif ( s1 <= extDet ) {\n\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// region 1\n\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 5\n\n\t\t\t\t\ts1 = - segExtent;\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( s1 <= - extDet ) {\n\n\t\t\t\t\t// region 4\n\n\t\t\t\t\ts0 = Math.max( 0, - ( - a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else if ( s1 <= extDet ) {\n\n\t\t\t\t\t// region 3\n\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 2\n\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Ray and segment are parallel.\n\n\t\t\ts1 = ( a01 > 0 ) ? - segExtent : segExtent;\n\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t}\n\n\t\tif ( optionalPointOnRay ) {\n\n\t\t\toptionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin );\n\n\t\t}\n\n\t\tif ( optionalPointOnSegment ) {\n\n\t\t\toptionalPointOnSegment.copy( _segDir ).multiplyScalar( s1 ).add( _segCenter );\n\n\t\t}\n\n\t\treturn sqrDist;\n\n\t}\n\n\tintersectSphere( sphere, target ) {\n\n\t\t_vector$a.subVectors( sphere.center, this.origin );\n\t\tconst tca = _vector$a.dot( this.direction );\n\t\tconst d2 = _vector$a.dot( _vector$a ) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\n\t\tif ( d2 > radius2 ) return null;\n\n\t\tconst thc = Math.sqrt( radius2 - d2 );\n\n\t\t// t0 = first intersect point - entrance on front of sphere\n\t\tconst t0 = tca - thc;\n\n\t\t// t1 = second intersect point - exit point on back of sphere\n\t\tconst t1 = tca + thc;\n\n\t\t// test to see if both t0 and t1 are behind the ray - if so, return null\n\t\tif ( t0 < 0 && t1 < 0 ) return null;\n\n\t\t// test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\t\tif ( t0 < 0 ) return this.at( t1, target );\n\n\t\t// else t0 is in front of the ray, so return the first collision point scaled by t0\n\t\treturn this.at( t0, target );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\treturn this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\tdistanceToPlane( plane ) {\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( plane.distanceToPoint( this.origin ) === 0 ) {\n\n\t\t\t\treturn 0;\n\n\t\t\t}\n\n\t\t\t// Null is preferable to undefined since undefined means.... it is undefined\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator;\n\n\t\t// Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\n\t}\n\n\tintersectPlane( plane, target ) {\n\n\t\tconst t = this.distanceToPlane( plane );\n\n\t\tif ( t === null ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn this.at( t, target );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\t// check if the ray lies on the plane first\n\n\t\tconst distToPoint = plane.distanceToPoint( this.origin );\n\n\t\tif ( distToPoint === 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator * distToPoint < 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// ray origin is behind the plane (and is pointing behind it)\n\n\t\treturn false;\n\n\t}\n\n\tintersectBox( box, target ) {\n\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\tinvdirz = 1 / this.direction.z;\n\n\t\tconst origin = this.origin;\n\n\t\tif ( invdirx >= 0 ) {\n\n\t\t\ttmin = ( box.min.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.max.x - origin.x ) * invdirx;\n\n\t\t} else {\n\n\t\t\ttmin = ( box.max.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.min.x - origin.x ) * invdirx;\n\n\t\t}\n\n\t\tif ( invdiry >= 0 ) {\n\n\t\t\ttymin = ( box.min.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.max.y - origin.y ) * invdiry;\n\n\t\t} else {\n\n\t\t\ttymin = ( box.max.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.min.y - origin.y ) * invdiry;\n\n\t\t}\n\n\t\tif ( ( tmin > tymax ) || ( tymin > tmax ) ) return null;\n\n\t\t// These lines also handle the case where tmin or tmax is NaN\n\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\tif ( tymin > tmin || tmin !== tmin ) tmin = tymin;\n\n\t\tif ( tymax < tmax || tmax !== tmax ) tmax = tymax;\n\n\t\tif ( invdirz >= 0 ) {\n\n\t\t\ttzmin = ( box.min.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.max.z - origin.z ) * invdirz;\n\n\t\t} else {\n\n\t\t\ttzmin = ( box.max.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.min.z - origin.z ) * invdirz;\n\n\t\t}\n\n\t\tif ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null;\n\n\t\tif ( tzmin > tmin || tmin !== tmin ) tmin = tzmin;\n\n\t\tif ( tzmax < tmax || tmax !== tmax ) tmax = tzmax;\n\n\t\t//return point closest to the ray (positive side)\n\n\t\tif ( tmax < 0 ) return null;\n\n\t\treturn this.at( tmin >= 0 ? tmin : tmax, target );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn this.intersectBox( box, _vector$a ) !== null;\n\n\t}\n\n\tintersectTriangle( a, b, c, backfaceCulling, target ) {\n\n\t\t// Compute the offset origin, edges, and normal.\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\n\t\t_edge1.subVectors( b, a );\n\t\t_edge2.subVectors( c, a );\n\t\t_normal$1.crossVectors( _edge1, _edge2 );\n\n\t\t// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t// |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t// |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t// |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\t\tlet DdN = this.direction.dot( _normal$1 );\n\t\tlet sign;\n\n\t\tif ( DdN > 0 ) {\n\n\t\t\tif ( backfaceCulling ) return null;\n\t\t\tsign = 1;\n\n\t\t} else if ( DdN < 0 ) {\n\n\t\t\tsign = - 1;\n\t\t\tDdN = - DdN;\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t_diff.subVectors( this.origin, a );\n\t\tconst DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) );\n\n\t\t// b1 < 0, no intersection\n\t\tif ( DdQxE2 < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) );\n\n\t\t// b2 < 0, no intersection\n\t\tif ( DdE1xQ < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// b1+b2 > 1, no intersection\n\t\tif ( DdQxE2 + DdE1xQ > DdN ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Line intersects triangle, check if ray does.\n\t\tconst QdN = - sign * _diff.dot( _normal$1 );\n\n\t\t// t < 0, no intersection\n\t\tif ( QdN < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Ray intersects triangle.\n\t\treturn this.at( QdN / DdN, target );\n\n\t}\n\n\tapplyMatrix4( matrix4 ) {\n\n\t\tthis.origin.applyMatrix4( matrix4 );\n\t\tthis.direction.transformDirection( matrix4 );\n\n\t\treturn this;\n\n\t}\n\n\tequals( ray ) {\n\n\t\treturn ray.origin.equals( this.origin ) && ray.direction.equals( this.direction );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nclass Matrix4 {\n\n\tconstructor() {\n\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t];\n\n\t\tif ( arguments.length > 0 ) {\n\n\t\t\tconsole.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' );\n\n\t\t}\n\n\t}\n\n\tset( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;\n\t\tte[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;\n\t\tte[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;\n\t\tte[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Matrix4().fromArray( this.elements );\n\n\t}\n\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ];\n\t\tte[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ];\n\t\tte[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ];\n\t\tte[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\tcopyPosition( m ) {\n\n\t\tconst te = this.elements, me = m.elements;\n\n\t\tte[ 12 ] = me[ 12 ];\n\t\tte[ 13 ] = me[ 13 ];\n\t\tte[ 14 ] = me[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrix3( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 3 ], me[ 6 ], 0,\n\t\t\tme[ 1 ], me[ 4 ], me[ 7 ], 0,\n\t\t\tme[ 2 ], me[ 5 ], me[ 8 ], 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrixColumn( this, 0 );\n\t\tyAxis.setFromMatrixColumn( this, 1 );\n\t\tzAxis.setFromMatrixColumn( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\tmakeBasis( xAxis, yAxis, zAxis ) {\n\n\t\tthis.set(\n\t\t\txAxis.x, yAxis.x, zAxis.x, 0,\n\t\t\txAxis.y, yAxis.y, zAxis.y, 0,\n\t\t\txAxis.z, yAxis.z, zAxis.z, 0,\n\t\t\t0, 0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\textractRotation( m ) {\n\n\t\t// this method does not support reflection matrices\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$5.setFromMatrixColumn( m, 0 ).length();\n\t\tconst scaleY = 1 / _v1$5.setFromMatrixColumn( m, 1 ).length();\n\t\tconst scaleZ = 1 / _v1$5.setFromMatrixColumn( m, 2 ).length();\n\n\t\tte[ 0 ] = me[ 0 ] * scaleX;\n\t\tte[ 1 ] = me[ 1 ] * scaleX;\n\t\tte[ 2 ] = me[ 2 ] * scaleX;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = me[ 4 ] * scaleY;\n\t\tte[ 5 ] = me[ 5 ] * scaleY;\n\t\tte[ 6 ] = me[ 6 ] * scaleY;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = me[ 8 ] * scaleZ;\n\t\tte[ 9 ] = me[ 9 ] * scaleZ;\n\t\tte[ 10 ] = me[ 10 ] * scaleZ;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationFromEuler( euler ) {\n\n\t\tif ( ! ( euler && euler.isEuler ) ) {\n\n\t\t\tconsole.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' );\n\n\t\t}\n\n\t\tconst te = this.elements;\n\n\t\tconst x = euler.x, y = euler.y, z = euler.z;\n\t\tconst a = Math.cos( x ), b = Math.sin( x );\n\t\tconst c = Math.cos( y ), d = Math.sin( y );\n\t\tconst e = Math.cos( z ), f = Math.sin( z );\n\n\t\tif ( euler.order === 'XYZ' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - c * f;\n\t\t\tte[ 8 ] = d;\n\n\t\t\tte[ 1 ] = af + be * d;\n\t\t\tte[ 5 ] = ae - bf * d;\n\t\t\tte[ 9 ] = - b * c;\n\n\t\t\tte[ 2 ] = bf - ae * d;\n\t\t\tte[ 6 ] = be + af * d;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YXZ' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce + df * b;\n\t\t\tte[ 4 ] = de * b - cf;\n\t\t\tte[ 8 ] = a * d;\n\n\t\t\tte[ 1 ] = a * f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b;\n\n\t\t\tte[ 2 ] = cf * b - de;\n\t\t\tte[ 6 ] = df + ce * b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZXY' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce - df * b;\n\t\t\tte[ 4 ] = - a * f;\n\t\t\tte[ 8 ] = de + cf * b;\n\n\t\t\tte[ 1 ] = cf + de * b;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = df - ce * b;\n\n\t\t\tte[ 2 ] = - a * d;\n\t\t\tte[ 6 ] = b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZYX' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = be * d - af;\n\t\t\tte[ 8 ] = ae * d + bf;\n\n\t\t\tte[ 1 ] = c * f;\n\t\t\tte[ 5 ] = bf * d + ae;\n\t\t\tte[ 9 ] = af * d - be;\n\n\t\t\tte[ 2 ] = - d;\n\t\t\tte[ 6 ] = b * c;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YZX' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = bd - ac * f;\n\t\t\tte[ 8 ] = bc * f + ad;\n\n\t\t\tte[ 1 ] = f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b * e;\n\n\t\t\tte[ 2 ] = - d * e;\n\t\t\tte[ 6 ] = ad * f + bc;\n\t\t\tte[ 10 ] = ac - bd * f;\n\n\t\t} else if ( euler.order === 'XZY' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - f;\n\t\t\tte[ 8 ] = d * e;\n\n\t\t\tte[ 1 ] = ac * f + bd;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = ad * f - bc;\n\n\t\t\tte[ 2 ] = bc * f - ad;\n\t\t\tte[ 6 ] = b * e;\n\t\t\tte[ 10 ] = bd * f + ac;\n\n\t\t}\n\n\t\t// bottom row\n\t\tte[ 3 ] = 0;\n\t\tte[ 7 ] = 0;\n\t\tte[ 11 ] = 0;\n\n\t\t// last column\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationFromQuaternion( q ) {\n\n\t\treturn this.compose( _zero, q, _one );\n\n\t}\n\n\tlookAt( eye, target, up ) {\n\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors( eye, target );\n\n\t\tif ( _z.lengthSq() === 0 ) {\n\n\t\t\t// eye and target are in the same position\n\n\t\t\t_z.z = 1;\n\n\t\t}\n\n\t\t_z.normalize();\n\t\t_x.crossVectors( up, _z );\n\n\t\tif ( _x.lengthSq() === 0 ) {\n\n\t\t\t// up and z are parallel\n\n\t\t\tif ( Math.abs( up.z ) === 1 ) {\n\n\t\t\t\t_z.x += 0.0001;\n\n\t\t\t} else {\n\n\t\t\t\t_z.z += 0.0001;\n\n\t\t\t}\n\n\t\t\t_z.normalize();\n\t\t\t_x.crossVectors( up, _z );\n\n\t\t}\n\n\t\t_x.normalize();\n\t\t_y.crossVectors( _z, _x );\n\n\t\tte[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x;\n\t\tte[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y;\n\t\tte[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( m, n ) {\n\n\t\tif ( n !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' );\n\t\t\treturn this.multiplyMatrices( m, n );\n\n\t\t}\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];\n\t\tconst a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];\n\t\tconst b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n\t\tte[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;\n\t\tte[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;\n\t\tte[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;\n\t\tte[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];\n\t\tconst n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];\n\t\tconst n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];\n\t\tconst n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];\n\n\t\t//TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn (\n\t\t\tn41 * (\n\t\t\t\t+ n14 * n23 * n32\n\t\t\t\t - n13 * n24 * n32\n\t\t\t\t - n14 * n22 * n33\n\t\t\t\t + n12 * n24 * n33\n\t\t\t\t + n13 * n22 * n34\n\t\t\t\t - n12 * n23 * n34\n\t\t\t) +\n\t\t\tn42 * (\n\t\t\t\t+ n11 * n23 * n34\n\t\t\t\t - n11 * n24 * n33\n\t\t\t\t + n14 * n21 * n33\n\t\t\t\t - n13 * n21 * n34\n\t\t\t\t + n13 * n24 * n31\n\t\t\t\t - n14 * n23 * n31\n\t\t\t) +\n\t\t\tn43 * (\n\t\t\t\t+ n11 * n24 * n32\n\t\t\t\t - n11 * n22 * n34\n\t\t\t\t - n14 * n21 * n32\n\t\t\t\t + n12 * n21 * n34\n\t\t\t\t + n14 * n22 * n31\n\t\t\t\t - n12 * n24 * n31\n\t\t\t) +\n\t\t\tn44 * (\n\t\t\t\t- n13 * n22 * n31\n\t\t\t\t - n11 * n23 * n32\n\t\t\t\t + n11 * n22 * n33\n\t\t\t\t + n13 * n21 * n32\n\t\t\t\t - n12 * n21 * n33\n\t\t\t\t + n12 * n23 * n31\n\t\t\t)\n\n\t\t);\n\n\t}\n\n\ttranspose() {\n\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\n\t\ttmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;\n\t\ttmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;\n\t\ttmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;\n\n\t\ttmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;\n\t\ttmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;\n\t\ttmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\tsetPosition( x, y, z ) {\n\n\t\tconst te = this.elements;\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tte[ 12 ] = x.x;\n\t\t\tte[ 13 ] = x.y;\n\t\t\tte[ 14 ] = x.z;\n\n\t\t} else {\n\n\t\t\tte[ 12 ] = x;\n\t\t\tte[ 13 ] = y;\n\t\t\tte[ 14 ] = z;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tinvert() {\n\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], n41 = te[ 3 ],\n\t\t\tn12 = te[ 4 ], n22 = te[ 5 ], n32 = te[ 6 ], n42 = te[ 7 ],\n\t\t\tn13 = te[ 8 ], n23 = te[ 9 ], n33 = te[ 10 ], n43 = te[ 11 ],\n\t\t\tn14 = te[ 12 ], n24 = te[ 13 ], n34 = te[ 14 ], n44 = te[ 15 ],\n\n\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;\n\t\tte[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;\n\t\tte[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;\n\n\t\tte[ 4 ] = t12 * detInv;\n\t\tte[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;\n\t\tte[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;\n\t\tte[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;\n\n\t\tte[ 8 ] = t13 * detInv;\n\t\tte[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;\n\t\tte[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;\n\t\tte[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;\n\n\t\tte[ 12 ] = t14 * detInv;\n\t\tte[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;\n\t\tte[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;\n\t\tte[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\tscale( v ) {\n\n\t\tconst te = this.elements;\n\t\tconst x = v.x, y = v.y, z = v.z;\n\n\t\tte[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;\n\t\tte[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;\n\t\tte[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;\n\t\tte[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;\n\n\t\treturn this;\n\n\t}\n\n\tgetMaxScaleOnAxis() {\n\n\t\tconst te = this.elements;\n\n\t\tconst scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];\n\t\tconst scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];\n\t\tconst scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];\n\n\t\treturn Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );\n\n\t}\n\n\tmakeTranslation( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, x,\n\t\t\t0, 1, 0, y,\n\t\t\t0, 0, 1, z,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationX( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, c, - s, 0,\n\t\t\t0, s, c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationY( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t c, 0, s, 0,\n\t\t\t 0, 1, 0, 0,\n\t\t\t- s, 0, c, 0,\n\t\t\t 0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationZ( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0, 0,\n\t\t\ts, c, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationAxis( axis, angle ) {\n\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n\t\tconst c = Math.cos( angle );\n\t\tconst s = Math.sin( angle );\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x, y = axis.y, z = axis.z;\n\t\tconst tx = t * x, ty = t * y;\n\n\t\tthis.set(\n\n\t\t\ttx * x + c, tx * y - s * z, tx * z + s * y, 0,\n\t\t\ttx * y + s * z, ty * y + c, ty * z - s * x, 0,\n\t\t\ttx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeScale( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0, 0,\n\t\t\t0, y, 0, 0,\n\t\t\t0, 0, z, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeShear( xy, xz, yx, yz, zx, zy ) {\n\n\t\tthis.set(\n\n\t\t\t1, yx, zx, 0,\n\t\t\txy, 1, zy, 0,\n\t\t\txz, yz, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tcompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w;\n\t\tconst x2 = x + x,\ty2 = y + y, z2 = z + z;\n\t\tconst xx = x * x2, xy = x * y2, xz = x * z2;\n\t\tconst yy = y * y2, yz = y * z2, zz = z * z2;\n\t\tconst wx = w * x2, wy = w * y2, wz = w * z2;\n\n\t\tconst sx = scale.x, sy = scale.y, sz = scale.z;\n\n\t\tte[ 0 ] = ( 1 - ( yy + zz ) ) * sx;\n\t\tte[ 1 ] = ( xy + wz ) * sx;\n\t\tte[ 2 ] = ( xz - wy ) * sx;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = ( xy - wz ) * sy;\n\t\tte[ 5 ] = ( 1 - ( xx + zz ) ) * sy;\n\t\tte[ 6 ] = ( yz + wx ) * sy;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = ( xz + wy ) * sz;\n\t\tte[ 9 ] = ( yz - wx ) * sz;\n\t\tte[ 10 ] = ( 1 - ( xx + yy ) ) * sz;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = position.x;\n\t\tte[ 13 ] = position.y;\n\t\tte[ 14 ] = position.z;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tdecompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$5.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();\n\t\tconst sy = _v1$5.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();\n\t\tconst sz = _v1$5.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();\n\n\t\t// if determine is negative, we need to invert one scale\n\t\tconst det = this.determinant();\n\t\tif ( det < 0 ) sx = - sx;\n\n\t\tposition.x = te[ 12 ];\n\t\tposition.y = te[ 13 ];\n\t\tposition.z = te[ 14 ];\n\n\t\t// scale the rotation part\n\t\t_m1$2.copy( this );\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\n\t\t_m1$2.elements[ 0 ] *= invSX;\n\t\t_m1$2.elements[ 1 ] *= invSX;\n\t\t_m1$2.elements[ 2 ] *= invSX;\n\n\t\t_m1$2.elements[ 4 ] *= invSY;\n\t\t_m1$2.elements[ 5 ] *= invSY;\n\t\t_m1$2.elements[ 6 ] *= invSY;\n\n\t\t_m1$2.elements[ 8 ] *= invSZ;\n\t\t_m1$2.elements[ 9 ] *= invSZ;\n\t\t_m1$2.elements[ 10 ] *= invSZ;\n\n\t\tquaternion.setFromRotationMatrix( _m1$2 );\n\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\tmakePerspective( left, right, top, bottom, near, far ) {\n\n\t\tif ( far === undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' );\n\n\t\t}\n\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / ( right - left );\n\t\tconst y = 2 * near / ( top - bottom );\n\n\t\tconst a = ( right + left ) / ( right - left );\n\t\tconst b = ( top + bottom ) / ( top - bottom );\n\t\tconst c = - ( far + near ) / ( far - near );\n\t\tconst d = - 2 * far * near / ( far - near );\n\n\t\tte[ 0 ] = x;\tte[ 4 ] = 0;\tte[ 8 ] = a;\tte[ 12 ] = 0;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = y;\tte[ 9 ] = b;\tte[ 13 ] = 0;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = c;\tte[ 14 ] = d;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = - 1;\tte[ 15 ] = 0;\n\n\t\treturn this;\n\n\t}\n\n\tmakeOrthographic( left, right, top, bottom, near, far ) {\n\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / ( right - left );\n\t\tconst h = 1.0 / ( top - bottom );\n\t\tconst p = 1.0 / ( far - near );\n\n\t\tconst x = ( right + left ) * w;\n\t\tconst y = ( top + bottom ) * h;\n\t\tconst z = ( far + near ) * p;\n\n\t\tte[ 0 ] = 2 * w;\tte[ 4 ] = 0;\tte[ 8 ] = 0;\tte[ 12 ] = - x;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = 2 * h;\tte[ 9 ] = 0;\tte[ 13 ] = - y;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = - 2 * p;\tte[ 14 ] = - z;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = 0;\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\t\tarray[ offset + 9 ] = te[ 9 ];\n\t\tarray[ offset + 10 ] = te[ 10 ];\n\t\tarray[ offset + 11 ] = te[ 11 ];\n\n\t\tarray[ offset + 12 ] = te[ 12 ];\n\t\tarray[ offset + 13 ] = te[ 13 ];\n\t\tarray[ offset + 14 ] = te[ 14 ];\n\t\tarray[ offset + 15 ] = te[ 15 ];\n\n\t\treturn array;\n\n\t}\n\n}\n\nMatrix4.prototype.isMatrix4 = true;\n\nconst _v1$5 = /*@__PURE__*/ new Vector3();\nconst _m1$2 = /*@__PURE__*/ new Matrix4();\nconst _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );\nconst _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );\nconst _x = /*@__PURE__*/ new Vector3();\nconst _y = /*@__PURE__*/ new Vector3();\nconst _z = /*@__PURE__*/ new Vector3();\n\nconst _matrix$1 = /*@__PURE__*/ new Matrix4();\nconst _quaternion$3 = /*@__PURE__*/ new Quaternion();\n\nclass Euler {\n\n\tconstructor( x = 0, y = 0, z = 0, order = Euler.DefaultOrder ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t}\n\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget order() {\n\n\t\treturn this._order;\n\n\t}\n\n\tset order( value ) {\n\n\t\tthis._order = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tset( x, y, z, order = this._order ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._order );\n\n\t}\n\n\tcopy( euler ) {\n\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromRotationMatrix( m, order = this._order, update = true ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements;\n\t\tconst m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ];\n\t\tconst m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ];\n\t\tconst m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\n\t\t\t\tthis._y = Math.asin( clamp( m13, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m13 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\n\t\t\t\tthis._x = Math.asin( - clamp( m23, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m23 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\n\t\t\t\tthis._x = Math.asin( clamp( m32, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m32 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\n\t\t\t\tthis._y = Math.asin( - clamp( m31, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m31 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\n\t\t\t\tthis._z = Math.asin( clamp( m21, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m21 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m22 );\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\n\t\t\t\tthis._z = Math.asin( - clamp( m12, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m12 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._y = Math.atan2( m13, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._y = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tconsole.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tthis._order = order;\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromQuaternion( q, order, update ) {\n\n\t\t_matrix$1.makeRotationFromQuaternion( q );\n\n\t\treturn this.setFromRotationMatrix( _matrix$1, order, update );\n\n\t}\n\n\tsetFromVector3( v, order = this._order ) {\n\n\t\treturn this.set( v.x, v.y, v.z, order );\n\n\t}\n\n\treorder( newOrder ) {\n\n\t\t// WARNING: this discards revolution information -bhouston\n\n\t\t_quaternion$3.setFromEuler( this );\n\n\t\treturn this.setFromQuaternion( _quaternion$3, newOrder );\n\n\t}\n\n\tequals( euler ) {\n\n\t\treturn ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order );\n\n\t}\n\n\tfromArray( array ) {\n\n\t\tthis._x = array[ 0 ];\n\t\tthis._y = array[ 1 ];\n\t\tthis._z = array[ 2 ];\n\t\tif ( array[ 3 ] !== undefined ) this._order = array[ 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._order;\n\n\t\treturn array;\n\n\t}\n\n\ttoVector3( optionalResult ) {\n\n\t\tif ( optionalResult ) {\n\n\t\t\treturn optionalResult.set( this._x, this._y, this._z );\n\n\t\t} else {\n\n\t\t\treturn new Vector3( this._x, this._y, this._z );\n\n\t\t}\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n}\n\nEuler.prototype.isEuler = true;\n\nEuler.DefaultOrder = 'XYZ';\nEuler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ];\n\nclass Layers {\n\n\tconstructor() {\n\n\t\tthis.mask = 1 | 0;\n\n\t}\n\n\tset( channel ) {\n\n\t\tthis.mask = ( 1 << channel | 0 ) >>> 0;\n\n\t}\n\n\tenable( channel ) {\n\n\t\tthis.mask |= 1 << channel | 0;\n\n\t}\n\n\tenableAll() {\n\n\t\tthis.mask = 0xffffffff | 0;\n\n\t}\n\n\ttoggle( channel ) {\n\n\t\tthis.mask ^= 1 << channel | 0;\n\n\t}\n\n\tdisable( channel ) {\n\n\t\tthis.mask &= ~ ( 1 << channel | 0 );\n\n\t}\n\n\tdisableAll() {\n\n\t\tthis.mask = 0;\n\n\t}\n\n\ttest( layers ) {\n\n\t\treturn ( this.mask & layers.mask ) !== 0;\n\n\t}\n\n\tisEnabled( channel ) {\n\n\t\treturn ( this.mask & ( 1 << channel | 0 ) ) !== 0;\n\n\t}\n\n}\n\nlet _object3DId = 0;\n\nconst _v1$4 = /*@__PURE__*/ new Vector3();\nconst _q1 = /*@__PURE__*/ new Quaternion();\nconst _m1$1 = /*@__PURE__*/ new Matrix4();\nconst _target = /*@__PURE__*/ new Vector3();\n\nconst _position$3 = /*@__PURE__*/ new Vector3();\nconst _scale$2 = /*@__PURE__*/ new Vector3();\nconst _quaternion$2 = /*@__PURE__*/ new Quaternion();\n\nconst _xAxis = /*@__PURE__*/ new Vector3( 1, 0, 0 );\nconst _yAxis = /*@__PURE__*/ new Vector3( 0, 1, 0 );\nconst _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );\n\nconst _addedEvent = { type: 'added' };\nconst _removedEvent = { type: 'removed' };\n\nclass Object3D extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tObject.defineProperty( this, 'id', { value: _object3DId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Object3D';\n\n\t\tthis.parent = null;\n\t\tthis.children = [];\n\n\t\tthis.up = Object3D.DefaultUp.clone();\n\n\t\tconst position = new Vector3();\n\t\tconst rotation = new Euler();\n\t\tconst quaternion = new Quaternion();\n\t\tconst scale = new Vector3( 1, 1, 1 );\n\n\t\tfunction onRotationChange() {\n\n\t\t\tquaternion.setFromEuler( rotation, false );\n\n\t\t}\n\n\t\tfunction onQuaternionChange() {\n\n\t\t\trotation.setFromQuaternion( quaternion, undefined, false );\n\n\t\t}\n\n\t\trotation._onChange( onRotationChange );\n\t\tquaternion._onChange( onQuaternionChange );\n\n\t\tObject.defineProperties( this, {\n\t\t\tposition: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: position\n\t\t\t},\n\t\t\trotation: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: rotation\n\t\t\t},\n\t\t\tquaternion: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: quaternion\n\t\t\t},\n\t\t\tscale: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: scale\n\t\t\t},\n\t\t\tmodelViewMatrix: {\n\t\t\t\tvalue: new Matrix4()\n\t\t\t},\n\t\t\tnormalMatrix: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t} );\n\n\t\tthis.matrix = new Matrix4();\n\t\tthis.matrixWorld = new Matrix4();\n\n\t\tthis.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;\n\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\tthis.layers = new Layers();\n\t\tthis.visible = true;\n\n\t\tthis.castShadow = false;\n\t\tthis.receiveShadow = false;\n\n\t\tthis.frustumCulled = true;\n\t\tthis.renderOrder = 0;\n\n\t\tthis.animations = [];\n\n\t\tthis.userData = {};\n\n\t}\n\n\tonBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\tonAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tthis.matrix.premultiply( matrix );\n\n\t\tthis.matrix.decompose( this.position, this.quaternion, this.scale );\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\tthis.quaternion.premultiply( q );\n\n\t\treturn this;\n\n\t}\n\n\tsetRotationFromAxisAngle( axis, angle ) {\n\n\t\t// assumes axis is normalized\n\n\t\tthis.quaternion.setFromAxisAngle( axis, angle );\n\n\t}\n\n\tsetRotationFromEuler( euler ) {\n\n\t\tthis.quaternion.setFromEuler( euler, true );\n\n\t}\n\n\tsetRotationFromMatrix( m ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tthis.quaternion.setFromRotationMatrix( m );\n\n\t}\n\n\tsetRotationFromQuaternion( q ) {\n\n\t\t// assumes q is normalized\n\n\t\tthis.quaternion.copy( q );\n\n\t}\n\n\trotateOnAxis( axis, angle ) {\n\n\t\t// rotate object on axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.multiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateOnWorldAxis( axis, angle ) {\n\n\t\t// rotate object on axis in world space\n\t\t// axis is assumed to be normalized\n\t\t// method assumes no rotated parent\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.premultiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateX( angle ) {\n\n\t\treturn this.rotateOnAxis( _xAxis, angle );\n\n\t}\n\n\trotateY( angle ) {\n\n\t\treturn this.rotateOnAxis( _yAxis, angle );\n\n\t}\n\n\trotateZ( angle ) {\n\n\t\treturn this.rotateOnAxis( _zAxis, angle );\n\n\t}\n\n\ttranslateOnAxis( axis, distance ) {\n\n\t\t// translate object by distance along axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_v1$4.copy( axis ).applyQuaternion( this.quaternion );\n\n\t\tthis.position.add( _v1$4.multiplyScalar( distance ) );\n\n\t\treturn this;\n\n\t}\n\n\ttranslateX( distance ) {\n\n\t\treturn this.translateOnAxis( _xAxis, distance );\n\n\t}\n\n\ttranslateY( distance ) {\n\n\t\treturn this.translateOnAxis( _yAxis, distance );\n\n\t}\n\n\ttranslateZ( distance ) {\n\n\t\treturn this.translateOnAxis( _zAxis, distance );\n\n\t}\n\n\tlocalToWorld( vector ) {\n\n\t\treturn vector.applyMatrix4( this.matrixWorld );\n\n\t}\n\n\tworldToLocal( vector ) {\n\n\t\treturn vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() );\n\n\t}\n\n\tlookAt( x, y, z ) {\n\n\t\t// This method does not support objects having non-uniformly-scaled parent(s)\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\t_target.copy( x );\n\n\t\t} else {\n\n\t\t\t_target.set( x, y, z );\n\n\t\t}\n\n\t\tconst parent = this.parent;\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_position$3.setFromMatrixPosition( this.matrixWorld );\n\n\t\tif ( this.isCamera || this.isLight ) {\n\n\t\t\t_m1$1.lookAt( _position$3, _target, this.up );\n\n\t\t} else {\n\n\t\t\t_m1$1.lookAt( _target, _position$3, this.up );\n\n\t\t}\n\n\t\tthis.quaternion.setFromRotationMatrix( _m1$1 );\n\n\t\tif ( parent ) {\n\n\t\t\t_m1$1.extractRotation( parent.matrixWorld );\n\t\t\t_q1.setFromRotationMatrix( _m1$1 );\n\t\t\tthis.quaternion.premultiply( _q1.invert() );\n\n\t\t}\n\n\t}\n\n\tadd( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.add( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object === this ) {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object can\\'t be added as a child of itself.', object );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object && object.isObject3D ) {\n\n\t\t\tif ( object.parent !== null ) {\n\n\t\t\t\tobject.parent.remove( object );\n\n\t\t\t}\n\n\t\t\tobject.parent = this;\n\t\t\tthis.children.push( object );\n\n\t\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremove( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.remove( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst index = this.children.indexOf( object );\n\n\t\tif ( index !== - 1 ) {\n\n\t\t\tobject.parent = null;\n\t\t\tthis.children.splice( index, 1 );\n\n\t\t\tobject.dispatchEvent( _removedEvent );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremoveFromParent() {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tparent.remove( this );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclear() {\n\n\t\tfor ( let i = 0; i < this.children.length; i ++ ) {\n\n\t\t\tconst object = this.children[ i ];\n\n\t\t\tobject.parent = null;\n\n\t\t\tobject.dispatchEvent( _removedEvent );\n\n\t\t}\n\n\t\tthis.children.length = 0;\n\n\t\treturn this;\n\n\n\t}\n\n\tattach( object ) {\n\n\t\t// adds object as a child of this, while maintaining the object's world transform\n\n\t\t// Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_m1$1.copy( this.matrixWorld ).invert();\n\n\t\tif ( object.parent !== null ) {\n\n\t\t\tobject.parent.updateWorldMatrix( true, false );\n\n\t\t\t_m1$1.multiply( object.parent.matrixWorld );\n\n\t\t}\n\n\t\tobject.applyMatrix4( _m1$1 );\n\n\t\tthis.add( object );\n\n\t\tobject.updateWorldMatrix( false, true );\n\n\t\treturn this;\n\n\t}\n\n\tgetObjectById( id ) {\n\n\t\treturn this.getObjectByProperty( 'id', id );\n\n\t}\n\n\tgetObjectByName( name ) {\n\n\t\treturn this.getObjectByProperty( 'name', name );\n\n\t}\n\n\tgetObjectByProperty( name, value ) {\n\n\t\tif ( this[ name ] === value ) return this;\n\n\t\tfor ( let i = 0, l = this.children.length; i < l; i ++ ) {\n\n\t\t\tconst child = this.children[ i ];\n\t\t\tconst object = child.getObjectByProperty( name, value );\n\n\t\t\tif ( object !== undefined ) {\n\n\t\t\t\treturn object;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\tgetWorldPosition( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn target.setFromMatrixPosition( this.matrixWorld );\n\n\t}\n\n\tgetWorldQuaternion( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, target, _scale$2 );\n\n\t\treturn target;\n\n\t}\n\n\tgetWorldScale( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, _quaternion$2, target );\n\n\t\treturn target;\n\n\t}\n\n\tgetWorldDirection( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tconst e = this.matrixWorld.elements;\n\n\t\treturn target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();\n\n\t}\n\n\traycast( /* raycaster, intersects */ ) {}\n\n\ttraverse( callback ) {\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverse( callback );\n\n\t\t}\n\n\t}\n\n\ttraverseVisible( callback ) {\n\n\t\tif ( this.visible === false ) return;\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverseVisible( callback );\n\n\t\t}\n\n\t}\n\n\ttraverseAncestors( callback ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tcallback( parent );\n\n\t\t\tparent.traverseAncestors( callback );\n\n\t\t}\n\n\t}\n\n\tupdateMatrix() {\n\n\t\tthis.matrix.compose( this.position, this.quaternion, this.scale );\n\n\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\n\n\t\t\tif ( this.parent === null ) {\n\n\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t}\n\n\t\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t\tforce = true;\n\n\t\t}\n\n\t\t// update children\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].updateMatrixWorld( force );\n\n\t\t}\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( updateParents === true && parent !== null ) {\n\n\t\t\tparent.updateWorldMatrix( true, false );\n\n\t\t}\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.parent === null ) {\n\n\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t} else {\n\n\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t}\n\n\t\t// update children\n\n\t\tif ( updateChildren === true ) {\n\n\t\t\tconst children = this.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tchildren[ i ].updateWorldMatrix( false, true );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\t// meta is a string when called from JSON.stringify\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tconst output = {};\n\n\t\t// meta is a hash used to collect geometries, materials.\n\t\t// not providing it implies that this is the root object\n\t\t// being serialized.\n\t\tif ( isRootObject ) {\n\n\t\t\t// initialize meta obj\n\t\t\tmeta = {\n\t\t\t\tgeometries: {},\n\t\t\t\tmaterials: {},\n\t\t\t\ttextures: {},\n\t\t\t\timages: {},\n\t\t\t\tshapes: {},\n\t\t\t\tskeletons: {},\n\t\t\t\tanimations: {}\n\t\t\t};\n\n\t\t\toutput.metadata = {\n\t\t\t\tversion: 4.5,\n\t\t\t\ttype: 'Object',\n\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t};\n\n\t\t}\n\n\t\t// standard Object3D serialization\n\n\t\tconst object = {};\n\n\t\tobject.uuid = this.uuid;\n\t\tobject.type = this.type;\n\n\t\tif ( this.name !== '' ) object.name = this.name;\n\t\tif ( this.castShadow === true ) object.castShadow = true;\n\t\tif ( this.receiveShadow === true ) object.receiveShadow = true;\n\t\tif ( this.visible === false ) object.visible = false;\n\t\tif ( this.frustumCulled === false ) object.frustumCulled = false;\n\t\tif ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;\n\t\tif ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;\n\n\t\tobject.layers = this.layers.mask;\n\t\tobject.matrix = this.matrix.toArray();\n\n\t\tif ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;\n\n\t\t// object specific properties\n\n\t\tif ( this.isInstancedMesh ) {\n\n\t\t\tobject.type = 'InstancedMesh';\n\t\t\tobject.count = this.count;\n\t\t\tobject.instanceMatrix = this.instanceMatrix.toJSON();\n\t\t\tif ( this.instanceColor !== null ) object.instanceColor = this.instanceColor.toJSON();\n\n\t\t}\n\n\t\t//\n\n\t\tfunction serialize( library, element ) {\n\n\t\t\tif ( library[ element.uuid ] === undefined ) {\n\n\t\t\t\tlibrary[ element.uuid ] = element.toJSON( meta );\n\n\t\t\t}\n\n\t\t\treturn element.uuid;\n\n\t\t}\n\n\t\tif ( this.isScene ) {\n\n\t\t\tif ( this.background ) {\n\n\t\t\t\tif ( this.background.isColor ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON();\n\n\t\t\t\t} else if ( this.background.isTexture ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON( meta ).uuid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.environment && this.environment.isTexture ) {\n\n\t\t\t\tobject.environment = this.environment.toJSON( meta ).uuid;\n\n\t\t\t}\n\n\t\t} else if ( this.isMesh || this.isLine || this.isPoints ) {\n\n\t\t\tobject.geometry = serialize( meta.geometries, this.geometry );\n\n\t\t\tconst parameters = this.geometry.parameters;\n\n\t\t\tif ( parameters !== undefined && parameters.shapes !== undefined ) {\n\n\t\t\t\tconst shapes = parameters.shapes;\n\n\t\t\t\tif ( Array.isArray( shapes ) ) {\n\n\t\t\t\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tconst shape = shapes[ i ];\n\n\t\t\t\t\t\tserialize( meta.shapes, shape );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tserialize( meta.shapes, shapes );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.isSkinnedMesh ) {\n\n\t\t\tobject.bindMode = this.bindMode;\n\t\t\tobject.bindMatrix = this.bindMatrix.toArray();\n\n\t\t\tif ( this.skeleton !== undefined ) {\n\n\t\t\t\tserialize( meta.skeletons, this.skeleton );\n\n\t\t\t\tobject.skeleton = this.skeleton.uuid;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.material !== undefined ) {\n\n\t\t\tif ( Array.isArray( this.material ) ) {\n\n\t\t\t\tconst uuids = [];\n\n\t\t\t\tfor ( let i = 0, l = this.material.length; i < l; i ++ ) {\n\n\t\t\t\t\tuuids.push( serialize( meta.materials, this.material[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tobject.material = uuids;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = serialize( meta.materials, this.material );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.children.length > 0 ) {\n\n\t\t\tobject.children = [];\n\n\t\t\tfor ( let i = 0; i < this.children.length; i ++ ) {\n\n\t\t\t\tobject.children.push( this.children[ i ].toJSON( meta ).object );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.animations.length > 0 ) {\n\n\t\t\tobject.animations = [];\n\n\t\t\tfor ( let i = 0; i < this.animations.length; i ++ ) {\n\n\t\t\t\tconst animation = this.animations[ i ];\n\n\t\t\t\tobject.animations.push( serialize( meta.animations, animation ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst geometries = extractFromCache( meta.geometries );\n\t\t\tconst materials = extractFromCache( meta.materials );\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\t\t\tconst shapes = extractFromCache( meta.shapes );\n\t\t\tconst skeletons = extractFromCache( meta.skeletons );\n\t\t\tconst animations = extractFromCache( meta.animations );\n\n\t\t\tif ( geometries.length > 0 ) output.geometries = geometries;\n\t\t\tif ( materials.length > 0 ) output.materials = materials;\n\t\t\tif ( textures.length > 0 ) output.textures = textures;\n\t\t\tif ( images.length > 0 ) output.images = images;\n\t\t\tif ( shapes.length > 0 ) output.shapes = shapes;\n\t\t\tif ( skeletons.length > 0 ) output.skeletons = skeletons;\n\t\t\tif ( animations.length > 0 ) output.animations = animations;\n\n\t\t}\n\n\t\toutput.object = object;\n\n\t\treturn output;\n\n\t\t// extract data from the cache hash\n\t\t// remove metadata on each item\n\t\t// and return as array\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t}\n\n\tclone( recursive ) {\n\n\t\treturn new this.constructor().copy( this, recursive );\n\n\t}\n\n\tcopy( source, recursive = true ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.up.copy( source.up );\n\n\t\tthis.position.copy( source.position );\n\t\tthis.rotation.order = source.rotation.order;\n\t\tthis.quaternion.copy( source.quaternion );\n\t\tthis.scale.copy( source.scale );\n\n\t\tthis.matrix.copy( source.matrix );\n\t\tthis.matrixWorld.copy( source.matrixWorld );\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\n\t\tthis.layers.mask = source.layers.mask;\n\t\tthis.visible = source.visible;\n\n\t\tthis.castShadow = source.castShadow;\n\t\tthis.receiveShadow = source.receiveShadow;\n\n\t\tthis.frustumCulled = source.frustumCulled;\n\t\tthis.renderOrder = source.renderOrder;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tif ( recursive === true ) {\n\n\t\t\tfor ( let i = 0; i < source.children.length; i ++ ) {\n\n\t\t\t\tconst child = source.children[ i ];\n\t\t\t\tthis.add( child.clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nObject3D.DefaultUp = new Vector3( 0, 1, 0 );\nObject3D.DefaultMatrixAutoUpdate = true;\n\nObject3D.prototype.isObject3D = true;\n\nconst _v0$1 = /*@__PURE__*/ new Vector3();\nconst _v1$3 = /*@__PURE__*/ new Vector3();\nconst _v2$2 = /*@__PURE__*/ new Vector3();\nconst _v3$1 = /*@__PURE__*/ new Vector3();\n\nconst _vab = /*@__PURE__*/ new Vector3();\nconst _vac = /*@__PURE__*/ new Vector3();\nconst _vbc = /*@__PURE__*/ new Vector3();\nconst _vap = /*@__PURE__*/ new Vector3();\nconst _vbp = /*@__PURE__*/ new Vector3();\nconst _vcp = /*@__PURE__*/ new Vector3();\n\nclass Triangle {\n\n\tconstructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {\n\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\n\t}\n\n\tstatic getNormal( a, b, c, target ) {\n\n\t\ttarget.subVectors( c, b );\n\t\t_v0$1.subVectors( a, b );\n\t\ttarget.cross( _v0$1 );\n\n\t\tconst targetLengthSq = target.lengthSq();\n\t\tif ( targetLengthSq > 0 ) {\n\n\t\t\treturn target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) );\n\n\t\t}\n\n\t\treturn target.set( 0, 0, 0 );\n\n\t}\n\n\t// static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\tstatic getBarycoord( point, a, b, c, target ) {\n\n\t\t_v0$1.subVectors( c, a );\n\t\t_v1$3.subVectors( b, a );\n\t\t_v2$2.subVectors( point, a );\n\n\t\tconst dot00 = _v0$1.dot( _v0$1 );\n\t\tconst dot01 = _v0$1.dot( _v1$3 );\n\t\tconst dot02 = _v0$1.dot( _v2$2 );\n\t\tconst dot11 = _v1$3.dot( _v1$3 );\n\t\tconst dot12 = _v1$3.dot( _v2$2 );\n\n\t\tconst denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t// collinear or singular triangle\n\t\tif ( denom === 0 ) {\n\n\t\t\t// arbitrary location outside of triangle?\n\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\treturn target.set( - 2, - 1, - 1 );\n\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\tconst v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t// barycentric coordinates must always sum to 1\n\t\treturn target.set( 1 - u - v, v, u );\n\n\t}\n\n\tstatic containsPoint( point, a, b, c ) {\n\n\t\tthis.getBarycoord( point, a, b, c, _v3$1 );\n\n\t\treturn ( _v3$1.x >= 0 ) && ( _v3$1.y >= 0 ) && ( ( _v3$1.x + _v3$1.y ) <= 1 );\n\n\t}\n\n\tstatic getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) {\n\n\t\tthis.getBarycoord( point, p1, p2, p3, _v3$1 );\n\n\t\ttarget.set( 0, 0 );\n\t\ttarget.addScaledVector( uv1, _v3$1.x );\n\t\ttarget.addScaledVector( uv2, _v3$1.y );\n\t\ttarget.addScaledVector( uv3, _v3$1.z );\n\n\t\treturn target;\n\n\t}\n\n\tstatic isFrontFacing( a, b, c, direction ) {\n\n\t\t_v0$1.subVectors( c, b );\n\t\t_v1$3.subVectors( a, b );\n\n\t\t// strictly front facing\n\t\treturn ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false;\n\n\t}\n\n\tset( a, b, c ) {\n\n\t\tthis.a.copy( a );\n\t\tthis.b.copy( b );\n\t\tthis.c.copy( c );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPointsAndIndices( points, i0, i1, i2 ) {\n\n\t\tthis.a.copy( points[ i0 ] );\n\t\tthis.b.copy( points[ i1 ] );\n\t\tthis.c.copy( points[ i2 ] );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\n\t\tthis.a.fromBufferAttribute( attribute, i0 );\n\t\tthis.b.fromBufferAttribute( attribute, i1 );\n\t\tthis.c.fromBufferAttribute( attribute, i2 );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( triangle ) {\n\n\t\tthis.a.copy( triangle.a );\n\t\tthis.b.copy( triangle.b );\n\t\tthis.c.copy( triangle.c );\n\n\t\treturn this;\n\n\t}\n\n\tgetArea() {\n\n\t\t_v0$1.subVectors( this.c, this.b );\n\t\t_v1$3.subVectors( this.a, this.b );\n\n\t\treturn _v0$1.cross( _v1$3 ).length() * 0.5;\n\n\t}\n\n\tgetMidpoint( target ) {\n\n\t\treturn target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t}\n\n\tgetNormal( target ) {\n\n\t\treturn Triangle.getNormal( this.a, this.b, this.c, target );\n\n\t}\n\n\tgetPlane( target ) {\n\n\t\treturn target.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t}\n\n\tgetBarycoord( point, target ) {\n\n\t\treturn Triangle.getBarycoord( point, this.a, this.b, this.c, target );\n\n\t}\n\n\tgetUV( point, uv1, uv2, uv3, target ) {\n\n\t\treturn Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, target );\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t}\n\n\tisFrontFacing( direction ) {\n\n\t\treturn Triangle.isFrontFacing( this.a, this.b, this.c, direction );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsTriangle( this );\n\n\t}\n\n\tclosestPointToPoint( p, target ) {\n\n\t\tconst a = this.a, b = this.b, c = this.c;\n\t\tlet v, w;\n\n\t\t// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors( b, a );\n\t\t_vac.subVectors( c, a );\n\t\t_vap.subVectors( p, a );\n\t\tconst d1 = _vab.dot( _vap );\n\t\tconst d2 = _vac.dot( _vap );\n\t\tif ( d1 <= 0 && d2 <= 0 ) {\n\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy( a );\n\n\t\t}\n\n\t\t_vbp.subVectors( p, b );\n\t\tconst d3 = _vab.dot( _vbp );\n\t\tconst d4 = _vac.dot( _vbp );\n\t\tif ( d3 >= 0 && d4 <= d3 ) {\n\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy( b );\n\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\t\tif ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {\n\n\t\t\tv = d1 / ( d1 - d3 );\n\t\t\t// edge region of AB; barycentric coords (1-v, v, 0)\n\t\t\treturn target.copy( a ).addScaledVector( _vab, v );\n\n\t\t}\n\n\t\t_vcp.subVectors( p, c );\n\t\tconst d5 = _vab.dot( _vcp );\n\t\tconst d6 = _vac.dot( _vcp );\n\t\tif ( d6 >= 0 && d5 <= d6 ) {\n\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy( c );\n\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\t\tif ( vb <= 0 && d2 >= 0 && d6 <= 0 ) {\n\n\t\t\tw = d2 / ( d2 - d6 );\n\t\t\t// edge region of AC; barycentric coords (1-w, 0, w)\n\t\t\treturn target.copy( a ).addScaledVector( _vac, w );\n\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\t\tif ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) {\n\n\t\t\t_vbc.subVectors( c, b );\n\t\t\tw = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) );\n\t\t\t// edge region of BC; barycentric coords (0, 1-w, w)\n\t\t\treturn target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC\n\n\t\t}\n\n\t\t// face region\n\t\tconst denom = 1 / ( va + vb + vc );\n\t\t// u = va * denom\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\n\t\treturn target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w );\n\n\t}\n\n\tequals( triangle ) {\n\n\t\treturn triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );\n\n\t}\n\n}\n\nlet materialId = 0;\n\nclass Material extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tObject.defineProperty( this, 'id', { value: materialId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Material';\n\n\t\tthis.fog = true;\n\n\t\tthis.blending = NormalBlending;\n\t\tthis.side = FrontSide;\n\t\tthis.vertexColors = false;\n\n\t\tthis.opacity = 1;\n\t\tthis.transparent = false;\n\n\t\tthis.blendSrc = SrcAlphaFactor;\n\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\t\tthis.blendEquation = AddEquation;\n\t\tthis.blendSrcAlpha = null;\n\t\tthis.blendDstAlpha = null;\n\t\tthis.blendEquationAlpha = null;\n\n\t\tthis.depthFunc = LessEqualDepth;\n\t\tthis.depthTest = true;\n\t\tthis.depthWrite = true;\n\n\t\tthis.stencilWriteMask = 0xff;\n\t\tthis.stencilFunc = AlwaysStencilFunc;\n\t\tthis.stencilRef = 0;\n\t\tthis.stencilFuncMask = 0xff;\n\t\tthis.stencilFail = KeepStencilOp;\n\t\tthis.stencilZFail = KeepStencilOp;\n\t\tthis.stencilZPass = KeepStencilOp;\n\t\tthis.stencilWrite = false;\n\n\t\tthis.clippingPlanes = null;\n\t\tthis.clipIntersection = false;\n\t\tthis.clipShadows = false;\n\n\t\tthis.shadowSide = null;\n\n\t\tthis.colorWrite = true;\n\n\t\tthis.precision = null; // override the renderer's default precision for this material\n\n\t\tthis.polygonOffset = false;\n\t\tthis.polygonOffsetFactor = 0;\n\t\tthis.polygonOffsetUnits = 0;\n\n\t\tthis.dithering = false;\n\n\t\tthis.alphaToCoverage = false;\n\t\tthis.premultipliedAlpha = false;\n\n\t\tthis.visible = true;\n\n\t\tthis.toneMapped = true;\n\n\t\tthis.userData = {};\n\n\t\tthis.version = 0;\n\n\t\tthis._alphaTest = 0;\n\n\t}\n\n\tget alphaTest() {\n\n\t\treturn this._alphaTest;\n\n\t}\n\n\tset alphaTest( value ) {\n\n\t\tif ( this._alphaTest > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._alphaTest = value;\n\n\t}\n\n\tonBuild( /* shaderobject, renderer */ ) {}\n\n\tonBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}\n\n\tonBeforeCompile( /* shaderobject, renderer */ ) {}\n\n\tcustomProgramCacheKey() {\n\n\t\treturn this.onBeforeCompile.toString();\n\n\t}\n\n\tsetValues( values ) {\n\n\t\tif ( values === undefined ) return;\n\n\t\tfor ( const key in values ) {\n\n\t\t\tconst newValue = values[ key ];\n\n\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Material: \\'' + key + '\\' parameter is undefined.' );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\t// for backward compatability if shading is set in the constructor\n\t\t\tif ( key === 'shading' ) {\n\n\t\t\t\tconsole.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );\n\t\t\t\tthis.flatShading = ( newValue === FlatShading ) ? true : false;\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValue = this[ key ];\n\n\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.' + this.type + ': \\'' + key + '\\' is not a property of this material.' );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( currentValue && currentValue.isColor ) {\n\n\t\t\t\tcurrentValue.set( newValue );\n\n\t\t\t} else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else {\n\n\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRoot = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( isRoot ) {\n\n\t\t\tmeta = {\n\t\t\t\ttextures: {},\n\t\t\t\timages: {}\n\t\t\t};\n\n\t\t}\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.5,\n\t\t\t\ttype: 'Material',\n\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard Material serialization\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\tif ( this.color && this.color.isColor ) data.color = this.color.getHex();\n\n\t\tif ( this.roughness !== undefined ) data.roughness = this.roughness;\n\t\tif ( this.metalness !== undefined ) data.metalness = this.metalness;\n\n\t\tif ( this.sheen !== undefined ) data.sheen = this.sheen;\n\t\tif ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();\n\t\tif ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;\n\t\tif ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();\n\t\tif ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;\n\n\t\tif ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();\n\t\tif ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;\n\t\tif ( this.specularColor && this.specularColor.isColor ) data.specularColor = this.specularColor.getHex();\n\t\tif ( this.shininess !== undefined ) data.shininess = this.shininess;\n\t\tif ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat;\n\t\tif ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness;\n\n\t\tif ( this.clearcoatMap && this.clearcoatMap.isTexture ) {\n\n\t\t\tdata.clearcoatMap = this.clearcoatMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture ) {\n\n\t\t\tdata.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) {\n\n\t\t\tdata.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid;\n\t\t\tdata.clearcoatNormalScale = this.clearcoatNormalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;\n\t\tif ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;\n\t\tif ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;\n\n\t\tif ( this.lightMap && this.lightMap.isTexture ) {\n\n\t\t\tdata.lightMap = this.lightMap.toJSON( meta ).uuid;\n\t\t\tdata.lightMapIntensity = this.lightMapIntensity;\n\n\t\t}\n\n\t\tif ( this.aoMap && this.aoMap.isTexture ) {\n\n\t\t\tdata.aoMap = this.aoMap.toJSON( meta ).uuid;\n\t\t\tdata.aoMapIntensity = this.aoMapIntensity;\n\n\t\t}\n\n\t\tif ( this.bumpMap && this.bumpMap.isTexture ) {\n\n\t\t\tdata.bumpMap = this.bumpMap.toJSON( meta ).uuid;\n\t\t\tdata.bumpScale = this.bumpScale;\n\n\t\t}\n\n\t\tif ( this.normalMap && this.normalMap.isTexture ) {\n\n\t\t\tdata.normalMap = this.normalMap.toJSON( meta ).uuid;\n\t\t\tdata.normalMapType = this.normalMapType;\n\t\t\tdata.normalScale = this.normalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.displacementMap && this.displacementMap.isTexture ) {\n\n\t\t\tdata.displacementMap = this.displacementMap.toJSON( meta ).uuid;\n\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\tdata.displacementBias = this.displacementBias;\n\n\t\t}\n\n\t\tif ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid;\n\t\tif ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid;\n\n\t\tif ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid;\n\t\tif ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid;\n\t\tif ( this.specularIntensityMap && this.specularIntensityMap.isTexture ) data.specularIntensityMap = this.specularIntensityMap.toJSON( meta ).uuid;\n\t\tif ( this.specularColorMap && this.specularColorMap.isTexture ) data.specularColorMap = this.specularColorMap.toJSON( meta ).uuid;\n\n\t\tif ( this.envMap && this.envMap.isTexture ) {\n\n\t\t\tdata.envMap = this.envMap.toJSON( meta ).uuid;\n\n\t\t\tif ( this.combine !== undefined ) data.combine = this.combine;\n\n\t\t}\n\n\t\tif ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;\n\t\tif ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;\n\t\tif ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;\n\n\t\tif ( this.gradientMap && this.gradientMap.isTexture ) {\n\n\t\t\tdata.gradientMap = this.gradientMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.transmission !== undefined ) data.transmission = this.transmission;\n\t\tif ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid;\n\t\tif ( this.thickness !== undefined ) data.thickness = this.thickness;\n\t\tif ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid;\n\t\tif ( this.attenuationDistance !== undefined ) data.attenuationDistance = this.attenuationDistance;\n\t\tif ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex();\n\n\t\tif ( this.size !== undefined ) data.size = this.size;\n\t\tif ( this.shadowSide !== null ) data.shadowSide = this.shadowSide;\n\t\tif ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;\n\n\t\tif ( this.blending !== NormalBlending ) data.blending = this.blending;\n\t\tif ( this.side !== FrontSide ) data.side = this.side;\n\t\tif ( this.vertexColors ) data.vertexColors = true;\n\n\t\tif ( this.opacity < 1 ) data.opacity = this.opacity;\n\t\tif ( this.transparent === true ) data.transparent = this.transparent;\n\n\t\tdata.depthFunc = this.depthFunc;\n\t\tdata.depthTest = this.depthTest;\n\t\tdata.depthWrite = this.depthWrite;\n\t\tdata.colorWrite = this.colorWrite;\n\n\t\tdata.stencilWrite = this.stencilWrite;\n\t\tdata.stencilWriteMask = this.stencilWriteMask;\n\t\tdata.stencilFunc = this.stencilFunc;\n\t\tdata.stencilRef = this.stencilRef;\n\t\tdata.stencilFuncMask = this.stencilFuncMask;\n\t\tdata.stencilFail = this.stencilFail;\n\t\tdata.stencilZFail = this.stencilZFail;\n\t\tdata.stencilZPass = this.stencilZPass;\n\n\t\t// rotation (SpriteMaterial)\n\t\tif ( this.rotation && this.rotation !== 0 ) data.rotation = this.rotation;\n\n\t\tif ( this.polygonOffset === true ) data.polygonOffset = true;\n\t\tif ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor;\n\t\tif ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;\n\n\t\tif ( this.linewidth && this.linewidth !== 1 ) data.linewidth = this.linewidth;\n\t\tif ( this.dashSize !== undefined ) data.dashSize = this.dashSize;\n\t\tif ( this.gapSize !== undefined ) data.gapSize = this.gapSize;\n\t\tif ( this.scale !== undefined ) data.scale = this.scale;\n\n\t\tif ( this.dithering === true ) data.dithering = true;\n\n\t\tif ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;\n\t\tif ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage;\n\t\tif ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;\n\n\t\tif ( this.wireframe === true ) data.wireframe = this.wireframe;\n\t\tif ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\tif ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;\n\t\tif ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;\n\n\t\tif ( this.flatShading === true ) data.flatShading = this.flatShading;\n\n\t\tif ( this.visible === false ) data.visible = false;\n\n\t\tif ( this.toneMapped === false ) data.toneMapped = false;\n\n\t\tif ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;\n\n\t\t// TODO: Copied from Object3D.toJSON\n\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t\tif ( isRoot ) {\n\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\n\t\t\tif ( textures.length > 0 ) data.textures = textures;\n\t\t\tif ( images.length > 0 ) data.images = images;\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.fog = source.fog;\n\n\t\tthis.blending = source.blending;\n\t\tthis.side = source.side;\n\t\tthis.vertexColors = source.vertexColors;\n\n\t\tthis.opacity = source.opacity;\n\t\tthis.transparent = source.transparent;\n\n\t\tthis.blendSrc = source.blendSrc;\n\t\tthis.blendDst = source.blendDst;\n\t\tthis.blendEquation = source.blendEquation;\n\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\n\t\tthis.depthFunc = source.depthFunc;\n\t\tthis.depthTest = source.depthTest;\n\t\tthis.depthWrite = source.depthWrite;\n\n\t\tthis.stencilWriteMask = source.stencilWriteMask;\n\t\tthis.stencilFunc = source.stencilFunc;\n\t\tthis.stencilRef = source.stencilRef;\n\t\tthis.stencilFuncMask = source.stencilFuncMask;\n\t\tthis.stencilFail = source.stencilFail;\n\t\tthis.stencilZFail = source.stencilZFail;\n\t\tthis.stencilZPass = source.stencilZPass;\n\t\tthis.stencilWrite = source.stencilWrite;\n\n\t\tconst srcPlanes = source.clippingPlanes;\n\t\tlet dstPlanes = null;\n\n\t\tif ( srcPlanes !== null ) {\n\n\t\t\tconst n = srcPlanes.length;\n\t\t\tdstPlanes = new Array( n );\n\n\t\t\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\t\t\tdstPlanes[ i ] = srcPlanes[ i ].clone();\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.clippingPlanes = dstPlanes;\n\t\tthis.clipIntersection = source.clipIntersection;\n\t\tthis.clipShadows = source.clipShadows;\n\n\t\tthis.shadowSide = source.shadowSide;\n\n\t\tthis.colorWrite = source.colorWrite;\n\n\t\tthis.precision = source.precision;\n\n\t\tthis.polygonOffset = source.polygonOffset;\n\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\n\t\tthis.dithering = source.dithering;\n\n\t\tthis.alphaTest = source.alphaTest;\n\t\tthis.alphaToCoverage = source.alphaToCoverage;\n\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\n\t\tthis.visible = source.visible;\n\n\t\tthis.toneMapped = source.toneMapped;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n}\n\nMaterial.prototype.isMaterial = true;\n\n/**\n * parameters = {\n * color: ,\n * opacity: ,\n * map: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * specularMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n * combine: THREE.Multiply,\n * reflectivity: ,\n * refractionRatio: ,\n *\n * depthTest: ,\n * depthWrite: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n * }\n */\n\nclass MeshBasicMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'MeshBasicMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // emissive\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshBasicMaterial.prototype.isMeshBasicMaterial = true;\n\nconst _vector$9 = /*@__PURE__*/ new Vector3();\nconst _vector2$1 = /*@__PURE__*/ new Vector2();\n\nclass BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tif ( Array.isArray( array ) ) {\n\n\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t}\n\n\t\tthis.name = '';\n\n\t\tthis.array = array;\n\t\tthis.itemSize = itemSize;\n\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\t\tthis.normalized = normalized === true;\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis.updateRange = { offset: 0, count: - 1 };\n\n\t\tthis.version = 0;\n\n\t}\n\n\tonUploadCallback() {}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.itemSize = source.itemSize;\n\t\tthis.count = source.count;\n\t\tthis.normalized = source.normalized;\n\n\t\tthis.usage = source.usage;\n\n\t\treturn this;\n\n\t}\n\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.itemSize;\n\t\tindex2 *= attribute.itemSize;\n\n\t\tfor ( let i = 0, l = this.itemSize; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcopyArray( array ) {\n\n\t\tthis.array.set( array );\n\n\t\treturn this;\n\n\t}\n\n\tcopyColorsArray( colors ) {\n\n\t\tconst array = this.array;\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0, l = colors.length; i < l; i ++ ) {\n\n\t\t\tlet color = colors[ i ];\n\n\t\t\tif ( color === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', i );\n\t\t\t\tcolor = new Color();\n\n\t\t\t}\n\n\t\t\tarray[ offset ++ ] = color.r;\n\t\t\tarray[ offset ++ ] = color.g;\n\t\t\tarray[ offset ++ ] = color.b;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcopyVector2sArray( vectors ) {\n\n\t\tconst array = this.array;\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0, l = vectors.length; i < l; i ++ ) {\n\n\t\t\tlet vector = vectors[ i ];\n\n\t\t\tif ( vector === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i );\n\t\t\t\tvector = new Vector2();\n\n\t\t\t}\n\n\t\t\tarray[ offset ++ ] = vector.x;\n\t\t\tarray[ offset ++ ] = vector.y;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcopyVector3sArray( vectors ) {\n\n\t\tconst array = this.array;\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0, l = vectors.length; i < l; i ++ ) {\n\n\t\t\tlet vector = vectors[ i ];\n\n\t\t\tif ( vector === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i );\n\t\t\t\tvector = new Vector3();\n\n\t\t\t}\n\n\t\t\tarray[ offset ++ ] = vector.x;\n\t\t\tarray[ offset ++ ] = vector.y;\n\t\t\tarray[ offset ++ ] = vector.z;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcopyVector4sArray( vectors ) {\n\n\t\tconst array = this.array;\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0, l = vectors.length; i < l; i ++ ) {\n\n\t\t\tlet vector = vectors[ i ];\n\n\t\t\tif ( vector === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i );\n\t\t\t\tvector = new Vector4();\n\n\t\t\t}\n\n\t\t\tarray[ offset ++ ] = vector.x;\n\t\t\tarray[ offset ++ ] = vector.y;\n\t\t\tarray[ offset ++ ] = vector.z;\n\t\t\tarray[ offset ++ ] = vector.w;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tif ( this.itemSize === 2 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector2$1.fromBufferAttribute( this, i );\n\t\t\t\t_vector2$1.applyMatrix3( m );\n\n\t\t\t\tthis.setXY( i, _vector2$1.x, _vector2$1.y );\n\n\t\t\t}\n\n\t\t} else if ( this.itemSize === 3 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector$9.fromBufferAttribute( this, i );\n\t\t\t\t_vector$9.applyMatrix3( m );\n\n\t\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.x = this.getX( i );\n\t\t\t_vector$9.y = this.getY( i );\n\t\t\t_vector$9.z = this.getZ( i );\n\n\t\t\t_vector$9.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.x = this.getX( i );\n\t\t\t_vector$9.y = this.getY( i );\n\t\t\t_vector$9.z = this.getZ( i );\n\n\t\t\t_vector$9.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.x = this.getX( i );\n\t\t\t_vector$9.y = this.getY( i );\n\t\t\t_vector$9.z = this.getZ( i );\n\n\t\t\t_vector$9.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tset( value, offset = 0 ) {\n\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\tgetX( index ) {\n\n\t\treturn this.array[ index * this.itemSize ];\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tthis.array[ index * this.itemSize ] = x;\n\n\t\treturn this;\n\n\t}\n\n\tgetY( index ) {\n\n\t\treturn this.array[ index * this.itemSize + 1 ];\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tthis.array[ index * this.itemSize + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\treturn this.array[ index * this.itemSize + 2 ];\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tthis.array[ index * this.itemSize + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tgetW( index ) {\n\n\t\treturn this.array[ index * this.itemSize + 3 ];\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tthis.array[ index * this.itemSize + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\t\tthis.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.array, this.itemSize ).copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\titemSize: this.itemSize,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tarray: Array.prototype.slice.call( this.array ),\n\t\t\tnormalized: this.normalized\n\t\t};\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( this.usage !== StaticDrawUsage ) data.usage = this.usage;\n\t\tif ( this.updateRange.offset !== 0 || this.updateRange.count !== - 1 ) data.updateRange = this.updateRange;\n\n\t\treturn data;\n\n\t}\n\n}\n\nBufferAttribute.prototype.isBufferAttribute = true;\n\n//\n\nclass Int8BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint8BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint8ClampedBufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8ClampedArray( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Int16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Int32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Float16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nFloat16BufferAttribute.prototype.isFloat16BufferAttribute = true;\n\nclass Float32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Float32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Float64BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Float64Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nlet _id$1 = 0;\n\nconst _m1 = /*@__PURE__*/ new Matrix4();\nconst _obj = /*@__PURE__*/ new Object3D();\nconst _offset = /*@__PURE__*/ new Vector3();\nconst _box$1 = /*@__PURE__*/ new Box3();\nconst _boxMorphTargets = /*@__PURE__*/ new Box3();\nconst _vector$8 = /*@__PURE__*/ new Vector3();\n\nclass BufferGeometry extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tObject.defineProperty( this, 'id', { value: _id$1 ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'BufferGeometry';\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\n\t\tthis.morphAttributes = {};\n\t\tthis.morphTargetsRelative = false;\n\n\t\tthis.groups = [];\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\tthis.drawRange = { start: 0, count: Infinity };\n\n\t\tthis.userData = {};\n\n\t}\n\n\tgetIndex() {\n\n\t\treturn this.index;\n\n\t}\n\n\tsetIndex( index ) {\n\n\t\tif ( Array.isArray( index ) ) {\n\n\t\t\tthis.index = new ( arrayNeedsUint32( index ) ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 );\n\n\t\t} else {\n\n\t\t\tthis.index = index;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetAttribute( name ) {\n\n\t\treturn this.attributes[ name ];\n\n\t}\n\n\tsetAttribute( name, attribute ) {\n\n\t\tthis.attributes[ name ] = attribute;\n\n\t\treturn this;\n\n\t}\n\n\tdeleteAttribute( name ) {\n\n\t\tdelete this.attributes[ name ];\n\n\t\treturn this;\n\n\t}\n\n\thasAttribute( name ) {\n\n\t\treturn this.attributes[ name ] !== undefined;\n\n\t}\n\n\taddGroup( start, count, materialIndex = 0 ) {\n\n\t\tthis.groups.push( {\n\n\t\t\tstart: start,\n\t\t\tcount: count,\n\t\t\tmaterialIndex: materialIndex\n\n\t\t} );\n\n\t}\n\n\tclearGroups() {\n\n\t\tthis.groups = [];\n\n\t}\n\n\tsetDrawRange( start, count ) {\n\n\t\tthis.drawRange.start = start;\n\t\tthis.drawRange.count = count;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tconst position = this.attributes.position;\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tposition.applyMatrix4( matrix );\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t}\n\n\t\tconst normal = this.attributes.normal;\n\n\t\tif ( normal !== undefined ) {\n\n\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\tnormal.applyNormalMatrix( normalMatrix );\n\n\t\t\tnormal.needsUpdate = true;\n\n\t\t}\n\n\t\tconst tangent = this.attributes.tangent;\n\n\t\tif ( tangent !== undefined ) {\n\n\t\t\ttangent.transformDirection( matrix );\n\n\t\t\ttangent.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\t_m1.makeRotationFromQuaternion( q );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateX( angle ) {\n\n\t\t// rotate geometry around world x-axis\n\n\t\t_m1.makeRotationX( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateY( angle ) {\n\n\t\t// rotate geometry around world y-axis\n\n\t\t_m1.makeRotationY( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateZ( angle ) {\n\n\t\t// rotate geometry around world z-axis\n\n\t\t_m1.makeRotationZ( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( x, y, z ) {\n\n\t\t// translate geometry\n\n\t\t_m1.makeTranslation( x, y, z );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\tscale( x, y, z ) {\n\n\t\t// scale geometry\n\n\t\t_m1.makeScale( x, y, z );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\tlookAt( vector ) {\n\n\t\t_obj.lookAt( vector );\n\n\t\t_obj.updateMatrix();\n\n\t\tthis.applyMatrix4( _obj.matrix );\n\n\t\treturn this;\n\n\t}\n\n\tcenter() {\n\n\t\tthis.computeBoundingBox();\n\n\t\tthis.boundingBox.getCenter( _offset ).negate();\n\n\t\tthis.translate( _offset.x, _offset.y, _offset.z );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tconst position = [];\n\n\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\tconst point = points[ i ];\n\t\t\tposition.push( point.x, point.y, point.z || 0 );\n\n\t\t}\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) );\n\n\t\treturn this;\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set \"mesh.frustumCulled\" to \"false\".', this );\n\n\t\t\tthis.boundingBox.set(\n\t\t\t\tnew Vector3( - Infinity, - Infinity, - Infinity ),\n\t\t\t\tnew Vector3( + Infinity, + Infinity, + Infinity )\n\t\t\t);\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tthis.boundingBox.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_box$1.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.min, _box$1.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.max, _box$1.max );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$1.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$1.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.boundingBox.makeEmpty();\n\n\t\t}\n\n\t\tif ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set \"mesh.frustumCulled\" to \"false\".', this );\n\n\t\t\tthis.boundingSphere.set( new Vector3(), Infinity );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position ) {\n\n\t\t\t// first, find the center of the bounding sphere\n\n\t\t\tconst center = this.boundingSphere.center;\n\n\t\t\t_box$1.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_boxMorphTargets.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$1.min, _boxMorphTargets.min );\n\t\t\t\t\t\t_box$1.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$1.max, _boxMorphTargets.max );\n\t\t\t\t\t\t_box$1.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_box$1.expandByPoint( _boxMorphTargets.min );\n\t\t\t\t\t\t_box$1.expandByPoint( _boxMorphTargets.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_box$1.getCenter( center );\n\n\t\t\t// second, try to find a boundingSphere with a radius smaller than the\n\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\t\t\tlet maxRadiusSq = 0;\n\n\t\t\tfor ( let i = 0, il = position.count; i < il; i ++ ) {\n\n\t\t\t\t_vector$8.fromBufferAttribute( position, i );\n\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t}\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\tconst morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t\t\t\tfor ( let j = 0, jl = morphAttribute.count; j < jl; j ++ ) {\n\n\t\t\t\t\t\t_vector$8.fromBufferAttribute( morphAttribute, j );\n\n\t\t\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t\t\t_offset.fromBufferAttribute( position, j );\n\t\t\t\t\t\t\t_vector$8.add( _offset );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcomputeTangents() {\n\n\t\tconst index = this.index;\n\t\tconst attributes = this.attributes;\n\n\t\t// based on http://www.terathon.com/code/tangent.html\n\t\t// (per vertex tangents)\n\n\t\tif ( index === null ||\n\t\t\t attributes.position === undefined ||\n\t\t\t attributes.normal === undefined ||\n\t\t\t attributes.uv === undefined ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst indices = index.array;\n\t\tconst positions = attributes.position.array;\n\t\tconst normals = attributes.normal.array;\n\t\tconst uvs = attributes.uv.array;\n\n\t\tconst nVertices = positions.length / 3;\n\n\t\tif ( attributes.tangent === undefined ) {\n\n\t\t\tthis.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );\n\n\t\t}\n\n\t\tconst tangents = attributes.tangent.array;\n\n\t\tconst tan1 = [], tan2 = [];\n\n\t\tfor ( let i = 0; i < nVertices; i ++ ) {\n\n\t\t\ttan1[ i ] = new Vector3();\n\t\t\ttan2[ i ] = new Vector3();\n\n\t\t}\n\n\t\tconst vA = new Vector3(),\n\t\t\tvB = new Vector3(),\n\t\t\tvC = new Vector3(),\n\n\t\t\tuvA = new Vector2(),\n\t\t\tuvB = new Vector2(),\n\t\t\tuvC = new Vector2(),\n\n\t\t\tsdir = new Vector3(),\n\t\t\ttdir = new Vector3();\n\n\t\tfunction handleTriangle( a, b, c ) {\n\n\t\t\tvA.fromArray( positions, a * 3 );\n\t\t\tvB.fromArray( positions, b * 3 );\n\t\t\tvC.fromArray( positions, c * 3 );\n\n\t\t\tuvA.fromArray( uvs, a * 2 );\n\t\t\tuvB.fromArray( uvs, b * 2 );\n\t\t\tuvC.fromArray( uvs, c * 2 );\n\n\t\t\tvB.sub( vA );\n\t\t\tvC.sub( vA );\n\n\t\t\tuvB.sub( uvA );\n\t\t\tuvC.sub( uvA );\n\n\t\t\tconst r = 1.0 / ( uvB.x * uvC.y - uvC.x * uvB.y );\n\n\t\t\t// silently ignore degenerate uv triangles having coincident or colinear vertices\n\n\t\t\tif ( ! isFinite( r ) ) return;\n\n\t\t\tsdir.copy( vB ).multiplyScalar( uvC.y ).addScaledVector( vC, - uvB.y ).multiplyScalar( r );\n\t\t\ttdir.copy( vC ).multiplyScalar( uvB.x ).addScaledVector( vB, - uvC.x ).multiplyScalar( r );\n\n\t\t\ttan1[ a ].add( sdir );\n\t\t\ttan1[ b ].add( sdir );\n\t\t\ttan1[ c ].add( sdir );\n\n\t\t\ttan2[ a ].add( tdir );\n\t\t\ttan2[ b ].add( tdir );\n\t\t\ttan2[ c ].add( tdir );\n\n\t\t}\n\n\t\tlet groups = this.groups;\n\n\t\tif ( groups.length === 0 ) {\n\n\t\t\tgroups = [ {\n\t\t\t\tstart: 0,\n\t\t\t\tcount: indices.length\n\t\t\t} ];\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleTriangle(\n\t\t\t\t\tindices[ j + 0 ],\n\t\t\t\t\tindices[ j + 1 ],\n\t\t\t\t\tindices[ j + 2 ]\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst tmp = new Vector3(), tmp2 = new Vector3();\n\t\tconst n = new Vector3(), n2 = new Vector3();\n\n\t\tfunction handleVertex( v ) {\n\n\t\t\tn.fromArray( normals, v * 3 );\n\t\t\tn2.copy( n );\n\n\t\t\tconst t = tan1[ v ];\n\n\t\t\t// Gram-Schmidt orthogonalize\n\n\t\t\ttmp.copy( t );\n\t\t\ttmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize();\n\n\t\t\t// Calculate handedness\n\n\t\t\ttmp2.crossVectors( n2, t );\n\t\t\tconst test = tmp2.dot( tan2[ v ] );\n\t\t\tconst w = ( test < 0.0 ) ? - 1.0 : 1.0;\n\n\t\t\ttangents[ v * 4 ] = tmp.x;\n\t\t\ttangents[ v * 4 + 1 ] = tmp.y;\n\t\t\ttangents[ v * 4 + 2 ] = tmp.z;\n\t\t\ttangents[ v * 4 + 3 ] = w;\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleVertex( indices[ j + 0 ] );\n\t\t\t\thandleVertex( indices[ j + 1 ] );\n\t\t\t\thandleVertex( indices[ j + 2 ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcomputeVertexNormals() {\n\n\t\tconst index = this.index;\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute !== undefined ) {\n\n\t\t\tlet normalAttribute = this.getAttribute( 'normal' );\n\n\t\t\tif ( normalAttribute === undefined ) {\n\n\t\t\t\tnormalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );\n\t\t\t\tthis.setAttribute( 'normal', normalAttribute );\n\n\t\t\t} else {\n\n\t\t\t\t// reset existing normals to zero\n\n\t\t\t\tfor ( let i = 0, il = normalAttribute.count; i < il; i ++ ) {\n\n\t\t\t\t\tnormalAttribute.setXYZ( i, 0, 0, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst pA = new Vector3(), pB = new Vector3(), pC = new Vector3();\n\t\t\tconst nA = new Vector3(), nB = new Vector3(), nC = new Vector3();\n\t\t\tconst cb = new Vector3(), ab = new Vector3();\n\n\t\t\t// indexed elements\n\n\t\t\tif ( index ) {\n\n\t\t\t\tfor ( let i = 0, il = index.count; i < il; i += 3 ) {\n\n\t\t\t\t\tconst vA = index.getX( i + 0 );\n\t\t\t\t\tconst vB = index.getX( i + 1 );\n\t\t\t\t\tconst vC = index.getX( i + 2 );\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, vA );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, vB );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, vC );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnA.fromBufferAttribute( normalAttribute, vA );\n\t\t\t\t\tnB.fromBufferAttribute( normalAttribute, vB );\n\t\t\t\t\tnC.fromBufferAttribute( normalAttribute, vC );\n\n\t\t\t\t\tnA.add( cb );\n\t\t\t\t\tnB.add( cb );\n\t\t\t\t\tnC.add( cb );\n\n\t\t\t\t\tnormalAttribute.setXYZ( vA, nA.x, nA.y, nA.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vB, nB.x, nB.y, nB.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vC, nC.x, nC.y, nC.z );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\n\t\t\t\tfor ( let i = 0, il = positionAttribute.count; i < il; i += 3 ) {\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, i + 0 );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, i + 1 );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, i + 2 );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnormalAttribute.setXYZ( i + 0, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 1, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 2, cb.x, cb.y, cb.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.normalizeNormals();\n\n\t\t\tnormalAttribute.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tmerge( geometry, offset ) {\n\n\t\tif ( ! ( geometry && geometry.isBufferGeometry ) ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( offset === undefined ) {\n\n\t\t\toffset = 0;\n\n\t\t\tconsole.warn(\n\t\t\t\t'THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. '\n\t\t\t\t+ 'Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.'\n\t\t\t);\n\n\t\t}\n\n\t\tconst attributes = this.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tif ( geometry.attributes[ key ] === undefined ) continue;\n\n\t\t\tconst attribute1 = attributes[ key ];\n\t\t\tconst attributeArray1 = attribute1.array;\n\n\t\t\tconst attribute2 = geometry.attributes[ key ];\n\t\t\tconst attributeArray2 = attribute2.array;\n\n\t\t\tconst attributeOffset = attribute2.itemSize * offset;\n\t\t\tconst length = Math.min( attributeArray2.length, attributeArray1.length - attributeOffset );\n\n\t\t\tfor ( let i = 0, j = attributeOffset; i < length; i ++, j ++ ) {\n\n\t\t\t\tattributeArray1[ j ] = attributeArray2[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tnormalizeNormals() {\n\n\t\tconst normals = this.attributes.normal;\n\n\t\tfor ( let i = 0, il = normals.count; i < il; i ++ ) {\n\n\t\t\t_vector$8.fromBufferAttribute( normals, i );\n\n\t\t\t_vector$8.normalize();\n\n\t\t\tnormals.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z );\n\n\t\t}\n\n\t}\n\n\ttoNonIndexed() {\n\n\t\tfunction convertBufferAttribute( attribute, indices ) {\n\n\t\t\tconst array = attribute.array;\n\t\t\tconst itemSize = attribute.itemSize;\n\t\t\tconst normalized = attribute.normalized;\n\n\t\t\tconst array2 = new array.constructor( indices.length * itemSize );\n\n\t\t\tlet index = 0, index2 = 0;\n\n\t\t\tfor ( let i = 0, l = indices.length; i < l; i ++ ) {\n\n\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\tindex = indices[ i ] * attribute.data.stride + attribute.offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindex = indices[ i ] * itemSize;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let j = 0; j < itemSize; j ++ ) {\n\n\t\t\t\t\tarray2[ index2 ++ ] = array[ index ++ ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( array2, itemSize, normalized );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.index === null ) {\n\n\t\t\tconsole.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst geometry2 = new BufferGeometry();\n\n\t\tconst indices = this.index.array;\n\t\tconst attributes = this.attributes;\n\n\t\t// attributes\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\n\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\tgeometry2.setAttribute( name, newAttribute );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = this.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst morphArray = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, il = morphAttribute.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = morphAttribute[ i ];\n\n\t\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\t\tmorphArray.push( newAttribute );\n\n\t\t\t}\n\n\t\t\tgeometry2.morphAttributes[ name ] = morphArray;\n\n\t\t}\n\n\t\tgeometry2.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = this.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tgeometry2.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\treturn geometry2;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.5,\n\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard BufferGeometry serialization\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;\n\n\t\tif ( this.parameters !== undefined ) {\n\n\t\t\tconst parameters = this.parameters;\n\n\t\t\tfor ( const key in parameters ) {\n\n\t\t\t\tif ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\t// for simplicity the code assumes attributes are not shared across geometries, see #15811\n\n\t\tdata.data = { attributes: {} };\n\n\t\tconst index = this.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tdata.data.index = {\n\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\tarray: Array.prototype.slice.call( index.array )\n\t\t\t};\n\n\t\t}\n\n\t\tconst attributes = this.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\n\t\t\tdata.data.attributes[ key ] = attribute.toJSON( data.data );\n\n\t\t}\n\n\t\tconst morphAttributes = {};\n\t\tlet hasMorphAttributes = false;\n\n\t\tfor ( const key in this.morphAttributes ) {\n\n\t\t\tconst attributeArray = this.morphAttributes[ key ];\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = attributeArray[ i ];\n\n\t\t\t\tarray.push( attribute.toJSON( data.data ) );\n\n\t\t\t}\n\n\t\t\tif ( array.length > 0 ) {\n\n\t\t\t\tmorphAttributes[ key ] = array;\n\n\t\t\t\thasMorphAttributes = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( hasMorphAttributes ) {\n\n\t\t\tdata.data.morphAttributes = morphAttributes;\n\t\t\tdata.data.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t}\n\n\t\tconst groups = this.groups;\n\n\t\tif ( groups.length > 0 ) {\n\n\t\t\tdata.data.groups = JSON.parse( JSON.stringify( groups ) );\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tdata.data.boundingSphere = {\n\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\tradius: boundingSphere.radius\n\t\t\t};\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tclone() {\n\n\t\t return new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\t// reset\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\t\tthis.morphAttributes = {};\n\t\tthis.groups = [];\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\t// used for storing cloned, shared data\n\n\t\tconst data = {};\n\n\t\t// name\n\n\t\tthis.name = source.name;\n\n\t\t// index\n\n\t\tconst index = source.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tthis.setIndex( index.clone( data ) );\n\n\t\t}\n\n\t\t// attributes\n\n\t\tconst attributes = source.attributes;\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\t\t\tthis.setAttribute( name, attribute.clone( data ) );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = source.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, l = morphAttribute.length; i < l; i ++ ) {\n\n\t\t\t\tarray.push( morphAttribute[ i ].clone( data ) );\n\n\t\t\t}\n\n\t\t\tthis.morphAttributes[ name ] = array;\n\n\t\t}\n\n\t\tthis.morphTargetsRelative = source.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = source.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tthis.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\t// bounding box\n\n\t\tconst boundingBox = source.boundingBox;\n\n\t\tif ( boundingBox !== null ) {\n\n\t\t\tthis.boundingBox = boundingBox.clone();\n\n\t\t}\n\n\t\t// bounding sphere\n\n\t\tconst boundingSphere = source.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tthis.boundingSphere = boundingSphere.clone();\n\n\t\t}\n\n\t\t// draw range\n\n\t\tthis.drawRange.start = source.drawRange.start;\n\t\tthis.drawRange.count = source.drawRange.count;\n\n\t\t// user data\n\n\t\tthis.userData = source.userData;\n\n\t\t// geometry generator parameters\n\n\t\tif ( source.parameters !== undefined ) this.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nBufferGeometry.prototype.isBufferGeometry = true;\n\nconst _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();\nconst _ray$2 = /*@__PURE__*/ new Ray();\nconst _sphere$3 = /*@__PURE__*/ new Sphere();\n\nconst _vA$1 = /*@__PURE__*/ new Vector3();\nconst _vB$1 = /*@__PURE__*/ new Vector3();\nconst _vC$1 = /*@__PURE__*/ new Vector3();\n\nconst _tempA = /*@__PURE__*/ new Vector3();\nconst _tempB = /*@__PURE__*/ new Vector3();\nconst _tempC = /*@__PURE__*/ new Vector3();\n\nconst _morphA = /*@__PURE__*/ new Vector3();\nconst _morphB = /*@__PURE__*/ new Vector3();\nconst _morphC = /*@__PURE__*/ new Vector3();\n\nconst _uvA$1 = /*@__PURE__*/ new Vector2();\nconst _uvB$1 = /*@__PURE__*/ new Vector2();\nconst _uvC$1 = /*@__PURE__*/ new Vector2();\n\nconst _intersectionPoint = /*@__PURE__*/ new Vector3();\nconst _intersectionPointWorld = /*@__PURE__*/ new Vector3();\n\nclass Mesh extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Mesh';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tif ( source.morphTargetInfluences !== undefined ) {\n\n\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\n\t\t}\n\n\t\tif ( source.morphTargetDictionary !== undefined ) {\n\n\t\t\tthis.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );\n\n\t\t}\n\n\t\tthis.material = source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\tconst keys = Object.keys( morphAttributes );\n\n\t\t\tif ( keys.length > 0 ) {\n\n\t\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\tif ( morphTargets !== undefined && morphTargets.length > 0 ) {\n\n\t\t\t\tconsole.error( 'THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$3.copy( geometry.boundingSphere );\n\t\t_sphere$3.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix$2.copy( matrixWorld ).invert();\n\t\t_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );\n\n\t\t// Check boundingBox before continuing\n\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tif ( _ray$2.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\tlet intersection;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\t\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\t\t\tconst uv = geometry.attributes.uv;\n\t\t\tconst uv2 = geometry.attributes.uv2;\n\t\t\tconst groups = geometry.groups;\n\t\t\tconst drawRange = geometry.drawRange;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\t// indexed buffer geometry\n\n\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\t\tconst end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\t\tconst a = index.getX( j );\n\t\t\t\t\t\t\tconst b = index.getX( j + 1 );\n\t\t\t\t\t\t\tconst c = index.getX( j + 2 );\n\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );\n\n\t\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\t\tconst b = index.getX( i + 1 );\n\t\t\t\t\t\tconst c = index.getX( i + 2 );\n\n\t\t\t\t\t\tintersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( position !== undefined ) {\n\n\t\t\t\t// non-indexed buffer geometry\n\n\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\t\tconst end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\t\tconst c = j + 2;\n\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );\n\n\t\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\t\tconst end = Math.min( position.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\t\tconst a = i;\n\t\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\t\tconst c = i + 2;\n\n\t\t\t\t\t\tintersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( geometry.isGeometry ) {\n\n\t\t\tconsole.error( 'THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t}\n\n\t}\n\n}\n\nMesh.prototype.isMesh = true;\n\nfunction checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) {\n\n\tlet intersect;\n\n\tif ( material.side === BackSide ) {\n\n\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t} else {\n\n\t\tintersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point );\n\n\t}\n\n\tif ( intersect === null ) return null;\n\n\t_intersectionPointWorld.copy( point );\n\t_intersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return null;\n\n\treturn {\n\t\tdistance: distance,\n\t\tpoint: _intersectionPointWorld.clone(),\n\t\tobject: object\n\t};\n\n}\n\nfunction checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c ) {\n\n\t_vA$1.fromBufferAttribute( position, a );\n\t_vB$1.fromBufferAttribute( position, b );\n\t_vC$1.fromBufferAttribute( position, c );\n\n\tconst morphInfluences = object.morphTargetInfluences;\n\n\tif ( morphPosition && morphInfluences ) {\n\n\t\t_morphA.set( 0, 0, 0 );\n\t\t_morphB.set( 0, 0, 0 );\n\t\t_morphC.set( 0, 0, 0 );\n\n\t\tfor ( let i = 0, il = morphPosition.length; i < il; i ++ ) {\n\n\t\t\tconst influence = morphInfluences[ i ];\n\t\t\tconst morphAttribute = morphPosition[ i ];\n\n\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t_tempA.fromBufferAttribute( morphAttribute, a );\n\t\t\t_tempB.fromBufferAttribute( morphAttribute, b );\n\t\t\t_tempC.fromBufferAttribute( morphAttribute, c );\n\n\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\t\t\t\t_morphB.addScaledVector( _tempB, influence );\n\t\t\t\t_morphC.addScaledVector( _tempC, influence );\n\n\t\t\t} else {\n\n\t\t\t\t_morphA.addScaledVector( _tempA.sub( _vA$1 ), influence );\n\t\t\t\t_morphB.addScaledVector( _tempB.sub( _vB$1 ), influence );\n\t\t\t\t_morphC.addScaledVector( _tempC.sub( _vC$1 ), influence );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_vA$1.add( _morphA );\n\t\t_vB$1.add( _morphB );\n\t\t_vC$1.add( _morphC );\n\n\t}\n\n\tif ( object.isSkinnedMesh ) {\n\n\t\tobject.boneTransform( a, _vA$1 );\n\t\tobject.boneTransform( b, _vB$1 );\n\t\tobject.boneTransform( c, _vC$1 );\n\n\t}\n\n\tconst intersection = checkIntersection( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint );\n\n\tif ( intersection ) {\n\n\t\tif ( uv ) {\n\n\t\t\t_uvA$1.fromBufferAttribute( uv, a );\n\t\t\t_uvB$1.fromBufferAttribute( uv, b );\n\t\t\t_uvC$1.fromBufferAttribute( uv, c );\n\n\t\t\tintersection.uv = Triangle.getUV( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );\n\n\t\t}\n\n\t\tif ( uv2 ) {\n\n\t\t\t_uvA$1.fromBufferAttribute( uv2, a );\n\t\t\t_uvB$1.fromBufferAttribute( uv2, b );\n\t\t\t_uvC$1.fromBufferAttribute( uv2, c );\n\n\t\t\tintersection.uv2 = Triangle.getUV( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );\n\n\t\t}\n\n\t\tconst face = {\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\tnormal: new Vector3(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\n\t\tTriangle.getNormal( _vA$1, _vB$1, _vC$1, face.normal );\n\n\t\tintersection.face = face;\n\n\t}\n\n\treturn intersection;\n\n}\n\nclass BoxGeometry extends BufferGeometry {\n\n\tconstructor( width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'BoxGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\tdepth: depth,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tdepthSegments: depthSegments\n\t\t};\n\n\t\tconst scope = this;\n\n\t\t// segments\n\n\t\twidthSegments = Math.floor( widthSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\t\tdepthSegments = Math.floor( depthSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet numberOfVertices = 0;\n\t\tlet groupStart = 0;\n\n\t\t// build each side of the box geometry\n\n\t\tbuildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px\n\t\tbuildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx\n\t\tbuildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py\n\t\tbuildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny\n\t\tbuildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz\n\t\tbuildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {\n\n\t\t\tconst segmentWidth = width / gridX;\n\t\t\tconst segmentHeight = height / gridY;\n\n\t\t\tconst widthHalf = width / 2;\n\t\t\tconst heightHalf = height / 2;\n\t\t\tconst depthHalf = depth / 2;\n\n\t\t\tconst gridX1 = gridX + 1;\n\t\t\tconst gridY1 = gridY + 1;\n\n\t\t\tlet vertexCounter = 0;\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst vector = new Vector3();\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\t\tconst y = iy * segmentHeight - heightHalf;\n\n\t\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\t\tconst x = ix * segmentWidth - widthHalf;\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = x * udir;\n\t\t\t\t\tvector[ v ] = y * vdir;\n\t\t\t\t\tvector[ w ] = depthHalf;\n\n\t\t\t\t\t// now apply vector to vertex buffer\n\n\t\t\t\t\tvertices.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = 0;\n\t\t\t\t\tvector[ v ] = 0;\n\t\t\t\t\tvector[ w ] = depth > 0 ? 1 : - 1;\n\n\t\t\t\t\t// now apply vector to normal buffer\n\n\t\t\t\t\tnormals.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// uvs\n\n\t\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t\t\t// counters\n\n\t\t\t\t\tvertexCounter += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\t// 1. you need three indices to draw a single face\n\t\t\t// 2. a single segment consists of two faces\n\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\t\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\t\tconst a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\tconst b = numberOfVertices + ix + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t\t// increase counter\n\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, materialIndex );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t\t// update total number of vertices\n\n\t\t\tnumberOfVertices += vertexCounter;\n\n\t\t}\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments );\n\n\t}\n\n}\n\n/**\n * Uniform Utilities\n */\n\nfunction cloneUniforms( src ) {\n\n\tconst dst = {};\n\n\tfor ( const u in src ) {\n\n\t\tdst[ u ] = {};\n\n\t\tfor ( const p in src[ u ] ) {\n\n\t\t\tconst property = src[ u ][ p ];\n\n\t\t\tif ( property && ( property.isColor ||\n\t\t\t\tproperty.isMatrix3 || property.isMatrix4 ||\n\t\t\t\tproperty.isVector2 || property.isVector3 || property.isVector4 ||\n\t\t\t\tproperty.isTexture || property.isQuaternion ) ) {\n\n\t\t\t\tdst[ u ][ p ] = property.clone();\n\n\t\t\t} else if ( Array.isArray( property ) ) {\n\n\t\t\t\tdst[ u ][ p ] = property.slice();\n\n\t\t\t} else {\n\n\t\t\t\tdst[ u ][ p ] = property;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction mergeUniforms( uniforms ) {\n\n\tconst merged = {};\n\n\tfor ( let u = 0; u < uniforms.length; u ++ ) {\n\n\t\tconst tmp = cloneUniforms( uniforms[ u ] );\n\n\t\tfor ( const p in tmp ) {\n\n\t\t\tmerged[ p ] = tmp[ p ];\n\n\t\t}\n\n\t}\n\n\treturn merged;\n\n}\n\n// Legacy\n\nconst UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };\n\nvar default_vertex = \"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";\n\nvar default_fragment = \"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";\n\n/**\n * parameters = {\n * defines: { \"label\" : \"value\" },\n * uniforms: { \"parameter1\": { value: 1.0 }, \"parameter2\": { value2: 2 } },\n *\n * fragmentShader: ,\n * vertexShader: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * lights: \n * }\n */\n\nclass ShaderMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ShaderMaterial';\n\n\t\tthis.defines = {};\n\t\tthis.uniforms = {};\n\n\t\tthis.vertexShader = default_vertex;\n\t\tthis.fragmentShader = default_fragment;\n\n\t\tthis.linewidth = 1;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false; // set to use scene fog\n\t\tthis.lights = false; // set to use scene lights\n\t\tthis.clipping = false; // set to use user-defined clipping planes\n\n\t\tthis.extensions = {\n\t\t\tderivatives: false, // set to use derivatives\n\t\t\tfragDepth: false, // set to use fragment depth values\n\t\t\tdrawBuffers: false, // set to use draw buffers\n\t\t\tshaderTextureLOD: false // set to use shader texture LOD\n\t\t};\n\n\t\t// When rendered geometry doesn't include these attributes but the material does,\n\t\t// use these default values in WebGL. This avoids errors when buffer data is missing.\n\t\tthis.defaultAttributeValues = {\n\t\t\t'color': [ 1, 1, 1 ],\n\t\t\t'uv': [ 0, 0 ],\n\t\t\t'uv2': [ 0, 0 ]\n\t\t};\n\n\t\tthis.index0AttributeName = undefined;\n\t\tthis.uniformsNeedUpdate = false;\n\n\t\tthis.glslVersion = null;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tif ( parameters.attributes !== undefined ) {\n\n\t\t\t\tconsole.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' );\n\n\t\t\t}\n\n\t\t\tthis.setValues( parameters );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.fragmentShader = source.fragmentShader;\n\t\tthis.vertexShader = source.vertexShader;\n\n\t\tthis.uniforms = cloneUniforms( source.uniforms );\n\n\t\tthis.defines = Object.assign( {}, source.defines );\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.lights = source.lights;\n\t\tthis.clipping = source.clipping;\n\n\t\tthis.extensions = Object.assign( {}, source.extensions );\n\n\t\tthis.glslVersion = source.glslVersion;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.glslVersion = this.glslVersion;\n\t\tdata.uniforms = {};\n\n\t\tfor ( const name in this.uniforms ) {\n\n\t\t\tconst uniform = this.uniforms[ name ];\n\t\t\tconst value = uniform.value;\n\n\t\t\tif ( value && value.isTexture ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 't',\n\t\t\t\t\tvalue: value.toJSON( meta ).uuid\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isColor ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'c',\n\t\t\t\t\tvalue: value.getHex()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector2 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v2',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\tvalue: value\n\t\t\t\t};\n\n\t\t\t\t// note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( Object.keys( this.defines ).length > 0 ) data.defines = this.defines;\n\n\t\tdata.vertexShader = this.vertexShader;\n\t\tdata.fragmentShader = this.fragmentShader;\n\n\t\tconst extensions = {};\n\n\t\tfor ( const key in this.extensions ) {\n\n\t\t\tif ( this.extensions[ key ] === true ) extensions[ key ] = true;\n\n\t\t}\n\n\t\tif ( Object.keys( extensions ).length > 0 ) data.extensions = extensions;\n\n\t\treturn data;\n\n\t}\n\n}\n\nShaderMaterial.prototype.isShaderMaterial = true;\n\nclass Camera extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'Camera';\n\n\t\tthis.matrixWorldInverse = new Matrix4();\n\n\t\tthis.projectionMatrix = new Matrix4();\n\t\tthis.projectionMatrixInverse = new Matrix4();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.matrixWorldInverse.copy( source.matrixWorldInverse );\n\n\t\tthis.projectionMatrix.copy( source.projectionMatrix );\n\t\tthis.projectionMatrixInverse.copy( source.projectionMatrixInverse );\n\n\t\treturn this;\n\n\t}\n\n\tgetWorldDirection( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tconst e = this.matrixWorld.elements;\n\n\t\treturn target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tsuper.updateWorldMatrix( updateParents, updateChildren );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nCamera.prototype.isCamera = true;\n\nclass PerspectiveCamera extends Camera {\n\n\tconstructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PerspectiveCamera';\n\n\t\tthis.fov = fov;\n\t\tthis.zoom = 1;\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\t\tthis.focus = 10;\n\n\t\tthis.aspect = aspect;\n\t\tthis.view = null;\n\n\t\tthis.filmGauge = 35;\t// width of the film (default in millimeters)\n\t\tthis.filmOffset = 0;\t// horizontal film offset (same unit as gauge)\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.fov = source.fov;\n\t\tthis.zoom = source.zoom;\n\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\t\tthis.focus = source.focus;\n\n\t\tthis.aspect = source.aspect;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\tthis.filmGauge = source.filmGauge;\n\t\tthis.filmOffset = source.filmOffset;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t *\n\t * The default film gauge is 35, so that the focal length can be specified for\n\t * a 35mm (full frame) camera.\n\t *\n\t * Values for focal length and film gauge must have the same unit.\n\t */\n\tsetFocalLength( focalLength ) {\n\n\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\n\t\tthis.fov = RAD2DEG * 2 * Math.atan( vExtentSlope );\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Calculates the focal length from the current .fov and .filmGauge.\n\t */\n\tgetFocalLength() {\n\n\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t}\n\n\tgetEffectiveFOV() {\n\n\t\treturn RAD2DEG * 2 * Math.atan(\n\t\t\tMath.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom );\n\n\t}\n\n\tgetFilmWidth() {\n\n\t\t// film not completely covered in portrait format (aspect < 1)\n\t\treturn this.filmGauge * Math.min( this.aspect, 1 );\n\n\t}\n\n\tgetFilmHeight() {\n\n\t\t// film not completely covered in landscape format (aspect > 1)\n\t\treturn this.filmGauge / Math.max( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *\n\t * +---+---+---+\n\t * | A | B | C |\n\t * +---+---+---+\n\t * | D | E | F |\n\t * +---+---+---+\n\t *\n\t * then for each monitor you would call it like this\n\t *\n\t * const w = 1920;\n\t * const h = 1080;\n\t * const fullWidth = w * 3;\n\t * const fullHeight = h * 2;\n\t *\n\t * --A--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * --B--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * --C--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * --D--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * --E--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * --F--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tupdateProjectionMatrix() {\n\n\t\tconst near = this.near;\n\t\tlet top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom;\n\t\tlet height = 2 * top;\n\t\tlet width = this.aspect * height;\n\t\tlet left = - 0.5 * width;\n\t\tconst view = this.view;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\tfullHeight = view.fullHeight;\n\n\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\twidth *= view.width / fullWidth;\n\t\t\theight *= view.height / fullHeight;\n\n\t\t}\n\n\t\tconst skew = this.filmOffset;\n\t\tif ( skew !== 0 ) left += near * skew / this.getFilmWidth();\n\n\t\tthis.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.fov = this.fov;\n\t\tdata.object.zoom = this.zoom;\n\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\t\tdata.object.focus = this.focus;\n\n\t\tdata.object.aspect = this.aspect;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\tdata.object.filmGauge = this.filmGauge;\n\t\tdata.object.filmOffset = this.filmOffset;\n\n\t\treturn data;\n\n\t}\n\n}\n\nPerspectiveCamera.prototype.isPerspectiveCamera = true;\n\nconst fov = 90, aspect = 1;\n\nclass CubeCamera extends Object3D {\n\n\tconstructor( near, far, renderTarget ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CubeCamera';\n\n\t\tif ( renderTarget.isWebGLCubeRenderTarget !== true ) {\n\n\t\t\tconsole.error( 'THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.renderTarget = renderTarget;\n\n\t\tconst cameraPX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPX.layers = this.layers;\n\t\tcameraPX.up.set( 0, - 1, 0 );\n\t\tcameraPX.lookAt( new Vector3( 1, 0, 0 ) );\n\t\tthis.add( cameraPX );\n\n\t\tconst cameraNX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNX.layers = this.layers;\n\t\tcameraNX.up.set( 0, - 1, 0 );\n\t\tcameraNX.lookAt( new Vector3( - 1, 0, 0 ) );\n\t\tthis.add( cameraNX );\n\n\t\tconst cameraPY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPY.layers = this.layers;\n\t\tcameraPY.up.set( 0, 0, 1 );\n\t\tcameraPY.lookAt( new Vector3( 0, 1, 0 ) );\n\t\tthis.add( cameraPY );\n\n\t\tconst cameraNY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNY.layers = this.layers;\n\t\tcameraNY.up.set( 0, 0, - 1 );\n\t\tcameraNY.lookAt( new Vector3( 0, - 1, 0 ) );\n\t\tthis.add( cameraNY );\n\n\t\tconst cameraPZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPZ.layers = this.layers;\n\t\tcameraPZ.up.set( 0, - 1, 0 );\n\t\tcameraPZ.lookAt( new Vector3( 0, 0, 1 ) );\n\t\tthis.add( cameraPZ );\n\n\t\tconst cameraNZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNZ.layers = this.layers;\n\t\tcameraNZ.up.set( 0, - 1, 0 );\n\t\tcameraNZ.lookAt( new Vector3( 0, 0, - 1 ) );\n\t\tthis.add( cameraNZ );\n\n\t}\n\n\tupdate( renderer, scene ) {\n\n\t\tif ( this.parent === null ) this.updateMatrixWorld();\n\n\t\tconst renderTarget = this.renderTarget;\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;\n\n\t\tconst currentXrEnabled = renderer.xr.enabled;\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\trenderer.xr.enabled = false;\n\n\t\tconst generateMipmaps = renderTarget.texture.generateMipmaps;\n\n\t\trenderTarget.texture.generateMipmaps = false;\n\n\t\trenderer.setRenderTarget( renderTarget, 0 );\n\t\trenderer.render( scene, cameraPX );\n\n\t\trenderer.setRenderTarget( renderTarget, 1 );\n\t\trenderer.render( scene, cameraNX );\n\n\t\trenderer.setRenderTarget( renderTarget, 2 );\n\t\trenderer.render( scene, cameraPY );\n\n\t\trenderer.setRenderTarget( renderTarget, 3 );\n\t\trenderer.render( scene, cameraNY );\n\n\t\trenderer.setRenderTarget( renderTarget, 4 );\n\t\trenderer.render( scene, cameraPZ );\n\n\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\n\t\trenderer.setRenderTarget( renderTarget, 5 );\n\t\trenderer.render( scene, cameraNZ );\n\n\t\trenderer.setRenderTarget( currentRenderTarget );\n\n\t\trenderer.xr.enabled = currentXrEnabled;\n\n\t\trenderTarget.texture.needsPMREMUpdate = true;\n\n\t}\n\n}\n\nclass CubeTexture extends Texture {\n\n\tconstructor( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {\n\n\t\timages = images !== undefined ? images : [];\n\t\tmapping = mapping !== undefined ? mapping : CubeReflectionMapping;\n\n\t\tsuper( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );\n\n\t\tthis.flipY = false;\n\n\t}\n\n\tget images() {\n\n\t\treturn this.image;\n\n\t}\n\n\tset images( value ) {\n\n\t\tthis.image = value;\n\n\t}\n\n}\n\nCubeTexture.prototype.isCubeTexture = true;\n\nclass WebGLCubeRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( size, options, dummy ) {\n\n\t\tif ( Number.isInteger( options ) ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )' );\n\n\t\t\toptions = dummy;\n\n\t\t}\n\n\t\tsuper( size, size, options );\n\n\t\toptions = options || {};\n\n\t\t// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n\t\t// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n\t\t// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n\n\t\t// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n\t\t// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n\t\t// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\n\n\t\tthis.texture = new CubeTexture( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\n\t}\n\n\tfromEquirectangularTexture( renderer, texture ) {\n\n\t\tthis.texture.type = texture.type;\n\t\tthis.texture.format = RGBAFormat; // see #18859\n\t\tthis.texture.encoding = texture.encoding;\n\n\t\tthis.texture.generateMipmaps = texture.generateMipmaps;\n\t\tthis.texture.minFilter = texture.minFilter;\n\t\tthis.texture.magFilter = texture.magFilter;\n\n\t\tconst shader = {\n\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: { value: null },\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\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 \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \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`\n\t\t};\n\n\t\tconst geometry = new BoxGeometry( 5, 5, 5 );\n\n\t\tconst material = new ShaderMaterial( {\n\n\t\t\tname: 'CubemapFromEquirect',\n\n\t\t\tuniforms: cloneUniforms( shader.uniforms ),\n\t\t\tvertexShader: shader.vertexShader,\n\t\t\tfragmentShader: shader.fragmentShader,\n\t\t\tside: BackSide,\n\t\t\tblending: NoBlending\n\n\t\t} );\n\n\t\tmaterial.uniforms.tEquirect.value = texture;\n\n\t\tconst mesh = new Mesh( geometry, material );\n\n\t\tconst currentMinFilter = texture.minFilter;\n\n\t\t// Avoid blurred poles\n\t\tif ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter;\n\n\t\tconst camera = new CubeCamera( 1, 10, this );\n\t\tcamera.update( renderer, mesh );\n\n\t\ttexture.minFilter = currentMinFilter;\n\n\t\tmesh.geometry.dispose();\n\t\tmesh.material.dispose();\n\n\t\treturn this;\n\n\t}\n\n\tclear( renderer, color, depth, stencil ) {\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\trenderer.setRenderTarget( this, i );\n\n\t\t\trenderer.clear( color, depth, stencil );\n\n\t\t}\n\n\t\trenderer.setRenderTarget( currentRenderTarget );\n\n\t}\n\n}\n\nWebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;\n\nconst _vector1 = /*@__PURE__*/ new Vector3();\nconst _vector2 = /*@__PURE__*/ new Vector3();\nconst _normalMatrix = /*@__PURE__*/ new Matrix3();\n\nclass Plane {\n\n\tconstructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {\n\n\t\t// normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\n\t}\n\n\tset( normal, constant ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = constant;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponents( x, y, z, w ) {\n\n\t\tthis.normal.set( x, y, z );\n\t\tthis.constant = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromNormalAndCoplanarPoint( normal, point ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = - point.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCoplanarPoints( a, b, c ) {\n\n\t\tconst normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();\n\n\t\t// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\t\tthis.setFromNormalAndCoplanarPoint( normal, a );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( plane ) {\n\n\t\tthis.normal.copy( plane.normal );\n\t\tthis.constant = plane.constant;\n\n\t\treturn this;\n\n\t}\n\n\tnormalize() {\n\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar( inverseNormalLength );\n\t\tthis.constant *= inverseNormalLength;\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.constant *= - 1;\n\t\tthis.normal.negate();\n\n\t\treturn this;\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.normal.dot( point ) + this.constant;\n\n\t}\n\n\tdistanceToSphere( sphere ) {\n\n\t\treturn this.distanceToPoint( sphere.center ) - sphere.radius;\n\n\t}\n\n\tprojectPoint( point, target ) {\n\n\t\treturn target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point );\n\n\t}\n\n\tintersectLine( line, target ) {\n\n\t\tconst direction = line.delta( _vector1 );\n\n\t\tconst denominator = this.normal.dot( direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( this.distanceToPoint( line.start ) === 0 ) {\n\n\t\t\t\treturn target.copy( line.start );\n\n\t\t\t}\n\n\t\t\t// Unsure if this is the correct method to handle this case.\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;\n\n\t\tif ( t < 0 || t > 1 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn target.copy( direction ).multiplyScalar( t ).add( line.start );\n\n\t}\n\n\tintersectsLine( line ) {\n\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n\t\tconst startSign = this.distanceToPoint( line.start );\n\t\tconst endSign = this.distanceToPoint( line.end );\n\n\t\treturn ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsPlane( this );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\treturn sphere.intersectsPlane( this );\n\n\t}\n\n\tcoplanarPoint( target ) {\n\n\t\treturn target.copy( this.normal ).multiplyScalar( - this.constant );\n\n\t}\n\n\tapplyMatrix4( matrix, optionalNormalMatrix ) {\n\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );\n\n\t\tconst referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );\n\n\t\tconst normal = this.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\tthis.constant = - referencePoint.dot( normal );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.constant -= offset.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tequals( plane ) {\n\n\t\treturn plane.normal.equals( this.normal ) && ( plane.constant === this.constant );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nPlane.prototype.isPlane = true;\n\nconst _sphere$2 = /*@__PURE__*/ new Sphere();\nconst _vector$7 = /*@__PURE__*/ new Vector3();\n\nclass Frustum {\n\n\tconstructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) {\n\n\t\tthis.planes = [ p0, p1, p2, p3, p4, p5 ];\n\n\t}\n\n\tset( p0, p1, p2, p3, p4, p5 ) {\n\n\t\tconst planes = this.planes;\n\n\t\tplanes[ 0 ].copy( p0 );\n\t\tplanes[ 1 ].copy( p1 );\n\t\tplanes[ 2 ].copy( p2 );\n\t\tplanes[ 3 ].copy( p3 );\n\t\tplanes[ 4 ].copy( p4 );\n\t\tplanes[ 5 ].copy( p5 );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( frustum ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tplanes[ i ].copy( frustum.planes[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromProjectionMatrix( m ) {\n\n\t\tconst planes = this.planes;\n\t\tconst me = m.elements;\n\t\tconst me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ];\n\t\tconst me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ];\n\t\tconst me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ];\n\t\tconst me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ];\n\n\t\tplanes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize();\n\t\tplanes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();\n\t\tplanes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();\n\t\tplanes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();\n\t\tplanes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();\n\t\tplanes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();\n\n\t\treturn this;\n\n\t}\n\n\tintersectsObject( object ) {\n\n\t\tconst geometry = object.geometry;\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$2.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\treturn this.intersectsSphere( _sphere$2 );\n\n\t}\n\n\tintersectsSprite( sprite ) {\n\n\t\t_sphere$2.center.set( 0, 0, 0 );\n\t\t_sphere$2.radius = 0.7071067811865476;\n\t\t_sphere$2.applyMatrix4( sprite.matrixWorld );\n\n\t\treturn this.intersectsSphere( _sphere$2 );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\tconst planes = this.planes;\n\t\tconst center = sphere.center;\n\t\tconst negRadius = - sphere.radius;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst distance = planes[ i ].distanceToPoint( center );\n\n\t\t\tif ( distance < negRadius ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst plane = planes[ i ];\n\n\t\t\t// corner at max distance\n\n\t\t\t_vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t_vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t_vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\tif ( plane.distanceToPoint( _vector$7 ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tif ( planes[ i ].distanceToPoint( point ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nfunction WebGLAnimation() {\n\n\tlet context = null;\n\tlet isAnimating = false;\n\tlet animationLoop = null;\n\tlet requestId = null;\n\n\tfunction onAnimationFrame( time, frame ) {\n\n\t\tanimationLoop( time, frame );\n\n\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t}\n\n\treturn {\n\n\t\tstart: function () {\n\n\t\t\tif ( isAnimating === true ) return;\n\t\t\tif ( animationLoop === null ) return;\n\n\t\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t\t\tisAnimating = true;\n\n\t\t},\n\n\t\tstop: function () {\n\n\t\t\tcontext.cancelAnimationFrame( requestId );\n\n\t\t\tisAnimating = false;\n\n\t\t},\n\n\t\tsetAnimationLoop: function ( callback ) {\n\n\t\t\tanimationLoop = callback;\n\n\t\t},\n\n\t\tsetContext: function ( value ) {\n\n\t\t\tcontext = value;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLAttributes( gl, capabilities ) {\n\n\tconst isWebGL2 = capabilities.isWebGL2;\n\n\tconst buffers = new WeakMap();\n\n\tfunction createBuffer( attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst usage = attribute.usage;\n\n\t\tconst buffer = gl.createBuffer();\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\t\tgl.bufferData( bufferType, array, usage );\n\n\t\tattribute.onUploadCallback();\n\n\t\tlet type = 5126;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\ttype = 5126;\n\n\t\t} else if ( array instanceof Float64Array ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.' );\n\n\t\t} else if ( array instanceof Uint16Array ) {\n\n\t\t\tif ( attribute.isFloat16BufferAttribute ) {\n\n\t\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\t\ttype = 5131;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.' );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\ttype = 5123;\n\n\t\t\t}\n\n\t\t} else if ( array instanceof Int16Array ) {\n\n\t\t\ttype = 5122;\n\n\t\t} else if ( array instanceof Uint32Array ) {\n\n\t\t\ttype = 5125;\n\n\t\t} else if ( array instanceof Int32Array ) {\n\n\t\t\ttype = 5124;\n\n\t\t} else if ( array instanceof Int8Array ) {\n\n\t\t\ttype = 5120;\n\n\t\t} else if ( array instanceof Uint8Array ) {\n\n\t\t\ttype = 5121;\n\n\t\t} else if ( array instanceof Uint8ClampedArray ) {\n\n\t\t\ttype = 5121;\n\n\t\t}\n\n\t\treturn {\n\t\t\tbuffer: buffer,\n\t\t\ttype: type,\n\t\t\tbytesPerElement: array.BYTES_PER_ELEMENT,\n\t\t\tversion: attribute.version\n\t\t};\n\n\t}\n\n\tfunction updateBuffer( buffer, attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst updateRange = attribute.updateRange;\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\n\t\tif ( updateRange.count === - 1 ) {\n\n\t\t\t// Not using update ranges\n\n\t\t\tgl.bufferSubData( bufferType, 0, array );\n\n\t\t} else {\n\n\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\tgl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,\n\t\t\t\t\tarray, updateRange.offset, updateRange.count );\n\n\t\t\t} else {\n\n\t\t\t\tgl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,\n\t\t\t\t\tarray.subarray( updateRange.offset, updateRange.offset + updateRange.count ) );\n\n\t\t\t}\n\n\t\t\tupdateRange.count = - 1; // reset range\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction get( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\treturn buffers.get( attribute );\n\n\t}\n\n\tfunction remove( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data ) {\n\n\t\t\tgl.deleteBuffer( data.buffer );\n\n\t\t\tbuffers.delete( attribute );\n\n\t\t}\n\n\t}\n\n\tfunction update( attribute, bufferType ) {\n\n\t\tif ( attribute.isGLBufferAttribute ) {\n\n\t\t\tconst cached = buffers.get( attribute );\n\n\t\t\tif ( ! cached || cached.version < attribute.version ) {\n\n\t\t\t\tbuffers.set( attribute, {\n\t\t\t\t\tbuffer: attribute.buffer,\n\t\t\t\t\ttype: attribute.type,\n\t\t\t\t\tbytesPerElement: attribute.elementSize,\n\t\t\t\t\tversion: attribute.version\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data === undefined ) {\n\n\t\t\tbuffers.set( attribute, createBuffer( attribute, bufferType ) );\n\n\t\t} else if ( data.version < attribute.version ) {\n\n\t\t\tupdateBuffer( data.buffer, attribute, bufferType );\n\n\t\t\tdata.version = attribute.version;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update\n\n\t};\n\n}\n\nclass PlaneGeometry extends BufferGeometry {\n\n\tconstructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) {\n\n\t\tsuper();\n\t\tthis.type = 'PlaneGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments\n\t\t};\n\n\t\tconst width_half = width / 2;\n\t\tconst height_half = height / 2;\n\n\t\tconst gridX = Math.floor( widthSegments );\n\t\tconst gridY = Math.floor( heightSegments );\n\n\t\tconst gridX1 = gridX + 1;\n\t\tconst gridY1 = gridY + 1;\n\n\t\tconst segment_width = width / gridX;\n\t\tconst segment_height = height / gridY;\n\n\t\t//\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\tconst y = iy * segment_height - height_half;\n\n\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\tconst x = ix * segment_width - width_half;\n\n\t\t\t\tvertices.push( x, - y, 0 );\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\tconst a = ix + gridX1 * iy;\n\t\t\t\tconst b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tconst c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tconst d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments );\n\n\t}\n\n}\n\nvar alphamap_fragment = \"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\";\n\nvar alphamap_pars_fragment = \"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\nvar alphatest_fragment = \"#ifdef USE_ALPHATEST\\n\\tif ( diffuseColor.a < alphaTest ) discard;\\n#endif\";\n\nvar alphatest_pars_fragment = \"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\";\n\nvar aomap_fragment = \"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\\t#endif\\n#endif\";\n\nvar aomap_pars_fragment = \"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";\n\nvar begin_vertex = \"vec3 transformed = vec3( position );\";\n\nvar beginnormal_vertex = \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\";\n\nvar bsdfs = \"vec3 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 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}\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float 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\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\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}\\nfloat 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}\\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\";\n\nvar bumpmap_pars_fragment = \"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + 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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\\n\\t\\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\\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\";\n\nvar clipping_planes_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\tplane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\tif ( clipped ) discard;\\n\\t#endif\\n#endif\";\n\nvar clipping_planes_pars_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\";\n\nvar clipping_planes_pars_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\";\n\nvar clipping_planes_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\";\n\nvar color_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";\n\nvar color_pars_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\nvar color_pars_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\nvar color_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvColor = vec4( 1.0 );\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_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\nvar 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; }\\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 color ) { return dot( color, vec3( 0.3333 ) ); }\\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};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal;\\n#endif\\n};\\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}\\nfloat linearToRelativeLuminance( const in vec3 color ) {\\n\\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\\n\\treturn dot( weights, color.rgb );\\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}\";\n\nvar cube_uv_reflection_fragment = \"#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t#define cubeUV_maxMipLevel 8.0\\n\\t#define cubeUV_minMipLevel 4.0\\n\\t#define cubeUV_maxTileSize 256.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\\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\\n\\t\\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\\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\\tif ( mipInt < cubeUV_maxMipLevel ) {\\n\\t\\t\\tuv.y += 2.0 * cubeUV_maxTileSize;\\n\\t\\t}\\n\\t\\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\\n\\t\\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\\n\\t\\tuv *= texelSize;\\n\\t\\treturn texture2D( envMap, uv ).rgb;\\n\\t}\\n\\t#define r0 1.0\\n\\t#define v0 0.339\\n\\t#define m0 - 2.0\\n\\t#define r1 0.8\\n\\t#define v1 0.276\\n\\t#define m1 - 1.0\\n\\t#define r4 0.4\\n\\t#define v4 0.046\\n\\t#define m4 2.0\\n\\t#define r5 0.305\\n\\t#define v5 0.016\\n\\t#define m5 3.0\\n\\t#define r6 0.21\\n\\t#define v6 0.0038\\n\\t#define m6 4.0\\n\\tfloat roughnessToMip( float roughness ) {\\n\\t\\tfloat mip = 0.0;\\n\\t\\tif ( roughness >= r1 ) {\\n\\t\\t\\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\\n\\t\\t} else if ( roughness >= r4 ) {\\n\\t\\t\\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\\n\\t\\t} else if ( roughness >= r5 ) {\\n\\t\\t\\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\\n\\t\\t} else if ( roughness >= r6 ) {\\n\\t\\t\\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + 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 ), m0, cubeUV_maxMipLevel );\\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\";\n\nvar defaultnormal_vertex = \"vec3 transformedNormal = objectNormal;\\n#ifdef USE_INSTANCING\\n\\tmat3 m = mat3( instanceMatrix );\\n\\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\\n\\ttransformedNormal = m * transformedNormal;\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#ifdef FLIP_SIDED\\n\\t\\ttransformedTangent = - transformedTangent;\\n\\t#endif\\n#endif\";\n\nvar displacementmap_pars_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\";\n\nvar displacementmap_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\\n#endif\";\n\nvar emissivemap_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\";\n\nvar emissivemap_pars_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\";\n\nvar encodings_fragment = \"gl_FragColor = linearToOutputTexel( gl_FragColor );\";\n\nvar encodings_pars_fragment = \"vec4 LinearToLinear( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 LinearTosRGB( 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}\";\n\nvar 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\\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\";\n\nvar envmap_common_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float envMapIntensity;\\n\\tuniform float flipEnvMap;\\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\";\n\nvar envmap_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float reflectivity;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\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\";\n\nvar envmap_pars_vertex = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\\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\";\n\nvar 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\";\n\nvar fog_vertex = \"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\";\n\nvar fog_pars_vertex = \"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\\n\\t#endif\\n}\";\n\nvar lightmap_fragment = \"#ifdef USE_LIGHTMAP\\n\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tlightMapIrradiance *= PI;\\n\\t#endif\\n\\treflectedLight.indirectDiffuse += lightMapIrradiance;\\n#endif\";\n\nvar lightmap_pars_fragment = \"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";\n\nvar lights_lambert_vertex = \"vec3 diffuse = vec3( 1.0 );\\nGeometricContext geometry;\\ngeometry.position = mvPosition.xyz;\\ngeometry.normal = normalize( transformedNormal );\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\\nGeometricContext backGeometry;\\nbackGeometry.position = geometry.position;\\nbackGeometry.normal = -geometry.normal;\\nbackGeometry.viewDir = geometry.viewDir;\\nvLightFront = vec3( 0.0 );\\nvIndirectFront = vec3( 0.0 );\\n#ifdef DOUBLE_SIDED\\n\\tvLightBack = vec3( 0.0 );\\n\\tvIndirectBack = vec3( 0.0 );\\n#endif\\nIncidentLight directLight;\\nfloat dotNL;\\nvec3 directLightColor_Diffuse;\\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\\n#ifdef DOUBLE_SIDED\\n\\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\\n\\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\";\n\nvar lights_pars_begin = \"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\nuniform vec3 lightProbe[ 9 ];\\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\\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tif ( cutoffDistance > 0.0 ) {\\n\\t\\t\\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\t}\\n\\t\\treturn distanceFalloff;\\n\\t#else\\n\\t\\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\\n\\t\\t\\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n\\t\\t}\\n\\t\\treturn 1.0;\\n\\t#endif\\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\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 GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\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\";\n\nvar envmap_physical_pars_fragment = \"#if defined( USE_ENVMAP )\\n\\t#ifdef ENVMAP_MODE_REFRACTION\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n\\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, 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#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 reflectVec;\\n\\t\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\t\\treflectVec = reflect( - viewDir, normal );\\n\\t\\t\\t\\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\\n\\t\\t\\t#else\\n\\t\\t\\t\\treflectVec = refract( - viewDir, normal, refractionRatio );\\n\\t\\t\\t#endif\\n\\t\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, 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#endif\";\n\nvar lights_toon_fragment = \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\";\n\nvar lights_toon_pars_fragment = \"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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\\n#define Material_LightProbeLOD( material )\\t(0)\";\n\nvar lights_phong_fragment = \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\";\n\nvar 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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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\\n#define Material_LightProbeLOD( material )\\t(0)\";\n\nvar lights_physical_fragment = \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\\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\\t#ifdef SPECULAR\\n\\t\\tfloat specularIntensityFactor = specularIntensity;\\n\\t\\tvec3 specularColorFactor = specularColor;\\n\\t\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\t\\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\\n\\t\\t#endif\\n\\t\\t#ifdef USE_SPECULARCOLORMAP\\n\\t\\t\\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\\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( ( ior - 1.0 ) / ( 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, vUv ).x;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\t\\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_SHEEN\\n\\tmaterial.sheenColor = sheenColor;\\n\\t#ifdef USE_SHEENCOLORMAP\\n\\t\\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\\n\\t#endif\\n\\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\\n\\t#ifdef USE_SHEENROUGHNESSMAP\\n\\t\\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\\n\\t#endif\\n#endif\";\n\nvar lights_physical_pars_fragment = \"struct PhysicalMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat roughness;\\n\\tvec3 specularColor;\\n\\tfloat specularF90;\\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_SHEEN\\n\\t\\tvec3 sheenColor;\\n\\t\\tfloat sheenRoughness;\\n\\t#endif\\n};\\nvec3 clearcoatSpecular = vec3( 0.0 );\\nvec3 sheenSpecular = vec3( 0.0 );\\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}\\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\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\\n\\tfloat Ess = fab.x + fab.y;\\n\\tfloat Ems = 1.0 - Ess;\\n\\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometry.normal;\\n\\t\\tvec3 viewDir = geometry.viewDir;\\n\\t\\tvec3 position = geometry.position;\\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\\n\\t\\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\\t\\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\\n\\t#endif\\n\\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\\n\\t#endif\\n\\tvec3 singleScattering = vec3( 0.0 );\\n\\tvec3 multiScattering = vec3( 0.0 );\\n\\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\\n\\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\\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}\";\n\nvar lights_fragment_begin = \"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\n#ifdef USE_CLEARCOAT\\n\\tgeometry.clearcoatNormal = clearcoatNormal;\\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, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\\n\\t\\tpointLightShadow = pointLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, 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\\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, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\tspotLightShadow = spotLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, 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, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\\t\\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, 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, geometry, 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\\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\\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 ], geometry.normal );\\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\";\n\nvar lights_fragment_maps = \"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\t\\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tlightMapIrradiance *= PI;\\n\\t\\t#endif\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tiblIrradiance += getIBLIrradiance( geometry.normal );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\\n\\t#endif\\n#endif\";\n\nvar lights_fragment_end = \"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\\n#endif\";\n\nvar logdepthbuf_fragment = \"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\";\n\nvar logdepthbuf_pars_fragment = \"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\nvar logdepthbuf_pars_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t\\tvarying float vIsPerspective;\\n\\t#else\\n\\t\\tuniform float logDepthBufFC;\\n\\t#endif\\n#endif\";\n\nvar logdepthbuf_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n\\t#else\\n\\t\\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\\n\\t\\t\\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\\n\\t\\t\\tgl_Position.z *= gl_Position.w;\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\nvar map_fragment = \"#ifdef USE_MAP\\n\\tvec4 sampledDiffuseColor = texture2D( map, vUv );\\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#endif\\n\\tdiffuseColor *= sampledDiffuseColor;\\n#endif\";\n\nvar map_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\";\n\nvar map_particle_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\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\";\n\nvar map_particle_pars_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tuniform mat3 uvTransform;\\n#endif\\n#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\nvar metalnessmap_fragment = \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\";\n\nvar metalnessmap_pars_fragment = \"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";\n\nvar morphnormal_vertex = \"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\\n\\t\\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\\n\\t\\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\\n\\t\\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\\n\\t#endif\\n#endif\";\n\nvar morphtarget_pars_vertex = \"#ifdef USE_MORPHTARGETS\\n\\tuniform float morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\t\\tuniform sampler2DArray morphTargetsTexture;\\n\\t\\tuniform vec2 morphTargetsTextureSize;\\n\\t\\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\\n\\t\\t\\tfloat texelIndex = float( vertexIndex * stride + offset );\\n\\t\\t\\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\\n\\t\\t\\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\\n\\t\\t\\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\\n\\t\\t\\treturn texture( morphTargetsTexture, morphUV ).xyz;\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\tuniform float morphTargetInfluences[ 8 ];\\n\\t\\t#else\\n\\t\\t\\tuniform float morphTargetInfluences[ 4 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar morphtarget_vertex = \"#ifdef USE_MORPHTARGETS\\n\\ttransformed *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#else\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#else\\n\\t\\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\\n\\t\\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\\n\\t\\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\\n\\t\\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\\n\\t\\t\\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\\n\\t\\t\\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\\n\\t\\t\\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar normal_fragment_begin = \"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\\n\\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\\n\\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\t#ifdef USE_TANGENT\\n\\t\\tvec3 tangent = normalize( vTangent );\\n\\t\\tvec3 bitangent = normalize( vBitangent );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\ttangent = tangent * faceDirection;\\n\\t\\t\\tbitangent = bitangent * faceDirection;\\n\\t\\t#endif\\n\\t\\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\\n\\t\\t\\tmat3 vTBN = mat3( tangent, bitangent, normal );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\nvec3 geometryNormal = normal;\";\n\nvar normal_fragment_maps = \"#ifdef OBJECTSPACE_NORMALMAP\\n\\tnormal = texture2D( normalMap, vUv ).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( TANGENTSPACE_NORMALMAP )\\n\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tmapN.xy *= normalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tnormal = normalize( vTBN * mapN );\\n\\t#else\\n\\t\\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\\n\\t#endif\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar normalmap_pars_fragment = \"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n#endif\\n#ifdef OBJECTSPACE_NORMALMAP\\n\\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\\n\\t\\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\\n\\t\\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\\n\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\tvec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );\\n\\t\\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\\n\\t}\\n#endif\";\n\nvar clearcoat_normal_fragment_begin = \"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = geometryNormal;\\n#endif\";\n\nvar clearcoat_normal_fragment_maps = \"#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\\n\\t#else\\n\\t\\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\\n\\t#endif\\n#endif\";\n\nvar clearcoat_pars_fragment = \"#ifdef USE_CLEARCOATMAP\\n\\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform sampler2D clearcoatNormalMap;\\n\\tuniform vec2 clearcoatNormalScale;\\n#endif\";\n\nvar output_fragment = \"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= transmissionAlpha + 0.1;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\";\n\nvar 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.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nvec4 pack2HalfToRGBA( 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( 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 linearClipZ, const in float near, const in float far ) {\\n\\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\";\n\nvar premultiplied_alpha_fragment = \"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\";\n\nvar project_vertex = \"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_INSTANCING\\n\\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\";\n\nvar dithering_fragment = \"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\";\n\nvar 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\";\n\nvar roughnessmap_fragment = \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\";\n\nvar roughnessmap_pars_fragment = \"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";\n\nvar shadowmap_pars_fragment = \"#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 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\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\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 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 shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\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 shadow;\\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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\";\n\nvar shadowmap_pars_vertex = \"#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 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 mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\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 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\";\n\nvar shadowmap_vertex = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\tvec4 shadowWorldPosition;\\n\\t#endif\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\";\n\nvar 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.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.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ 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.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}\";\n\nvar 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\";\n\nvar skinning_pars_vertex = \"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\t#ifdef BONE_TEXTURE\\n\\t\\tuniform highp sampler2D boneTexture;\\n\\t\\tuniform int boneTextureSize;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureSize ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureSize ) );\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#else\\n\\t\\tuniform mat4 boneMatrices[ MAX_BONES ];\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tmat4 bone = boneMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar specularmap_fragment = \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\";\n\nvar specularmap_pars_fragment = \"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";\n\nvar tonemapping_fragment = \"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\";\n\nvar 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 toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 OptimizedCineonToneMapping( 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}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\";\n\nvar transmission_fragment = \"#ifdef USE_TRANSMISSION\\n\\tfloat transmissionAlpha = 1.0;\\n\\tfloat transmissionFactor = transmission;\\n\\tfloat thicknessFactor = thickness;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\\n\\t#endif\\n\\tvec3 pos = vWorldPosition;\\n\\tvec3 v = normalize( cameraPosition - pos );\\n\\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\\tvec4 transmission = getIBLVolumeRefraction(\\n\\t\\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\\n\\t\\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\\n\\t\\tattenuationColor, attenuationDistance );\\n\\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\\n\\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\\n#endif\";\n\nvar 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\\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 framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tif ( attenuationDistance == 0.0 ) {\\n\\t\\t\\treturn radiance;\\n\\t\\t} else {\\n\\t\\t\\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\\t\\t\\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\\t\\t\\treturn transmittance * radiance;\\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 ior, const in float thickness,\\n\\t\\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\trefractionCoords += 1.0;\\n\\t\\trefractionCoords /= 2.0;\\n\\t\\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\\t\\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\\n\\t\\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\\t\\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\\n\\t}\\n#endif\";\n\nvar uv_pars_fragment = \"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\\n\\tvarying vec2 vUv;\\n#endif\";\n\nvar uv_pars_vertex = \"#ifdef USE_UV\\n\\t#ifdef UVS_VERTEX_ONLY\\n\\t\\tvec2 vUv;\\n\\t#else\\n\\t\\tvarying vec2 vUv;\\n\\t#endif\\n\\tuniform mat3 uvTransform;\\n#endif\";\n\nvar uv_vertex = \"#ifdef USE_UV\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n#endif\";\n\nvar uv2_pars_fragment = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\";\n\nvar uv2_pars_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n\\tuniform mat3 uv2Transform;\\n#endif\";\n\nvar uv2_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\\n#endif\";\n\nvar worldpos_vertex = \"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\\n\\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\\t#ifdef USE_INSTANCING\\n\\t\\tworldPosition = instanceMatrix * worldPosition;\\n\\t#endif\\n\\tworldPosition = modelMatrix * worldPosition;\\n#endif\";\n\nconst vertex$g = \"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}\";\n\nconst fragment$g = \"uniform sampler2D t2D;\\nvarying vec2 vUv;\\nvoid main() {\\n\\tgl_FragColor = texture2D( t2D, vUv );\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$f = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n\\tgl_Position.z = gl_Position.w;\\n}\";\n\nconst fragment$f = \"#include \\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvec3 vReflect = vWorldDirection;\\n\\t#include \\n\\tgl_FragColor = envColor;\\n\\tgl_FragColor.a *= opacity;\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$e = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvHighPrecisionZW = gl_Position.zw;\\n}\";\n\nconst fragment$e = \"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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#endif\\n}\";\n\nconst vertex$d = \"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvWorldPosition = worldPosition.xyz;\\n}\";\n\nconst fragment$d = \"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main () {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\";\n\nconst vertex$c = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$c = \"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvec3 direction = normalize( vWorldDirection );\\n\\tvec2 sampleUV = equirectUv( direction );\\n\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$b = \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvLineDistance = scale * lineDistance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$b = \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$a = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$a = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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, vUv2 );\\n\\t\\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include \\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$9 = \"#define LAMBERT\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$9 = \"uniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vIndirectFront;\\n\\t#endif\\n\\t#include \\n\\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\\n\\t#else\\n\\t\\treflectedLight.directDiffuse = vLightFront;\\n\\t#endif\\n\\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$8 = \"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n}\";\n\nconst fragment$8 = \"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$7 = \"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\";\n\nconst fragment$7 = \"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\n\\t#ifdef OPAQUE\\n\\t\\tgl_FragColor.a = 1.0;\\n\\t#endif\\n}\";\n\nconst vertex$6 = \"#define PHONG\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$6 = \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$5 = \"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\\tvarying vec3 vWorldPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n#ifdef USE_TRANSMISSION\\n\\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\";\n\nconst fragment$5 = \"#define STANDARD\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define 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 SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularColor;\\n\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n\\t#ifdef USE_SPECULARCOLORMAP\\n\\t\\tuniform sampler2D specularColorMap;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenColor;\\n\\tuniform float sheenRoughness;\\n\\t#ifdef USE_SHEENCOLORMAP\\n\\t\\tuniform sampler2D sheenColorMap;\\n\\t#endif\\n\\t#ifdef USE_SHEENROUGHNESSMAP\\n\\t\\tuniform sampler2D sheenRoughnessMap;\\n\\t#endif\\n#endif\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\t#include \\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 + sheenSpecular;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$4 = \"#define TOON\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$4 = \"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$3 = \"uniform float size;\\nuniform float scale;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$3 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$2 = \"#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$2 = \"uniform vec3 color;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$1 = \"uniform float rotation;\\nuniform vec2 center;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\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 \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$1 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst ShaderChunk = {\n\talphamap_fragment: alphamap_fragment,\n\talphamap_pars_fragment: alphamap_pars_fragment,\n\talphatest_fragment: alphatest_fragment,\n\talphatest_pars_fragment: alphatest_pars_fragment,\n\taomap_fragment: aomap_fragment,\n\taomap_pars_fragment: aomap_pars_fragment,\n\tbegin_vertex: begin_vertex,\n\tbeginnormal_vertex: beginnormal_vertex,\n\tbsdfs: bsdfs,\n\tbumpmap_pars_fragment: bumpmap_pars_fragment,\n\tclipping_planes_fragment: clipping_planes_fragment,\n\tclipping_planes_pars_fragment: clipping_planes_pars_fragment,\n\tclipping_planes_pars_vertex: clipping_planes_pars_vertex,\n\tclipping_planes_vertex: clipping_planes_vertex,\n\tcolor_fragment: color_fragment,\n\tcolor_pars_fragment: color_pars_fragment,\n\tcolor_pars_vertex: color_pars_vertex,\n\tcolor_vertex: color_vertex,\n\tcommon: common,\n\tcube_uv_reflection_fragment: cube_uv_reflection_fragment,\n\tdefaultnormal_vertex: defaultnormal_vertex,\n\tdisplacementmap_pars_vertex: displacementmap_pars_vertex,\n\tdisplacementmap_vertex: displacementmap_vertex,\n\temissivemap_fragment: emissivemap_fragment,\n\temissivemap_pars_fragment: emissivemap_pars_fragment,\n\tencodings_fragment: encodings_fragment,\n\tencodings_pars_fragment: encodings_pars_fragment,\n\tenvmap_fragment: envmap_fragment,\n\tenvmap_common_pars_fragment: envmap_common_pars_fragment,\n\tenvmap_pars_fragment: envmap_pars_fragment,\n\tenvmap_pars_vertex: envmap_pars_vertex,\n\tenvmap_physical_pars_fragment: envmap_physical_pars_fragment,\n\tenvmap_vertex: envmap_vertex,\n\tfog_vertex: fog_vertex,\n\tfog_pars_vertex: fog_pars_vertex,\n\tfog_fragment: fog_fragment,\n\tfog_pars_fragment: fog_pars_fragment,\n\tgradientmap_pars_fragment: gradientmap_pars_fragment,\n\tlightmap_fragment: lightmap_fragment,\n\tlightmap_pars_fragment: lightmap_pars_fragment,\n\tlights_lambert_vertex: lights_lambert_vertex,\n\tlights_pars_begin: lights_pars_begin,\n\tlights_toon_fragment: lights_toon_fragment,\n\tlights_toon_pars_fragment: lights_toon_pars_fragment,\n\tlights_phong_fragment: lights_phong_fragment,\n\tlights_phong_pars_fragment: lights_phong_pars_fragment,\n\tlights_physical_fragment: lights_physical_fragment,\n\tlights_physical_pars_fragment: lights_physical_pars_fragment,\n\tlights_fragment_begin: lights_fragment_begin,\n\tlights_fragment_maps: lights_fragment_maps,\n\tlights_fragment_end: lights_fragment_end,\n\tlogdepthbuf_fragment: logdepthbuf_fragment,\n\tlogdepthbuf_pars_fragment: logdepthbuf_pars_fragment,\n\tlogdepthbuf_pars_vertex: logdepthbuf_pars_vertex,\n\tlogdepthbuf_vertex: logdepthbuf_vertex,\n\tmap_fragment: map_fragment,\n\tmap_pars_fragment: map_pars_fragment,\n\tmap_particle_fragment: map_particle_fragment,\n\tmap_particle_pars_fragment: map_particle_pars_fragment,\n\tmetalnessmap_fragment: metalnessmap_fragment,\n\tmetalnessmap_pars_fragment: metalnessmap_pars_fragment,\n\tmorphnormal_vertex: morphnormal_vertex,\n\tmorphtarget_pars_vertex: morphtarget_pars_vertex,\n\tmorphtarget_vertex: morphtarget_vertex,\n\tnormal_fragment_begin: normal_fragment_begin,\n\tnormal_fragment_maps: normal_fragment_maps,\n\tnormal_pars_fragment: normal_pars_fragment,\n\tnormal_pars_vertex: normal_pars_vertex,\n\tnormal_vertex: normal_vertex,\n\tnormalmap_pars_fragment: normalmap_pars_fragment,\n\tclearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin,\n\tclearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,\n\tclearcoat_pars_fragment: clearcoat_pars_fragment,\n\toutput_fragment: output_fragment,\n\tpacking: packing,\n\tpremultiplied_alpha_fragment: premultiplied_alpha_fragment,\n\tproject_vertex: project_vertex,\n\tdithering_fragment: dithering_fragment,\n\tdithering_pars_fragment: dithering_pars_fragment,\n\troughnessmap_fragment: roughnessmap_fragment,\n\troughnessmap_pars_fragment: roughnessmap_pars_fragment,\n\tshadowmap_pars_fragment: shadowmap_pars_fragment,\n\tshadowmap_pars_vertex: shadowmap_pars_vertex,\n\tshadowmap_vertex: shadowmap_vertex,\n\tshadowmask_pars_fragment: shadowmask_pars_fragment,\n\tskinbase_vertex: skinbase_vertex,\n\tskinning_pars_vertex: skinning_pars_vertex,\n\tskinning_vertex: skinning_vertex,\n\tskinnormal_vertex: skinnormal_vertex,\n\tspecularmap_fragment: specularmap_fragment,\n\tspecularmap_pars_fragment: specularmap_pars_fragment,\n\ttonemapping_fragment: tonemapping_fragment,\n\ttonemapping_pars_fragment: tonemapping_pars_fragment,\n\ttransmission_fragment: transmission_fragment,\n\ttransmission_pars_fragment: transmission_pars_fragment,\n\tuv_pars_fragment: uv_pars_fragment,\n\tuv_pars_vertex: uv_pars_vertex,\n\tuv_vertex: uv_vertex,\n\tuv2_pars_fragment: uv2_pars_fragment,\n\tuv2_pars_vertex: uv2_pars_vertex,\n\tuv2_vertex: uv2_vertex,\n\tworldpos_vertex: worldpos_vertex,\n\n\tbackground_vert: vertex$g,\n\tbackground_frag: fragment$g,\n\tcube_vert: vertex$f,\n\tcube_frag: fragment$f,\n\tdepth_vert: vertex$e,\n\tdepth_frag: fragment$e,\n\tdistanceRGBA_vert: vertex$d,\n\tdistanceRGBA_frag: fragment$d,\n\tequirect_vert: vertex$c,\n\tequirect_frag: fragment$c,\n\tlinedashed_vert: vertex$b,\n\tlinedashed_frag: fragment$b,\n\tmeshbasic_vert: vertex$a,\n\tmeshbasic_frag: fragment$a,\n\tmeshlambert_vert: vertex$9,\n\tmeshlambert_frag: fragment$9,\n\tmeshmatcap_vert: vertex$8,\n\tmeshmatcap_frag: fragment$8,\n\tmeshnormal_vert: vertex$7,\n\tmeshnormal_frag: fragment$7,\n\tmeshphong_vert: vertex$6,\n\tmeshphong_frag: fragment$6,\n\tmeshphysical_vert: vertex$5,\n\tmeshphysical_frag: fragment$5,\n\tmeshtoon_vert: vertex$4,\n\tmeshtoon_frag: fragment$4,\n\tpoints_vert: vertex$3,\n\tpoints_frag: fragment$3,\n\tshadow_vert: vertex$2,\n\tshadow_frag: fragment$2,\n\tsprite_vert: vertex$1,\n\tsprite_frag: fragment$1\n};\n\n/**\n * Uniforms library for shared webgl shaders\n */\n\nconst UniformsLib = {\n\n\tcommon: {\n\n\t\tdiffuse: { value: new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\n\t\tmap: { value: null },\n\t\tuvTransform: { value: new Matrix3() },\n\t\tuv2Transform: { value: new Matrix3() },\n\n\t\talphaMap: { value: null },\n\t\talphaTest: { value: 0 }\n\n\t},\n\n\tspecularmap: {\n\n\t\tspecularMap: { value: null },\n\n\t},\n\n\tenvmap: {\n\n\t\tenvMap: { value: null },\n\t\tflipEnvMap: { value: - 1 },\n\t\treflectivity: { value: 1.0 }, // basic, lambert, phong\n\t\tior: { value: 1.5 }, // standard, physical\n\t\trefractionRatio: { value: 0.98 }\n\n\t},\n\n\taomap: {\n\n\t\taoMap: { value: null },\n\t\taoMapIntensity: { value: 1 }\n\n\t},\n\n\tlightmap: {\n\n\t\tlightMap: { value: null },\n\t\tlightMapIntensity: { value: 1 }\n\n\t},\n\n\temissivemap: {\n\n\t\temissiveMap: { value: null }\n\n\t},\n\n\tbumpmap: {\n\n\t\tbumpMap: { value: null },\n\t\tbumpScale: { value: 1 }\n\n\t},\n\n\tnormalmap: {\n\n\t\tnormalMap: { value: null },\n\t\tnormalScale: { value: new Vector2( 1, 1 ) }\n\n\t},\n\n\tdisplacementmap: {\n\n\t\tdisplacementMap: { value: null },\n\t\tdisplacementScale: { value: 1 },\n\t\tdisplacementBias: { value: 0 }\n\n\t},\n\n\troughnessmap: {\n\n\t\troughnessMap: { value: null }\n\n\t},\n\n\tmetalnessmap: {\n\n\t\tmetalnessMap: { value: null }\n\n\t},\n\n\tgradientmap: {\n\n\t\tgradientMap: { value: null }\n\n\t},\n\n\tfog: {\n\n\t\tfogDensity: { value: 0.00025 },\n\t\tfogNear: { value: 1 },\n\t\tfogFar: { value: 2000 },\n\t\tfogColor: { value: new Color( 0xffffff ) }\n\n\t},\n\n\tlights: {\n\n\t\tambientLightColor: { value: [] },\n\n\t\tlightProbe: { value: [] },\n\n\t\tdirectionalLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tcolor: {}\n\t\t} },\n\n\t\tdirectionalLightShadows: { value: [], properties: {\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tdirectionalShadowMap: { value: [] },\n\t\tdirectionalShadowMatrix: { value: [] },\n\n\t\tspotLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdirection: {},\n\t\t\tdistance: {},\n\t\t\tconeCos: {},\n\t\t\tpenumbraCos: {},\n\t\t\tdecay: {}\n\t\t} },\n\n\t\tspotLightShadows: { value: [], properties: {\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tspotShadowMap: { value: [] },\n\t\tspotShadowMatrix: { value: [] },\n\n\t\tpointLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdecay: {},\n\t\t\tdistance: {}\n\t\t} },\n\n\t\tpointLightShadows: { value: [], properties: {\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {},\n\t\t\tshadowCameraNear: {},\n\t\t\tshadowCameraFar: {}\n\t\t} },\n\n\t\tpointShadowMap: { value: [] },\n\t\tpointShadowMatrix: { value: [] },\n\n\t\themisphereLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tskyColor: {},\n\t\t\tgroundColor: {}\n\t\t} },\n\n\t\t// TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src\n\t\trectAreaLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\twidth: {},\n\t\t\theight: {}\n\t\t} },\n\n\t\tltc_1: { value: null },\n\t\tltc_2: { value: null }\n\n\t},\n\n\tpoints: {\n\n\t\tdiffuse: { value: new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tsize: { value: 1.0 },\n\t\tscale: { value: 1.0 },\n\t\tmap: { value: null },\n\t\talphaMap: { value: null },\n\t\talphaTest: { value: 0 },\n\t\tuvTransform: { value: new Matrix3() }\n\n\t},\n\n\tsprite: {\n\n\t\tdiffuse: { value: new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tcenter: { value: new Vector2( 0.5, 0.5 ) },\n\t\trotation: { value: 0.0 },\n\t\tmap: { value: null },\n\t\talphaMap: { value: null },\n\t\talphaTest: { value: 0 },\n\t\tuvTransform: { value: new Matrix3() }\n\n\t}\n\n};\n\nconst ShaderLib = {\n\n\tbasic: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshbasic_vert,\n\t\tfragmentShader: ShaderChunk.meshbasic_frag\n\n\t},\n\n\tlambert: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshlambert_vert,\n\t\tfragmentShader: ShaderChunk.meshlambert_frag\n\n\t},\n\n\tphong: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: new Color( 0x000000 ) },\n\t\t\t\tspecular: { value: new Color( 0x111111 ) },\n\t\t\t\tshininess: { value: 30 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphong_vert,\n\t\tfragmentShader: ShaderChunk.meshphong_frag\n\n\t},\n\n\tstandard: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.roughnessmap,\n\t\t\tUniformsLib.metalnessmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: new Color( 0x000000 ) },\n\t\t\t\troughness: { value: 1.0 },\n\t\t\t\tmetalness: { value: 0.0 },\n\t\t\t\tenvMapIntensity: { value: 1 } // temporary\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\n\t},\n\n\ttoon: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.gradientmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshtoon_vert,\n\t\tfragmentShader: ShaderChunk.meshtoon_frag\n\n\t},\n\n\tmatcap: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tmatcap: { value: null }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshmatcap_vert,\n\t\tfragmentShader: ShaderChunk.meshmatcap_frag\n\n\t},\n\n\tpoints: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.points,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.points_vert,\n\t\tfragmentShader: ShaderChunk.points_frag\n\n\t},\n\n\tdashed: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tscale: { value: 1 },\n\t\t\t\tdashSize: { value: 1 },\n\t\t\t\ttotalSize: { value: 2 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.linedashed_vert,\n\t\tfragmentShader: ShaderChunk.linedashed_frag\n\n\t},\n\n\tdepth: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.depth_vert,\n\t\tfragmentShader: ShaderChunk.depth_frag\n\n\t},\n\n\tnormal: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshnormal_vert,\n\t\tfragmentShader: ShaderChunk.meshnormal_frag\n\n\t},\n\n\tsprite: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.sprite,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.sprite_vert,\n\t\tfragmentShader: ShaderChunk.sprite_frag\n\n\t},\n\n\tbackground: {\n\n\t\tuniforms: {\n\t\t\tuvTransform: { value: new Matrix3() },\n\t\t\tt2D: { value: null },\n\t\t},\n\n\t\tvertexShader: ShaderChunk.background_vert,\n\t\tfragmentShader: ShaderChunk.background_frag\n\n\t},\n\t/* -------------------------------------------------------------------------\n\t//\tCube map shader\n\t ------------------------------------------------------------------------- */\n\n\tcube: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.envmap,\n\t\t\t{\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.cube_vert,\n\t\tfragmentShader: ShaderChunk.cube_frag\n\n\t},\n\n\tequirect: {\n\n\t\tuniforms: {\n\t\t\ttEquirect: { value: null },\n\t\t},\n\n\t\tvertexShader: ShaderChunk.equirect_vert,\n\t\tfragmentShader: ShaderChunk.equirect_frag\n\n\t},\n\n\tdistanceRGBA: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\treferencePosition: { value: new Vector3() },\n\t\t\t\tnearDistance: { value: 1 },\n\t\t\t\tfarDistance: { value: 1000 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.distanceRGBA_vert,\n\t\tfragmentShader: ShaderChunk.distanceRGBA_frag\n\n\t},\n\n\tshadow: {\n\n\t\tuniforms: mergeUniforms( [\n\t\t\tUniformsLib.lights,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tcolor: { value: new Color( 0x00000 ) },\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t},\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.shadow_vert,\n\t\tfragmentShader: ShaderChunk.shadow_frag\n\n\t}\n\n};\n\nShaderLib.physical = {\n\n\tuniforms: mergeUniforms( [\n\t\tShaderLib.standard.uniforms,\n\t\t{\n\t\t\tclearcoat: { value: 0 },\n\t\t\tclearcoatMap: { value: null },\n\t\t\tclearcoatRoughness: { value: 0 },\n\t\t\tclearcoatRoughnessMap: { value: null },\n\t\t\tclearcoatNormalScale: { value: new Vector2( 1, 1 ) },\n\t\t\tclearcoatNormalMap: { value: null },\n\t\t\tsheen: { value: 0 },\n\t\t\tsheenColor: { value: new Color( 0x000000 ) },\n\t\t\tsheenColorMap: { value: null },\n\t\t\tsheenRoughness: { value: 1 },\n\t\t\tsheenRoughnessMap: { value: null },\n\t\t\ttransmission: { value: 0 },\n\t\t\ttransmissionMap: { value: null },\n\t\t\ttransmissionSamplerSize: { value: new Vector2() },\n\t\t\ttransmissionSamplerMap: { value: null },\n\t\t\tthickness: { value: 0 },\n\t\t\tthicknessMap: { value: null },\n\t\t\tattenuationDistance: { value: 0 },\n\t\t\tattenuationColor: { value: new Color( 0x000000 ) },\n\t\t\tspecularIntensity: { value: 1 },\n\t\t\tspecularIntensityMap: { value: null },\n\t\t\tspecularColor: { value: new Color( 1, 1, 1 ) },\n\t\t\tspecularColorMap: { value: null },\n\t\t}\n\t] ),\n\n\tvertexShader: ShaderChunk.meshphysical_vert,\n\tfragmentShader: ShaderChunk.meshphysical_frag\n\n};\n\nfunction WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipliedAlpha ) {\n\n\tconst clearColor = new Color( 0x000000 );\n\tlet clearAlpha = alpha === true ? 0 : 1;\n\n\tlet planeMesh;\n\tlet boxMesh;\n\n\tlet currentBackground = null;\n\tlet currentBackgroundVersion = 0;\n\tlet currentTonemapping = null;\n\n\tfunction render( renderList, scene ) {\n\n\t\tlet forceClear = false;\n\t\tlet background = scene.isScene === true ? scene.background : null;\n\n\t\tif ( background && background.isTexture ) {\n\n\t\t\tbackground = cubemaps.get( background );\n\n\t\t}\n\n\t\t// Ignore background in AR\n\t\t// TODO: Reconsider this.\n\n\t\tconst xr = renderer.xr;\n\t\tconst session = xr.getSession && xr.getSession();\n\n\t\tif ( session && session.environmentBlendMode === 'additive' ) {\n\n\t\t\tbackground = null;\n\n\t\t}\n\n\t\tif ( background === null ) {\n\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t} else if ( background && background.isColor ) {\n\n\t\t\tsetClear( background, 1 );\n\t\t\tforceClear = true;\n\n\t\t}\n\n\t\tif ( renderer.autoClear || forceClear ) {\n\n\t\t\trenderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );\n\n\t\t}\n\n\t\tif ( background && ( background.isCubeTexture || background.mapping === CubeUVReflectionMapping ) ) {\n\n\t\t\tif ( boxMesh === undefined ) {\n\n\t\t\t\tboxMesh = new Mesh(\n\t\t\t\t\tnew BoxGeometry( 1, 1, 1 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundCubeMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.cube.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.cube.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.cube.fragmentShader,\n\t\t\t\t\t\tside: BackSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'normal' );\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'uv' );\n\n\t\t\t\tboxMesh.onBeforeRender = function ( renderer, scene, camera ) {\n\n\t\t\t\t\tthis.matrixWorld.copyPosition( camera.matrixWorld );\n\n\t\t\t\t};\n\n\t\t\t\t// enable code injection for non-built-in material\n\t\t\t\tObject.defineProperty( boxMesh.material, 'envMap', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.envMap.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( boxMesh );\n\n\t\t\t}\n\n\t\t\tboxMesh.material.uniforms.envMap.value = background;\n\t\t\tboxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tboxMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null );\n\n\t\t} else if ( background && background.isTexture ) {\n\n\t\t\tif ( planeMesh === undefined ) {\n\n\t\t\t\tplaneMesh = new Mesh(\n\t\t\t\t\tnew PlaneGeometry( 2, 2 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.background.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.background.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.background.fragmentShader,\n\t\t\t\t\t\tside: FrontSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tplaneMesh.geometry.deleteAttribute( 'normal' );\n\n\t\t\t\t// enable code injection for non-built-in material\n\t\t\t\tObject.defineProperty( planeMesh.material, 'map', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.t2D.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( planeMesh );\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.t2D.value = background;\n\n\t\t\tif ( background.matrixAutoUpdate === true ) {\n\n\t\t\t\tbackground.updateMatrix();\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.uvTransform.value.copy( background.matrix );\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tplaneMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null );\n\n\t\t}\n\n\t}\n\n\tfunction setClear( color, alpha ) {\n\n\t\tstate.buffers.color.setClear( color.r, color.g, color.b, alpha, premultipliedAlpha );\n\n\t}\n\n\treturn {\n\n\t\tgetClearColor: function () {\n\n\t\t\treturn clearColor;\n\n\t\t},\n\t\tsetClearColor: function ( color, alpha = 1 ) {\n\n\t\t\tclearColor.set( color );\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\tgetClearAlpha: function () {\n\n\t\t\treturn clearAlpha;\n\n\t\t},\n\t\tsetClearAlpha: function ( alpha ) {\n\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\trender: render\n\n\t};\n\n}\n\nfunction WebGLBindingStates( gl, extensions, attributes, capabilities ) {\n\n\tconst maxVertexAttributes = gl.getParameter( 34921 );\n\n\tconst extension = capabilities.isWebGL2 ? null : extensions.get( 'OES_vertex_array_object' );\n\tconst vaoAvailable = capabilities.isWebGL2 || extension !== null;\n\n\tconst bindingStates = {};\n\n\tconst defaultState = createBindingState( null );\n\tlet currentState = defaultState;\n\n\tfunction setup( object, material, program, geometry, index ) {\n\n\t\tlet updateBuffers = false;\n\n\t\tif ( vaoAvailable ) {\n\n\t\t\tconst state = getBindingState( geometry, program, material );\n\n\t\t\tif ( currentState !== state ) {\n\n\t\t\t\tcurrentState = state;\n\t\t\t\tbindVertexArrayObject( currentState.object );\n\n\t\t\t}\n\n\t\t\tupdateBuffers = needsUpdate( geometry, index );\n\n\t\t\tif ( updateBuffers ) saveCache( geometry, index );\n\n\t\t} else {\n\n\t\t\tconst wireframe = ( material.wireframe === true );\n\n\t\t\tif ( currentState.geometry !== geometry.id ||\n\t\t\t\tcurrentState.program !== program.id ||\n\t\t\t\tcurrentState.wireframe !== wireframe ) {\n\n\t\t\t\tcurrentState.geometry = geometry.id;\n\t\t\t\tcurrentState.program = program.id;\n\t\t\t\tcurrentState.wireframe = wireframe;\n\n\t\t\t\tupdateBuffers = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( object.isInstancedMesh === true ) {\n\n\t\t\tupdateBuffers = true;\n\n\t\t}\n\n\t\tif ( index !== null ) {\n\n\t\t\tattributes.update( index, 34963 );\n\n\t\t}\n\n\t\tif ( updateBuffers ) {\n\n\t\t\tsetupVertexAttributes( object, material, program, geometry );\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tgl.bindBuffer( 34963, attributes.get( index ).buffer );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction createVertexArrayObject() {\n\n\t\tif ( capabilities.isWebGL2 ) return gl.createVertexArray();\n\n\t\treturn extension.createVertexArrayOES();\n\n\t}\n\n\tfunction bindVertexArrayObject( vao ) {\n\n\t\tif ( capabilities.isWebGL2 ) return gl.bindVertexArray( vao );\n\n\t\treturn extension.bindVertexArrayOES( vao );\n\n\t}\n\n\tfunction deleteVertexArrayObject( vao ) {\n\n\t\tif ( capabilities.isWebGL2 ) return gl.deleteVertexArray( vao );\n\n\t\treturn extension.deleteVertexArrayOES( vao );\n\n\t}\n\n\tfunction getBindingState( geometry, program, material ) {\n\n\t\tconst wireframe = ( material.wireframe === true );\n\n\t\tlet programMap = bindingStates[ geometry.id ];\n\n\t\tif ( programMap === undefined ) {\n\n\t\t\tprogramMap = {};\n\t\t\tbindingStates[ geometry.id ] = programMap;\n\n\t\t}\n\n\t\tlet stateMap = programMap[ program.id ];\n\n\t\tif ( stateMap === undefined ) {\n\n\t\t\tstateMap = {};\n\t\t\tprogramMap[ program.id ] = stateMap;\n\n\t\t}\n\n\t\tlet state = stateMap[ wireframe ];\n\n\t\tif ( state === undefined ) {\n\n\t\t\tstate = createBindingState( createVertexArrayObject() );\n\t\t\tstateMap[ wireframe ] = state;\n\n\t\t}\n\n\t\treturn state;\n\n\t}\n\n\tfunction createBindingState( vao ) {\n\n\t\tconst newAttributes = [];\n\t\tconst enabledAttributes = [];\n\t\tconst attributeDivisors = [];\n\n\t\tfor ( let i = 0; i < maxVertexAttributes; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\t\t\tenabledAttributes[ i ] = 0;\n\t\t\tattributeDivisors[ i ] = 0;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\t// for backward compatibility on non-VAO support browser\n\t\t\tgeometry: null,\n\t\t\tprogram: null,\n\t\t\twireframe: false,\n\n\t\t\tnewAttributes: newAttributes,\n\t\t\tenabledAttributes: enabledAttributes,\n\t\t\tattributeDivisors: attributeDivisors,\n\t\t\tobject: vao,\n\t\t\tattributes: {},\n\t\t\tindex: null\n\n\t\t};\n\n\t}\n\n\tfunction needsUpdate( geometry, index ) {\n\n\t\tconst cachedAttributes = currentState.attributes;\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tlet attributesNum = 0;\n\n\t\tfor ( const key in geometryAttributes ) {\n\n\t\t\tconst cachedAttribute = cachedAttributes[ key ];\n\t\t\tconst geometryAttribute = geometryAttributes[ key ];\n\n\t\t\tif ( cachedAttribute === undefined ) return true;\n\n\t\t\tif ( cachedAttribute.attribute !== geometryAttribute ) return true;\n\n\t\t\tif ( cachedAttribute.data !== geometryAttribute.data ) return true;\n\n\t\t\tattributesNum ++;\n\n\t\t}\n\n\t\tif ( currentState.attributesNum !== attributesNum ) return true;\n\n\t\tif ( currentState.index !== index ) return true;\n\n\t\treturn false;\n\n\t}\n\n\tfunction saveCache( geometry, index ) {\n\n\t\tconst cache = {};\n\t\tconst attributes = geometry.attributes;\n\t\tlet attributesNum = 0;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\n\t\t\tconst data = {};\n\t\t\tdata.attribute = attribute;\n\n\t\t\tif ( attribute.data ) {\n\n\t\t\t\tdata.data = attribute.data;\n\n\t\t\t}\n\n\t\t\tcache[ key ] = data;\n\n\t\t\tattributesNum ++;\n\n\t\t}\n\n\t\tcurrentState.attributes = cache;\n\t\tcurrentState.attributesNum = attributesNum;\n\n\t\tcurrentState.index = index;\n\n\t}\n\n\tfunction initAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\n\t\tfor ( let i = 0, il = newAttributes.length; i < il; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\tfunction enableAttribute( attribute ) {\n\n\t\tenableAttributeAndDivisor( attribute, 0 );\n\n\t}\n\n\tfunction enableAttributeAndDivisor( attribute, meshPerAttribute ) {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\t\tconst attributeDivisors = currentState.attributeDivisors;\n\n\t\tnewAttributes[ attribute ] = 1;\n\n\t\tif ( enabledAttributes[ attribute ] === 0 ) {\n\n\t\t\tgl.enableVertexAttribArray( attribute );\n\t\t\tenabledAttributes[ attribute ] = 1;\n\n\t\t}\n\n\t\tif ( attributeDivisors[ attribute ] !== meshPerAttribute ) {\n\n\t\t\tconst extension = capabilities.isWebGL2 ? gl : extensions.get( 'ANGLE_instanced_arrays' );\n\n\t\t\textension[ capabilities.isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE' ]( attribute, meshPerAttribute );\n\t\t\tattributeDivisors[ attribute ] = meshPerAttribute;\n\n\t\t}\n\n\t}\n\n\tfunction disableUnusedAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\n\t\tfor ( let i = 0, il = enabledAttributes.length; i < il; i ++ ) {\n\n\t\t\tif ( enabledAttributes[ i ] !== newAttributes[ i ] ) {\n\n\t\t\t\tgl.disableVertexAttribArray( i );\n\t\t\t\tenabledAttributes[ i ] = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction vertexAttribPointer( index, size, type, normalized, stride, offset ) {\n\n\t\tif ( capabilities.isWebGL2 === true && ( type === 5124 || type === 5125 ) ) {\n\n\t\t\tgl.vertexAttribIPointer( index, size, type, stride, offset );\n\n\t\t} else {\n\n\t\t\tgl.vertexAttribPointer( index, size, type, normalized, stride, offset );\n\n\t\t}\n\n\t}\n\n\tfunction setupVertexAttributes( object, material, program, geometry ) {\n\n\t\tif ( capabilities.isWebGL2 === false && ( object.isInstancedMesh || geometry.isInstancedBufferGeometry ) ) {\n\n\t\t\tif ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) return;\n\n\t\t}\n\n\t\tinitAttributes();\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tconst materialDefaultAttributeValues = material.defaultAttributeValues;\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tlet geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\tif ( geometryAttribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometryAttribute !== undefined ) {\n\n\t\t\t\t\tconst normalized = geometryAttribute.normalized;\n\t\t\t\t\tconst size = geometryAttribute.itemSize;\n\n\t\t\t\t\tconst attribute = attributes.get( geometryAttribute );\n\n\t\t\t\t\t// TODO Attribute may not be available on context restore\n\n\t\t\t\t\tif ( attribute === undefined ) continue;\n\n\t\t\t\t\tconst buffer = attribute.buffer;\n\t\t\t\t\tconst type = attribute.type;\n\t\t\t\t\tconst bytesPerElement = attribute.bytesPerElement;\n\n\t\t\t\t\tif ( geometryAttribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst data = geometryAttribute.data;\n\t\t\t\t\t\tconst stride = data.stride;\n\t\t\t\t\t\tconst offset = geometryAttribute.offset;\n\n\t\t\t\t\t\tif ( data && data.isInstancedInterleavedBuffer ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, data.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = data.meshPerAttribute * data.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( 34962, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tstride * bytesPerElement,\n\t\t\t\t\t\t\t\t( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( geometryAttribute.isInstancedBufferAttribute ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, geometryAttribute.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( 34962, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tsize * bytesPerElement,\n\t\t\t\t\t\t\t\t( size / programAttribute.locationSize ) * i * bytesPerElement\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( materialDefaultAttributeValues !== undefined ) {\n\n\t\t\t\t\tconst value = materialDefaultAttributeValues[ name ];\n\n\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\tswitch ( value.length ) {\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tgl.vertexAttrib2fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tgl.vertexAttrib3fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tgl.vertexAttrib4fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tgl.vertexAttrib1fv( programAttribute.location, value );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tdisableUnusedAttributes();\n\n\t}\n\n\tfunction dispose() {\n\n\t\treset();\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tfor ( const programId in programMap ) {\n\n\t\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[ programId ];\n\n\t\t\t}\n\n\t\t\tdelete bindingStates[ geometryId ];\n\n\t\t}\n\n\t}\n\n\tfunction releaseStatesOfGeometry( geometry ) {\n\n\t\tif ( bindingStates[ geometry.id ] === undefined ) return;\n\n\t\tconst programMap = bindingStates[ geometry.id ];\n\n\t\tfor ( const programId in programMap ) {\n\n\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ programId ];\n\n\t\t}\n\n\t\tdelete bindingStates[ geometry.id ];\n\n\t}\n\n\tfunction releaseStatesOfProgram( program ) {\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tif ( programMap[ program.id ] === undefined ) continue;\n\n\t\t\tconst stateMap = programMap[ program.id ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ program.id ];\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\tresetDefaultState();\n\n\t\tif ( currentState === defaultState ) return;\n\n\t\tcurrentState = defaultState;\n\t\tbindVertexArrayObject( currentState.object );\n\n\t}\n\n\t// for backward-compatilibity\n\n\tfunction resetDefaultState() {\n\n\t\tdefaultState.geometry = null;\n\t\tdefaultState.program = null;\n\t\tdefaultState.wireframe = false;\n\n\t}\n\n\treturn {\n\n\t\tsetup: setup,\n\t\treset: reset,\n\t\tresetDefaultState: resetDefaultState,\n\t\tdispose: dispose,\n\t\treleaseStatesOfGeometry: releaseStatesOfGeometry,\n\t\treleaseStatesOfProgram: releaseStatesOfProgram,\n\n\t\tinitAttributes: initAttributes,\n\t\tenableAttribute: enableAttribute,\n\t\tdisableUnusedAttributes: disableUnusedAttributes\n\n\t};\n\n}\n\nfunction WebGLBufferRenderer( gl, extensions, info, capabilities ) {\n\n\tconst isWebGL2 = capabilities.isWebGL2;\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawArrays( mode, start, count );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tlet extension, methodName;\n\n\t\tif ( isWebGL2 ) {\n\n\t\t\textension = gl;\n\t\t\tmethodName = 'drawArraysInstanced';\n\n\t\t} else {\n\n\t\t\textension = extensions.get( 'ANGLE_instanced_arrays' );\n\t\t\tmethodName = 'drawArraysInstancedANGLE';\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\textension[ methodName ]( mode, start, count, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\n}\n\nfunction WebGLCapabilities( gl, extensions, parameters ) {\n\n\tlet maxAnisotropy;\n\n\tfunction getMaxAnisotropy() {\n\n\t\tif ( maxAnisotropy !== undefined ) return maxAnisotropy;\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\n\t\t\tmaxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT );\n\n\t\t} else {\n\n\t\t\tmaxAnisotropy = 0;\n\n\t\t}\n\n\t\treturn maxAnisotropy;\n\n\t}\n\n\tfunction getMaxPrecision( precision ) {\n\n\t\tif ( precision === 'highp' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( 35633, 36338 ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( 35632, 36338 ).precision > 0 ) {\n\n\t\t\t\treturn 'highp';\n\n\t\t\t}\n\n\t\t\tprecision = 'mediump';\n\n\t\t}\n\n\t\tif ( precision === 'mediump' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( 35633, 36337 ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( 35632, 36337 ).precision > 0 ) {\n\n\t\t\t\treturn 'mediump';\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn 'lowp';\n\n\t}\n\n\tconst isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext ) ||\n\t\t( typeof WebGL2ComputeRenderingContext !== 'undefined' && gl instanceof WebGL2ComputeRenderingContext );\n\n\tlet precision = parameters.precision !== undefined ? parameters.precision : 'highp';\n\tconst maxPrecision = getMaxPrecision( precision );\n\n\tif ( maxPrecision !== precision ) {\n\n\t\tconsole.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );\n\t\tprecision = maxPrecision;\n\n\t}\n\n\tconst drawBuffers = isWebGL2 || extensions.has( 'WEBGL_draw_buffers' );\n\n\tconst logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;\n\n\tconst maxTextures = gl.getParameter( 34930 );\n\tconst maxVertexTextures = gl.getParameter( 35660 );\n\tconst maxTextureSize = gl.getParameter( 3379 );\n\tconst maxCubemapSize = gl.getParameter( 34076 );\n\n\tconst maxAttributes = gl.getParameter( 34921 );\n\tconst maxVertexUniforms = gl.getParameter( 36347 );\n\tconst maxVaryings = gl.getParameter( 36348 );\n\tconst maxFragmentUniforms = gl.getParameter( 36349 );\n\n\tconst vertexTextures = maxVertexTextures > 0;\n\tconst floatFragmentTextures = isWebGL2 || extensions.has( 'OES_texture_float' );\n\tconst floatVertexTextures = vertexTextures && floatFragmentTextures;\n\n\tconst maxSamples = isWebGL2 ? gl.getParameter( 36183 ) : 0;\n\n\treturn {\n\n\t\tisWebGL2: isWebGL2,\n\n\t\tdrawBuffers: drawBuffers,\n\n\t\tgetMaxAnisotropy: getMaxAnisotropy,\n\t\tgetMaxPrecision: getMaxPrecision,\n\n\t\tprecision: precision,\n\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\n\t\tmaxTextures: maxTextures,\n\t\tmaxVertexTextures: maxVertexTextures,\n\t\tmaxTextureSize: maxTextureSize,\n\t\tmaxCubemapSize: maxCubemapSize,\n\n\t\tmaxAttributes: maxAttributes,\n\t\tmaxVertexUniforms: maxVertexUniforms,\n\t\tmaxVaryings: maxVaryings,\n\t\tmaxFragmentUniforms: maxFragmentUniforms,\n\n\t\tvertexTextures: vertexTextures,\n\t\tfloatFragmentTextures: floatFragmentTextures,\n\t\tfloatVertexTextures: floatVertexTextures,\n\n\t\tmaxSamples: maxSamples\n\n\t};\n\n}\n\nfunction WebGLClipping( properties ) {\n\n\tconst scope = this;\n\n\tlet globalState = null,\n\t\tnumGlobalPlanes = 0,\n\t\tlocalClippingEnabled = false,\n\t\trenderingShadows = false;\n\n\tconst plane = new Plane(),\n\t\tviewNormalMatrix = new Matrix3(),\n\n\t\tuniform = { value: null, needsUpdate: false };\n\n\tthis.uniform = uniform;\n\tthis.numPlanes = 0;\n\tthis.numIntersection = 0;\n\n\tthis.init = function ( planes, enableLocalClipping, camera ) {\n\n\t\tconst enabled =\n\t\t\tplanes.length !== 0 ||\n\t\t\tenableLocalClipping ||\n\t\t\t// enable state of previous frame - the clipping code has to\n\t\t\t// run another frame in order to reset the state:\n\t\t\tnumGlobalPlanes !== 0 ||\n\t\t\tlocalClippingEnabled;\n\n\t\tlocalClippingEnabled = enableLocalClipping;\n\n\t\tglobalState = projectPlanes( planes, camera, 0 );\n\t\tnumGlobalPlanes = planes.length;\n\n\t\treturn enabled;\n\n\t};\n\n\tthis.beginShadows = function () {\n\n\t\trenderingShadows = true;\n\t\tprojectPlanes( null );\n\n\t};\n\n\tthis.endShadows = function () {\n\n\t\trenderingShadows = false;\n\t\tresetGlobalState();\n\n\t};\n\n\tthis.setState = function ( material, camera, useCache ) {\n\n\t\tconst planes = material.clippingPlanes,\n\t\t\tclipIntersection = material.clipIntersection,\n\t\t\tclipShadows = material.clipShadows;\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tif ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) {\n\n\t\t\t// there's no local clipping\n\n\t\t\tif ( renderingShadows ) {\n\n\t\t\t\t// there's no global clipping\n\n\t\t\t\tprojectPlanes( null );\n\n\t\t\t} else {\n\n\t\t\t\tresetGlobalState();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst nGlobal = renderingShadows ? 0 : numGlobalPlanes,\n\t\t\t\tlGlobal = nGlobal * 4;\n\n\t\t\tlet dstArray = materialProperties.clippingState || null;\n\n\t\t\tuniform.value = dstArray; // ensure unique state\n\n\t\t\tdstArray = projectPlanes( planes, camera, lGlobal, useCache );\n\n\t\t\tfor ( let i = 0; i !== lGlobal; ++ i ) {\n\n\t\t\t\tdstArray[ i ] = globalState[ i ];\n\n\t\t\t}\n\n\t\t\tmaterialProperties.clippingState = dstArray;\n\t\t\tthis.numIntersection = clipIntersection ? this.numPlanes : 0;\n\t\t\tthis.numPlanes += nGlobal;\n\n\t\t}\n\n\n\t};\n\n\tfunction resetGlobalState() {\n\n\t\tif ( uniform.value !== globalState ) {\n\n\t\t\tuniform.value = globalState;\n\t\t\tuniform.needsUpdate = numGlobalPlanes > 0;\n\n\t\t}\n\n\t\tscope.numPlanes = numGlobalPlanes;\n\t\tscope.numIntersection = 0;\n\n\t}\n\n\tfunction projectPlanes( planes, camera, dstOffset, skipTransform ) {\n\n\t\tconst nPlanes = planes !== null ? planes.length : 0;\n\t\tlet dstArray = null;\n\n\t\tif ( nPlanes !== 0 ) {\n\n\t\t\tdstArray = uniform.value;\n\n\t\t\tif ( skipTransform !== true || dstArray === null ) {\n\n\t\t\t\tconst flatSize = dstOffset + nPlanes * 4,\n\t\t\t\t\tviewMatrix = camera.matrixWorldInverse;\n\n\t\t\t\tviewNormalMatrix.getNormalMatrix( viewMatrix );\n\n\t\t\t\tif ( dstArray === null || dstArray.length < flatSize ) {\n\n\t\t\t\t\tdstArray = new Float32Array( flatSize );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, i4 = dstOffset; i !== nPlanes; ++ i, i4 += 4 ) {\n\n\t\t\t\t\tplane.copy( planes[ i ] ).applyMatrix4( viewMatrix, viewNormalMatrix );\n\n\t\t\t\t\tplane.normal.toArray( dstArray, i4 );\n\t\t\t\t\tdstArray[ i4 + 3 ] = plane.constant;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tuniform.value = dstArray;\n\t\t\tuniform.needsUpdate = true;\n\n\t\t}\n\n\t\tscope.numPlanes = nPlanes;\n\t\tscope.numIntersection = 0;\n\n\t\treturn dstArray;\n\n\t}\n\n}\n\nfunction WebGLCubeMaps( renderer ) {\n\n\tlet cubemaps = new WeakMap();\n\n\tfunction mapTextureMapping( texture, mapping ) {\n\n\t\tif ( mapping === EquirectangularReflectionMapping ) {\n\n\t\t\ttexture.mapping = CubeReflectionMapping;\n\n\t\t} else if ( mapping === EquirectangularRefractionMapping ) {\n\n\t\t\ttexture.mapping = CubeRefractionMapping;\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture && texture.isRenderTargetTexture === false ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tif ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) {\n\n\t\t\t\tif ( cubemaps.has( texture ) ) {\n\n\t\t\t\t\tconst cubemap = cubemaps.get( texture ).texture;\n\t\t\t\t\treturn mapTextureMapping( cubemap, texture.mapping );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\tif ( image && image.height > 0 ) {\n\n\t\t\t\t\t\tconst renderTarget = new WebGLCubeRenderTarget( image.height / 2 );\n\t\t\t\t\t\trenderTarget.fromEquirectangularTexture( renderer, texture );\n\t\t\t\t\t\tcubemaps.set( texture, renderTarget );\n\n\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\treturn mapTextureMapping( renderTarget.texture, texture.mapping );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemap = cubemaps.get( texture );\n\n\t\tif ( cubemap !== undefined ) {\n\n\t\t\tcubemaps.delete( texture );\n\t\t\tcubemap.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubemaps = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nclass OrthographicCamera extends Camera {\n\n\tconstructor( left = - 1, right = 1, top = 1, bottom = - 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'OrthographicCamera';\n\n\t\tthis.zoom = 1;\n\t\tthis.view = null;\n\n\t\tthis.left = left;\n\t\tthis.right = right;\n\t\tthis.top = top;\n\t\tthis.bottom = bottom;\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.left = source.left;\n\t\tthis.right = source.right;\n\t\tthis.top = source.top;\n\t\tthis.bottom = source.bottom;\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\n\t\tthis.zoom = source.zoom;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\treturn this;\n\n\t}\n\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tupdateProjectionMatrix() {\n\n\t\tconst dx = ( this.right - this.left ) / ( 2 * this.zoom );\n\t\tconst dy = ( this.top - this.bottom ) / ( 2 * this.zoom );\n\t\tconst cx = ( this.right + this.left ) / 2;\n\t\tconst cy = ( this.top + this.bottom ) / 2;\n\n\t\tlet left = cx - dx;\n\t\tlet right = cx + dx;\n\t\tlet top = cy + dy;\n\t\tlet bottom = cy - dy;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst scaleW = ( this.right - this.left ) / this.view.fullWidth / this.zoom;\n\t\t\tconst scaleH = ( this.top - this.bottom ) / this.view.fullHeight / this.zoom;\n\n\t\t\tleft += scaleW * this.view.offsetX;\n\t\t\tright = left + scaleW * this.view.width;\n\t\t\ttop -= scaleH * this.view.offsetY;\n\t\t\tbottom = top - scaleH * this.view.height;\n\n\t\t}\n\n\t\tthis.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.zoom = this.zoom;\n\t\tdata.object.left = this.left;\n\t\tdata.object.right = this.right;\n\t\tdata.object.top = this.top;\n\t\tdata.object.bottom = this.bottom;\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\treturn data;\n\n\t}\n\n}\n\nOrthographicCamera.prototype.isOrthographicCamera = true;\n\nclass RawShaderMaterial extends ShaderMaterial {\n\n\tconstructor( parameters ) {\n\n\t\tsuper( parameters );\n\n\t\tthis.type = 'RawShaderMaterial';\n\n\t}\n\n}\n\nRawShaderMaterial.prototype.isRawShaderMaterial = true;\n\nconst LOD_MIN = 4;\nconst LOD_MAX = 8;\nconst SIZE_MAX = Math.pow( 2, LOD_MAX );\n\n// The standard deviations (radians) associated with the extra mips. These are\n// chosen to approximate a Trowbridge-Reitz distribution function times the\n// geometric shadowing function. These sigma values squared must match the\n// variance #defines in cube_uv_reflection_fragment.glsl.js.\nconst EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ];\n\nconst TOTAL_LODS = LOD_MAX - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length;\n\n// The maximum length of the blur for loop. Smaller sigmas will use fewer\n// samples and exit early, but not recompile the shader.\nconst MAX_SAMPLES = 20;\n\nconst _flatCamera = /*@__PURE__*/ new OrthographicCamera();\nconst { _lodPlanes, _sizeLods, _sigmas } = /*@__PURE__*/ _createPlanes();\nconst _clearColor = /*@__PURE__*/ new Color();\nlet _oldTarget = null;\n\n// Golden Ratio\nconst PHI = ( 1 + Math.sqrt( 5 ) ) / 2;\nconst INV_PHI = 1 / PHI;\n\n// Vertices of a dodecahedron (except the opposites, which represent the\n// same axis), used as axis directions evenly spread on a sphere.\nconst _axisDirections = [\n\t/*@__PURE__*/ new Vector3( 1, 1, 1 ),\n\t/*@__PURE__*/ new Vector3( - 1, 1, 1 ),\n\t/*@__PURE__*/ new Vector3( 1, 1, - 1 ),\n\t/*@__PURE__*/ new Vector3( - 1, 1, - 1 ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),\n\t/*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),\n\t/*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ) ];\n\n/**\n * This class generates a Prefiltered, Mipmapped Radiance Environment Map\n * (PMREM) from a cubeMap environment texture. This allows different levels of\n * blur to be quickly accessed based on material roughness. It is packed into a\n * special CubeUV format that allows us to perform custom interpolation so that\n * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap\n * chain, it only goes down to the LOD_MIN level (above), and then creates extra\n * even more filtered 'mips' at the same LOD_MIN resolution, associated with\n * higher roughness levels. In this way we maintain resolution to smoothly\n * interpolate diffuse lighting while limiting sampling computation.\n *\n * Paper: Fast, Accurate Image-Based Lighting\n * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view\n*/\n\nclass PMREMGenerator {\n\n\tconstructor( renderer ) {\n\n\t\tthis._renderer = renderer;\n\t\tthis._pingPongRenderTarget = null;\n\n\t\tthis._blurMaterial = _getBlurShader( MAX_SAMPLES );\n\t\tthis._equirectShader = null;\n\t\tthis._cubemapShader = null;\n\n\t\tthis._compileMaterial( this._blurMaterial );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from a supplied Scene, which can be faster than using an\n\t * image if networking bandwidth is low. Optional sigma specifies a blur radius\n\t * in radians to be applied to the scene before PMREM generation. Optional near\n\t * and far planes ensure the scene is rendered in its entirety (the cubeCamera\n\t * is placed at the origin).\n\t */\n\tfromScene( scene, sigma = 0, near = 0.1, far = 100 ) {\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\tconst cubeUVRenderTarget = this._allocateTargets();\n\n\t\tthis._sceneToCubeUV( scene, near, far, cubeUVRenderTarget );\n\t\tif ( sigma > 0 ) {\n\n\t\t\tthis._blur( cubeUVRenderTarget, 0, 0, sigma );\n\n\t\t}\n\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an equirectangular texture, which can be either LDR\n\t * or HDR. The ideal input image size is 1k (1024 x 512),\n\t * as this matches best with the 256 x 256 cubemap output.\n\t */\n\tfromEquirectangular( equirectangular, renderTarget = null ) {\n\n\t\treturn this._fromTexture( equirectangular, renderTarget );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an cubemap texture, which can be either LDR\n\t * or HDR. The ideal input cube size is 256 x 256,\n\t * as this matches best with the 256 x 256 cubemap output.\n\t */\n\tfromCubemap( cubemap, renderTarget = null ) {\n\n\t\treturn this._fromTexture( cubemap, renderTarget );\n\n\t}\n\n\t/**\n\t * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileCubemapShader() {\n\n\t\tif ( this._cubemapShader === null ) {\n\n\t\t\tthis._cubemapShader = _getCubemapShader();\n\t\t\tthis._compileMaterial( this._cubemapShader );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileEquirectangularShader() {\n\n\t\tif ( this._equirectShader === null ) {\n\n\t\t\tthis._equirectShader = _getEquirectShader();\n\t\t\tthis._compileMaterial( this._equirectShader );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,\n\t * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on\n\t * one of them will cause any others to also become unusable.\n\t */\n\tdispose() {\n\n\t\tthis._blurMaterial.dispose();\n\n\t\tif ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose();\n\n\t\tif ( this._cubemapShader !== null ) this._cubemapShader.dispose();\n\t\tif ( this._equirectShader !== null ) this._equirectShader.dispose();\n\n\t\tfor ( let i = 0; i < _lodPlanes.length; i ++ ) {\n\n\t\t\t_lodPlanes[ i ].dispose();\n\n\t\t}\n\n\t}\n\n\t// private interface\n\n\t_cleanup( outputTarget ) {\n\n\t\tthis._renderer.setRenderTarget( _oldTarget );\n\t\toutputTarget.scissorTest = false;\n\t\t_setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height );\n\n\t}\n\n\t_fromTexture( texture, renderTarget ) {\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\tconst cubeUVRenderTarget = renderTarget || this._allocateTargets( texture );\n\t\tthis._textureToCubeUV( texture, cubeUVRenderTarget );\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_allocateTargets( texture ) { // warning: null texture is valid\n\n\t\tconst params = {\n\t\t\tmagFilter: LinearFilter,\n\t\t\tminFilter: LinearFilter,\n\t\t\tgenerateMipmaps: false,\n\t\t\ttype: HalfFloatType,\n\t\t\tformat: RGBAFormat,\n\t\t\tencoding: LinearEncoding,\n\t\t\tdepthBuffer: false\n\t\t};\n\n\t\tconst cubeUVRenderTarget = _createRenderTarget( params );\n\t\tcubeUVRenderTarget.depthBuffer = texture ? false : true;\n\n\t\tif ( this._pingPongRenderTarget === null ) {\n\n\t\t\tthis._pingPongRenderTarget = _createRenderTarget( params );\n\n\t\t}\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_compileMaterial( material ) {\n\n\t\tconst tmpMesh = new Mesh( _lodPlanes[ 0 ], material );\n\t\tthis._renderer.compile( tmpMesh, _flatCamera );\n\n\t}\n\n\t_sceneToCubeUV( scene, near, far, cubeUVRenderTarget ) {\n\n\t\tconst fov = 90;\n\t\tconst aspect = 1;\n\t\tconst cubeCamera = new PerspectiveCamera( fov, aspect, near, far );\n\t\tconst upSign = [ 1, - 1, 1, 1, 1, 1 ];\n\t\tconst forwardSign = [ 1, 1, 1, - 1, - 1, - 1 ];\n\t\tconst renderer = this._renderer;\n\n\t\tconst originalAutoClear = renderer.autoClear;\n\t\tconst toneMapping = renderer.toneMapping;\n\t\trenderer.getClearColor( _clearColor );\n\n\t\trenderer.toneMapping = NoToneMapping;\n\t\trenderer.autoClear = false;\n\n\t\tconst backgroundMaterial = new MeshBasicMaterial( {\n\t\t\tname: 'PMREM.Background',\n\t\t\tside: BackSide,\n\t\t\tdepthWrite: false,\n\t\t\tdepthTest: false,\n\t\t} );\n\n\t\tconst backgroundBox = new Mesh( new BoxGeometry(), backgroundMaterial );\n\n\t\tlet useSolidColor = false;\n\t\tconst background = scene.background;\n\n\t\tif ( background ) {\n\n\t\t\tif ( background.isColor ) {\n\n\t\t\t\tbackgroundMaterial.color.copy( background );\n\t\t\t\tscene.background = null;\n\t\t\t\tuseSolidColor = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tbackgroundMaterial.color.copy( _clearColor );\n\t\t\tuseSolidColor = true;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst col = i % 3;\n\t\t\tif ( col === 0 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.lookAt( forwardSign[ i ], 0, 0 );\n\n\t\t\t} else if ( col === 1 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, 0, upSign[ i ] );\n\t\t\t\tcubeCamera.lookAt( 0, forwardSign[ i ], 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.lookAt( 0, 0, forwardSign[ i ] );\n\n\t\t\t}\n\n\t\t\t_setViewport( cubeUVRenderTarget,\n\t\t\t\tcol * SIZE_MAX, i > 2 ? SIZE_MAX : 0, SIZE_MAX, SIZE_MAX );\n\t\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\n\t\t\tif ( useSolidColor ) {\n\n\t\t\t\trenderer.render( backgroundBox, cubeCamera );\n\n\t\t\t}\n\n\t\t\trenderer.render( scene, cubeCamera );\n\n\t\t}\n\n\t\tbackgroundBox.geometry.dispose();\n\t\tbackgroundBox.material.dispose();\n\n\t\trenderer.toneMapping = toneMapping;\n\t\trenderer.autoClear = originalAutoClear;\n\t\tscene.background = background;\n\n\t}\n\n\t_textureToCubeUV( texture, cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\n\t\tconst isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping );\n\n\t\tif ( isCubeTexture ) {\n\n\t\t\tif ( this._cubemapShader === null ) {\n\n\t\t\t\tthis._cubemapShader = _getCubemapShader();\n\n\t\t\t}\n\n\t\t\tthis._cubemapShader.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t} else {\n\n\t\t\tif ( this._equirectShader === null ) {\n\n\t\t\t\tthis._equirectShader = _getEquirectShader();\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst material = isCubeTexture ? this._cubemapShader : this._equirectShader;\n\t\tconst mesh = new Mesh( _lodPlanes[ 0 ], material );\n\n\t\tconst uniforms = material.uniforms;\n\n\t\tuniforms[ 'envMap' ].value = texture;\n\n\t\tif ( ! isCubeTexture ) {\n\n\t\t\tuniforms[ 'texelSize' ].value.set( 1.0 / texture.image.width, 1.0 / texture.image.height );\n\n\t\t}\n\n\t\t_setViewport( cubeUVRenderTarget, 0, 0, 3 * SIZE_MAX, 2 * SIZE_MAX );\n\n\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\t\trenderer.render( mesh, _flatCamera );\n\n\t}\n\n\t_applyPMREM( cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst autoClear = renderer.autoClear;\n\t\trenderer.autoClear = false;\n\n\t\tfor ( let i = 1; i < TOTAL_LODS; i ++ ) {\n\n\t\t\tconst sigma = Math.sqrt( _sigmas[ i ] * _sigmas[ i ] - _sigmas[ i - 1 ] * _sigmas[ i - 1 ] );\n\n\t\t\tconst poleAxis = _axisDirections[ ( i - 1 ) % _axisDirections.length ];\n\n\t\t\tthis._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );\n\n\t\t}\n\n\t\trenderer.autoClear = autoClear;\n\n\t}\n\n\t/**\n\t * This is a two-pass Gaussian blur for a cubemap. Normally this is done\n\t * vertically and horizontally, but this breaks down on a cube. Here we apply\n\t * the blur latitudinally (around the poles), and then longitudinally (towards\n\t * the poles) to approximate the orthogonally-separable blur. It is least\n\t * accurate at the poles, but still does a decent job.\n\t */\n\t_blur( cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis ) {\n\n\t\tconst pingPongRenderTarget = this._pingPongRenderTarget;\n\n\t\tthis._halfBlur(\n\t\t\tcubeUVRenderTarget,\n\t\t\tpingPongRenderTarget,\n\t\t\tlodIn,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'latitudinal',\n\t\t\tpoleAxis );\n\n\t\tthis._halfBlur(\n\t\t\tpingPongRenderTarget,\n\t\t\tcubeUVRenderTarget,\n\t\t\tlodOut,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'longitudinal',\n\t\t\tpoleAxis );\n\n\t}\n\n\t_halfBlur( targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst blurMaterial = this._blurMaterial;\n\n\t\tif ( direction !== 'latitudinal' && direction !== 'longitudinal' ) {\n\n\t\t\tconsole.error(\n\t\t\t\t'blur direction must be either latitudinal or longitudinal!' );\n\n\t\t}\n\n\t\t// Number of standard deviations at which to cut off the discrete approximation.\n\t\tconst STANDARD_DEVIATIONS = 3;\n\n\t\tconst blurMesh = new Mesh( _lodPlanes[ lodOut ], blurMaterial );\n\t\tconst blurUniforms = blurMaterial.uniforms;\n\n\t\tconst pixels = _sizeLods[ lodIn ] - 1;\n\t\tconst radiansPerPixel = isFinite( sigmaRadians ) ? Math.PI / ( 2 * pixels ) : 2 * Math.PI / ( 2 * MAX_SAMPLES - 1 );\n\t\tconst sigmaPixels = sigmaRadians / radiansPerPixel;\n\t\tconst samples = isFinite( sigmaRadians ) ? 1 + Math.floor( STANDARD_DEVIATIONS * sigmaPixels ) : MAX_SAMPLES;\n\n\t\tif ( samples > MAX_SAMPLES ) {\n\n\t\t\tconsole.warn( `sigmaRadians, ${\n\t\t\t\tsigmaRadians}, is too large and will clip, as it requested ${\n\t\t\t\tsamples} samples when the maximum is set to ${MAX_SAMPLES}` );\n\n\t\t}\n\n\t\tconst weights = [];\n\t\tlet sum = 0;\n\n\t\tfor ( let i = 0; i < MAX_SAMPLES; ++ i ) {\n\n\t\t\tconst x = i / sigmaPixels;\n\t\t\tconst weight = Math.exp( - x * x / 2 );\n\t\t\tweights.push( weight );\n\n\t\t\tif ( i === 0 ) {\n\n\t\t\t\tsum += weight;\n\n\t\t\t} else if ( i < samples ) {\n\n\t\t\t\tsum += 2 * weight;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let i = 0; i < weights.length; i ++ ) {\n\n\t\t\tweights[ i ] = weights[ i ] / sum;\n\n\t\t}\n\n\t\tblurUniforms[ 'envMap' ].value = targetIn.texture;\n\t\tblurUniforms[ 'samples' ].value = samples;\n\t\tblurUniforms[ 'weights' ].value = weights;\n\t\tblurUniforms[ 'latitudinal' ].value = direction === 'latitudinal';\n\n\t\tif ( poleAxis ) {\n\n\t\t\tblurUniforms[ 'poleAxis' ].value = poleAxis;\n\n\t\t}\n\n\t\tblurUniforms[ 'dTheta' ].value = radiansPerPixel;\n\t\tblurUniforms[ 'mipInt' ].value = LOD_MAX - lodIn;\n\n\t\tconst outputSize = _sizeLods[ lodOut ];\n\t\tconst x = 3 * Math.max( 0, SIZE_MAX - 2 * outputSize );\n\t\tconst y = ( lodOut === 0 ? 0 : 2 * SIZE_MAX ) + 2 * outputSize * ( lodOut > LOD_MAX - LOD_MIN ? lodOut - LOD_MAX + LOD_MIN : 0 );\n\n\t\t_setViewport( targetOut, x, y, 3 * outputSize, 2 * outputSize );\n\t\trenderer.setRenderTarget( targetOut );\n\t\trenderer.render( blurMesh, _flatCamera );\n\n\t}\n\n}\n\nfunction _createPlanes() {\n\n\tconst _lodPlanes = [];\n\tconst _sizeLods = [];\n\tconst _sigmas = [];\n\n\tlet lod = LOD_MAX;\n\n\tfor ( let i = 0; i < TOTAL_LODS; i ++ ) {\n\n\t\tconst sizeLod = Math.pow( 2, lod );\n\t\t_sizeLods.push( sizeLod );\n\t\tlet sigma = 1.0 / sizeLod;\n\n\t\tif ( i > LOD_MAX - LOD_MIN ) {\n\n\t\t\tsigma = EXTRA_LOD_SIGMA[ i - LOD_MAX + LOD_MIN - 1 ];\n\n\t\t} else if ( i === 0 ) {\n\n\t\t\tsigma = 0;\n\n\t\t}\n\n\t\t_sigmas.push( sigma );\n\n\t\tconst texelSize = 1.0 / ( sizeLod - 1 );\n\t\tconst min = - texelSize / 2;\n\t\tconst max = 1 + texelSize / 2;\n\t\tconst uv1 = [ min, min, max, min, max, max, min, min, max, max, min, max ];\n\n\t\tconst cubeFaces = 6;\n\t\tconst vertices = 6;\n\t\tconst positionSize = 3;\n\t\tconst uvSize = 2;\n\t\tconst faceIndexSize = 1;\n\n\t\tconst position = new Float32Array( positionSize * vertices * cubeFaces );\n\t\tconst uv = new Float32Array( uvSize * vertices * cubeFaces );\n\t\tconst faceIndex = new Float32Array( faceIndexSize * vertices * cubeFaces );\n\n\t\tfor ( let face = 0; face < cubeFaces; face ++ ) {\n\n\t\t\tconst x = ( face % 3 ) * 2 / 3 - 1;\n\t\t\tconst y = face > 2 ? 0 : - 1;\n\t\t\tconst coordinates = [\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y + 1, 0\n\t\t\t];\n\t\t\tposition.set( coordinates, positionSize * vertices * face );\n\t\t\tuv.set( uv1, uvSize * vertices * face );\n\t\t\tconst fill = [ face, face, face, face, face, face ];\n\t\t\tfaceIndex.set( fill, faceIndexSize * vertices * face );\n\n\t\t}\n\n\t\tconst planes = new BufferGeometry();\n\t\tplanes.setAttribute( 'position', new BufferAttribute( position, positionSize ) );\n\t\tplanes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) );\n\t\tplanes.setAttribute( 'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) );\n\t\t_lodPlanes.push( planes );\n\n\t\tif ( lod > LOD_MIN ) {\n\n\t\t\tlod --;\n\n\t\t}\n\n\t}\n\n\treturn { _lodPlanes, _sizeLods, _sigmas };\n\n}\n\nfunction _createRenderTarget( params ) {\n\n\tconst cubeUVRenderTarget = new WebGLRenderTarget( 3 * SIZE_MAX, 3 * SIZE_MAX, params );\n\tcubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping;\n\tcubeUVRenderTarget.texture.name = 'PMREM.cubeUv';\n\tcubeUVRenderTarget.scissorTest = true;\n\treturn cubeUVRenderTarget;\n\n}\n\nfunction _setViewport( target, x, y, width, height ) {\n\n\ttarget.viewport.set( x, y, width, height );\n\ttarget.scissor.set( x, y, width, height );\n\n}\n\nfunction _getBlurShader( maxSamples ) {\n\n\tconst weights = new Float32Array( maxSamples );\n\tconst poleAxis = new Vector3( 0, 1, 0 );\n\tconst shaderMaterial = new RawShaderMaterial( {\n\n\t\tname: 'SphericalGaussianBlur',\n\n\t\tdefines: { 'n': maxSamples },\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'samples': { value: 1 },\n\t\t\t'weights': { value: weights },\n\t\t\t'latitudinal': { value: false },\n\t\t\t'dTheta': { value: 0 },\n\t\t\t'mipInt': { value: 0 },\n\t\t\t'poleAxis': { value: poleAxis }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\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 \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`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n\treturn shaderMaterial;\n\n}\n\nfunction _getEquirectShader() {\n\n\tconst texelSize = new Vector2( 1, 1 );\n\tconst shaderMaterial = new RawShaderMaterial( {\n\n\t\tname: 'EquirectangularToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'texelSize': { value: texelSize }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\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 vec2 texelSize;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = texture2D ( envMap, uv ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t}\n\t\t`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n\treturn shaderMaterial;\n\n}\n\nfunction _getCubemapShader() {\n\n\tconst shaderMaterial = new RawShaderMaterial( {\n\n\t\tname: 'CubemapToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'flipEnvMap': { value: - 1 }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\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`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n\treturn shaderMaterial;\n\n}\n\nfunction _getCommonVertexShader() {\n\n\treturn /* glsl */`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\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`;\n\n}\n\nfunction WebGLCubeUVMaps( renderer ) {\n\n\tlet cubeUVmaps = new WeakMap();\n\n\tlet pmremGenerator = null;\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tconst isEquirectMap = ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping );\n\t\t\tconst isCubeMap = ( mapping === CubeReflectionMapping || mapping === CubeRefractionMapping );\n\n\t\t\t// equirect/cube map to cubeUV conversion\n\n\t\t\tif ( isEquirectMap || isCubeMap ) {\n\n\t\t\t\tif ( texture.isRenderTargetTexture && texture.needsPMREMUpdate === true ) {\n\n\t\t\t\t\ttexture.needsPMREMUpdate = false;\n\n\t\t\t\t\tlet renderTarget = cubeUVmaps.get( texture );\n\n\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\trenderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture, renderTarget ) : pmremGenerator.fromCubemap( texture, renderTarget );\n\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( cubeUVmaps.has( texture ) ) {\n\n\t\t\t\t\t\treturn cubeUVmaps.get( texture ).texture;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif ( ( isEquirectMap && image && image.height > 0 ) || ( isCubeMap && image && isCubeTextureComplete( image ) ) ) {\n\n\t\t\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\t\t\tconst renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture ) : pmremGenerator.fromCubemap( texture );\n\t\t\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction isCubeTextureComplete( image ) {\n\n\t\tlet count = 0;\n\t\tconst length = 6;\n\n\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\tif ( image[ i ] !== undefined ) count ++;\n\n\t\t}\n\n\t\treturn count === length;\n\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemapUV = cubeUVmaps.get( texture );\n\n\t\tif ( cubemapUV !== undefined ) {\n\n\t\t\tcubeUVmaps.delete( texture );\n\t\t\tcubemapUV.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubeUVmaps = new WeakMap();\n\n\t\tif ( pmremGenerator !== null ) {\n\n\t\t\tpmremGenerator.dispose();\n\t\t\tpmremGenerator = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLExtensions( gl ) {\n\n\tconst extensions = {};\n\n\tfunction getExtension( name ) {\n\n\t\tif ( extensions[ name ] !== undefined ) {\n\n\t\t\treturn extensions[ name ];\n\n\t\t}\n\n\t\tlet extension;\n\n\t\tswitch ( name ) {\n\n\t\t\tcase 'WEBGL_depth_texture':\n\t\t\t\textension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'EXT_texture_filter_anisotropic':\n\t\t\t\textension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_s3tc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_pvrtc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\textension = gl.getExtension( name );\n\n\t\t}\n\n\t\textensions[ name ] = extension;\n\n\t\treturn extension;\n\n\t}\n\n\treturn {\n\n\t\thas: function ( name ) {\n\n\t\t\treturn getExtension( name ) !== null;\n\n\t\t},\n\n\t\tinit: function ( capabilities ) {\n\n\t\t\tif ( capabilities.isWebGL2 ) {\n\n\t\t\t\tgetExtension( 'EXT_color_buffer_float' );\n\n\t\t\t} else {\n\n\t\t\t\tgetExtension( 'WEBGL_depth_texture' );\n\t\t\t\tgetExtension( 'OES_texture_float' );\n\t\t\t\tgetExtension( 'OES_texture_half_float' );\n\t\t\t\tgetExtension( 'OES_texture_half_float_linear' );\n\t\t\t\tgetExtension( 'OES_standard_derivatives' );\n\t\t\t\tgetExtension( 'OES_element_index_uint' );\n\t\t\t\tgetExtension( 'OES_vertex_array_object' );\n\t\t\t\tgetExtension( 'ANGLE_instanced_arrays' );\n\n\t\t\t}\n\n\t\t\tgetExtension( 'OES_texture_float_linear' );\n\t\t\tgetExtension( 'EXT_color_buffer_half_float' );\n\t\t\tgetExtension( 'WEBGL_multisampled_render_to_texture' );\n\n\t\t},\n\n\t\tget: function ( name ) {\n\n\t\t\tconst extension = getExtension( name );\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' );\n\n\t\t\t}\n\n\t\t\treturn extension;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLGeometries( gl, attributes, info, bindingStates ) {\n\n\tconst geometries = {};\n\tconst wireframeAttributes = new WeakMap();\n\n\tfunction onGeometryDispose( event ) {\n\n\t\tconst geometry = event.target;\n\n\t\tif ( geometry.index !== null ) {\n\n\t\t\tattributes.remove( geometry.index );\n\n\t\t}\n\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tattributes.remove( geometry.attributes[ name ] );\n\n\t\t}\n\n\t\tgeometry.removeEventListener( 'dispose', onGeometryDispose );\n\n\t\tdelete geometries[ geometry.id ];\n\n\t\tconst attribute = wireframeAttributes.get( geometry );\n\n\t\tif ( attribute ) {\n\n\t\t\tattributes.remove( attribute );\n\t\t\twireframeAttributes.delete( geometry );\n\n\t\t}\n\n\t\tbindingStates.releaseStatesOfGeometry( geometry );\n\n\t\tif ( geometry.isInstancedBufferGeometry === true ) {\n\n\t\t\tdelete geometry._maxInstanceCount;\n\n\t\t}\n\n\t\t//\n\n\t\tinfo.memory.geometries --;\n\n\t}\n\n\tfunction get( object, geometry ) {\n\n\t\tif ( geometries[ geometry.id ] === true ) return geometry;\n\n\t\tgeometry.addEventListener( 'dispose', onGeometryDispose );\n\n\t\tgeometries[ geometry.id ] = true;\n\n\t\tinfo.memory.geometries ++;\n\n\t\treturn geometry;\n\n\t}\n\n\tfunction update( geometry ) {\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates.\n\n\t\tfor ( const name in geometryAttributes ) {\n\n\t\t\tattributes.update( geometryAttributes[ name ], 34962 );\n\n\t\t}\n\n\t\t// morph targets\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = morphAttributes[ name ];\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tattributes.update( array[ i ], 34962 );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction updateWireframeAttribute( geometry ) {\n\n\t\tconst indices = [];\n\n\t\tconst geometryIndex = geometry.index;\n\t\tconst geometryPosition = geometry.attributes.position;\n\t\tlet version = 0;\n\n\t\tif ( geometryIndex !== null ) {\n\n\t\t\tconst array = geometryIndex.array;\n\t\t\tversion = geometryIndex.version;\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i += 3 ) {\n\n\t\t\t\tconst a = array[ i + 0 ];\n\t\t\t\tconst b = array[ i + 1 ];\n\t\t\t\tconst c = array[ i + 2 ];\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst array = geometryPosition.array;\n\t\t\tversion = geometryPosition.version;\n\n\t\t\tfor ( let i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) {\n\n\t\t\t\tconst a = i + 0;\n\t\t\t\tconst b = i + 1;\n\t\t\t\tconst c = i + 2;\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );\n\t\tattribute.version = version;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates\n\n\t\t//\n\n\t\tconst previousAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( previousAttribute ) attributes.remove( previousAttribute );\n\n\t\t//\n\n\t\twireframeAttributes.set( geometry, attribute );\n\n\t}\n\n\tfunction getWireframeAttribute( geometry ) {\n\n\t\tconst currentAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( currentAttribute ) {\n\n\t\t\tconst geometryIndex = geometry.index;\n\n\t\t\tif ( geometryIndex !== null ) {\n\n\t\t\t\t// if the attribute is obsolete, create a new one\n\n\t\t\t\tif ( currentAttribute.version < geometryIndex.version ) {\n\n\t\t\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t}\n\n\t\treturn wireframeAttributes.get( geometry );\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tupdate: update,\n\n\t\tgetWireframeAttribute: getWireframeAttribute\n\n\t};\n\n}\n\nfunction WebGLIndexedBufferRenderer( gl, extensions, info, capabilities ) {\n\n\tconst isWebGL2 = capabilities.isWebGL2;\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tlet type, bytesPerElement;\n\n\tfunction setIndex( value ) {\n\n\t\ttype = value.type;\n\t\tbytesPerElement = value.bytesPerElement;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawElements( mode, count, type, start * bytesPerElement );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tlet extension, methodName;\n\n\t\tif ( isWebGL2 ) {\n\n\t\t\textension = gl;\n\t\t\tmethodName = 'drawElementsInstanced';\n\n\t\t} else {\n\n\t\t\textension = extensions.get( 'ANGLE_instanced_arrays' );\n\t\t\tmethodName = 'drawElementsInstancedANGLE';\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\textension[ methodName ]( mode, count, type, start * bytesPerElement, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.setIndex = setIndex;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\n}\n\nfunction WebGLInfo( gl ) {\n\n\tconst memory = {\n\t\tgeometries: 0,\n\t\ttextures: 0\n\t};\n\n\tconst render = {\n\t\tframe: 0,\n\t\tcalls: 0,\n\t\ttriangles: 0,\n\t\tpoints: 0,\n\t\tlines: 0\n\t};\n\n\tfunction update( count, mode, instanceCount ) {\n\n\t\trender.calls ++;\n\n\t\tswitch ( mode ) {\n\n\t\t\tcase 4:\n\t\t\t\trender.triangles += instanceCount * ( count / 3 );\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\trender.lines += instanceCount * ( count / 2 );\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\trender.lines += instanceCount * ( count - 1 );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\trender.lines += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tcase 0:\n\t\t\t\trender.points += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.error( 'THREE.WebGLInfo: Unknown draw mode:', mode );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\trender.frame ++;\n\t\trender.calls = 0;\n\t\trender.triangles = 0;\n\t\trender.points = 0;\n\t\trender.lines = 0;\n\n\t}\n\n\treturn {\n\t\tmemory: memory,\n\t\trender: render,\n\t\tprograms: null,\n\t\tautoReset: true,\n\t\treset: reset,\n\t\tupdate: update\n\t};\n\n}\n\nclass DataTexture2DArray extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\tsuper( null );\n\n\t\tthis.image = { data, width, height, depth };\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nDataTexture2DArray.prototype.isDataTexture2DArray = true;\n\nfunction numericalSort( a, b ) {\n\n\treturn a[ 0 ] - b[ 0 ];\n\n}\n\nfunction absNumericalSort( a, b ) {\n\n\treturn Math.abs( b[ 1 ] ) - Math.abs( a[ 1 ] );\n\n}\n\nfunction denormalize( morph, attribute ) {\n\n\tlet denominator = 1;\n\tconst array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array;\n\n\tif ( array instanceof Int8Array ) denominator = 127;\n\telse if ( array instanceof Int16Array ) denominator = 32767;\n\telse if ( array instanceof Int32Array ) denominator = 2147483647;\n\telse console.error( 'THREE.WebGLMorphtargets: Unsupported morph attribute data type: ', array );\n\n\tmorph.divideScalar( denominator );\n\n}\n\nfunction WebGLMorphtargets( gl, capabilities, textures ) {\n\n\tconst influencesList = {};\n\tconst morphInfluences = new Float32Array( 8 );\n\tconst morphTextures = new WeakMap();\n\tconst morph = new Vector3();\n\n\tconst workInfluences = [];\n\n\tfor ( let i = 0; i < 8; i ++ ) {\n\n\t\tworkInfluences[ i ] = [ i, 0 ];\n\n\t}\n\n\tfunction update( object, geometry, material, program ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tif ( capabilities.isWebGL2 === true ) {\n\n\t\t\t// instead of using attributes, the WebGL 2 code path encodes morph targets\n\t\t\t// into an array of data textures. Each layer represents a single morph target.\n\n\t\t\tconst numberOfMorphTargets = geometry.morphAttributes.position.length;\n\n\t\t\tlet entry = morphTextures.get( geometry );\n\n\t\t\tif ( entry === undefined || entry.count !== numberOfMorphTargets ) {\n\n\t\t\t\tif ( entry !== undefined ) entry.texture.dispose();\n\n\t\t\t\tconst hasMorphNormals = geometry.morphAttributes.normal !== undefined;\n\n\t\t\t\tconst morphTargets = geometry.morphAttributes.position;\n\t\t\t\tconst morphNormals = geometry.morphAttributes.normal || [];\n\n\t\t\t\tconst numberOfVertices = geometry.attributes.position.count;\n\t\t\t\tconst numberOfVertexData = ( hasMorphNormals === true ) ? 2 : 1; // (v,n) vs. (v)\n\n\t\t\t\tlet width = numberOfVertices * numberOfVertexData;\n\t\t\t\tlet height = 1;\n\n\t\t\t\tif ( width > capabilities.maxTextureSize ) {\n\n\t\t\t\t\theight = Math.ceil( width / capabilities.maxTextureSize );\n\t\t\t\t\twidth = capabilities.maxTextureSize;\n\n\t\t\t\t}\n\n\t\t\t\tconst buffer = new Float32Array( width * height * 4 * numberOfMorphTargets );\n\n\t\t\t\tconst texture = new DataTexture2DArray( buffer, width, height, numberOfMorphTargets );\n\t\t\t\ttexture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower)\n\t\t\t\ttexture.type = FloatType;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t// fill buffer\n\n\t\t\t\tconst vertexDataStride = numberOfVertexData * 4;\n\n\t\t\t\tfor ( let i = 0; i < numberOfMorphTargets; i ++ ) {\n\n\t\t\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\t\t\tconst morphNormal = morphNormals[ i ];\n\n\t\t\t\t\tconst offset = width * height * 4 * i;\n\n\t\t\t\t\tfor ( let j = 0; j < morphTarget.count; j ++ ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphTarget, j );\n\n\t\t\t\t\t\tif ( morphTarget.normalized === true ) denormalize( morph, morphTarget );\n\n\t\t\t\t\t\tconst stride = j * vertexDataStride;\n\n\t\t\t\t\t\tbuffer[ offset + stride + 0 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 1 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 2 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 3 ] = 0;\n\n\t\t\t\t\t\tif ( hasMorphNormals === true ) {\n\n\t\t\t\t\t\t\tmorph.fromBufferAttribute( morphNormal, j );\n\n\t\t\t\t\t\t\tif ( morphNormal.normalized === true ) denormalize( morph, morphNormal );\n\n\t\t\t\t\t\t\tbuffer[ offset + stride + 4 ] = morph.x;\n\t\t\t\t\t\t\tbuffer[ offset + stride + 5 ] = morph.y;\n\t\t\t\t\t\t\tbuffer[ offset + stride + 6 ] = morph.z;\n\t\t\t\t\t\t\tbuffer[ offset + stride + 7 ] = 0;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tentry = {\n\t\t\t\t\tcount: numberOfMorphTargets,\n\t\t\t\t\ttexture: texture,\n\t\t\t\t\tsize: new Vector2( width, height )\n\t\t\t\t};\n\n\t\t\t\tmorphTextures.set( geometry, entry );\n\n\t\t\t\tfunction disposeTexture() {\n\n\t\t\t\t\ttexture.dispose();\n\n\t\t\t\t\tmorphTextures.delete( geometry );\n\n\t\t\t\t\tgeometry.removeEventListener( 'dispose', disposeTexture );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.addEventListener( 'dispose', disposeTexture );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t\t}\n\n\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );\n\n\n\t\t} else {\n\n\t\t\t// When object doesn't have morph target influences defined, we treat it as a 0-length array\n\t\t\t// This is important to make sure we set up morphTargetBaseInfluence / morphTargetInfluences\n\n\t\t\tconst length = objectInfluences === undefined ? 0 : objectInfluences.length;\n\n\t\t\tlet influences = influencesList[ geometry.id ];\n\n\t\t\tif ( influences === undefined || influences.length !== length ) {\n\n\t\t\t\t// initialise list\n\n\t\t\t\tinfluences = [];\n\n\t\t\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\t\t\tinfluences[ i ] = [ i, 0 ];\n\n\t\t\t\t}\n\n\t\t\t\tinfluencesList[ geometry.id ] = influences;\n\n\t\t\t}\n\n\t\t\t// Collect influences\n\n\t\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\t\tconst influence = influences[ i ];\n\n\t\t\t\tinfluence[ 0 ] = i;\n\t\t\t\tinfluence[ 1 ] = objectInfluences[ i ];\n\n\t\t\t}\n\n\t\t\tinfluences.sort( absNumericalSort );\n\n\t\t\tfor ( let i = 0; i < 8; i ++ ) {\n\n\t\t\t\tif ( i < length && influences[ i ][ 1 ] ) {\n\n\t\t\t\t\tworkInfluences[ i ][ 0 ] = influences[ i ][ 0 ];\n\t\t\t\t\tworkInfluences[ i ][ 1 ] = influences[ i ][ 1 ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tworkInfluences[ i ][ 0 ] = Number.MAX_SAFE_INTEGER;\n\t\t\t\t\tworkInfluences[ i ][ 1 ] = 0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tworkInfluences.sort( numericalSort );\n\n\t\t\tconst morphTargets = geometry.morphAttributes.position;\n\t\t\tconst morphNormals = geometry.morphAttributes.normal;\n\n\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\tfor ( let i = 0; i < 8; i ++ ) {\n\n\t\t\t\tconst influence = workInfluences[ i ];\n\t\t\t\tconst index = influence[ 0 ];\n\t\t\t\tconst value = influence[ 1 ];\n\n\t\t\t\tif ( index !== Number.MAX_SAFE_INTEGER && value ) {\n\n\t\t\t\t\tif ( morphTargets && geometry.getAttribute( 'morphTarget' + i ) !== morphTargets[ index ] ) {\n\n\t\t\t\t\t\tgeometry.setAttribute( 'morphTarget' + i, morphTargets[ index ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( morphNormals && geometry.getAttribute( 'morphNormal' + i ) !== morphNormals[ index ] ) {\n\n\t\t\t\t\t\tgeometry.setAttribute( 'morphNormal' + i, morphNormals[ index ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmorphInfluences[ i ] = value;\n\t\t\t\t\tmorphInfluencesSum += value;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( morphTargets && geometry.hasAttribute( 'morphTarget' + i ) === true ) {\n\n\t\t\t\t\t\tgeometry.deleteAttribute( 'morphTarget' + i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( morphNormals && geometry.hasAttribute( 'morphNormal' + i ) === true ) {\n\n\t\t\t\t\t\tgeometry.deleteAttribute( 'morphNormal' + i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmorphInfluences[ i ] = 0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// GLSL shader uses formula baseinfluence * base + sum(target * influence)\n\t\t\t// This allows us to switch between absolute morphs and relative morphs without changing shader code\n\t\t\t// When baseinfluence = 1 - sum(influence), the above is equivalent to sum((target - base) * influence)\n\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetInfluences', morphInfluences );\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\tupdate: update\n\n\t};\n\n}\n\nfunction WebGLObjects( gl, geometries, attributes, info ) {\n\n\tlet updateMap = new WeakMap();\n\n\tfunction update( object ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\tconst geometry = object.geometry;\n\t\tconst buffergeometry = geometries.get( object, geometry );\n\n\t\t// Update once per frame\n\n\t\tif ( updateMap.get( buffergeometry ) !== frame ) {\n\n\t\t\tgeometries.update( buffergeometry );\n\n\t\t\tupdateMap.set( buffergeometry, frame );\n\n\t\t}\n\n\t\tif ( object.isInstancedMesh ) {\n\n\t\t\tif ( object.hasEventListener( 'dispose', onInstancedMeshDispose ) === false ) {\n\n\t\t\t\tobject.addEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\t\t}\n\n\t\t\tattributes.update( object.instanceMatrix, 34962 );\n\n\t\t\tif ( object.instanceColor !== null ) {\n\n\t\t\t\tattributes.update( object.instanceColor, 34962 );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn buffergeometry;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tupdateMap = new WeakMap();\n\n\t}\n\n\tfunction onInstancedMeshDispose( event ) {\n\n\t\tconst instancedMesh = event.target;\n\n\t\tinstancedMesh.removeEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\tattributes.remove( instancedMesh.instanceMatrix );\n\n\t\tif ( instancedMesh.instanceColor !== null ) attributes.remove( instancedMesh.instanceColor );\n\n\t}\n\n\treturn {\n\n\t\tupdate: update,\n\t\tdispose: dispose\n\n\t};\n\n}\n\nclass DataTexture3D extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\t// We're going to add .setXXX() methods for setting properties later.\n\t\t// Users can still set in DataTexture3D directly.\n\t\t//\n\t\t//\tconst texture = new THREE.DataTexture3D( data, width, height, depth );\n\t\t// \ttexture.anisotropy = 16;\n\t\t//\n\t\t// See #14839\n\n\t\tsuper( null );\n\n\t\tthis.image = { data, width, height, depth };\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nDataTexture3D.prototype.isDataTexture3D = true;\n\n/**\n * Uniforms of a program.\n * Those form a tree structure with a special top-level container for the root,\n * which you get by calling 'new WebGLUniforms( gl, program )'.\n *\n *\n * Properties of inner nodes including the top-level container:\n *\n * .seq - array of nested uniforms\n * .map - nested uniforms by name\n *\n *\n * Methods of all nodes except the top-level container:\n *\n * .setValue( gl, value, [textures] )\n *\n * \t\tuploads a uniform value(s)\n * \tthe 'textures' parameter is needed for sampler uniforms\n *\n *\n * Static methods of the top-level container (textures factorizations):\n *\n * .upload( gl, seq, values, textures )\n *\n * \t\tsets uniforms in 'seq' to 'values[id].value'\n *\n * .seqWithValue( seq, values ) : filteredSeq\n *\n * \t\tfilters 'seq' entries with corresponding entry in values\n *\n *\n * Methods of the top-level container (textures factorizations):\n *\n * .setValue( gl, name, value, textures )\n *\n * \t\tsets uniform with name 'name' to 'value'\n *\n * .setOptional( gl, obj, prop )\n *\n * \t\tlike .set for an optional property of the object\n *\n */\n\nconst emptyTexture = new Texture();\nconst emptyTexture2dArray = new DataTexture2DArray();\nconst emptyTexture3d = new DataTexture3D();\nconst emptyCubeTexture = new CubeTexture();\n\n// --- Utilities ---\n\n// Array Caches (provide typed arrays for temporary by size)\n\nconst arrayCacheF32 = [];\nconst arrayCacheI32 = [];\n\n// Float32Array caches used for uploading Matrix uniforms\n\nconst mat4array = new Float32Array( 16 );\nconst mat3array = new Float32Array( 9 );\nconst mat2array = new Float32Array( 4 );\n\n// Flattening for arrays of vectors and matrices\n\nfunction flatten( array, nBlocks, blockSize ) {\n\n\tconst firstElem = array[ 0 ];\n\n\tif ( firstElem <= 0 || firstElem > 0 ) return array;\n\t// unoptimized: ! isNaN( firstElem )\n\t// see http://jacksondunstan.com/articles/983\n\n\tconst n = nBlocks * blockSize;\n\tlet r = arrayCacheF32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Float32Array( n );\n\t\tarrayCacheF32[ n ] = r;\n\n\t}\n\n\tif ( nBlocks !== 0 ) {\n\n\t\tfirstElem.toArray( r, 0 );\n\n\t\tfor ( let i = 1, offset = 0; i !== nBlocks; ++ i ) {\n\n\t\t\toffset += blockSize;\n\t\t\tarray[ i ].toArray( r, offset );\n\n\t\t}\n\n\t}\n\n\treturn r;\n\n}\n\nfunction arraysEqual( a, b ) {\n\n\tif ( a.length !== b.length ) return false;\n\n\tfor ( let i = 0, l = a.length; i < l; i ++ ) {\n\n\t\tif ( a[ i ] !== b[ i ] ) return false;\n\n\t}\n\n\treturn true;\n\n}\n\nfunction copyArray( a, b ) {\n\n\tfor ( let i = 0, l = b.length; i < l; i ++ ) {\n\n\t\ta[ i ] = b[ i ];\n\n\t}\n\n}\n\n// Texture unit allocation\n\nfunction allocTexUnits( textures, n ) {\n\n\tlet r = arrayCacheI32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Int32Array( n );\n\t\tarrayCacheI32[ n ] = r;\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\tr[ i ] = textures.allocateTextureUnit();\n\n\t}\n\n\treturn r;\n\n}\n\n// --- Setters ---\n\n// Note: Defining these methods externally, because they come in a bunch\n// and this way their names minify.\n\n// Single scalar\n\nfunction setValueV1f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1f( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single float vector (from flat array or THREE.VectorN)\n\nfunction setValueV2f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2f( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3f( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else if ( v.r !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.r || cache[ 1 ] !== v.g || cache[ 2 ] !== v.b ) {\n\n\t\t\tgl.uniform3f( this.addr, v.r, v.g, v.b );\n\n\t\t\tcache[ 0 ] = v.r;\n\t\t\tcache[ 1 ] = v.g;\n\t\t\tcache[ 2 ] = v.b;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4f( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n// Single matrix (from flat array or THREE.MatrixN)\n\nfunction setValueM2( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix2fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat2array.set( elements );\n\n\t\tgl.uniformMatrix2fv( this.addr, false, mat2array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM3( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix3fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat3array.set( elements );\n\n\t\tgl.uniformMatrix3fv( this.addr, false, mat3array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM4( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix4fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat4array.set( elements );\n\n\t\tgl.uniformMatrix4fv( this.addr, false, mat4array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\n// Single integer / boolean\n\nfunction setValueV1i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1i( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single integer / boolean vector (from flat array)\n\nfunction setValueV2i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( arraysEqual( cache, v ) ) return;\n\n\tgl.uniform2iv( this.addr, v );\n\n\tcopyArray( cache, v );\n\n}\n\nfunction setValueV3i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( arraysEqual( cache, v ) ) return;\n\n\tgl.uniform3iv( this.addr, v );\n\n\tcopyArray( cache, v );\n\n}\n\nfunction setValueV4i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( arraysEqual( cache, v ) ) return;\n\n\tgl.uniform4iv( this.addr, v );\n\n\tcopyArray( cache, v );\n\n}\n\n// Single unsigned integer\n\nfunction setValueV1ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1ui( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single unsigned integer vector (from flat array)\n\nfunction setValueV2ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( arraysEqual( cache, v ) ) return;\n\n\tgl.uniform2uiv( this.addr, v );\n\n\tcopyArray( cache, v );\n\n}\n\nfunction setValueV3ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( arraysEqual( cache, v ) ) return;\n\n\tgl.uniform3uiv( this.addr, v );\n\n\tcopyArray( cache, v );\n\n}\n\nfunction setValueV4ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( arraysEqual( cache, v ) ) return;\n\n\tgl.uniform4uiv( this.addr, v );\n\n\tcopyArray( cache, v );\n\n}\n\n\n// Single texture (2D / Cube)\n\nfunction setValueT1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.safeSetTexture2D( v || emptyTexture, unit );\n\n}\n\nfunction setValueT3D1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture3D( v || emptyTexture3d, unit );\n\n}\n\nfunction setValueT6( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.safeSetTextureCube( v || emptyCubeTexture, unit );\n\n}\n\nfunction setValueT2DArray1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture2DArray( v || emptyTexture2dArray, unit );\n\n}\n\n// Helper to pick the right setter for the singular case\n\nfunction getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t\tcase 0x1405: return setValueV1ui; // UINT\n\t\tcase 0x8dc6: return setValueV2ui; // _VEC2\n\t\tcase 0x8dc7: return setValueV3ui; // _VEC3\n\t\tcase 0x8dc8: return setValueV4ui; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3D1;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArray1;\n\n\t}\n\n}\n\n\n// Array of scalars\n\nfunction setValueV1fArray( gl, v ) {\n\n\tgl.uniform1fv( this.addr, v );\n\n}\n\n// Array of vectors (from flat array or array of THREE.VectorN)\n\nfunction setValueV2fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 2 );\n\n\tgl.uniform2fv( this.addr, data );\n\n}\n\nfunction setValueV3fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 3 );\n\n\tgl.uniform3fv( this.addr, data );\n\n}\n\nfunction setValueV4fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniform4fv( this.addr, data );\n\n}\n\n// Array of matrices (from flat array or array of THREE.MatrixN)\n\nfunction setValueM2Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniformMatrix2fv( this.addr, false, data );\n\n}\n\nfunction setValueM3Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 9 );\n\n\tgl.uniformMatrix3fv( this.addr, false, data );\n\n}\n\nfunction setValueM4Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 16 );\n\n\tgl.uniformMatrix4fv( this.addr, false, data );\n\n}\n\n// Array of integer / boolean\n\nfunction setValueV1iArray( gl, v ) {\n\n\tgl.uniform1iv( this.addr, v );\n\n}\n\n// Array of integer / boolean vectors (from flat array)\n\nfunction setValueV2iArray( gl, v ) {\n\n\tgl.uniform2iv( this.addr, v );\n\n}\n\nfunction setValueV3iArray( gl, v ) {\n\n\tgl.uniform3iv( this.addr, v );\n\n}\n\nfunction setValueV4iArray( gl, v ) {\n\n\tgl.uniform4iv( this.addr, v );\n\n}\n\n// Array of unsigned integer\n\nfunction setValueV1uiArray( gl, v ) {\n\n\tgl.uniform1uiv( this.addr, v );\n\n}\n\n// Array of unsigned integer vectors (from flat array)\n\nfunction setValueV2uiArray( gl, v ) {\n\n\tgl.uniform2uiv( this.addr, v );\n\n}\n\nfunction setValueV3uiArray( gl, v ) {\n\n\tgl.uniform3uiv( this.addr, v );\n\n}\n\nfunction setValueV4uiArray( gl, v ) {\n\n\tgl.uniform4uiv( this.addr, v );\n\n}\n\n\n// Array of textures (2D / 3D / Cube / 2DArray)\n\nfunction setValueT1Array( gl, v, textures ) {\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tgl.uniform1iv( this.addr, units );\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.safeSetTexture2D( v[ i ] || emptyTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT3DArray( gl, v, textures ) {\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tgl.uniform1iv( this.addr, units );\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture3D( v[ i ] || emptyTexture3d, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT6Array( gl, v, textures ) {\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tgl.uniform1iv( this.addr, units );\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.safeSetTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT2DArrayArray( gl, v, textures ) {\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tgl.uniform1iv( this.addr, units );\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture2DArray( v[ i ] || emptyTexture2dArray, units[ i ] );\n\n\t}\n\n}\n\n\n// Helper to pick the right setter for a pure (bottom-level) array\n\nfunction getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3DArray;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArrayArray;\n\n\t}\n\n}\n\n// --- Uniform Classes ---\n\nfunction SingleUniform( id, activeInfo, addr ) {\n\n\tthis.id = id;\n\tthis.addr = addr;\n\tthis.cache = [];\n\tthis.setValue = getSingularSetter( activeInfo.type );\n\n\t// this.path = activeInfo.name; // DEBUG\n\n}\n\nfunction PureArrayUniform( id, activeInfo, addr ) {\n\n\tthis.id = id;\n\tthis.addr = addr;\n\tthis.cache = [];\n\tthis.size = activeInfo.size;\n\tthis.setValue = getPureArraySetter( activeInfo.type );\n\n\t// this.path = activeInfo.name; // DEBUG\n\n}\n\nPureArrayUniform.prototype.updateCache = function ( data ) {\n\n\tconst cache = this.cache;\n\n\tif ( data instanceof Float32Array && cache.length !== data.length ) {\n\n\t\tthis.cache = new Float32Array( data.length );\n\n\t}\n\n\tcopyArray( cache, data );\n\n};\n\nfunction StructuredUniform( id ) {\n\n\tthis.id = id;\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}\n\nStructuredUniform.prototype.setValue = function ( gl, value, textures ) {\n\n\tconst seq = this.seq;\n\n\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\tconst u = seq[ i ];\n\t\tu.setValue( gl, value[ u.id ], textures );\n\n\t}\n\n};\n\n// --- Top-level ---\n\n// Parser - builds up the property tree from the path strings\n\nconst RePathPart = /(\\w+)(\\])?(\\[|\\.)?/g;\n\n// extracts\n// \t- the identifier (member name or array index)\n// - followed by an optional right bracket (found when array index)\n// - followed by an optional left bracket or dot (type of subscript)\n//\n// Note: These portions can be read in a non-overlapping fashion and\n// allow straightforward parsing of the hierarchy that WebGL encodes\n// in the uniform names.\n\nfunction addUniform( container, uniformObject ) {\n\n\tcontainer.seq.push( uniformObject );\n\tcontainer.map[ uniformObject.id ] = uniformObject;\n\n}\n\nfunction parseUniform( activeInfo, addr, container ) {\n\n\tconst path = activeInfo.name,\n\t\tpathLength = path.length;\n\n\t// reset RegExp object, because of the early exit of a previous run\n\tRePathPart.lastIndex = 0;\n\n\twhile ( true ) {\n\n\t\tconst match = RePathPart.exec( path ),\n\t\t\tmatchEnd = RePathPart.lastIndex;\n\n\t\tlet id = match[ 1 ];\n\t\tconst idIsIndex = match[ 2 ] === ']',\n\t\t\tsubscript = match[ 3 ];\n\n\t\tif ( idIsIndex ) id = id | 0; // convert to integer\n\n\t\tif ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) {\n\n\t\t\t// bare name or \"pure\" bottom-level array \"[0]\" suffix\n\n\t\t\taddUniform( container, subscript === undefined ?\n\t\t\t\tnew SingleUniform( id, activeInfo, addr ) :\n\t\t\t\tnew PureArrayUniform( id, activeInfo, addr ) );\n\n\t\t\tbreak;\n\n\t\t} else {\n\n\t\t\t// step into inner node / create it in case it doesn't exist\n\n\t\t\tconst map = container.map;\n\t\t\tlet next = map[ id ];\n\n\t\t\tif ( next === undefined ) {\n\n\t\t\t\tnext = new StructuredUniform( id );\n\t\t\t\taddUniform( container, next );\n\n\t\t\t}\n\n\t\t\tcontainer = next;\n\n\t\t}\n\n\t}\n\n}\n\n// Root Container\n\nfunction WebGLUniforms( gl, program ) {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n\tconst n = gl.getProgramParameter( program, 35718 );\n\n\tfor ( let i = 0; i < n; ++ i ) {\n\n\t\tconst info = gl.getActiveUniform( program, i ),\n\t\t\taddr = gl.getUniformLocation( program, info.name );\n\n\t\tparseUniform( info, addr, this );\n\n\t}\n\n}\n\nWebGLUniforms.prototype.setValue = function ( gl, name, value, textures ) {\n\n\tconst u = this.map[ name ];\n\n\tif ( u !== undefined ) u.setValue( gl, value, textures );\n\n};\n\nWebGLUniforms.prototype.setOptional = function ( gl, object, name ) {\n\n\tconst v = object[ name ];\n\n\tif ( v !== undefined ) this.setValue( gl, name, v );\n\n};\n\n\n// Static interface\n\nWebGLUniforms.upload = function ( gl, seq, values, textures ) {\n\n\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\tconst u = seq[ i ],\n\t\t\tv = values[ u.id ];\n\n\t\tif ( v.needsUpdate !== false ) {\n\n\t\t\t// note: always updating when .needsUpdate is undefined\n\t\t\tu.setValue( gl, v.value, textures );\n\n\t\t}\n\n\t}\n\n};\n\nWebGLUniforms.seqWithValue = function ( seq, values ) {\n\n\tconst r = [];\n\n\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\tconst u = seq[ i ];\n\t\tif ( u.id in values ) r.push( u );\n\n\t}\n\n\treturn r;\n\n};\n\nfunction WebGLShader( gl, type, string ) {\n\n\tconst shader = gl.createShader( type );\n\n\tgl.shaderSource( shader, string );\n\tgl.compileShader( shader );\n\n\treturn shader;\n\n}\n\nlet programIdCount = 0;\n\nfunction addLineNumbers( string ) {\n\n\tconst lines = string.split( '\\n' );\n\n\tfor ( let i = 0; i < lines.length; i ++ ) {\n\n\t\tlines[ i ] = ( i + 1 ) + ': ' + lines[ i ];\n\n\t}\n\n\treturn lines.join( '\\n' );\n\n}\n\nfunction getEncodingComponents( encoding ) {\n\n\tswitch ( encoding ) {\n\n\t\tcase LinearEncoding:\n\t\t\treturn [ 'Linear', '( value )' ];\n\t\tcase sRGBEncoding:\n\t\t\treturn [ 'sRGB', '( value )' ];\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported encoding:', encoding );\n\t\t\treturn [ 'Linear', '( value )' ];\n\n\t}\n\n}\n\nfunction getShaderErrors( gl, shader, type ) {\n\n\tconst status = gl.getShaderParameter( shader, 35713 );\n\tconst errors = gl.getShaderInfoLog( shader ).trim();\n\n\tif ( status && errors === '' ) return '';\n\n\t// --enable-privileged-webgl-extension\n\t// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\n\n\treturn type.toUpperCase() + '\\n\\n' + errors + '\\n\\n' + addLineNumbers( gl.getShaderSource( shader ) );\n\n}\n\nfunction getTexelEncodingFunction( functionName, encoding ) {\n\n\tconst components = getEncodingComponents( encoding );\n\treturn 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }';\n\n}\n\nfunction getToneMappingFunction( functionName, toneMapping ) {\n\n\tlet toneMappingName;\n\n\tswitch ( toneMapping ) {\n\n\t\tcase LinearToneMapping:\n\t\t\ttoneMappingName = 'Linear';\n\t\t\tbreak;\n\n\t\tcase ReinhardToneMapping:\n\t\t\ttoneMappingName = 'Reinhard';\n\t\t\tbreak;\n\n\t\tcase CineonToneMapping:\n\t\t\ttoneMappingName = 'OptimizedCineon';\n\t\t\tbreak;\n\n\t\tcase ACESFilmicToneMapping:\n\t\t\ttoneMappingName = 'ACESFilmic';\n\t\t\tbreak;\n\n\t\tcase CustomToneMapping:\n\t\t\ttoneMappingName = 'Custom';\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping );\n\t\t\ttoneMappingName = 'Linear';\n\n\t}\n\n\treturn 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }';\n\n}\n\nfunction generateExtensions( parameters ) {\n\n\tconst chunks = [\n\t\t( parameters.extensionDerivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === 'physical' ) ? '#extension GL_OES_standard_derivatives : enable' : '',\n\t\t( parameters.extensionFragDepth || parameters.logarithmicDepthBuffer ) && parameters.rendererExtensionFragDepth ? '#extension GL_EXT_frag_depth : enable' : '',\n\t\t( parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ) ? '#extension GL_EXT_draw_buffers : require' : '',\n\t\t( parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission ) && parameters.rendererExtensionShaderTextureLod ? '#extension GL_EXT_shader_texture_lod : enable' : ''\n\t];\n\n\treturn chunks.filter( filterEmptyLine ).join( '\\n' );\n\n}\n\nfunction generateDefines( defines ) {\n\n\tconst chunks = [];\n\n\tfor ( const name in defines ) {\n\n\t\tconst value = defines[ name ];\n\n\t\tif ( value === false ) continue;\n\n\t\tchunks.push( '#define ' + name + ' ' + value );\n\n\t}\n\n\treturn chunks.join( '\\n' );\n\n}\n\nfunction fetchAttributeLocations( gl, program ) {\n\n\tconst attributes = {};\n\n\tconst n = gl.getProgramParameter( program, 35721 );\n\n\tfor ( let i = 0; i < n; i ++ ) {\n\n\t\tconst info = gl.getActiveAttrib( program, i );\n\t\tconst name = info.name;\n\n\t\tlet locationSize = 1;\n\t\tif ( info.type === 35674 ) locationSize = 2;\n\t\tif ( info.type === 35675 ) locationSize = 3;\n\t\tif ( info.type === 35676 ) locationSize = 4;\n\n\t\t// console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );\n\n\t\tattributes[ name ] = {\n\t\t\ttype: info.type,\n\t\t\tlocation: gl.getAttribLocation( program, name ),\n\t\t\tlocationSize: locationSize\n\t\t};\n\n\t}\n\n\treturn attributes;\n\n}\n\nfunction filterEmptyLine( string ) {\n\n\treturn string !== '';\n\n}\n\nfunction replaceLightNums( string, parameters ) {\n\n\treturn string\n\t\t.replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights )\n\t\t.replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights )\n\t\t.replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights )\n\t\t.replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights )\n\t\t.replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights )\n\t\t.replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows )\n\t\t.replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows )\n\t\t.replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows );\n\n}\n\nfunction replaceClippingPlaneNums( string, parameters ) {\n\n\treturn string\n\t\t.replace( /NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes )\n\t\t.replace( /UNION_CLIPPING_PLANES/g, ( parameters.numClippingPlanes - parameters.numClipIntersection ) );\n\n}\n\n// Resolve Includes\n\nconst includePattern = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\n\nfunction resolveIncludes( string ) {\n\n\treturn string.replace( includePattern, includeReplacer );\n\n}\n\nfunction includeReplacer( match, include ) {\n\n\tconst string = ShaderChunk[ include ];\n\n\tif ( string === undefined ) {\n\n\t\tthrow new Error( 'Can not resolve #include <' + include + '>' );\n\n\t}\n\n\treturn resolveIncludes( string );\n\n}\n\n// Unroll Loops\n\nconst deprecatedUnrollLoopPattern = /#pragma unroll_loop[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g;\nconst unrollLoopPattern = /#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;\n\nfunction unrollLoops( string ) {\n\n\treturn string\n\t\t.replace( unrollLoopPattern, loopReplacer )\n\t\t.replace( deprecatedUnrollLoopPattern, deprecatedLoopReplacer );\n\n}\n\nfunction deprecatedLoopReplacer( match, start, end, snippet ) {\n\n\tconsole.warn( 'WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.' );\n\treturn loopReplacer( match, start, end, snippet );\n\n}\n\nfunction loopReplacer( match, start, end, snippet ) {\n\n\tlet string = '';\n\n\tfor ( let i = parseInt( start ); i < parseInt( end ); i ++ ) {\n\n\t\tstring += snippet\n\t\t\t.replace( /\\[\\s*i\\s*\\]/g, '[ ' + i + ' ]' )\n\t\t\t.replace( /UNROLLED_LOOP_INDEX/g, i );\n\n\t}\n\n\treturn string;\n\n}\n\n//\n\nfunction generatePrecision( parameters ) {\n\n\tlet precisionstring = 'precision ' + parameters.precision + ' float;\\nprecision ' + parameters.precision + ' int;';\n\n\tif ( parameters.precision === 'highp' ) {\n\n\t\tprecisionstring += '\\n#define HIGH_PRECISION';\n\n\t} else if ( parameters.precision === 'mediump' ) {\n\n\t\tprecisionstring += '\\n#define MEDIUM_PRECISION';\n\n\t} else if ( parameters.precision === 'lowp' ) {\n\n\t\tprecisionstring += '\\n#define LOW_PRECISION';\n\n\t}\n\n\treturn precisionstring;\n\n}\n\nfunction generateShadowMapTypeDefine( parameters ) {\n\n\tlet shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC';\n\n\tif ( parameters.shadowMapType === PCFShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF';\n\n\t} else if ( parameters.shadowMapType === PCFSoftShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT';\n\n\t} else if ( parameters.shadowMapType === VSMShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM';\n\n\t}\n\n\treturn shadowMapTypeDefine;\n\n}\n\nfunction generateEnvMapTypeDefine( parameters ) {\n\n\tlet envMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeReflectionMapping:\n\t\t\tcase CubeRefractionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\t\t\tbreak;\n\n\t\t\tcase CubeUVReflectionMapping:\n\t\t\tcase CubeUVRefractionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapTypeDefine;\n\n}\n\nfunction generateEnvMapModeDefine( parameters ) {\n\n\tlet envMapModeDefine = 'ENVMAP_MODE_REFLECTION';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeRefractionMapping:\n\t\t\tcase CubeUVRefractionMapping:\n\n\t\t\t\tenvMapModeDefine = 'ENVMAP_MODE_REFRACTION';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapModeDefine;\n\n}\n\nfunction generateEnvMapBlendingDefine( parameters ) {\n\n\tlet envMapBlendingDefine = 'ENVMAP_BLENDING_NONE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.combine ) {\n\n\t\t\tcase MultiplyOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\t\t\t\tbreak;\n\n\t\t\tcase MixOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MIX';\n\t\t\t\tbreak;\n\n\t\t\tcase AddOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_ADD';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapBlendingDefine;\n\n}\n\nfunction WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {\n\n\t// TODO Send this event to Three.js DevTools\n\t// console.log( 'WebGLProgram', cacheKey );\n\n\tconst gl = renderer.getContext();\n\n\tconst defines = parameters.defines;\n\n\tlet vertexShader = parameters.vertexShader;\n\tlet fragmentShader = parameters.fragmentShader;\n\n\tconst shadowMapTypeDefine = generateShadowMapTypeDefine( parameters );\n\tconst envMapTypeDefine = generateEnvMapTypeDefine( parameters );\n\tconst envMapModeDefine = generateEnvMapModeDefine( parameters );\n\tconst envMapBlendingDefine = generateEnvMapBlendingDefine( parameters );\n\n\tconst customExtensions = parameters.isWebGL2 ? '' : generateExtensions( parameters );\n\n\tconst customDefines = generateDefines( defines );\n\n\tconst program = gl.createProgram();\n\n\tlet prefixVertex, prefixFragment;\n\tlet versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\\n' : '';\n\n\tif ( parameters.isRawShaderMaterial ) {\n\n\t\tprefixVertex = [\n\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixVertex.length > 0 ) {\n\n\t\t\tprefixVertex += '\\n';\n\n\t\t}\n\n\t\tprefixFragment = [\n\n\t\t\tcustomExtensions,\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixFragment.length > 0 ) {\n\n\t\t\tprefixFragment += '\\n';\n\n\t\t}\n\n\t} else {\n\n\t\tprefixVertex = [\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\tparameters.instancing ? '#define USE_INSTANCING' : '',\n\t\t\tparameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',\n\n\t\t\tparameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',\n\n\t\t\t'#define MAX_BONES ' + parameters.maxBones,\n\t\t\t( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '',\n\t\t\t( parameters.useFog && parameters.fogExp2 ) ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\t( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '',\n\t\t\t( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '',\n\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULARCOLORMAP' : '',\n\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEENCOLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEENROUGHNESSMAP' : '',\n\n\t\t\tparameters.vertexTangents ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUvs ? '#define USE_UV' : '',\n\t\t\tparameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.skinning ? '#define USE_SKINNING' : '',\n\t\t\tparameters.useVertexTexture ? '#define BONE_TEXTURE' : '',\n\n\t\t\tparameters.morphTargets ? '#define USE_MORPHTARGETS' : '',\n\t\t\tparameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '',\n\t\t\t( parameters.morphTargets && parameters.isWebGL2 ) ? '#define MORPHTARGETS_TEXTURE' : '',\n\t\t\t( parameters.morphTargets && parameters.isWebGL2 ) ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '',\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\t( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',\n\n\t\t\t'uniform mat4 modelMatrix;',\n\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform mat3 normalMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t'#ifdef USE_INSTANCING',\n\n\t\t\t'\tattribute mat4 instanceMatrix;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_INSTANCING_COLOR',\n\n\t\t\t'\tattribute vec3 instanceColor;',\n\n\t\t\t'#endif',\n\n\t\t\t'attribute vec3 position;',\n\t\t\t'attribute vec3 normal;',\n\t\t\t'attribute vec2 uv;',\n\n\t\t\t'#ifdef USE_TANGENT',\n\n\t\t\t'\tattribute vec4 tangent;',\n\n\t\t\t'#endif',\n\n\t\t\t'#if defined( USE_COLOR_ALPHA )',\n\n\t\t\t'\tattribute vec4 color;',\n\n\t\t\t'#elif defined( USE_COLOR )',\n\n\t\t\t'\tattribute vec3 color;',\n\n\t\t\t'#endif',\n\n\t\t\t'#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )',\n\n\t\t\t'\tattribute vec3 morphTarget0;',\n\t\t\t'\tattribute vec3 morphTarget1;',\n\t\t\t'\tattribute vec3 morphTarget2;',\n\t\t\t'\tattribute vec3 morphTarget3;',\n\n\t\t\t'\t#ifdef USE_MORPHNORMALS',\n\n\t\t\t'\t\tattribute vec3 morphNormal0;',\n\t\t\t'\t\tattribute vec3 morphNormal1;',\n\t\t\t'\t\tattribute vec3 morphNormal2;',\n\t\t\t'\t\tattribute vec3 morphNormal3;',\n\n\t\t\t'\t#else',\n\n\t\t\t'\t\tattribute vec3 morphTarget4;',\n\t\t\t'\t\tattribute vec3 morphTarget5;',\n\t\t\t'\t\tattribute vec3 morphTarget6;',\n\t\t\t'\t\tattribute vec3 morphTarget7;',\n\n\t\t\t'\t#endif',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_SKINNING',\n\n\t\t\t'\tattribute vec4 skinIndex;',\n\t\t\t'\tattribute vec4 skinWeight;',\n\n\t\t\t'#endif',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tprefixFragment = [\n\n\t\t\tcustomExtensions,\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\t( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '',\n\t\t\t( parameters.useFog && parameters.fogExp2 ) ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.matcap ? '#define USE_MATCAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapTypeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapBlendingDefine : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\t( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '',\n\t\t\t( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '',\n\n\t\t\tparameters.clearcoat ? '#define USE_CLEARCOAT' : '',\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULARCOLORMAP' : '',\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\tparameters.alphaTest ? '#define USE_ALPHATEST' : '',\n\n\t\t\tparameters.sheen ? '#define USE_SHEEN' : '',\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEENCOLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEENROUGHNESSMAP' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',\n\n\t\t\tparameters.vertexTangents ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUvs ? '#define USE_UV' : '',\n\t\t\tparameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '',\n\n\t\t\tparameters.gradientMap ? '#define USE_GRADIENTMAP' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',\n\n\t\t\tparameters.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\t( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',\n\n\t\t\t( ( parameters.extensionShaderTextureLOD || parameters.envMap ) && parameters.rendererExtensionShaderTextureLod ) ? '#define TEXTURE_LOD_EXT' : '',\n\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '',\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '',\n\n\t\t\tparameters.dithering ? '#define DITHERING' : '',\n\t\t\tparameters.transparent ? '' : '#define OPAQUE',\n\n\t\t\tShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below\n\t\t\tgetTexelEncodingFunction( 'linearToOutputTexel', parameters.outputEncoding ),\n\n\t\t\tparameters.depthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t}\n\n\tvertexShader = resolveIncludes( vertexShader );\n\tvertexShader = replaceLightNums( vertexShader, parameters );\n\tvertexShader = replaceClippingPlaneNums( vertexShader, parameters );\n\n\tfragmentShader = resolveIncludes( fragmentShader );\n\tfragmentShader = replaceLightNums( fragmentShader, parameters );\n\tfragmentShader = replaceClippingPlaneNums( fragmentShader, parameters );\n\n\tvertexShader = unrollLoops( vertexShader );\n\tfragmentShader = unrollLoops( fragmentShader );\n\n\tif ( parameters.isWebGL2 && parameters.isRawShaderMaterial !== true ) {\n\n\t\t// GLSL 3.0 conversion for built-in materials and ShaderMaterial\n\n\t\tversionString = '#version 300 es\\n';\n\n\t\tprefixVertex = [\n\t\t\t'precision mediump sampler2DArray;',\n\t\t\t'#define attribute in',\n\t\t\t'#define varying out',\n\t\t\t'#define texture2D texture'\n\t\t].join( '\\n' ) + '\\n' + prefixVertex;\n\n\t\tprefixFragment = [\n\t\t\t'#define varying in',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor',\n\t\t\t'#define gl_FragDepthEXT gl_FragDepth',\n\t\t\t'#define texture2D texture',\n\t\t\t'#define textureCube texture',\n\t\t\t'#define texture2DProj textureProj',\n\t\t\t'#define texture2DLodEXT textureLod',\n\t\t\t'#define texture2DProjLodEXT textureProjLod',\n\t\t\t'#define textureCubeLodEXT textureLod',\n\t\t\t'#define texture2DGradEXT textureGrad',\n\t\t\t'#define texture2DProjGradEXT textureProjGrad',\n\t\t\t'#define textureCubeGradEXT textureGrad'\n\t\t].join( '\\n' ) + '\\n' + prefixFragment;\n\n\t}\n\n\tconst vertexGlsl = versionString + prefixVertex + vertexShader;\n\tconst fragmentGlsl = versionString + prefixFragment + fragmentShader;\n\n\t// console.log( '*VERTEX*', vertexGlsl );\n\t// console.log( '*FRAGMENT*', fragmentGlsl );\n\n\tconst glVertexShader = WebGLShader( gl, 35633, vertexGlsl );\n\tconst glFragmentShader = WebGLShader( gl, 35632, fragmentGlsl );\n\n\tgl.attachShader( program, glVertexShader );\n\tgl.attachShader( program, glFragmentShader );\n\n\t// Force a particular attribute to index 0.\n\n\tif ( parameters.index0AttributeName !== undefined ) {\n\n\t\tgl.bindAttribLocation( program, 0, parameters.index0AttributeName );\n\n\t} else if ( parameters.morphTargets === true ) {\n\n\t\t// programs with morphTargets displace position out of attribute 0\n\t\tgl.bindAttribLocation( program, 0, 'position' );\n\n\t}\n\n\tgl.linkProgram( program );\n\n\t// check for link errors\n\tif ( renderer.debug.checkShaderErrors ) {\n\n\t\tconst programLog = gl.getProgramInfoLog( program ).trim();\n\t\tconst vertexLog = gl.getShaderInfoLog( glVertexShader ).trim();\n\t\tconst fragmentLog = gl.getShaderInfoLog( glFragmentShader ).trim();\n\n\t\tlet runnable = true;\n\t\tlet haveDiagnostics = true;\n\n\t\tif ( gl.getProgramParameter( program, 35714 ) === false ) {\n\n\t\t\trunnable = false;\n\n\t\t\tconst vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' );\n\t\t\tconst fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' );\n\n\t\t\tconsole.error(\n\t\t\t\t'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' +\n\t\t\t\t'VALIDATE_STATUS ' + gl.getProgramParameter( program, 35715 ) + '\\n\\n' +\n\t\t\t\t'Program Info Log: ' + programLog + '\\n' +\n\t\t\t\tvertexErrors + '\\n' +\n\t\t\t\tfragmentErrors\n\t\t\t);\n\n\t\t} else if ( programLog !== '' ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Program Info Log:', programLog );\n\n\t\t} else if ( vertexLog === '' || fragmentLog === '' ) {\n\n\t\t\thaveDiagnostics = false;\n\n\t\t}\n\n\t\tif ( haveDiagnostics ) {\n\n\t\t\tthis.diagnostics = {\n\n\t\t\t\trunnable: runnable,\n\n\t\t\t\tprogramLog: programLog,\n\n\t\t\t\tvertexShader: {\n\n\t\t\t\t\tlog: vertexLog,\n\t\t\t\t\tprefix: prefixVertex\n\n\t\t\t\t},\n\n\t\t\t\tfragmentShader: {\n\n\t\t\t\t\tlog: fragmentLog,\n\t\t\t\t\tprefix: prefixFragment\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}\n\n\t}\n\n\t// Clean up\n\n\t// Crashes in iOS9 and iOS10. #18402\n\t// gl.detachShader( program, glVertexShader );\n\t// gl.detachShader( program, glFragmentShader );\n\n\tgl.deleteShader( glVertexShader );\n\tgl.deleteShader( glFragmentShader );\n\n\t// set up caching for uniform locations\n\n\tlet cachedUniforms;\n\n\tthis.getUniforms = function () {\n\n\t\tif ( cachedUniforms === undefined ) {\n\n\t\t\tcachedUniforms = new WebGLUniforms( gl, program );\n\n\t\t}\n\n\t\treturn cachedUniforms;\n\n\t};\n\n\t// set up caching for attribute locations\n\n\tlet cachedAttributes;\n\n\tthis.getAttributes = function () {\n\n\t\tif ( cachedAttributes === undefined ) {\n\n\t\t\tcachedAttributes = fetchAttributeLocations( gl, program );\n\n\t\t}\n\n\t\treturn cachedAttributes;\n\n\t};\n\n\t// free resource\n\n\tthis.destroy = function () {\n\n\t\tbindingStates.releaseStatesOfProgram( this );\n\n\t\tgl.deleteProgram( program );\n\t\tthis.program = undefined;\n\n\t};\n\n\t//\n\n\tthis.name = parameters.shaderName;\n\tthis.id = programIdCount ++;\n\tthis.cacheKey = cacheKey;\n\tthis.usedTimes = 1;\n\tthis.program = program;\n\tthis.vertexShader = glVertexShader;\n\tthis.fragmentShader = glFragmentShader;\n\n\treturn this;\n\n}\n\nlet _id = 0;\n\nclass WebGLShaderCache {\n\n\tconstructor() {\n\n\t\tthis.shaderCache = new Map();\n\t\tthis.materialCache = new Map();\n\n\t}\n\n\tupdate( material ) {\n\n\t\tconst vertexShader = material.vertexShader;\n\t\tconst fragmentShader = material.fragmentShader;\n\n\t\tconst vertexShaderStage = this._getShaderStage( vertexShader );\n\t\tconst fragmentShaderStage = this._getShaderStage( fragmentShader );\n\n\t\tconst materialShaders = this._getShaderCacheForMaterial( material );\n\n\t\tif ( materialShaders.has( vertexShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( vertexShaderStage );\n\t\t\tvertexShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\tif ( materialShaders.has( fragmentShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( fragmentShaderStage );\n\t\t\tfragmentShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremove( material ) {\n\n\t\tconst materialShaders = this.materialCache.get( material );\n\n\t\tfor ( const shaderStage of materialShaders ) {\n\n\t\t\tshaderStage.usedTimes --;\n\n\t\t\tif ( shaderStage.usedTimes === 0 ) this.shaderCache.delete( shaderStage );\n\n\t\t}\n\n\t\tthis.materialCache.delete( material );\n\n\t\treturn this;\n\n\t}\n\n\tgetVertexShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.vertexShader ).id;\n\n\t}\n\n\tgetFragmentShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.fragmentShader ).id;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shaderCache.clear();\n\t\tthis.materialCache.clear();\n\n\t}\n\n\t_getShaderCacheForMaterial( material ) {\n\n\t\tconst cache = this.materialCache;\n\n\t\tif ( cache.has( material ) === false ) {\n\n\t\t\tcache.set( material, new Set() );\n\n\t\t}\n\n\t\treturn cache.get( material );\n\n\t}\n\n\t_getShaderStage( code ) {\n\n\t\tconst cache = this.shaderCache;\n\n\t\tif ( cache.has( code ) === false ) {\n\n\t\t\tconst stage = new WebGLShaderStage();\n\t\t\tcache.set( code, stage );\n\n\t\t}\n\n\t\treturn cache.get( code );\n\n\t}\n\n}\n\nclass WebGLShaderStage {\n\n\tconstructor() {\n\n\t\tthis.id = _id ++;\n\n\t\tthis.usedTimes = 0;\n\n\t}\n\n}\n\nfunction WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ) {\n\n\tconst _programLayers = new Layers();\n\tconst _customShaders = new WebGLShaderCache();\n\tconst programs = [];\n\n\tconst isWebGL2 = capabilities.isWebGL2;\n\tconst logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;\n\tconst floatVertexTextures = capabilities.floatVertexTextures;\n\tconst maxVertexUniforms = capabilities.maxVertexUniforms;\n\tconst vertexTextures = capabilities.vertexTextures;\n\tlet precision = capabilities.precision;\n\n\tconst shaderIDs = {\n\t\tMeshDepthMaterial: 'depth',\n\t\tMeshDistanceMaterial: 'distanceRGBA',\n\t\tMeshNormalMaterial: 'normal',\n\t\tMeshBasicMaterial: 'basic',\n\t\tMeshLambertMaterial: 'lambert',\n\t\tMeshPhongMaterial: 'phong',\n\t\tMeshToonMaterial: 'toon',\n\t\tMeshStandardMaterial: 'physical',\n\t\tMeshPhysicalMaterial: 'physical',\n\t\tMeshMatcapMaterial: 'matcap',\n\t\tLineBasicMaterial: 'basic',\n\t\tLineDashedMaterial: 'dashed',\n\t\tPointsMaterial: 'points',\n\t\tShadowMaterial: 'shadow',\n\t\tSpriteMaterial: 'sprite'\n\t};\n\n\tfunction getMaxBones( object ) {\n\n\t\tconst skeleton = object.skeleton;\n\t\tconst bones = skeleton.bones;\n\n\t\tif ( floatVertexTextures ) {\n\n\t\t\treturn 1024;\n\n\t\t} else {\n\n\t\t\t// default for when object is not specified\n\t\t\t// ( for example when prebuilding shader to be used with multiple objects )\n\t\t\t//\n\t\t\t// - leave some extra space for other uniforms\n\t\t\t// - limit here is ANGLE's 254 max uniform vectors\n\t\t\t// (up to 54 should be safe)\n\n\t\t\tconst nVertexUniforms = maxVertexUniforms;\n\t\t\tconst nVertexMatrices = Math.floor( ( nVertexUniforms - 20 ) / 4 );\n\n\t\t\tconst maxBones = Math.min( nVertexMatrices, bones.length );\n\n\t\t\tif ( maxBones < bones.length ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Skeleton has ' + bones.length + ' bones. This GPU supports ' + maxBones + '.' );\n\t\t\t\treturn 0;\n\n\t\t\t}\n\n\t\t\treturn maxBones;\n\n\t\t}\n\n\t}\n\n\tfunction getParameters( material, lights, shadows, scene, object ) {\n\n\t\tconst fog = scene.fog;\n\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\n\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\n\t\t// heuristics to create shader parameters according to lights in the scene\n\t\t// (not to blow over maxLights budget)\n\n\t\tconst maxBones = object.isSkinnedMesh ? getMaxBones( object ) : 0;\n\n\t\tif ( material.precision !== null ) {\n\n\t\t\tprecision = capabilities.getMaxPrecision( material.precision );\n\n\t\t\tif ( precision !== material.precision ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' );\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet vertexShader, fragmentShader;\n\t\tlet customVertexShaderID, customFragmentShaderID;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\n\t\t\tvertexShader = shader.vertexShader;\n\t\t\tfragmentShader = shader.fragmentShader;\n\n\t\t} else {\n\n\t\t\tvertexShader = material.vertexShader;\n\t\t\tfragmentShader = material.fragmentShader;\n\n\t\t\t_customShaders.update( material );\n\n\t\t\tcustomVertexShaderID = _customShaders.getVertexShaderID( material );\n\t\t\tcustomFragmentShaderID = _customShaders.getFragmentShaderID( material );\n\n\t\t}\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\tconst useAlphaTest = material.alphaTest > 0;\n\t\tconst useClearcoat = material.clearcoat > 0;\n\n\t\tconst parameters = {\n\n\t\t\tisWebGL2: isWebGL2,\n\n\t\t\tshaderID: shaderID,\n\t\t\tshaderName: material.type,\n\n\t\t\tvertexShader: vertexShader,\n\t\t\tfragmentShader: fragmentShader,\n\t\t\tdefines: material.defines,\n\n\t\t\tcustomVertexShaderID: customVertexShaderID,\n\t\t\tcustomFragmentShaderID: customFragmentShaderID,\n\n\t\t\tisRawShaderMaterial: material.isRawShaderMaterial === true,\n\t\t\tglslVersion: material.glslVersion,\n\n\t\t\tprecision: precision,\n\n\t\t\tinstancing: object.isInstancedMesh === true,\n\t\t\tinstancingColor: object.isInstancedMesh === true && object.instanceColor !== null,\n\n\t\t\tsupportsVertexTextures: vertexTextures,\n\t\t\toutputEncoding: ( currentRenderTarget === null ) ? renderer.outputEncoding : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.encoding : LinearEncoding ),\n\t\t\tmap: !! material.map,\n\t\t\tmatcap: !! material.matcap,\n\t\t\tenvMap: !! envMap,\n\t\t\tenvMapMode: envMap && envMap.mapping,\n\t\t\tenvMapCubeUV: ( !! envMap ) && ( ( envMap.mapping === CubeUVReflectionMapping ) || ( envMap.mapping === CubeUVRefractionMapping ) ),\n\t\t\tlightMap: !! material.lightMap,\n\t\t\taoMap: !! material.aoMap,\n\t\t\temissiveMap: !! material.emissiveMap,\n\t\t\tbumpMap: !! material.bumpMap,\n\t\t\tnormalMap: !! material.normalMap,\n\t\t\tobjectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap,\n\t\t\ttangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap,\n\n\t\t\tdecodeVideoTexture: !! material.map && ( material.map.isVideoTexture === true ) && ( material.map.encoding === sRGBEncoding ),\n\n\t\t\tclearcoat: useClearcoat,\n\t\t\tclearcoatMap: useClearcoat && !! material.clearcoatMap,\n\t\t\tclearcoatRoughnessMap: useClearcoat && !! material.clearcoatRoughnessMap,\n\t\t\tclearcoatNormalMap: useClearcoat && !! material.clearcoatNormalMap,\n\n\t\t\tdisplacementMap: !! material.displacementMap,\n\t\t\troughnessMap: !! material.roughnessMap,\n\t\t\tmetalnessMap: !! material.metalnessMap,\n\t\t\tspecularMap: !! material.specularMap,\n\t\t\tspecularIntensityMap: !! material.specularIntensityMap,\n\t\t\tspecularColorMap: !! material.specularColorMap,\n\n\t\t\ttransparent: material.transparent,\n\n\t\t\talphaMap: !! material.alphaMap,\n\t\t\talphaTest: useAlphaTest,\n\n\t\t\tgradientMap: !! material.gradientMap,\n\n\t\t\tsheen: material.sheen > 0,\n\t\t\tsheenColorMap: !! material.sheenColorMap,\n\t\t\tsheenRoughnessMap: !! material.sheenRoughnessMap,\n\n\t\t\ttransmission: material.transmission > 0,\n\t\t\ttransmissionMap: !! material.transmissionMap,\n\t\t\tthicknessMap: !! material.thicknessMap,\n\n\t\t\tcombine: material.combine,\n\n\t\t\tvertexTangents: ( !! material.normalMap && !! object.geometry && !! object.geometry.attributes.tangent ),\n\t\t\tvertexColors: material.vertexColors,\n\t\t\tvertexAlphas: material.vertexColors === true && !! object.geometry && !! object.geometry.attributes.color && object.geometry.attributes.color.itemSize === 4,\n\t\t\tvertexUvs: !! material.map || !! material.bumpMap || !! material.normalMap || !! material.specularMap || !! material.alphaMap || !! material.emissiveMap || !! material.roughnessMap || !! material.metalnessMap || !! material.clearcoatMap || !! material.clearcoatRoughnessMap || !! material.clearcoatNormalMap || !! material.displacementMap || !! material.transmissionMap || !! material.thicknessMap || !! material.specularIntensityMap || !! material.specularColorMap || !! material.sheenColorMap || !! material.sheenRoughnessMap,\n\t\t\tuvsVertexOnly: ! ( !! material.map || !! material.bumpMap || !! material.normalMap || !! material.specularMap || !! material.alphaMap || !! material.emissiveMap || !! material.roughnessMap || !! material.metalnessMap || !! material.clearcoatNormalMap || material.transmission > 0 || !! material.transmissionMap || !! material.thicknessMap || !! material.specularIntensityMap || !! material.specularColorMap || material.sheen > 0 || !! material.sheenColorMap || !! material.sheenRoughnessMap ) && !! material.displacementMap,\n\n\t\t\tfog: !! fog,\n\t\t\tuseFog: material.fog,\n\t\t\tfogExp2: ( fog && fog.isFogExp2 ),\n\n\t\t\tflatShading: !! material.flatShading,\n\n\t\t\tsizeAttenuation: material.sizeAttenuation,\n\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\n\t\t\tskinning: object.isSkinnedMesh === true && maxBones > 0,\n\t\t\tmaxBones: maxBones,\n\t\t\tuseVertexTexture: floatVertexTextures,\n\n\t\t\tmorphTargets: !! object.geometry && !! object.geometry.morphAttributes.position,\n\t\t\tmorphNormals: !! object.geometry && !! object.geometry.morphAttributes.normal,\n\t\t\tmorphTargetsCount: ( !! object.geometry && !! object.geometry.morphAttributes.position ) ? object.geometry.morphAttributes.position.length : 0,\n\n\t\t\tnumDirLights: lights.directional.length,\n\t\t\tnumPointLights: lights.point.length,\n\t\t\tnumSpotLights: lights.spot.length,\n\t\t\tnumRectAreaLights: lights.rectArea.length,\n\t\t\tnumHemiLights: lights.hemi.length,\n\n\t\t\tnumDirLightShadows: lights.directionalShadowMap.length,\n\t\t\tnumPointLightShadows: lights.pointShadowMap.length,\n\t\t\tnumSpotLightShadows: lights.spotShadowMap.length,\n\n\t\t\tnumClippingPlanes: clipping.numPlanes,\n\t\t\tnumClipIntersection: clipping.numIntersection,\n\n\t\t\tdithering: material.dithering,\n\n\t\t\tshadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,\n\t\t\tshadowMapType: renderer.shadowMap.type,\n\n\t\t\ttoneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping,\n\t\t\tphysicallyCorrectLights: renderer.physicallyCorrectLights,\n\n\t\t\tpremultipliedAlpha: material.premultipliedAlpha,\n\n\t\t\tdoubleSided: material.side === DoubleSide,\n\t\t\tflipSided: material.side === BackSide,\n\n\t\t\tdepthPacking: ( material.depthPacking !== undefined ) ? material.depthPacking : false,\n\n\t\t\tindex0AttributeName: material.index0AttributeName,\n\n\t\t\textensionDerivatives: material.extensions && material.extensions.derivatives,\n\t\t\textensionFragDepth: material.extensions && material.extensions.fragDepth,\n\t\t\textensionDrawBuffers: material.extensions && material.extensions.drawBuffers,\n\t\t\textensionShaderTextureLOD: material.extensions && material.extensions.shaderTextureLOD,\n\n\t\t\trendererExtensionFragDepth: isWebGL2 || extensions.has( 'EXT_frag_depth' ),\n\t\t\trendererExtensionDrawBuffers: isWebGL2 || extensions.has( 'WEBGL_draw_buffers' ),\n\t\t\trendererExtensionShaderTextureLod: isWebGL2 || extensions.has( 'EXT_shader_texture_lod' ),\n\n\t\t\tcustomProgramCacheKey: material.customProgramCacheKey()\n\n\t\t};\n\n\t\treturn parameters;\n\n\t}\n\n\tfunction getProgramCacheKey( parameters ) {\n\n\t\tconst array = [];\n\n\t\tif ( parameters.shaderID ) {\n\n\t\t\tarray.push( parameters.shaderID );\n\n\t\t} else {\n\n\t\t\tarray.push( parameters.customVertexShaderID );\n\t\t\tarray.push( parameters.customFragmentShaderID );\n\n\t\t}\n\n\t\tif ( parameters.defines !== undefined ) {\n\n\t\t\tfor ( const name in parameters.defines ) {\n\n\t\t\t\tarray.push( name );\n\t\t\t\tarray.push( parameters.defines[ name ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( parameters.isRawShaderMaterial === false ) {\n\n\t\t\tgetProgramCacheKeyParameters( array, parameters );\n\t\t\tgetProgramCacheKeyBooleans( array, parameters );\n\t\t\tarray.push( renderer.outputEncoding );\n\n\t\t}\n\n\t\tarray.push( parameters.customProgramCacheKey );\n\n\t\treturn array.join();\n\n\t}\n\n\tfunction getProgramCacheKeyParameters( array, parameters ) {\n\n\t\tarray.push( parameters.precision );\n\t\tarray.push( parameters.outputEncoding );\n\t\tarray.push( parameters.envMapMode );\n\t\tarray.push( parameters.combine );\n\t\tarray.push( parameters.vertexUvs );\n\t\tarray.push( parameters.fogExp2 );\n\t\tarray.push( parameters.sizeAttenuation );\n\t\tarray.push( parameters.maxBones );\n\t\tarray.push( parameters.morphTargetsCount );\n\t\tarray.push( parameters.numDirLights );\n\t\tarray.push( parameters.numPointLights );\n\t\tarray.push( parameters.numSpotLights );\n\t\tarray.push( parameters.numHemiLights );\n\t\tarray.push( parameters.numRectAreaLights );\n\t\tarray.push( parameters.numDirLightShadows );\n\t\tarray.push( parameters.numPointLightShadows );\n\t\tarray.push( parameters.numSpotLightShadows );\n\t\tarray.push( parameters.shadowMapType );\n\t\tarray.push( parameters.toneMapping );\n\t\tarray.push( parameters.numClippingPlanes );\n\t\tarray.push( parameters.numClipIntersection );\n\n\t}\n\n\tfunction getProgramCacheKeyBooleans( array, parameters ) {\n\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.isWebGL2 )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.supportsVertexTextures )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.instancing )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.instancingColor )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.map )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.matcap )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.envMap )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.envMapCubeUV )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.lightMap )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.aoMap )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.emissiveMap )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.bumpMap )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.normalMap )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.objectSpaceNormalMap )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.tangentSpaceNormalMap )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.clearcoat )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.clearcoatMap )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.clearcoatRoughnessMap )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.clearcoatNormalMap )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.displacementMap )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.specularMap )\n\t\t\t_programLayers.enable( 20 );\n\t\tif ( parameters.roughnessMap )\n\t\t\t_programLayers.enable( 21 );\n\t\tif ( parameters.metalnessMap )\n\t\t\t_programLayers.enable( 22 );\n\t\tif ( parameters.gradientMap )\n\t\t\t_programLayers.enable( 23 );\n\t\tif ( parameters.alphaMap )\n\t\t\t_programLayers.enable( 24 );\n\t\tif ( parameters.alphaTest )\n\t\t\t_programLayers.enable( 25 );\n\t\tif ( parameters.vertexColors )\n\t\t\t_programLayers.enable( 26 );\n\t\tif ( parameters.vertexAlphas )\n\t\t\t_programLayers.enable( 27 );\n\t\tif ( parameters.vertexUvs )\n\t\t\t_programLayers.enable( 28 );\n\t\tif ( parameters.vertexTangents )\n\t\t\t_programLayers.enable( 29 );\n\t\tif ( parameters.uvsVertexOnly )\n\t\t\t_programLayers.enable( 30 );\n\t\tif ( parameters.fog )\n\t\t\t_programLayers.enable( 31 );\n\n\t\tarray.push( _programLayers.mask );\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.useFog )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.flatShading )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.logarithmicDepthBuffer )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.skinning )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.useVertexTexture )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.morphTargets )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.morphNormals )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.premultipliedAlpha )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.shadowMapEnabled )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.physicallyCorrectLights )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.doubleSided )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.flipSided )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.depthPacking )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.dithering )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.specularIntensityMap )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.specularColorMap )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.transmission )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.transmissionMap )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.thicknessMap )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.sheen )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.sheenColorMap )\n\t\t\t_programLayers.enable( 20 );\n\t\tif ( parameters.sheenRoughnessMap )\n\t\t\t_programLayers.enable( 21 );\n\t\tif ( parameters.decodeVideoTexture )\n\t\t\t_programLayers.enable( 22 );\n\t\tif ( parameters.transparent )\n\t\t\t_programLayers.enable( 23 );\n\n\t\tarray.push( _programLayers.mask );\n\n\t}\n\n\tfunction getUniforms( material ) {\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\t\tlet uniforms;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\t\t\tuniforms = UniformsUtils.clone( shader.uniforms );\n\n\t\t} else {\n\n\t\t\tuniforms = material.uniforms;\n\n\t\t}\n\n\t\treturn uniforms;\n\n\t}\n\n\tfunction acquireProgram( parameters, cacheKey ) {\n\n\t\tlet program;\n\n\t\t// Check if code has been already compiled\n\t\tfor ( let p = 0, pl = programs.length; p < pl; p ++ ) {\n\n\t\t\tconst preexistingProgram = programs[ p ];\n\n\t\t\tif ( preexistingProgram.cacheKey === cacheKey ) {\n\n\t\t\t\tprogram = preexistingProgram;\n\t\t\t\t++ program.usedTimes;\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( program === undefined ) {\n\n\t\t\tprogram = new WebGLProgram( renderer, cacheKey, parameters, bindingStates );\n\t\t\tprograms.push( program );\n\n\t\t}\n\n\t\treturn program;\n\n\t}\n\n\tfunction releaseProgram( program ) {\n\n\t\tif ( -- program.usedTimes === 0 ) {\n\n\t\t\t// Remove from unordered set\n\t\t\tconst i = programs.indexOf( program );\n\t\t\tprograms[ i ] = programs[ programs.length - 1 ];\n\t\t\tprograms.pop();\n\n\t\t\t// Free WebGL resources\n\t\t\tprogram.destroy();\n\n\t\t}\n\n\t}\n\n\tfunction releaseShaderCache( material ) {\n\n\t\t_customShaders.remove( material );\n\n\t}\n\n\tfunction dispose() {\n\n\t\t_customShaders.dispose();\n\n\t}\n\n\treturn {\n\t\tgetParameters: getParameters,\n\t\tgetProgramCacheKey: getProgramCacheKey,\n\t\tgetUniforms: getUniforms,\n\t\tacquireProgram: acquireProgram,\n\t\treleaseProgram: releaseProgram,\n\t\treleaseShaderCache: releaseShaderCache,\n\t\t// Exposed for resource monitoring & error feedback via renderer.info:\n\t\tprograms: programs,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLProperties() {\n\n\tlet properties = new WeakMap();\n\n\tfunction get( object ) {\n\n\t\tlet map = properties.get( object );\n\n\t\tif ( map === undefined ) {\n\n\t\t\tmap = {};\n\t\t\tproperties.set( object, map );\n\n\t\t}\n\n\t\treturn map;\n\n\t}\n\n\tfunction remove( object ) {\n\n\t\tproperties.delete( object );\n\n\t}\n\n\tfunction update( object, key, value ) {\n\n\t\tproperties.get( object )[ key ] = value;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tproperties = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction painterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.material.id !== b.material.id ) {\n\n\t\treturn a.material.id - b.material.id;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn a.z - b.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\nfunction reversePainterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn b.z - a.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\n\nfunction WebGLRenderList() {\n\n\tconst renderItems = [];\n\tlet renderItemsIndex = 0;\n\n\tconst opaque = [];\n\tconst transmissive = [];\n\tconst transparent = [];\n\n\tfunction init() {\n\n\t\trenderItemsIndex = 0;\n\n\t\topaque.length = 0;\n\t\ttransmissive.length = 0;\n\t\ttransparent.length = 0;\n\n\t}\n\n\tfunction getNextRenderItem( object, geometry, material, groupOrder, z, group ) {\n\n\t\tlet renderItem = renderItems[ renderItemsIndex ];\n\n\t\tif ( renderItem === undefined ) {\n\n\t\t\trenderItem = {\n\t\t\t\tid: object.id,\n\t\t\t\tobject: object,\n\t\t\t\tgeometry: geometry,\n\t\t\t\tmaterial: material,\n\t\t\t\tgroupOrder: groupOrder,\n\t\t\t\trenderOrder: object.renderOrder,\n\t\t\t\tz: z,\n\t\t\t\tgroup: group\n\t\t\t};\n\n\t\t\trenderItems[ renderItemsIndex ] = renderItem;\n\n\t\t} else {\n\n\t\t\trenderItem.id = object.id;\n\t\t\trenderItem.object = object;\n\t\t\trenderItem.geometry = geometry;\n\t\t\trenderItem.material = material;\n\t\t\trenderItem.groupOrder = groupOrder;\n\t\t\trenderItem.renderOrder = object.renderOrder;\n\t\t\trenderItem.z = z;\n\t\t\trenderItem.group = group;\n\n\t\t}\n\n\t\trenderItemsIndex ++;\n\n\t\treturn renderItem;\n\n\t}\n\n\tfunction push( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.push( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.push( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.push( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction unshift( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.unshift( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.unshift( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.unshift( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction sort( customOpaqueSort, customTransparentSort ) {\n\n\t\tif ( opaque.length > 1 ) opaque.sort( customOpaqueSort || painterSortStable );\n\t\tif ( transmissive.length > 1 ) transmissive.sort( customTransparentSort || reversePainterSortStable );\n\t\tif ( transparent.length > 1 ) transparent.sort( customTransparentSort || reversePainterSortStable );\n\n\t}\n\n\tfunction finish() {\n\n\t\t// Clear references from inactive renderItems in the list\n\n\t\tfor ( let i = renderItemsIndex, il = renderItems.length; i < il; i ++ ) {\n\n\t\t\tconst renderItem = renderItems[ i ];\n\n\t\t\tif ( renderItem.id === null ) break;\n\n\t\t\trenderItem.id = null;\n\t\t\trenderItem.object = null;\n\t\t\trenderItem.geometry = null;\n\t\t\trenderItem.material = null;\n\t\t\trenderItem.group = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\topaque: opaque,\n\t\ttransmissive: transmissive,\n\t\ttransparent: transparent,\n\n\t\tinit: init,\n\t\tpush: push,\n\t\tunshift: unshift,\n\t\tfinish: finish,\n\n\t\tsort: sort\n\t};\n\n}\n\nfunction WebGLRenderLists() {\n\n\tlet lists = new WeakMap();\n\n\tfunction get( scene, renderCallDepth ) {\n\n\t\tlet list;\n\n\t\tif ( lists.has( scene ) === false ) {\n\n\t\t\tlist = new WebGLRenderList();\n\t\t\tlists.set( scene, [ list ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= lists.get( scene ).length ) {\n\n\t\t\t\tlist = new WebGLRenderList();\n\t\t\t\tlists.get( scene ).push( list );\n\n\t\t\t} else {\n\n\t\t\t\tlist = lists.get( scene )[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn list;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tlists = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction UniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tconeCos: 0,\n\t\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tskyColor: new Color(),\n\t\t\t\t\t\tgroundColor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\thalfWidth: new Vector3(),\n\t\t\t\t\t\thalfHeight: new Vector3()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\nfunction ShadowUniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2(),\n\t\t\t\t\t\tshadowCameraNear: 1,\n\t\t\t\t\t\tshadowCameraFar: 1000\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\t// TODO (abelnation): set RectAreaLight shadow uniforms\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\n\n\nlet nextVersion = 0;\n\nfunction shadowCastingLightsFirst( lightA, lightB ) {\n\n\treturn ( lightB.castShadow ? 1 : 0 ) - ( lightA.castShadow ? 1 : 0 );\n\n}\n\nfunction WebGLLights( extensions, capabilities ) {\n\n\tconst cache = new UniformsCache();\n\n\tconst shadowCache = ShadowUniformsCache();\n\n\tconst state = {\n\n\t\tversion: 0,\n\n\t\thash: {\n\t\t\tdirectionalLength: - 1,\n\t\t\tpointLength: - 1,\n\t\t\tspotLength: - 1,\n\t\t\trectAreaLength: - 1,\n\t\t\themiLength: - 1,\n\n\t\t\tnumDirectionalShadows: - 1,\n\t\t\tnumPointShadows: - 1,\n\t\t\tnumSpotShadows: - 1\n\t\t},\n\n\t\tambient: [ 0, 0, 0 ],\n\t\tprobe: [],\n\t\tdirectional: [],\n\t\tdirectionalShadow: [],\n\t\tdirectionalShadowMap: [],\n\t\tdirectionalShadowMatrix: [],\n\t\tspot: [],\n\t\tspotShadow: [],\n\t\tspotShadowMap: [],\n\t\tspotShadowMatrix: [],\n\t\trectArea: [],\n\t\trectAreaLTC1: null,\n\t\trectAreaLTC2: null,\n\t\tpoint: [],\n\t\tpointShadow: [],\n\t\tpointShadowMap: [],\n\t\tpointShadowMatrix: [],\n\t\themi: []\n\n\t};\n\n\tfor ( let i = 0; i < 9; i ++ ) state.probe.push( new Vector3() );\n\n\tconst vector3 = new Vector3();\n\tconst matrix4 = new Matrix4();\n\tconst matrix42 = new Matrix4();\n\n\tfunction setup( lights, physicallyCorrectLights ) {\n\n\t\tlet r = 0, g = 0, b = 0;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 );\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tlet numDirectionalShadows = 0;\n\t\tlet numPointShadows = 0;\n\t\tlet numSpotShadows = 0;\n\n\t\tlights.sort( shadowCastingLightsFirst );\n\n\t\t// artist-friendly light intensity scaling factor\n\t\tconst scaleFactor = ( physicallyCorrectLights !== true ) ? Math.PI : 1;\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tconst color = light.color;\n\t\t\tconst intensity = light.intensity;\n\t\t\tconst distance = light.distance;\n\n\t\t\tconst shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null;\n\n\t\t\tif ( light.isAmbientLight ) {\n\n\t\t\t\tr += color.r * intensity * scaleFactor;\n\t\t\t\tg += color.g * intensity * scaleFactor;\n\t\t\t\tb += color.b * intensity * scaleFactor;\n\n\t\t\t} else if ( light.isLightProbe ) {\n\n\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\tstate.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity );\n\n\t\t\t\t}\n\n\t\t\t} else if ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor );\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.directionalShadow[ directionalLength ] = shadowUniforms;\n\t\t\t\t\tstate.directionalShadowMap[ directionalLength ] = shadowMap;\n\t\t\t\t\tstate.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumDirectionalShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.directional[ directionalLength ] = uniforms;\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity * scaleFactor );\n\t\t\t\tuniforms.distance = distance;\n\n\t\t\t\tuniforms.coneCos = Math.cos( light.angle );\n\t\t\t\tuniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) );\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.spotShadow[ spotLength ] = shadowUniforms;\n\t\t\t\t\tstate.spotShadowMap[ spotLength ] = shadowMap;\n\t\t\t\t\tstate.spotShadowMatrix[ spotLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumSpotShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.spot[ spotLength ] = uniforms;\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\t// (a) intensity is the total visible light emitted\n\t\t\t\t//uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) );\n\n\t\t\t\t// (b) intensity is the brightness of the light\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tstate.rectArea[ rectAreaLength ] = uniforms;\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor );\n\t\t\t\tuniforms.distance = light.distance;\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\tshadowUniforms.shadowCameraNear = shadow.camera.near;\n\t\t\t\t\tshadowUniforms.shadowCameraFar = shadow.camera.far;\n\n\t\t\t\t\tstate.pointShadow[ pointLength ] = shadowUniforms;\n\t\t\t\t\tstate.pointShadowMap[ pointLength ] = shadowMap;\n\t\t\t\t\tstate.pointShadowMatrix[ pointLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumPointShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.point[ pointLength ] = uniforms;\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.skyColor.copy( light.color ).multiplyScalar( intensity * scaleFactor );\n\t\t\t\tuniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity * scaleFactor );\n\n\t\t\t\tstate.hemi[ hemiLength ] = uniforms;\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( rectAreaLength > 0 ) {\n\n\t\t\tif ( capabilities.isWebGL2 ) {\n\n\t\t\t\t// WebGL 2\n\n\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\n\t\t\t} else {\n\n\t\t\t\t// WebGL 1\n\n\t\t\t\tif ( extensions.has( 'OES_texture_float_linear' ) === true ) {\n\n\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\n\t\t\t\t} else if ( extensions.has( 'OES_texture_half_float_linear' ) === true ) {\n\n\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_HALF_1;\n\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_HALF_2;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.ambient[ 0 ] = r;\n\t\tstate.ambient[ 1 ] = g;\n\t\tstate.ambient[ 2 ] = b;\n\n\t\tconst hash = state.hash;\n\n\t\tif ( hash.directionalLength !== directionalLength ||\n\t\t\thash.pointLength !== pointLength ||\n\t\t\thash.spotLength !== spotLength ||\n\t\t\thash.rectAreaLength !== rectAreaLength ||\n\t\t\thash.hemiLength !== hemiLength ||\n\t\t\thash.numDirectionalShadows !== numDirectionalShadows ||\n\t\t\thash.numPointShadows !== numPointShadows ||\n\t\t\thash.numSpotShadows !== numSpotShadows ) {\n\n\t\t\tstate.directional.length = directionalLength;\n\t\t\tstate.spot.length = spotLength;\n\t\t\tstate.rectArea.length = rectAreaLength;\n\t\t\tstate.point.length = pointLength;\n\t\t\tstate.hemi.length = hemiLength;\n\n\t\t\tstate.directionalShadow.length = numDirectionalShadows;\n\t\t\tstate.directionalShadowMap.length = numDirectionalShadows;\n\t\t\tstate.pointShadow.length = numPointShadows;\n\t\t\tstate.pointShadowMap.length = numPointShadows;\n\t\t\tstate.spotShadow.length = numSpotShadows;\n\t\t\tstate.spotShadowMap.length = numSpotShadows;\n\t\t\tstate.directionalShadowMatrix.length = numDirectionalShadows;\n\t\t\tstate.pointShadowMatrix.length = numPointShadows;\n\t\t\tstate.spotShadowMatrix.length = numSpotShadows;\n\n\t\t\thash.directionalLength = directionalLength;\n\t\t\thash.pointLength = pointLength;\n\t\t\thash.spotLength = spotLength;\n\t\t\thash.rectAreaLength = rectAreaLength;\n\t\t\thash.hemiLength = hemiLength;\n\n\t\t\thash.numDirectionalShadows = numDirectionalShadows;\n\t\t\thash.numPointShadows = numPointShadows;\n\t\t\thash.numSpotShadows = numSpotShadows;\n\n\t\t\tstate.version = nextVersion ++;\n\n\t\t}\n\n\t}\n\n\tfunction setupView( lights, camera ) {\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tconst viewMatrix = camera.matrixWorldInverse;\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tif ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = state.directional[ directionalLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = state.spot[ spotLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = state.rectArea[ rectAreaLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\t// extract local rotation of light to derive width/height half vectors\n\t\t\t\tmatrix42.identity();\n\t\t\t\tmatrix4.copy( light.matrixWorld );\n\t\t\t\tmatrix4.premultiply( viewMatrix );\n\t\t\t\tmatrix42.extractRotation( matrix4 );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tuniforms.halfWidth.applyMatrix4( matrix42 );\n\t\t\t\tuniforms.halfHeight.applyMatrix4( matrix42 );\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = state.point[ pointLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = state.hemi[ hemiLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\t\t\t\tuniforms.direction.normalize();\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tsetup: setup,\n\t\tsetupView: setupView,\n\t\tstate: state\n\t};\n\n}\n\nfunction WebGLRenderState( extensions, capabilities ) {\n\n\tconst lights = new WebGLLights( extensions, capabilities );\n\n\tconst lightsArray = [];\n\tconst shadowsArray = [];\n\n\tfunction init() {\n\n\t\tlightsArray.length = 0;\n\t\tshadowsArray.length = 0;\n\n\t}\n\n\tfunction pushLight( light ) {\n\n\t\tlightsArray.push( light );\n\n\t}\n\n\tfunction pushShadow( shadowLight ) {\n\n\t\tshadowsArray.push( shadowLight );\n\n\t}\n\n\tfunction setupLights( physicallyCorrectLights ) {\n\n\t\tlights.setup( lightsArray, physicallyCorrectLights );\n\n\t}\n\n\tfunction setupLightsView( camera ) {\n\n\t\tlights.setupView( lightsArray, camera );\n\n\t}\n\n\tconst state = {\n\t\tlightsArray: lightsArray,\n\t\tshadowsArray: shadowsArray,\n\n\t\tlights: lights\n\t};\n\n\treturn {\n\t\tinit: init,\n\t\tstate: state,\n\t\tsetupLights: setupLights,\n\t\tsetupLightsView: setupLightsView,\n\n\t\tpushLight: pushLight,\n\t\tpushShadow: pushShadow\n\t};\n\n}\n\nfunction WebGLRenderStates( extensions, capabilities ) {\n\n\tlet renderStates = new WeakMap();\n\n\tfunction get( scene, renderCallDepth = 0 ) {\n\n\t\tlet renderState;\n\n\t\tif ( renderStates.has( scene ) === false ) {\n\n\t\t\trenderState = new WebGLRenderState( extensions, capabilities );\n\t\t\trenderStates.set( scene, [ renderState ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= renderStates.get( scene ).length ) {\n\n\t\t\t\trenderState = new WebGLRenderState( extensions, capabilities );\n\t\t\t\trenderStates.get( scene ).push( renderState );\n\n\t\t\t} else {\n\n\t\t\t\trenderState = renderStates.get( scene )[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn renderState;\n\n\t}\n\n\tfunction dispose() {\n\n\t\trenderStates = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\n/**\n * parameters = {\n *\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * wireframe: ,\n * wireframeLinewidth: \n * }\n */\n\nclass MeshDepthMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'MeshDepthMaterial';\n\n\t\tthis.depthPacking = BasicDepthPacking;\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.depthPacking = source.depthPacking;\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshDepthMaterial.prototype.isMeshDepthMaterial = true;\n\n/**\n * parameters = {\n *\n * referencePosition: ,\n * nearDistance: ,\n * farDistance: ,\n *\n * map: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: \n *\n * }\n */\n\nclass MeshDistanceMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'MeshDistanceMaterial';\n\n\t\tthis.referencePosition = new Vector3();\n\t\tthis.nearDistance = 1;\n\t\tthis.farDistance = 1000;\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.fog = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.referencePosition.copy( source.referencePosition );\n\t\tthis.nearDistance = source.nearDistance;\n\t\tthis.farDistance = source.farDistance;\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;\n\nconst vertex = \"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\";\n\nconst fragment = \"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\n#include \\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}\";\n\nfunction WebGLShadowMap( _renderer, _objects, _capabilities ) {\n\n\tlet _frustum = new Frustum();\n\n\tconst _shadowMapSize = new Vector2(),\n\t\t_viewportSize = new Vector2(),\n\n\t\t_viewport = new Vector4(),\n\n\t\t_depthMaterial = new MeshDepthMaterial( { depthPacking: RGBADepthPacking } ),\n\t\t_distanceMaterial = new MeshDistanceMaterial(),\n\n\t\t_materialCache = {},\n\n\t\t_maxTextureSize = _capabilities.maxTextureSize;\n\n\tconst shadowSide = { 0: BackSide, 1: FrontSide, 2: DoubleSide };\n\n\tconst shadowMaterialVertical = new ShaderMaterial( {\n\t\tdefines: {\n\t\t\tVSM_SAMPLES: 8\n\t\t},\n\t\tuniforms: {\n\t\t\tshadow_pass: { value: null },\n\t\t\tresolution: { value: new Vector2() },\n\t\t\tradius: { value: 4.0 }\n\t\t},\n\n\t\tvertexShader: vertex,\n\t\tfragmentShader: fragment\n\n\t} );\n\n\tconst shadowMaterialHorizontal = shadowMaterialVertical.clone();\n\tshadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1;\n\n\tconst fullScreenTri = new BufferGeometry();\n\tfullScreenTri.setAttribute(\n\t\t'position',\n\t\tnew BufferAttribute(\n\t\t\tnew Float32Array( [ - 1, - 1, 0.5, 3, - 1, 0.5, - 1, 3, 0.5 ] ),\n\t\t\t3\n\t\t)\n\t);\n\n\tconst fullScreenMesh = new Mesh( fullScreenTri, shadowMaterialVertical );\n\n\tconst scope = this;\n\n\tthis.enabled = false;\n\n\tthis.autoUpdate = true;\n\tthis.needsUpdate = false;\n\n\tthis.type = PCFShadowMap;\n\n\tthis.render = function ( lights, scene, camera ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tif ( scope.autoUpdate === false && scope.needsUpdate === false ) return;\n\n\t\tif ( lights.length === 0 ) return;\n\n\t\tconst currentRenderTarget = _renderer.getRenderTarget();\n\t\tconst activeCubeFace = _renderer.getActiveCubeFace();\n\t\tconst activeMipmapLevel = _renderer.getActiveMipmapLevel();\n\n\t\tconst _state = _renderer.state;\n\n\t\t// Set GL state for depth map.\n\t\t_state.setBlending( NoBlending );\n\t\t_state.buffers.color.setClear( 1, 1, 1, 1 );\n\t\t_state.buffers.depth.setTest( true );\n\t\t_state.setScissorTest( false );\n\n\t\t// render depth map\n\n\t\tfor ( let i = 0, il = lights.length; i < il; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\t\t\tconst shadow = light.shadow;\n\n\t\t\tif ( shadow === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue;\n\n\t\t\t_shadowMapSize.copy( shadow.mapSize );\n\n\t\t\tconst shadowFrameExtents = shadow.getFrameExtents();\n\n\t\t\t_shadowMapSize.multiply( shadowFrameExtents );\n\n\t\t\t_viewportSize.copy( shadow.mapSize );\n\n\t\t\tif ( _shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\tif ( _shadowMapSize.x > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.x = Math.floor( _maxTextureSize / shadowFrameExtents.x );\n\t\t\t\t\t_shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x;\n\t\t\t\t\tshadow.mapSize.x = _viewportSize.x;\n\n\t\t\t\t}\n\n\t\t\t\tif ( _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.y = Math.floor( _maxTextureSize / shadowFrameExtents.y );\n\t\t\t\t\t_shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y;\n\t\t\t\t\tshadow.mapSize.y = _viewportSize.y;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( shadow.map === null && ! shadow.isPointLightShadow && this.type === VSMShadowMap ) {\n\n\t\t\t\tconst pars = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat };\n\n\t\t\t\tshadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );\n\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\n\t\t\t\tshadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );\n\n\t\t\t\tshadow.camera.updateProjectionMatrix();\n\n\t\t\t}\n\n\t\t\tif ( shadow.map === null ) {\n\n\t\t\t\tconst pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };\n\n\t\t\t\tshadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );\n\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\n\t\t\t\tshadow.camera.updateProjectionMatrix();\n\n\t\t\t}\n\n\t\t\t_renderer.setRenderTarget( shadow.map );\n\t\t\t_renderer.clear();\n\n\t\t\tconst viewportCount = shadow.getViewportCount();\n\n\t\t\tfor ( let vp = 0; vp < viewportCount; vp ++ ) {\n\n\t\t\t\tconst viewport = shadow.getViewport( vp );\n\n\t\t\t\t_viewport.set(\n\t\t\t\t\t_viewportSize.x * viewport.x,\n\t\t\t\t\t_viewportSize.y * viewport.y,\n\t\t\t\t\t_viewportSize.x * viewport.z,\n\t\t\t\t\t_viewportSize.y * viewport.w\n\t\t\t\t);\n\n\t\t\t\t_state.viewport( _viewport );\n\n\t\t\t\tshadow.updateMatrices( light, vp );\n\n\t\t\t\t_frustum = shadow.getFrustum();\n\n\t\t\t\trenderObject( scene, camera, shadow.camera, light, this.type );\n\n\t\t\t}\n\n\t\t\t// do blur pass for VSM\n\n\t\t\tif ( ! shadow.isPointLightShadow && this.type === VSMShadowMap ) {\n\n\t\t\t\tVSMPass( shadow, camera );\n\n\t\t\t}\n\n\t\t\tshadow.needsUpdate = false;\n\n\t\t}\n\n\t\tscope.needsUpdate = false;\n\n\t\t_renderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );\n\n\t};\n\n\tfunction VSMPass( shadow, camera ) {\n\n\t\tconst geometry = _objects.update( fullScreenMesh );\n\n\t\tif ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) {\n\n\t\t\tshadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples;\n\t\t\tshadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples;\n\n\t\t\tshadowMaterialVertical.needsUpdate = true;\n\t\t\tshadowMaterialHorizontal.needsUpdate = true;\n\n\t\t}\n\n\t\t// vertical pass\n\n\t\tshadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;\n\t\tshadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialVertical.uniforms.radius.value = shadow.radius;\n\t\t_renderer.setRenderTarget( shadow.mapPass );\n\t\t_renderer.clear();\n\t\t_renderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null );\n\n\t\t// horizontal pass\n\n\t\tshadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;\n\t\tshadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialHorizontal.uniforms.radius.value = shadow.radius;\n\t\t_renderer.setRenderTarget( shadow.map );\n\t\t_renderer.clear();\n\t\t_renderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null );\n\n\t}\n\n\tfunction getDepthMaterial( object, geometry, material, light, shadowCameraNear, shadowCameraFar, type ) {\n\n\t\tlet result = null;\n\n\t\tconst customMaterial = ( light.isPointLight === true ) ? object.customDistanceMaterial : object.customDepthMaterial;\n\n\t\tif ( customMaterial !== undefined ) {\n\n\t\t\tresult = customMaterial;\n\n\t\t} else {\n\n\t\t\tresult = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial;\n\n\t\t}\n\n\t\tif ( ( _renderer.localClippingEnabled && material.clipShadows === true && material.clippingPlanes.length !== 0 ) ||\n\t\t\t( material.displacementMap && material.displacementScale !== 0 ) ||\n\t\t\t( material.alphaMap && material.alphaTest > 0 ) ) {\n\n\t\t\t// in this case we need a unique material instance reflecting the\n\t\t\t// appropriate state\n\n\t\t\tconst keyA = result.uuid, keyB = material.uuid;\n\n\t\t\tlet materialsForVariant = _materialCache[ keyA ];\n\n\t\t\tif ( materialsForVariant === undefined ) {\n\n\t\t\t\tmaterialsForVariant = {};\n\t\t\t\t_materialCache[ keyA ] = materialsForVariant;\n\n\t\t\t}\n\n\t\t\tlet cachedMaterial = materialsForVariant[ keyB ];\n\n\t\t\tif ( cachedMaterial === undefined ) {\n\n\t\t\t\tcachedMaterial = result.clone();\n\t\t\t\tmaterialsForVariant[ keyB ] = cachedMaterial;\n\n\t\t\t}\n\n\t\t\tresult = cachedMaterial;\n\n\t\t}\n\n\t\tresult.visible = material.visible;\n\t\tresult.wireframe = material.wireframe;\n\n\t\tif ( type === VSMShadowMap ) {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : material.side;\n\n\t\t} else {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : shadowSide[ material.side ];\n\n\t\t}\n\n\t\tresult.alphaMap = material.alphaMap;\n\t\tresult.alphaTest = material.alphaTest;\n\n\t\tresult.clipShadows = material.clipShadows;\n\t\tresult.clippingPlanes = material.clippingPlanes;\n\t\tresult.clipIntersection = material.clipIntersection;\n\n\t\tresult.displacementMap = material.displacementMap;\n\t\tresult.displacementScale = material.displacementScale;\n\t\tresult.displacementBias = material.displacementBias;\n\n\t\tresult.wireframeLinewidth = material.wireframeLinewidth;\n\t\tresult.linewidth = material.linewidth;\n\n\t\tif ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) {\n\n\t\t\tresult.referencePosition.setFromMatrixPosition( light.matrixWorld );\n\t\t\tresult.nearDistance = shadowCameraNear;\n\t\t\tresult.farDistance = shadowCameraFar;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tfunction renderObject( object, camera, shadowCamera, light, type ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tconst visible = object.layers.test( camera.layers );\n\n\t\tif ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) {\n\n\t\t\tif ( ( object.castShadow || ( object.receiveShadow && type === VSMShadowMap ) ) && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) {\n\n\t\t\t\tobject.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );\n\n\t\t\t\tconst geometry = _objects.update( object );\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\tfor ( let k = 0, kl = groups.length; k < kl; k ++ ) {\n\n\t\t\t\t\t\tconst group = groups[ k ];\n\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type );\n\n\t\t\t\t\t\t\t_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, geometry, material, light, shadowCamera.near, shadowCamera.far, type );\n\n\t\t\t\t\t_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( children[ i ], camera, shadowCamera, light, type );\n\n\t\t}\n\n\t}\n\n}\n\nfunction WebGLState( gl, extensions, capabilities ) {\n\n\tconst isWebGL2 = capabilities.isWebGL2;\n\n\tfunction ColorBuffer() {\n\n\t\tlet locked = false;\n\n\t\tconst color = new Vector4();\n\t\tlet currentColorMask = null;\n\t\tconst currentColorClear = new Vector4( 0, 0, 0, 0 );\n\n\t\treturn {\n\n\t\t\tsetMask: function ( colorMask ) {\n\n\t\t\t\tif ( currentColorMask !== colorMask && ! locked ) {\n\n\t\t\t\t\tgl.colorMask( colorMask, colorMask, colorMask, colorMask );\n\t\t\t\t\tcurrentColorMask = colorMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( r, g, b, a, premultipliedAlpha ) {\n\n\t\t\t\tif ( premultipliedAlpha === true ) {\n\n\t\t\t\t\tr *= a; g *= a; b *= a;\n\n\t\t\t\t}\n\n\t\t\t\tcolor.set( r, g, b, a );\n\n\t\t\t\tif ( currentColorClear.equals( color ) === false ) {\n\n\t\t\t\t\tgl.clearColor( r, g, b, a );\n\t\t\t\t\tcurrentColorClear.copy( color );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentColorMask = null;\n\t\t\t\tcurrentColorClear.set( - 1, 0, 0, 0 ); // set to invalid state\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction DepthBuffer() {\n\n\t\tlet locked = false;\n\n\t\tlet currentDepthMask = null;\n\t\tlet currentDepthFunc = null;\n\t\tlet currentDepthClear = null;\n\n\t\treturn {\n\n\t\t\tsetTest: function ( depthTest ) {\n\n\t\t\t\tif ( depthTest ) {\n\n\t\t\t\t\tenable( 2929 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdisable( 2929 );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( depthMask ) {\n\n\t\t\t\tif ( currentDepthMask !== depthMask && ! locked ) {\n\n\t\t\t\t\tgl.depthMask( depthMask );\n\t\t\t\t\tcurrentDepthMask = depthMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( depthFunc ) {\n\n\t\t\t\tif ( currentDepthFunc !== depthFunc ) {\n\n\t\t\t\t\tif ( depthFunc ) {\n\n\t\t\t\t\t\tswitch ( depthFunc ) {\n\n\t\t\t\t\t\t\tcase NeverDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 512 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase AlwaysDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 519 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase LessDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 513 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase LessEqualDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 515 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase EqualDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 514 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase GreaterEqualDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 518 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase GreaterDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 516 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase NotEqualDepth:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 517 );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t\tgl.depthFunc( 515 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgl.depthFunc( 515 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentDepthFunc = depthFunc;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( depth ) {\n\n\t\t\t\tif ( currentDepthClear !== depth ) {\n\n\t\t\t\t\tgl.clearDepth( depth );\n\t\t\t\t\tcurrentDepthClear = depth;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentDepthMask = null;\n\t\t\t\tcurrentDepthFunc = null;\n\t\t\t\tcurrentDepthClear = null;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction StencilBuffer() {\n\n\t\tlet locked = false;\n\n\t\tlet currentStencilMask = null;\n\t\tlet currentStencilFunc = null;\n\t\tlet currentStencilRef = null;\n\t\tlet currentStencilFuncMask = null;\n\t\tlet currentStencilFail = null;\n\t\tlet currentStencilZFail = null;\n\t\tlet currentStencilZPass = null;\n\t\tlet currentStencilClear = null;\n\n\t\treturn {\n\n\t\t\tsetTest: function ( stencilTest ) {\n\n\t\t\t\tif ( ! locked ) {\n\n\t\t\t\t\tif ( stencilTest ) {\n\n\t\t\t\t\t\tenable( 2960 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tdisable( 2960 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( stencilMask ) {\n\n\t\t\t\tif ( currentStencilMask !== stencilMask && ! locked ) {\n\n\t\t\t\t\tgl.stencilMask( stencilMask );\n\t\t\t\t\tcurrentStencilMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( stencilFunc, stencilRef, stencilMask ) {\n\n\t\t\t\tif ( currentStencilFunc !== stencilFunc ||\n\t\t\t\t currentStencilRef !== stencilRef ||\n\t\t\t\t currentStencilFuncMask !== stencilMask ) {\n\n\t\t\t\t\tgl.stencilFunc( stencilFunc, stencilRef, stencilMask );\n\n\t\t\t\t\tcurrentStencilFunc = stencilFunc;\n\t\t\t\t\tcurrentStencilRef = stencilRef;\n\t\t\t\t\tcurrentStencilFuncMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetOp: function ( stencilFail, stencilZFail, stencilZPass ) {\n\n\t\t\t\tif ( currentStencilFail !== stencilFail ||\n\t\t\t\t currentStencilZFail !== stencilZFail ||\n\t\t\t\t currentStencilZPass !== stencilZPass ) {\n\n\t\t\t\t\tgl.stencilOp( stencilFail, stencilZFail, stencilZPass );\n\n\t\t\t\t\tcurrentStencilFail = stencilFail;\n\t\t\t\t\tcurrentStencilZFail = stencilZFail;\n\t\t\t\t\tcurrentStencilZPass = stencilZPass;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( stencil ) {\n\n\t\t\t\tif ( currentStencilClear !== stencil ) {\n\n\t\t\t\t\tgl.clearStencil( stencil );\n\t\t\t\t\tcurrentStencilClear = stencil;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentStencilMask = null;\n\t\t\t\tcurrentStencilFunc = null;\n\t\t\t\tcurrentStencilRef = null;\n\t\t\t\tcurrentStencilFuncMask = null;\n\t\t\t\tcurrentStencilFail = null;\n\t\t\t\tcurrentStencilZFail = null;\n\t\t\t\tcurrentStencilZPass = null;\n\t\t\t\tcurrentStencilClear = null;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t//\n\n\tconst colorBuffer = new ColorBuffer();\n\tconst depthBuffer = new DepthBuffer();\n\tconst stencilBuffer = new StencilBuffer();\n\n\tlet enabledCapabilities = {};\n\n\tlet currentBoundFramebuffers = {};\n\tlet currentDrawbuffers = new WeakMap();\n\tlet defaultDrawbuffers = [];\n\n\tlet currentProgram = null;\n\n\tlet currentBlendingEnabled = false;\n\tlet currentBlending = null;\n\tlet currentBlendEquation = null;\n\tlet currentBlendSrc = null;\n\tlet currentBlendDst = null;\n\tlet currentBlendEquationAlpha = null;\n\tlet currentBlendSrcAlpha = null;\n\tlet currentBlendDstAlpha = null;\n\tlet currentPremultipledAlpha = false;\n\n\tlet currentFlipSided = null;\n\tlet currentCullFace = null;\n\n\tlet currentLineWidth = null;\n\n\tlet currentPolygonOffsetFactor = null;\n\tlet currentPolygonOffsetUnits = null;\n\n\tconst maxTextures = gl.getParameter( 35661 );\n\n\tlet lineWidthAvailable = false;\n\tlet version = 0;\n\tconst glVersion = gl.getParameter( 7938 );\n\n\tif ( glVersion.indexOf( 'WebGL' ) !== - 1 ) {\n\n\t\tversion = parseFloat( /^WebGL (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 1.0 );\n\n\t} else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) {\n\n\t\tversion = parseFloat( /^OpenGL ES (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 2.0 );\n\n\t}\n\n\tlet currentTextureSlot = null;\n\tlet currentBoundTextures = {};\n\n\tconst scissorParam = gl.getParameter( 3088 );\n\tconst viewportParam = gl.getParameter( 2978 );\n\n\tconst currentScissor = new Vector4().fromArray( scissorParam );\n\tconst currentViewport = new Vector4().fromArray( viewportParam );\n\n\tfunction createTexture( type, target, count ) {\n\n\t\tconst data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.\n\t\tconst texture = gl.createTexture();\n\n\t\tgl.bindTexture( type, texture );\n\t\tgl.texParameteri( type, 10241, 9728 );\n\t\tgl.texParameteri( type, 10240, 9728 );\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tgl.texImage2D( target + i, 0, 6408, 1, 1, 0, 6408, 5121, data );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tconst emptyTextures = {};\n\temptyTextures[ 3553 ] = createTexture( 3553, 3553, 1 );\n\temptyTextures[ 34067 ] = createTexture( 34067, 34069, 6 );\n\n\t// init\n\n\tcolorBuffer.setClear( 0, 0, 0, 1 );\n\tdepthBuffer.setClear( 1 );\n\tstencilBuffer.setClear( 0 );\n\n\tenable( 2929 );\n\tdepthBuffer.setFunc( LessEqualDepth );\n\n\tsetFlipSided( false );\n\tsetCullFace( CullFaceBack );\n\tenable( 2884 );\n\n\tsetBlending( NoBlending );\n\n\t//\n\n\tfunction enable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== true ) {\n\n\t\t\tgl.enable( id );\n\t\t\tenabledCapabilities[ id ] = true;\n\n\t\t}\n\n\t}\n\n\tfunction disable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== false ) {\n\n\t\t\tgl.disable( id );\n\t\t\tenabledCapabilities[ id ] = false;\n\n\t\t}\n\n\t}\n\n\tfunction bindFramebuffer( target, framebuffer ) {\n\n\t\tif ( currentBoundFramebuffers[ target ] !== framebuffer ) {\n\n\t\t\tgl.bindFramebuffer( target, framebuffer );\n\n\t\t\tcurrentBoundFramebuffers[ target ] = framebuffer;\n\n\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\t// 36009 is equivalent to 36160\n\n\t\t\t\tif ( target === 36009 ) {\n\n\t\t\t\t\tcurrentBoundFramebuffers[ 36160 ] = framebuffer;\n\n\t\t\t\t}\n\n\t\t\t\tif ( target === 36160 ) {\n\n\t\t\t\t\tcurrentBoundFramebuffers[ 36009 ] = framebuffer;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tfunction drawBuffers( renderTarget, framebuffer ) {\n\n\t\tlet drawBuffers = defaultDrawbuffers;\n\n\t\tlet needsUpdate = false;\n\n\t\tif ( renderTarget ) {\n\n\t\t\tdrawBuffers = currentDrawbuffers.get( framebuffer );\n\n\t\t\tif ( drawBuffers === undefined ) {\n\n\t\t\t\tdrawBuffers = [];\n\t\t\t\tcurrentDrawbuffers.set( framebuffer, drawBuffers );\n\n\t\t\t}\n\n\t\t\tif ( renderTarget.isWebGLMultipleRenderTargets ) {\n\n\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\tif ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== 36064 ) {\n\n\t\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tdrawBuffers[ i ] = 36064 + i;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tdrawBuffers.length = textures.length;\n\n\t\t\t\t\tneedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( drawBuffers[ 0 ] !== 36064 ) {\n\n\t\t\t\t\tdrawBuffers[ 0 ] = 36064;\n\n\t\t\t\t\tneedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( drawBuffers[ 0 ] !== 1029 ) {\n\n\t\t\t\tdrawBuffers[ 0 ] = 1029;\n\n\t\t\t\tneedsUpdate = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tif ( capabilities.isWebGL2 ) {\n\n\t\t\t\tgl.drawBuffers( drawBuffers );\n\n\t\t\t} else {\n\n\t\t\t\textensions.get( 'WEBGL_draw_buffers' ).drawBuffersWEBGL( drawBuffers );\n\n\t\t\t}\n\n\t\t}\n\n\n\t}\n\n\tfunction useProgram( program ) {\n\n\t\tif ( currentProgram !== program ) {\n\n\t\t\tgl.useProgram( program );\n\n\t\t\tcurrentProgram = program;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tconst equationToGL = {\n\t\t[ AddEquation ]: 32774,\n\t\t[ SubtractEquation ]: 32778,\n\t\t[ ReverseSubtractEquation ]: 32779\n\t};\n\n\tif ( isWebGL2 ) {\n\n\t\tequationToGL[ MinEquation ] = 32775;\n\t\tequationToGL[ MaxEquation ] = 32776;\n\n\t} else {\n\n\t\tconst extension = extensions.get( 'EXT_blend_minmax' );\n\n\t\tif ( extension !== null ) {\n\n\t\t\tequationToGL[ MinEquation ] = extension.MIN_EXT;\n\t\t\tequationToGL[ MaxEquation ] = extension.MAX_EXT;\n\n\t\t}\n\n\t}\n\n\tconst factorToGL = {\n\t\t[ ZeroFactor ]: 0,\n\t\t[ OneFactor ]: 1,\n\t\t[ SrcColorFactor ]: 768,\n\t\t[ SrcAlphaFactor ]: 770,\n\t\t[ SrcAlphaSaturateFactor ]: 776,\n\t\t[ DstColorFactor ]: 774,\n\t\t[ DstAlphaFactor ]: 772,\n\t\t[ OneMinusSrcColorFactor ]: 769,\n\t\t[ OneMinusSrcAlphaFactor ]: 771,\n\t\t[ OneMinusDstColorFactor ]: 775,\n\t\t[ OneMinusDstAlphaFactor ]: 773\n\t};\n\n\tfunction setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) {\n\n\t\tif ( blending === NoBlending ) {\n\n\t\t\tif ( currentBlendingEnabled === true ) {\n\n\t\t\t\tdisable( 3042 );\n\t\t\t\tcurrentBlendingEnabled = false;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( currentBlendingEnabled === false ) {\n\n\t\t\tenable( 3042 );\n\t\t\tcurrentBlendingEnabled = true;\n\n\t\t}\n\n\t\tif ( blending !== CustomBlending ) {\n\n\t\t\tif ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) {\n\n\t\t\t\tif ( currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation ) {\n\n\t\t\t\t\tgl.blendEquation( 32774 );\n\n\t\t\t\t\tcurrentBlendEquation = AddEquation;\n\t\t\t\t\tcurrentBlendEquationAlpha = AddEquation;\n\n\t\t\t\t}\n\n\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( 1, 771, 1, 771 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFunc( 1, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( 0, 769, 0, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( 0, 768, 0, 770 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( 770, 771, 1, 771 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFunc( 770, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( 0, 769, 0, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tgl.blendFunc( 0, 768 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcurrentBlendSrc = null;\n\t\t\t\tcurrentBlendDst = null;\n\t\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\t\tcurrentBlendDstAlpha = null;\n\n\t\t\t\tcurrentBlending = blending;\n\t\t\t\tcurrentPremultipledAlpha = premultipliedAlpha;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// custom blending\n\n\t\tblendEquationAlpha = blendEquationAlpha || blendEquation;\n\t\tblendSrcAlpha = blendSrcAlpha || blendSrc;\n\t\tblendDstAlpha = blendDstAlpha || blendDst;\n\n\t\tif ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) {\n\n\t\t\tgl.blendEquationSeparate( equationToGL[ blendEquation ], equationToGL[ blendEquationAlpha ] );\n\n\t\t\tcurrentBlendEquation = blendEquation;\n\t\t\tcurrentBlendEquationAlpha = blendEquationAlpha;\n\n\t\t}\n\n\t\tif ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) {\n\n\t\t\tgl.blendFuncSeparate( factorToGL[ blendSrc ], factorToGL[ blendDst ], factorToGL[ blendSrcAlpha ], factorToGL[ blendDstAlpha ] );\n\n\t\t\tcurrentBlendSrc = blendSrc;\n\t\t\tcurrentBlendDst = blendDst;\n\t\t\tcurrentBlendSrcAlpha = blendSrcAlpha;\n\t\t\tcurrentBlendDstAlpha = blendDstAlpha;\n\n\t\t}\n\n\t\tcurrentBlending = blending;\n\t\tcurrentPremultipledAlpha = null;\n\n\t}\n\n\tfunction setMaterial( material, frontFaceCW ) {\n\n\t\tmaterial.side === DoubleSide\n\t\t\t? disable( 2884 )\n\t\t\t: enable( 2884 );\n\n\t\tlet flipSided = ( material.side === BackSide );\n\t\tif ( frontFaceCW ) flipSided = ! flipSided;\n\n\t\tsetFlipSided( flipSided );\n\n\t\t( material.blending === NormalBlending && material.transparent === false )\n\t\t\t? setBlending( NoBlending )\n\t\t\t: setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha );\n\n\t\tdepthBuffer.setFunc( material.depthFunc );\n\t\tdepthBuffer.setTest( material.depthTest );\n\t\tdepthBuffer.setMask( material.depthWrite );\n\t\tcolorBuffer.setMask( material.colorWrite );\n\n\t\tconst stencilWrite = material.stencilWrite;\n\t\tstencilBuffer.setTest( stencilWrite );\n\t\tif ( stencilWrite ) {\n\n\t\t\tstencilBuffer.setMask( material.stencilWriteMask );\n\t\t\tstencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask );\n\t\t\tstencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass );\n\n\t\t}\n\n\t\tsetPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );\n\n\t\tmaterial.alphaToCoverage === true\n\t\t\t? enable( 32926 )\n\t\t\t: disable( 32926 );\n\n\t}\n\n\t//\n\n\tfunction setFlipSided( flipSided ) {\n\n\t\tif ( currentFlipSided !== flipSided ) {\n\n\t\t\tif ( flipSided ) {\n\n\t\t\t\tgl.frontFace( 2304 );\n\n\t\t\t} else {\n\n\t\t\t\tgl.frontFace( 2305 );\n\n\t\t\t}\n\n\t\t\tcurrentFlipSided = flipSided;\n\n\t\t}\n\n\t}\n\n\tfunction setCullFace( cullFace ) {\n\n\t\tif ( cullFace !== CullFaceNone ) {\n\n\t\t\tenable( 2884 );\n\n\t\t\tif ( cullFace !== currentCullFace ) {\n\n\t\t\t\tif ( cullFace === CullFaceBack ) {\n\n\t\t\t\t\tgl.cullFace( 1029 );\n\n\t\t\t\t} else if ( cullFace === CullFaceFront ) {\n\n\t\t\t\t\tgl.cullFace( 1028 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tgl.cullFace( 1032 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( 2884 );\n\n\t\t}\n\n\t\tcurrentCullFace = cullFace;\n\n\t}\n\n\tfunction setLineWidth( width ) {\n\n\t\tif ( width !== currentLineWidth ) {\n\n\t\t\tif ( lineWidthAvailable ) gl.lineWidth( width );\n\n\t\t\tcurrentLineWidth = width;\n\n\t\t}\n\n\t}\n\n\tfunction setPolygonOffset( polygonOffset, factor, units ) {\n\n\t\tif ( polygonOffset ) {\n\n\t\t\tenable( 32823 );\n\n\t\t\tif ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) {\n\n\t\t\t\tgl.polygonOffset( factor, units );\n\n\t\t\t\tcurrentPolygonOffsetFactor = factor;\n\t\t\t\tcurrentPolygonOffsetUnits = units;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( 32823 );\n\n\t\t}\n\n\t}\n\n\tfunction setScissorTest( scissorTest ) {\n\n\t\tif ( scissorTest ) {\n\n\t\t\tenable( 3089 );\n\n\t\t} else {\n\n\t\t\tdisable( 3089 );\n\n\t\t}\n\n\t}\n\n\t// texture\n\n\tfunction activeTexture( webglSlot ) {\n\n\t\tif ( webglSlot === undefined ) webglSlot = 33984 + maxTextures - 1;\n\n\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\tgl.activeTexture( webglSlot );\n\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t}\n\n\t}\n\n\tfunction bindTexture( webglType, webglTexture ) {\n\n\t\tif ( currentTextureSlot === null ) {\n\n\t\t\tactiveTexture();\n\n\t\t}\n\n\t\tlet boundTexture = currentBoundTextures[ currentTextureSlot ];\n\n\t\tif ( boundTexture === undefined ) {\n\n\t\t\tboundTexture = { type: undefined, texture: undefined };\n\t\t\tcurrentBoundTextures[ currentTextureSlot ] = boundTexture;\n\n\t\t}\n\n\t\tif ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) {\n\n\t\t\tgl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] );\n\n\t\t\tboundTexture.type = webglType;\n\t\t\tboundTexture.texture = webglTexture;\n\n\t\t}\n\n\t}\n\n\tfunction unbindTexture() {\n\n\t\tconst boundTexture = currentBoundTextures[ currentTextureSlot ];\n\n\t\tif ( boundTexture !== undefined && boundTexture.type !== undefined ) {\n\n\t\t\tgl.bindTexture( boundTexture.type, null );\n\n\t\t\tboundTexture.type = undefined;\n\t\t\tboundTexture.texture = undefined;\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexSubImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction scissor( scissor ) {\n\n\t\tif ( currentScissor.equals( scissor ) === false ) {\n\n\t\t\tgl.scissor( scissor.x, scissor.y, scissor.z, scissor.w );\n\t\t\tcurrentScissor.copy( scissor );\n\n\t\t}\n\n\t}\n\n\tfunction viewport( viewport ) {\n\n\t\tif ( currentViewport.equals( viewport ) === false ) {\n\n\t\t\tgl.viewport( viewport.x, viewport.y, viewport.z, viewport.w );\n\t\t\tcurrentViewport.copy( viewport );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction reset() {\n\n\t\t// reset state\n\n\t\tgl.disable( 3042 );\n\t\tgl.disable( 2884 );\n\t\tgl.disable( 2929 );\n\t\tgl.disable( 32823 );\n\t\tgl.disable( 3089 );\n\t\tgl.disable( 2960 );\n\t\tgl.disable( 32926 );\n\n\t\tgl.blendEquation( 32774 );\n\t\tgl.blendFunc( 1, 0 );\n\t\tgl.blendFuncSeparate( 1, 0, 1, 0 );\n\n\t\tgl.colorMask( true, true, true, true );\n\t\tgl.clearColor( 0, 0, 0, 0 );\n\n\t\tgl.depthMask( true );\n\t\tgl.depthFunc( 513 );\n\t\tgl.clearDepth( 1 );\n\n\t\tgl.stencilMask( 0xffffffff );\n\t\tgl.stencilFunc( 519, 0, 0xffffffff );\n\t\tgl.stencilOp( 7680, 7680, 7680 );\n\t\tgl.clearStencil( 0 );\n\n\t\tgl.cullFace( 1029 );\n\t\tgl.frontFace( 2305 );\n\n\t\tgl.polygonOffset( 0, 0 );\n\n\t\tgl.activeTexture( 33984 );\n\n\t\tgl.bindFramebuffer( 36160, null );\n\n\t\tif ( isWebGL2 === true ) {\n\n\t\t\tgl.bindFramebuffer( 36009, null );\n\t\t\tgl.bindFramebuffer( 36008, null );\n\n\t\t}\n\n\t\tgl.useProgram( null );\n\n\t\tgl.lineWidth( 1 );\n\n\t\tgl.scissor( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tgl.viewport( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\t// reset internals\n\n\t\tenabledCapabilities = {};\n\n\t\tcurrentTextureSlot = null;\n\t\tcurrentBoundTextures = {};\n\n\t\tcurrentBoundFramebuffers = {};\n\t\tcurrentDrawbuffers = new WeakMap();\n\t\tdefaultDrawbuffers = [];\n\n\t\tcurrentProgram = null;\n\n\t\tcurrentBlendingEnabled = false;\n\t\tcurrentBlending = null;\n\t\tcurrentBlendEquation = null;\n\t\tcurrentBlendSrc = null;\n\t\tcurrentBlendDst = null;\n\t\tcurrentBlendEquationAlpha = null;\n\t\tcurrentBlendSrcAlpha = null;\n\t\tcurrentBlendDstAlpha = null;\n\t\tcurrentPremultipledAlpha = false;\n\n\t\tcurrentFlipSided = null;\n\t\tcurrentCullFace = null;\n\n\t\tcurrentLineWidth = null;\n\n\t\tcurrentPolygonOffsetFactor = null;\n\t\tcurrentPolygonOffsetUnits = null;\n\n\t\tcurrentScissor.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tcurrentViewport.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\tcolorBuffer.reset();\n\t\tdepthBuffer.reset();\n\t\tstencilBuffer.reset();\n\n\t}\n\n\treturn {\n\n\t\tbuffers: {\n\t\t\tcolor: colorBuffer,\n\t\t\tdepth: depthBuffer,\n\t\t\tstencil: stencilBuffer\n\t\t},\n\n\t\tenable: enable,\n\t\tdisable: disable,\n\n\t\tbindFramebuffer: bindFramebuffer,\n\t\tdrawBuffers: drawBuffers,\n\n\t\tuseProgram: useProgram,\n\n\t\tsetBlending: setBlending,\n\t\tsetMaterial: setMaterial,\n\n\t\tsetFlipSided: setFlipSided,\n\t\tsetCullFace: setCullFace,\n\n\t\tsetLineWidth: setLineWidth,\n\t\tsetPolygonOffset: setPolygonOffset,\n\n\t\tsetScissorTest: setScissorTest,\n\n\t\tactiveTexture: activeTexture,\n\t\tbindTexture: bindTexture,\n\t\tunbindTexture: unbindTexture,\n\t\tcompressedTexImage2D: compressedTexImage2D,\n\t\ttexImage2D: texImage2D,\n\t\ttexImage3D: texImage3D,\n\n\t\ttexStorage2D: texStorage2D,\n\t\ttexStorage3D: texStorage3D,\n\t\ttexSubImage2D: texSubImage2D,\n\t\ttexSubImage3D: texSubImage3D,\n\t\tcompressedTexSubImage2D: compressedTexSubImage2D,\n\n\t\tscissor: scissor,\n\t\tviewport: viewport,\n\n\t\treset: reset\n\n\t};\n\n}\n\nfunction WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {\n\n\tconst isWebGL2 = capabilities.isWebGL2;\n\tconst maxTextures = capabilities.maxTextures;\n\tconst maxCubemapSize = capabilities.maxCubemapSize;\n\tconst maxTextureSize = capabilities.maxTextureSize;\n\tconst maxSamples = capabilities.maxSamples;\n\tconst hasMultisampledRenderToTexture = extensions.has( 'WEBGL_multisampled_render_to_texture' );\n\tconst MultisampledRenderToTextureExtension = hasMultisampledRenderToTexture ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : undefined;\n\n\tconst _videoTextures = new WeakMap();\n\tlet _canvas;\n\n\t// cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,\n\t// also OffscreenCanvas.getContext(\"webgl\"), but not OffscreenCanvas.getContext(\"2d\")!\n\t// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).\n\n\tlet useOffscreenCanvas = false;\n\n\ttry {\n\n\t\tuseOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'\n\t\t\t&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;\n\n\t} catch ( err ) {\n\n\t\t// Ignore any errors\n\n\t}\n\n\tfunction createCanvas( width, height ) {\n\n\t\t// Use OffscreenCanvas when available. Specially needed in web workers\n\n\t\treturn useOffscreenCanvas ?\n\t\t\tnew OffscreenCanvas( width, height ) : createElementNS( 'canvas' );\n\n\t}\n\n\tfunction resizeImage( image, needsPowerOfTwo, needsNewCanvas, maxSize ) {\n\n\t\tlet scale = 1;\n\n\t\t// handle case if texture exceeds max size\n\n\t\tif ( image.width > maxSize || image.height > maxSize ) {\n\n\t\t\tscale = maxSize / Math.max( image.width, image.height );\n\n\t\t}\n\n\t\t// only perform resize if necessary\n\n\t\tif ( scale < 1 || needsPowerOfTwo === true ) {\n\n\t\t\t// only perform resize for certain image types\n\n\t\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t\t\tconst floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;\n\n\t\t\t\tconst width = floor( scale * image.width );\n\t\t\t\tconst height = floor( scale * image.height );\n\n\t\t\t\tif ( _canvas === undefined ) _canvas = createCanvas( width, height );\n\n\t\t\t\t// cube textures can't reuse the same canvas\n\n\t\t\t\tconst canvas = needsNewCanvas ? createCanvas( width, height ) : _canvas;\n\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, width, height );\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' );\n\n\t\t\t\treturn canvas;\n\n\t\t\t} else {\n\n\t\t\t\tif ( 'data' in image ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );\n\n\t\t\t\t}\n\n\t\t\t\treturn image;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\tfunction isPowerOfTwo$1( image ) {\n\n\t\treturn isPowerOfTwo( image.width ) && isPowerOfTwo( image.height );\n\n\t}\n\n\tfunction textureNeedsPowerOfTwo( texture ) {\n\n\t\tif ( isWebGL2 ) return false;\n\n\t\treturn ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) ||\n\t\t\t( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter );\n\n\t}\n\n\tfunction textureNeedsGenerateMipmaps( texture, supportsMips ) {\n\n\t\treturn texture.generateMipmaps && supportsMips &&\n\t\t\ttexture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;\n\n\t}\n\n\tfunction generateMipmap( target ) {\n\n\t\t_gl.generateMipmap( target );\n\n\t}\n\n\tfunction getInternalFormat( internalFormatName, glFormat, glType, encoding, isVideoTexture = false ) {\n\n\t\tif ( isWebGL2 === false ) return glFormat;\n\n\t\tif ( internalFormatName !== null ) {\n\n\t\t\tif ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ];\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \\'' + internalFormatName + '\\'' );\n\n\t\t}\n\n\t\tlet internalFormat = glFormat;\n\n\t\tif ( glFormat === 6403 ) {\n\n\t\t\tif ( glType === 5126 ) internalFormat = 33326;\n\t\t\tif ( glType === 5131 ) internalFormat = 33325;\n\t\t\tif ( glType === 5121 ) internalFormat = 33321;\n\n\t\t}\n\n\t\tif ( glFormat === 33319 ) {\n\n\t\t\tif ( glType === 5126 ) internalFormat = 33328;\n\t\t\tif ( glType === 5131 ) internalFormat = 33327;\n\t\t\tif ( glType === 5121 ) internalFormat = 33323;\n\n\t\t}\n\n\t\tif ( glFormat === 6408 ) {\n\n\t\t\tif ( glType === 5126 ) internalFormat = 34836;\n\t\t\tif ( glType === 5131 ) internalFormat = 34842;\n\t\t\tif ( glType === 5121 ) internalFormat = ( encoding === sRGBEncoding && isVideoTexture === false ) ? 35907 : 32856;\n\t\t\tif ( glType === 32819 ) internalFormat = 32854;\n\t\t\tif ( glType === 32820 ) internalFormat = 32855;\n\n\t\t}\n\n\t\tif ( internalFormat === 33325 || internalFormat === 33326 ||\n\t\t\tinternalFormat === 33327 || internalFormat === 33328 ||\n\t\t\tinternalFormat === 34842 || internalFormat === 34836 ) {\n\n\t\t\textensions.get( 'EXT_color_buffer_float' );\n\n\t\t}\n\n\t\treturn internalFormat;\n\n\t}\n\n\tfunction getMipLevels( texture, image, supportsMips ) {\n\n\t\tif ( textureNeedsGenerateMipmaps( texture, supportsMips ) === true || ( texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) ) {\n\n\t\t\treturn Math.log2( Math.max( image.width, image.height ) ) + 1;\n\n\t\t} else if ( texture.mipmaps !== undefined && texture.mipmaps.length > 0 ) {\n\n\t\t\t// user-defined mipmaps\n\n\t\t\treturn texture.mipmaps.length;\n\n\t\t} else if ( texture.isCompressedTexture && Array.isArray( texture.image ) ) {\n\n\t\t\treturn image.mipmaps.length;\n\n\t\t} else {\n\n\t\t\t// texture without mipmaps (only base level)\n\n\t\t\treturn 1;\n\n\t\t}\n\n\t}\n\n\t// Fallback filters for non-power-of-2 textures\n\n\tfunction filterFallback( f ) {\n\n\t\tif ( f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter ) {\n\n\t\t\treturn 9728;\n\n\t\t}\n\n\t\treturn 9729;\n\n\t}\n\n\t//\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tdeallocateTexture( texture );\n\n\t\tif ( texture.isVideoTexture ) {\n\n\t\t\t_videoTextures.delete( texture );\n\n\t\t}\n\n\t\tinfo.memory.textures --;\n\n\t}\n\n\tfunction onRenderTargetDispose( event ) {\n\n\t\tconst renderTarget = event.target;\n\n\t\trenderTarget.removeEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tdeallocateRenderTarget( renderTarget );\n\n\t}\n\n\t//\n\n\tfunction deallocateTexture( texture ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( textureProperties.__webglInit === undefined ) return;\n\n\t\t_gl.deleteTexture( textureProperties.__webglTexture );\n\n\t\tproperties.remove( texture );\n\n\t}\n\n\tfunction deallocateRenderTarget( renderTarget ) {\n\n\t\tconst texture = renderTarget.texture;\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( ! renderTarget ) return;\n\n\t\tif ( textureProperties.__webglTexture !== undefined ) {\n\n\t\t\t_gl.deleteTexture( textureProperties.__webglTexture );\n\n\t\t\tinfo.memory.textures --;\n\n\t\t}\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\trenderTarget.depthTexture.dispose();\n\n\t\t}\n\n\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer );\n\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer );\n\t\t\tif ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\tif ( renderTargetProperties.__webglColorRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglColorRenderbuffer );\n\t\t\tif ( renderTargetProperties.__webglDepthRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthRenderbuffer );\n\n\t\t}\n\n\t\tif ( renderTarget.isWebGLMultipleRenderTargets ) {\n\n\t\t\tfor ( let i = 0, il = texture.length; i < il; i ++ ) {\n\n\t\t\t\tconst attachmentProperties = properties.get( texture[ i ] );\n\n\t\t\t\tif ( attachmentProperties.__webglTexture ) {\n\n\t\t\t\t\t_gl.deleteTexture( attachmentProperties.__webglTexture );\n\n\t\t\t\t\tinfo.memory.textures --;\n\n\t\t\t\t}\n\n\t\t\t\tproperties.remove( texture[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tproperties.remove( texture );\n\t\tproperties.remove( renderTarget );\n\n\t}\n\n\t//\n\n\tlet textureUnits = 0;\n\n\tfunction resetTextureUnits() {\n\n\t\ttextureUnits = 0;\n\n\t}\n\n\tfunction allocateTextureUnit() {\n\n\t\tconst textureUnit = textureUnits;\n\n\t\tif ( textureUnit >= maxTextures ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + maxTextures );\n\n\t\t}\n\n\t\ttextureUnits += 1;\n\n\t\treturn textureUnit;\n\n\t}\n\n\t//\n\n\tfunction setTexture2D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.isVideoTexture ) updateVideoTexture( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tconst image = texture.image;\n\n\t\t\tif ( image === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined' );\n\n\t\t\t} else if ( image.complete === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' );\n\n\t\t\t} else {\n\n\t\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.activeTexture( 33984 + slot );\n\t\tstate.bindTexture( 3553, textureProperties.__webglTexture );\n\n\t}\n\n\tfunction setTexture2DArray( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.activeTexture( 33984 + slot );\n\t\tstate.bindTexture( 35866, textureProperties.__webglTexture );\n\n\t}\n\n\tfunction setTexture3D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.activeTexture( 33984 + slot );\n\t\tstate.bindTexture( 32879, textureProperties.__webglTexture );\n\n\t}\n\n\tfunction setTextureCube( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadCubeTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.activeTexture( 33984 + slot );\n\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\n\t}\n\n\tconst wrappingToGL = {\n\t\t[ RepeatWrapping ]: 10497,\n\t\t[ ClampToEdgeWrapping ]: 33071,\n\t\t[ MirroredRepeatWrapping ]: 33648\n\t};\n\n\tconst filterToGL = {\n\t\t[ NearestFilter ]: 9728,\n\t\t[ NearestMipmapNearestFilter ]: 9984,\n\t\t[ NearestMipmapLinearFilter ]: 9986,\n\n\t\t[ LinearFilter ]: 9729,\n\t\t[ LinearMipmapNearestFilter ]: 9985,\n\t\t[ LinearMipmapLinearFilter ]: 9987\n\t};\n\n\tfunction setTextureParameters( textureType, texture, supportsMips ) {\n\n\t\tif ( supportsMips ) {\n\n\t\t\t_gl.texParameteri( textureType, 10242, wrappingToGL[ texture.wrapS ] );\n\t\t\t_gl.texParameteri( textureType, 10243, wrappingToGL[ texture.wrapT ] );\n\n\t\t\tif ( textureType === 32879 || textureType === 35866 ) {\n\n\t\t\t\t_gl.texParameteri( textureType, 32882, wrappingToGL[ texture.wrapR ] );\n\n\t\t\t}\n\n\t\t\t_gl.texParameteri( textureType, 10240, filterToGL[ texture.magFilter ] );\n\t\t\t_gl.texParameteri( textureType, 10241, filterToGL[ texture.minFilter ] );\n\n\t\t} else {\n\n\t\t\t_gl.texParameteri( textureType, 10242, 33071 );\n\t\t\t_gl.texParameteri( textureType, 10243, 33071 );\n\n\t\t\tif ( textureType === 32879 || textureType === 35866 ) {\n\n\t\t\t\t_gl.texParameteri( textureType, 32882, 33071 );\n\n\t\t\t}\n\n\t\t\tif ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' );\n\n\t\t\t}\n\n\t\t\t_gl.texParameteri( textureType, 10240, filterFallback( texture.magFilter ) );\n\t\t\t_gl.texParameteri( textureType, 10241, filterFallback( texture.minFilter ) );\n\n\t\t\tif ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.' );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\n\t\t\tif ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2\n\t\t\tif ( isWebGL2 === false && ( texture.type === HalfFloatType && extensions.has( 'OES_texture_half_float_linear' ) === false ) ) return; // verify extension for WebGL 1 only\n\n\t\t\tif ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {\n\n\t\t\t\t_gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );\n\t\t\t\tproperties.get( texture ).__currentAnisotropy = texture.anisotropy;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction initTexture( textureProperties, texture ) {\n\n\t\tif ( textureProperties.__webglInit === undefined ) {\n\n\t\t\ttextureProperties.__webglInit = true;\n\n\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\tinfo.memory.textures ++;\n\n\t\t}\n\n\t}\n\n\tfunction uploadTexture( textureProperties, texture, slot ) {\n\n\t\tlet textureType = 3553;\n\n\t\tif ( texture.isDataTexture2DArray ) textureType = 35866;\n\t\tif ( texture.isDataTexture3D ) textureType = 32879;\n\n\t\tinitTexture( textureProperties, texture );\n\n\t\tstate.activeTexture( 33984 + slot );\n\t\tstate.bindTexture( textureType, textureProperties.__webglTexture );\n\n\t\t_gl.pixelStorei( 37440, texture.flipY );\n\t\t_gl.pixelStorei( 37441, texture.premultiplyAlpha );\n\t\t_gl.pixelStorei( 3317, texture.unpackAlignment );\n\t\t_gl.pixelStorei( 37443, 0 );\n\n\t\tconst needsPowerOfTwo = textureNeedsPowerOfTwo( texture ) && isPowerOfTwo$1( texture.image ) === false;\n\t\tlet image = resizeImage( texture.image, needsPowerOfTwo, false, maxTextureSize );\n\t\timage = verifyColorSpace( texture, image );\n\n\t\tconst supportsMips = isPowerOfTwo$1( image ) || isWebGL2,\n\t\t\tglFormat = utils.convert( texture.format, texture.encoding );\n\n\t\tlet glType = utils.convert( texture.type ),\n\t\t\tglInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding, texture.isVideoTexture );\n\n\t\tsetTextureParameters( textureType, texture, supportsMips );\n\n\t\tlet mipmap;\n\t\tconst mipmaps = texture.mipmaps;\n\n\t\tconst useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true );\n\t\tconst allocateMemory = ( textureProperties.__version === undefined );\n\t\tconst levels = getMipLevels( texture, image, supportsMips );\n\n\t\tif ( texture.isDepthTexture ) {\n\n\t\t\t// populate depth texture with dummy data\n\n\t\t\tglInternalFormat = 6402;\n\n\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\tif ( texture.type === FloatType ) {\n\n\t\t\t\t\tglInternalFormat = 36012;\n\n\t\t\t\t} else if ( texture.type === UnsignedIntType ) {\n\n\t\t\t\t\tglInternalFormat = 33190;\n\n\t\t\t\t} else if ( texture.type === UnsignedInt248Type ) {\n\n\t\t\t\t\tglInternalFormat = 35056;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tglInternalFormat = 33189; // WebGL2 requires sized internalformat for glTexImage2D\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( texture.type === FloatType ) {\n\n\t\t\t\t\tconsole.error( 'WebGLRenderer: Floating point depth texture requires WebGL2.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// validation checks for WebGL 1\n\n\t\t\tif ( texture.format === DepthFormat && glInternalFormat === 6402 ) {\n\n\t\t\t\t// The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n\t\t\t\t// DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT\n\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\tif ( texture.type !== UnsignedShortType && texture.type !== UnsignedIntType ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' );\n\n\t\t\t\t\ttexture.type = UnsignedShortType;\n\t\t\t\t\tglType = utils.convert( texture.type );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( texture.format === DepthStencilFormat && glInternalFormat === 6402 ) {\n\n\t\t\t\t// Depth stencil textures need the DEPTH_STENCIL internal format\n\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\tglInternalFormat = 34041;\n\n\t\t\t\t// The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n\t\t\t\t// DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL.\n\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\tif ( texture.type !== UnsignedInt248Type ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' );\n\n\t\t\t\t\ttexture.type = UnsignedInt248Type;\n\t\t\t\t\tglType = utils.convert( texture.type );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\tstate.texStorage2D( 3553, 1, glInternalFormat, image.width, image.height );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage2D( 3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null );\n\n\t\t\t}\n\n\t\t} else if ( texture.isDataTexture ) {\n\n\t\t\t// use manually created mipmaps if available\n\t\t\t// if there are no manual mipmaps\n\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\tif ( mipmaps.length > 0 && supportsMips ) {\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\tstate.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texSubImage2D( 3553, 0, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t} else {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( 3553, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.texSubImage2D( 3553, 0, 0, 0, image.width, image.height, glFormat, glType, image.data );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage2D( 3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( texture.isCompressedTexture ) {\n\n\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\tstate.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tstate.compressedTexSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.compressedTexImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( texture.isDataTexture2DArray ) {\n\n\t\t\tif ( useTexStorage ) {\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tstate.texStorage3D( 35866, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t}\n\n\t\t\t\tstate.texSubImage3D( 35866, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage3D( 35866, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t}\n\n\t\t} else if ( texture.isDataTexture3D ) {\n\n\t\t\tif ( useTexStorage ) {\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tstate.texStorage3D( 32879, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t}\n\n\t\t\t\tstate.texSubImage3D( 32879, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage3D( 32879, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t}\n\n\t\t} else if ( texture.isFramebufferTexture ) {\n\n\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\tstate.texStorage2D( 3553, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage2D( 3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// regular Texture (image, video, canvas)\n\n\t\t\t// use manually created mipmaps if available\n\t\t\t// if there are no manual mipmaps\n\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\tif ( mipmaps.length > 0 && supportsMips ) {\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\tstate.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texSubImage2D( 3553, i, 0, 0, glFormat, glType, mipmap );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( 3553, i, glInternalFormat, glFormat, glType, mipmap );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t} else {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( 3553, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.texSubImage2D( 3553, 0, 0, 0, glFormat, glType, image );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage2D( 3553, 0, glInternalFormat, glFormat, glType, image );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {\n\n\t\t\tgenerateMipmap( textureType );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t}\n\n\tfunction uploadCubeTexture( textureProperties, texture, slot ) {\n\n\t\tif ( texture.image.length !== 6 ) return;\n\n\t\tinitTexture( textureProperties, texture );\n\n\t\tstate.activeTexture( 33984 + slot );\n\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\n\t\t_gl.pixelStorei( 37440, texture.flipY );\n\t\t_gl.pixelStorei( 37441, texture.premultiplyAlpha );\n\t\t_gl.pixelStorei( 3317, texture.unpackAlignment );\n\t\t_gl.pixelStorei( 37443, 0 );\n\n\t\tconst isCompressed = ( texture && ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture ) );\n\t\tconst isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );\n\n\t\tconst cubeImage = [];\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tif ( ! isCompressed && ! isDataTexture ) {\n\n\t\t\t\tcubeImage[ i ] = resizeImage( texture.image[ i ], false, true, maxCubemapSize );\n\n\t\t\t} else {\n\n\t\t\t\tcubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ];\n\n\t\t\t}\n\n\t\t\tcubeImage[ i ] = verifyColorSpace( texture, cubeImage[ i ] );\n\n\t\t}\n\n\t\tconst image = cubeImage[ 0 ],\n\t\t\tsupportsMips = isPowerOfTwo$1( image ) || isWebGL2,\n\t\t\tglFormat = utils.convert( texture.format, texture.encoding ),\n\t\t\tglType = utils.convert( texture.type ),\n\t\t\tglInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );\n\n\t\tconst useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true );\n\t\tconst allocateMemory = ( textureProperties.__version === undefined );\n\t\tlet levels = getMipLevels( texture, image, supportsMips );\n\n\t\tsetTextureParameters( 34067, texture, supportsMips );\n\n\t\tlet mipmaps;\n\n\t\tif ( isCompressed ) {\n\n\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\tstate.texStorage2D( 34067, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tmipmaps = cubeImage[ i ].mipmaps;\n\n\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tstate.compressedTexSubImage2D( 34069 + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.compressedTexImage2D( 34069 + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( 34069 + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( 34069 + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tmipmaps = texture.mipmaps;\n\n\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t// TODO: Uniformly handle mipmap definitions\n\t\t\t\t// Normal textures and compressed cube textures define base level + mips with their mipmap array\n\t\t\t\t// Uncompressed cube textures use their mipmap array only for mips (no base level)\n\n\t\t\t\tif ( mipmaps.length > 0 ) levels ++;\n\n\t\t\t\tstate.texStorage2D( 34067, levels, glInternalFormat, cubeImage[ 0 ].width, cubeImage[ 0 ].height );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( isDataTexture ) {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texSubImage2D( 34069 + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( 34069 + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\t\t\t\t\t\tconst mipmapImage = mipmap.image[ i ].image;\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( 34069 + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( 34069 + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texSubImage2D( 34069 + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( 34069 + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( 34069 + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( 34069 + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {\n\n\t\t\t// We assume images for cube map have the same size.\n\t\t\tgenerateMipmap( 34067 );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t}\n\n\t// Render targets\n\n\t// Setup storage for target texture and bind it to correct framebuffer\n\tfunction setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) {\n\n\t\tconst glFormat = utils.convert( texture.format, texture.encoding );\n\t\tconst glType = utils.convert( texture.type );\n\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( ! renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\tif ( textureTarget === 32879 || textureTarget === 35866 ) {\n\n\t\t\t\tstate.texImage3D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( 36160, framebuffer );\n\t\tif ( renderTarget.useRenderToTexture ) {\n\n\t\t\tMultisampledRenderToTextureExtension.framebufferTexture2DMultisampleEXT( 36160, attachment, textureTarget, properties.get( texture ).__webglTexture, 0, getRenderTargetSamples( renderTarget ) );\n\n\t\t} else {\n\n\t\t\t_gl.framebufferTexture2D( 36160, attachment, textureTarget, properties.get( texture ).__webglTexture, 0 );\n\n\t\t}\n\n\t\tstate.bindFramebuffer( 36160, null );\n\n\t}\n\n\n\t// Setup storage for internal depth/stencil buffers and bind to correct framebuffer\n\tfunction setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\tlet glInternalFormat = 33189;\n\n\t\t\tif ( isMultisample || renderTarget.useRenderToTexture ) {\n\n\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\n\t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n\t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n\t\t\t\t\t\tglInternalFormat = 36012;\n\n\t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n\t\t\t\t\t\tglInternalFormat = 33190;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\tif ( renderTarget.useRenderToTexture ) {\n\n\t\t\t\t\tMultisampledRenderToTextureExtension.renderbufferStorageMultisampleEXT( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\tif ( isMultisample && renderTarget.useRenderbuffer ) {\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, 35056, renderTarget.width, renderTarget.height );\n\n\t\t\t} else if ( renderTarget.useRenderToTexture ) {\n\n\t\t\t\tMultisampledRenderToTextureExtension.renderbufferStorageMultisampleEXT( 36161, samples, 35056, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n\t\t} else {\n\n\t\t\t// Use the first texture for MRT so far\n\t\t\tconst texture = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture[ 0 ] : renderTarget.texture;\n\n\t\t\tconst glFormat = utils.convert( texture.format, texture.encoding );\n\t\t\tconst glType = utils.convert( texture.type );\n\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );\n\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\tif ( isMultisample && renderTarget.useRenderbuffer ) {\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else if ( renderTarget.useRenderToTexture ) {\n\n\t\t\t\tMultisampledRenderToTextureExtension.renderbufferStorageMultisampleEXT( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t}\n\n\t// Setup resources for a Depth Texture for a FBO (needs an extension)\n\tfunction setupDepthTexture( framebuffer, renderTarget ) {\n\n\t\tconst isCube = ( renderTarget && renderTarget.isWebGLCubeRenderTarget );\n\t\tif ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' );\n\n\t\tstate.bindFramebuffer( 36160, framebuffer );\n\n\t\tif ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) {\n\n\t\t\tthrow new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' );\n\n\t\t}\n\n\t\t// upload an empty depth texture with framebuffer size\n\t\tif ( ! properties.get( renderTarget.depthTexture ).__webglTexture ||\n\t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\n\t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\n\n\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\n\t\t}\n\n\t\tsetTexture2D( renderTarget.depthTexture, 0 );\n\n\t\tconst webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture;\n\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\tif ( renderTarget.depthTexture.format === DepthFormat ) {\n\n\t\t\tif ( renderTarget.useRenderToTexture ) {\n\n\t\t\t\tMultisampledRenderToTextureExtension.framebufferTexture2DMultisampleEXT( 36160, 36096, 3553, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( 36160, 36096, 3553, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {\n\n\t\t\tif ( renderTarget.useRenderToTexture ) {\n\n\t\t\t\tMultisampledRenderToTextureExtension.framebufferTexture2DMultisampleEXT( 36160, 33306, 3553, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( 36160, 33306, 3553, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'Unknown depthTexture format' );\n\n\t\t}\n\n\t}\n\n\t// Setup GL resources for a non-texture depth buffer\n\tfunction setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tstate.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( 36160, null );\n\n\t}\n\n\t// rebind framebuffer with external textures\n\tfunction rebindTextures( renderTarget, colorTexture, depthTexture ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( colorTexture !== undefined ) {\n\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, 36064, 3553 );\n\n\t\t}\n\n\t\tif ( depthTexture !== undefined ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\t// Set up GL resources for the render target\n\tfunction setupRenderTarget( renderTarget ) {\n\n\t\tconst texture = renderTarget.texture;\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst textureProperties = properties.get( texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tif ( renderTarget.isWebGLMultipleRenderTargets !== true ) {\n\n\t\t\tif ( textureProperties.__webglTexture === undefined ) {\n\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tinfo.memory.textures ++;\n\n\t\t}\n\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\t\tconst isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );\n\t\tconst isRenderTarget3D = texture.isDataTexture3D || texture.isDataTexture2DArray;\n\t\tconst supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\tif ( capabilities.drawBuffers ) {\n\n\t\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst attachmentProperties = properties.get( textures[ i ] );\n\n\t\t\t\t\t\tif ( attachmentProperties.__webglTexture === undefined ) {\n\n\t\t\t\t\t\t\tattachmentProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t\t\t\t\tinfo.memory.textures ++;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.' );\n\n\t\t\t\t}\n\n\t\t\t} else if ( renderTarget.useRenderbuffer ) {\n\n\t\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n\t\t\t\t\t_gl.bindRenderbuffer( 36161, renderTargetProperties.__webglColorRenderbuffer );\n\n\t\t\t\t\tconst glFormat = utils.convert( texture.format, texture.encoding );\n\t\t\t\t\tconst glType = utils.convert( texture.type );\n\t\t\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );\n\t\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\tstate.bindFramebuffer( 36160, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t_gl.framebufferRenderbuffer( 36160, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.bindFramebuffer( 36160, null );\n\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( 34067, texture, supportsMips );\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, 36064, 34069 + i );\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {\n\n\t\t\t\tgenerateMipmap( 34067 );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else if ( isMultipleRenderTargets ) {\n\n\t\t\tconst textures = renderTarget.texture;\n\n\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\tconst attachment = textures[ i ];\n\t\t\t\tconst attachmentProperties = properties.get( attachment );\n\n\t\t\t\tstate.bindTexture( 3553, attachmentProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 3553, attachment, supportsMips );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, 36064 + i, 3553 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 3553 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else {\n\n\t\t\tlet glTextureType = 3553;\n\n\t\t\tif ( isRenderTarget3D ) {\n\n\t\t\t\t// Render targets containing layers, i.e: Texture 3D and 2d arrays\n\n\t\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\t\tconst isTexture3D = texture.isDataTexture3D;\n\t\t\t\t\tglTextureType = isTexture3D ? 32879 : 35866;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( 'THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.bindTexture( glTextureType, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( glTextureType, texture, supportsMips );\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, 36064, glTextureType );\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {\n\n\t\t\t\tgenerateMipmap( glTextureType );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\tfunction updateRenderTargetMipmap( renderTarget ) {\n\n\t\tconst supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;\n\n\t\tconst textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ];\n\n\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\tconst texture = textures[ i ];\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {\n\n\t\t\t\tconst target = renderTarget.isWebGLCubeRenderTarget ? 34067 : 3553;\n\t\t\t\tconst webglTexture = properties.get( texture ).__webglTexture;\n\n\t\t\t\tstate.bindTexture( target, webglTexture );\n\t\t\t\tgenerateMipmap( target );\n\t\t\t\tstate.unbindTexture();\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction updateMultisampleRenderTarget( renderTarget ) {\n\n\t\tif ( renderTarget.useRenderbuffer ) {\n\n\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\tconst width = renderTarget.width;\n\t\t\t\tconst height = renderTarget.height;\n\t\t\t\tlet mask = 16384;\n\t\t\t\tconst invalidationArray = [ 36064 ];\n\t\t\t\tconst depthStyle = renderTarget.stencilBuffer ? 33306 : 36096;\n\n\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\tinvalidationArray.push( depthStyle );\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! renderTarget.ignoreDepthForMultisampleCopy ) {\n\n\t\t\t\t\tif ( renderTarget.depthBuffer ) mask |= 256;\n\t\t\t\t\tif ( renderTarget.stencilBuffer ) mask |= 1024;\n\n\t\t\t\t}\n\n\t\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\t\t\tstate.bindFramebuffer( 36008, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\tstate.bindFramebuffer( 36009, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\tif ( renderTarget.ignoreDepthForMultisampleCopy ) {\n\n\t\t\t\t\t_gl.invalidateFramebuffer( 36008, [ depthStyle ] );\n\t\t\t\t\t_gl.invalidateFramebuffer( 36009, [ depthStyle ] );\n\n\t\t\t\t}\n\n\t\t\t\t_gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, 9728 );\n\t\t\t\t_gl.invalidateFramebuffer( 36008, invalidationArray );\n\n\t\t\t\tstate.bindFramebuffer( 36008, null );\n\t\t\t\tstate.bindFramebuffer( 36009, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction getRenderTargetSamples( renderTarget ) {\n\n\t\treturn ( isWebGL2 && ( renderTarget.useRenderbuffer || renderTarget.useRenderToTexture ) ) ?\n\t\t\tMath.min( maxSamples, renderTarget.samples ) : 0;\n\n\t}\n\n\tfunction updateVideoTexture( texture ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\t// Check the last frame we updated the VideoTexture\n\n\t\tif ( _videoTextures.get( texture ) !== frame ) {\n\n\t\t\t_videoTextures.set( texture, frame );\n\t\t\ttexture.update();\n\n\t\t}\n\n\t}\n\n\tfunction verifyColorSpace( texture, image ) {\n\n\t\tconst encoding = texture.encoding;\n\t\tconst format = texture.format;\n\t\tconst type = texture.type;\n\n\t\tif ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;\n\n\t\tif ( encoding !== LinearEncoding ) {\n\n\t\t\t// sRGB\n\n\t\t\tif ( encoding === sRGBEncoding ) {\n\n\t\t\t\tif ( isWebGL2 === false ) {\n\n\t\t\t\t\t// in WebGL 1, try to use EXT_sRGB extension and unsized formats\n\n\t\t\t\t\tif ( extensions.has( 'EXT_sRGB' ) === true && format === RGBAFormat ) {\n\n\t\t\t\t\t\ttexture.format = _SRGBAFormat;\n\n\t\t\t\t\t\t// it's not possible to generate mips in WebGL 1 with this extension\n\n\t\t\t\t\t\ttexture.minFilter = LinearFilter;\n\t\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// slow fallback (CPU decode)\n\n\t\t\t\t\t\timage = ImageUtils.sRGBToLinear( image );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// in WebGL 2 uncompressed textures can only be sRGB encoded if they have the RGBA8 format\n\n\t\t\t\t\tif ( format !== RGBAFormat || type !== UnsignedByteType ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.WebGLTextures: Unsupported texture encoding:', encoding );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\t// backwards compatibility\n\n\tlet warnedTexture2D = false;\n\tlet warnedTextureCube = false;\n\n\tfunction safeSetTexture2D( texture, slot ) {\n\n\t\tif ( texture && texture.isWebGLRenderTarget ) {\n\n\t\t\tif ( warnedTexture2D === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLTextures.safeSetTexture2D: don\\'t use render targets as textures. Use their .texture property instead.' );\n\t\t\t\twarnedTexture2D = true;\n\n\t\t\t}\n\n\t\t\ttexture = texture.texture;\n\n\t\t}\n\n\t\tsetTexture2D( texture, slot );\n\n\t}\n\n\tfunction safeSetTextureCube( texture, slot ) {\n\n\t\tif ( texture && texture.isWebGLCubeRenderTarget ) {\n\n\t\t\tif ( warnedTextureCube === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLTextures.safeSetTextureCube: don\\'t use cube render targets as textures. Use their .texture property instead.' );\n\t\t\t\twarnedTextureCube = true;\n\n\t\t\t}\n\n\t\t\ttexture = texture.texture;\n\n\t\t}\n\n\n\t\tsetTextureCube( texture, slot );\n\n\t}\n\n\t//\n\n\tthis.allocateTextureUnit = allocateTextureUnit;\n\tthis.resetTextureUnits = resetTextureUnits;\n\n\tthis.setTexture2D = setTexture2D;\n\tthis.setTexture2DArray = setTexture2DArray;\n\tthis.setTexture3D = setTexture3D;\n\tthis.setTextureCube = setTextureCube;\n\tthis.rebindTextures = rebindTextures;\n\tthis.setupRenderTarget = setupRenderTarget;\n\tthis.updateRenderTargetMipmap = updateRenderTargetMipmap;\n\tthis.updateMultisampleRenderTarget = updateMultisampleRenderTarget;\n\tthis.setupDepthRenderbuffer = setupDepthRenderbuffer;\n\tthis.setupFrameBufferTexture = setupFrameBufferTexture;\n\n\tthis.safeSetTexture2D = safeSetTexture2D;\n\tthis.safeSetTextureCube = safeSetTextureCube;\n\n}\n\nfunction WebGLUtils( gl, extensions, capabilities ) {\n\n\tconst isWebGL2 = capabilities.isWebGL2;\n\n\tfunction convert( p, encoding = null ) {\n\n\t\tlet extension;\n\n\t\tif ( p === UnsignedByteType ) return 5121;\n\t\tif ( p === UnsignedShort4444Type ) return 32819;\n\t\tif ( p === UnsignedShort5551Type ) return 32820;\n\n\t\tif ( p === ByteType ) return 5120;\n\t\tif ( p === ShortType ) return 5122;\n\t\tif ( p === UnsignedShortType ) return 5123;\n\t\tif ( p === IntType ) return 5124;\n\t\tif ( p === UnsignedIntType ) return 5125;\n\t\tif ( p === FloatType ) return 5126;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\tif ( isWebGL2 ) return 5131;\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\treturn extension.HALF_FLOAT_OES;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return 6406;\n\t\tif ( p === RGBAFormat ) return 6408;\n\t\tif ( p === LuminanceFormat ) return 6409;\n\t\tif ( p === LuminanceAlphaFormat ) return 6410;\n\t\tif ( p === DepthFormat ) return 6402;\n\t\tif ( p === DepthStencilFormat ) return 34041;\n\t\tif ( p === RedFormat ) return 6403;\n\n\t\tif ( p === RGBFormat ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228' );\n\t\t\treturn 6408;\n\n\t\t}\n\n\t\t// WebGL 1 sRGB fallback\n\n\t\tif ( p === _SRGBAFormat ) {\n\n\t\t\textension = extensions.get( 'EXT_sRGB' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\treturn extension.SRGB_ALPHA_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// WebGL2 formats.\n\n\t\tif ( p === RedIntegerFormat ) return 36244;\n\t\tif ( p === RGFormat ) return 33319;\n\t\tif ( p === RGIntegerFormat ) return 33320;\n\t\tif ( p === RGBAIntegerFormat ) return 36249;\n\n\t\t// S3TC\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\tif ( encoding === sRGBEncoding ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// PVRTC\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ETC1\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\treturn extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ETC2\n\n\t\tif ( p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_ETC2_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;\n\t\t\t\tif ( p === RGBA_ETC2_EAC_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ASTC\n\n\t\tif ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format ||\n\t\t\tp === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format ||\n\t\t\tp === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format ||\n\t\t\tp === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format ||\n\t\t\tp === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_astc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_ASTC_4x4_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x4_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x6_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x6_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x8_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x6_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x8_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x10_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x10_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x12_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// BPTC\n\n\t\tif ( p === RGBA_BPTC_Format ) {\n\n\t\t\textension = extensions.get( 'EXT_texture_compression_bptc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_BPTC_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\tif ( isWebGL2 ) return 34042;\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\treturn extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn { convert: convert };\n\n}\n\nclass ArrayCamera extends PerspectiveCamera {\n\n\tconstructor( array = [] ) {\n\n\t\tsuper();\n\n\t\tthis.cameras = array;\n\n\t}\n\n}\n\nArrayCamera.prototype.isArrayCamera = true;\n\nclass Group extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'Group';\n\n\t}\n\n}\n\nGroup.prototype.isGroup = true;\n\nconst _moveEvent = { type: 'move' };\n\nclass WebXRController {\n\n\tconstructor() {\n\n\t\tthis._targetRay = null;\n\t\tthis._grip = null;\n\t\tthis._hand = null;\n\n\t}\n\n\tgetHandSpace() {\n\n\t\tif ( this._hand === null ) {\n\n\t\t\tthis._hand = new Group();\n\t\t\tthis._hand.matrixAutoUpdate = false;\n\t\t\tthis._hand.visible = false;\n\n\t\t\tthis._hand.joints = {};\n\t\t\tthis._hand.inputState = { pinching: false };\n\n\t\t}\n\n\t\treturn this._hand;\n\n\t}\n\n\tgetTargetRaySpace() {\n\n\t\tif ( this._targetRay === null ) {\n\n\t\t\tthis._targetRay = new Group();\n\t\t\tthis._targetRay.matrixAutoUpdate = false;\n\t\t\tthis._targetRay.visible = false;\n\t\t\tthis._targetRay.hasLinearVelocity = false;\n\t\t\tthis._targetRay.linearVelocity = new Vector3();\n\t\t\tthis._targetRay.hasAngularVelocity = false;\n\t\t\tthis._targetRay.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._targetRay;\n\n\t}\n\n\tgetGripSpace() {\n\n\t\tif ( this._grip === null ) {\n\n\t\t\tthis._grip = new Group();\n\t\t\tthis._grip.matrixAutoUpdate = false;\n\t\t\tthis._grip.visible = false;\n\t\t\tthis._grip.hasLinearVelocity = false;\n\t\t\tthis._grip.linearVelocity = new Vector3();\n\t\t\tthis._grip.hasAngularVelocity = false;\n\t\t\tthis._grip.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._grip;\n\n\t}\n\n\tdispatchEvent( event ) {\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.dispatchEvent( event );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect( inputSource ) {\n\n\t\tthis.dispatchEvent( { type: 'disconnected', data: inputSource } );\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.visible = false;\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.visible = false;\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.visible = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tupdate( inputSource, frame, referenceSpace ) {\n\n\t\tlet inputPose = null;\n\t\tlet gripPose = null;\n\t\tlet handPose = null;\n\n\t\tconst targetRay = this._targetRay;\n\t\tconst grip = this._grip;\n\t\tconst hand = this._hand;\n\n\t\tif ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) {\n\n\t\t\tif ( targetRay !== null ) {\n\n\t\t\t\tinputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );\n\n\t\t\t\tif ( inputPose !== null ) {\n\n\t\t\t\t\ttargetRay.matrix.fromArray( inputPose.transform.matrix );\n\t\t\t\t\ttargetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );\n\n\t\t\t\t\tif ( inputPose.linearVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = true;\n\t\t\t\t\t\ttargetRay.linearVelocity.copy( inputPose.linearVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( inputPose.angularVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = true;\n\t\t\t\t\t\ttargetRay.angularVelocity.copy( inputPose.angularVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dispatchEvent( _moveEvent );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( hand && inputSource.hand ) {\n\n\t\t\t\thandPose = true;\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Update the joints groups with the XRJoint poses\n\t\t\t\t\tconst jointPose = frame.getJointPose( inputjoint, referenceSpace );\n\n\t\t\t\t\tif ( hand.joints[ inputjoint.jointName ] === undefined ) {\n\n\t\t\t\t\t\t// The transform of this joint will be updated with the joint pose on each frame\n\t\t\t\t\t\tconst joint = new Group();\n\t\t\t\t\t\tjoint.matrixAutoUpdate = false;\n\t\t\t\t\t\tjoint.visible = false;\n\t\t\t\t\t\thand.joints[ inputjoint.jointName ] = joint;\n\t\t\t\t\t\t// ??\n\t\t\t\t\t\thand.add( joint );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst joint = hand.joints[ inputjoint.jointName ];\n\n\t\t\t\t\tif ( jointPose !== null ) {\n\n\t\t\t\t\t\tjoint.matrix.fromArray( jointPose.transform.matrix );\n\t\t\t\t\t\tjoint.matrix.decompose( joint.position, joint.rotation, joint.scale );\n\t\t\t\t\t\tjoint.jointRadius = jointPose.radius;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tjoint.visible = jointPose !== null;\n\n\t\t\t\t}\n\n\t\t\t\t// Custom events\n\n\t\t\t\t// Check pinchz\n\t\t\t\tconst indexTip = hand.joints[ 'index-finger-tip' ];\n\t\t\t\tconst thumbTip = hand.joints[ 'thumb-tip' ];\n\t\t\t\tconst distance = indexTip.position.distanceTo( thumbTip.position );\n\n\t\t\t\tconst distanceToPinch = 0.02;\n\t\t\t\tconst threshold = 0.005;\n\n\t\t\t\tif ( hand.inputState.pinching && distance > distanceToPinch + threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = false;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchend',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t} else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = true;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchstart',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( grip !== null && inputSource.gripSpace ) {\n\n\t\t\t\t\tgripPose = frame.getPose( inputSource.gripSpace, referenceSpace );\n\n\t\t\t\t\tif ( gripPose !== null ) {\n\n\t\t\t\t\t\tgrip.matrix.fromArray( gripPose.transform.matrix );\n\t\t\t\t\t\tgrip.matrix.decompose( grip.position, grip.rotation, grip.scale );\n\n\t\t\t\t\t\tif ( gripPose.linearVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = true;\n\t\t\t\t\t\t\tgrip.linearVelocity.copy( gripPose.linearVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( gripPose.angularVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = true;\n\t\t\t\t\t\t\tgrip.angularVelocity.copy( gripPose.angularVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( targetRay !== null ) {\n\n\t\t\ttargetRay.visible = ( inputPose !== null );\n\n\t\t}\n\n\t\tif ( grip !== null ) {\n\n\t\t\tgrip.visible = ( gripPose !== null );\n\n\t\t}\n\n\t\tif ( hand !== null ) {\n\n\t\t\thand.visible = ( handPose !== null );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass DepthTexture extends Texture {\n\n\tconstructor( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) {\n\n\t\tformat = format !== undefined ? format : DepthFormat;\n\n\t\tif ( format !== DepthFormat && format !== DepthStencilFormat ) {\n\n\t\t\tthrow new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' );\n\n\t\t}\n\n\t\tif ( type === undefined && format === DepthFormat ) type = UnsignedShortType;\n\t\tif ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type;\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.image = { width: width, height: height };\n\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : NearestFilter;\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : NearestFilter;\n\n\t\tthis.flipY = false;\n\t\tthis.generateMipmaps\t= false;\n\n\t}\n\n\n}\n\nDepthTexture.prototype.isDepthTexture = true;\n\nclass WebXRManager extends EventDispatcher {\n\n\tconstructor( renderer, gl ) {\n\n\t\tsuper();\n\n\t\tconst scope = this;\n\n\t\tlet session = null;\n\t\tlet framebufferScaleFactor = 1.0;\n\n\t\tlet referenceSpace = null;\n\t\tlet referenceSpaceType = 'local-floor';\n\t\tconst hasMultisampledRenderToTexture = renderer.extensions.has( 'WEBGL_multisampled_render_to_texture' );\n\n\t\tlet pose = null;\n\t\tlet glBinding = null;\n\t\tlet glProjLayer = null;\n\t\tlet glBaseLayer = null;\n\t\tlet isMultisample = false;\n\t\tlet xrFrame = null;\n\t\tconst attributes = gl.getContextAttributes();\n\t\tlet initialRenderTarget = null;\n\t\tlet newRenderTarget = null;\n\n\t\tconst controllers = [];\n\t\tconst inputSourcesMap = new Map();\n\n\t\t//\n\n\t\tconst cameraL = new PerspectiveCamera();\n\t\tcameraL.layers.enable( 1 );\n\t\tcameraL.viewport = new Vector4();\n\n\t\tconst cameraR = new PerspectiveCamera();\n\t\tcameraR.layers.enable( 2 );\n\t\tcameraR.viewport = new Vector4();\n\n\t\tconst cameras = [ cameraL, cameraR ];\n\n\t\tconst cameraVR = new ArrayCamera();\n\t\tcameraVR.layers.enable( 1 );\n\t\tcameraVR.layers.enable( 2 );\n\n\t\tlet _currentDepthNear = null;\n\t\tlet _currentDepthFar = null;\n\n\t\t//\n\n\t\tthis.cameraAutoUpdate = true;\n\t\tthis.enabled = false;\n\n\t\tthis.isPresenting = false;\n\n\t\tthis.getController = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getTargetRaySpace();\n\n\t\t};\n\n\t\tthis.getControllerGrip = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getGripSpace();\n\n\t\t};\n\n\t\tthis.getHand = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getHandSpace();\n\n\t\t};\n\n\t\t//\n\n\t\tfunction onSessionEvent( event ) {\n\n\t\t\tconst controller = inputSourcesMap.get( event.inputSource );\n\n\t\t\tif ( controller ) {\n\n\t\t\t\tcontroller.dispatchEvent( { type: event.type, data: event.inputSource } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onSessionEnd() {\n\n\t\t\tinputSourcesMap.forEach( function ( controller, inputSource ) {\n\n\t\t\t\tcontroller.disconnect( inputSource );\n\n\t\t\t} );\n\n\t\t\tinputSourcesMap.clear();\n\n\t\t\t_currentDepthNear = null;\n\t\t\t_currentDepthFar = null;\n\n\t\t\t// restore framebuffer/rendering state\n\n\t\t\trenderer.setRenderTarget( initialRenderTarget );\n\n\t\t\tglBaseLayer = null;\n\t\t\tglProjLayer = null;\n\t\t\tglBinding = null;\n\t\t\tsession = null;\n\t\t\tnewRenderTarget = null;\n\n\t\t\t//\n\n\t\t\tanimation.stop();\n\n\t\t\tscope.isPresenting = false;\n\n\t\t\tscope.dispatchEvent( { type: 'sessionend' } );\n\n\t\t}\n\n\t\tthis.setFramebufferScaleFactor = function ( value ) {\n\n\t\t\tframebufferScaleFactor = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setReferenceSpaceType = function ( value ) {\n\n\t\t\treferenceSpaceType = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getReferenceSpace = function () {\n\n\t\t\treturn referenceSpace;\n\n\t\t};\n\n\t\tthis.getBaseLayer = function () {\n\n\t\t\treturn glProjLayer !== null ? glProjLayer : glBaseLayer;\n\n\t\t};\n\n\t\tthis.getBinding = function () {\n\n\t\t\treturn glBinding;\n\n\t\t};\n\n\t\tthis.getFrame = function () {\n\n\t\t\treturn xrFrame;\n\n\t\t};\n\n\t\tthis.getSession = function () {\n\n\t\t\treturn session;\n\n\t\t};\n\n\t\tthis.setSession = async function ( value ) {\n\n\t\t\tsession = value;\n\n\t\t\tif ( session !== null ) {\n\n\t\t\t\tinitialRenderTarget = renderer.getRenderTarget();\n\n\t\t\t\tsession.addEventListener( 'select', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectstart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeeze', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezestart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezeend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'end', onSessionEnd );\n\t\t\t\tsession.addEventListener( 'inputsourceschange', onInputSourcesChange );\n\n\t\t\t\tif ( attributes.xrCompatible !== true ) {\n\n\t\t\t\t\tawait gl.makeXRCompatible();\n\n\t\t\t\t}\n\n\t\t\t\tif ( ( session.renderState.layers === undefined ) || ( renderer.capabilities.isWebGL2 === false ) ) {\n\n\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\tantialias: ( session.renderState.layers === undefined ) ? attributes.antialias : true,\n\t\t\t\t\t\talpha: attributes.alpha,\n\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglBaseLayer = new XRWebGLLayer( session, gl, layerInit );\n\n\t\t\t\t\tsession.updateRenderState( { baseLayer: glBaseLayer } );\n\n\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\tglBaseLayer.framebufferWidth,\n\t\t\t\t\t\tglBaseLayer.framebufferHeight,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\tencoding: renderer.outputEncoding\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tisMultisample = attributes.antialias;\n\t\t\t\t\tlet depthFormat = null;\n\t\t\t\t\tlet depthType = null;\n\t\t\t\t\tlet glDepthFormat = null;\n\n\t\t\t\t\tif ( attributes.depth ) {\n\n\t\t\t\t\t\tglDepthFormat = attributes.stencil ? 35056 : 33190;\n\t\t\t\t\t\tdepthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;\n\t\t\t\t\t\tdepthType = attributes.stencil ? UnsignedInt248Type : UnsignedShortType;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst projectionlayerInit = {\n\t\t\t\t\t\tcolorFormat: ( renderer.outputEncoding === sRGBEncoding ) ? 35907 : 32856,\n\t\t\t\t\t\tdepthFormat: glDepthFormat,\n\t\t\t\t\t\tscaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglBinding = new XRWebGLBinding( session, gl );\n\n\t\t\t\t\tglProjLayer = glBinding.createProjectionLayer( projectionlayerInit );\n\n\t\t\t\t\tsession.updateRenderState( { layers: [ glProjLayer ] } );\n\n\t\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\t\tnewRenderTarget = new WebGLMultisampleRenderTarget(\n\t\t\t\t\t\t\tglProjLayer.textureWidth,\n\t\t\t\t\t\t\tglProjLayer.textureHeight,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\t\tdepthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),\n\t\t\t\t\t\t\t\tstencilBuffer: attributes.stencil,\n\t\t\t\t\t\t\t\tignoreDepth: glProjLayer.ignoreDepthValues,\n\t\t\t\t\t\t\t\tuseRenderToTexture: hasMultisampledRenderToTexture,\n\t\t\t\t\t\t\t\tencoding: renderer.outputEncoding\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\t\tglProjLayer.textureWidth,\n\t\t\t\t\t\t\tglProjLayer.textureHeight,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\t\tdepthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),\n\t\t\t\t\t\t\t\tstencilBuffer: attributes.stencil,\n\t\t\t\t\t\t\t\tignoreDepth: glProjLayer.ignoreDepthValues,\n\t\t\t\t\t\t\t\tencoding: renderer.outputEncoding\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tnewRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278\n\n\t\t\t\t// Set foveation to maximum.\n\t\t\t\tthis.setFoveation( 1.0 );\n\n\t\t\t\treferenceSpace = await session.requestReferenceSpace( referenceSpaceType );\n\n\t\t\t\tanimation.setContext( session );\n\t\t\t\tanimation.start();\n\n\t\t\t\tscope.isPresenting = true;\n\n\t\t\t\tscope.dispatchEvent( { type: 'sessionstart' } );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction onInputSourcesChange( event ) {\n\n\t\t\tconst inputSources = session.inputSources;\n\n\t\t\t// Assign inputSources to available controllers\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tinputSourcesMap.set( inputSources[ i ], controllers[ i ] );\n\n\t\t\t}\n\n\t\t\t// Notify disconnected\n\n\t\t\tfor ( let i = 0; i < event.removed.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.removed[ i ];\n\t\t\t\tconst controller = inputSourcesMap.get( inputSource );\n\n\t\t\t\tif ( controller ) {\n\n\t\t\t\t\tcontroller.dispatchEvent( { type: 'disconnected', data: inputSource } );\n\t\t\t\t\tinputSourcesMap.delete( inputSource );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Notify connected\n\n\t\t\tfor ( let i = 0; i < event.added.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.added[ i ];\n\t\t\t\tconst controller = inputSourcesMap.get( inputSource );\n\n\t\t\t\tif ( controller ) {\n\n\t\t\t\t\tcontroller.dispatchEvent( { type: 'connected', data: inputSource } );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst cameraLPos = new Vector3();\n\t\tconst cameraRPos = new Vector3();\n\n\t\t/**\n\t\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t\t * the cameras' projection and world matrices have already been set.\n\t\t * And that near and far planes are identical for both cameras.\n\t\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t\t */\n\t\tfunction setProjectionFromUnion( camera, cameraL, cameraR ) {\n\n\t\t\tcameraLPos.setFromMatrixPosition( cameraL.matrixWorld );\n\t\t\tcameraRPos.setFromMatrixPosition( cameraR.matrixWorld );\n\n\t\t\tconst ipd = cameraLPos.distanceTo( cameraRPos );\n\n\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\tconst projR = cameraR.projectionMatrix.elements;\n\n\t\t\t// VR systems will have identical far and near planes, and\n\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t// Use the left camera for these values.\n\t\t\tconst near = projL[ 14 ] / ( projL[ 10 ] - 1 );\n\t\t\tconst far = projL[ 14 ] / ( projL[ 10 ] + 1 );\n\t\t\tconst topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ];\n\t\t\tconst bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ];\n\n\t\t\tconst leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ];\n\t\t\tconst rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ];\n\t\t\tconst left = near * leftFov;\n\t\t\tconst right = near * rightFov;\n\n\t\t\t// Calculate the new camera's position offset from the\n\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\t\t\tconst zOffset = ipd / ( - leftFov + rightFov );\n\t\t\tconst xOffset = zOffset * - leftFov;\n\n\t\t\t// TODO: Better way to apply this offset?\n\t\t\tcameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.translateX( xOffset );\n\t\t\tcamera.translateZ( zOffset );\n\t\t\tcamera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t\t// Find the union of the frustum values of the cameras and scale\n\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t// although must now be relative to the new union camera.\n\t\t\tconst near2 = near + zOffset;\n\t\t\tconst far2 = far + zOffset;\n\t\t\tconst left2 = left - xOffset;\n\t\t\tconst right2 = right + ( ipd - xOffset );\n\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\n\t\t\tcamera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );\n\n\t\t}\n\n\t\tfunction updateCamera( camera, parent ) {\n\n\t\t\tif ( parent === null ) {\n\n\t\t\t\tcamera.matrixWorld.copy( camera.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tcamera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );\n\n\t\t\t}\n\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t}\n\n\t\tthis.updateCamera = function ( camera ) {\n\n\t\t\tif ( session === null ) return;\n\n\t\t\tcameraVR.near = cameraR.near = cameraL.near = camera.near;\n\t\t\tcameraVR.far = cameraR.far = cameraL.far = camera.far;\n\n\t\t\tif ( _currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far ) {\n\n\t\t\t\t// Note that the new renderState won't apply until the next frame. See #18320\n\n\t\t\t\tsession.updateRenderState( {\n\t\t\t\t\tdepthNear: cameraVR.near,\n\t\t\t\t\tdepthFar: cameraVR.far\n\t\t\t\t} );\n\n\t\t\t\t_currentDepthNear = cameraVR.near;\n\t\t\t\t_currentDepthFar = cameraVR.far;\n\n\t\t\t}\n\n\t\t\tconst parent = camera.parent;\n\t\t\tconst cameras = cameraVR.cameras;\n\n\t\t\tupdateCamera( cameraVR, parent );\n\n\t\t\tfor ( let i = 0; i < cameras.length; i ++ ) {\n\n\t\t\t\tupdateCamera( cameras[ i ], parent );\n\n\t\t\t}\n\n\t\t\tcameraVR.matrixWorld.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );\n\n\t\t\t// update user camera and its children\n\n\t\t\tcamera.position.copy( cameraVR.position );\n\t\t\tcamera.quaternion.copy( cameraVR.quaternion );\n\t\t\tcamera.scale.copy( cameraVR.scale );\n\t\t\tcamera.matrix.copy( cameraVR.matrix );\n\t\t\tcamera.matrixWorld.copy( cameraVR.matrixWorld );\n\n\t\t\tconst children = camera.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tchildren[ i ].updateMatrixWorld( true );\n\n\t\t\t}\n\n\t\t\t// update projection matrix for proper view frustum culling\n\n\t\t\tif ( cameras.length === 2 ) {\n\n\t\t\t\tsetProjectionFromUnion( cameraVR, cameraL, cameraR );\n\n\t\t\t} else {\n\n\t\t\t\t// assume single camera setup (AR)\n\n\t\t\t\tcameraVR.projectionMatrix.copy( cameraL.projectionMatrix );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getCamera = function () {\n\n\t\t\treturn cameraVR;\n\n\t\t};\n\n\t\tthis.getFoveation = function () {\n\n\t\t\tif ( glProjLayer !== null ) {\n\n\t\t\t\treturn glProjLayer.fixedFoveation;\n\n\t\t\t}\n\n\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\treturn glBaseLayer.fixedFoveation;\n\n\t\t\t}\n\n\t\t\treturn undefined;\n\n\t\t};\n\n\t\tthis.setFoveation = function ( foveation ) {\n\n\t\t\t// 0 = no foveation = full resolution\n\t\t\t// 1 = maximum foveation = the edges render at lower resolution\n\n\t\t\tif ( glProjLayer !== null ) {\n\n\t\t\t\tglProjLayer.fixedFoveation = foveation;\n\n\t\t\t}\n\n\t\t\tif ( glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined ) {\n\n\t\t\t\tglBaseLayer.fixedFoveation = foveation;\n\n\t\t\t}\n\n\t\t};\n\n\t\t// Animation Loop\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame( time, frame ) {\n\n\t\t\tpose = frame.getViewerPose( referenceSpace );\n\t\t\txrFrame = frame;\n\n\t\t\tif ( pose !== null ) {\n\n\t\t\t\tconst views = pose.views;\n\n\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\trenderer.setRenderTargetFramebuffer( newRenderTarget, glBaseLayer.framebuffer );\n\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t\tlet cameraVRNeedsUpdate = false;\n\n\t\t\t\t// check if it's necessary to rebuild cameraVR's camera list\n\n\t\t\t\tif ( views.length !== cameraVR.cameras.length ) {\n\n\t\t\t\t\tcameraVR.cameras.length = 0;\n\t\t\t\t\tcameraVRNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < views.length; i ++ ) {\n\n\t\t\t\t\tconst view = views[ i ];\n\n\t\t\t\t\tlet viewport = null;\n\n\t\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\t\tviewport = glBaseLayer.getViewport( view );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst glSubImage = glBinding.getViewSubImage( glProjLayer, view );\n\t\t\t\t\t\tviewport = glSubImage.viewport;\n\n\t\t\t\t\t\t// For side-by-side projection, we only produce a single texture for both eyes.\n\t\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\t\trenderer.setRenderTargetTextures(\n\t\t\t\t\t\t\t\tnewRenderTarget,\n\t\t\t\t\t\t\t\tglSubImage.colorTexture,\n\t\t\t\t\t\t\t\tglProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture );\n\n\t\t\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst camera = cameras[ i ];\n\n\t\t\t\t\tcamera.matrix.fromArray( view.transform.matrix );\n\t\t\t\t\tcamera.projectionMatrix.fromArray( view.projectionMatrix );\n\t\t\t\t\tcamera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );\n\n\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\tcameraVR.matrix.copy( camera.matrix );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( cameraVRNeedsUpdate === true ) {\n\n\t\t\t\t\t\tcameraVR.cameras.push( camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tconst inputSources = session.inputSources;\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tconst controller = controllers[ i ];\n\t\t\t\tconst inputSource = inputSources[ i ];\n\n\t\t\t\tcontroller.update( inputSource, frame, referenceSpace );\n\n\t\t\t}\n\n\t\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );\n\n\t\t\txrFrame = null;\n\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\n\t\tanimation.setAnimationLoop( onAnimationFrame );\n\n\t\tthis.setAnimationLoop = function ( callback ) {\n\n\t\t\tonAnimationFrameCallback = callback;\n\n\t\t};\n\n\t\tthis.dispose = function () {};\n\n\t}\n\n}\n\nfunction WebGLMaterials( properties ) {\n\n\tfunction refreshFogUniforms( uniforms, fog ) {\n\n\t\tuniforms.fogColor.value.copy( fog.color );\n\n\t\tif ( fog.isFog ) {\n\n\t\t\tuniforms.fogNear.value = fog.near;\n\t\t\tuniforms.fogFar.value = fog.far;\n\n\t\t} else if ( fog.isFogExp2 ) {\n\n\t\t\tuniforms.fogDensity.value = fog.density;\n\n\t\t}\n\n\t}\n\n\tfunction refreshMaterialUniforms( uniforms, material, pixelRatio, height, transmissionRenderTarget ) {\n\n\t\tif ( material.isMeshBasicMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshLambertMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsLambert( uniforms, material );\n\n\t\t} else if ( material.isMeshToonMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsToon( uniforms, material );\n\n\t\t} else if ( material.isMeshPhongMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsPhong( uniforms, material );\n\n\t\t} else if ( material.isMeshStandardMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t\tif ( material.isMeshPhysicalMaterial ) {\n\n\t\t\t\trefreshUniformsPhysical( uniforms, material, transmissionRenderTarget );\n\n\t\t\t} else {\n\n\t\t\t\trefreshUniformsStandard( uniforms, material );\n\n\t\t\t}\n\n\t\t} else if ( material.isMeshMatcapMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsMatcap( uniforms, material );\n\n\t\t} else if ( material.isMeshDepthMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsDepth( uniforms, material );\n\n\t\t} else if ( material.isMeshDistanceMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsDistance( uniforms, material );\n\n\t\t} else if ( material.isMeshNormalMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsNormal( uniforms, material );\n\n\t\t} else if ( material.isLineBasicMaterial ) {\n\n\t\t\trefreshUniformsLine( uniforms, material );\n\n\t\t\tif ( material.isLineDashedMaterial ) {\n\n\t\t\t\trefreshUniformsDash( uniforms, material );\n\n\t\t\t}\n\n\t\t} else if ( material.isPointsMaterial ) {\n\n\t\t\trefreshUniformsPoints( uniforms, material, pixelRatio, height );\n\n\t\t} else if ( material.isSpriteMaterial ) {\n\n\t\t\trefreshUniformsSprites( uniforms, material );\n\n\t\t} else if ( material.isShadowMaterial ) {\n\n\t\t\tuniforms.color.value.copy( material.color );\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t} else if ( material.isShaderMaterial ) {\n\n\t\t\tmaterial.uniformsNeedUpdate = false; // #15581\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsCommon( uniforms, material ) {\n\n\t\tuniforms.opacity.value = material.opacity;\n\n\t\tif ( material.color ) {\n\n\t\t\tuniforms.diffuse.value.copy( material.color );\n\n\t\t}\n\n\t\tif ( material.emissive ) {\n\n\t\t\tuniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );\n\n\t\t}\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t}\n\n\t\tif ( material.specularMap ) {\n\n\t\t\tuniforms.specularMap.value = material.specularMap;\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t\tconst envMap = properties.get( material ).envMap;\n\n\t\tif ( envMap ) {\n\n\t\t\tuniforms.envMap.value = envMap;\n\n\t\t\tuniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t\tuniforms.reflectivity.value = material.reflectivity;\n\t\t\tuniforms.ior.value = material.ior;\n\t\t\tuniforms.refractionRatio.value = material.refractionRatio;\n\n\t\t}\n\n\t\tif ( material.lightMap ) {\n\n\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\n\t\t}\n\n\t\tif ( material.aoMap ) {\n\n\t\t\tuniforms.aoMap.value = material.aoMap;\n\t\t\tuniforms.aoMapIntensity.value = material.aoMapIntensity;\n\n\t\t}\n\n\t\t// uv repeat and offset setting priorities\n\t\t// 1. color map\n\t\t// 2. specular map\n\t\t// 3. displacementMap map\n\t\t// 4. normal map\n\t\t// 5. bump map\n\t\t// 6. roughnessMap map\n\t\t// 7. metalnessMap map\n\t\t// 8. alphaMap map\n\t\t// 9. emissiveMap map\n\t\t// 10. clearcoat map\n\t\t// 11. clearcoat normal map\n\t\t// 12. clearcoat roughnessMap map\n\t\t// 13. specular intensity map\n\t\t// 14. specular tint map\n\t\t// 15. transmission map\n\t\t// 16. thickness map\n\n\t\tlet uvScaleMap;\n\n\t\tif ( material.map ) {\n\n\t\t\tuvScaleMap = material.map;\n\n\t\t} else if ( material.specularMap ) {\n\n\t\t\tuvScaleMap = material.specularMap;\n\n\t\t} else if ( material.displacementMap ) {\n\n\t\t\tuvScaleMap = material.displacementMap;\n\n\t\t} else if ( material.normalMap ) {\n\n\t\t\tuvScaleMap = material.normalMap;\n\n\t\t} else if ( material.bumpMap ) {\n\n\t\t\tuvScaleMap = material.bumpMap;\n\n\t\t} else if ( material.roughnessMap ) {\n\n\t\t\tuvScaleMap = material.roughnessMap;\n\n\t\t} else if ( material.metalnessMap ) {\n\n\t\t\tuvScaleMap = material.metalnessMap;\n\n\t\t} else if ( material.alphaMap ) {\n\n\t\t\tuvScaleMap = material.alphaMap;\n\n\t\t} else if ( material.emissiveMap ) {\n\n\t\t\tuvScaleMap = material.emissiveMap;\n\n\t\t} else if ( material.clearcoatMap ) {\n\n\t\t\tuvScaleMap = material.clearcoatMap;\n\n\t\t} else if ( material.clearcoatNormalMap ) {\n\n\t\t\tuvScaleMap = material.clearcoatNormalMap;\n\n\t\t} else if ( material.clearcoatRoughnessMap ) {\n\n\t\t\tuvScaleMap = material.clearcoatRoughnessMap;\n\n\t\t} else if ( material.specularIntensityMap ) {\n\n\t\t\tuvScaleMap = material.specularIntensityMap;\n\n\t\t} else if ( material.specularColorMap ) {\n\n\t\t\tuvScaleMap = material.specularColorMap;\n\n\t\t} else if ( material.transmissionMap ) {\n\n\t\t\tuvScaleMap = material.transmissionMap;\n\n\t\t} else if ( material.thicknessMap ) {\n\n\t\t\tuvScaleMap = material.thicknessMap;\n\n\t\t} else if ( material.sheenColorMap ) {\n\n\t\t\tuvScaleMap = material.sheenColorMap;\n\n\t\t} else if ( material.sheenRoughnessMap ) {\n\n\t\t\tuvScaleMap = material.sheenRoughnessMap;\n\n\t\t}\n\n\t\tif ( uvScaleMap !== undefined ) {\n\n\t\t\t// backwards compatibility\n\t\t\tif ( uvScaleMap.isWebGLRenderTarget ) {\n\n\t\t\t\tuvScaleMap = uvScaleMap.texture;\n\n\t\t\t}\n\n\t\t\tif ( uvScaleMap.matrixAutoUpdate === true ) {\n\n\t\t\t\tuvScaleMap.updateMatrix();\n\n\t\t\t}\n\n\t\t\tuniforms.uvTransform.value.copy( uvScaleMap.matrix );\n\n\t\t}\n\n\t\t// uv repeat and offset setting priorities for uv2\n\t\t// 1. ao map\n\t\t// 2. light map\n\n\t\tlet uv2ScaleMap;\n\n\t\tif ( material.aoMap ) {\n\n\t\t\tuv2ScaleMap = material.aoMap;\n\n\t\t} else if ( material.lightMap ) {\n\n\t\t\tuv2ScaleMap = material.lightMap;\n\n\t\t}\n\n\t\tif ( uv2ScaleMap !== undefined ) {\n\n\t\t\t// backwards compatibility\n\t\t\tif ( uv2ScaleMap.isWebGLRenderTarget ) {\n\n\t\t\t\tuv2ScaleMap = uv2ScaleMap.texture;\n\n\t\t\t}\n\n\t\t\tif ( uv2ScaleMap.matrixAutoUpdate === true ) {\n\n\t\t\t\tuv2ScaleMap.updateMatrix();\n\n\t\t\t}\n\n\t\t\tuniforms.uv2Transform.value.copy( uv2ScaleMap.matrix );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsLine( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\n\t}\n\n\tfunction refreshUniformsDash( uniforms, material ) {\n\n\t\tuniforms.dashSize.value = material.dashSize;\n\t\tuniforms.totalSize.value = material.dashSize + material.gapSize;\n\t\tuniforms.scale.value = material.scale;\n\n\t}\n\n\tfunction refreshUniformsPoints( uniforms, material, pixelRatio, height ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.size.value = material.size * pixelRatio;\n\t\tuniforms.scale.value = height * 0.5;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t\t// uv repeat and offset setting priorities\n\t\t// 1. color map\n\t\t// 2. alpha map\n\n\t\tlet uvScaleMap;\n\n\t\tif ( material.map ) {\n\n\t\t\tuvScaleMap = material.map;\n\n\t\t} else if ( material.alphaMap ) {\n\n\t\t\tuvScaleMap = material.alphaMap;\n\n\t\t}\n\n\t\tif ( uvScaleMap !== undefined ) {\n\n\t\t\tif ( uvScaleMap.matrixAutoUpdate === true ) {\n\n\t\t\t\tuvScaleMap.updateMatrix();\n\n\t\t\t}\n\n\t\t\tuniforms.uvTransform.value.copy( uvScaleMap.matrix );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsSprites( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.rotation.value = material.rotation;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t\t// uv repeat and offset setting priorities\n\t\t// 1. color map\n\t\t// 2. alpha map\n\n\t\tlet uvScaleMap;\n\n\t\tif ( material.map ) {\n\n\t\t\tuvScaleMap = material.map;\n\n\t\t} else if ( material.alphaMap ) {\n\n\t\t\tuvScaleMap = material.alphaMap;\n\n\t\t}\n\n\t\tif ( uvScaleMap !== undefined ) {\n\n\t\t\tif ( uvScaleMap.matrixAutoUpdate === true ) {\n\n\t\t\t\tuvScaleMap.updateMatrix();\n\n\t\t\t}\n\n\t\t\tuniforms.uvTransform.value.copy( uvScaleMap.matrix );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsLambert( uniforms, material ) {\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhong( uniforms, material ) {\n\n\t\tuniforms.specular.value.copy( material.specular );\n\t\tuniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t}\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\tif ( material.side === BackSide ) uniforms.bumpScale.value *= - 1;\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\t\t\tif ( material.side === BackSide ) uniforms.normalScale.value.negate();\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsToon( uniforms, material ) {\n\n\t\tif ( material.gradientMap ) {\n\n\t\t\tuniforms.gradientMap.value = material.gradientMap;\n\n\t\t}\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t}\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\tif ( material.side === BackSide ) uniforms.bumpScale.value *= - 1;\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\t\t\tif ( material.side === BackSide ) uniforms.normalScale.value.negate();\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsStandard( uniforms, material ) {\n\n\t\tuniforms.roughness.value = material.roughness;\n\t\tuniforms.metalness.value = material.metalness;\n\n\t\tif ( material.roughnessMap ) {\n\n\t\t\tuniforms.roughnessMap.value = material.roughnessMap;\n\n\t\t}\n\n\t\tif ( material.metalnessMap ) {\n\n\t\t\tuniforms.metalnessMap.value = material.metalnessMap;\n\n\t\t}\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t}\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\tif ( material.side === BackSide ) uniforms.bumpScale.value *= - 1;\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\t\t\tif ( material.side === BackSide ) uniforms.normalScale.value.negate();\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t\tconst envMap = properties.get( material ).envMap;\n\n\t\tif ( envMap ) {\n\n\t\t\t//uniforms.envMap.value = material.envMap; // part of uniforms common\n\t\t\tuniforms.envMapIntensity.value = material.envMapIntensity;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ) {\n\n\t\trefreshUniformsStandard( uniforms, material );\n\n\t\tuniforms.ior.value = material.ior; // also part of uniforms common\n\n\t\tif ( material.sheen > 0 ) {\n\n\t\t\tuniforms.sheenColor.value.copy( material.sheenColor ).multiplyScalar( material.sheen );\n\n\t\t\tuniforms.sheenRoughness.value = material.sheenRoughness;\n\n\t\t\tif ( material.sheenColorMap ) {\n\n\t\t\t\tuniforms.sheenColorMap.value = material.sheenColorMap;\n\n\t\t\t}\n\n\t\t\tif ( material.sheenRoughnessMap ) {\n\n\t\t\t\tuniforms.sheenRoughnessMap.value = material.sheenRoughnessMap;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.clearcoat > 0 ) {\n\n\t\t\tuniforms.clearcoat.value = material.clearcoat;\n\t\t\tuniforms.clearcoatRoughness.value = material.clearcoatRoughness;\n\n\t\t\tif ( material.clearcoatMap ) {\n\n\t\t\t\tuniforms.clearcoatMap.value = material.clearcoatMap;\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatRoughnessMap ) {\n\n\t\t\t\tuniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap;\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatNormalMap ) {\n\n\t\t\t\tuniforms.clearcoatNormalScale.value.copy( material.clearcoatNormalScale );\n\t\t\t\tuniforms.clearcoatNormalMap.value = material.clearcoatNormalMap;\n\n\t\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\t\tuniforms.clearcoatNormalScale.value.negate();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.transmission > 0 ) {\n\n\t\t\tuniforms.transmission.value = material.transmission;\n\t\t\tuniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture;\n\t\t\tuniforms.transmissionSamplerSize.value.set( transmissionRenderTarget.width, transmissionRenderTarget.height );\n\n\t\t\tif ( material.transmissionMap ) {\n\n\t\t\t\tuniforms.transmissionMap.value = material.transmissionMap;\n\n\t\t\t}\n\n\t\t\tuniforms.thickness.value = material.thickness;\n\n\t\t\tif ( material.thicknessMap ) {\n\n\t\t\t\tuniforms.thicknessMap.value = material.thicknessMap;\n\n\t\t\t}\n\n\t\t\tuniforms.attenuationDistance.value = material.attenuationDistance;\n\t\t\tuniforms.attenuationColor.value.copy( material.attenuationColor );\n\n\t\t}\n\n\t\tuniforms.specularIntensity.value = material.specularIntensity;\n\t\tuniforms.specularColor.value.copy( material.specularColor );\n\n\t\tif ( material.specularIntensityMap ) {\n\n\t\t\tuniforms.specularIntensityMap.value = material.specularIntensityMap;\n\n\t\t}\n\n\t\tif ( material.specularColorMap ) {\n\n\t\t\tuniforms.specularColorMap.value = material.specularColorMap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsMatcap( uniforms, material ) {\n\n\t\tif ( material.matcap ) {\n\n\t\t\tuniforms.matcap.value = material.matcap;\n\n\t\t}\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\tif ( material.side === BackSide ) uniforms.bumpScale.value *= - 1;\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\t\t\tif ( material.side === BackSide ) uniforms.normalScale.value.negate();\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDepth( uniforms, material ) {\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDistance( uniforms, material ) {\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t\tuniforms.referencePosition.value.copy( material.referencePosition );\n\t\tuniforms.nearDistance.value = material.nearDistance;\n\t\tuniforms.farDistance.value = material.farDistance;\n\n\t}\n\n\tfunction refreshUniformsNormal( uniforms, material ) {\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\tif ( material.side === BackSide ) uniforms.bumpScale.value *= - 1;\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\t\t\tif ( material.side === BackSide ) uniforms.normalScale.value.negate();\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\trefreshFogUniforms: refreshFogUniforms,\n\t\trefreshMaterialUniforms: refreshMaterialUniforms\n\t};\n\n}\n\nfunction createCanvasElement() {\n\n\tconst canvas = createElementNS( 'canvas' );\n\tcanvas.style.display = 'block';\n\treturn canvas;\n\n}\n\nfunction WebGLRenderer( parameters = {} ) {\n\n\tconst _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),\n\t\t_context = parameters.context !== undefined ? parameters.context : null,\n\n\t\t_alpha = parameters.alpha !== undefined ? parameters.alpha : false,\n\t\t_depth = parameters.depth !== undefined ? parameters.depth : true,\n\t\t_stencil = parameters.stencil !== undefined ? parameters.stencil : true,\n\t\t_antialias = parameters.antialias !== undefined ? parameters.antialias : false,\n\t\t_premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true,\n\t\t_preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false,\n\t\t_powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default',\n\t\t_failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false;\n\n\tlet currentRenderList = null;\n\tlet currentRenderState = null;\n\n\t// render() can be called from within a callback triggered by another render.\n\t// We track this so that the nested render call gets its list and state isolated from the parent render call.\n\n\tconst renderListStack = [];\n\tconst renderStateStack = [];\n\n\t// public properties\n\n\tthis.domElement = _canvas;\n\n\t// Debug configuration container\n\tthis.debug = {\n\n\t\t/**\n\t\t * Enables error checking and reporting when shader programs are being compiled\n\t\t * @type {boolean}\n\t\t */\n\t\tcheckShaderErrors: true\n\t};\n\n\t// clearing\n\n\tthis.autoClear = true;\n\tthis.autoClearColor = true;\n\tthis.autoClearDepth = true;\n\tthis.autoClearStencil = true;\n\n\t// scene graph\n\n\tthis.sortObjects = true;\n\n\t// user-defined clipping\n\n\tthis.clippingPlanes = [];\n\tthis.localClippingEnabled = false;\n\n\t// physically based shading\n\n\tthis.outputEncoding = LinearEncoding;\n\n\t// physical lights\n\n\tthis.physicallyCorrectLights = false;\n\n\t// tone mapping\n\n\tthis.toneMapping = NoToneMapping;\n\tthis.toneMappingExposure = 1.0;\n\n\t// internal properties\n\n\tconst _this = this;\n\n\tlet _isContextLost = false;\n\n\t// internal state cache\n\n\tlet _currentActiveCubeFace = 0;\n\tlet _currentActiveMipmapLevel = 0;\n\tlet _currentRenderTarget = null;\n\tlet _currentMaterialId = - 1;\n\n\tlet _currentCamera = null;\n\n\tconst _currentViewport = new Vector4();\n\tconst _currentScissor = new Vector4();\n\tlet _currentScissorTest = null;\n\n\t//\n\n\tlet _width = _canvas.width;\n\tlet _height = _canvas.height;\n\n\tlet _pixelRatio = 1;\n\tlet _opaqueSort = null;\n\tlet _transparentSort = null;\n\n\tconst _viewport = new Vector4( 0, 0, _width, _height );\n\tconst _scissor = new Vector4( 0, 0, _width, _height );\n\tlet _scissorTest = false;\n\n\t// frustum\n\n\tconst _frustum = new Frustum();\n\n\t// clipping\n\n\tlet _clippingEnabled = false;\n\tlet _localClippingEnabled = false;\n\n\t// transmission\n\n\tlet _transmissionRenderTarget = null;\n\n\t// camera matrices cache\n\n\tconst _projScreenMatrix = new Matrix4();\n\n\tconst _vector3 = new Vector3();\n\n\tconst _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };\n\n\tfunction getTargetPixelRatio() {\n\n\t\treturn _currentRenderTarget === null ? _pixelRatio : 1;\n\n\t}\n\n\t// initialize\n\n\tlet _gl = _context;\n\n\tfunction getContext( contextNames, contextAttributes ) {\n\n\t\tfor ( let i = 0; i < contextNames.length; i ++ ) {\n\n\t\t\tconst contextName = contextNames[ i ];\n\t\t\tconst context = _canvas.getContext( contextName, contextAttributes );\n\t\t\tif ( context !== null ) return context;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\ttry {\n\n\t\tconst contextAttributes = {\n\t\t\talpha: true,\n\t\t\tdepth: _depth,\n\t\t\tstencil: _stencil,\n\t\t\tantialias: _antialias,\n\t\t\tpremultipliedAlpha: _premultipliedAlpha,\n\t\t\tpreserveDrawingBuffer: _preserveDrawingBuffer,\n\t\t\tpowerPreference: _powerPreference,\n\t\t\tfailIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat\n\t\t};\n\n\t\t// OffscreenCanvas does not have setAttribute, see #22811\n\t\tif ( 'setAttribute' in _canvas ) _canvas.setAttribute( 'data-engine', `three.js r${REVISION}` );\n\n\t\t// event listeners must be registered before WebGL context is created, see #12753\n\t\t_canvas.addEventListener( 'webglcontextlost', onContextLost, false );\n\t\t_canvas.addEventListener( 'webglcontextrestored', onContextRestore, false );\n\n\t\tif ( _gl === null ) {\n\n\t\t\tconst contextNames = [ 'webgl2', 'webgl', 'experimental-webgl' ];\n\n\t\t\tif ( _this.isWebGL1Renderer === true ) {\n\n\t\t\t\tcontextNames.shift();\n\n\t\t\t}\n\n\t\t\t_gl = getContext( contextNames, contextAttributes );\n\n\t\t\tif ( _gl === null ) {\n\n\t\t\t\tif ( getContext( contextNames ) ) {\n\n\t\t\t\t\tthrow new Error( 'Error creating WebGL context with your selected attributes.' );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( 'Error creating WebGL context.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Some experimental-webgl implementations do not have getShaderPrecisionFormat\n\n\t\tif ( _gl.getShaderPrecisionFormat === undefined ) {\n\n\t\t\t_gl.getShaderPrecisionFormat = function () {\n\n\t\t\t\treturn { 'rangeMin': 1, 'rangeMax': 1, 'precision': 1 };\n\n\t\t\t};\n\n\t\t}\n\n\t} catch ( error ) {\n\n\t\tconsole.error( 'THREE.WebGLRenderer: ' + error.message );\n\t\tthrow error;\n\n\t}\n\n\tlet extensions, capabilities, state, info;\n\tlet properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;\n\tlet programCache, materials, renderLists, renderStates, clipping, shadowMap;\n\n\tlet background, morphtargets, bufferRenderer, indexedBufferRenderer;\n\n\tlet utils, bindingStates;\n\n\tfunction initGLContext() {\n\n\t\textensions = new WebGLExtensions( _gl );\n\n\t\tcapabilities = new WebGLCapabilities( _gl, extensions, parameters );\n\n\t\textensions.init( capabilities );\n\n\t\tutils = new WebGLUtils( _gl, extensions, capabilities );\n\n\t\tstate = new WebGLState( _gl, extensions, capabilities );\n\n\t\tinfo = new WebGLInfo( _gl );\n\t\tproperties = new WebGLProperties();\n\t\ttextures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );\n\t\tcubemaps = new WebGLCubeMaps( _this );\n\t\tcubeuvmaps = new WebGLCubeUVMaps( _this );\n\t\tattributes = new WebGLAttributes( _gl, capabilities );\n\t\tbindingStates = new WebGLBindingStates( _gl, extensions, attributes, capabilities );\n\t\tgeometries = new WebGLGeometries( _gl, attributes, info, bindingStates );\n\t\tobjects = new WebGLObjects( _gl, geometries, attributes, info );\n\t\tmorphtargets = new WebGLMorphtargets( _gl, capabilities, textures );\n\t\tclipping = new WebGLClipping( properties );\n\t\tprogramCache = new WebGLPrograms( _this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping );\n\t\tmaterials = new WebGLMaterials( properties );\n\t\trenderLists = new WebGLRenderLists();\n\t\trenderStates = new WebGLRenderStates( extensions, capabilities );\n\t\tbackground = new WebGLBackground( _this, cubemaps, state, objects, _alpha, _premultipliedAlpha );\n\t\tshadowMap = new WebGLShadowMap( _this, objects, capabilities );\n\n\t\tbufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities );\n\t\tindexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities );\n\n\t\tinfo.programs = programCache.programs;\n\n\t\t_this.capabilities = capabilities;\n\t\t_this.extensions = extensions;\n\t\t_this.properties = properties;\n\t\t_this.renderLists = renderLists;\n\t\t_this.shadowMap = shadowMap;\n\t\t_this.state = state;\n\t\t_this.info = info;\n\n\t}\n\n\tinitGLContext();\n\n\t// xr\n\n\tconst xr = new WebXRManager( _this, _gl );\n\n\tthis.xr = xr;\n\n\t// API\n\n\tthis.getContext = function () {\n\n\t\treturn _gl;\n\n\t};\n\n\tthis.getContextAttributes = function () {\n\n\t\treturn _gl.getContextAttributes();\n\n\t};\n\n\tthis.forceContextLoss = function () {\n\n\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\tif ( extension ) extension.loseContext();\n\n\t};\n\n\tthis.forceContextRestore = function () {\n\n\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\tif ( extension ) extension.restoreContext();\n\n\t};\n\n\tthis.getPixelRatio = function () {\n\n\t\treturn _pixelRatio;\n\n\t};\n\n\tthis.setPixelRatio = function ( value ) {\n\n\t\tif ( value === undefined ) return;\n\n\t\t_pixelRatio = value;\n\n\t\tthis.setSize( _width, _height, false );\n\n\t};\n\n\tthis.getSize = function ( target ) {\n\n\t\treturn target.set( _width, _height );\n\n\t};\n\n\tthis.setSize = function ( width, height, updateStyle ) {\n\n\t\tif ( xr.isPresenting ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Can\\'t change size while VR device is presenting.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\t_width = width;\n\t\t_height = height;\n\n\t\t_canvas.width = Math.floor( width * _pixelRatio );\n\t\t_canvas.height = Math.floor( height * _pixelRatio );\n\n\t\tif ( updateStyle !== false ) {\n\n\t\t\t_canvas.style.width = width + 'px';\n\t\t\t_canvas.style.height = height + 'px';\n\n\t\t}\n\n\t\tthis.setViewport( 0, 0, width, height );\n\n\t};\n\n\tthis.getDrawingBufferSize = function ( target ) {\n\n\t\treturn target.set( _width * _pixelRatio, _height * _pixelRatio ).floor();\n\n\t};\n\n\tthis.setDrawingBufferSize = function ( width, height, pixelRatio ) {\n\n\t\t_width = width;\n\t\t_height = height;\n\n\t\t_pixelRatio = pixelRatio;\n\n\t\t_canvas.width = Math.floor( width * pixelRatio );\n\t\t_canvas.height = Math.floor( height * pixelRatio );\n\n\t\tthis.setViewport( 0, 0, width, height );\n\n\t};\n\n\tthis.getCurrentViewport = function ( target ) {\n\n\t\treturn target.copy( _currentViewport );\n\n\t};\n\n\tthis.getViewport = function ( target ) {\n\n\t\treturn target.copy( _viewport );\n\n\t};\n\n\tthis.setViewport = function ( x, y, width, height ) {\n\n\t\tif ( x.isVector4 ) {\n\n\t\t\t_viewport.set( x.x, x.y, x.z, x.w );\n\n\t\t} else {\n\n\t\t\t_viewport.set( x, y, width, height );\n\n\t\t}\n\n\t\tstate.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() );\n\n\t};\n\n\tthis.getScissor = function ( target ) {\n\n\t\treturn target.copy( _scissor );\n\n\t};\n\n\tthis.setScissor = function ( x, y, width, height ) {\n\n\t\tif ( x.isVector4 ) {\n\n\t\t\t_scissor.set( x.x, x.y, x.z, x.w );\n\n\t\t} else {\n\n\t\t\t_scissor.set( x, y, width, height );\n\n\t\t}\n\n\t\tstate.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() );\n\n\t};\n\n\tthis.getScissorTest = function () {\n\n\t\treturn _scissorTest;\n\n\t};\n\n\tthis.setScissorTest = function ( boolean ) {\n\n\t\tstate.setScissorTest( _scissorTest = boolean );\n\n\t};\n\n\tthis.setOpaqueSort = function ( method ) {\n\n\t\t_opaqueSort = method;\n\n\t};\n\n\tthis.setTransparentSort = function ( method ) {\n\n\t\t_transparentSort = method;\n\n\t};\n\n\t// Clearing\n\n\tthis.getClearColor = function ( target ) {\n\n\t\treturn target.copy( background.getClearColor() );\n\n\t};\n\n\tthis.setClearColor = function () {\n\n\t\tbackground.setClearColor.apply( background, arguments );\n\n\t};\n\n\tthis.getClearAlpha = function () {\n\n\t\treturn background.getClearAlpha();\n\n\t};\n\n\tthis.setClearAlpha = function () {\n\n\t\tbackground.setClearAlpha.apply( background, arguments );\n\n\t};\n\n\tthis.clear = function ( color, depth, stencil ) {\n\n\t\tlet bits = 0;\n\n\t\tif ( color === undefined || color ) bits |= 16384;\n\t\tif ( depth === undefined || depth ) bits |= 256;\n\t\tif ( stencil === undefined || stencil ) bits |= 1024;\n\n\t\t_gl.clear( bits );\n\n\t};\n\n\tthis.clearColor = function () {\n\n\t\tthis.clear( true, false, false );\n\n\t};\n\n\tthis.clearDepth = function () {\n\n\t\tthis.clear( false, true, false );\n\n\t};\n\n\tthis.clearStencil = function () {\n\n\t\tthis.clear( false, false, true );\n\n\t};\n\n\t//\n\n\tthis.dispose = function () {\n\n\t\t_canvas.removeEventListener( 'webglcontextlost', onContextLost, false );\n\t\t_canvas.removeEventListener( 'webglcontextrestored', onContextRestore, false );\n\n\t\trenderLists.dispose();\n\t\trenderStates.dispose();\n\t\tproperties.dispose();\n\t\tcubemaps.dispose();\n\t\tcubeuvmaps.dispose();\n\t\tobjects.dispose();\n\t\tbindingStates.dispose();\n\t\tprogramCache.dispose();\n\n\t\txr.dispose();\n\n\t\txr.removeEventListener( 'sessionstart', onXRSessionStart );\n\t\txr.removeEventListener( 'sessionend', onXRSessionEnd );\n\n\t\tif ( _transmissionRenderTarget ) {\n\n\t\t\t_transmissionRenderTarget.dispose();\n\t\t\t_transmissionRenderTarget = null;\n\n\t\t}\n\n\t\tanimation.stop();\n\n\t};\n\n\t// Events\n\n\tfunction onContextLost( event ) {\n\n\t\tevent.preventDefault();\n\n\t\tconsole.log( 'THREE.WebGLRenderer: Context Lost.' );\n\n\t\t_isContextLost = true;\n\n\t}\n\n\tfunction onContextRestore( /* event */ ) {\n\n\t\tconsole.log( 'THREE.WebGLRenderer: Context Restored.' );\n\n\t\t_isContextLost = false;\n\n\t\tconst infoAutoReset = info.autoReset;\n\t\tconst shadowMapEnabled = shadowMap.enabled;\n\t\tconst shadowMapAutoUpdate = shadowMap.autoUpdate;\n\t\tconst shadowMapNeedsUpdate = shadowMap.needsUpdate;\n\t\tconst shadowMapType = shadowMap.type;\n\n\t\tinitGLContext();\n\n\t\tinfo.autoReset = infoAutoReset;\n\t\tshadowMap.enabled = shadowMapEnabled;\n\t\tshadowMap.autoUpdate = shadowMapAutoUpdate;\n\t\tshadowMap.needsUpdate = shadowMapNeedsUpdate;\n\t\tshadowMap.type = shadowMapType;\n\n\t}\n\n\tfunction onMaterialDispose( event ) {\n\n\t\tconst material = event.target;\n\n\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\tdeallocateMaterial( material );\n\n\t}\n\n\t// Buffer deallocation\n\n\tfunction deallocateMaterial( material ) {\n\n\t\treleaseMaterialProgramReferences( material );\n\n\t\tproperties.remove( material );\n\n\t}\n\n\n\tfunction releaseMaterialProgramReferences( material ) {\n\n\t\tconst programs = properties.get( material ).programs;\n\n\t\tif ( programs !== undefined ) {\n\n\t\t\tprograms.forEach( function ( program ) {\n\n\t\t\t\tprogramCache.releaseProgram( program );\n\n\t\t\t} );\n\n\t\t\tif ( material.isShaderMaterial ) {\n\n\t\t\t\tprogramCache.releaseShaderCache( material );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// Buffer rendering\n\n\tthis.renderBufferDirect = function ( camera, scene, geometry, material, object, group ) {\n\n\t\tif ( scene === null ) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null)\n\n\t\tconst frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );\n\n\t\tconst program = setProgram( camera, scene, geometry, material, object );\n\n\t\tstate.setMaterial( material, frontFaceCW );\n\n\t\t//\n\n\t\tlet index = geometry.index;\n\t\tconst position = geometry.attributes.position;\n\n\t\t//\n\n\t\tif ( index === null ) {\n\n\t\t\tif ( position === undefined || position.count === 0 ) return;\n\n\t\t} else if ( index.count === 0 ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t//\n\n\t\tlet rangeFactor = 1;\n\n\t\tif ( material.wireframe === true ) {\n\n\t\t\tindex = geometries.getWireframeAttribute( geometry );\n\t\t\trangeFactor = 2;\n\n\t\t}\n\n\t\tbindingStates.setup( object, material, program, geometry, index );\n\n\t\tlet attribute;\n\t\tlet renderer = bufferRenderer;\n\n\t\tif ( index !== null ) {\n\n\t\t\tattribute = attributes.get( index );\n\n\t\t\trenderer = indexedBufferRenderer;\n\t\t\trenderer.setIndex( attribute );\n\n\t\t}\n\n\t\t//\n\n\t\tconst dataCount = ( index !== null ) ? index.count : position.count;\n\n\t\tconst rangeStart = geometry.drawRange.start * rangeFactor;\n\t\tconst rangeCount = geometry.drawRange.count * rangeFactor;\n\n\t\tconst groupStart = group !== null ? group.start * rangeFactor : 0;\n\t\tconst groupCount = group !== null ? group.count * rangeFactor : Infinity;\n\n\t\tconst drawStart = Math.max( rangeStart, groupStart );\n\t\tconst drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1;\n\n\t\tconst drawCount = Math.max( 0, drawEnd - drawStart + 1 );\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\t//\n\n\t\tif ( object.isMesh ) {\n\n\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\tstate.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() );\n\t\t\t\trenderer.setMode( 1 );\n\n\t\t\t} else {\n\n\t\t\t\trenderer.setMode( 4 );\n\n\t\t\t}\n\n\t\t} else if ( object.isLine ) {\n\n\t\t\tlet lineWidth = material.linewidth;\n\n\t\t\tif ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material\n\n\t\t\tstate.setLineWidth( lineWidth * getTargetPixelRatio() );\n\n\t\t\tif ( object.isLineSegments ) {\n\n\t\t\t\trenderer.setMode( 1 );\n\n\t\t\t} else if ( object.isLineLoop ) {\n\n\t\t\t\trenderer.setMode( 2 );\n\n\t\t\t} else {\n\n\t\t\t\trenderer.setMode( 3 );\n\n\t\t\t}\n\n\t\t} else if ( object.isPoints ) {\n\n\t\t\trenderer.setMode( 0 );\n\n\t\t} else if ( object.isSprite ) {\n\n\t\t\trenderer.setMode( 4 );\n\n\t\t}\n\n\t\tif ( object.isInstancedMesh ) {\n\n\t\t\trenderer.renderInstances( drawStart, drawCount, object.count );\n\n\t\t} else if ( geometry.isInstancedBufferGeometry ) {\n\n\t\t\tconst instanceCount = Math.min( geometry.instanceCount, geometry._maxInstanceCount );\n\n\t\t\trenderer.renderInstances( drawStart, drawCount, instanceCount );\n\n\t\t} else {\n\n\t\t\trenderer.render( drawStart, drawCount );\n\n\t\t}\n\n\t};\n\n\t// Compile\n\n\tthis.compile = function ( scene, camera ) {\n\n\t\tcurrentRenderState = renderStates.get( scene );\n\t\tcurrentRenderState.init();\n\n\t\trenderStateStack.push( currentRenderState );\n\n\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\tif ( object.isLight && object.layers.test( camera.layers ) ) {\n\n\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t\tcurrentRenderState.setupLights( _this.physicallyCorrectLights );\n\n\t\tscene.traverse( function ( object ) {\n\n\t\t\tconst material = object.material;\n\n\t\t\tif ( material ) {\n\n\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\tfor ( let i = 0; i < material.length; i ++ ) {\n\n\t\t\t\t\t\tconst material2 = material[ i ];\n\n\t\t\t\t\t\tgetProgram( material2, scene, object );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t\trenderStateStack.pop();\n\t\tcurrentRenderState = null;\n\n\t};\n\n\t// Animation Loop\n\n\tlet onAnimationFrameCallback = null;\n\n\tfunction onAnimationFrame( time ) {\n\n\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time );\n\n\t}\n\n\tfunction onXRSessionStart() {\n\n\t\tanimation.stop();\n\n\t}\n\n\tfunction onXRSessionEnd() {\n\n\t\tanimation.start();\n\n\t}\n\n\tconst animation = new WebGLAnimation();\n\tanimation.setAnimationLoop( onAnimationFrame );\n\n\tif ( typeof window !== 'undefined' ) animation.setContext( window );\n\n\tthis.setAnimationLoop = function ( callback ) {\n\n\t\tonAnimationFrameCallback = callback;\n\t\txr.setAnimationLoop( callback );\n\n\t\t( callback === null ) ? animation.stop() : animation.start();\n\n\t};\n\n\txr.addEventListener( 'sessionstart', onXRSessionStart );\n\txr.addEventListener( 'sessionend', onXRSessionEnd );\n\n\t// Rendering\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tif ( camera !== undefined && camera.isCamera !== true ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( _isContextLost === true ) return;\n\n\t\t// update scene graph\n\n\t\tif ( scene.autoUpdate === true ) scene.updateMatrixWorld();\n\n\t\t// update camera matrices and frustum\n\n\t\tif ( camera.parent === null ) camera.updateMatrixWorld();\n\n\t\tif ( xr.enabled === true && xr.isPresenting === true ) {\n\n\t\t\tif ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera );\n\n\t\t\tcamera = xr.getCamera(); // use XR camera for rendering\n\n\t\t}\n\n\t\t//\n\t\tif ( scene.isScene === true ) scene.onBeforeRender( _this, scene, camera, _currentRenderTarget );\n\n\t\tcurrentRenderState = renderStates.get( scene, renderStateStack.length );\n\t\tcurrentRenderState.init();\n\n\t\trenderStateStack.push( currentRenderState );\n\n\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\t_frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t\t_localClippingEnabled = this.localClippingEnabled;\n\t\t_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled, camera );\n\n\t\tcurrentRenderList = renderLists.get( scene, renderListStack.length );\n\t\tcurrentRenderList.init();\n\n\t\trenderListStack.push( currentRenderList );\n\n\t\tprojectObject( scene, camera, 0, _this.sortObjects );\n\n\t\tcurrentRenderList.finish();\n\n\t\tif ( _this.sortObjects === true ) {\n\n\t\t\tcurrentRenderList.sort( _opaqueSort, _transparentSort );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( _clippingEnabled === true ) clipping.beginShadows();\n\n\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\tshadowMap.render( shadowsArray, scene, camera );\n\n\t\tif ( _clippingEnabled === true ) clipping.endShadows();\n\n\t\t//\n\n\t\tif ( this.info.autoReset === true ) this.info.reset();\n\n\t\t//\n\n\t\tbackground.render( currentRenderList, scene );\n\n\t\t// render scene\n\n\t\tcurrentRenderState.setupLights( _this.physicallyCorrectLights );\n\n\t\tif ( camera.isArrayCamera ) {\n\n\t\t\tconst cameras = camera.cameras;\n\n\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\n\n\t\t\t\tconst camera2 = cameras[ i ];\n\n\t\t\t\trenderScene( currentRenderList, scene, camera2, camera2.viewport );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\trenderScene( currentRenderList, scene, camera );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( _currentRenderTarget !== null ) {\n\n\t\t\t// resolve multisample renderbuffers to a single-sample texture if necessary\n\n\t\t\ttextures.updateMultisampleRenderTarget( _currentRenderTarget );\n\n\t\t\t// Generate mipmap if we're using any kind of mipmap filtering\n\n\t\t\ttextures.updateRenderTargetMipmap( _currentRenderTarget );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( scene.isScene === true ) scene.onAfterRender( _this, scene, camera );\n\n\t\t// Ensure depth buffer writing is enabled so it can be cleared on next render\n\n\t\tstate.buffers.depth.setTest( true );\n\t\tstate.buffers.depth.setMask( true );\n\t\tstate.buffers.color.setMask( true );\n\n\t\tstate.setPolygonOffset( false );\n\n\t\t// _gl.finish();\n\n\t\tbindingStates.resetDefaultState();\n\t\t_currentMaterialId = - 1;\n\t\t_currentCamera = null;\n\n\t\trenderStateStack.pop();\n\n\t\tif ( renderStateStack.length > 0 ) {\n\n\t\t\tcurrentRenderState = renderStateStack[ renderStateStack.length - 1 ];\n\n\t\t} else {\n\n\t\t\tcurrentRenderState = null;\n\n\t\t}\n\n\t\trenderListStack.pop();\n\n\t\tif ( renderListStack.length > 0 ) {\n\n\t\t\tcurrentRenderList = renderListStack[ renderListStack.length - 1 ];\n\n\t\t} else {\n\n\t\t\tcurrentRenderList = null;\n\n\t\t}\n\n\t};\n\n\tfunction projectObject( object, camera, groupOrder, sortObjects ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tconst visible = object.layers.test( camera.layers );\n\n\t\tif ( visible ) {\n\n\t\t\tif ( object.isGroup ) {\n\n\t\t\t\tgroupOrder = object.renderOrder;\n\n\t\t\t} else if ( object.isLOD ) {\n\n\t\t\t\tif ( object.autoUpdate === true ) object.update( camera );\n\n\t\t\t} else if ( object.isLight ) {\n\n\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) {\n\n\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t_vector3.setFromMatrixPosition( object.matrixWorld )\n\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\tif ( material.visible ) {\n\n\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isMesh || object.isLine || object.isPoints ) {\n\n\t\t\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\t\t\t// update skeleton only once in a frame\n\n\t\t\t\t\tif ( object.skeleton.frame !== info.render.frame ) {\n\n\t\t\t\t\t\tobject.skeleton.update();\n\t\t\t\t\t\tobject.skeleton.frame = info.render.frame;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {\n\n\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t_vector3.setFromMatrixPosition( object.matrixWorld )\n\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, groupMaterial, groupOrder, _vector3.z, group );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tprojectObject( children[ i ], camera, groupOrder, sortObjects );\n\n\t\t}\n\n\t}\n\n\tfunction renderScene( currentRenderList, scene, camera, viewport ) {\n\n\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\t\tconst transparentObjects = currentRenderList.transparent;\n\n\t\tcurrentRenderState.setupLightsView( camera );\n\n\t\tif ( transmissiveObjects.length > 0 ) renderTransmissionPass( opaqueObjects, scene, camera );\n\n\t\tif ( viewport ) state.viewport( _currentViewport.copy( viewport ) );\n\n\t\tif ( opaqueObjects.length > 0 ) renderObjects( opaqueObjects, scene, camera );\n\t\tif ( transmissiveObjects.length > 0 ) renderObjects( transmissiveObjects, scene, camera );\n\t\tif ( transparentObjects.length > 0 ) renderObjects( transparentObjects, scene, camera );\n\n\t}\n\n\tfunction renderTransmissionPass( opaqueObjects, scene, camera ) {\n\n\t\tif ( _transmissionRenderTarget === null ) {\n\n\t\t\tconst needsAntialias = _antialias === true && capabilities.isWebGL2 === true;\n\t\t\tconst renderTargetType = needsAntialias ? WebGLMultisampleRenderTarget : WebGLRenderTarget;\n\n\t\t\t_transmissionRenderTarget = new renderTargetType( 1024, 1024, {\n\t\t\t\tgenerateMipmaps: true,\n\t\t\t\ttype: utils.convert( HalfFloatType ) !== null ? HalfFloatType : UnsignedByteType,\n\t\t\t\tminFilter: LinearMipmapLinearFilter,\n\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\twrapS: ClampToEdgeWrapping,\n\t\t\t\twrapT: ClampToEdgeWrapping,\n\t\t\t\tuseRenderToTexture: extensions.has( 'WEBGL_multisampled_render_to_texture' )\n\t\t\t} );\n\n\t\t}\n\n\t\tconst currentRenderTarget = _this.getRenderTarget();\n\t\t_this.setRenderTarget( _transmissionRenderTarget );\n\t\t_this.clear();\n\n\t\t// Turn off the features which can affect the frag color for opaque objects pass.\n\t\t// Otherwise they are applied twice in opaque objects pass and transmission objects pass.\n\t\tconst currentToneMapping = _this.toneMapping;\n\t\t_this.toneMapping = NoToneMapping;\n\n\t\trenderObjects( opaqueObjects, scene, camera );\n\n\t\t_this.toneMapping = currentToneMapping;\n\n\t\ttextures.updateMultisampleRenderTarget( _transmissionRenderTarget );\n\t\ttextures.updateRenderTargetMipmap( _transmissionRenderTarget );\n\n\t\t_this.setRenderTarget( currentRenderTarget );\n\n\t}\n\n\tfunction renderObjects( renderList, scene, camera ) {\n\n\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\tfor ( let i = 0, l = renderList.length; i < l; i ++ ) {\n\n\t\t\tconst renderItem = renderList[ i ];\n\n\t\t\tconst object = renderItem.object;\n\t\t\tconst geometry = renderItem.geometry;\n\t\t\tconst material = overrideMaterial === null ? renderItem.material : overrideMaterial;\n\t\t\tconst group = renderItem.group;\n\n\t\t\tif ( object.layers.test( camera.layers ) ) {\n\n\t\t\t\trenderObject( object, scene, camera, geometry, material, group );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction renderObject( object, scene, camera, geometry, material, group ) {\n\n\t\tobject.onBeforeRender( _this, scene, camera, geometry, material, group );\n\n\t\tobject.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );\n\t\tobject.normalMatrix.getNormalMatrix( object.modelViewMatrix );\n\n\t\tmaterial.onBeforeRender( _this, scene, camera, geometry, object, group );\n\n\t\tif ( material.transparent === true && material.side === DoubleSide ) {\n\n\t\t\tmaterial.side = BackSide;\n\t\t\tmaterial.needsUpdate = true;\n\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\tmaterial.side = FrontSide;\n\t\t\tmaterial.needsUpdate = true;\n\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\tmaterial.side = DoubleSide;\n\n\t\t} else {\n\n\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t}\n\n\t\tobject.onAfterRender( _this, scene, camera, geometry, material, group );\n\n\t}\n\n\tfunction getProgram( material, scene, object ) {\n\n\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tconst lights = currentRenderState.state.lights;\n\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\tconst lightsStateVersion = lights.state.version;\n\n\t\tconst parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object );\n\t\tconst programCacheKey = programCache.getProgramCacheKey( parameters );\n\n\t\tlet programs = materialProperties.programs;\n\n\t\t// always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change\n\n\t\tmaterialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\tmaterialProperties.fog = scene.fog;\n\t\tmaterialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );\n\n\t\tif ( programs === undefined ) {\n\n\t\t\t// new material\n\n\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\tprograms = new Map();\n\t\t\tmaterialProperties.programs = programs;\n\n\t\t}\n\n\t\tlet program = programs.get( programCacheKey );\n\n\t\tif ( program !== undefined ) {\n\n\t\t\t// early out if program and light state is identical\n\n\t\t\tif ( materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion ) {\n\n\t\t\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t\t\treturn program;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tparameters.uniforms = programCache.getUniforms( material );\n\n\t\t\tmaterial.onBuild( object, parameters, _this );\n\n\t\t\tmaterial.onBeforeCompile( parameters, _this );\n\n\t\t\tprogram = programCache.acquireProgram( parameters, programCacheKey );\n\t\t\tprograms.set( programCacheKey, program );\n\n\t\t\tmaterialProperties.uniforms = parameters.uniforms;\n\n\t\t}\n\n\t\tconst uniforms = materialProperties.uniforms;\n\n\t\tif ( ( ! material.isShaderMaterial && ! material.isRawShaderMaterial ) || material.clipping === true ) {\n\n\t\t\tuniforms.clippingPlanes = clipping.uniform;\n\n\t\t}\n\n\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t// store the light setup it was created for\n\n\t\tmaterialProperties.needsLights = materialNeedsLights( material );\n\t\tmaterialProperties.lightsStateVersion = lightsStateVersion;\n\n\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t// wire up the material to this renderer's lighting state\n\n\t\t\tuniforms.ambientLightColor.value = lights.state.ambient;\n\t\t\tuniforms.lightProbe.value = lights.state.probe;\n\t\t\tuniforms.directionalLights.value = lights.state.directional;\n\t\t\tuniforms.directionalLightShadows.value = lights.state.directionalShadow;\n\t\t\tuniforms.spotLights.value = lights.state.spot;\n\t\t\tuniforms.spotLightShadows.value = lights.state.spotShadow;\n\t\t\tuniforms.rectAreaLights.value = lights.state.rectArea;\n\t\t\tuniforms.ltc_1.value = lights.state.rectAreaLTC1;\n\t\t\tuniforms.ltc_2.value = lights.state.rectAreaLTC2;\n\t\t\tuniforms.pointLights.value = lights.state.point;\n\t\t\tuniforms.pointLightShadows.value = lights.state.pointShadow;\n\t\t\tuniforms.hemisphereLights.value = lights.state.hemi;\n\n\t\t\tuniforms.directionalShadowMap.value = lights.state.directionalShadowMap;\n\t\t\tuniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;\n\t\t\tuniforms.spotShadowMap.value = lights.state.spotShadowMap;\n\t\t\tuniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix;\n\t\t\tuniforms.pointShadowMap.value = lights.state.pointShadowMap;\n\t\t\tuniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;\n\t\t\t// TODO (abelnation): add area lights shadow info to uniforms\n\n\t\t}\n\n\t\tconst progUniforms = program.getUniforms();\n\t\tconst uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, uniforms );\n\n\t\tmaterialProperties.currentProgram = program;\n\t\tmaterialProperties.uniformsList = uniformsList;\n\n\t\treturn program;\n\n\t}\n\n\tfunction updateCommonMaterialProperties( material, parameters ) {\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tmaterialProperties.outputEncoding = parameters.outputEncoding;\n\t\tmaterialProperties.instancing = parameters.instancing;\n\t\tmaterialProperties.skinning = parameters.skinning;\n\t\tmaterialProperties.morphTargets = parameters.morphTargets;\n\t\tmaterialProperties.morphNormals = parameters.morphNormals;\n\t\tmaterialProperties.morphTargetsCount = parameters.morphTargetsCount;\n\t\tmaterialProperties.numClippingPlanes = parameters.numClippingPlanes;\n\t\tmaterialProperties.numIntersection = parameters.numClipIntersection;\n\t\tmaterialProperties.vertexAlphas = parameters.vertexAlphas;\n\t\tmaterialProperties.vertexTangents = parameters.vertexTangents;\n\t\tmaterialProperties.toneMapping = parameters.toneMapping;\n\n\t}\n\n\tfunction setProgram( camera, scene, geometry, material, object ) {\n\n\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\ttextures.resetTextureUnits();\n\n\t\tconst fog = scene.fog;\n\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\tconst encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.encoding : LinearEncoding );\n\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\t\tconst vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;\n\t\tconst vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;\n\t\tconst morphTargets = !! geometry.morphAttributes.position;\n\t\tconst morphNormals = !! geometry.morphAttributes.normal;\n\t\tconst morphTargetsCount = !! geometry.morphAttributes.position ? geometry.morphAttributes.position.length : 0;\n\t\tconst toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping;\n\n\t\tconst materialProperties = properties.get( material );\n\t\tconst lights = currentRenderState.state.lights;\n\n\t\tif ( _clippingEnabled === true ) {\n\n\t\t\tif ( _localClippingEnabled === true || camera !== _currentCamera ) {\n\n\t\t\t\tconst useCache =\n\t\t\t\t\tcamera === _currentCamera &&\n\t\t\t\t\tmaterial.id === _currentMaterialId;\n\n\t\t\t\t// we might want to call this function with some ClippingGroup\n\t\t\t\t// object instead of the material, once it becomes feasible\n\t\t\t\t// (#8465, #8379)\n\t\t\t\tclipping.setState( material, camera, useCache );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tlet needsProgramChange = false;\n\n\t\tif ( material.version === materialProperties.__version ) {\n\n\t\t\tif ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.outputEncoding !== encoding ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancing === false ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( ! object.isInstancedMesh && materialProperties.instancing === true ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( object.isSkinnedMesh && materialProperties.skinning === false ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( ! object.isSkinnedMesh && materialProperties.skinning === true ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.envMap !== envMap ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( material.fog && materialProperties.fog !== fog ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.numClippingPlanes !== undefined &&\n\t\t\t\t( materialProperties.numClippingPlanes !== clipping.numPlanes ||\n\t\t\t\tmaterialProperties.numIntersection !== clipping.numIntersection ) ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.vertexAlphas !== vertexAlphas ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.vertexTangents !== vertexTangents ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.morphTargets !== morphTargets ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.morphNormals !== morphNormals ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( materialProperties.toneMapping !== toneMapping ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t} else if ( capabilities.isWebGL2 === true && materialProperties.morphTargetsCount !== morphTargetsCount ) {\n\n\t\t\t\tneedsProgramChange = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tneedsProgramChange = true;\n\t\t\tmaterialProperties.__version = material.version;\n\n\t\t}\n\n\t\t//\n\n\t\tlet program = materialProperties.currentProgram;\n\n\t\tif ( needsProgramChange === true ) {\n\n\t\t\tprogram = getProgram( material, scene, object );\n\n\t\t}\n\n\t\tlet refreshProgram = false;\n\t\tlet refreshMaterial = false;\n\t\tlet refreshLights = false;\n\n\t\tconst p_uniforms = program.getUniforms(),\n\t\t\tm_uniforms = materialProperties.uniforms;\n\n\t\tif ( state.useProgram( program.program ) ) {\n\n\t\t\trefreshProgram = true;\n\t\t\trefreshMaterial = true;\n\t\t\trefreshLights = true;\n\n\t\t}\n\n\t\tif ( material.id !== _currentMaterialId ) {\n\n\t\t\t_currentMaterialId = material.id;\n\n\t\t\trefreshMaterial = true;\n\n\t\t}\n\n\t\tif ( refreshProgram || _currentCamera !== camera ) {\n\n\t\t\tp_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );\n\n\t\t\tif ( capabilities.logarithmicDepthBuffer ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'logDepthBufFC',\n\t\t\t\t\t2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );\n\n\t\t\t}\n\n\t\t\tif ( _currentCamera !== camera ) {\n\n\t\t\t\t_currentCamera = camera;\n\n\t\t\t\t// lighting uniforms depend on the camera so enforce an update\n\t\t\t\t// now, in case this material supports lights - or later, when\n\t\t\t\t// the next material that does gets activated:\n\n\t\t\t\trefreshMaterial = true;\t\t// set to true on material change\n\t\t\t\trefreshLights = true;\t\t// remains set until update done\n\n\t\t\t}\n\n\t\t\t// load material specific uniforms\n\t\t\t// (shader material also gets them for the sake of genericity)\n\n\t\t\tif ( material.isShaderMaterial ||\n\t\t\t\tmaterial.isMeshPhongMaterial ||\n\t\t\t\tmaterial.isMeshToonMaterial ||\n\t\t\t\tmaterial.isMeshStandardMaterial ||\n\t\t\t\tmaterial.envMap ) {\n\n\t\t\t\tconst uCamPos = p_uniforms.map.cameraPosition;\n\n\t\t\t\tif ( uCamPos !== undefined ) {\n\n\t\t\t\t\tuCamPos.setValue( _gl,\n\t\t\t\t\t\t_vector3.setFromMatrixPosition( camera.matrixWorld ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( material.isMeshPhongMaterial ||\n\t\t\t\tmaterial.isMeshToonMaterial ||\n\t\t\t\tmaterial.isMeshLambertMaterial ||\n\t\t\t\tmaterial.isMeshBasicMaterial ||\n\t\t\t\tmaterial.isMeshStandardMaterial ||\n\t\t\t\tmaterial.isShaderMaterial ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'isOrthographic', camera.isOrthographicCamera === true );\n\n\t\t\t}\n\n\t\t\tif ( material.isMeshPhongMaterial ||\n\t\t\t\tmaterial.isMeshToonMaterial ||\n\t\t\t\tmaterial.isMeshLambertMaterial ||\n\t\t\t\tmaterial.isMeshBasicMaterial ||\n\t\t\t\tmaterial.isMeshStandardMaterial ||\n\t\t\t\tmaterial.isShaderMaterial ||\n\t\t\t\tmaterial.isShadowMaterial ||\n\t\t\t\tobject.isSkinnedMesh ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// skinning and morph target uniforms must be set even if material didn't change\n\t\t// auto-setting of texture unit for bone and morph texture must go before other textures\n\t\t// otherwise textures used for skinning and morphing can take over texture units reserved for other material textures\n\n\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrix' );\n\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );\n\n\t\t\tconst skeleton = object.skeleton;\n\n\t\t\tif ( skeleton ) {\n\n\t\t\t\tif ( capabilities.floatVertexTextures ) {\n\n\t\t\t\t\tif ( skeleton.boneTexture === null ) skeleton.computeBoneTexture();\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures );\n\t\t\t\t\tp_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tp_uniforms.setOptional( _gl, skeleton, 'boneMatrices' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( !! geometry && ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) ) {\n\n\t\t\tmorphtargets.update( object, geometry, material, program );\n\n\t\t}\n\n\n\t\tif ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) {\n\n\t\t\tmaterialProperties.receiveShadow = object.receiveShadow;\n\t\t\tp_uniforms.setValue( _gl, 'receiveShadow', object.receiveShadow );\n\n\t\t}\n\n\t\tif ( refreshMaterial ) {\n\n\t\t\tp_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );\n\n\t\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t\t// the current material requires lighting info\n\n\t\t\t\t// note: all lighting uniforms are always set correctly\n\t\t\t\t// they simply reference the renderer's state for their\n\t\t\t\t// values\n\t\t\t\t//\n\t\t\t\t// use the current material's .needsUpdate flags to set\n\t\t\t\t// the GL state when required\n\n\t\t\t\tmarkUniformsLightsNeedsUpdate( m_uniforms, refreshLights );\n\n\t\t\t}\n\n\t\t\t// refresh uniforms common to several materials\n\n\t\t\tif ( fog && material.fog ) {\n\n\t\t\t\tmaterials.refreshFogUniforms( m_uniforms, fog );\n\n\t\t\t}\n\n\t\t\tmaterials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height, _transmissionRenderTarget );\n\n\t\t\tWebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures );\n\n\t\t}\n\n\t\tif ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) {\n\n\t\t\tWebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures );\n\t\t\tmaterial.uniformsNeedUpdate = false;\n\n\t\t}\n\n\t\tif ( material.isSpriteMaterial ) {\n\n\t\t\tp_uniforms.setValue( _gl, 'center', object.center );\n\n\t\t}\n\n\t\t// common matrices\n\n\t\tp_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );\n\t\tp_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );\n\t\tp_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );\n\n\t\treturn program;\n\n\t}\n\n\t// If uniforms are marked as clean, they don't need to be loaded to the GPU.\n\n\tfunction markUniformsLightsNeedsUpdate( uniforms, value ) {\n\n\t\tuniforms.ambientLightColor.needsUpdate = value;\n\t\tuniforms.lightProbe.needsUpdate = value;\n\n\t\tuniforms.directionalLights.needsUpdate = value;\n\t\tuniforms.directionalLightShadows.needsUpdate = value;\n\t\tuniforms.pointLights.needsUpdate = value;\n\t\tuniforms.pointLightShadows.needsUpdate = value;\n\t\tuniforms.spotLights.needsUpdate = value;\n\t\tuniforms.spotLightShadows.needsUpdate = value;\n\t\tuniforms.rectAreaLights.needsUpdate = value;\n\t\tuniforms.hemisphereLights.needsUpdate = value;\n\n\t}\n\n\tfunction materialNeedsLights( material ) {\n\n\t\treturn material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial ||\n\t\t\tmaterial.isMeshStandardMaterial || material.isShadowMaterial ||\n\t\t\t( material.isShaderMaterial && material.lights === true );\n\n\t}\n\n\tthis.getActiveCubeFace = function () {\n\n\t\treturn _currentActiveCubeFace;\n\n\t};\n\n\tthis.getActiveMipmapLevel = function () {\n\n\t\treturn _currentActiveMipmapLevel;\n\n\t};\n\n\tthis.getRenderTarget = function () {\n\n\t\treturn _currentRenderTarget;\n\n\t};\n\n\tthis.setRenderTargetTextures = function ( renderTarget, colorTexture, depthTexture ) {\n\n\t\tproperties.get( renderTarget.texture ).__webglTexture = colorTexture;\n\t\tproperties.get( renderTarget.depthTexture ).__webglTexture = depthTexture;\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\trenderTargetProperties.__hasExternalTextures = true;\n\n\t\tif ( renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\trenderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined;\n\n\t\t\tif ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\t\t// The multisample_render_to_texture extension doesn't work properly if there\n\t\t\t\t// are midframe flushes and an external depth buffer. Disable use of the extension.\n\t\t\t\tif ( renderTarget.useRenderToTexture ) {\n\n\t\t\t\t\tconsole.warn( 'render-to-texture extension was disabled because an external texture was provided' );\n\t\t\t\t\trenderTarget.useRenderToTexture = false;\n\t\t\t\t\trenderTarget.useRenderbuffer = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\trenderTargetProperties.__webglFramebuffer = defaultFramebuffer;\n\t\trenderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;\n\n\t};\n\n\tthis.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {\n\n\t\t_currentRenderTarget = renderTarget;\n\t\t_currentActiveCubeFace = activeCubeFace;\n\t\t_currentActiveMipmapLevel = activeMipmapLevel;\n\t\tlet useDefaultFramebuffer = true;\n\n\t\tif ( renderTarget ) {\n\n\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tif ( renderTargetProperties.__useDefaultFramebuffer !== undefined ) {\n\n\t\t\t\t// We need to make sure to rebind the framebuffer.\n\t\t\t\tstate.bindFramebuffer( 36160, null );\n\t\t\t\tuseDefaultFramebuffer = false;\n\n\t\t\t} else if ( renderTargetProperties.__webglFramebuffer === undefined ) {\n\n\t\t\t\ttextures.setupRenderTarget( renderTarget );\n\n\t\t\t} else if ( renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\t\t// Color and depth texture must be rebound in order for the swapchain to update.\n\t\t\t\ttextures.rebindTextures( renderTarget, properties.get( renderTarget.texture ).__webglTexture, properties.get( renderTarget.depthTexture ).__webglTexture );\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet framebuffer = null;\n\t\tlet isCube = false;\n\t\tlet isRenderTarget3D = false;\n\n\t\tif ( renderTarget ) {\n\n\t\t\tconst texture = renderTarget.texture;\n\n\t\t\tif ( texture.isDataTexture3D || texture.isDataTexture2DArray ) {\n\n\t\t\t\tisRenderTarget3D = true;\n\n\t\t\t}\n\n\t\t\tconst __webglFramebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\t\tframebuffer = __webglFramebuffer[ activeCubeFace ];\n\t\t\t\tisCube = true;\n\n\t\t\t} else if ( renderTarget.useRenderbuffer ) {\n\n\t\t\t\tframebuffer = properties.get( renderTarget ).__webglMultisampledFramebuffer;\n\n\t\t\t} else {\n\n\t\t\t\tframebuffer = __webglFramebuffer;\n\n\t\t\t}\n\n\t\t\t_currentViewport.copy( renderTarget.viewport );\n\t\t\t_currentScissor.copy( renderTarget.scissor );\n\t\t\t_currentScissorTest = renderTarget.scissorTest;\n\n\t\t} else {\n\n\t\t\t_currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t_currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t_currentScissorTest = _scissorTest;\n\n\t\t}\n\n\t\tconst framebufferBound = state.bindFramebuffer( 36160, framebuffer );\n\n\t\tif ( framebufferBound && capabilities.drawBuffers && useDefaultFramebuffer ) {\n\n\t\t\tstate.drawBuffers( renderTarget, framebuffer );\n\n\t\t}\n\n\t\tstate.viewport( _currentViewport );\n\t\tstate.scissor( _currentScissor );\n\t\tstate.setScissorTest( _currentScissorTest );\n\n\t\tif ( isCube ) {\n\n\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\t_gl.framebufferTexture2D( 36160, 36064, 34069 + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel );\n\n\t\t} else if ( isRenderTarget3D ) {\n\n\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\tconst layer = activeCubeFace || 0;\n\t\t\t_gl.framebufferTextureLayer( 36160, 36064, textureProperties.__webglTexture, activeMipmapLevel || 0, layer );\n\n\t\t}\n\n\t\t_currentMaterialId = - 1; // reset current material to ensure correct uniform bindings\n\n\t};\n\n\tthis.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex ) {\n\n\t\tif ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tlet framebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\tif ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) {\n\n\t\t\tframebuffer = framebuffer[ activeCubeFaceIndex ];\n\n\t\t}\n\n\t\tif ( framebuffer ) {\n\n\t\t\tstate.bindFramebuffer( 36160, framebuffer );\n\n\t\t\ttry {\n\n\t\t\t\tconst texture = renderTarget.texture;\n\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\tif ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== _gl.getParameter( 35739 ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tconst halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || ( capabilities.isWebGL2 && extensions.has( 'EXT_color_buffer_float' ) ) );\n\n\t\t\t\tif ( textureType !== UnsignedByteType && utils.convert( textureType ) !== _gl.getParameter( 35738 ) && // Edge and Chrome Mac < 52 (#9513)\n\t\t\t\t\t! ( textureType === FloatType && ( capabilities.isWebGL2 || extensions.has( 'OES_texture_float' ) || extensions.has( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox\n\t\t\t\t\t! halfFloatSupportedByExt ) {\n\n\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( _gl.checkFramebufferStatus( 36160 ) === 36053 ) {\n\n\t\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\n\t\t\t\t\tif ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {\n\n\t\t\t\t\t\t_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' );\n\n\t\t\t\t}\n\n\t\t\t} finally {\n\n\t\t\t\t// restore framebuffer of current render target if necessary\n\n\t\t\t\tconst framebuffer = ( _currentRenderTarget !== null ) ? properties.get( _currentRenderTarget ).__webglFramebuffer : null;\n\t\t\t\tstate.bindFramebuffer( 36160, framebuffer );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.copyFramebufferToTexture = function ( position, texture, level = 0 ) {\n\n\t\tif ( texture.isFramebufferTexture !== true ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst levelScale = Math.pow( 2, - level );\n\t\tconst width = Math.floor( texture.image.width * levelScale );\n\t\tconst height = Math.floor( texture.image.height * levelScale );\n\n\t\ttextures.setTexture2D( texture, 0 );\n\n\t\t_gl.copyTexSubImage2D( 3553, level, 0, 0, position.x, position.y, width, height );\n\n\t\tstate.unbindTexture();\n\n\t};\n\n\tthis.copyTextureToTexture = function ( position, srcTexture, dstTexture, level = 0 ) {\n\n\t\tconst width = srcTexture.image.width;\n\t\tconst height = srcTexture.image.height;\n\t\tconst glFormat = utils.convert( dstTexture.format );\n\t\tconst glType = utils.convert( dstTexture.type );\n\n\t\ttextures.setTexture2D( dstTexture, 0 );\n\n\t\t// As another texture upload may have changed pixelStorei\n\t\t// parameters, make sure they are correct for the dstTexture\n\t\t_gl.pixelStorei( 37440, dstTexture.flipY );\n\t\t_gl.pixelStorei( 37441, dstTexture.premultiplyAlpha );\n\t\t_gl.pixelStorei( 3317, dstTexture.unpackAlignment );\n\n\t\tif ( srcTexture.isDataTexture ) {\n\n\t\t\t_gl.texSubImage2D( 3553, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );\n\n\t\t} else {\n\n\t\t\tif ( srcTexture.isCompressedTexture ) {\n\n\t\t\t\t_gl.compressedTexSubImage2D( 3553, level, position.x, position.y, srcTexture.mipmaps[ 0 ].width, srcTexture.mipmaps[ 0 ].height, glFormat, srcTexture.mipmaps[ 0 ].data );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.texSubImage2D( 3553, level, position.x, position.y, glFormat, glType, srcTexture.image );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Generate mipmaps only when copying level 0\n\t\tif ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( 3553 );\n\n\t\tstate.unbindTexture();\n\n\t};\n\n\tthis.copyTextureToTexture3D = function ( sourceBox, position, srcTexture, dstTexture, level = 0 ) {\n\n\t\tif ( _this.isWebGL1Renderer ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst width = sourceBox.max.x - sourceBox.min.x + 1;\n\t\tconst height = sourceBox.max.y - sourceBox.min.y + 1;\n\t\tconst depth = sourceBox.max.z - sourceBox.min.z + 1;\n\t\tconst glFormat = utils.convert( dstTexture.format );\n\t\tconst glType = utils.convert( dstTexture.type );\n\t\tlet glTarget;\n\n\t\tif ( dstTexture.isDataTexture3D ) {\n\n\t\t\ttextures.setTexture3D( dstTexture, 0 );\n\t\t\tglTarget = 32879;\n\n\t\t} else if ( dstTexture.isDataTexture2DArray ) {\n\n\t\t\ttextures.setTexture2DArray( dstTexture, 0 );\n\t\t\tglTarget = 35866;\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\t_gl.pixelStorei( 37440, dstTexture.flipY );\n\t\t_gl.pixelStorei( 37441, dstTexture.premultiplyAlpha );\n\t\t_gl.pixelStorei( 3317, dstTexture.unpackAlignment );\n\n\t\tconst unpackRowLen = _gl.getParameter( 3314 );\n\t\tconst unpackImageHeight = _gl.getParameter( 32878 );\n\t\tconst unpackSkipPixels = _gl.getParameter( 3316 );\n\t\tconst unpackSkipRows = _gl.getParameter( 3315 );\n\t\tconst unpackSkipImages = _gl.getParameter( 32877 );\n\n\t\tconst image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ 0 ] : srcTexture.image;\n\n\t\t_gl.pixelStorei( 3314, image.width );\n\t\t_gl.pixelStorei( 32878, image.height );\n\t\t_gl.pixelStorei( 3316, sourceBox.min.x );\n\t\t_gl.pixelStorei( 3315, sourceBox.min.y );\n\t\t_gl.pixelStorei( 32877, sourceBox.min.z );\n\n\t\tif ( srcTexture.isDataTexture || srcTexture.isDataTexture3D ) {\n\n\t\t\t_gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data );\n\n\t\t} else {\n\n\t\t\tif ( srcTexture.isCompressedTexture ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );\n\t\t\t\t_gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.pixelStorei( 3314, unpackRowLen );\n\t\t_gl.pixelStorei( 32878, unpackImageHeight );\n\t\t_gl.pixelStorei( 3316, unpackSkipPixels );\n\t\t_gl.pixelStorei( 3315, unpackSkipRows );\n\t\t_gl.pixelStorei( 32877, unpackSkipImages );\n\n\t\t// Generate mipmaps only when copying level 0\n\t\tif ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( glTarget );\n\n\t\tstate.unbindTexture();\n\n\t};\n\n\tthis.initTexture = function ( texture ) {\n\n\t\ttextures.setTexture2D( texture, 0 );\n\n\t\tstate.unbindTexture();\n\n\t};\n\n\tthis.resetState = function () {\n\n\t\t_currentActiveCubeFace = 0;\n\t\t_currentActiveMipmapLevel = 0;\n\t\t_currentRenderTarget = null;\n\n\t\tstate.reset();\n\t\tbindingStates.reset();\n\n\t};\n\n\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t}\n\n}\n\nWebGLRenderer.prototype.isWebGLRenderer = true;\n\nclass WebGL1Renderer extends WebGLRenderer {}\n\nWebGL1Renderer.prototype.isWebGL1Renderer = true;\n\nclass FogExp2 {\n\n\tconstructor( color, density = 0.00025 ) {\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\t\tthis.density = density;\n\n\t}\n\n\tclone() {\n\n\t\treturn new FogExp2( this.color, this.density );\n\n\t}\n\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'FogExp2',\n\t\t\tcolor: this.color.getHex(),\n\t\t\tdensity: this.density\n\t\t};\n\n\t}\n\n}\n\nFogExp2.prototype.isFogExp2 = true;\n\nclass Fog {\n\n\tconstructor( color, near = 1, far = 1000 ) {\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Fog( this.color, this.near, this.far );\n\n\t}\n\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'Fog',\n\t\t\tcolor: this.color.getHex(),\n\t\t\tnear: this.near,\n\t\t\tfar: this.far\n\t\t};\n\n\t}\n\n}\n\nFog.prototype.isFog = true;\n\nclass Scene extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'Scene';\n\n\t\tthis.background = null;\n\t\tthis.environment = null;\n\t\tthis.fog = null;\n\n\t\tthis.overrideMaterial = null;\n\n\t\tthis.autoUpdate = true; // checked by the renderer\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.background !== null ) this.background = source.background.clone();\n\t\tif ( source.environment !== null ) this.environment = source.environment.clone();\n\t\tif ( source.fog !== null ) this.fog = source.fog.clone();\n\n\t\tif ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.fog !== null ) data.object.fog = this.fog.toJSON();\n\n\t\treturn data;\n\n\t}\n\n}\n\nScene.prototype.isScene = true;\n\nclass InterleavedBuffer {\n\n\tconstructor( array, stride ) {\n\n\t\tthis.array = array;\n\t\tthis.stride = stride;\n\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis.updateRange = { offset: 0, count: - 1 };\n\n\t\tthis.version = 0;\n\n\t\tthis.uuid = generateUUID();\n\n\t}\n\n\tonUploadCallback() {}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.count = source.count;\n\t\tthis.stride = source.stride;\n\t\tthis.usage = source.usage;\n\n\t\treturn this;\n\n\t}\n\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.stride;\n\t\tindex2 *= attribute.stride;\n\n\t\tfor ( let i = 0, l = this.stride; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tset( value, offset = 0 ) {\n\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer;\n\n\t\t}\n\n\t\tconst array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] );\n\n\t\tconst ib = new this.constructor( array, this.stride );\n\t\tib.setUsage( this.usage );\n\n\t\treturn ib;\n\n\t}\n\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\t// generate UUID for array buffer if necessary\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = Array.prototype.slice.call( new Uint32Array( this.array.buffer ) );\n\n\t\t}\n\n\t\t//\n\n\t\treturn {\n\t\t\tuuid: this.uuid,\n\t\t\tbuffer: this.array.buffer._uuid,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tstride: this.stride\n\t\t};\n\n\t}\n\n}\n\nInterleavedBuffer.prototype.isInterleavedBuffer = true;\n\nconst _vector$6 = /*@__PURE__*/ new Vector3();\n\nclass InterleavedBufferAttribute {\n\n\tconstructor( interleavedBuffer, itemSize, offset, normalized = false ) {\n\n\t\tthis.name = '';\n\n\t\tthis.data = interleavedBuffer;\n\t\tthis.itemSize = itemSize;\n\t\tthis.offset = offset;\n\n\t\tthis.normalized = normalized === true;\n\n\t}\n\n\tget count() {\n\n\t\treturn this.data.count;\n\n\t}\n\n\tget array() {\n\n\t\treturn this.data.array;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tthis.data.needsUpdate = value;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.data.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.x = this.getX( i );\n\t\t\t_vector$6.y = this.getY( i );\n\t\t\t_vector$6.z = this.getZ( i );\n\n\t\t\t_vector$6.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.x = this.getX( i );\n\t\t\t_vector$6.y = this.getY( i );\n\t\t\t_vector$6.z = this.getZ( i );\n\n\t\t\t_vector$6.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.x = this.getX( i );\n\t\t\t_vector$6.y = this.getY( i );\n\t\t\t_vector$6.z = this.getZ( i );\n\n\t\t\t_vector$6.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tthis.data.array[ index * this.data.stride + this.offset ] = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tgetX( index ) {\n\n\t\treturn this.data.array[ index * this.data.stride + this.offset ];\n\n\t}\n\n\tgetY( index ) {\n\n\t\treturn this.data.array[ index * this.data.stride + this.offset + 1 ];\n\n\t}\n\n\tgetZ( index ) {\n\n\t\treturn this.data.array[ index * this.data.stride + this.offset + 2 ];\n\n\t}\n\n\tgetW( index ) {\n\n\t\treturn this.data.array[ index * this.data.stride + this.offset + 3 ];\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\t\tthis.data.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( new this.array.constructor( array ), this.itemSize, this.normalized );\n\n\t\t} else {\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.clone( data );\n\n\t\t\t}\n\n\t\t\treturn new InterleavedBufferAttribute( data.interleavedBuffers[ this.data.uuid ], this.itemSize, this.offset, this.normalized );\n\n\t\t}\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// deinterleave data and save it as an ordinary buffer attribute for now\n\n\t\t\treturn {\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tarray: array,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t} else {\n\n\t\t\t// save as true interlaved attribtue\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.toJSON( data );\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisInterleavedBufferAttribute: true,\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\tdata: this.data.uuid,\n\t\t\t\toffset: this.offset,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t}\n\n\t}\n\n}\n\nInterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;\n\n/**\n * parameters = {\n * color: ,\n * map: new THREE.Texture( ),\n * alphaMap: new THREE.Texture( ),\n * rotation: ,\n * sizeAttenuation: \n * }\n */\n\nclass SpriteMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SpriteMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.rotation = 0;\n\n\t\tthis.sizeAttenuation = true;\n\n\t\tthis.transparent = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\treturn this;\n\n\t}\n\n}\n\nSpriteMaterial.prototype.isSpriteMaterial = true;\n\nlet _geometry;\n\nconst _intersectPoint = /*@__PURE__*/ new Vector3();\nconst _worldScale = /*@__PURE__*/ new Vector3();\nconst _mvPosition = /*@__PURE__*/ new Vector3();\n\nconst _alignedPosition = /*@__PURE__*/ new Vector2();\nconst _rotatedPosition = /*@__PURE__*/ new Vector2();\nconst _viewWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _vA = /*@__PURE__*/ new Vector3();\nconst _vB = /*@__PURE__*/ new Vector3();\nconst _vC = /*@__PURE__*/ new Vector3();\n\nconst _uvA = /*@__PURE__*/ new Vector2();\nconst _uvB = /*@__PURE__*/ new Vector2();\nconst _uvC = /*@__PURE__*/ new Vector2();\n\nclass Sprite extends Object3D {\n\n\tconstructor( material ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Sprite';\n\n\t\tif ( _geometry === undefined ) {\n\n\t\t\t_geometry = new BufferGeometry();\n\n\t\t\tconst float32Array = new Float32Array( [\n\t\t\t\t- 0.5, - 0.5, 0, 0, 0,\n\t\t\t\t0.5, - 0.5, 0, 1, 0,\n\t\t\t\t0.5, 0.5, 0, 1, 1,\n\t\t\t\t- 0.5, 0.5, 0, 0, 1\n\t\t\t] );\n\n\t\t\tconst interleavedBuffer = new InterleavedBuffer( float32Array, 5 );\n\n\t\t\t_geometry.setIndex( [ 0, 1, 2,\t0, 2, 3 ] );\n\t\t\t_geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) );\n\t\t\t_geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) );\n\n\t\t}\n\n\t\tthis.geometry = _geometry;\n\t\tthis.material = ( material !== undefined ) ? material : new SpriteMaterial();\n\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tif ( raycaster.camera === null ) {\n\n\t\t\tconsole.error( 'THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.' );\n\n\t\t}\n\n\t\t_worldScale.setFromMatrixScale( this.matrixWorld );\n\n\t\t_viewWorldMatrix.copy( raycaster.camera.matrixWorld );\n\t\tthis.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld );\n\n\t\t_mvPosition.setFromMatrixPosition( this.modelViewMatrix );\n\n\t\tif ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {\n\n\t\t\t_worldScale.multiplyScalar( - _mvPosition.z );\n\n\t\t}\n\n\t\tconst rotation = this.material.rotation;\n\t\tlet sin, cos;\n\n\t\tif ( rotation !== 0 ) {\n\n\t\t\tcos = Math.cos( rotation );\n\t\t\tsin = Math.sin( rotation );\n\n\t\t}\n\n\t\tconst center = this.center;\n\n\t\ttransformVertex( _vA.set( - 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vB.set( 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\n\t\t_uvA.set( 0, 0 );\n\t\t_uvB.set( 1, 0 );\n\t\t_uvC.set( 1, 1 );\n\n\t\t// check first triangle\n\t\tlet intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint );\n\n\t\tif ( intersect === null ) {\n\n\t\t\t// check second triangle\n\t\t\ttransformVertex( _vB.set( - 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\t\t_uvB.set( 0, 1 );\n\n\t\t\tintersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint );\n\t\t\tif ( intersect === null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( _intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tpoint: _intersectPoint.clone(),\n\t\t\tuv: Triangle.getUV( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ),\n\t\t\tface: null,\n\t\t\tobject: this\n\n\t\t} );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tif ( source.center !== undefined ) this.center.copy( source.center );\n\n\t\tthis.material = source.material;\n\n\t\treturn this;\n\n\t}\n\n}\n\nSprite.prototype.isSprite = true;\n\nfunction transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) {\n\n\t// compute position in camera space\n\t_alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale );\n\n\t// to check if rotation is not zero\n\tif ( sin !== undefined ) {\n\n\t\t_rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y );\n\t\t_rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y );\n\n\t} else {\n\n\t\t_rotatedPosition.copy( _alignedPosition );\n\n\t}\n\n\n\tvertexPosition.copy( mvPosition );\n\tvertexPosition.x += _rotatedPosition.x;\n\tvertexPosition.y += _rotatedPosition.y;\n\n\t// transform to world space\n\tvertexPosition.applyMatrix4( _viewWorldMatrix );\n\n}\n\nconst _v1$2 = /*@__PURE__*/ new Vector3();\nconst _v2$1 = /*@__PURE__*/ new Vector3();\n\nclass LOD extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis._currentLevel = 0;\n\n\t\tthis.type = 'LOD';\n\n\t\tObject.defineProperties( this, {\n\t\t\tlevels: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tisLOD: {\n\t\t\t\tvalue: true,\n\t\t\t}\n\t\t} );\n\n\t\tthis.autoUpdate = true;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tconst levels = source.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tthis.addLevel( level.object.clone(), level.distance );\n\n\t\t}\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\taddLevel( object, distance = 0 ) {\n\n\t\tdistance = Math.abs( distance );\n\n\t\tconst levels = this.levels;\n\n\t\tlet l;\n\n\t\tfor ( l = 0; l < levels.length; l ++ ) {\n\n\t\t\tif ( distance < levels[ l ].distance ) {\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlevels.splice( l, 0, { distance: distance, object: object } );\n\n\t\tthis.add( object );\n\n\t\treturn this;\n\n\t}\n\n\tgetCurrentLevel() {\n\n\t\treturn this._currentLevel;\n\n\t}\n\n\tgetObjectForDistance( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tif ( distance < levels[ i ].distance ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn levels[ i - 1 ].object;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = raycaster.ray.origin.distanceTo( _v1$2 );\n\n\t\t\tthis.getObjectForDistance( distance ).raycast( raycaster, intersects );\n\n\t\t}\n\n\t}\n\n\tupdate( camera ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 1 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( camera.matrixWorld );\n\t\t\t_v2$1.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = _v1$2.distanceTo( _v2$1 ) / camera.zoom;\n\n\t\t\tlevels[ 0 ].object.visible = true;\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tif ( distance >= levels[ i ].distance ) {\n\n\t\t\t\t\tlevels[ i - 1 ].object.visible = false;\n\t\t\t\t\tlevels[ i ].object.visible = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._currentLevel = i - 1;\n\n\t\t\tfor ( ; i < l; i ++ ) {\n\n\t\t\t\tlevels[ i ].object.visible = false;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.autoUpdate === false ) data.object.autoUpdate = false;\n\n\t\tdata.object.levels = [];\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tdata.object.levels.push( {\n\t\t\t\tobject: level.object.uuid,\n\t\t\t\tdistance: level.distance\n\t\t\t} );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _basePosition = /*@__PURE__*/ new Vector3();\n\nconst _skinIndex = /*@__PURE__*/ new Vector4();\nconst _skinWeight = /*@__PURE__*/ new Vector4();\n\nconst _vector$5 = /*@__PURE__*/ new Vector3();\nconst _matrix = /*@__PURE__*/ new Matrix4();\n\nclass SkinnedMesh extends Mesh {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'SkinnedMesh';\n\n\t\tthis.bindMode = 'attached';\n\t\tthis.bindMatrix = new Matrix4();\n\t\tthis.bindMatrixInverse = new Matrix4();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.bindMode = source.bindMode;\n\t\tthis.bindMatrix.copy( source.bindMatrix );\n\t\tthis.bindMatrixInverse.copy( source.bindMatrixInverse );\n\n\t\tthis.skeleton = source.skeleton;\n\n\t\treturn this;\n\n\t}\n\n\tbind( skeleton, bindMatrix ) {\n\n\t\tthis.skeleton = skeleton;\n\n\t\tif ( bindMatrix === undefined ) {\n\n\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\tthis.skeleton.calculateInverses();\n\n\t\t\tbindMatrix = this.matrixWorld;\n\n\t\t}\n\n\t\tthis.bindMatrix.copy( bindMatrix );\n\t\tthis.bindMatrixInverse.copy( bindMatrix ).invert();\n\n\t}\n\n\tpose() {\n\n\t\tthis.skeleton.pose();\n\n\t}\n\n\tnormalizeSkinWeights() {\n\n\t\tconst vector = new Vector4();\n\n\t\tconst skinWeight = this.geometry.attributes.skinWeight;\n\n\t\tfor ( let i = 0, l = skinWeight.count; i < l; i ++ ) {\n\n\t\t\tvector.x = skinWeight.getX( i );\n\t\t\tvector.y = skinWeight.getY( i );\n\t\t\tvector.z = skinWeight.getZ( i );\n\t\t\tvector.w = skinWeight.getW( i );\n\n\t\t\tconst scale = 1.0 / vector.manhattanLength();\n\n\t\t\tif ( scale !== Infinity ) {\n\n\t\t\t\tvector.multiplyScalar( scale );\n\n\t\t\t} else {\n\n\t\t\t\tvector.set( 1, 0, 0, 0 ); // do something reasonable\n\n\t\t\t}\n\n\t\t\tskinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w );\n\n\t\t}\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.bindMode === 'attached' ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.matrixWorld ).invert();\n\n\t\t} else if ( this.bindMode === 'detached' ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.bindMatrix ).invert();\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );\n\n\t\t}\n\n\t}\n\n\tboneTransform( index, target ) {\n\n\t\tconst skeleton = this.skeleton;\n\t\tconst geometry = this.geometry;\n\n\t\t_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );\n\t\t_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );\n\n\t\t_basePosition.copy( target ).applyMatrix4( this.bindMatrix );\n\n\t\ttarget.set( 0, 0, 0 );\n\n\t\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\t\tconst weight = _skinWeight.getComponent( i );\n\n\t\t\tif ( weight !== 0 ) {\n\n\t\t\t\tconst boneIndex = _skinIndex.getComponent( i );\n\n\t\t\t\t_matrix.multiplyMatrices( skeleton.bones[ boneIndex ].matrixWorld, skeleton.boneInverses[ boneIndex ] );\n\n\t\t\t\ttarget.addScaledVector( _vector$5.copy( _basePosition ).applyMatrix4( _matrix ), weight );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn target.applyMatrix4( this.bindMatrixInverse );\n\n\t}\n\n}\n\nSkinnedMesh.prototype.isSkinnedMesh = true;\n\nclass Bone extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'Bone';\n\n\t}\n\n}\n\nBone.prototype.isBone = true;\n\nclass DataTexture extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );\n\n\t\tthis.image = { data: data, width: width, height: height };\n\n\t\tthis.magFilter = magFilter;\n\t\tthis.minFilter = minFilter;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nDataTexture.prototype.isDataTexture = true;\n\nconst _offsetMatrix = /*@__PURE__*/ new Matrix4();\nconst _identityMatrix = /*@__PURE__*/ new Matrix4();\n\nclass Skeleton {\n\n\tconstructor( bones = [], boneInverses = [] ) {\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.bones = bones.slice( 0 );\n\t\tthis.boneInverses = boneInverses;\n\t\tthis.boneMatrices = null;\n\n\t\tthis.boneTexture = null;\n\t\tthis.boneTextureSize = 0;\n\n\t\tthis.frame = - 1;\n\n\t\tthis.init();\n\n\t}\n\n\tinit() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tthis.boneMatrices = new Float32Array( bones.length * 16 );\n\n\t\t// calculate inverse bone matrices if necessary\n\n\t\tif ( boneInverses.length === 0 ) {\n\n\t\t\tthis.calculateInverses();\n\n\t\t} else {\n\n\t\t\t// handle special case\n\n\t\t\tif ( bones.length !== boneInverses.length ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' );\n\n\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\t\t\tthis.boneInverses.push( new Matrix4() );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcalculateInverses() {\n\n\t\tthis.boneInverses.length = 0;\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst inverse = new Matrix4();\n\n\t\t\tif ( this.bones[ i ] ) {\n\n\t\t\t\tinverse.copy( this.bones[ i ].matrixWorld ).invert();\n\n\t\t\t}\n\n\t\t\tthis.boneInverses.push( inverse );\n\n\t\t}\n\n\t}\n\n\tpose() {\n\n\t\t// recover the bind-time world matrices\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tbone.matrixWorld.copy( this.boneInverses[ i ] ).invert();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// compute the local matrices, positions, rotations and scales\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t\tbone.matrix.copy( bone.parent.matrixWorld ).invert();\n\t\t\t\t\tbone.matrix.multiply( bone.matrixWorld );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbone.matrix.copy( bone.matrixWorld );\n\n\t\t\t\t}\n\n\t\t\t\tbone.matrix.decompose( bone.position, bone.quaternion, bone.scale );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\t\tconst boneMatrices = this.boneMatrices;\n\t\tconst boneTexture = this.boneTexture;\n\n\t\t// flatten bone matrices to array\n\n\t\tfor ( let i = 0, il = bones.length; i < il; i ++ ) {\n\n\t\t\t// compute the offset between the current and the original transform\n\n\t\t\tconst matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix;\n\n\t\t\t_offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] );\n\t\t\t_offsetMatrix.toArray( boneMatrices, i * 16 );\n\n\t\t}\n\n\t\tif ( boneTexture !== null ) {\n\n\t\t\tboneTexture.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new Skeleton( this.bones, this.boneInverses );\n\n\t}\n\n\tcomputeBoneTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t// with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8)\n\t\t// 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16)\n\t\t// 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32)\n\t\t// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = ceilPowerOfTwo( size );\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tboneMatrices.set( this.boneMatrices ); // copy current values\n\n\t\tconst boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType );\n\t\tboneTexture.needsUpdate = true;\n\n\t\tthis.boneMatrices = boneMatrices;\n\t\tthis.boneTexture = boneTexture;\n\t\tthis.boneTextureSize = size;\n\n\t\treturn this;\n\n\t}\n\n\tgetBoneByName( name ) {\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone.name === name ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\tdispose( ) {\n\n\t\tif ( this.boneTexture !== null ) {\n\n\t\t\tthis.boneTexture.dispose();\n\n\t\t\tthis.boneTexture = null;\n\n\t\t}\n\n\t}\n\n\tfromJSON( json, bones ) {\n\n\t\tthis.uuid = json.uuid;\n\n\t\tfor ( let i = 0, l = json.bones.length; i < l; i ++ ) {\n\n\t\t\tconst uuid = json.bones[ i ];\n\t\t\tlet bone = bones[ uuid ];\n\n\t\t\tif ( bone === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: No bone found with UUID:', uuid );\n\t\t\t\tbone = new Bone();\n\n\t\t\t}\n\n\t\t\tthis.bones.push( bone );\n\t\t\tthis.boneInverses.push( new Matrix4().fromArray( json.boneInverses[ i ] ) );\n\n\t\t}\n\n\t\tthis.init();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.5,\n\t\t\t\ttype: 'Skeleton',\n\t\t\t\tgenerator: 'Skeleton.toJSON'\n\t\t\t},\n\t\t\tbones: [],\n\t\t\tboneInverses: []\n\t\t};\n\n\t\tdata.uuid = this.uuid;\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tfor ( let i = 0, l = bones.length; i < l; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\t\t\tdata.bones.push( bone.uuid );\n\n\t\t\tconst boneInverse = boneInverses[ i ];\n\t\t\tdata.boneInverses.push( boneInverse.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass InstancedBufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized, meshPerAttribute = 1 ) {\n\n\t\tif ( typeof normalized === 'number' ) {\n\n\t\t\tmeshPerAttribute = normalized;\n\n\t\t\tnormalized = false;\n\n\t\t\tconsole.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' );\n\n\t\t}\n\n\t\tsuper( array, itemSize, normalized );\n\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.meshPerAttribute = this.meshPerAttribute;\n\n\t\tdata.isInstancedBufferAttribute = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nInstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;\n\nconst _instanceLocalMatrix = /*@__PURE__*/ new Matrix4();\nconst _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _instanceIntersects = [];\n\nconst _mesh = /*@__PURE__*/ new Mesh();\n\nclass InstancedMesh extends Mesh {\n\n\tconstructor( geometry, material, count ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );\n\t\tthis.instanceColor = null;\n\n\t\tthis.count = count;\n\n\t\tthis.frustumCulled = false;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.instanceMatrix.copy( source.instanceMatrix );\n\n\t\tif ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();\n\n\t\tthis.count = source.count;\n\n\t\treturn this;\n\n\t}\n\n\tgetColorAt( index, color ) {\n\n\t\tcolor.fromArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\tgetMatrixAt( index, matrix ) {\n\n\t\tmatrix.fromArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst raycastTimes = this.count;\n\n\t\t_mesh.geometry = this.geometry;\n\t\t_mesh.material = this.material;\n\n\t\tif ( _mesh.material === undefined ) return;\n\n\t\tfor ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) {\n\n\t\t\t// calculate the world matrix for each instance\n\n\t\t\tthis.getMatrixAt( instanceId, _instanceLocalMatrix );\n\n\t\t\t_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );\n\n\t\t\t// the mesh represents this single instance\n\n\t\t\t_mesh.matrixWorld = _instanceWorldMatrix;\n\n\t\t\t_mesh.raycast( raycaster, _instanceIntersects );\n\n\t\t\t// process the result of raycast\n\n\t\t\tfor ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) {\n\n\t\t\t\tconst intersect = _instanceIntersects[ i ];\n\t\t\t\tintersect.instanceId = instanceId;\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_instanceIntersects.length = 0;\n\n\t\t}\n\n\t}\n\n\tsetColorAt( index, color ) {\n\n\t\tif ( this.instanceColor === null ) {\n\n\t\t\tthis.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ), 3 );\n\n\t\t}\n\n\t\tcolor.toArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\tsetMatrixAt( index, matrix ) {\n\n\t\tmatrix.toArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nInstancedMesh.prototype.isInstancedMesh = true;\n\n/**\n * parameters = {\n * color: ,\n * opacity: ,\n *\n * linewidth: ,\n * linecap: \"round\",\n * linejoin: \"round\"\n * }\n */\n\nclass LineBasicMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LineBasicMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.linewidth = 1;\n\t\tthis.linecap = 'round';\n\t\tthis.linejoin = 'round';\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.linewidth = source.linewidth;\n\t\tthis.linecap = source.linecap;\n\t\tthis.linejoin = source.linejoin;\n\n\t\treturn this;\n\n\t}\n\n}\n\nLineBasicMaterial.prototype.isLineBasicMaterial = true;\n\nconst _start$1 = /*@__PURE__*/ new Vector3();\nconst _end$1 = /*@__PURE__*/ new Vector3();\nconst _inverseMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _ray$1 = /*@__PURE__*/ new Ray();\nconst _sphere$1 = /*@__PURE__*/ new Sphere();\n\nclass Line extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Line';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.material = source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\t// we assume non-indexed geometry\n\n\t\t\tif ( geometry.index === null ) {\n\n\t\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\t\tconst lineDistances = [ 0 ];\n\n\t\t\t\tfor ( let i = 1, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t\t_start$1.fromBufferAttribute( positionAttribute, i - 1 );\n\t\t\t\t\t_end$1.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\t\tlineDistances[ i ] = lineDistances[ i - 1 ];\n\t\t\t\t\tlineDistances[ i ] += _start$1.distanceTo( _end$1 );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t\t}\n\n\t\t} else if ( geometry.isGeometry ) {\n\n\t\t\tconsole.error( 'THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Line.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$1.copy( geometry.boundingSphere );\n\t\t_sphere$1.applyMatrix4( matrixWorld );\n\t\t_sphere$1.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$1 ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix$1.copy( matrixWorld ).invert();\n\t\t_ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst vStart = new Vector3();\n\t\tconst vEnd = new Vector3();\n\t\tconst interSegment = new Vector3();\n\t\tconst interRay = new Vector3();\n\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst attributes = geometry.attributes;\n\t\t\tconst positionAttribute = attributes.position;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\tconst b = index.getX( i + 1 );\n\n\t\t\t\t\tvStart.fromBufferAttribute( positionAttribute, a );\n\t\t\t\t\tvEnd.fromBufferAttribute( positionAttribute, b );\n\n\t\t\t\t\tconst distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );\n\n\t\t\t\t\tif ( distSq > localThresholdSq ) continue;\n\n\t\t\t\t\tinterRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation\n\n\t\t\t\t\tconst distance = raycaster.ray.origin.distanceTo( interRay );\n\n\t\t\t\t\tif ( distance < raycaster.near || distance > raycaster.far ) continue;\n\n\t\t\t\t\tintersects.push( {\n\n\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4( this.matrixWorld ),\n\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\tface: null,\n\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\tobject: this\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\t\tvStart.fromBufferAttribute( positionAttribute, i );\n\t\t\t\t\tvEnd.fromBufferAttribute( positionAttribute, i + 1 );\n\n\t\t\t\t\tconst distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );\n\n\t\t\t\t\tif ( distSq > localThresholdSq ) continue;\n\n\t\t\t\t\tinterRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation\n\n\t\t\t\t\tconst distance = raycaster.ray.origin.distanceTo( interRay );\n\n\t\t\t\t\tif ( distance < raycaster.near || distance > raycaster.far ) continue;\n\n\t\t\t\t\tintersects.push( {\n\n\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4( this.matrixWorld ),\n\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\tface: null,\n\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\tobject: this\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( geometry.isGeometry ) {\n\n\t\t\tconsole.error( 'THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t}\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\tconst keys = Object.keys( morphAttributes );\n\n\t\t\tif ( keys.length > 0 ) {\n\n\t\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\tif ( morphTargets !== undefined && morphTargets.length > 0 ) {\n\n\t\t\t\tconsole.error( 'THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nLine.prototype.isLine = true;\n\nconst _start = /*@__PURE__*/ new Vector3();\nconst _end = /*@__PURE__*/ new Vector3();\n\nclass LineSegments extends Line {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'LineSegments';\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\t// we assume non-indexed geometry\n\n\t\t\tif ( geometry.index === null ) {\n\n\t\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\t\tconst lineDistances = [];\n\n\t\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i += 2 ) {\n\n\t\t\t\t\t_start.fromBufferAttribute( positionAttribute, i );\n\t\t\t\t\t_end.fromBufferAttribute( positionAttribute, i + 1 );\n\n\t\t\t\t\tlineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ];\n\t\t\t\t\tlineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t\t}\n\n\t\t} else if ( geometry.isGeometry ) {\n\n\t\t\tconsole.error( 'THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nLineSegments.prototype.isLineSegments = true;\n\nclass LineLoop extends Line {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'LineLoop';\n\n\t}\n\n}\n\nLineLoop.prototype.isLineLoop = true;\n\n/**\n * parameters = {\n * color: ,\n * opacity: ,\n * map: new THREE.Texture( ),\n * alphaMap: new THREE.Texture( ),\n *\n * size: ,\n * sizeAttenuation: \n *\n * }\n */\n\nclass PointsMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PointsMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.size = 1;\n\t\tthis.sizeAttenuation = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.size = source.size;\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\treturn this;\n\n\t}\n\n}\n\nPointsMaterial.prototype.isPointsMaterial = true;\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _position$2 = /*@__PURE__*/ new Vector3();\n\nclass Points extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new PointsMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Points';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.material = source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Points.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\t\t_sphere.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst attributes = geometry.attributes;\n\t\t\tconst positionAttribute = attributes.position;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i ++ ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\n\t\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, a );\n\n\t\t\t\t\ttestPoint( _position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, l = end; i < l; i ++ ) {\n\n\t\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\t\ttestPoint( _position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t}\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\tconst keys = Object.keys( morphAttributes );\n\n\t\t\tif ( keys.length > 0 ) {\n\n\t\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\tif ( morphTargets !== undefined && morphTargets.length > 0 ) {\n\n\t\t\t\tconsole.error( 'THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nPoints.prototype.isPoints = true;\n\nfunction testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) {\n\n\tconst rayPointDistanceSq = _ray.distanceSqToPoint( point );\n\n\tif ( rayPointDistanceSq < localThresholdSq ) {\n\n\t\tconst intersectPoint = new Vector3();\n\n\t\t_ray.closestPointToPoint( point, intersectPoint );\n\t\tintersectPoint.applyMatrix4( matrixWorld );\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tdistanceToRay: Math.sqrt( rayPointDistanceSq ),\n\t\t\tpoint: intersectPoint,\n\t\t\tindex: index,\n\t\t\tface: null,\n\t\t\tobject: object\n\n\t\t} );\n\n\t}\n\n}\n\nclass VideoTexture extends Texture {\n\n\tconstructor( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : LinearFilter;\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : LinearFilter;\n\n\t\tthis.generateMipmaps = false;\n\n\t\tconst scope = this;\n\n\t\tfunction updateVideo() {\n\n\t\t\tscope.needsUpdate = true;\n\t\t\tvideo.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t\tif ( 'requestVideoFrameCallback' in video ) {\n\n\t\t\tvideo.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.image ).copy( this );\n\n\t}\n\n\tupdate() {\n\n\t\tconst video = this.image;\n\t\tconst hasVideoFrameCallback = 'requestVideoFrameCallback' in video;\n\n\t\tif ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA ) {\n\n\t\t\tthis.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n}\n\nVideoTexture.prototype.isVideoTexture = true;\n\nclass FramebufferTexture extends Texture {\n\n\tconstructor( width, height, format ) {\n\n\t\tsuper( { width, height } );\n\n\t\tthis.format = format;\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.generateMipmaps = false;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\nFramebufferTexture.prototype.isFramebufferTexture = true;\n\nclass CompressedTexture extends Texture {\n\n\tconstructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );\n\n\t\tthis.image = { width: width, height: height };\n\t\tthis.mipmaps = mipmaps;\n\n\t\t// no flipping for cube textures\n\t\t// (also flipping doesn't work for compressed textures )\n\n\t\tthis.flipY = false;\n\n\t\t// can't generate mipmaps for compressed textures\n\t\t// mips must be embedded in DDS files\n\n\t\tthis.generateMipmaps = false;\n\n\t}\n\n}\n\nCompressedTexture.prototype.isCompressedTexture = true;\n\nclass CanvasTexture extends Texture {\n\n\tconstructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\nCanvasTexture.prototype.isCanvasTexture = true;\n\nclass CircleGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, segments = 8, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CircleGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tsegments: segments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tsegments = Math.max( 3, segments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// center point\n\n\t\tvertices.push( 0, 0, 0 );\n\t\tnormals.push( 0, 0, 1 );\n\t\tuvs.push( 0.5, 0.5 );\n\n\t\tfor ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) {\n\n\t\t\tconst segment = thetaStart + s / segments * thetaLength;\n\n\t\t\t// vertex\n\n\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t// normal\n\n\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t// uvs\n\n\t\t\tuv.x = ( vertices[ i ] / radius + 1 ) / 2;\n\t\t\tuv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2;\n\n\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tindices.push( i, i + 1, 0 );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass CylinderGeometry extends BufferGeometry {\n\n\tconstructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\t\tthis.type = 'CylinderGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradiusTop: radiusTop,\n\t\t\tradiusBottom: radiusBottom,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tconst scope = this;\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet index = 0;\n\t\tconst indexArray = [];\n\t\tconst halfHeight = height / 2;\n\t\tlet groupStart = 0;\n\n\t\t// generate geometry\n\n\t\tgenerateTorso();\n\n\t\tif ( openEnded === false ) {\n\n\t\t\tif ( radiusTop > 0 ) generateCap( true );\n\t\t\tif ( radiusBottom > 0 ) generateCap( false );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction generateTorso() {\n\n\t\t\tconst normal = new Vector3();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\t// this will be used to calculate the normal\n\t\t\tconst slope = ( radiusBottom - radiusTop ) / height;\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let y = 0; y <= heightSegments; y ++ ) {\n\n\t\t\t\tconst indexRow = [];\n\n\t\t\t\tconst v = y / heightSegments;\n\n\t\t\t\t// calculate the radius of the current row\n\n\t\t\t\tconst radius = v * ( radiusBottom - radiusTop ) + radiusTop;\n\n\t\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\t\tconst u = x / radialSegments;\n\n\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\t\tconst sinTheta = Math.sin( theta );\n\t\t\t\t\tconst cosTheta = Math.cos( theta );\n\n\t\t\t\t\t// vertex\n\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = - v * height + halfHeight;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t\t// normal\n\n\t\t\t\t\tnormal.set( sinTheta, slope, cosTheta ).normalize();\n\t\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\t// uv\n\n\t\t\t\t\tuvs.push( u, 1 - v );\n\n\t\t\t\t\t// save index of vertex in respective row\n\n\t\t\t\t\tindexRow.push( index ++ );\n\n\t\t\t\t}\n\n\t\t\t\t// now save vertices of the row in our index array\n\n\t\t\t\tindexArray.push( indexRow );\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tfor ( let y = 0; y < heightSegments; y ++ ) {\n\n\t\t\t\t\t// we use the index array to access the correct indices\n\n\t\t\t\t\tconst a = indexArray[ y ][ x ];\n\t\t\t\t\tconst b = indexArray[ y + 1 ][ x ];\n\t\t\t\t\tconst c = indexArray[ y + 1 ][ x + 1 ];\n\t\t\t\t\tconst d = indexArray[ y ][ x + 1 ];\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t\t// update group counter\n\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, 0 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t\tfunction generateCap( top ) {\n\n\t\t\t// save the index of the first center vertex\n\t\t\tconst centerIndexStart = index;\n\n\t\t\tconst uv = new Vector2();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst radius = ( top === true ) ? radiusTop : radiusBottom;\n\t\t\tconst sign = ( top === true ) ? 1 : - 1;\n\n\t\t\t// first we generate the center vertex data of the cap.\n\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\tfor ( let x = 1; x <= radialSegments; x ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertices.push( 0, halfHeight * sign, 0 );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( 0.5, 0.5 );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// save the index of the last center vertex\n\t\t\tconst centerIndexEnd = index;\n\n\t\t\t// now we generate the surrounding vertices, normals and uvs\n\n\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\tconst u = x / radialSegments;\n\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\tconst cosTheta = Math.cos( theta );\n\t\t\t\tconst sinTheta = Math.sin( theta );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( cosTheta * 0.5 ) + 0.5;\n\t\t\t\tuv.y = ( sinTheta * 0.5 * sign ) + 0.5;\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tconst c = centerIndexStart + x;\n\t\t\t\tconst i = centerIndexEnd + x;\n\n\t\t\t\tif ( top === true ) {\n\n\t\t\t\t\t// face top\n\n\t\t\t\t\tindices.push( i, i + 1, c );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// face bottom\n\n\t\t\t\t\tindices.push( i + 1, i, c );\n\n\t\t\t\t}\n\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, top === true ? 1 : 2 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass ConeGeometry extends CylinderGeometry {\n\n\tconstructor( radius = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );\n\n\t\tthis.type = 'ConeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new ConeGeometry( data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass PolyhedronGeometry extends BufferGeometry {\n\n\tconstructor( vertices = [], indices = [], radius = 1, detail = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PolyhedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tvertices: vertices,\n\t\t\tindices: indices,\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\t// default buffer data\n\n\t\tconst vertexBuffer = [];\n\t\tconst uvBuffer = [];\n\n\t\t// the subdivision creates the vertex buffer data\n\n\t\tsubdivide( detail );\n\n\t\t// all vertices should lie on a conceptual sphere with a given radius\n\n\t\tapplyRadius( radius );\n\n\t\t// finally, create the uv data\n\n\t\tgenerateUVs();\n\n\t\t// build non-indexed geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );\n\n\t\tif ( detail === 0 ) {\n\n\t\t\tthis.computeVertexNormals(); // flat normals\n\n\t\t} else {\n\n\t\t\tthis.normalizeNormals(); // smooth normals\n\n\t\t}\n\n\t\t// helper functions\n\n\t\tfunction subdivide( detail ) {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\t// iterate over all faces and apply a subdivison with the given detail value\n\n\t\t\tfor ( let i = 0; i < indices.length; i += 3 ) {\n\n\t\t\t\t// get the vertices of the face\n\n\t\t\t\tgetVertexByIndex( indices[ i + 0 ], a );\n\t\t\t\tgetVertexByIndex( indices[ i + 1 ], b );\n\t\t\t\tgetVertexByIndex( indices[ i + 2 ], c );\n\n\t\t\t\t// perform subdivision\n\n\t\t\t\tsubdivideFace( a, b, c, detail );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction subdivideFace( a, b, c, detail ) {\n\n\t\t\tconst cols = detail + 1;\n\n\t\t\t// we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\tconst v = [];\n\n\t\t\t// construct all of the vertices for this subdivision\n\n\t\t\tfor ( let i = 0; i <= cols; i ++ ) {\n\n\t\t\t\tv[ i ] = [];\n\n\t\t\t\tconst aj = a.clone().lerp( c, i / cols );\n\t\t\t\tconst bj = b.clone().lerp( c, i / cols );\n\n\t\t\t\tconst rows = cols - i;\n\n\t\t\t\tfor ( let j = 0; j <= rows; j ++ ) {\n\n\t\t\t\t\tif ( j === 0 && i === cols ) {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj.clone().lerp( bj, j / rows );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// construct all of the faces\n\n\t\t\tfor ( let i = 0; i < cols; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) {\n\n\t\t\t\t\tconst k = Math.floor( j / 2 );\n\n\t\t\t\t\tif ( j % 2 === 0 ) {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\t\t\t\t\t\tpushVertex( v[ i ][ k ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction applyRadius( radius ) {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\t// iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tvertex.normalize().multiplyScalar( radius );\n\n\t\t\t\tvertexBuffer[ i + 0 ] = vertex.x;\n\t\t\t\tvertexBuffer[ i + 1 ] = vertex.y;\n\t\t\t\tvertexBuffer[ i + 2 ] = vertex.z;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tconst u = azimuth( vertex ) / 2 / Math.PI + 0.5;\n\t\t\t\tconst v = inclination( vertex ) / Math.PI + 0.5;\n\t\t\t\tuvBuffer.push( u, 1 - v );\n\n\t\t\t}\n\n\t\t\tcorrectUVs();\n\n\t\t\tcorrectSeam();\n\n\t\t}\n\n\t\tfunction correctSeam() {\n\n\t\t\t// handle case when face straddles the seam, see #3269\n\n\t\t\tfor ( let i = 0; i < uvBuffer.length; i += 6 ) {\n\n\t\t\t\t// uv data of a single face\n\n\t\t\t\tconst x0 = uvBuffer[ i + 0 ];\n\t\t\t\tconst x1 = uvBuffer[ i + 2 ];\n\t\t\t\tconst x2 = uvBuffer[ i + 4 ];\n\n\t\t\t\tconst max = Math.max( x0, x1, x2 );\n\t\t\t\tconst min = Math.min( x0, x1, x2 );\n\n\t\t\t\t// 0.9 is somewhat arbitrary\n\n\t\t\t\tif ( max > 0.9 && min < 0.1 ) {\n\n\t\t\t\t\tif ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1;\n\t\t\t\t\tif ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1;\n\t\t\t\t\tif ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction pushVertex( vertex ) {\n\n\t\t\tvertexBuffer.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tfunction getVertexByIndex( index, vertex ) {\n\n\t\t\tconst stride = index * 3;\n\n\t\t\tvertex.x = vertices[ stride + 0 ];\n\t\t\tvertex.y = vertices[ stride + 1 ];\n\t\t\tvertex.z = vertices[ stride + 2 ];\n\n\t\t}\n\n\t\tfunction correctUVs() {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\tconst centroid = new Vector3();\n\n\t\t\tconst uvA = new Vector2();\n\t\t\tconst uvB = new Vector2();\n\t\t\tconst uvC = new Vector2();\n\n\t\t\tfor ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) {\n\n\t\t\t\ta.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] );\n\t\t\t\tb.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] );\n\t\t\t\tc.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] );\n\n\t\t\t\tuvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] );\n\t\t\t\tuvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] );\n\t\t\t\tuvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] );\n\n\t\t\t\tcentroid.copy( a ).add( b ).add( c ).divideScalar( 3 );\n\n\t\t\t\tconst azi = azimuth( centroid );\n\n\t\t\t\tcorrectUV( uvA, j + 0, a, azi );\n\t\t\t\tcorrectUV( uvB, j + 2, b, azi );\n\t\t\t\tcorrectUV( uvC, j + 4, c, azi );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction correctUV( uv, stride, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = uv.x - 1;\n\n\t\t\t}\n\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Angle around the Y axis, counter-clockwise when looking from above.\n\n\t\tfunction azimuth( vector ) {\n\n\t\t\treturn Math.atan2( vector.z, - vector.x );\n\n\t\t}\n\n\n\t\t// Angle above the XZ plane.\n\n\t\tfunction inclination( vector ) {\n\n\t\t\treturn Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) );\n\n\t\t}\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.details );\n\n\t}\n\n}\n\nclass DodecahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\t\tconst r = 1 / t;\n\n\t\tconst vertices = [\n\n\t\t\t// (±1, ±1, ±1)\n\t\t\t- 1, - 1, - 1,\t- 1, - 1, 1,\n\t\t\t- 1, 1, - 1, - 1, 1, 1,\n\t\t\t1, - 1, - 1, 1, - 1, 1,\n\t\t\t1, 1, - 1, 1, 1, 1,\n\n\t\t\t// (0, ±1/φ, ±φ)\n\t\t\t0, - r, - t, 0, - r, t,\n\t\t\t0, r, - t, 0, r, t,\n\n\t\t\t// (±1/φ, ±φ, 0)\n\t\t\t- r, - t, 0, - r, t, 0,\n\t\t\tr, - t, 0, r, t, 0,\n\n\t\t\t// (±φ, 0, ±1/φ)\n\t\t\t- t, 0, - r, t, 0, - r,\n\t\t\t- t, 0, r, t, 0, r\n\t\t];\n\n\t\tconst indices = [\n\t\t\t3, 11, 7, \t3, 7, 15, \t3, 15, 13,\n\t\t\t7, 19, 17, \t7, 17, 6, \t7, 6, 15,\n\t\t\t17, 4, 8, \t17, 8, 10, \t17, 10, 6,\n\t\t\t8, 0, 16, \t8, 16, 2, \t8, 2, 10,\n\t\t\t0, 12, 1, \t0, 1, 18, \t0, 18, 16,\n\t\t\t6, 10, 2, \t6, 2, 13, \t6, 13, 15,\n\t\t\t2, 16, 18, \t2, 18, 3, \t2, 3, 13,\n\t\t\t18, 1, 9, \t18, 9, 11, \t18, 11, 3,\n\t\t\t4, 14, 12, \t4, 12, 0, \t4, 0, 8,\n\t\t\t11, 9, 5, \t11, 5, 19, \t11, 19, 7,\n\t\t\t19, 5, 14, \t19, 14, 4, \t19, 4, 17,\n\t\t\t1, 12, 14, \t1, 14, 5, \t1, 5, 9\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'DodecahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new DodecahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nconst _v0 = new Vector3();\nconst _v1$1 = new Vector3();\nconst _normal = new Vector3();\nconst _triangle = new Triangle();\n\nclass EdgesGeometry extends BufferGeometry {\n\n\tconstructor( geometry = null, thresholdAngle = 1 ) {\n\n\t\tsuper();\n\t\tthis.type = 'EdgesGeometry';\n\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry,\n\t\t\tthresholdAngle: thresholdAngle\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\tconst precisionPoints = 4;\n\t\t\tconst precision = Math.pow( 10, precisionPoints );\n\t\t\tconst thresholdDot = Math.cos( DEG2RAD * thresholdAngle );\n\n\t\t\tconst indexAttr = geometry.getIndex();\n\t\t\tconst positionAttr = geometry.getAttribute( 'position' );\n\t\t\tconst indexCount = indexAttr ? indexAttr.count : positionAttr.count;\n\n\t\t\tconst indexArr = [ 0, 0, 0 ];\n\t\t\tconst vertKeys = [ 'a', 'b', 'c' ];\n\t\t\tconst hashes = new Array( 3 );\n\n\t\t\tconst edgeData = {};\n\t\t\tconst vertices = [];\n\t\t\tfor ( let i = 0; i < indexCount; i += 3 ) {\n\n\t\t\t\tif ( indexAttr ) {\n\n\t\t\t\t\tindexArr[ 0 ] = indexAttr.getX( i );\n\t\t\t\t\tindexArr[ 1 ] = indexAttr.getX( i + 1 );\n\t\t\t\t\tindexArr[ 2 ] = indexAttr.getX( i + 2 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindexArr[ 0 ] = i;\n\t\t\t\t\tindexArr[ 1 ] = i + 1;\n\t\t\t\t\tindexArr[ 2 ] = i + 2;\n\n\t\t\t\t}\n\n\t\t\t\tconst { a, b, c } = _triangle;\n\t\t\t\ta.fromBufferAttribute( positionAttr, indexArr[ 0 ] );\n\t\t\t\tb.fromBufferAttribute( positionAttr, indexArr[ 1 ] );\n\t\t\t\tc.fromBufferAttribute( positionAttr, indexArr[ 2 ] );\n\t\t\t\t_triangle.getNormal( _normal );\n\n\t\t\t\t// create hashes for the edge from the vertices\n\t\t\t\thashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`;\n\t\t\t\thashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`;\n\t\t\t\thashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`;\n\n\t\t\t\t// skip degenerate triangles\n\t\t\t\tif ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\t// iterate over every edge\n\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t// get the first and next vertex making up the edge\n\t\t\t\t\tconst jNext = ( j + 1 ) % 3;\n\t\t\t\t\tconst vecHash0 = hashes[ j ];\n\t\t\t\t\tconst vecHash1 = hashes[ jNext ];\n\t\t\t\t\tconst v0 = _triangle[ vertKeys[ j ] ];\n\t\t\t\t\tconst v1 = _triangle[ vertKeys[ jNext ] ];\n\n\t\t\t\t\tconst hash = `${ vecHash0 }_${ vecHash1 }`;\n\t\t\t\t\tconst reverseHash = `${ vecHash1 }_${ vecHash0 }`;\n\n\t\t\t\t\tif ( reverseHash in edgeData && edgeData[ reverseHash ] ) {\n\n\t\t\t\t\t\t// if we found a sibling edge add it into the vertex array if\n\t\t\t\t\t\t// it meets the angle threshold and delete the edge from the map.\n\t\t\t\t\t\tif ( _normal.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) {\n\n\t\t\t\t\t\t\tvertices.push( v0.x, v0.y, v0.z );\n\t\t\t\t\t\t\tvertices.push( v1.x, v1.y, v1.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tedgeData[ reverseHash ] = null;\n\n\t\t\t\t\t} else if ( ! ( hash in edgeData ) ) {\n\n\t\t\t\t\t\t// if we've already got an edge here then skip adding a new one\n\t\t\t\t\t\tedgeData[ hash ] = {\n\n\t\t\t\t\t\t\tindex0: indexArr[ j ],\n\t\t\t\t\t\t\tindex1: indexArr[ jNext ],\n\t\t\t\t\t\t\tnormal: _normal.clone(),\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// iterate over all remaining, unmatched edges and add them to the vertex array\n\t\t\tfor ( const key in edgeData ) {\n\n\t\t\t\tif ( edgeData[ key ] ) {\n\n\t\t\t\t\tconst { index0, index1 } = edgeData[ key ];\n\t\t\t\t\t_v0.fromBufferAttribute( positionAttr, index0 );\n\t\t\t\t\t_v1$1.fromBufferAttribute( positionAttr, index1 );\n\n\t\t\t\t\tvertices.push( _v0.x, _v0.y, _v0.z );\n\t\t\t\t\tvertices.push( _v1$1.x, _v1$1.y, _v1$1.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Extensible curve object.\n *\n * Some common of curve methods:\n * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )\n * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )\n * .getPoints(), .getSpacedPoints()\n * .getLength()\n * .updateArcLengths()\n *\n * This following curves inherit from THREE.Curve:\n *\n * -- 2D curves --\n * THREE.ArcCurve\n * THREE.CubicBezierCurve\n * THREE.EllipseCurve\n * THREE.LineCurve\n * THREE.QuadraticBezierCurve\n * THREE.SplineCurve\n *\n * -- 3D curves --\n * THREE.CatmullRomCurve3\n * THREE.CubicBezierCurve3\n * THREE.LineCurve3\n * THREE.QuadraticBezierCurve3\n *\n * A series of curves can be represented as a THREE.CurvePath.\n *\n **/\n\nclass Curve {\n\n\tconstructor() {\n\n\t\tthis.type = 'Curve';\n\n\t\tthis.arcLengthDivisions = 200;\n\n\t}\n\n\t// Virtual base class method to overwrite and implement in subclasses\n\t//\t- t [0 .. 1]\n\n\tgetPoint( /* t, optionalTarget */ ) {\n\n\t\tconsole.warn( 'THREE.Curve: .getPoint() not implemented.' );\n\t\treturn null;\n\n\t}\n\n\t// Get point at relative position in curve according to arc length\n\t// - u [0 .. 1]\n\n\tgetPointAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getPoint( t, optionalTarget );\n\n\t}\n\n\t// Get sequence of points using getPoint( t )\n\n\tgetPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPoint( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get sequence of points using getPointAt( u )\n\n\tgetSpacedPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPointAt( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get total curve arc length\n\n\tgetLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}\n\n\t// Get list of cumulative segment lengths\n\n\tgetLengths( divisions = this.arcLengthDivisions ) {\n\n\t\tif ( this.cacheArcLengths &&\n\t\t\t( this.cacheArcLengths.length === divisions + 1 ) &&\n\t\t\t! this.needsUpdate ) {\n\n\t\t\treturn this.cacheArcLengths;\n\n\t\t}\n\n\t\tthis.needsUpdate = false;\n\n\t\tconst cache = [];\n\t\tlet current, last = this.getPoint( 0 );\n\t\tlet sum = 0;\n\n\t\tcache.push( 0 );\n\n\t\tfor ( let p = 1; p <= divisions; p ++ ) {\n\n\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\tsum += current.distanceTo( last );\n\t\t\tcache.push( sum );\n\t\t\tlast = current;\n\n\t\t}\n\n\t\tthis.cacheArcLengths = cache;\n\n\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t}\n\n\tupdateArcLengths() {\n\n\t\tthis.needsUpdate = true;\n\t\tthis.getLengths();\n\n\t}\n\n\t// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\n\n\tgetUtoTmapping( u, distance ) {\n\n\t\tconst arcLengths = this.getLengths();\n\n\t\tlet i = 0;\n\t\tconst il = arcLengths.length;\n\n\t\tlet targetArcLength; // The targeted u distance value to get\n\n\t\tif ( distance ) {\n\n\t\t\ttargetArcLength = distance;\n\n\t\t} else {\n\n\t\t\ttargetArcLength = u * arcLengths[ il - 1 ];\n\n\t\t}\n\n\t\t// binary search for the index with largest value smaller than target u distance\n\n\t\tlet low = 0, high = il - 1, comparison;\n\n\t\twhile ( low <= high ) {\n\n\t\t\ti = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\tcomparison = arcLengths[ i ] - targetArcLength;\n\n\t\t\tif ( comparison < 0 ) {\n\n\t\t\t\tlow = i + 1;\n\n\t\t\t} else if ( comparison > 0 ) {\n\n\t\t\t\thigh = i - 1;\n\n\t\t\t} else {\n\n\t\t\t\thigh = i;\n\t\t\t\tbreak;\n\n\t\t\t\t// DONE\n\n\t\t\t}\n\n\t\t}\n\n\t\ti = high;\n\n\t\tif ( arcLengths[ i ] === targetArcLength ) {\n\n\t\t\treturn i / ( il - 1 );\n\n\t\t}\n\n\t\t// we could get finer grain at lengths, or use simple interpolation between two points\n\n\t\tconst lengthBefore = arcLengths[ i ];\n\t\tconst lengthAfter = arcLengths[ i + 1 ];\n\n\t\tconst segmentLength = lengthAfter - lengthBefore;\n\n\t\t// determine where we are between the 'before' and 'after' points\n\n\t\tconst segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength;\n\n\t\t// add that fractional amount to t\n\n\t\tconst t = ( i + segmentFraction ) / ( il - 1 );\n\n\t\treturn t;\n\n\t}\n\n\t// Returns a unit vector tangent at t\n\t// In case any sub curve does not implement its tangent derivation,\n\t// 2 points a small delta apart will be used to find its gradient\n\t// which seems to give a reasonable approximation\n\n\tgetTangent( t, optionalTarget ) {\n\n\t\tconst delta = 0.0001;\n\t\tlet t1 = t - delta;\n\t\tlet t2 = t + delta;\n\n\t\t// Capping in case of danger\n\n\t\tif ( t1 < 0 ) t1 = 0;\n\t\tif ( t2 > 1 ) t2 = 1;\n\n\t\tconst pt1 = this.getPoint( t1 );\n\t\tconst pt2 = this.getPoint( t2 );\n\n\t\tconst tangent = optionalTarget || ( ( pt1.isVector2 ) ? new Vector2() : new Vector3() );\n\n\t\ttangent.copy( pt2 ).sub( pt1 ).normalize();\n\n\t\treturn tangent;\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getTangent( t, optionalTarget );\n\n\t}\n\n\tcomputeFrenetFrames( segments, closed ) {\n\n\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\n\t\tconst normal = new Vector3();\n\n\t\tconst tangents = [];\n\t\tconst normals = [];\n\t\tconst binormals = [];\n\n\t\tconst vec = new Vector3();\n\t\tconst mat = new Matrix4();\n\n\t\t// compute the tangent vectors for each segment on the curve\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst u = i / segments;\n\n\t\t\ttangents[ i ] = this.getTangentAt( u, new Vector3() );\n\n\t\t}\n\n\t\t// select an initial normal vector perpendicular to the first tangent vector,\n\t\t// and in the direction of the minimum tangent xyz component\n\n\t\tnormals[ 0 ] = new Vector3();\n\t\tbinormals[ 0 ] = new Vector3();\n\t\tlet min = Number.MAX_VALUE;\n\t\tconst tx = Math.abs( tangents[ 0 ].x );\n\t\tconst ty = Math.abs( tangents[ 0 ].y );\n\t\tconst tz = Math.abs( tangents[ 0 ].z );\n\n\t\tif ( tx <= min ) {\n\n\t\t\tmin = tx;\n\t\t\tnormal.set( 1, 0, 0 );\n\n\t\t}\n\n\t\tif ( ty <= min ) {\n\n\t\t\tmin = ty;\n\t\t\tnormal.set( 0, 1, 0 );\n\n\t\t}\n\n\t\tif ( tz <= min ) {\n\n\t\t\tnormal.set( 0, 0, 1 );\n\n\t\t}\n\n\t\tvec.crossVectors( tangents[ 0 ], normal ).normalize();\n\n\t\tnormals[ 0 ].crossVectors( tangents[ 0 ], vec );\n\t\tbinormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] );\n\n\n\t\t// compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tnormals[ i ] = normals[ i - 1 ].clone();\n\n\t\t\tbinormals[ i ] = binormals[ i - 1 ].clone();\n\n\t\t\tvec.crossVectors( tangents[ i - 1 ], tangents[ i ] );\n\n\t\t\tif ( vec.length() > Number.EPSILON ) {\n\n\t\t\t\tvec.normalize();\n\n\t\t\t\tconst theta = Math.acos( clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors\n\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) );\n\n\t\t\t}\n\n\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t}\n\n\t\t// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\t\tif ( closed === true ) {\n\n\t\t\tlet theta = Math.acos( clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) );\n\t\t\ttheta /= segments;\n\n\t\t\tif ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) {\n\n\t\t\t\ttheta = - theta;\n\n\t\t\t}\n\n\t\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\t\t// twist a little...\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) );\n\t\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttangents: tangents,\n\t\t\tnormals: normals,\n\t\t\tbinormals: binormals\n\t\t};\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.arcLengthDivisions = source.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.5,\n\t\t\t\ttype: 'Curve',\n\t\t\t\tgenerator: 'Curve.toJSON'\n\t\t\t}\n\t\t};\n\n\t\tdata.arcLengthDivisions = this.arcLengthDivisions;\n\t\tdata.type = this.type;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tthis.arcLengthDivisions = json.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass EllipseCurve extends Curve {\n\n\tconstructor( aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'EllipseCurve';\n\n\t\tthis.aX = aX;\n\t\tthis.aY = aY;\n\n\t\tthis.xRadius = xRadius;\n\t\tthis.yRadius = yRadius;\n\n\t\tthis.aStartAngle = aStartAngle;\n\t\tthis.aEndAngle = aEndAngle;\n\n\t\tthis.aClockwise = aClockwise;\n\n\t\tthis.aRotation = aRotation;\n\n\t}\n\n\tgetPoint( t, optionalTarget ) {\n\n\t\tconst point = optionalTarget || new Vector2();\n\n\t\tconst twoPi = Math.PI * 2;\n\t\tlet deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\tconst samePoints = Math.abs( deltaAngle ) < Number.EPSILON;\n\n\t\t// ensures that deltaAngle is 0 .. 2 PI\n\t\twhile ( deltaAngle < 0 ) deltaAngle += twoPi;\n\t\twhile ( deltaAngle > twoPi ) deltaAngle -= twoPi;\n\n\t\tif ( deltaAngle < Number.EPSILON ) {\n\n\t\t\tif ( samePoints ) {\n\n\t\t\t\tdeltaAngle = 0;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.aClockwise === true && ! samePoints ) {\n\n\t\t\tif ( deltaAngle === twoPi ) {\n\n\t\t\t\tdeltaAngle = - twoPi;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst angle = this.aStartAngle + t * deltaAngle;\n\t\tlet x = this.aX + this.xRadius * Math.cos( angle );\n\t\tlet y = this.aY + this.yRadius * Math.sin( angle );\n\n\t\tif ( this.aRotation !== 0 ) {\n\n\t\t\tconst cos = Math.cos( this.aRotation );\n\t\t\tconst sin = Math.sin( this.aRotation );\n\n\t\t\tconst tx = x - this.aX;\n\t\t\tconst ty = y - this.aY;\n\n\t\t\t// Rotate the point about the center of the ellipse.\n\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\ty = tx * sin + ty * cos + this.aY;\n\n\t\t}\n\n\t\treturn point.set( x, y );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.aX = source.aX;\n\t\tthis.aY = source.aY;\n\n\t\tthis.xRadius = source.xRadius;\n\t\tthis.yRadius = source.yRadius;\n\n\t\tthis.aStartAngle = source.aStartAngle;\n\t\tthis.aEndAngle = source.aEndAngle;\n\n\t\tthis.aClockwise = source.aClockwise;\n\n\t\tthis.aRotation = source.aRotation;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.aX = this.aX;\n\t\tdata.aY = this.aY;\n\n\t\tdata.xRadius = this.xRadius;\n\t\tdata.yRadius = this.yRadius;\n\n\t\tdata.aStartAngle = this.aStartAngle;\n\t\tdata.aEndAngle = this.aEndAngle;\n\n\t\tdata.aClockwise = this.aClockwise;\n\n\t\tdata.aRotation = this.aRotation;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.aX = json.aX;\n\t\tthis.aY = json.aY;\n\n\t\tthis.xRadius = json.xRadius;\n\t\tthis.yRadius = json.yRadius;\n\n\t\tthis.aStartAngle = json.aStartAngle;\n\t\tthis.aEndAngle = json.aEndAngle;\n\n\t\tthis.aClockwise = json.aClockwise;\n\n\t\tthis.aRotation = json.aRotation;\n\n\t\treturn this;\n\n\t}\n\n}\n\nEllipseCurve.prototype.isEllipseCurve = true;\n\nclass ArcCurve extends EllipseCurve {\n\n\tconstructor( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tsuper( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\tthis.type = 'ArcCurve';\n\n\t}\n\n}\n\nArcCurve.prototype.isArcCurve = true;\n\n/**\n * Centripetal CatmullRom Curve - which is useful for avoiding\n * cusps and self-intersections in non-uniform catmull rom curves.\n * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n *\n * curve.type accepts centripetal(default), chordal and catmullrom\n * curve.tension is used for catmullrom which defaults to 0.5\n */\n\n\n/*\nBased on an optimized c++ solution in\n - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n - http://ideone.com/NoEbVM\n\nThis CubicPoly class could be used for reusing some variables and calculations,\nbut for three.js curve use, it could be possible inlined and flatten into a single function call\nwhich can be placed in CurveUtils.\n*/\n\nfunction CubicPoly() {\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}\n\n//\n\nconst tmp = new Vector3();\nconst px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly();\n\nclass CatmullRomCurve3 extends Curve {\n\n\tconstructor( points = [], closed = false, curveType = 'centripetal', tension = 0.5 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CatmullRomCurve3';\n\n\t\tthis.points = points;\n\t\tthis.closed = closed;\n\t\tthis.curveType = curveType;\n\t\tthis.tension = tension;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst l = points.length;\n\n\t\tconst p = ( l - ( this.closed ? 0 : 1 ) ) * t;\n\t\tlet intPoint = Math.floor( p );\n\t\tlet weight = p - intPoint;\n\n\t\tif ( this.closed ) {\n\n\t\t\tintPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l;\n\n\t\t} else if ( weight === 0 && intPoint === l - 1 ) {\n\n\t\t\tintPoint = l - 2;\n\t\t\tweight = 1;\n\n\t\t}\n\n\t\tlet p0, p3; // 4 points (p1 & p2 defined below)\n\n\t\tif ( this.closed || intPoint > 0 ) {\n\n\t\t\tp0 = points[ ( intPoint - 1 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate first point\n\t\t\ttmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] );\n\t\t\tp0 = tmp;\n\n\t\t}\n\n\t\tconst p1 = points[ intPoint % l ];\n\t\tconst p2 = points[ ( intPoint + 1 ) % l ];\n\n\t\tif ( this.closed || intPoint + 2 < l ) {\n\n\t\t\tp3 = points[ ( intPoint + 2 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate last point\n\t\t\ttmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] );\n\t\t\tp3 = tmp;\n\n\t\t}\n\n\t\tif ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) {\n\n\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\tconst pow = this.curveType === 'chordal' ? 0.5 : 0.25;\n\t\t\tlet dt0 = Math.pow( p0.distanceToSquared( p1 ), pow );\n\t\t\tlet dt1 = Math.pow( p1.distanceToSquared( p2 ), pow );\n\t\t\tlet dt2 = Math.pow( p2.distanceToSquared( p3 ), pow );\n\n\t\t\t// safety check for repeated points\n\t\t\tif ( dt1 < 1e-4 ) dt1 = 1.0;\n\t\t\tif ( dt0 < 1e-4 ) dt0 = dt1;\n\t\t\tif ( dt2 < 1e-4 ) dt2 = dt1;\n\n\t\t\tpx.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 );\n\t\t\tpy.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 );\n\t\t\tpz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 );\n\n\t\t} else if ( this.curveType === 'catmullrom' ) {\n\n\t\t\tpx.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension );\n\t\t\tpy.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension );\n\t\t\tpz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension );\n\n\t\t}\n\n\t\tpoint.set(\n\t\t\tpx.calc( weight ),\n\t\t\tpy.calc( weight ),\n\t\t\tpz.calc( weight )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\tthis.closed = source.closed;\n\t\tthis.curveType = source.curveType;\n\t\tthis.tension = source.tension;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\tdata.closed = this.closed;\n\t\tdata.curveType = this.curveType;\n\t\tdata.tension = this.tension;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector3().fromArray( point ) );\n\n\t\t}\n\n\t\tthis.closed = json.closed;\n\t\tthis.curveType = json.curveType;\n\t\tthis.tension = json.tension;\n\n\t\treturn this;\n\n\t}\n\n}\n\nCatmullRomCurve3.prototype.isCatmullRomCurve3 = true;\n\n/**\n * Bezier Curves formulas obtained from\n * https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n */\n\nfunction CatmullRom( t, p0, p1, p2, p3 ) {\n\n\tconst v0 = ( p2 - p0 ) * 0.5;\n\tconst v1 = ( p3 - p1 ) * 0.5;\n\tconst t2 = t * t;\n\tconst t3 = t * t2;\n\treturn ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n}\n\n//\n\nfunction QuadraticBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * p;\n\n}\n\nfunction QuadraticBezierP1( t, p ) {\n\n\treturn 2 * ( 1 - t ) * t * p;\n\n}\n\nfunction QuadraticBezierP2( t, p ) {\n\n\treturn t * t * p;\n\n}\n\nfunction QuadraticBezier( t, p0, p1, p2 ) {\n\n\treturn QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) +\n\t\tQuadraticBezierP2( t, p2 );\n\n}\n\n//\n\nfunction CubicBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * k * p;\n\n}\n\nfunction CubicBezierP1( t, p ) {\n\n\tconst k = 1 - t;\n\treturn 3 * k * k * t * p;\n\n}\n\nfunction CubicBezierP2( t, p ) {\n\n\treturn 3 * ( 1 - t ) * t * t * p;\n\n}\n\nfunction CubicBezierP3( t, p ) {\n\n\treturn t * t * t * p;\n\n}\n\nfunction CubicBezier( t, p0, p1, p2, p3 ) {\n\n\treturn CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) +\n\t\tCubicBezierP3( t, p3 );\n\n}\n\nclass CubicBezierCurve extends Curve {\n\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CubicBezierCurve';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\t\tthis.v3 = v3;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nCubicBezierCurve.prototype.isCubicBezierCurve = true;\n\nclass CubicBezierCurve3 extends Curve {\n\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CubicBezierCurve3';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\t\tthis.v3 = v3;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y ),\n\t\t\tCubicBezier( t, v0.z, v1.z, v2.z, v3.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nCubicBezierCurve3.prototype.isCubicBezierCurve3 = true;\n\nclass LineCurve extends Curve {\n\n\tconstructor( v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LineCurve';\n\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget ) {\n\n\t\tconst tangent = optionalTarget || new Vector2();\n\n\t\ttangent.copy( this.v2 ).sub( this.v1 ).normalize();\n\n\t\treturn tangent;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nLineCurve.prototype.isLineCurve = true;\n\nclass LineCurve3 extends Curve {\n\n\tconstructor( v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LineCurve3';\n\t\tthis.isLineCurve3 = true;\n\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass QuadraticBezierCurve extends Curve {\n\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'QuadraticBezierCurve';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nQuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;\n\nclass QuadraticBezierCurve3 extends Curve {\n\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'QuadraticBezierCurve3';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y ),\n\t\t\tQuadraticBezier( t, v0.z, v1.z, v2.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nQuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;\n\nclass SplineCurve extends Curve {\n\n\tconstructor( points = [] ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SplineCurve';\n\n\t\tthis.points = points;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst p = ( points.length - 1 ) * t;\n\n\t\tconst intPoint = Math.floor( p );\n\t\tconst weight = p - intPoint;\n\n\t\tconst p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];\n\t\tconst p1 = points[ intPoint ];\n\t\tconst p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];\n\t\tconst p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];\n\n\t\tpoint.set(\n\t\t\tCatmullRom( weight, p0.x, p1.x, p2.x, p3.x ),\n\t\t\tCatmullRom( weight, p0.y, p1.y, p2.y, p3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector2().fromArray( point ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nSplineCurve.prototype.isSplineCurve = true;\n\nvar Curves = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tArcCurve: ArcCurve,\n\tCatmullRomCurve3: CatmullRomCurve3,\n\tCubicBezierCurve: CubicBezierCurve,\n\tCubicBezierCurve3: CubicBezierCurve3,\n\tEllipseCurve: EllipseCurve,\n\tLineCurve: LineCurve,\n\tLineCurve3: LineCurve3,\n\tQuadraticBezierCurve: QuadraticBezierCurve,\n\tQuadraticBezierCurve3: QuadraticBezierCurve3,\n\tSplineCurve: SplineCurve\n});\n\n/**************************************************************\n *\tCurved Path - a curve path is simply a array of connected\n * curves, but retains the api of a curve\n **************************************************************/\n\nclass CurvePath extends Curve {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'CurvePath';\n\n\t\tthis.curves = [];\n\t\tthis.autoClose = false; // Automatically closes the path\n\n\t}\n\n\tadd( curve ) {\n\n\t\tthis.curves.push( curve );\n\n\t}\n\n\tclosePath() {\n\n\t\t// Add a line curve if start and end of lines are not connected\n\t\tconst startPoint = this.curves[ 0 ].getPoint( 0 );\n\t\tconst endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 );\n\n\t\tif ( ! startPoint.equals( endPoint ) ) {\n\n\t\t\tthis.curves.push( new LineCurve( endPoint, startPoint ) );\n\n\t\t}\n\n\t}\n\n\t// To get accurate point with reference to\n\t// entire path distance at time t,\n\t// following has to be done:\n\n\t// 1. Length of each sub path have to be known\n\t// 2. Locate and identify type of curve\n\t// 3. Get t for the curve\n\t// 4. Return curve.getPointAt(t')\n\n\tgetPoint( t, optionalTarget ) {\n\n\t\tconst d = t * this.getLength();\n\t\tconst curveLengths = this.getCurveLengths();\n\t\tlet i = 0;\n\n\t\t// To think about boundaries points.\n\n\t\twhile ( i < curveLengths.length ) {\n\n\t\t\tif ( curveLengths[ i ] >= d ) {\n\n\t\t\t\tconst diff = curveLengths[ i ] - d;\n\t\t\t\tconst curve = this.curves[ i ];\n\n\t\t\t\tconst segmentLength = curve.getLength();\n\t\t\t\tconst u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\n\t\t\t\treturn curve.getPointAt( u, optionalTarget );\n\n\t\t\t}\n\n\t\t\ti ++;\n\n\t\t}\n\n\t\treturn null;\n\n\t\t// loop where sum != 0, sum > d , sum+1 1 && ! points[ points.length - 1 ].equals( points[ 0 ] ) ) {\n\n\t\t\tpoints.push( points[ 0 ] );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = source.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = source.curves[ i ];\n\n\t\t\tthis.curves.push( curve.clone() );\n\n\t\t}\n\n\t\tthis.autoClose = source.autoClose;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.autoClose = this.autoClose;\n\t\tdata.curves = [];\n\n\t\tfor ( let i = 0, l = this.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = this.curves[ i ];\n\t\t\tdata.curves.push( curve.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.autoClose = json.autoClose;\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = json.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = json.curves[ i ];\n\t\t\tthis.curves.push( new Curves[ curve.type ]().fromJSON( curve ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass Path extends CurvePath {\n\n\tconstructor( points ) {\n\n\t\tsuper();\n\t\tthis.type = 'Path';\n\n\t\tthis.currentPoint = new Vector2();\n\n\t\tif ( points ) {\n\n\t\t\tthis.setFromPoints( points );\n\n\t\t}\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.moveTo( points[ 0 ].x, points[ 0 ].y );\n\n\t\tfor ( let i = 1, l = points.length; i < l; i ++ ) {\n\n\t\t\tthis.lineTo( points[ i ].x, points[ i ].y );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying?\n\n\t\treturn this;\n\n\t}\n\n\tlineTo( x, y ) {\n\n\t\tconst curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tconst curve = new QuadraticBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCPx, aCPy ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tconst curve = new CubicBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCP1x, aCP1y ),\n\t\t\tnew Vector2( aCP2x, aCP2y ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tsplineThru( pts /*Array of Vector*/ ) {\n\n\t\tconst npts = [ this.currentPoint.clone() ].concat( pts );\n\n\t\tconst curve = new SplineCurve( npts );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.copy( pts[ pts.length - 1 ] );\n\n\t\treturn this;\n\n\t}\n\n\tarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absarc( aX + x0, aY + y0, aRadius,\n\t\t\taStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\tabsarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tthis.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\tellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\treturn this;\n\n\t}\n\n\tabsellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\tif ( this.curves.length > 0 ) {\n\n\t\t\t// if a previous curve is present, attempt to join\n\t\t\tconst firstPoint = curve.getPoint( 0 );\n\n\t\t\tif ( ! firstPoint.equals( this.currentPoint ) ) {\n\n\t\t\t\tthis.lineTo( firstPoint.x, firstPoint.y );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.curves.push( curve );\n\n\t\tconst lastPoint = curve.getPoint( 1 );\n\t\tthis.currentPoint.copy( lastPoint );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.currentPoint.copy( source.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.currentPoint = this.currentPoint.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.currentPoint.fromArray( json.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass Shape extends Path {\n\n\tconstructor( points ) {\n\n\t\tsuper( points );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.type = 'Shape';\n\n\t\tthis.holes = [];\n\n\t}\n\n\tgetPointsHoles( divisions ) {\n\n\t\tconst holesPts = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tholesPts[ i ] = this.holes[ i ].getPoints( divisions );\n\n\t\t}\n\n\t\treturn holesPts;\n\n\t}\n\n\t// get points of shape and holes (keypoints based on segments parameter)\n\n\textractPoints( divisions ) {\n\n\t\treturn {\n\n\t\t\tshape: this.getPoints( divisions ),\n\t\t\tholes: this.getPointsHoles( divisions )\n\n\t\t};\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = source.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = source.holes[ i ];\n\n\t\t\tthis.holes.push( hole.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.holes = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = this.holes[ i ];\n\t\t\tdata.holes.push( hole.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.uuid = json.uuid;\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = json.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = json.holes[ i ];\n\t\t\tthis.holes.push( new Path().fromJSON( hole ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Port from https://github.com/mapbox/earcut (v2.2.2)\n */\n\nconst Earcut = {\n\n\ttriangulate: function ( data, holeIndices, dim = 2 ) {\n\n\t\tconst hasHoles = holeIndices && holeIndices.length;\n\t\tconst outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length;\n\t\tlet outerNode = linkedList( data, 0, outerLen, dim, true );\n\t\tconst triangles = [];\n\n\t\tif ( ! outerNode || outerNode.next === outerNode.prev ) return triangles;\n\n\t\tlet minX, minY, maxX, maxY, x, y, invSize;\n\n\t\tif ( hasHoles ) outerNode = eliminateHoles( data, holeIndices, outerNode, dim );\n\n\t\t// if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n\t\tif ( data.length > 80 * dim ) {\n\n\t\t\tminX = maxX = data[ 0 ];\n\t\t\tminY = maxY = data[ 1 ];\n\n\t\t\tfor ( let i = dim; i < outerLen; i += dim ) {\n\n\t\t\t\tx = data[ i ];\n\t\t\t\ty = data[ i + 1 ];\n\t\t\t\tif ( x < minX ) minX = x;\n\t\t\t\tif ( y < minY ) minY = y;\n\t\t\t\tif ( x > maxX ) maxX = x;\n\t\t\t\tif ( y > maxY ) maxY = y;\n\n\t\t\t}\n\n\t\t\t// minX, minY and invSize are later used to transform coords into integers for z-order calculation\n\t\t\tinvSize = Math.max( maxX - minX, maxY - minY );\n\t\t\tinvSize = invSize !== 0 ? 1 / invSize : 0;\n\n\t\t}\n\n\t\tearcutLinked( outerNode, triangles, dim, minX, minY, invSize );\n\n\t\treturn triangles;\n\n\t}\n\n};\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList( data, start, end, dim, clockwise ) {\n\n\tlet i, last;\n\n\tif ( clockwise === ( signedArea( data, start, end, dim ) > 0 ) ) {\n\n\t\tfor ( i = start; i < end; i += dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last );\n\n\t} else {\n\n\t\tfor ( i = end - dim; i >= start; i -= dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last );\n\n\t}\n\n\tif ( last && equals( last, last.next ) ) {\n\n\t\tremoveNode( last );\n\t\tlast = last.next;\n\n\t}\n\n\treturn last;\n\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints( start, end ) {\n\n\tif ( ! start ) return start;\n\tif ( ! end ) end = start;\n\n\tlet p = start,\n\t\tagain;\n\tdo {\n\n\t\tagain = false;\n\n\t\tif ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) {\n\n\t\t\tremoveNode( p );\n\t\t\tp = end = p.prev;\n\t\t\tif ( p === p.next ) break;\n\t\t\tagain = true;\n\n\t\t} else {\n\n\t\t\tp = p.next;\n\n\t\t}\n\n\t} while ( again || p !== end );\n\n\treturn end;\n\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) {\n\n\tif ( ! ear ) return;\n\n\t// interlink polygon nodes in z-order\n\tif ( ! pass && invSize ) indexCurve( ear, minX, minY, invSize );\n\n\tlet stop = ear,\n\t\tprev, next;\n\n\t// iterate through ears, slicing them one by one\n\twhile ( ear.prev !== ear.next ) {\n\n\t\tprev = ear.prev;\n\t\tnext = ear.next;\n\n\t\tif ( invSize ? isEarHashed( ear, minX, minY, invSize ) : isEar( ear ) ) {\n\n\t\t\t// cut off the triangle\n\t\t\ttriangles.push( prev.i / dim );\n\t\t\ttriangles.push( ear.i / dim );\n\t\t\ttriangles.push( next.i / dim );\n\n\t\t\tremoveNode( ear );\n\n\t\t\t// skipping the next vertex leads to less sliver triangles\n\t\t\tear = next.next;\n\t\t\tstop = next.next;\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tear = next;\n\n\t\t// if we looped through the whole remaining polygon and can't find any more ears\n\t\tif ( ear === stop ) {\n\n\t\t\t// try filtering points and slicing again\n\t\t\tif ( ! pass ) {\n\n\t\t\t\tearcutLinked( filterPoints( ear ), triangles, dim, minX, minY, invSize, 1 );\n\n\t\t\t\t// if this didn't work, try curing all small self-intersections locally\n\n\t\t\t} else if ( pass === 1 ) {\n\n\t\t\t\tear = cureLocalIntersections( filterPoints( ear ), triangles, dim );\n\t\t\t\tearcutLinked( ear, triangles, dim, minX, minY, invSize, 2 );\n\n\t\t\t\t// as a last resort, try splitting the remaining polygon into two\n\n\t\t\t} else if ( pass === 2 ) {\n\n\t\t\t\tsplitEarcut( ear, triangles, dim, minX, minY, invSize );\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar( ear ) {\n\n\tconst a = ear.prev,\n\t\tb = ear,\n\t\tc = ear.next;\n\n\tif ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear\n\n\t// now make sure we don't have other points inside the potential ear\n\tlet p = ear.next.next;\n\n\twhile ( p !== ear.prev ) {\n\n\t\tif ( pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) &&\n\t\t\tarea( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.next;\n\n\t}\n\n\treturn true;\n\n}\n\nfunction isEarHashed( ear, minX, minY, invSize ) {\n\n\tconst a = ear.prev,\n\t\tb = ear,\n\t\tc = ear.next;\n\n\tif ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear\n\n\t// triangle bbox; min & max are calculated like this for speed\n\tconst minTX = a.x < b.x ? ( a.x < c.x ? a.x : c.x ) : ( b.x < c.x ? b.x : c.x ),\n\t\tminTY = a.y < b.y ? ( a.y < c.y ? a.y : c.y ) : ( b.y < c.y ? b.y : c.y ),\n\t\tmaxTX = a.x > b.x ? ( a.x > c.x ? a.x : c.x ) : ( b.x > c.x ? b.x : c.x ),\n\t\tmaxTY = a.y > b.y ? ( a.y > c.y ? a.y : c.y ) : ( b.y > c.y ? b.y : c.y );\n\n\t// z-order range for the current triangle bbox;\n\tconst minZ = zOrder( minTX, minTY, minX, minY, invSize ),\n\t\tmaxZ = zOrder( maxTX, maxTY, minX, minY, invSize );\n\n\tlet p = ear.prevZ,\n\t\tn = ear.nextZ;\n\n\t// look for points inside the triangle in both directions\n\twhile ( p && p.z >= minZ && n && n.z <= maxZ ) {\n\n\t\tif ( p !== ear.prev && p !== ear.next &&\n\t\t\tpointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) &&\n\t\t\tarea( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.prevZ;\n\n\t\tif ( n !== ear.prev && n !== ear.next &&\n\t\t\tpointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) &&\n\t\t\tarea( n.prev, n, n.next ) >= 0 ) return false;\n\t\tn = n.nextZ;\n\n\t}\n\n\t// look for remaining points in decreasing z-order\n\twhile ( p && p.z >= minZ ) {\n\n\t\tif ( p !== ear.prev && p !== ear.next &&\n\t\t\tpointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) &&\n\t\t\tarea( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.prevZ;\n\n\t}\n\n\t// look for remaining points in increasing z-order\n\twhile ( n && n.z <= maxZ ) {\n\n\t\tif ( n !== ear.prev && n !== ear.next &&\n\t\t\tpointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) &&\n\t\t\tarea( n.prev, n, n.next ) >= 0 ) return false;\n\t\tn = n.nextZ;\n\n\t}\n\n\treturn true;\n\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections( start, triangles, dim ) {\n\n\tlet p = start;\n\tdo {\n\n\t\tconst a = p.prev,\n\t\t\tb = p.next.next;\n\n\t\tif ( ! equals( a, b ) && intersects( a, p, p.next, b ) && locallyInside( a, b ) && locallyInside( b, a ) ) {\n\n\t\t\ttriangles.push( a.i / dim );\n\t\t\ttriangles.push( p.i / dim );\n\t\t\ttriangles.push( b.i / dim );\n\n\t\t\t// remove two nodes involved\n\t\t\tremoveNode( p );\n\t\t\tremoveNode( p.next );\n\n\t\t\tp = start = b;\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\treturn filterPoints( p );\n\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut( start, triangles, dim, minX, minY, invSize ) {\n\n\t// look for a valid diagonal that divides the polygon into two\n\tlet a = start;\n\tdo {\n\n\t\tlet b = a.next.next;\n\t\twhile ( b !== a.prev ) {\n\n\t\t\tif ( a.i !== b.i && isValidDiagonal( a, b ) ) {\n\n\t\t\t\t// split the polygon in two by the diagonal\n\t\t\t\tlet c = splitPolygon( a, b );\n\n\t\t\t\t// filter colinear points around the cuts\n\t\t\t\ta = filterPoints( a, a.next );\n\t\t\t\tc = filterPoints( c, c.next );\n\n\t\t\t\t// run earcut on each half\n\t\t\t\tearcutLinked( a, triangles, dim, minX, minY, invSize );\n\t\t\t\tearcutLinked( c, triangles, dim, minX, minY, invSize );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tb = b.next;\n\n\t\t}\n\n\t\ta = a.next;\n\n\t} while ( a !== start );\n\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles( data, holeIndices, outerNode, dim ) {\n\n\tconst queue = [];\n\tlet i, len, start, end, list;\n\n\tfor ( i = 0, len = holeIndices.length; i < len; i ++ ) {\n\n\t\tstart = holeIndices[ i ] * dim;\n\t\tend = i < len - 1 ? holeIndices[ i + 1 ] * dim : data.length;\n\t\tlist = linkedList( data, start, end, dim, false );\n\t\tif ( list === list.next ) list.steiner = true;\n\t\tqueue.push( getLeftmost( list ) );\n\n\t}\n\n\tqueue.sort( compareX );\n\n\t// process holes from left to right\n\tfor ( i = 0; i < queue.length; i ++ ) {\n\n\t\teliminateHole( queue[ i ], outerNode );\n\t\touterNode = filterPoints( outerNode, outerNode.next );\n\n\t}\n\n\treturn outerNode;\n\n}\n\nfunction compareX( a, b ) {\n\n\treturn a.x - b.x;\n\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole( hole, outerNode ) {\n\n\touterNode = findHoleBridge( hole, outerNode );\n\tif ( outerNode ) {\n\n\t\tconst b = splitPolygon( outerNode, hole );\n\n\t\t// filter collinear points around the cuts\n\t\tfilterPoints( outerNode, outerNode.next );\n\t\tfilterPoints( b, b.next );\n\n\t}\n\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge( hole, outerNode ) {\n\n\tlet p = outerNode;\n\tconst hx = hole.x;\n\tconst hy = hole.y;\n\tlet qx = - Infinity, m;\n\n\t// find a segment intersected by a ray from the hole's leftmost point to the left;\n\t// segment's endpoint with lesser x will be potential connection point\n\tdo {\n\n\t\tif ( hy <= p.y && hy >= p.next.y && p.next.y !== p.y ) {\n\n\t\t\tconst x = p.x + ( hy - p.y ) * ( p.next.x - p.x ) / ( p.next.y - p.y );\n\t\t\tif ( x <= hx && x > qx ) {\n\n\t\t\t\tqx = x;\n\t\t\t\tif ( x === hx ) {\n\n\t\t\t\t\tif ( hy === p.y ) return p;\n\t\t\t\t\tif ( hy === p.next.y ) return p.next;\n\n\t\t\t\t}\n\n\t\t\t\tm = p.x < p.next.x ? p : p.next;\n\n\t\t\t}\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== outerNode );\n\n\tif ( ! m ) return null;\n\n\tif ( hx === qx ) return m; // hole touches outer segment; pick leftmost endpoint\n\n\t// look for points inside the triangle of hole point, segment intersection and endpoint;\n\t// if there are no points found, we have a valid connection;\n\t// otherwise choose the point of the minimum angle with the ray as connection point\n\n\tconst stop = m,\n\t\tmx = m.x,\n\t\tmy = m.y;\n\tlet tanMin = Infinity, tan;\n\n\tp = m;\n\n\tdo {\n\n\t\tif ( hx >= p.x && p.x >= mx && hx !== p.x &&\n\t\t\t\tpointInTriangle( hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y ) ) {\n\n\t\t\ttan = Math.abs( hy - p.y ) / ( hx - p.x ); // tangential\n\n\t\t\tif ( locallyInside( p, hole ) && ( tan < tanMin || ( tan === tanMin && ( p.x > m.x || ( p.x === m.x && sectorContainsSector( m, p ) ) ) ) ) ) {\n\n\t\t\t\tm = p;\n\t\t\t\ttanMin = tan;\n\n\t\t\t}\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== stop );\n\n\treturn m;\n\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector( m, p ) {\n\n\treturn area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0;\n\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve( start, minX, minY, invSize ) {\n\n\tlet p = start;\n\tdo {\n\n\t\tif ( p.z === null ) p.z = zOrder( p.x, p.y, minX, minY, invSize );\n\t\tp.prevZ = p.prev;\n\t\tp.nextZ = p.next;\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\tp.prevZ.nextZ = null;\n\tp.prevZ = null;\n\n\tsortLinked( p );\n\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked( list ) {\n\n\tlet i, p, q, e, tail, numMerges, pSize, qSize,\n\t\tinSize = 1;\n\n\tdo {\n\n\t\tp = list;\n\t\tlist = null;\n\t\ttail = null;\n\t\tnumMerges = 0;\n\n\t\twhile ( p ) {\n\n\t\t\tnumMerges ++;\n\t\t\tq = p;\n\t\t\tpSize = 0;\n\t\t\tfor ( i = 0; i < inSize; i ++ ) {\n\n\t\t\t\tpSize ++;\n\t\t\t\tq = q.nextZ;\n\t\t\t\tif ( ! q ) break;\n\n\t\t\t}\n\n\t\t\tqSize = inSize;\n\n\t\t\twhile ( pSize > 0 || ( qSize > 0 && q ) ) {\n\n\t\t\t\tif ( pSize !== 0 && ( qSize === 0 || ! q || p.z <= q.z ) ) {\n\n\t\t\t\t\te = p;\n\t\t\t\t\tp = p.nextZ;\n\t\t\t\t\tpSize --;\n\n\t\t\t\t} else {\n\n\t\t\t\t\te = q;\n\t\t\t\t\tq = q.nextZ;\n\t\t\t\t\tqSize --;\n\n\t\t\t\t}\n\n\t\t\t\tif ( tail ) tail.nextZ = e;\n\t\t\t\telse list = e;\n\n\t\t\t\te.prevZ = tail;\n\t\t\t\ttail = e;\n\n\t\t\t}\n\n\t\t\tp = q;\n\n\t\t}\n\n\t\ttail.nextZ = null;\n\t\tinSize *= 2;\n\n\t} while ( numMerges > 1 );\n\n\treturn list;\n\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\n\tx = 32767 * ( x - minX ) * invSize;\n\ty = 32767 * ( y - minY ) * invSize;\n\n\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\treturn x | ( y << 1 );\n\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost( start ) {\n\n\tlet p = start,\n\t\tleftmost = start;\n\tdo {\n\n\t\tif ( p.x < leftmost.x || ( p.x === leftmost.x && p.y < leftmost.y ) ) leftmost = p;\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\treturn leftmost;\n\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal( a, b ) {\n\n\treturn a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // dones't intersect other edges\n\t\t( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible\n\t\t( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors\n\t\tequals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case\n\n}\n\n// signed area of a triangle\nfunction area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}\n\n// check if two points are equal\nfunction equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}\n\n// check if two segments intersect\nfunction intersects( p1, q1, p2, q2 ) {\n\n\tconst o1 = sign( area( p1, q1, p2 ) );\n\tconst o2 = sign( area( p1, q1, q2 ) );\n\tconst o3 = sign( area( p2, q2, p1 ) );\n\tconst o4 = sign( area( p2, q2, q1 ) );\n\n\tif ( o1 !== o2 && o3 !== o4 ) return true; // general case\n\n\tif ( o1 === 0 && onSegment( p1, p2, q1 ) ) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n\tif ( o2 === 0 && onSegment( p1, q2, q1 ) ) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n\tif ( o3 === 0 && onSegment( p2, p1, q2 ) ) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n\tif ( o4 === 0 && onSegment( p2, q1, q2 ) ) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n\treturn false;\n\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment( p, q, r ) {\n\n\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n}\n\nfunction sign( num ) {\n\n\treturn num > 0 ? 1 : num < 0 ? - 1 : 0;\n\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon( a, b ) {\n\n\tlet p = a;\n\tdo {\n\n\t\tif ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n\t\t\t\tintersects( p, p.next, a, b ) ) return true;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn false;\n\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside( a, b ) {\n\n\treturn area( a.prev, a, a.next ) < 0 ?\n\t\tarea( a, b, a.next ) >= 0 && area( a, a.prev, b ) >= 0 :\n\t\tarea( a, b, a.prev ) < 0 || area( a, a.next, b ) < 0;\n\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon( a, b ) {\n\n\tconst a2 = new Node( a.i, a.x, a.y ),\n\t\tb2 = new Node( b.i, b.x, b.y ),\n\t\tan = a.next,\n\t\tbp = b.prev;\n\n\ta.next = b;\n\tb.prev = a;\n\n\ta2.next = an;\n\tan.prev = a2;\n\n\tb2.next = a2;\n\ta2.prev = b2;\n\n\tbp.next = b2;\n\tb2.prev = bp;\n\n\treturn b2;\n\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode( i, x, y, last ) {\n\n\tconst p = new Node( i, x, y );\n\n\tif ( ! last ) {\n\n\t\tp.prev = p;\n\t\tp.next = p;\n\n\t} else {\n\n\t\tp.next = last.next;\n\t\tp.prev = last;\n\t\tlast.next.prev = p;\n\t\tlast.next = p;\n\n\t}\n\n\treturn p;\n\n}\n\nfunction removeNode( p ) {\n\n\tp.next.prev = p.prev;\n\tp.prev.next = p.next;\n\n\tif ( p.prevZ ) p.prevZ.nextZ = p.nextZ;\n\tif ( p.nextZ ) p.nextZ.prevZ = p.prevZ;\n\n}\n\nfunction Node( i, x, y ) {\n\n\t// vertex index in coordinates array\n\tthis.i = i;\n\n\t// vertex coordinates\n\tthis.x = x;\n\tthis.y = y;\n\n\t// previous and next vertex nodes in a polygon ring\n\tthis.prev = null;\n\tthis.next = null;\n\n\t// z-order curve value\n\tthis.z = null;\n\n\t// previous and next nodes in z-order\n\tthis.prevZ = null;\n\tthis.nextZ = null;\n\n\t// indicates whether this is a steiner point\n\tthis.steiner = false;\n\n}\n\nfunction signedArea( data, start, end, dim ) {\n\n\tlet sum = 0;\n\tfor ( let i = start, j = end - dim; i < end; i += dim ) {\n\n\t\tsum += ( data[ j ] - data[ i ] ) * ( data[ i + 1 ] + data[ j + 1 ] );\n\t\tj = i;\n\n\t}\n\n\treturn sum;\n\n}\n\nclass ShapeUtils {\n\n\t// calculate area of the contour polygon\n\n\tstatic area( contour ) {\n\n\t\tconst n = contour.length;\n\t\tlet a = 0.0;\n\n\t\tfor ( let p = n - 1, q = 0; q < n; p = q ++ ) {\n\n\t\t\ta += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y;\n\n\t\t}\n\n\t\treturn a * 0.5;\n\n\t}\n\n\tstatic isClockWise( pts ) {\n\n\t\treturn ShapeUtils.area( pts ) < 0;\n\n\t}\n\n\tstatic triangulateShape( contour, holes ) {\n\n\t\tconst vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\n\t\tconst holeIndices = []; // array of hole indices\n\t\tconst faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\n\n\t\tremoveDupEndPts( contour );\n\t\taddContour( vertices, contour );\n\n\t\t//\n\n\t\tlet holeIndex = contour.length;\n\n\t\tholes.forEach( removeDupEndPts );\n\n\t\tfor ( let i = 0; i < holes.length; i ++ ) {\n\n\t\t\tholeIndices.push( holeIndex );\n\t\t\tholeIndex += holes[ i ].length;\n\t\t\taddContour( vertices, holes[ i ] );\n\n\t\t}\n\n\t\t//\n\n\t\tconst triangles = Earcut.triangulate( vertices, holeIndices );\n\n\t\t//\n\n\t\tfor ( let i = 0; i < triangles.length; i += 3 ) {\n\n\t\t\tfaces.push( triangles.slice( i, i + 3 ) );\n\n\t\t}\n\n\t\treturn faces;\n\n\t}\n\n}\n\nfunction removeDupEndPts( points ) {\n\n\tconst l = points.length;\n\n\tif ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {\n\n\t\tpoints.pop();\n\n\t}\n\n}\n\nfunction addContour( vertices, contour ) {\n\n\tfor ( let i = 0; i < contour.length; i ++ ) {\n\n\t\tvertices.push( contour[ i ].x );\n\t\tvertices.push( contour[ i ].y );\n\n\t}\n\n}\n\n/**\n * Creates extruded geometry from a path shape.\n *\n * parameters = {\n *\n * curveSegments: , // number of points on the curves\n * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n * depth: , // Depth to extrude the shape\n *\n * bevelEnabled: , // turn on bevel\n * bevelThickness: , // how deep into the original shape bevel goes\n * bevelSize: , // how far from shape outline (including bevelOffset) is bevel\n * bevelOffset: , // how far from shape outline does bevel start\n * bevelSegments: , // number of bevel layers\n *\n * extrudePath: // curve to extrude shape along\n *\n * UVGenerator: // object that provides UV generator functions\n *\n * }\n */\n\nclass ExtrudeGeometry extends BufferGeometry {\n\n\tconstructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ExtrudeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\toptions: options\n\t\t};\n\n\t\tshapes = Array.isArray( shapes ) ? shapes : [ shapes ];\n\n\t\tconst scope = this;\n\n\t\tconst verticesArray = [];\n\t\tconst uvArray = [];\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\t\t\taddShape( shape );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) );\n\n\t\tthis.computeVertexNormals();\n\n\t\t// functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst placeholder = [];\n\n\t\t\t// options\n\n\t\t\tconst curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\t\t\tconst steps = options.steps !== undefined ? options.steps : 1;\n\t\t\tlet depth = options.depth !== undefined ? options.depth : 1;\n\n\t\t\tlet bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;\n\t\t\tlet bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;\n\t\t\tlet bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1;\n\t\t\tlet bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;\n\t\t\tlet bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\n\t\t\tconst extrudePath = options.extrudePath;\n\n\t\t\tconst uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator;\n\n\t\t\t// deprecated options\n\n\t\t\tif ( options.amount !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' );\n\t\t\t\tdepth = options.amount;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet extrudePts, extrudeByPath = false;\n\t\t\tlet splineTube, binormal, normal, position2;\n\n\t\t\tif ( extrudePath ) {\n\n\t\t\t\textrudePts = extrudePath.getSpacedPoints( steps );\n\n\t\t\t\textrudeByPath = true;\n\t\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\n\t\t\t\t// SETUP TNB variables\n\n\t\t\t\t// TODO1 - have a .isClosed in spline?\n\n\t\t\t\tsplineTube = extrudePath.computeFrenetFrames( steps, false );\n\n\t\t\t\t// console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\t\tbinormal = new Vector3();\n\t\t\t\tnormal = new Vector3();\n\t\t\t\tposition2 = new Vector3();\n\n\t\t\t}\n\n\t\t\t// Safeguards if bevels are not enabled\n\n\t\t\tif ( ! bevelEnabled ) {\n\n\t\t\t\tbevelSegments = 0;\n\t\t\t\tbevelThickness = 0;\n\t\t\t\tbevelSize = 0;\n\t\t\t\tbevelOffset = 0;\n\n\t\t\t}\n\n\t\t\t// Variables initialization\n\n\t\t\tconst shapePoints = shape.extractPoints( curveSegments );\n\n\t\t\tlet vertices = shapePoints.shape;\n\t\t\tconst holes = shapePoints.holes;\n\n\t\t\tconst reverse = ! ShapeUtils.isClockWise( vertices );\n\n\t\t\tif ( reverse ) {\n\n\t\t\t\tvertices = vertices.reverse();\n\n\t\t\t\t// Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\t\tif ( ShapeUtils.isClockWise( ahole ) ) {\n\n\t\t\t\t\t\tholes[ h ] = ahole.reverse();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( vertices, holes );\n\n\t\t\t/* Vertices */\n\n\t\t\tconst contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\tvertices = vertices.concat( ahole );\n\n\t\t\t}\n\n\n\t\t\tfunction scalePt2( pt, vec, size ) {\n\n\t\t\t\tif ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' );\n\n\t\t\t\treturn vec.clone().multiplyScalar( size ).add( pt );\n\n\t\t\t}\n\n\t\t\tconst vlen = vertices.length, flen = faces.length;\n\n\n\t\t\t// Find directions for point movement\n\n\n\t\t\tfunction getBevelVec( inPt, inPrev, inNext ) {\n\n\t\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t\t// shifted by 1 unit (length of normalized vector) to the left\n\t\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t\t//\n\t\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t\t// adjacent edges of inPt at a distance of 1 unit on the left side.\n\n\t\t\t\tlet v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt\n\n\t\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\t\tconst v_prev_x = inPt.x - inPrev.x,\n\t\t\t\t\tv_prev_y = inPt.y - inPrev.y;\n\t\t\t\tconst v_next_x = inNext.x - inPt.x,\n\t\t\t\t\tv_next_y = inNext.y - inPt.y;\n\n\t\t\t\tconst v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );\n\n\t\t\t\t// check for collinear edges\n\t\t\t\tconst collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\tif ( Math.abs( collinear0 ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not collinear\n\n\t\t\t\t\t// length of vectors for normalizing\n\n\t\t\t\t\tconst v_prev_len = Math.sqrt( v_prev_lensq );\n\t\t\t\t\tconst v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );\n\n\t\t\t\t\t// shift adjacent points by unit vectors to the left\n\n\t\t\t\t\tconst ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len );\n\t\t\t\t\tconst ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len );\n\n\t\t\t\t\tconst ptNextShift_x = ( inNext.x - v_next_y / v_next_len );\n\t\t\t\t\tconst ptNextShift_y = ( inNext.y + v_next_x / v_next_len );\n\n\t\t\t\t\t// scaling factor for v_prev to intersection point\n\n\t\t\t\t\tconst sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y -\n\t\t\t\t\t\t\t( ptNextShift_y - ptPrevShift_y ) * v_next_x ) /\n\t\t\t\t\t\t( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\t\t// vector from inPt to intersection point\n\n\t\t\t\t\tv_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );\n\t\t\t\t\tv_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );\n\n\t\t\t\t\t// Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t\t// but prevent crazy spikes\n\t\t\t\t\tconst v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );\n\t\t\t\t\tif ( v_trans_lensq <= 2 ) {\n\n\t\t\t\t\t\treturn new Vector2( v_trans_x, v_trans_y );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_trans_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// handle special case of collinear edges\n\n\t\t\t\t\tlet direction_eq = false; // assumes: opposite\n\n\t\t\t\t\tif ( v_prev_x > Number.EPSILON ) {\n\n\t\t\t\t\t\tif ( v_next_x > Number.EPSILON ) {\n\n\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( v_prev_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\tif ( v_next_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( direction_eq ) {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\t\tv_trans_x = - v_prev_y;\n\t\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight spike\");\n\t\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );\n\n\t\t\t}\n\n\n\t\t\tconst contourMovements = [];\n\n\t\t\tfor ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t// (j)---(i)---(k)\n\t\t\t\t// console.log('i,j,k', i, j , k)\n\n\t\t\t\tcontourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );\n\n\t\t\t}\n\n\t\t\tconst holesMovements = [];\n\t\t\tlet oneHoleMovements, verticesMovements = contourMovements.concat();\n\n\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\toneHoleMovements = [];\n\n\t\t\t\tfor ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t\t// (j)---(i)---(k)\n\t\t\t\t\toneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] );\n\n\t\t\t\t}\n\n\t\t\t\tholesMovements.push( oneHoleMovements );\n\t\t\t\tverticesMovements = verticesMovements.concat( oneHoleMovements );\n\n\t\t\t}\n\n\n\t\t\t// Loop bevelSegments, 1 for the front, 1 for the back\n\n\t\t\tfor ( let b = 0; b < bevelSegments; b ++ ) {\n\n\t\t\t\t//for ( b = bevelSegments; b > 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\n\t\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst bs = bevelSize + bevelOffset;\n\n\t\t\t// Back facing vertices\n\n\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\tv( vert.x, vert.y, 0 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\n\t\t\t\t\tnormal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x );\n\t\t\t\t\tbinormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\tposition2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal );\n\n\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Add stepped vertices...\n\t\t\t// Including front facing vertices\n\n\t\t\tfor ( let s = 1; s <= steps; s ++ ) {\n\n\t\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\tv( vert.x, vert.y, depth / steps * s );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\n\t\t\t\t\t\tnormal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x );\n\t\t\t\t\t\tbinormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\t\tposition2.copy( extrudePts[ s ] ).add( normal ).add( binormal );\n\n\t\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t// Add bevel segments planes\n\n\t\t\t//for ( b = 1; b <= bevelSegments; b ++ ) {\n\t\t\tfor ( let b = bevelSegments - 1; b >= 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/* Faces */\n\n\t\t\t// Top and bottom faces\n\n\t\t\tbuildLidFaces();\n\n\t\t\t// Sides faces\n\n\t\t\tbuildSideFaces();\n\n\n\t\t\t///// Internal functions\n\n\t\t\tfunction buildLidFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\n\t\t\t\tif ( bevelEnabled ) {\n\n\t\t\t\t\tlet layer = 0; // steps + 1\n\t\t\t\t\tlet offset = vlen * layer;\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\t\toffset = vlen * layer;\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ], face[ 1 ], face[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 0 );\n\n\t\t\t}\n\n\t\t\t// Create faces for the z-sides of the shape\n\n\t\t\tfunction buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}\n\n\t\t\tfunction sidewalls( contour, layeroffset ) {\n\n\t\t\t\tlet i = contour.length;\n\n\t\t\t\twhile ( -- i >= 0 ) {\n\n\t\t\t\t\tconst j = i;\n\t\t\t\t\tlet k = i - 1;\n\t\t\t\t\tif ( k < 0 ) k = contour.length - 1;\n\n\t\t\t\t\t//console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\t\tfor ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) {\n\n\t\t\t\t\t\tconst slen1 = vlen * s;\n\t\t\t\t\t\tconst slen2 = vlen * ( s + 1 );\n\n\t\t\t\t\t\tconst a = layeroffset + j + slen1,\n\t\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\t\td = layeroffset + j + slen2;\n\n\t\t\t\t\t\tf4( a, b, c, d );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction v( x, y, z ) {\n\n\t\t\t\tplaceholder.push( x );\n\t\t\t\tplaceholder.push( y );\n\t\t\t\tplaceholder.push( z );\n\n\t\t\t}\n\n\n\t\t\tfunction f3( a, b, c ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\n\t\t\t}\n\n\t\t\tfunction f4( a, b, c, d ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( d );\n\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\t\t\t\taddVertex( d );\n\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t}\n\n\t\t\tfunction addVertex( index ) {\n\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 0 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 1 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 2 ] );\n\n\t\t\t}\n\n\n\t\t\tfunction addUV( vector2 ) {\n\n\t\t\t\tuvArray.push( vector2.x );\n\t\t\t\tuvArray.push( vector2.y );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\t\tconst options = this.parameters.options;\n\n\t\treturn toJSON$1( shapes, options, data );\n\n\t}\n\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\tconst extrudePath = data.options.extrudePath;\n\n\t\tif ( extrudePath !== undefined ) {\n\n\t\t\tdata.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath );\n\n\t\t}\n\n\t\treturn new ExtrudeGeometry( geometryShapes, data.options );\n\n\t}\n\n}\n\nconst WorldUVGenerator = {\n\n\tgenerateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\n\t\treturn [\n\t\t\tnew Vector2( a_x, a_y ),\n\t\t\tnew Vector2( b_x, b_y ),\n\t\t\tnew Vector2( c_x, c_y )\n\t\t];\n\n\t},\n\n\tgenerateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst a_z = vertices[ indexA * 3 + 2 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst b_z = vertices[ indexB * 3 + 2 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\t\tconst c_z = vertices[ indexC * 3 + 2 ];\n\t\tconst d_x = vertices[ indexD * 3 ];\n\t\tconst d_y = vertices[ indexD * 3 + 1 ];\n\t\tconst d_z = vertices[ indexD * 3 + 2 ];\n\n\t\tif ( Math.abs( a_y - b_y ) < Math.abs( a_x - b_x ) ) {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_x, 1 - a_z ),\n\t\t\t\tnew Vector2( b_x, 1 - b_z ),\n\t\t\t\tnew Vector2( c_x, 1 - c_z ),\n\t\t\t\tnew Vector2( d_x, 1 - d_z )\n\t\t\t];\n\n\t\t} else {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_y, 1 - a_z ),\n\t\t\t\tnew Vector2( b_y, 1 - b_z ),\n\t\t\t\tnew Vector2( c_y, 1 - c_z ),\n\t\t\t\tnew Vector2( d_y, 1 - d_z )\n\t\t\t];\n\n\t\t}\n\n\t}\n\n};\n\nfunction toJSON$1( shapes, options, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\tif ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON();\n\n\treturn data;\n\n}\n\nclass IcosahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\n\t\tconst vertices = [\n\t\t\t- 1, t, 0, \t1, t, 0, \t- 1, - t, 0, \t1, - t, 0,\n\t\t\t0, - 1, t, \t0, 1, t,\t0, - 1, - t, \t0, 1, - t,\n\t\t\tt, 0, - 1, \tt, 0, 1, \t- t, 0, - 1, \t- t, 0, 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 11, 5, \t0, 5, 1, \t0, 1, 7, \t0, 7, 10, \t0, 10, 11,\n\t\t\t1, 5, 9, \t5, 11, 4,\t11, 10, 2,\t10, 7, 6,\t7, 1, 8,\n\t\t\t3, 9, 4, \t3, 4, 2,\t3, 2, 6,\t3, 6, 8,\t3, 8, 9,\n\t\t\t4, 9, 5, \t2, 4, 11,\t6, 2, 10,\t8, 6, 7,\t9, 8, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'IcosahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new IcosahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass LatheGeometry extends BufferGeometry {\n\n\tconstructor( points = [ new Vector2( 0, 0.5 ), new Vector2( 0.5, 0 ), new Vector2( 0, - 0.5 ) ], segments = 12, phiStart = 0, phiLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LatheGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpoints: points,\n\t\t\tsegments: segments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength\n\t\t};\n\n\t\tsegments = Math.floor( segments );\n\n\t\t// clamp phiLength so it's in range of [ 0, 2PI ]\n\n\t\tphiLength = clamp( phiLength, 0, Math.PI * 2 );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst uvs = [];\n\t\tconst initNormals = [];\n\t\tconst normals = [];\n\n\t\t// helper variables\n\n\t\tconst inverseSegments = 1.0 / segments;\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tconst normal = new Vector3();\n\t\tconst curNormal = new Vector3();\n\t\tconst prevNormal = new Vector3();\n\t\tlet dx = 0;\n\t\tlet dy = 0;\n\n\t\t// pre-compute normals for initial \"meridian\"\n\n\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\tswitch ( j ) {\n\n\t\t\t\tcase 0:\t\t\t\t// special handling for 1st vertex on path\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tprevNormal.copy( normal );\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ( points.length - 1 ):\t// special handling for last Vertex on path\n\n\t\t\t\t\tinitNormals.push( prevNormal.x, prevNormal.y, prevNormal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\t\t\t// default handling for all vertices in between\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tcurNormal.copy( normal );\n\n\t\t\t\t\tnormal.x += prevNormal.x;\n\t\t\t\t\tnormal.y += prevNormal.y;\n\t\t\t\t\tnormal.z += prevNormal.z;\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tprevNormal.copy( curNormal );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate vertices, uvs and normals\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst phi = phiStart + i * inverseSegments * phiLength;\n\n\t\t\tconst sin = Math.sin( phi );\n\t\t\tconst cos = Math.cos( phi );\n\n\t\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = points[ j ].x * sin;\n\t\t\t\tvertex.y = points[ j ].y;\n\t\t\t\tvertex.z = points[ j ].x * cos;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = i / segments;\n\t\t\t\tuv.y = j / ( points.length - 1 );\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// normal\n\n\t\t\t\tconst x = initNormals[ 3 * j + 0 ] * sin;\n\t\t\t\tconst y = initNormals[ 3 * j + 1 ];\n\t\t\t\tconst z = initNormals[ 3 * j + 0 ] * cos;\n\n\t\t\t\tnormals.push( x, y, z );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 0; i < segments; i ++ ) {\n\n\t\t\tfor ( let j = 0; j < ( points.length - 1 ); j ++ ) {\n\n\t\t\t\tconst base = j + i * points.length;\n\n\t\t\t\tconst a = base;\n\t\t\t\tconst b = base + points.length;\n\t\t\t\tconst c = base + points.length + 1;\n\t\t\t\tconst d = base + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( c, d, b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength );\n\n\t}\n\n}\n\nclass OctahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 0, 0, \t- 1, 0, 0,\t0, 1, 0,\n\t\t\t0, - 1, 0, \t0, 0, 1,\t0, 0, - 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 2, 4,\t0, 4, 3,\t0, 3, 5,\n\t\t\t0, 5, 2,\t1, 2, 5,\t1, 5, 3,\n\t\t\t1, 3, 4,\t1, 4, 2\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'OctahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new OctahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass RingGeometry extends BufferGeometry {\n\n\tconstructor( innerRadius = 0.5, outerRadius = 1, thetaSegments = 8, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'RingGeometry';\n\n\t\tthis.parameters = {\n\t\t\tinnerRadius: innerRadius,\n\t\t\touterRadius: outerRadius,\n\t\t\tthetaSegments: thetaSegments,\n\t\t\tphiSegments: phiSegments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthetaSegments = Math.max( 3, thetaSegments );\n\t\tphiSegments = Math.max( 1, phiSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// some helper variables\n\n\t\tlet radius = innerRadius;\n\t\tconst radiusStep = ( ( outerRadius - innerRadius ) / phiSegments );\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= phiSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= thetaSegments; i ++ ) {\n\n\t\t\t\t// values are generate from the inside of the ring to the outside\n\n\t\t\t\tconst segment = thetaStart + i / thetaSegments * thetaLength;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( vertex.x / outerRadius + 1 ) / 2;\n\t\t\t\tuv.y = ( vertex.y / outerRadius + 1 ) / 2;\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t}\n\n\t\t\t// increase the radius for next row of vertices\n\n\t\t\tradius += radiusStep;\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let j = 0; j < phiSegments; j ++ ) {\n\n\t\t\tconst thetaSegmentLevel = j * ( thetaSegments + 1 );\n\n\t\t\tfor ( let i = 0; i < thetaSegments; i ++ ) {\n\n\t\t\t\tconst segment = i + thetaSegmentLevel;\n\n\t\t\t\tconst a = segment;\n\t\t\t\tconst b = segment + thetaSegments + 1;\n\t\t\t\tconst c = segment + thetaSegments + 2;\n\t\t\t\tconst d = segment + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass ShapeGeometry extends BufferGeometry {\n\n\tconstructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), curveSegments = 12 ) {\n\n\t\tsuper();\n\t\tthis.type = 'ShapeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\tcurveSegments: curveSegments\n\t\t};\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet groupStart = 0;\n\t\tlet groupCount = 0;\n\n\t\t// allow single and array values for \"shapes\" parameter\n\n\t\tif ( Array.isArray( shapes ) === false ) {\n\n\t\t\taddShape( shapes );\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0; i < shapes.length; i ++ ) {\n\n\t\t\t\taddShape( shapes[ i ] );\n\n\t\t\t\tthis.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t\tgroupCount = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\n\t\t// helper functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst indexOffset = vertices.length / 3;\n\t\t\tconst points = shape.extractPoints( curveSegments );\n\n\t\t\tlet shapeVertices = points.shape;\n\t\t\tconst shapeHoles = points.holes;\n\n\t\t\t// check direction of vertices\n\n\t\t\tif ( ShapeUtils.isClockWise( shapeVertices ) === false ) {\n\n\t\t\t\tshapeVertices = shapeVertices.reverse();\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\n\t\t\t\tif ( ShapeUtils.isClockWise( shapeHole ) === true ) {\n\n\t\t\t\t\tshapeHoles[ i ] = shapeHole.reverse();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles );\n\n\t\t\t// join vertices of inner and outer paths to a single array\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\t\t\t\tshapeVertices = shapeVertices.concat( shapeHole );\n\n\t\t\t}\n\n\t\t\t// vertices, normals, uvs\n\n\t\t\tfor ( let i = 0, l = shapeVertices.length; i < l; i ++ ) {\n\n\t\t\t\tconst vertex = shapeVertices[ i ];\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, 0 );\n\t\t\t\tnormals.push( 0, 0, 1 );\n\t\t\t\tuvs.push( vertex.x, vertex.y ); // world uvs\n\n\t\t\t}\n\n\t\t\t// incides\n\n\t\t\tfor ( let i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\tconst face = faces[ i ];\n\n\t\t\t\tconst a = face[ 0 ] + indexOffset;\n\t\t\t\tconst b = face[ 1 ] + indexOffset;\n\t\t\t\tconst c = face[ 2 ] + indexOffset;\n\n\t\t\t\tindices.push( a, b, c );\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\n\t\treturn toJSON( shapes, data );\n\n\t}\n\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\treturn new ShapeGeometry( geometryShapes, data.curveSegments );\n\n\t}\n\n}\n\nfunction toJSON( shapes, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\treturn data;\n\n}\n\nclass SphereGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {\n\n\t\tsuper();\n\t\tthis.type = 'SphereGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) );\n\n\t\tconst thetaEnd = Math.min( thetaStart + thetaLength, Math.PI );\n\n\t\tlet index = 0;\n\t\tconst grid = [];\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let iy = 0; iy <= heightSegments; iy ++ ) {\n\n\t\t\tconst verticesRow = [];\n\n\t\t\tconst v = iy / heightSegments;\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy == 0 && thetaStart == 0 ) {\n\n\t\t\t\tuOffset = 0.5 / widthSegments;\n\n\t\t\t} else if ( iy == heightSegments && thetaEnd == Math.PI ) {\n\n\t\t\t\tuOffset = - 0.5 / widthSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix <= widthSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / widthSegments;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\t\t\t\tvertex.y = radius * Math.cos( thetaStart + v * thetaLength );\n\t\t\t\tvertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.copy( vertex ).normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, 1 - v );\n\n\t\t\t\tverticesRow.push( index ++ );\n\n\t\t\t}\n\n\t\t\tgrid.push( verticesRow );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let iy = 0; iy < heightSegments; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < widthSegments; ix ++ ) {\n\n\t\t\t\tconst a = grid[ iy ][ ix + 1 ];\n\t\t\t\tconst b = grid[ iy ][ ix ];\n\t\t\t\tconst c = grid[ iy + 1 ][ ix ];\n\t\t\t\tconst d = grid[ iy + 1 ][ ix + 1 ];\n\n\t\t\t\tif ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d );\n\t\t\t\tif ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass TetrahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 1, 1, \t- 1, - 1, 1, \t- 1, 1, - 1, \t1, - 1, - 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t2, 1, 0, \t0, 3, 2,\t1, 3, 0,\t2, 3, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'TetrahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TetrahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass TorusGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, tube = 0.4, radialSegments = 8, tubularSegments = 6, arc = Math.PI * 2 ) {\n\n\t\tsuper();\n\t\tthis.type = 'TorusGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\ttubularSegments = Math.floor( tubularSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst center = new Vector3();\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tconst u = i / tubularSegments * arc;\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u );\n\t\t\t\tvertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u );\n\t\t\t\tvertex.z = tube * Math.sin( v );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tcenter.x = radius * Math.cos( u );\n\t\t\t\tcenter.y = radius * Math.sin( u );\n\t\t\t\tnormal.subVectors( vertex, center ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= tubularSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( tubularSegments + 1 ) * j + i - 1;\n\t\t\t\tconst b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1;\n\t\t\t\tconst c = ( tubularSegments + 1 ) * ( j - 1 ) + i;\n\t\t\t\tconst d = ( tubularSegments + 1 ) * j + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc );\n\n\t}\n\n}\n\nclass TorusKnotGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) {\n\n\t\tsuper();\n\t\tthis.type = 'TorusKnotGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\tp: p,\n\t\t\tq: q\n\t\t};\n\n\t\ttubularSegments = Math.floor( tubularSegments );\n\t\tradialSegments = Math.floor( radialSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\tconst P1 = new Vector3();\n\t\tconst P2 = new Vector3();\n\n\t\tconst B = new Vector3();\n\t\tconst T = new Vector3();\n\t\tconst N = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let i = 0; i <= tubularSegments; ++ i ) {\n\n\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segement\n\n\t\t\tconst u = i / tubularSegments * p * Math.PI * 2;\n\n\t\t\t// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\tcalculatePositionOnCurve( u, p, q, radius, P1 );\n\t\t\tcalculatePositionOnCurve( u + 0.01, p, q, radius, P2 );\n\n\t\t\t// calculate orthonormal basis\n\n\t\t\tT.subVectors( P2, P1 );\n\t\t\tN.addVectors( P2, P1 );\n\t\t\tB.crossVectors( T, N );\n\t\t\tN.crossVectors( B, T );\n\n\t\t\t// normalize B, N. T can be ignored, we don't use it\n\n\t\t\tB.normalize();\n\t\t\tN.normalize();\n\n\t\t\tfor ( let j = 0; j <= radialSegments; ++ j ) {\n\n\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\tconst cx = - tube * Math.cos( v );\n\t\t\t\tconst cy = tube * Math.sin( v );\n\n\t\t\t\t// now calculate the final vertex position.\n\t\t\t\t// first we orient the extrusion with our basis vectos, then we add it to the current position on the curve\n\n\t\t\t\tvertex.x = P1.x + ( cx * N.x + cy * B.x );\n\t\t\t\tvertex.y = P1.y + ( cx * N.y + cy * B.y );\n\t\t\t\tvertex.z = P1.z + ( cx * N.z + cy * B.z );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\n\t\t\t\tnormal.subVectors( vertex, P1 ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// this function calculates the current position on the torus curve\n\n\t\tfunction calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q );\n\n\t}\n\n}\n\nclass TubeGeometry extends BufferGeometry {\n\n\tconstructor( path = new QuadraticBezierCurve3( new Vector3( - 1, - 1, 0 ), new Vector3( - 1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) {\n\n\t\tsuper();\n\t\tthis.type = 'TubeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpath: path,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradius: radius,\n\t\t\tradialSegments: radialSegments,\n\t\t\tclosed: closed\n\t\t};\n\n\t\tconst frames = path.computeFrenetFrames( tubularSegments, closed );\n\n\t\t// expose internals\n\n\t\tthis.tangents = frames.tangents;\n\t\tthis.normals = frames.normals;\n\t\tthis.binormals = frames.binormals;\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tlet P = new Vector3();\n\n\t\t// buffer\n\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\t\tconst indices = [];\n\n\t\t// create buffer data\n\n\t\tgenerateBufferData();\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// functions\n\n\t\tfunction generateBufferData() {\n\n\t\t\tfor ( let i = 0; i < tubularSegments; i ++ ) {\n\n\t\t\t\tgenerateSegment( i );\n\n\t\t\t}\n\n\t\t\t// if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t// at the regular position on the given path\n\t\t\t//\n\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\t\t\tgenerateSegment( ( closed === false ) ? tubularSegments : 0 );\n\n\t\t\t// uvs are generated in a separate function.\n\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\tgenerateUVs();\n\n\t\t\t// finally create faces\n\n\t\t\tgenerateIndices();\n\n\t\t}\n\n\t\tfunction generateSegment( i ) {\n\n\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\n\t\t\tP = path.getPointAt( i / tubularSegments, P );\n\n\t\t\t// retrieve corresponding normal and binormal\n\n\t\t\tconst N = frames.normals[ i ];\n\t\t\tconst B = frames.binormals[ i ];\n\n\t\t\t// generate normals and vertices for the current segment\n\n\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\tconst sin = Math.sin( v );\n\t\t\t\tconst cos = - Math.cos( v );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.x = ( cos * N.x + sin * B.x );\n\t\t\t\tnormal.y = ( cos * N.y + sin * B.y );\n\t\t\t\tnormal.z = ( cos * N.z + sin * B.z );\n\t\t\t\tnormal.normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\tvertex.z = P.z + radius * normal.z;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateIndices() {\n\n\t\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\tuv.y = j / radialSegments;\n\n\t\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.path = this.parameters.path.toJSON();\n\n\t\treturn data;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\t// This only works for built-in curves (e.g. CatmullRomCurve3).\n\t\t// User defined curves or instances of CurvePath will not be deserialized.\n\t\treturn new TubeGeometry(\n\t\t\tnew Curves[ data.path.type ]().fromJSON( data.path ),\n\t\t\tdata.tubularSegments,\n\t\t\tdata.radius,\n\t\t\tdata.radialSegments,\n\t\t\tdata.closed\n\t\t);\n\n\t}\n\n}\n\nclass WireframeGeometry extends BufferGeometry {\n\n\tconstructor( geometry = null ) {\n\n\t\tsuper();\n\t\tthis.type = 'WireframeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\t// buffer\n\n\t\t\tconst vertices = [];\n\t\t\tconst edges = new Set();\n\n\t\t\t// helper variables\n\n\t\t\tconst start = new Vector3();\n\t\t\tconst end = new Vector3();\n\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\t// indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tconst indices = geometry.index;\n\t\t\t\tlet groups = geometry.groups;\n\n\t\t\t\tif ( groups.length === 0 ) {\n\n\t\t\t\t\tgroups = [ { start: 0, count: indices.count, materialIndex: 0 } ];\n\n\t\t\t\t}\n\n\t\t\t\t// create a data structure that contains all eges without duplicates\n\n\t\t\t\tfor ( let o = 0, ol = groups.length; o < ol; ++ o ) {\n\n\t\t\t\t\tconst group = groups[ o ];\n\n\t\t\t\t\tconst groupStart = group.start;\n\t\t\t\t\tconst groupCount = group.count;\n\n\t\t\t\t\tfor ( let i = groupStart, l = ( groupStart + groupCount ); i < l; i += 3 ) {\n\n\t\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\tconst index1 = indices.getX( i + j );\n\t\t\t\t\t\t\tconst index2 = indices.getX( i + ( j + 1 ) % 3 );\n\n\t\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\n\t\t\t\tfor ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {\n\n\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t// three edges per triangle, an edge is represented as (index1, index2)\n\t\t\t\t\t\t// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\n\n\t\t\t\t\t\tconst index1 = 3 * i + j;\n\t\t\t\t\t\tconst index2 = 3 * i + ( ( j + 1 ) % 3 );\n\n\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// build geometry\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n}\n\nfunction isUniqueEdge( start, end, edges ) {\n\n\tconst hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;\n\tconst hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge\n\n\tif ( edges.has( hash1 ) === true || edges.has( hash2 ) === true ) {\n\n\t\treturn false;\n\n\t} else {\n\n\t\tedges.add( hash1, hash2 );\n\t\treturn true;\n\n\t}\n\n}\n\nvar Geometries = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tBoxGeometry: BoxGeometry,\n\tBoxBufferGeometry: BoxGeometry,\n\tCircleGeometry: CircleGeometry,\n\tCircleBufferGeometry: CircleGeometry,\n\tConeGeometry: ConeGeometry,\n\tConeBufferGeometry: ConeGeometry,\n\tCylinderGeometry: CylinderGeometry,\n\tCylinderBufferGeometry: CylinderGeometry,\n\tDodecahedronGeometry: DodecahedronGeometry,\n\tDodecahedronBufferGeometry: DodecahedronGeometry,\n\tEdgesGeometry: EdgesGeometry,\n\tExtrudeGeometry: ExtrudeGeometry,\n\tExtrudeBufferGeometry: ExtrudeGeometry,\n\tIcosahedronGeometry: IcosahedronGeometry,\n\tIcosahedronBufferGeometry: IcosahedronGeometry,\n\tLatheGeometry: LatheGeometry,\n\tLatheBufferGeometry: LatheGeometry,\n\tOctahedronGeometry: OctahedronGeometry,\n\tOctahedronBufferGeometry: OctahedronGeometry,\n\tPlaneGeometry: PlaneGeometry,\n\tPlaneBufferGeometry: PlaneGeometry,\n\tPolyhedronGeometry: PolyhedronGeometry,\n\tPolyhedronBufferGeometry: PolyhedronGeometry,\n\tRingGeometry: RingGeometry,\n\tRingBufferGeometry: RingGeometry,\n\tShapeGeometry: ShapeGeometry,\n\tShapeBufferGeometry: ShapeGeometry,\n\tSphereGeometry: SphereGeometry,\n\tSphereBufferGeometry: SphereGeometry,\n\tTetrahedronGeometry: TetrahedronGeometry,\n\tTetrahedronBufferGeometry: TetrahedronGeometry,\n\tTorusGeometry: TorusGeometry,\n\tTorusBufferGeometry: TorusGeometry,\n\tTorusKnotGeometry: TorusKnotGeometry,\n\tTorusKnotBufferGeometry: TorusKnotGeometry,\n\tTubeGeometry: TubeGeometry,\n\tTubeBufferGeometry: TubeGeometry,\n\tWireframeGeometry: WireframeGeometry\n});\n\n/**\n * parameters = {\n * color: \n * }\n */\n\nclass ShadowMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ShadowMaterial';\n\n\t\tthis.color = new Color( 0x000000 );\n\t\tthis.transparent = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\treturn this;\n\n\t}\n\n}\n\nShadowMaterial.prototype.isShadowMaterial = true;\n\n/**\n * parameters = {\n * color: ,\n * roughness: ,\n * metalness: ,\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * emissive: ,\n * emissiveIntensity: \n * emissiveMap: new THREE.Texture( ),\n *\n * bumpMap: new THREE.Texture( ),\n * bumpScale: ,\n *\n * normalMap: new THREE.Texture( ),\n * normalMapType: THREE.TangentSpaceNormalMap,\n * normalScale: ,\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * roughnessMap: new THREE.Texture( ),\n *\n * metalnessMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n * envMapIntensity: \n *\n * refractionRatio: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * flatShading: \n * }\n */\n\nclass MeshStandardMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.type = 'MeshStandardMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.roughness = 1.0;\n\t\tthis.metalness = 0.0;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.roughnessMap = null;\n\n\t\tthis.metalnessMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapIntensity = 1.0;\n\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.color.copy( source.color );\n\t\tthis.roughness = source.roughness;\n\t\tthis.metalness = source.metalness;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.roughnessMap = source.roughnessMap;\n\n\t\tthis.metalnessMap = source.metalnessMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapIntensity = source.envMapIntensity;\n\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshStandardMaterial.prototype.isMeshStandardMaterial = true;\n\n/**\n * parameters = {\n * clearcoat: ,\n * clearcoatMap: new THREE.Texture( ),\n * clearcoatRoughness: ,\n * clearcoatRoughnessMap: new THREE.Texture( ),\n * clearcoatNormalScale: ,\n * clearcoatNormalMap: new THREE.Texture( ),\n *\n * ior: ,\n * reflectivity: ,\n *\n * sheen: ,\n * sheenColor: ,\n * sheenColorMap: new THREE.Texture( ),\n * sheenRoughness: ,\n * sheenRoughnessMap: new THREE.Texture( ),\n *\n * transmission: ,\n * transmissionMap: new THREE.Texture( ),\n *\n * thickness: ,\n * thicknessMap: new THREE.Texture( ),\n * attenuationDistance: ,\n * attenuationColor: ,\n *\n * specularIntensity: ,\n * specularIntensityMap: new THREE.Texture( ),\n * specularColor: ,\n * specularColorMap: new THREE.Texture( )\n * }\n */\n\nclass MeshPhysicalMaterial extends MeshStandardMaterial {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.type = 'MeshPhysicalMaterial';\n\n\t\tthis.clearcoatMap = null;\n\t\tthis.clearcoatRoughness = 0.0;\n\t\tthis.clearcoatRoughnessMap = null;\n\t\tthis.clearcoatNormalScale = new Vector2( 1, 1 );\n\t\tthis.clearcoatNormalMap = null;\n\n\t\tthis.ior = 1.5;\n\n\t\tObject.defineProperty( this, 'reflectivity', {\n\t\t\tget: function () {\n\n\t\t\t\treturn ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) );\n\n\t\t\t},\n\t\t\tset: function ( reflectivity ) {\n\n\t\t\t\tthis.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity );\n\n\t\t\t}\n\t\t} );\n\n\t\tthis.sheenColor = new Color( 0x000000 );\n\t\tthis.sheenColorMap = null;\n\t\tthis.sheenRoughness = 1.0;\n\t\tthis.sheenRoughnessMap = null;\n\n\t\tthis.transmissionMap = null;\n\n\t\tthis.thickness = 0;\n\t\tthis.thicknessMap = null;\n\t\tthis.attenuationDistance = 0.0;\n\t\tthis.attenuationColor = new Color( 1, 1, 1 );\n\n\t\tthis.specularIntensity = 1.0;\n\t\tthis.specularIntensityMap = null;\n\t\tthis.specularColor = new Color( 1, 1, 1 );\n\t\tthis.specularColorMap = null;\n\n\t\tthis._sheen = 0.0;\n\t\tthis._clearcoat = 0;\n\t\tthis._transmission = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tget sheen() {\n\n\t\treturn this._sheen;\n\n\t}\n\n\tset sheen( value ) {\n\n\t\tif ( this._sheen > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._sheen = value;\n\n\t}\n\n\tget clearcoat() {\n\n\t\treturn this._clearcoat;\n\n\t}\n\n\tset clearcoat( value ) {\n\n\t\tif ( this._clearcoat > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._clearcoat = value;\n\n\t}\n\n\tget transmission() {\n\n\t\treturn this._transmission;\n\n\t}\n\n\tset transmission( value ) {\n\n\t\tif ( this._transmission > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._transmission = value;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.clearcoat = source.clearcoat;\n\t\tthis.clearcoatMap = source.clearcoatMap;\n\t\tthis.clearcoatRoughness = source.clearcoatRoughness;\n\t\tthis.clearcoatRoughnessMap = source.clearcoatRoughnessMap;\n\t\tthis.clearcoatNormalMap = source.clearcoatNormalMap;\n\t\tthis.clearcoatNormalScale.copy( source.clearcoatNormalScale );\n\n\t\tthis.ior = source.ior;\n\n\t\tthis.sheen = source.sheen;\n\t\tthis.sheenColor.copy( source.sheenColor );\n\t\tthis.sheenColorMap = source.sheenColorMap;\n\t\tthis.sheenRoughness = source.sheenRoughness;\n\t\tthis.sheenRoughnessMap = source.sheenRoughnessMap;\n\n\t\tthis.transmission = source.transmission;\n\t\tthis.transmissionMap = source.transmissionMap;\n\n\t\tthis.thickness = source.thickness;\n\t\tthis.thicknessMap = source.thicknessMap;\n\t\tthis.attenuationDistance = source.attenuationDistance;\n\t\tthis.attenuationColor.copy( source.attenuationColor );\n\n\t\tthis.specularIntensity = source.specularIntensity;\n\t\tthis.specularIntensityMap = source.specularIntensityMap;\n\t\tthis.specularColor.copy( source.specularColor );\n\t\tthis.specularColorMap = source.specularColorMap;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;\n\n/**\n * parameters = {\n * color: ,\n * specular: ,\n * shininess: ,\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * emissive: ,\n * emissiveIntensity: \n * emissiveMap: new THREE.Texture( ),\n *\n * bumpMap: new THREE.Texture( ),\n * bumpScale: ,\n *\n * normalMap: new THREE.Texture( ),\n * normalMapType: THREE.TangentSpaceNormalMap,\n * normalScale: ,\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * specularMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n * combine: THREE.MultiplyOperation,\n * reflectivity: ,\n * refractionRatio: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * flatShading: \n * }\n */\n\nclass MeshPhongMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'MeshPhongMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.specular = new Color( 0x111111 );\n\t\tthis.shininess = 30;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.specular.copy( source.specular );\n\t\tthis.shininess = source.shininess;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshPhongMaterial.prototype.isMeshPhongMaterial = true;\n\n/**\n * parameters = {\n * color: ,\n *\n * map: new THREE.Texture( ),\n * gradientMap: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * emissive: ,\n * emissiveIntensity: \n * emissiveMap: new THREE.Texture( ),\n *\n * bumpMap: new THREE.Texture( ),\n * bumpScale: ,\n *\n * normalMap: new THREE.Texture( ),\n * normalMapType: THREE.TangentSpaceNormalMap,\n * normalScale: ,\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * alphaMap: new THREE.Texture( ),\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * }\n */\n\nclass MeshToonMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.defines = { 'TOON': '' };\n\n\t\tthis.type = 'MeshToonMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\t\tthis.gradientMap = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\t\tthis.gradientMap = source.gradientMap;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshToonMaterial.prototype.isMeshToonMaterial = true;\n\n/**\n * parameters = {\n * opacity: ,\n *\n * bumpMap: new THREE.Texture( ),\n * bumpScale: ,\n *\n * normalMap: new THREE.Texture( ),\n * normalMapType: THREE.TangentSpaceNormalMap,\n * normalScale: ,\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * wireframe: ,\n * wireframeLinewidth: \n *\n * flatShading: \n * }\n */\n\nclass MeshNormalMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'MeshNormalMaterial';\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false;\n\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshNormalMaterial.prototype.isMeshNormalMaterial = true;\n\n/**\n * parameters = {\n * color: ,\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * emissive: ,\n * emissiveIntensity: \n * emissiveMap: new THREE.Texture( ),\n *\n * specularMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n * combine: THREE.Multiply,\n * reflectivity: ,\n * refractionRatio: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * }\n */\n\nclass MeshLambertMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'MeshLambertMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshLambertMaterial.prototype.isMeshLambertMaterial = true;\n\n/**\n * parameters = {\n * color: ,\n * opacity: ,\n *\n * matcap: new THREE.Texture( ),\n *\n * map: new THREE.Texture( ),\n *\n * bumpMap: new THREE.Texture( ),\n * bumpScale: ,\n *\n * normalMap: new THREE.Texture( ),\n * normalMapType: THREE.TangentSpaceNormalMap,\n * normalScale: ,\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * alphaMap: new THREE.Texture( ),\n *\n * flatShading: \n * }\n */\n\nclass MeshMatcapMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.type = 'MeshMatcapMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\tthis.matcap = null;\n\n\t\tthis.map = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.matcap = source.matcap;\n\n\t\tthis.map = source.map;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\nMeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;\n\n/**\n * parameters = {\n * color: ,\n * opacity: ,\n *\n * linewidth: ,\n *\n * scale: ,\n * dashSize: ,\n * gapSize: \n * }\n */\n\nclass LineDashedMaterial extends LineBasicMaterial {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LineDashedMaterial';\n\n\t\tthis.scale = 1;\n\t\tthis.dashSize = 3;\n\t\tthis.gapSize = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.scale = source.scale;\n\t\tthis.dashSize = source.dashSize;\n\t\tthis.gapSize = source.gapSize;\n\n\t\treturn this;\n\n\t}\n\n}\n\nLineDashedMaterial.prototype.isLineDashedMaterial = true;\n\nvar Materials = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tShadowMaterial: ShadowMaterial,\n\tSpriteMaterial: SpriteMaterial,\n\tRawShaderMaterial: RawShaderMaterial,\n\tShaderMaterial: ShaderMaterial,\n\tPointsMaterial: PointsMaterial,\n\tMeshPhysicalMaterial: MeshPhysicalMaterial,\n\tMeshStandardMaterial: MeshStandardMaterial,\n\tMeshPhongMaterial: MeshPhongMaterial,\n\tMeshToonMaterial: MeshToonMaterial,\n\tMeshNormalMaterial: MeshNormalMaterial,\n\tMeshLambertMaterial: MeshLambertMaterial,\n\tMeshDepthMaterial: MeshDepthMaterial,\n\tMeshDistanceMaterial: MeshDistanceMaterial,\n\tMeshBasicMaterial: MeshBasicMaterial,\n\tMeshMatcapMaterial: MeshMatcapMaterial,\n\tLineDashedMaterial: LineDashedMaterial,\n\tLineBasicMaterial: LineBasicMaterial,\n\tMaterial: Material\n});\n\nconst AnimationUtils = {\n\n\t// same as Array.prototype.slice, but also works on typed arrays\n\tarraySlice: function ( array, from, to ) {\n\n\t\tif ( AnimationUtils.isTypedArray( array ) ) {\n\n\t\t\t// in ios9 array.subarray(from, undefined) will return empty array\n\t\t\t// but array.subarray(from) or array.subarray(from, len) is correct\n\t\t\treturn new array.constructor( array.subarray( from, to !== undefined ? to : array.length ) );\n\n\t\t}\n\n\t\treturn array.slice( from, to );\n\n\t},\n\n\t// converts an array to a specific type\n\tconvertArray: function ( array, type, forceClone ) {\n\n\t\tif ( ! array || // let 'undefined' and 'null' pass\n\t\t\t! forceClone && array.constructor === type ) return array;\n\n\t\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\t\treturn new type( array ); // create typed array\n\n\t\t}\n\n\t\treturn Array.prototype.slice.call( array ); // create Array\n\n\t},\n\n\tisTypedArray: function ( object ) {\n\n\t\treturn ArrayBuffer.isView( object ) &&\n\t\t\t! ( object instanceof DataView );\n\n\t},\n\n\t// returns an array by which times and values can be sorted\n\tgetKeyframeOrder: function ( times ) {\n\n\t\tfunction compareTime( i, j ) {\n\n\t\t\treturn times[ i ] - times[ j ];\n\n\t\t}\n\n\t\tconst n = times.length;\n\t\tconst result = new Array( n );\n\t\tfor ( let i = 0; i !== n; ++ i ) result[ i ] = i;\n\n\t\tresult.sort( compareTime );\n\n\t\treturn result;\n\n\t},\n\n\t// uses the array previously returned by 'getKeyframeOrder' to sort data\n\tsortedArray: function ( values, stride, order ) {\n\n\t\tconst nValues = values.length;\n\t\tconst result = new values.constructor( nValues );\n\n\t\tfor ( let i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) {\n\n\t\t\tconst srcOffset = order[ i ] * stride;\n\n\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\tresult[ dstOffset ++ ] = values[ srcOffset + j ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn result;\n\n\t},\n\n\t// function for parsing AOS keyframe formats\n\tflattenJSON: function ( jsonKeys, times, values, valuePropertyName ) {\n\n\t\tlet i = 1, key = jsonKeys[ 0 ];\n\n\t\twhile ( key !== undefined && key[ valuePropertyName ] === undefined ) {\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t}\n\n\t\tif ( key === undefined ) return; // no data\n\n\t\tlet value = key[ valuePropertyName ];\n\t\tif ( value === undefined ) return; // no data\n\n\t\tif ( Array.isArray( value ) ) {\n\n\t\t\tdo {\n\n\t\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\ttimes.push( key.time );\n\t\t\t\t\tvalues.push.apply( values, value ); // push all elements\n\n\t\t\t\t}\n\n\t\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t\t} while ( key !== undefined );\n\n\t\t} else if ( value.toArray !== undefined ) {\n\n\t\t\t// ...assume THREE.Math-ish\n\n\t\t\tdo {\n\n\t\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\ttimes.push( key.time );\n\t\t\t\t\tvalue.toArray( values, values.length );\n\n\t\t\t\t}\n\n\t\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t\t} while ( key !== undefined );\n\n\t\t} else {\n\n\t\t\t// otherwise push as-is\n\n\t\t\tdo {\n\n\t\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\ttimes.push( key.time );\n\t\t\t\t\tvalues.push( value );\n\n\t\t\t\t}\n\n\t\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t\t} while ( key !== undefined );\n\n\t\t}\n\n\t},\n\n\tsubclip: function ( sourceClip, name, startFrame, endFrame, fps = 30 ) {\n\n\t\tconst clip = sourceClip.clone();\n\n\t\tclip.name = name;\n\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\t\tconst track = clip.tracks[ i ];\n\t\t\tconst valueSize = track.getValueSize();\n\n\t\t\tconst times = [];\n\t\t\tconst values = [];\n\n\t\t\tfor ( let j = 0; j < track.times.length; ++ j ) {\n\n\t\t\t\tconst frame = track.times[ j ] * fps;\n\n\t\t\t\tif ( frame < startFrame || frame >= endFrame ) continue;\n\n\t\t\t\ttimes.push( track.times[ j ] );\n\n\t\t\t\tfor ( let k = 0; k < valueSize; ++ k ) {\n\n\t\t\t\t\tvalues.push( track.values[ j * valueSize + k ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( times.length === 0 ) continue;\n\n\t\t\ttrack.times = AnimationUtils.convertArray( times, track.times.constructor );\n\t\t\ttrack.values = AnimationUtils.convertArray( values, track.values.constructor );\n\n\t\t\ttracks.push( track );\n\n\t\t}\n\n\t\tclip.tracks = tracks;\n\n\t\t// find minimum .times value across all tracks in the trimmed clip\n\n\t\tlet minStartTime = Infinity;\n\n\t\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\t\tif ( minStartTime > clip.tracks[ i ].times[ 0 ] ) {\n\n\t\t\t\tminStartTime = clip.tracks[ i ].times[ 0 ];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// shift all tracks such that clip begins at t=0\n\n\t\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\t\tclip.tracks[ i ].shift( - 1 * minStartTime );\n\n\t\t}\n\n\t\tclip.resetDuration();\n\n\t\treturn clip;\n\n\t},\n\n\tmakeClipAdditive: function ( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {\n\n\t\tif ( fps <= 0 ) fps = 30;\n\n\t\tconst numTracks = referenceClip.tracks.length;\n\t\tconst referenceTime = referenceFrame / fps;\n\n\t\t// Make each track's values relative to the values at the reference frame\n\t\tfor ( let i = 0; i < numTracks; ++ i ) {\n\n\t\t\tconst referenceTrack = referenceClip.tracks[ i ];\n\t\t\tconst referenceTrackType = referenceTrack.ValueTypeName;\n\n\t\t\t// Skip this track if it's non-numeric\n\t\t\tif ( referenceTrackType === 'bool' || referenceTrackType === 'string' ) continue;\n\n\t\t\t// Find the track in the target clip whose name and type matches the reference track\n\t\t\tconst targetTrack = targetClip.tracks.find( function ( track ) {\n\n\t\t\t\treturn track.name === referenceTrack.name\n\t\t\t\t\t&& track.ValueTypeName === referenceTrackType;\n\n\t\t\t} );\n\n\t\t\tif ( targetTrack === undefined ) continue;\n\n\t\t\tlet referenceOffset = 0;\n\t\t\tconst referenceValueSize = referenceTrack.getValueSize();\n\n\t\t\tif ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\t\treferenceOffset = referenceValueSize / 3;\n\n\t\t\t}\n\n\t\t\tlet targetOffset = 0;\n\t\t\tconst targetValueSize = targetTrack.getValueSize();\n\n\t\t\tif ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\t\ttargetOffset = targetValueSize / 3;\n\n\t\t\t}\n\n\t\t\tconst lastIndex = referenceTrack.times.length - 1;\n\t\t\tlet referenceValue;\n\n\t\t\t// Find the value to subtract out of the track\n\t\t\tif ( referenceTime <= referenceTrack.times[ 0 ] ) {\n\n\t\t\t\t// Reference frame is earlier than the first keyframe, so just use the first keyframe\n\t\t\t\tconst startIndex = referenceOffset;\n\t\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\t\treferenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex, endIndex );\n\n\t\t\t} else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) {\n\n\t\t\t\t// Reference frame is after the last keyframe, so just use the last keyframe\n\t\t\t\tconst startIndex = lastIndex * referenceValueSize + referenceOffset;\n\t\t\t\tconst endIndex = startIndex + referenceValueSize - referenceOffset;\n\t\t\t\treferenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex, endIndex );\n\n\t\t\t} else {\n\n\t\t\t\t// Interpolate to the reference value\n\t\t\t\tconst interpolant = referenceTrack.createInterpolant();\n\t\t\t\tconst startIndex = referenceOffset;\n\t\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\t\tinterpolant.evaluate( referenceTime );\n\t\t\t\treferenceValue = AnimationUtils.arraySlice( interpolant.resultBuffer, startIndex, endIndex );\n\n\t\t\t}\n\n\t\t\t// Conjugate the quaternion\n\t\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\t\tconst referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate();\n\t\t\t\treferenceQuat.toArray( referenceValue );\n\n\t\t\t}\n\n\t\t\t// Subtract the reference value from all of the track values\n\n\t\t\tconst numTimes = targetTrack.times.length;\n\t\t\tfor ( let j = 0; j < numTimes; ++ j ) {\n\n\t\t\t\tconst valueStart = j * targetValueSize + targetOffset;\n\n\t\t\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\t\t\t// Multiply the conjugate for quaternion track types\n\t\t\t\t\tQuaternion.multiplyQuaternionsFlat(\n\t\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\t\tvalueStart,\n\t\t\t\t\t\treferenceValue,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\t\tvalueStart\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst valueEnd = targetValueSize - targetOffset * 2;\n\n\t\t\t\t\t// Subtract each value for all other numeric track types\n\t\t\t\t\tfor ( let k = 0; k < valueEnd; ++ k ) {\n\n\t\t\t\t\t\ttargetTrack.values[ valueStart + k ] -= referenceValue[ k ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\ttargetClip.blendMode = AdditiveAnimationBlendMode;\n\n\t\treturn targetClip;\n\n\t}\n\n};\n\n/**\n * Abstract base class of interpolants over parametric samples.\n *\n * The parameter domain is one dimensional, typically the time or a path\n * along a curve defined by the data.\n *\n * The sample values can have any dimensionality and derived classes may\n * apply special interpretations to the data.\n *\n * This class provides the interval seek in a Template Method, deferring\n * the actual interpolation to derived classes.\n *\n * Time complexity is O(1) for linear access crossing at most two points\n * and O(log N) for random access, where N is the number of positions.\n *\n * References:\n *\n * \t\thttp://www.oodesign.com/template-method-pattern.html\n *\n */\n\nclass Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\n\t\tthis.resultBuffer = resultBuffer !== undefined ?\n\t\t\tresultBuffer : new sampleValues.constructor( sampleSize );\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\n\t}\n\n\tevaluate( t ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\tt1 = pp[ i1 ],\n\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\tvalidate_interval: {\n\n\t\t\tseek: {\n\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if ( ! ( t < t1 ) ) {\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 + 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\t\t\t\tif ( t < t0 ) break forward_scan;\n\n\t\t\t\t\t\t\t\t// after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.afterEnd_( i1 - 1, t, t0 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[ ++ i1 ];\n\n\t\t\t\t\t\t\tif ( t < t1 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the right side of the index\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\t\t\t\t\tif ( ! ( t >= t0 ) ) {\n\n\t\t\t\t\t\t// looping?\n\n\t\t\t\t\t\tconst t1global = pp[ 1 ];\n\n\t\t\t\t\t\tif ( t < t1global ) {\n\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\t\t\t\t\t\t\tt0 = t1global;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// linear reverse scan\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 - 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\t\t\t\t// before start\n\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.beforeStart_( 0, t, t1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[ -- i1 - 1 ];\n\n\t\t\t\t\t\t\tif ( t >= t0 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the left side of the index\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the interval is valid\n\n\t\t\t\t\tbreak validate_interval;\n\n\t\t\t\t} // linear scan\n\n\t\t\t\t// binary search\n\n\t\t\t\twhile ( i1 < right ) {\n\n\t\t\t\t\tconst mid = ( i1 + right ) >>> 1;\n\n\t\t\t\t\tif ( t < pp[ mid ] ) {\n\n\t\t\t\t\t\tright = mid;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ti1 = mid + 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[ i1 ];\n\t\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\t\t\t// check boundary cases, again\n\n\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.beforeStart_( 0, t, t1 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.afterEnd_( i1 - 1, t0, t );\n\n\t\t\t\t}\n\n\t\t\t} // seek\n\n\t\t\tthis._cachedIndex = i1;\n\n\t\t\tthis.intervalChanged_( i1, t0, t1 );\n\n\t\t} // validate_interval\n\n\t\treturn this.interpolate_( i1, t0, t, t1 );\n\n\t}\n\n\tgetSettings_() {\n\n\t\treturn this.settings || this.DefaultSettings_;\n\n\t}\n\n\tcopySampleValue_( index ) {\n\n\t\t// copies a sample value to the result buffer\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = index * stride;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\t// Template methods for derived classes:\n\n\tinterpolate_( /* i1, t0, t, t1 */ ) {\n\n\t\tthrow new Error( 'call to abstract method' );\n\t\t// implementations shall return this.resultBuffer\n\n\t}\n\n\tintervalChanged_( /* i1, t0, t1 */ ) {\n\n\t\t// empty\n\n\t}\n\n}\n\n// ALIAS DEFINITIONS\n\nInterpolant.prototype.beforeStart_ = Interpolant.prototype.copySampleValue_;\nInterpolant.prototype.afterEnd_ = Interpolant.prototype.copySampleValue_;\n\n/**\n * Fast and simple cubic spline interpolant.\n *\n * It was derived from a Hermitian construction setting the first derivative\n * at each sample position to the linear slope between neighboring positions\n * over their parameter interval.\n */\n\nclass CubicInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\tthis._weightPrev = - 0;\n\t\tthis._offsetPrev = - 0;\n\t\tthis._weightNext = - 0;\n\t\tthis._offsetNext = - 0;\n\n\t\tthis.DefaultSettings_ = {\n\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\n\t\t};\n\n\t}\n\n\tintervalChanged_( i1, t0, t1 ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet iPrev = i1 - 2,\n\t\t\tiNext = i1 + 1,\n\n\t\t\ttPrev = pp[ iPrev ],\n\t\t\ttNext = pp[ iNext ];\n\n\t\tif ( tPrev === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingStart ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = 2 * t0 - t1;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\ttPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = t1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tNext === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingEnd ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\tiNext = i1;\n\t\t\t\t\ttNext = 2 * t1 - t0;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiNext = 1;\n\t\t\t\t\ttNext = t1 + pp[ 1 ] - pp[ 0 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\ttNext = t0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst halfDt = ( t1 - t0 ) * 0.5,\n\t\t\tstride = this.valueSize;\n\n\t\tthis._weightPrev = halfDt / ( t0 - tPrev );\n\t\tthis._weightNext = halfDt / ( tNext - t1 );\n\t\tthis._offsetPrev = iPrev * stride;\n\t\tthis._offsetNext = iNext * stride;\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\to1 = i1 * stride,\t\to0 = o1 - stride,\n\t\t\toP = this._offsetPrev, \toN = this._offsetNext,\n\t\t\twP = this._weightPrev,\twN = this._weightNext,\n\n\t\t\tp = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tpp = p * p,\n\t\t\tppp = pp * p;\n\n\t\t// evaluate polynomials\n\n\t\tconst sP = - wP * ppp + 2 * wP * pp - wP * p;\n\t\tconst s0 = ( 1 + wP ) * ppp + ( - 1.5 - 2 * wP ) * pp + ( - 0.5 + wP ) * p + 1;\n\t\tconst s1 = ( - 1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p;\n\t\tconst sN = wN * ppp - wN * pp;\n\n\t\t// combine data linearly\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tsP * values[ oP + i ] +\n\t\t\t\t\ts0 * values[ o0 + i ] +\n\t\t\t\t\ts1 * values[ o1 + i ] +\n\t\t\t\t\tsN * values[ oN + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\nclass LinearInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\toffset1 = i1 * stride,\n\t\t\toffset0 = offset1 - stride,\n\n\t\t\tweight1 = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tweight0 = 1 - weight1;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tvalues[ offset0 + i ] * weight0 +\n\t\t\t\t\tvalues[ offset1 + i ] * weight1;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n *\n * Interpolant that evaluates to the sample value at the position preceeding\n * the parameter.\n */\n\nclass DiscreteInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1 /*, t0, t, t1 */ ) {\n\n\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t}\n\n}\n\nclass KeyframeTrack {\n\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tif ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' );\n\t\tif ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name );\n\n\t\tthis.name = name;\n\n\t\tthis.times = AnimationUtils.convertArray( times, this.TimeBufferType );\n\t\tthis.values = AnimationUtils.convertArray( values, this.ValueBufferType );\n\n\t\tthis.setInterpolation( interpolation || this.DefaultInterpolation );\n\n\t}\n\n\t// Serialization (in static context, because of constructor invocation\n\t// and automatic invocation of .toJSON):\n\n\tstatic toJSON( track ) {\n\n\t\tconst trackType = track.constructor;\n\n\t\tlet json;\n\n\t\t// derived classes can define a static toJSON method\n\t\tif ( trackType.toJSON !== this.toJSON ) {\n\n\t\t\tjson = trackType.toJSON( track );\n\n\t\t} else {\n\n\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\tjson = {\n\n\t\t\t\t'name': track.name,\n\t\t\t\t'times': AnimationUtils.convertArray( track.times, Array ),\n\t\t\t\t'values': AnimationUtils.convertArray( track.values, Array )\n\n\t\t\t};\n\n\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t}\n\n\t\t}\n\n\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\treturn json;\n\n\t}\n\n\tInterpolantFactoryMethodDiscrete( result ) {\n\n\t\treturn new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new LinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tInterpolantFactoryMethodSmooth( result ) {\n\n\t\treturn new CubicInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tsetInterpolation( interpolation ) {\n\n\t\tlet factoryMethod;\n\n\t\tswitch ( interpolation ) {\n\n\t\t\tcase InterpolateDiscrete:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateLinear:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateSmooth:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif ( factoryMethod === undefined ) {\n\n\t\t\tconst message = 'unsupported interpolation for ' +\n\t\t\t\tthis.ValueTypeName + ' keyframe track named ' + this.name;\n\n\t\t\tif ( this.createInterpolant === undefined ) {\n\n\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\tif ( interpolation !== this.DefaultInterpolation ) {\n\n\t\t\t\t\tthis.setInterpolation( this.DefaultInterpolation );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( message ); // fatal, in this case\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconsole.warn( 'THREE.KeyframeTrack:', message );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis.createInterpolant = factoryMethod;\n\n\t\treturn this;\n\n\t}\n\n\tgetInterpolation() {\n\n\t\tswitch ( this.createInterpolant ) {\n\n\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\n\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\tcase this.InterpolantFactoryMethodLinear:\n\n\t\t\t\treturn InterpolateLinear;\n\n\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\n\t\t\t\treturn InterpolateSmooth;\n\n\t\t}\n\n\t}\n\n\tgetValueSize() {\n\n\t\treturn this.values.length / this.times.length;\n\n\t}\n\n\t// move all keyframes either forwards or backwards in time\n\tshift( timeOffset ) {\n\n\t\tif ( timeOffset !== 0.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] += timeOffset;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// scale all keyframe times by a factor (useful for frame <-> seconds conversions)\n\tscale( timeScale ) {\n\n\t\tif ( timeScale !== 1.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] *= timeScale;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n\t// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\n\ttrim( startTime, endTime ) {\n\n\t\tconst times = this.times,\n\t\t\tnKeys = times.length;\n\n\t\tlet from = 0,\n\t\t\tto = nKeys - 1;\n\n\t\twhile ( from !== nKeys && times[ from ] < startTime ) {\n\n\t\t\t++ from;\n\n\t\t}\n\n\t\twhile ( to !== - 1 && times[ to ] > endTime ) {\n\n\t\t\t-- to;\n\n\t\t}\n\n\t\t++ to; // inclusive -> exclusive bound\n\n\t\tif ( from !== 0 || to !== nKeys ) {\n\n\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\tif ( from >= to ) {\n\n\t\t\t\tto = Math.max( to, 1 );\n\t\t\t\tfrom = to - 1;\n\n\t\t\t}\n\n\t\t\tconst stride = this.getValueSize();\n\t\t\tthis.times = AnimationUtils.arraySlice( times, from, to );\n\t\t\tthis.values = AnimationUtils.arraySlice( this.values, from * stride, to * stride );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tconst valueSize = this.getValueSize();\n\t\tif ( valueSize - Math.floor( valueSize ) !== 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tconst times = this.times,\n\t\t\tvalues = this.values,\n\n\t\t\tnKeys = times.length;\n\n\t\tif ( nKeys === 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Track is empty.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tlet prevTime = null;\n\n\t\tfor ( let i = 0; i !== nKeys; i ++ ) {\n\n\t\t\tconst currTime = times[ i ];\n\n\t\t\tif ( typeof currTime === 'number' && isNaN( currTime ) ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( prevTime !== null && prevTime > currTime ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tprevTime = currTime;\n\n\t\t}\n\n\t\tif ( values !== undefined ) {\n\n\t\t\tif ( AnimationUtils.isTypedArray( values ) ) {\n\n\t\t\t\tfor ( let i = 0, n = values.length; i !== n; ++ i ) {\n\n\t\t\t\t\tconst value = values[ i ];\n\n\t\t\t\t\tif ( isNaN( value ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\t// removes equivalent sequential keys as common in morph target sequences\n\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\n\toptimize() {\n\n\t\t// times or values may be shared with other tracks, so overwriting is unsafe\n\t\tconst times = AnimationUtils.arraySlice( this.times ),\n\t\t\tvalues = AnimationUtils.arraySlice( this.values ),\n\t\t\tstride = this.getValueSize(),\n\n\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\n\t\t\tlastIndex = times.length - 1;\n\n\t\tlet writeIndex = 1;\n\n\t\tfor ( let i = 1; i < lastIndex; ++ i ) {\n\n\t\t\tlet keep = false;\n\n\t\t\tconst time = times[ i ];\n\t\t\tconst timeNext = times[ i + 1 ];\n\n\t\t\t// remove adjacent keyframes scheduled at the same time\n\n\t\t\tif ( time !== timeNext && ( i !== 1 || time !== times[ 0 ] ) ) {\n\n\t\t\t\tif ( ! smoothInterpolation ) {\n\n\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\n\t\t\t\t\tconst offset = i * stride,\n\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tconst value = values[ offset + j ];\n\n\t\t\t\t\t\tif ( value !== values[ offsetP + j ] ||\n\t\t\t\t\t\t\tvalue !== values[ offsetN + j ] ) {\n\n\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tkeep = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// in-place compaction\n\n\t\t\tif ( keep ) {\n\n\t\t\t\tif ( i !== writeIndex ) {\n\n\t\t\t\t\ttimes[ writeIndex ] = times[ i ];\n\n\t\t\t\t\tconst readOffset = i * stride,\n\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t++ writeIndex;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// flush last keyframe (compaction looks ahead)\n\n\t\tif ( lastIndex > 0 ) {\n\n\t\t\ttimes[ writeIndex ] = times[ lastIndex ];\n\n\t\t\tfor ( let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) {\n\n\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t}\n\n\t\t\t++ writeIndex;\n\n\t\t}\n\n\t\tif ( writeIndex !== times.length ) {\n\n\t\t\tthis.times = AnimationUtils.arraySlice( times, 0, writeIndex );\n\t\t\tthis.values = AnimationUtils.arraySlice( values, 0, writeIndex * stride );\n\n\t\t} else {\n\n\t\t\tthis.times = times;\n\t\t\tthis.values = values;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\tconst times = AnimationUtils.arraySlice( this.times, 0 );\n\t\tconst values = AnimationUtils.arraySlice( this.values, 0 );\n\n\t\tconst TypedKeyframeTrack = this.constructor;\n\t\tconst track = new TypedKeyframeTrack( this.name, times, values );\n\n\t\t// Interpolant argument to constructor is not saved, so copy the factory method directly.\n\t\ttrack.createInterpolant = this.createInterpolant;\n\n\t\treturn track;\n\n\t}\n\n}\n\nKeyframeTrack.prototype.TimeBufferType = Float32Array;\nKeyframeTrack.prototype.ValueBufferType = Float32Array;\nKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\n/**\n * A Track of Boolean keyframe values.\n */\nclass BooleanKeyframeTrack extends KeyframeTrack {}\n\nBooleanKeyframeTrack.prototype.ValueTypeName = 'bool';\nBooleanKeyframeTrack.prototype.ValueBufferType = Array;\nBooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track of keyframe values that represent color.\n */\nclass ColorKeyframeTrack extends KeyframeTrack {}\n\nColorKeyframeTrack.prototype.ValueTypeName = 'color';\n\n/**\n * A Track of numeric keyframe values.\n */\nclass NumberKeyframeTrack extends KeyframeTrack {}\n\nNumberKeyframeTrack.prototype.ValueTypeName = 'number';\n\n/**\n * Spherical linear unit quaternion interpolant.\n */\n\nclass QuaternionLinearInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\talpha = ( t - t0 ) / ( t1 - t0 );\n\n\t\tlet offset = i1 * stride;\n\n\t\tfor ( let end = offset + stride; offset !== end; offset += 4 ) {\n\n\t\t\tQuaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * A Track of quaternion keyframe values.\n */\nclass QuaternionKeyframeTrack extends KeyframeTrack {\n\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n}\n\nQuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';\n// ValueBufferType is inherited\nQuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\nQuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track that interpolates Strings\n */\nclass StringKeyframeTrack extends KeyframeTrack {}\n\nStringKeyframeTrack.prototype.ValueTypeName = 'string';\nStringKeyframeTrack.prototype.ValueBufferType = Array;\nStringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track of vectored keyframe values.\n */\nclass VectorKeyframeTrack extends KeyframeTrack {}\n\nVectorKeyframeTrack.prototype.ValueTypeName = 'vector';\n\nclass AnimationClip {\n\n\tconstructor( name, duration = - 1, tracks, blendMode = NormalAnimationBlendMode ) {\n\n\t\tthis.name = name;\n\t\tthis.tracks = tracks;\n\t\tthis.duration = duration;\n\t\tthis.blendMode = blendMode;\n\n\t\tthis.uuid = generateUUID();\n\n\t\t// this means it should figure out its duration by scanning the tracks\n\t\tif ( this.duration < 0 ) {\n\n\t\t\tthis.resetDuration();\n\n\t\t}\n\n\t}\n\n\n\tstatic parse( json ) {\n\n\t\tconst tracks = [],\n\t\t\tjsonTracks = json.tracks,\n\t\t\tframeTime = 1.0 / ( json.fps || 1.0 );\n\n\t\tfor ( let i = 0, n = jsonTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) );\n\n\t\t}\n\n\t\tconst clip = new this( json.name, json.duration, tracks, json.blendMode );\n\t\tclip.uuid = json.uuid;\n\n\t\treturn clip;\n\n\t}\n\n\tstatic toJSON( clip ) {\n\n\t\tconst tracks = [],\n\t\t\tclipTracks = clip.tracks;\n\n\t\tconst json = {\n\n\t\t\t'name': clip.name,\n\t\t\t'duration': clip.duration,\n\t\t\t'tracks': tracks,\n\t\t\t'uuid': clip.uuid,\n\t\t\t'blendMode': clip.blendMode\n\n\t\t};\n\n\t\tfor ( let i = 0, n = clipTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) );\n\n\t\t}\n\n\t\treturn json;\n\n\t}\n\n\tstatic CreateFromMorphTargetSequence( name, morphTargetSequence, fps, noLoop ) {\n\n\t\tconst numMorphTargets = morphTargetSequence.length;\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < numMorphTargets; i ++ ) {\n\n\t\t\tlet times = [];\n\t\t\tlet values = [];\n\n\t\t\ttimes.push(\n\t\t\t\t( i + numMorphTargets - 1 ) % numMorphTargets,\n\t\t\t\ti,\n\t\t\t\t( i + 1 ) % numMorphTargets );\n\n\t\t\tvalues.push( 0, 1, 0 );\n\n\t\t\tconst order = AnimationUtils.getKeyframeOrder( times );\n\t\t\ttimes = AnimationUtils.sortedArray( times, 1, order );\n\t\t\tvalues = AnimationUtils.sortedArray( values, 1, order );\n\n\t\t\t// if there is a key at the first frame, duplicate it as the\n\t\t\t// last frame as well for perfect loop.\n\t\t\tif ( ! noLoop && times[ 0 ] === 0 ) {\n\n\t\t\t\ttimes.push( numMorphTargets );\n\t\t\t\tvalues.push( values[ 0 ] );\n\n\t\t\t}\n\n\t\t\ttracks.push(\n\t\t\t\tnew NumberKeyframeTrack(\n\t\t\t\t\t'.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']',\n\t\t\t\t\ttimes, values\n\t\t\t\t).scale( 1.0 / fps ) );\n\n\t\t}\n\n\t\treturn new this( name, - 1, tracks );\n\n\t}\n\n\tstatic findByName( objectOrClipArray, name ) {\n\n\t\tlet clipArray = objectOrClipArray;\n\n\t\tif ( ! Array.isArray( objectOrClipArray ) ) {\n\n\t\t\tconst o = objectOrClipArray;\n\t\t\tclipArray = o.geometry && o.geometry.animations || o.animations;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < clipArray.length; i ++ ) {\n\n\t\t\tif ( clipArray[ i ].name === name ) {\n\n\t\t\t\treturn clipArray[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\tstatic CreateClipsFromMorphTargetSequences( morphTargets, fps, noLoop ) {\n\n\t\tconst animationToMorphTargets = {};\n\n\t\t// tested with https://regex101.com/ on trick sequences\n\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\t\tconst pattern = /^([\\w-]*?)([\\d]+)$/;\n\n\t\t// sort morph target names into animation groups based\n\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\t\tfor ( let i = 0, il = morphTargets.length; i < il; i ++ ) {\n\n\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\tconst parts = morphTarget.name.match( pattern );\n\n\t\t\tif ( parts && parts.length > 1 ) {\n\n\t\t\t\tconst name = parts[ 1 ];\n\n\t\t\t\tlet animationMorphTargets = animationToMorphTargets[ name ];\n\n\t\t\t\tif ( ! animationMorphTargets ) {\n\n\t\t\t\t\tanimationToMorphTargets[ name ] = animationMorphTargets = [];\n\n\t\t\t\t}\n\n\t\t\t\tanimationMorphTargets.push( morphTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst clips = [];\n\n\t\tfor ( const name in animationToMorphTargets ) {\n\n\t\t\tclips.push( this.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) );\n\n\t\t}\n\n\t\treturn clips;\n\n\t}\n\n\t// parse the animation.hierarchy format\n\tstatic parseAnimation( animation, bones ) {\n\n\t\tif ( ! animation ) {\n\n\t\t\tconsole.error( 'THREE.AnimationClip: No animation in JSONLoader data.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) {\n\n\t\t\t// only return track if there are actually keys.\n\t\t\tif ( animationKeys.length !== 0 ) {\n\n\t\t\t\tconst times = [];\n\t\t\t\tconst values = [];\n\n\t\t\t\tAnimationUtils.flattenJSON( animationKeys, times, values, propertyName );\n\n\t\t\t\t// empty keys are filtered out, so check again\n\t\t\t\tif ( times.length !== 0 ) {\n\n\t\t\t\t\tdestTracks.push( new trackType( trackName, times, values ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tconst tracks = [];\n\n\t\tconst clipName = animation.name || 'default';\n\t\tconst fps = animation.fps || 30;\n\t\tconst blendMode = animation.blendMode;\n\n\t\t// automatic length determination in AnimationClip.\n\t\tlet duration = animation.length || - 1;\n\n\t\tconst hierarchyTracks = animation.hierarchy || [];\n\n\t\tfor ( let h = 0; h < hierarchyTracks.length; h ++ ) {\n\n\t\t\tconst animationKeys = hierarchyTracks[ h ].keys;\n\n\t\t\t// skip empty tracks\n\t\t\tif ( ! animationKeys || animationKeys.length === 0 ) continue;\n\n\t\t\t// process morph targets\n\t\t\tif ( animationKeys[ 0 ].morphTargets ) {\n\n\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\tconst morphTargetNames = {};\n\n\t\t\t\tlet k;\n\n\t\t\t\tfor ( k = 0; k < animationKeys.length; k ++ ) {\n\n\t\t\t\t\tif ( animationKeys[ k ].morphTargets ) {\n\n\t\t\t\t\t\tfor ( let m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) {\n\n\t\t\t\t\t\t\tmorphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// create a track for each morph target with all zero\n\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t// the morphTarget is named.\n\t\t\t\tfor ( const morphTargetName in morphTargetNames ) {\n\n\t\t\t\t\tconst times = [];\n\t\t\t\t\tconst values = [];\n\n\t\t\t\t\tfor ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) {\n\n\t\t\t\t\t\tconst animationKey = animationKeys[ k ];\n\n\t\t\t\t\t\ttimes.push( animationKey.time );\n\t\t\t\t\t\tvalues.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) );\n\n\t\t\t\t}\n\n\t\t\t\tduration = morphTargetNames.length * ( fps || 1.0 );\n\n\t\t\t} else {\n\n\t\t\t\t// ...assume skeletal animation\n\n\t\t\t\tconst boneName = '.bones[' + bones[ h ].name + ']';\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.position',\n\t\t\t\t\tanimationKeys, 'pos', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tQuaternionKeyframeTrack, boneName + '.quaternion',\n\t\t\t\t\tanimationKeys, 'rot', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.scale',\n\t\t\t\t\tanimationKeys, 'scl', tracks );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tracks.length === 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst clip = new this( clipName, duration, tracks, blendMode );\n\n\t\treturn clip;\n\n\t}\n\n\tresetDuration() {\n\n\t\tconst tracks = this.tracks;\n\t\tlet duration = 0;\n\n\t\tfor ( let i = 0, n = tracks.length; i !== n; ++ i ) {\n\n\t\t\tconst track = this.tracks[ i ];\n\n\t\t\tduration = Math.max( duration, track.times[ track.times.length - 1 ] );\n\n\t\t}\n\n\t\tthis.duration = duration;\n\n\t\treturn this;\n\n\t}\n\n\ttrim() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].trim( 0, this.duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tvalid = valid && this.tracks[ i ].validate();\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\toptimize() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].optimize();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\ttracks.push( this.tracks[ i ].clone() );\n\n\t\t}\n\n\t\treturn new this.constructor( this.name, this.duration, tracks, this.blendMode );\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.constructor.toJSON( this );\n\n\t}\n\n}\n\nfunction getTrackTypeForValueTypeName( typeName ) {\n\n\tswitch ( typeName.toLowerCase() ) {\n\n\t\tcase 'scalar':\n\t\tcase 'double':\n\t\tcase 'float':\n\t\tcase 'number':\n\t\tcase 'integer':\n\n\t\t\treturn NumberKeyframeTrack;\n\n\t\tcase 'vector':\n\t\tcase 'vector2':\n\t\tcase 'vector3':\n\t\tcase 'vector4':\n\n\t\t\treturn VectorKeyframeTrack;\n\n\t\tcase 'color':\n\n\t\t\treturn ColorKeyframeTrack;\n\n\t\tcase 'quaternion':\n\n\t\t\treturn QuaternionKeyframeTrack;\n\n\t\tcase 'bool':\n\t\tcase 'boolean':\n\n\t\t\treturn BooleanKeyframeTrack;\n\n\t\tcase 'string':\n\n\t\t\treturn StringKeyframeTrack;\n\n\t}\n\n\tthrow new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName );\n\n}\n\nfunction parseKeyframeTrack( json ) {\n\n\tif ( json.type === undefined ) {\n\n\t\tthrow new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' );\n\n\t}\n\n\tconst trackType = getTrackTypeForValueTypeName( json.type );\n\n\tif ( json.times === undefined ) {\n\n\t\tconst times = [], values = [];\n\n\t\tAnimationUtils.flattenJSON( json.keys, times, values, 'value' );\n\n\t\tjson.times = times;\n\t\tjson.values = values;\n\n\t}\n\n\t// derived classes can define a static parse method\n\tif ( trackType.parse !== undefined ) {\n\n\t\treturn trackType.parse( json );\n\n\t} else {\n\n\t\t// by default, we assume a constructor compatible with the base\n\t\treturn new trackType( json.name, json.times, json.values, json.interpolation );\n\n\t}\n\n}\n\nconst Cache = {\n\n\tenabled: false,\n\n\tfiles: {},\n\n\tadd: function ( key, file ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Adding key:', key );\n\n\t\tthis.files[ key ] = file;\n\n\t},\n\n\tget: function ( key ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Checking key:', key );\n\n\t\treturn this.files[ key ];\n\n\t},\n\n\tremove: function ( key ) {\n\n\t\tdelete this.files[ key ];\n\n\t},\n\n\tclear: function () {\n\n\t\tthis.files = {};\n\n\t}\n\n};\n\nclass LoadingManager {\n\n\tconstructor( onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tlet isLoading = false;\n\t\tlet itemsLoaded = 0;\n\t\tlet itemsTotal = 0;\n\t\tlet urlModifier = undefined;\n\t\tconst handlers = [];\n\n\t\t// Refer to #5689 for the reason why we don't set .onStart\n\t\t// in the constructor\n\n\t\tthis.onStart = undefined;\n\t\tthis.onLoad = onLoad;\n\t\tthis.onProgress = onProgress;\n\t\tthis.onError = onError;\n\n\t\tthis.itemStart = function ( url ) {\n\n\t\t\titemsTotal ++;\n\n\t\t\tif ( isLoading === false ) {\n\n\t\t\t\tif ( scope.onStart !== undefined ) {\n\n\t\t\t\t\tscope.onStart( url, itemsLoaded, itemsTotal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tisLoading = true;\n\n\t\t};\n\n\t\tthis.itemEnd = function ( url ) {\n\n\t\t\titemsLoaded ++;\n\n\t\t\tif ( scope.onProgress !== undefined ) {\n\n\t\t\t\tscope.onProgress( url, itemsLoaded, itemsTotal );\n\n\t\t\t}\n\n\t\t\tif ( itemsLoaded === itemsTotal ) {\n\n\t\t\t\tisLoading = false;\n\n\t\t\t\tif ( scope.onLoad !== undefined ) {\n\n\t\t\t\t\tscope.onLoad();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.itemError = function ( url ) {\n\n\t\t\tif ( scope.onError !== undefined ) {\n\n\t\t\t\tscope.onError( url );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.resolveURL = function ( url ) {\n\n\t\t\tif ( urlModifier ) {\n\n\t\t\t\treturn urlModifier( url );\n\n\t\t\t}\n\n\t\t\treturn url;\n\n\t\t};\n\n\t\tthis.setURLModifier = function ( transform ) {\n\n\t\t\turlModifier = transform;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.addHandler = function ( regex, loader ) {\n\n\t\t\thandlers.push( regex, loader );\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.removeHandler = function ( regex ) {\n\n\t\t\tconst index = handlers.indexOf( regex );\n\n\t\t\tif ( index !== - 1 ) {\n\n\t\t\t\thandlers.splice( index, 2 );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.getHandler = function ( file ) {\n\n\t\t\tfor ( let i = 0, l = handlers.length; i < l; i += 2 ) {\n\n\t\t\t\tconst regex = handlers[ i ];\n\t\t\t\tconst loader = handlers[ i + 1 ];\n\n\t\t\t\tif ( regex.global ) regex.lastIndex = 0; // see #17920\n\n\t\t\t\tif ( regex.test( file ) ) {\n\n\t\t\t\t\treturn loader;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t};\n\n\t}\n\n}\n\nconst DefaultLoadingManager = new LoadingManager();\n\nclass Loader {\n\n\tconstructor( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\tthis.crossOrigin = 'anonymous';\n\t\tthis.withCredentials = false;\n\t\tthis.path = '';\n\t\tthis.resourcePath = '';\n\t\tthis.requestHeader = {};\n\n\t}\n\n\tload( /* url, onLoad, onProgress, onError */ ) {}\n\n\tloadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\tscope.load( url, resolve, onProgress, reject );\n\n\t\t} );\n\n\t}\n\n\tparse( /* data */ ) {}\n\n\tsetCrossOrigin( crossOrigin ) {\n\n\t\tthis.crossOrigin = crossOrigin;\n\t\treturn this;\n\n\t}\n\n\tsetWithCredentials( value ) {\n\n\t\tthis.withCredentials = value;\n\t\treturn this;\n\n\t}\n\n\tsetPath( path ) {\n\n\t\tthis.path = path;\n\t\treturn this;\n\n\t}\n\n\tsetResourcePath( resourcePath ) {\n\n\t\tthis.resourcePath = resourcePath;\n\t\treturn this;\n\n\t}\n\n\tsetRequestHeader( requestHeader ) {\n\n\t\tthis.requestHeader = requestHeader;\n\t\treturn this;\n\n\t}\n\n}\n\nconst loading = {};\n\nclass FileLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tthis.manager.itemStart( url );\n\n\t\t\tsetTimeout( () => {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\t// Check if request is duplicate\n\n\t\tif ( loading[ url ] !== undefined ) {\n\n\t\t\tloading[ url ].push( {\n\n\t\t\t\tonLoad: onLoad,\n\t\t\t\tonProgress: onProgress,\n\t\t\t\tonError: onError\n\n\t\t\t} );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// Initialise array for duplicate requests\n\t\tloading[ url ] = [];\n\n\t\tloading[ url ].push( {\n\t\t\tonLoad: onLoad,\n\t\t\tonProgress: onProgress,\n\t\t\tonError: onError,\n\t\t} );\n\n\t\t// create request\n\t\tconst req = new Request( url, {\n\t\t\theaders: new Headers( this.requestHeader ),\n\t\t\tcredentials: this.withCredentials ? 'include' : 'same-origin',\n\t\t\t// An abort controller could be added within a future PR\n\t\t} );\n\n\t\t// record states ( avoid data race )\n\t\tconst mimeType = this.mimeType;\n\t\tconst responseType = this.responseType;\n\n\t\t// start the fetch\n\t\tfetch( req )\n\t\t\t.then( response => {\n\n\t\t\t\tif ( response.status === 200 || response.status === 0 ) {\n\n\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\n\t\t\t\t\tif ( response.status === 0 ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.FileLoader: HTTP Status 0 received.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( typeof ReadableStream === 'undefined' || response.body.getReader === undefined ) {\n\n\t\t\t\t\t\treturn response;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\t\tconst reader = response.body.getReader();\n\t\t\t\t\tconst contentLength = response.headers.get( 'Content-Length' );\n\t\t\t\t\tconst total = contentLength ? parseInt( contentLength ) : 0;\n\t\t\t\t\tconst lengthComputable = total !== 0;\n\t\t\t\t\tlet loaded = 0;\n\n\t\t\t\t\t// periodically read data into the new stream tracking while download progress\n\t\t\t\t\tconst stream = new ReadableStream( {\n\t\t\t\t\t\tstart( controller ) {\n\n\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\tfunction readData() {\n\n\t\t\t\t\t\t\t\treader.read().then( ( { done, value } ) => {\n\n\t\t\t\t\t\t\t\t\tif ( done ) {\n\n\t\t\t\t\t\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\tloaded += value.byteLength;\n\n\t\t\t\t\t\t\t\t\t\tconst event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } );\n\t\t\t\t\t\t\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\t\t\t\t\t\t\tif ( callback.onProgress ) callback.onProgress( event );\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcontroller.enqueue( value );\n\t\t\t\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn new Response( stream );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow Error( `fetch for \"${response.url}\" responded with ${response.status}: ${response.statusText}` );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( response => {\n\n\t\t\t\tswitch ( responseType ) {\n\n\t\t\t\t\tcase 'arraybuffer':\n\n\t\t\t\t\t\treturn response.arrayBuffer();\n\n\t\t\t\t\tcase 'blob':\n\n\t\t\t\t\t\treturn response.blob();\n\n\t\t\t\t\tcase 'document':\n\n\t\t\t\t\t\treturn response.text()\n\t\t\t\t\t\t\t.then( text => {\n\n\t\t\t\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\t\t\t\treturn parser.parseFromString( text, mimeType );\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\tcase 'json':\n\n\t\t\t\t\t\treturn response.json();\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( mimeType === undefined ) {\n\n\t\t\t\t\t\t\treturn response.text();\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// sniff encoding\n\t\t\t\t\t\t\tconst re = /charset=\"?([^;\"\\s]*)\"?/i;\n\t\t\t\t\t\t\tconst exec = re.exec( mimeType );\n\t\t\t\t\t\t\tconst label = exec && exec[ 1 ] ? exec[ 1 ].toLowerCase() : undefined;\n\t\t\t\t\t\t\tconst decoder = new TextDecoder( label );\n\t\t\t\t\t\t\treturn response.arrayBuffer().then( ab => decoder.decode( ab ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( data => {\n\n\t\t\t\t// Add to cache only on HTTP success, so that we do not cache\n\t\t\t\t// error response bodies as proper responses to requests.\n\t\t\t\tCache.add( url, data );\n\n\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onLoad ) callback.onLoad( data );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.catch( err => {\n\n\t\t\t\t// Abort errors and other errors are handled the same\n\n\t\t\t\tconst callbacks = loading[ url ];\n\n\t\t\t\tif ( callbacks === undefined ) {\n\n\t\t\t\t\t// When onLoad was called and url was deleted in `loading`\n\t\t\t\t\tthis.manager.itemError( url );\n\t\t\t\t\tthrow err;\n\n\t\t\t\t}\n\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onError ) callback.onError( err );\n\n\t\t\t\t}\n\n\t\t\t\tthis.manager.itemError( url );\n\n\t\t\t} )\n\t\t\t.finally( () => {\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\tthis.manager.itemStart( url );\n\n\t}\n\n\tsetResponseType( value ) {\n\n\t\tthis.responseType = value;\n\t\treturn this;\n\n\t}\n\n\tsetMimeType( value ) {\n\n\t\tthis.mimeType = value;\n\t\treturn this;\n\n\t}\n\n}\n\nclass AnimationLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst animations = [];\n\n\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\tconst clip = AnimationClip.parse( json[ i ] );\n\n\t\t\tanimations.push( clip );\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n}\n\n/**\n * Abstract Base class to block based textures loader (dds, pvr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */\n\nclass CompressedTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst images = [];\n\n\t\tconst texture = new CompressedTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\timages[ i ] = {\n\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t};\n\n\t\t\t\tloaded += 1;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\tif ( texDatas.mipmapCount === 1 ) texture.minFilter = LinearFilter;\n\n\t\t\t\t\ttexture.image = images;\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tif ( Array.isArray( url ) ) {\n\n\t\t\tfor ( let i = 0, il = url.length; i < il; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\tif ( texDatas.isCubemap ) {\n\n\t\t\t\t\tconst faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\tfor ( let f = 0; f < faces; f ++ ) {\n\n\t\t\t\t\t\timages[ f ] = { mipmaps: [] };\n\n\t\t\t\t\t\tfor ( let i = 0; i < texDatas.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\timages[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] );\n\t\t\t\t\t\t\timages[ f ].format = texDatas.format;\n\t\t\t\t\t\t\timages[ f ].width = texDatas.width;\n\t\t\t\t\t\t\timages[ f ].height = texDatas.height;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.image = images;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\tif ( texDatas.mipmapCount === 1 ) {\n\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass ImageLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst image = createElementNS( 'img' );\n\n\t\tfunction onImageLoad() {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tCache.add( url, this );\n\n\t\t\tif ( onLoad ) onLoad( this );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction onImageError( event ) {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tif ( onError ) onError( event );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction removeEventListeners() {\n\n\t\t\timage.removeEventListener( 'load', onImageLoad, false );\n\t\t\timage.removeEventListener( 'error', onImageError, false );\n\n\t\t}\n\n\t\timage.addEventListener( 'load', onImageLoad, false );\n\t\timage.addEventListener( 'error', onImageError, false );\n\n\t\tif ( url.substr( 0, 5 ) !== 'data:' ) {\n\n\t\t\tif ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin;\n\n\t\t}\n\n\t\tscope.manager.itemStart( url );\n\n\t\timage.src = url;\n\n\t\treturn image;\n\n\t}\n\n}\n\nclass CubeTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( urls, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new CubeTexture();\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( urls[ i ], function ( image ) {\n\n\t\t\t\ttexture.images[ i ] = image;\n\n\t\t\t\tloaded ++;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, undefined, onError );\n\n\t\t}\n\n\t\tfor ( let i = 0; i < urls.length; ++ i ) {\n\n\t\t\tloadTexture( i );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */\n\nclass DataTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst texture = new DataTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setPath( this.path );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\tconst texData = scope.parse( buffer );\n\n\t\t\tif ( ! texData ) return;\n\n\t\t\tif ( texData.image !== undefined ) {\n\n\t\t\t\ttexture.image = texData.image;\n\n\t\t\t} else if ( texData.data !== undefined ) {\n\n\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\ttexture.image.data = texData.data;\n\n\t\t\t}\n\n\t\t\ttexture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\ttexture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping;\n\n\t\t\ttexture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter;\n\t\t\ttexture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;\n\n\t\t\ttexture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;\n\n\t\t\tif ( texData.encoding !== undefined ) {\n\n\t\t\t\ttexture.encoding = texData.encoding;\n\n\t\t\t}\n\n\t\t\tif ( texData.flipY !== undefined ) {\n\n\t\t\t\ttexture.flipY = texData.flipY;\n\n\t\t\t}\n\n\t\t\tif ( texData.format !== undefined ) {\n\n\t\t\t\ttexture.format = texData.format;\n\n\t\t\t}\n\n\t\t\tif ( texData.type !== undefined ) {\n\n\t\t\t\ttexture.type = texData.type;\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmaps !== undefined ) {\n\n\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\t\t\t\ttexture.minFilter = LinearMipmapLinearFilter; // presumably...\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmapCount === 1 ) {\n\n\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t}\n\n\t\t\tif ( texData.generateMipmaps !== undefined ) {\n\n\t\t\t\ttexture.generateMipmaps = texData.generateMipmaps;\n\n\t\t\t}\n\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad ) onLoad( texture, texData );\n\n\t\t}, onProgress, onError );\n\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass TextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new Texture();\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tloader.load( url, function ( image ) {\n\n\t\t\ttexture.image = image;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad !== undefined ) {\n\n\t\t\t\tonLoad( texture );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass Light extends Object3D {\n\n\tconstructor( color, intensity = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Light';\n\n\t\tthis.color = new Color( color );\n\t\tthis.intensity = intensity;\n\n\t}\n\n\tdispose() {\n\n\t\t// Empty here in base class; some subclasses override.\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.intensity = source.intensity;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.color = this.color.getHex();\n\t\tdata.object.intensity = this.intensity;\n\n\t\tif ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex();\n\n\t\tif ( this.distance !== undefined ) data.object.distance = this.distance;\n\t\tif ( this.angle !== undefined ) data.object.angle = this.angle;\n\t\tif ( this.decay !== undefined ) data.object.decay = this.decay;\n\t\tif ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra;\n\n\t\tif ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON();\n\n\t\treturn data;\n\n\t}\n\n}\n\nLight.prototype.isLight = true;\n\nclass HemisphereLight extends Light {\n\n\tconstructor( skyColor, groundColor, intensity ) {\n\n\t\tsuper( skyColor, intensity );\n\n\t\tthis.type = 'HemisphereLight';\n\n\t\tthis.position.copy( Object3D.DefaultUp );\n\t\tthis.updateMatrix();\n\n\t\tthis.groundColor = new Color( groundColor );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tLight.prototype.copy.call( this, source );\n\n\t\tthis.groundColor.copy( source.groundColor );\n\n\t\treturn this;\n\n\t}\n\n}\n\nHemisphereLight.prototype.isHemisphereLight = true;\n\nconst _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld$1 = /*@__PURE__*/ new Vector3();\nconst _lookTarget$1 = /*@__PURE__*/ new Vector3();\n\nclass LightShadow {\n\n\tconstructor( camera ) {\n\n\t\tthis.camera = camera;\n\n\t\tthis.bias = 0;\n\t\tthis.normalBias = 0;\n\t\tthis.radius = 1;\n\t\tthis.blurSamples = 8;\n\n\t\tthis.mapSize = new Vector2( 512, 512 );\n\n\t\tthis.map = null;\n\t\tthis.mapPass = null;\n\t\tthis.matrix = new Matrix4();\n\n\t\tthis.autoUpdate = true;\n\t\tthis.needsUpdate = false;\n\n\t\tthis._frustum = new Frustum();\n\t\tthis._frameExtents = new Vector2( 1, 1 );\n\n\t\tthis._viewportCount = 1;\n\n\t\tthis._viewports = [\n\n\t\t\tnew Vector4( 0, 0, 1, 1 )\n\n\t\t];\n\n\t}\n\n\tgetViewportCount() {\n\n\t\treturn this._viewportCount;\n\n\t}\n\n\tgetFrustum() {\n\n\t\treturn this._frustum;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst shadowCamera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\t_lightPositionWorld$1.setFromMatrixPosition( light.matrixWorld );\n\t\tshadowCamera.position.copy( _lightPositionWorld$1 );\n\n\t\t_lookTarget$1.setFromMatrixPosition( light.target.matrixWorld );\n\t\tshadowCamera.lookAt( _lookTarget$1 );\n\t\tshadowCamera.updateMatrixWorld();\n\n\t\t_projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix$1 );\n\n\t\tshadowMatrix.set(\n\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t);\n\n\t\tshadowMatrix.multiply( shadowCamera.projectionMatrix );\n\t\tshadowMatrix.multiply( shadowCamera.matrixWorldInverse );\n\n\t}\n\n\tgetViewport( viewportIndex ) {\n\n\t\treturn this._viewports[ viewportIndex ];\n\n\t}\n\n\tgetFrameExtents() {\n\n\t\treturn this._frameExtents;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.map ) {\n\n\t\t\tthis.map.dispose();\n\n\t\t}\n\n\t\tif ( this.mapPass ) {\n\n\t\t\tthis.mapPass.dispose();\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.camera = source.camera.clone();\n\n\t\tthis.bias = source.bias;\n\t\tthis.radius = source.radius;\n\n\t\tthis.mapSize.copy( source.mapSize );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst object = {};\n\n\t\tif ( this.bias !== 0 ) object.bias = this.bias;\n\t\tif ( this.normalBias !== 0 ) object.normalBias = this.normalBias;\n\t\tif ( this.radius !== 1 ) object.radius = this.radius;\n\t\tif ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();\n\n\t\tobject.camera = this.camera.toJSON( false ).object;\n\t\tdelete object.camera.matrix;\n\n\t\treturn object;\n\n\t}\n\n}\n\nclass SpotLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 50, 1, 0.5, 500 ) );\n\n\t\tthis.focus = 1;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst camera = this.camera;\n\n\t\tconst fov = RAD2DEG * 2 * light.angle * this.focus;\n\t\tconst aspect = this.mapSize.width / this.mapSize.height;\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) {\n\n\t\t\tcamera.fov = fov;\n\t\t\tcamera.aspect = aspect;\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\tsuper.updateMatrices( light );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.focus = source.focus;\n\n\t\treturn this;\n\n\t}\n\n}\n\nSpotLightShadow.prototype.isSpotLightShadow = true;\n\nclass SpotLight extends Light {\n\n\tconstructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 1 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.type = 'SpotLight';\n\n\t\tthis.position.copy( Object3D.DefaultUp );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tthis.distance = distance;\n\t\tthis.angle = angle;\n\t\tthis.penumbra = penumbra;\n\t\tthis.decay = decay; // for physically correct lights, should be 2.\n\n\t\tthis.shadow = new SpotLightShadow();\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\n\t\treturn this.intensity * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / Math.PI;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.distance = source.distance;\n\t\tthis.angle = source.angle;\n\t\tthis.penumbra = source.penumbra;\n\t\tthis.decay = source.decay;\n\n\t\tthis.target = source.target.clone();\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nSpotLight.prototype.isSpotLight = true;\n\nconst _projScreenMatrix = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld = /*@__PURE__*/ new Vector3();\nconst _lookTarget = /*@__PURE__*/ new Vector3();\n\nclass PointLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 90, 1, 0.5, 500 ) );\n\n\t\tthis._frameExtents = new Vector2( 4, 2 );\n\n\t\tthis._viewportCount = 6;\n\n\t\tthis._viewports = [\n\t\t\t// These viewports map a cube-map onto a 2D texture with the\n\t\t\t// following orientation:\n\t\t\t//\n\t\t\t// xzXZ\n\t\t\t// y Y\n\t\t\t//\n\t\t\t// X - Positive x direction\n\t\t\t// x - Negative x direction\n\t\t\t// Y - Positive y direction\n\t\t\t// y - Negative y direction\n\t\t\t// Z - Positive z direction\n\t\t\t// z - Negative z direction\n\n\t\t\t// positive X\n\t\t\tnew Vector4( 2, 1, 1, 1 ),\n\t\t\t// negative X\n\t\t\tnew Vector4( 0, 1, 1, 1 ),\n\t\t\t// positive Z\n\t\t\tnew Vector4( 3, 1, 1, 1 ),\n\t\t\t// negative Z\n\t\t\tnew Vector4( 1, 1, 1, 1 ),\n\t\t\t// positive Y\n\t\t\tnew Vector4( 3, 0, 1, 1 ),\n\t\t\t// negative Y\n\t\t\tnew Vector4( 1, 0, 1, 1 )\n\t\t];\n\n\t\tthis._cubeDirections = [\n\t\t\tnew Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ),\n\t\t\tnew Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 )\n\t\t];\n\n\t\tthis._cubeUps = [\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ),\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ),\tnew Vector3( 0, 0, - 1 )\n\t\t];\n\n\t}\n\n\tupdateMatrices( light, viewportIndex = 0 ) {\n\n\t\tconst camera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( far !== camera.far ) {\n\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\tcamera.position.copy( _lightPositionWorld );\n\n\t\t_lookTarget.copy( camera.position );\n\t\t_lookTarget.add( this._cubeDirections[ viewportIndex ] );\n\t\tcamera.up.copy( this._cubeUps[ viewportIndex ] );\n\t\tcamera.lookAt( _lookTarget );\n\t\tcamera.updateMatrixWorld();\n\n\t\tshadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );\n\n\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t}\n\n}\n\nPointLightShadow.prototype.isPointLightShadow = true;\n\nclass PointLight extends Light {\n\n\tconstructor( color, intensity, distance = 0, decay = 1 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.type = 'PointLight';\n\n\t\tthis.distance = distance;\n\t\tthis.decay = decay; // for physically correct lights, should be 2.\n\n\t\tthis.shadow = new PointLightShadow();\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\n\t\treturn this.intensity * 4 * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( 4 * Math.PI );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.distance = source.distance;\n\t\tthis.decay = source.decay;\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nPointLight.prototype.isPointLight = true;\n\nclass DirectionalLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );\n\n\t}\n\n}\n\nDirectionalLightShadow.prototype.isDirectionalLightShadow = true;\n\nclass DirectionalLight extends Light {\n\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.type = 'DirectionalLight';\n\n\t\tthis.position.copy( Object3D.DefaultUp );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tthis.shadow = new DirectionalLightShadow();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.target = source.target.clone();\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nDirectionalLight.prototype.isDirectionalLight = true;\n\nclass AmbientLight extends Light {\n\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.type = 'AmbientLight';\n\n\t}\n\n}\n\nAmbientLight.prototype.isAmbientLight = true;\n\nclass RectAreaLight extends Light {\n\n\tconstructor( color, intensity, width = 10, height = 10 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.type = 'RectAreaLight';\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in nits)\n\t\treturn this.intensity * this.width * this.height * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in nits) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( this.width * this.height * Math.PI );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.width = this.width;\n\t\tdata.object.height = this.height;\n\n\t\treturn data;\n\n\t}\n\n}\n\nRectAreaLight.prototype.isRectAreaLight = true;\n\n/**\n * Primary reference:\n * https://graphics.stanford.edu/papers/envmap/envmap.pdf\n *\n * Secondary reference:\n * https://www.ppsloan.org/publications/StupidSH36.pdf\n */\n\n// 3-band SH defined by 9 coefficients\n\nclass SphericalHarmonics3 {\n\n\tconstructor() {\n\n\t\tthis.coefficients = [];\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients.push( new Vector3() );\n\n\t\t}\n\n\t}\n\n\tset( coefficients ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].copy( coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tzero() {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].set( 0, 0, 0 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// get the radiance in the direction of the normal\n\t// target is a Vector3\n\tgetAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 );\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 0.488603 * y );\n\t\ttarget.addScaledVector( coeff[ 2 ], 0.488603 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 0.488603 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) );\n\t\ttarget.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) );\n\t\ttarget.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) );\n\n\t\treturn target;\n\n\t}\n\n\t// get the irradiance (radiance convolved with cosine lobe) in the direction of the normal\n\t// target is a Vector3\n\t// https://graphics.stanford.edu/papers/envmap/envmap.pdf\n\tgetIrradianceAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603\n\t\ttarget.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548\n\t\ttarget.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3\n\t\ttarget.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274\n\n\t\treturn target;\n\n\t}\n\n\tadd( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].add( sh.coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\taddScaledSH( sh, s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tscale( s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].multiplyScalar( s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tlerp( sh, alpha ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].lerp( sh.coefficients[ i ], alpha );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tequals( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tcopy( sh ) {\n\n\t\treturn this.set( sh.coefficients );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].fromArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].toArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn array;\n\n\t}\n\n\t// evaluate the basis functions\n\t// shBasis is an Array[ 9 ]\n\tstatic getBasisAt( normal, shBasis ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\t// band 0\n\t\tshBasis[ 0 ] = 0.282095;\n\n\t\t// band 1\n\t\tshBasis[ 1 ] = 0.488603 * y;\n\t\tshBasis[ 2 ] = 0.488603 * z;\n\t\tshBasis[ 3 ] = 0.488603 * x;\n\n\t\t// band 2\n\t\tshBasis[ 4 ] = 1.092548 * x * y;\n\t\tshBasis[ 5 ] = 1.092548 * y * z;\n\t\tshBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 );\n\t\tshBasis[ 7 ] = 1.092548 * x * z;\n\t\tshBasis[ 8 ] = 0.546274 * ( x * x - y * y );\n\n\t}\n\n}\n\nSphericalHarmonics3.prototype.isSphericalHarmonics3 = true;\n\nclass LightProbe extends Light {\n\n\tconstructor( sh = new SphericalHarmonics3(), intensity = 1 ) {\n\n\t\tsuper( undefined, intensity );\n\n\t\tthis.sh = sh;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.sh.copy( source.sh );\n\n\t\treturn this;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tthis.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON();\n\t\tthis.sh.fromArray( json.sh );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.sh = this.sh.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\nLightProbe.prototype.isLightProbe = true;\n\nclass MaterialLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\t\tthis.textures = {};\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst textures = this.textures;\n\n\t\tfunction getTexture( name ) {\n\n\t\t\tif ( textures[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.MaterialLoader: Undefined texture', name );\n\n\t\t\t}\n\n\t\t\treturn textures[ name ];\n\n\t\t}\n\n\t\tconst material = new Materials[ json.type ]();\n\n\t\tif ( json.uuid !== undefined ) material.uuid = json.uuid;\n\t\tif ( json.name !== undefined ) material.name = json.name;\n\t\tif ( json.color !== undefined && material.color !== undefined ) material.color.setHex( json.color );\n\t\tif ( json.roughness !== undefined ) material.roughness = json.roughness;\n\t\tif ( json.metalness !== undefined ) material.metalness = json.metalness;\n\t\tif ( json.sheen !== undefined ) material.sheen = json.sheen;\n\t\tif ( json.sheenColor !== undefined ) material.sheenColor = new Color().setHex( json.sheenColor );\n\t\tif ( json.sheenRoughness !== undefined ) material.sheenRoughness = json.sheenRoughness;\n\t\tif ( json.emissive !== undefined && material.emissive !== undefined ) material.emissive.setHex( json.emissive );\n\t\tif ( json.specular !== undefined && material.specular !== undefined ) material.specular.setHex( json.specular );\n\t\tif ( json.specularIntensity !== undefined ) material.specularIntensity = json.specularIntensity;\n\t\tif ( json.specularColor !== undefined && material.specularColor !== undefined ) material.specularColor.setHex( json.specularColor );\n\t\tif ( json.shininess !== undefined ) material.shininess = json.shininess;\n\t\tif ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat;\n\t\tif ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;\n\t\tif ( json.transmission !== undefined ) material.transmission = json.transmission;\n\t\tif ( json.thickness !== undefined ) material.thickness = json.thickness;\n\t\tif ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;\n\t\tif ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );\n\t\tif ( json.fog !== undefined ) material.fog = json.fog;\n\t\tif ( json.flatShading !== undefined ) material.flatShading = json.flatShading;\n\t\tif ( json.blending !== undefined ) material.blending = json.blending;\n\t\tif ( json.combine !== undefined ) material.combine = json.combine;\n\t\tif ( json.side !== undefined ) material.side = json.side;\n\t\tif ( json.shadowSide !== undefined ) material.shadowSide = json.shadowSide;\n\t\tif ( json.opacity !== undefined ) material.opacity = json.opacity;\n\t\tif ( json.transparent !== undefined ) material.transparent = json.transparent;\n\t\tif ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;\n\t\tif ( json.depthTest !== undefined ) material.depthTest = json.depthTest;\n\t\tif ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;\n\t\tif ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;\n\n\t\tif ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite;\n\t\tif ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask;\n\t\tif ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc;\n\t\tif ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef;\n\t\tif ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask;\n\t\tif ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail;\n\t\tif ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail;\n\t\tif ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass;\n\n\t\tif ( json.wireframe !== undefined ) material.wireframe = json.wireframe;\n\t\tif ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\tif ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;\n\t\tif ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;\n\n\t\tif ( json.rotation !== undefined ) material.rotation = json.rotation;\n\n\t\tif ( json.linewidth !== 1 ) material.linewidth = json.linewidth;\n\t\tif ( json.dashSize !== undefined ) material.dashSize = json.dashSize;\n\t\tif ( json.gapSize !== undefined ) material.gapSize = json.gapSize;\n\t\tif ( json.scale !== undefined ) material.scale = json.scale;\n\n\t\tif ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset;\n\t\tif ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor;\n\t\tif ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits;\n\n\t\tif ( json.dithering !== undefined ) material.dithering = json.dithering;\n\n\t\tif ( json.alphaToCoverage !== undefined ) material.alphaToCoverage = json.alphaToCoverage;\n\t\tif ( json.premultipliedAlpha !== undefined ) material.premultipliedAlpha = json.premultipliedAlpha;\n\n\t\tif ( json.visible !== undefined ) material.visible = json.visible;\n\n\t\tif ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped;\n\n\t\tif ( json.userData !== undefined ) material.userData = json.userData;\n\n\t\tif ( json.vertexColors !== undefined ) {\n\n\t\t\tif ( typeof json.vertexColors === 'number' ) {\n\n\t\t\t\tmaterial.vertexColors = ( json.vertexColors > 0 ) ? true : false;\n\n\t\t\t} else {\n\n\t\t\t\tmaterial.vertexColors = json.vertexColors;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Shader Material\n\n\t\tif ( json.uniforms !== undefined ) {\n\n\t\t\tfor ( const name in json.uniforms ) {\n\n\t\t\t\tconst uniform = json.uniforms[ name ];\n\n\t\t\t\tmaterial.uniforms[ name ] = {};\n\n\t\t\t\tswitch ( uniform.type ) {\n\n\t\t\t\t\tcase 't':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = getTexture( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Color().setHex( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v2':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector2().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = uniform.value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.defines !== undefined ) material.defines = json.defines;\n\t\tif ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader;\n\t\tif ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader;\n\n\t\tif ( json.extensions !== undefined ) {\n\n\t\t\tfor ( const key in json.extensions ) {\n\n\t\t\t\tmaterial.extensions[ key ] = json.extensions[ key ];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Deprecated\n\n\t\tif ( json.shading !== undefined ) material.flatShading = json.shading === 1; // THREE.FlatShading\n\n\t\t// for PointsMaterial\n\n\t\tif ( json.size !== undefined ) material.size = json.size;\n\t\tif ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation;\n\n\t\t// maps\n\n\t\tif ( json.map !== undefined ) material.map = getTexture( json.map );\n\t\tif ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );\n\n\t\tif ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap );\n\n\t\tif ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );\n\t\tif ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;\n\n\t\tif ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );\n\t\tif ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType;\n\t\tif ( json.normalScale !== undefined ) {\n\n\t\t\tlet normalScale = json.normalScale;\n\n\t\t\tif ( Array.isArray( normalScale ) === false ) {\n\n\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\n\t\t\t\tnormalScale = [ normalScale, normalScale ];\n\n\t\t\t}\n\n\t\t\tmaterial.normalScale = new Vector2().fromArray( normalScale );\n\n\t\t}\n\n\t\tif ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap );\n\t\tif ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale;\n\t\tif ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias;\n\n\t\tif ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap );\n\t\tif ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap );\n\n\t\tif ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap );\n\t\tif ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;\n\n\t\tif ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap );\n\t\tif ( json.specularIntensityMap !== undefined ) material.specularIntensityMap = getTexture( json.specularIntensityMap );\n\t\tif ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );\n\n\t\tif ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );\n\t\tif ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;\n\n\t\tif ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;\n\t\tif ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio;\n\n\t\tif ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap );\n\t\tif ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity;\n\n\t\tif ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap );\n\t\tif ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity;\n\n\t\tif ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );\n\n\t\tif ( json.clearcoatMap !== undefined ) material.clearcoatMap = getTexture( json.clearcoatMap );\n\t\tif ( json.clearcoatRoughnessMap !== undefined ) material.clearcoatRoughnessMap = getTexture( json.clearcoatRoughnessMap );\n\t\tif ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap );\n\t\tif ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale );\n\n\t\tif ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );\n\t\tif ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );\n\n\t\tif ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );\n\t\tif ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );\n\n\t\treturn material;\n\n\t}\n\n\tsetTextures( value ) {\n\n\t\tthis.textures = value;\n\t\treturn this;\n\n\t}\n\n}\n\nclass LoaderUtils {\n\n\tstatic decodeText( array ) {\n\n\t\tif ( typeof TextDecoder !== 'undefined' ) {\n\n\t\t\treturn new TextDecoder().decode( array );\n\n\t\t}\n\n\t\t// Avoid the String.fromCharCode.apply(null, array) shortcut, which\n\t\t// throws a \"maximum call stack size exceeded\" error for large arrays.\n\n\t\tlet s = '';\n\n\t\tfor ( let i = 0, il = array.length; i < il; i ++ ) {\n\n\t\t\t// Implicitly assumes little-endian.\n\t\t\ts += String.fromCharCode( array[ i ] );\n\n\t\t}\n\n\t\ttry {\n\n\t\t\t// merges multi-byte utf-8 characters.\n\n\t\t\treturn decodeURIComponent( escape( s ) );\n\n\t\t} catch ( e ) { // see #16358\n\n\t\t\treturn s;\n\n\t\t}\n\n\t}\n\n\tstatic extractUrlBase( url ) {\n\n\t\tconst index = url.lastIndexOf( '/' );\n\n\t\tif ( index === - 1 ) return './';\n\n\t\treturn url.substr( 0, index + 1 );\n\n\t}\n\n\tstatic resolveURL( url, path ) {\n\n\t\t// Invalid URL\n\t\tif ( typeof url !== 'string' || url === '' ) return '';\n\n\t\t// Host Relative URL\n\t\tif ( /^https?:\\/\\//i.test( path ) && /^\\//.test( url ) ) {\n\n\t\t\tpath = path.replace( /(^https?:\\/\\/[^\\/]+).*/i, '$1' );\n\n\t\t}\n\n\t\t// Absolute URL http://,https://,//\n\t\tif ( /^(https?:)?\\/\\//i.test( url ) ) return url;\n\n\t\t// Data URI\n\t\tif ( /^data:.*,.*$/i.test( url ) ) return url;\n\n\t\t// Blob URL\n\t\tif ( /^blob:.*$/i.test( url ) ) return url;\n\n\t\t// Relative URL\n\t\treturn path + url;\n\n\t}\n\n}\n\nclass InstancedBufferGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'InstancedBufferGeometry';\n\t\tthis.instanceCount = Infinity;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.instanceCount = source.instanceCount;\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON( this );\n\n\t\tdata.instanceCount = this.instanceCount;\n\n\t\tdata.isInstancedBufferGeometry = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nInstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;\n\nclass BufferGeometryLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst interleavedBufferMap = {};\n\t\tconst arrayBufferMap = {};\n\n\t\tfunction getInterleavedBuffer( json, uuid ) {\n\n\t\t\tif ( interleavedBufferMap[ uuid ] !== undefined ) return interleavedBufferMap[ uuid ];\n\n\t\t\tconst interleavedBuffers = json.interleavedBuffers;\n\t\t\tconst interleavedBuffer = interleavedBuffers[ uuid ];\n\n\t\t\tconst buffer = getArrayBuffer( json, interleavedBuffer.buffer );\n\n\t\t\tconst array = getTypedArray( interleavedBuffer.type, buffer );\n\t\t\tconst ib = new InterleavedBuffer( array, interleavedBuffer.stride );\n\t\t\tib.uuid = interleavedBuffer.uuid;\n\n\t\t\tinterleavedBufferMap[ uuid ] = ib;\n\n\t\t\treturn ib;\n\n\t\t}\n\n\t\tfunction getArrayBuffer( json, uuid ) {\n\n\t\t\tif ( arrayBufferMap[ uuid ] !== undefined ) return arrayBufferMap[ uuid ];\n\n\t\t\tconst arrayBuffers = json.arrayBuffers;\n\t\t\tconst arrayBuffer = arrayBuffers[ uuid ];\n\n\t\t\tconst ab = new Uint32Array( arrayBuffer ).buffer;\n\n\t\t\tarrayBufferMap[ uuid ] = ab;\n\n\t\t\treturn ab;\n\n\t\t}\n\n\t\tconst geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();\n\n\t\tconst index = json.data.index;\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst typedArray = getTypedArray( index.type, index.array );\n\t\t\tgeometry.setIndex( new BufferAttribute( typedArray, 1 ) );\n\n\t\t}\n\n\t\tconst attributes = json.data.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\t\t\tlet bufferAttribute;\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t} else {\n\n\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\tconst bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;\n\t\t\t\tbufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t}\n\n\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\tif ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );\n\n\t\t\tif ( attribute.updateRange !== undefined ) {\n\n\t\t\t\tbufferAttribute.updateRange.offset = attribute.updateRange.offset;\n\t\t\t\tbufferAttribute.updateRange.count = attribute.updateRange.count;\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( key, bufferAttribute );\n\n\t\t}\n\n\t\tconst morphAttributes = json.data.morphAttributes;\n\n\t\tif ( morphAttributes ) {\n\n\t\t\tfor ( const key in morphAttributes ) {\n\n\t\t\t\tconst attributeArray = morphAttributes[ key ];\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst attribute = attributeArray[ i ];\n\t\t\t\t\tlet bufferAttribute;\n\n\t\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\t\t\tbufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\t\t\tarray.push( bufferAttribute );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.morphAttributes[ key ] = array;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst morphTargetsRelative = json.data.morphTargetsRelative;\n\n\t\tif ( morphTargetsRelative ) {\n\n\t\t\tgeometry.morphTargetsRelative = true;\n\n\t\t}\n\n\t\tconst groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\tif ( groups !== undefined ) {\n\n\t\t\tfor ( let i = 0, n = groups.length; i !== n; ++ i ) {\n\n\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\tgeometry.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst boundingSphere = json.data.boundingSphere;\n\n\t\tif ( boundingSphere !== undefined ) {\n\n\t\t\tconst center = new Vector3();\n\n\t\t\tif ( boundingSphere.center !== undefined ) {\n\n\t\t\t\tcenter.fromArray( boundingSphere.center );\n\n\t\t\t}\n\n\t\t\tgeometry.boundingSphere = new Sphere( center, boundingSphere.radius );\n\n\t\t}\n\n\t\tif ( json.name ) geometry.name = json.name;\n\t\tif ( json.userData ) geometry.userData = json.userData;\n\n\t\treturn geometry;\n\n\t}\n\n}\n\nclass ObjectLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tlet json = null;\n\n\t\t\ttry {\n\n\t\t\t\tjson = JSON.parse( text );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( error );\n\n\t\t\t\tconsole.error( 'THREE:ObjectLoader: Can\\'t parse ' + url + '.', error.message );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst metadata = json.metadata;\n\n\t\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\t\tconsole.error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tscope.parse( json, onLoad );\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tasync loadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\n\t\tconst text = await loader.loadAsync( url, onProgress );\n\n\t\tconst json = JSON.parse( text );\n\n\t\tconst metadata = json.metadata;\n\n\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\tthrow new Error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\n\t\t}\n\n\t\treturn await scope.parseAsync( json );\n\n\t}\n\n\tparse( json, onLoad ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = this.parseImages( json.images, function () {\n\n\t\t\tif ( onLoad !== undefined ) onLoad( object );\n\n\t\t} );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\n\t\t//\n\n\t\tif ( onLoad !== undefined ) {\n\n\t\t\tlet hasImages = false;\n\n\t\t\tfor ( const uuid in images ) {\n\n\t\t\t\tif ( images[ uuid ] instanceof HTMLImageElement ) {\n\n\t\t\t\t\thasImages = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( hasImages === false ) onLoad( object );\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tasync parseAsync( json ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = await this.parseImagesAsync( json.images );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\n\t\treturn object;\n\n\t}\n\n\tparseShapes( json ) {\n\n\t\tconst shapes = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst shape = new Shape().fromJSON( json[ i ] );\n\n\t\t\t\tshapes[ shape.uuid ] = shape;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn shapes;\n\n\t}\n\n\tparseSkeletons( json, object ) {\n\n\t\tconst skeletons = {};\n\t\tconst bones = {};\n\n\t\t// generate bone lookup table\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isBone ) bones[ child.uuid ] = child;\n\n\t\t} );\n\n\t\t// create skeletons\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst skeleton = new Skeleton().fromJSON( json[ i ], bones );\n\n\t\t\t\tskeletons[ skeleton.uuid ] = skeleton;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn skeletons;\n\n\t}\n\n\tparseGeometries( json, shapes ) {\n\n\t\tconst geometries = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tlet geometry;\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tswitch ( data.type ) {\n\n\t\t\t\t\tcase 'BufferGeometry':\n\t\t\t\t\tcase 'InstancedBufferGeometry':\n\n\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse( data );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Geometry':\n\n\t\t\t\t\t\tconsole.error( 'THREE.ObjectLoader: The legacy Geometry type is no longer supported.' );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( data.type in Geometries ) {\n\n\t\t\t\t\t\t\tgeometry = Geometries[ data.type ].fromJSON( data, shapes );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( `THREE.ObjectLoader: Unsupported geometry type \"${ data.type }\"` );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) geometry.name = data.name;\n\t\t\t\tif ( geometry.isBufferGeometry === true && data.userData !== undefined ) geometry.userData = data.userData;\n\n\t\t\t\tgeometries[ data.uuid ] = geometry;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn geometries;\n\n\t}\n\n\tparseMaterials( json, textures ) {\n\n\t\tconst cache = {}; // MultiMaterial\n\t\tconst materials = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst loader = new MaterialLoader();\n\t\t\tloader.setTextures( textures );\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( data.type === 'MultiMaterial' ) {\n\n\t\t\t\t\t// Deprecated\n\n\t\t\t\t\tconst array = [];\n\n\t\t\t\t\tfor ( let j = 0; j < data.materials.length; j ++ ) {\n\n\t\t\t\t\t\tconst material = data.materials[ j ];\n\n\t\t\t\t\t\tif ( cache[ material.uuid ] === undefined ) {\n\n\t\t\t\t\t\t\tcache[ material.uuid ] = loader.parse( material );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tarray.push( cache[ material.uuid ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmaterials[ data.uuid ] = array;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( cache[ data.uuid ] === undefined ) {\n\n\t\t\t\t\t\tcache[ data.uuid ] = loader.parse( data );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmaterials[ data.uuid ] = cache[ data.uuid ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn materials;\n\n\t}\n\n\tparseAnimations( json ) {\n\n\t\tconst animations = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tconst clip = AnimationClip.parse( data );\n\n\t\t\t\tanimations[ clip.uuid ] = clip;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n\tparseImages( json, onLoad ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tfunction loadImage( url ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\treturn loader.load( url, function () {\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, undefined, function () {\n\n\t\t\t\tscope.manager.itemError( url );\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tfunction deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn loadImage( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tconst manager = new LoadingManager( onLoad );\n\n\t\t\tloader = new ImageLoader( manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\timages[ image.uuid ] = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timages[ image.uuid ].push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timages[ image.uuid ].push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = deserializeImage( image.url );\n\n\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\timages[ image.uuid ] = deserializedImage;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tasync parseImagesAsync( json ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tasync function deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn await loader.loadAsync( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tloader = new ImageLoader( this.manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\timages[ image.uuid ] = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = await deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timages[ image.uuid ].push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timages[ image.uuid ].push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = await deserializeImage( image.url );\n\n\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\timages[ image.uuid ] = deserializedImage;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tparseTextures( json, images ) {\n\n\t\tfunction parseConstant( value, type ) {\n\n\t\t\tif ( typeof value === 'number' ) return value;\n\n\t\t\tconsole.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value );\n\n\t\t\treturn type[ value ];\n\n\t\t}\n\n\t\tconst textures = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( data.image === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No \"image\" specified for', data.uuid );\n\n\t\t\t\t}\n\n\t\t\t\tif ( images[ data.image ] === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined image', data.image );\n\n\t\t\t\t}\n\n\t\t\t\tlet texture;\n\t\t\t\tconst image = images[ data.image ];\n\n\t\t\t\tif ( Array.isArray( image ) ) {\n\n\t\t\t\t\ttexture = new CubeTexture( image );\n\n\t\t\t\t\tif ( image.length === 6 ) texture.needsUpdate = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( image && image.data ) {\n\n\t\t\t\t\t\ttexture = new DataTexture( image.data, image.width, image.height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttexture = new Texture( image );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( image ) texture.needsUpdate = true; // textures can have undefined image data\n\n\t\t\t\t}\n\n\t\t\t\ttexture.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) texture.name = data.name;\n\n\t\t\t\tif ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING );\n\n\t\t\t\tif ( data.offset !== undefined ) texture.offset.fromArray( data.offset );\n\t\t\t\tif ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );\n\t\t\t\tif ( data.center !== undefined ) texture.center.fromArray( data.center );\n\t\t\t\tif ( data.rotation !== undefined ) texture.rotation = data.rotation;\n\n\t\t\t\tif ( data.wrap !== undefined ) {\n\n\t\t\t\t\ttexture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING );\n\t\t\t\t\ttexture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.format !== undefined ) texture.format = data.format;\n\t\t\t\tif ( data.type !== undefined ) texture.type = data.type;\n\t\t\t\tif ( data.encoding !== undefined ) texture.encoding = data.encoding;\n\n\t\t\t\tif ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;\n\n\t\t\t\tif ( data.flipY !== undefined ) texture.flipY = data.flipY;\n\n\t\t\t\tif ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;\n\t\t\t\tif ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;\n\n\t\t\t\tif ( data.userData !== undefined ) texture.userData = data.userData;\n\n\t\t\t\ttextures[ data.uuid ] = texture;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn textures;\n\n\t}\n\n\tparseObject( data, geometries, materials, textures, animations ) {\n\n\t\tlet object;\n\n\t\tfunction getGeometry( name ) {\n\n\t\t\tif ( geometries[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined geometry', name );\n\n\t\t\t}\n\n\t\t\treturn geometries[ name ];\n\n\t\t}\n\n\t\tfunction getMaterial( name ) {\n\n\t\t\tif ( name === undefined ) return undefined;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, l = name.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst uuid = name[ i ];\n\n\t\t\t\t\tif ( materials[ uuid ] === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', uuid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tarray.push( materials[ uuid ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn array;\n\n\t\t\t}\n\n\t\t\tif ( materials[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', name );\n\n\t\t\t}\n\n\t\t\treturn materials[ name ];\n\n\t\t}\n\n\t\tfunction getTexture( uuid ) {\n\n\t\t\tif ( textures[ uuid ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined texture', uuid );\n\n\t\t\t}\n\n\t\t\treturn textures[ uuid ];\n\n\t\t}\n\n\t\tlet geometry, material;\n\n\t\tswitch ( data.type ) {\n\n\t\t\tcase 'Scene':\n\n\t\t\t\tobject = new Scene();\n\n\t\t\t\tif ( data.background !== undefined ) {\n\n\t\t\t\t\tif ( Number.isInteger( data.background ) ) {\n\n\t\t\t\t\t\tobject.background = new Color( data.background );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tobject.background = getTexture( data.background );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.environment !== undefined ) {\n\n\t\t\t\t\tobject.environment = getTexture( data.environment );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.fog !== undefined ) {\n\n\t\t\t\t\tif ( data.fog.type === 'Fog' ) {\n\n\t\t\t\t\t\tobject.fog = new Fog( data.fog.color, data.fog.near, data.fog.far );\n\n\t\t\t\t\t} else if ( data.fog.type === 'FogExp2' ) {\n\n\t\t\t\t\t\tobject.fog = new FogExp2( data.fog.color, data.fog.density );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PerspectiveCamera':\n\n\t\t\t\tobject = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far );\n\n\t\t\t\tif ( data.focus !== undefined ) object.focus = data.focus;\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge;\n\t\t\t\tif ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'OrthographicCamera':\n\n\t\t\t\tobject = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far );\n\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'AmbientLight':\n\n\t\t\t\tobject = new AmbientLight( data.color, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'DirectionalLight':\n\n\t\t\t\tobject = new DirectionalLight( data.color, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointLight':\n\n\t\t\t\tobject = new PointLight( data.color, data.intensity, data.distance, data.decay );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'RectAreaLight':\n\n\t\t\t\tobject = new RectAreaLight( data.color, data.intensity, data.width, data.height );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SpotLight':\n\n\t\t\t\tobject = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'HemisphereLight':\n\n\t\t\t\tobject = new HemisphereLight( data.color, data.groundColor, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LightProbe':\n\n\t\t\t\tobject = new LightProbe().fromJSON( data );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SkinnedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t \tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new SkinnedMesh( geometry, material );\n\n\t\t\t\tif ( data.bindMode !== undefined ) object.bindMode = data.bindMode;\n\t\t\t\tif ( data.bindMatrix !== undefined ) object.bindMatrix.fromArray( data.bindMatrix );\n\t\t\t\tif ( data.skeleton !== undefined ) object.skeleton = data.skeleton;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Mesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new Mesh( geometry, material );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'InstancedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\t\t\t\tconst count = data.count;\n\t\t\t\tconst instanceMatrix = data.instanceMatrix;\n\t\t\t\tconst instanceColor = data.instanceColor;\n\n\t\t\t\tobject = new InstancedMesh( geometry, material, count );\n\t\t\t\tobject.instanceMatrix = new InstancedBufferAttribute( new Float32Array( instanceMatrix.array ), 16 );\n\t\t\t\tif ( instanceColor !== undefined ) object.instanceColor = new InstancedBufferAttribute( new Float32Array( instanceColor.array ), instanceColor.itemSize );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LOD':\n\n\t\t\t\tobject = new LOD();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Line':\n\n\t\t\t\tobject = new Line( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineLoop':\n\n\t\t\t\tobject = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineSegments':\n\n\t\t\t\tobject = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointCloud':\n\t\t\tcase 'Points':\n\n\t\t\t\tobject = new Points( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Sprite':\n\n\t\t\t\tobject = new Sprite( getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Group':\n\n\t\t\t\tobject = new Group();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Bone':\n\n\t\t\t\tobject = new Bone();\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tobject = new Object3D();\n\n\t\t}\n\n\t\tobject.uuid = data.uuid;\n\n\t\tif ( data.name !== undefined ) object.name = data.name;\n\n\t\tif ( data.matrix !== undefined ) {\n\n\t\t\tobject.matrix.fromArray( data.matrix );\n\n\t\t\tif ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate;\n\t\t\tif ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale );\n\n\t\t} else {\n\n\t\t\tif ( data.position !== undefined ) object.position.fromArray( data.position );\n\t\t\tif ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation );\n\t\t\tif ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion );\n\t\t\tif ( data.scale !== undefined ) object.scale.fromArray( data.scale );\n\n\t\t}\n\n\t\tif ( data.castShadow !== undefined ) object.castShadow = data.castShadow;\n\t\tif ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;\n\n\t\tif ( data.shadow ) {\n\n\t\t\tif ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;\n\t\t\tif ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias;\n\t\t\tif ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;\n\t\t\tif ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );\n\t\t\tif ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );\n\n\t\t}\n\n\t\tif ( data.visible !== undefined ) object.visible = data.visible;\n\t\tif ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled;\n\t\tif ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder;\n\t\tif ( data.userData !== undefined ) object.userData = data.userData;\n\t\tif ( data.layers !== undefined ) object.layers.mask = data.layers;\n\n\t\tif ( data.children !== undefined ) {\n\n\t\t\tconst children = data.children;\n\n\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\tobject.add( this.parseObject( children[ i ], geometries, materials, textures, animations ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.animations !== undefined ) {\n\n\t\t\tconst objectAnimations = data.animations;\n\n\t\t\tfor ( let i = 0; i < objectAnimations.length; i ++ ) {\n\n\t\t\t\tconst uuid = objectAnimations[ i ];\n\n\t\t\t\tobject.animations.push( animations[ uuid ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.type === 'LOD' ) {\n\n\t\t\tif ( data.autoUpdate !== undefined ) object.autoUpdate = data.autoUpdate;\n\n\t\t\tconst levels = data.levels;\n\n\t\t\tfor ( let l = 0; l < levels.length; l ++ ) {\n\n\t\t\t\tconst level = levels[ l ];\n\t\t\t\tconst child = object.getObjectByProperty( 'uuid', level.object );\n\n\t\t\t\tif ( child !== undefined ) {\n\n\t\t\t\t\tobject.addLevel( child, level.distance );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tbindSkeletons( object, skeletons ) {\n\n\t\tif ( Object.keys( skeletons ).length === 0 ) return;\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isSkinnedMesh === true && child.skeleton !== undefined ) {\n\n\t\t\t\tconst skeleton = skeletons[ child.skeleton ];\n\n\t\t\t\tif ( skeleton === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.bind( skeleton, child.bindMatrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n\t/* DEPRECATED */\n\n\tsetTexturePath( value ) {\n\n\t\tconsole.warn( 'THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().' );\n\t\treturn this.setResourcePath( value );\n\n\t}\n\n}\n\nconst TEXTURE_MAPPING = {\n\tUVMapping: UVMapping,\n\tCubeReflectionMapping: CubeReflectionMapping,\n\tCubeRefractionMapping: CubeRefractionMapping,\n\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\tCubeUVReflectionMapping: CubeUVReflectionMapping,\n\tCubeUVRefractionMapping: CubeUVRefractionMapping\n};\n\nconst TEXTURE_WRAPPING = {\n\tRepeatWrapping: RepeatWrapping,\n\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\tMirroredRepeatWrapping: MirroredRepeatWrapping\n};\n\nconst TEXTURE_FILTER = {\n\tNearestFilter: NearestFilter,\n\tNearestMipmapNearestFilter: NearestMipmapNearestFilter,\n\tNearestMipmapLinearFilter: NearestMipmapLinearFilter,\n\tLinearFilter: LinearFilter,\n\tLinearMipmapNearestFilter: LinearMipmapNearestFilter,\n\tLinearMipmapLinearFilter: LinearMipmapLinearFilter\n};\n\nclass ImageBitmapLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\tif ( typeof createImageBitmap === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' );\n\n\t\t}\n\n\t\tif ( typeof fetch === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' );\n\n\t\t}\n\n\t\tthis.options = { premultiplyAlpha: 'none' };\n\n\t}\n\n\tsetOptions( options ) {\n\n\t\tthis.options = options;\n\n\t\treturn this;\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst fetchOptions = {};\n\t\tfetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';\n\t\tfetchOptions.headers = this.requestHeader;\n\n\t\tfetch( url, fetchOptions ).then( function ( res ) {\n\n\t\t\treturn res.blob();\n\n\t\t} ).then( function ( blob ) {\n\n\t\t\treturn createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) );\n\n\t\t} ).then( function ( imageBitmap ) {\n\n\t\t\tCache.add( url, imageBitmap );\n\n\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t} ).catch( function ( e ) {\n\n\t\t\tif ( onError ) onError( e );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t} );\n\n\t\tscope.manager.itemStart( url );\n\n\t}\n\n}\n\nImageBitmapLoader.prototype.isImageBitmapLoader = true;\n\nlet _context;\n\nconst AudioContext = {\n\n\tgetContext: function () {\n\n\t\tif ( _context === undefined ) {\n\n\t\t\t_context = new ( window.AudioContext || window.webkitAudioContext )();\n\n\t\t}\n\n\t\treturn _context;\n\n\t},\n\n\tsetContext: function ( value ) {\n\n\t\t_context = value;\n\n\t}\n\n};\n\nclass AudioLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\ttry {\n\n\t\t\t\t// Create a copy of the buffer. The `decodeAudioData` method\n\t\t\t\t// detaches the buffer when complete, preventing reuse.\n\t\t\t\tconst bufferCopy = buffer.slice( 0 );\n\n\t\t\t\tconst context = AudioContext.getContext();\n\t\t\t\tcontext.decodeAudioData( bufferCopy, function ( audioBuffer ) {\n\n\t\t\t\t\tonLoad( audioBuffer );\n\n\t\t\t\t} );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n}\n\nclass HemisphereLightProbe extends LightProbe {\n\n\tconstructor( skyColor, groundColor, intensity = 1 ) {\n\n\t\tsuper( undefined, intensity );\n\n\t\tconst color1 = new Color().set( skyColor );\n\t\tconst color2 = new Color().set( groundColor );\n\n\t\tconst sky = new Vector3( color1.r, color1.g, color1.b );\n\t\tconst ground = new Vector3( color2.r, color2.g, color2.b );\n\n\t\t// without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI );\n\t\tconst c0 = Math.sqrt( Math.PI );\n\t\tconst c1 = c0 * Math.sqrt( 0.75 );\n\n\t\tthis.sh.coefficients[ 0 ].copy( sky ).add( ground ).multiplyScalar( c0 );\n\t\tthis.sh.coefficients[ 1 ].copy( sky ).sub( ground ).multiplyScalar( c1 );\n\n\t}\n\n}\n\nHemisphereLightProbe.prototype.isHemisphereLightProbe = true;\n\nclass AmbientLightProbe extends LightProbe {\n\n\tconstructor( color, intensity = 1 ) {\n\n\t\tsuper( undefined, intensity );\n\n\t\tconst color1 = new Color().set( color );\n\n\t\t// without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI );\n\t\tthis.sh.coefficients[ 0 ].set( color1.r, color1.g, color1.b ).multiplyScalar( 2 * Math.sqrt( Math.PI ) );\n\n\t}\n\n}\n\nAmbientLightProbe.prototype.isAmbientLightProbe = true;\n\nconst _eyeRight = /*@__PURE__*/ new Matrix4();\nconst _eyeLeft = /*@__PURE__*/ new Matrix4();\nconst _projectionMatrix = /*@__PURE__*/ new Matrix4();\n\nclass StereoCamera {\n\n\tconstructor() {\n\n\t\tthis.type = 'StereoCamera';\n\n\t\tthis.aspect = 1;\n\n\t\tthis.eyeSep = 0.064;\n\n\t\tthis.cameraL = new PerspectiveCamera();\n\t\tthis.cameraL.layers.enable( 1 );\n\t\tthis.cameraL.matrixAutoUpdate = false;\n\n\t\tthis.cameraR = new PerspectiveCamera();\n\t\tthis.cameraR.layers.enable( 2 );\n\t\tthis.cameraR.matrixAutoUpdate = false;\n\n\t\tthis._cache = {\n\t\t\tfocus: null,\n\t\t\tfov: null,\n\t\t\taspect: null,\n\t\t\tnear: null,\n\t\t\tfar: null,\n\t\t\tzoom: null,\n\t\t\teyeSep: null\n\t\t};\n\n\t}\n\n\tupdate( camera ) {\n\n\t\tconst cache = this._cache;\n\n\t\tconst needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov ||\n\t\t\tcache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near ||\n\t\t\tcache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep;\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tcache.focus = camera.focus;\n\t\t\tcache.fov = camera.fov;\n\t\t\tcache.aspect = camera.aspect * this.aspect;\n\t\t\tcache.near = camera.near;\n\t\t\tcache.far = camera.far;\n\t\t\tcache.zoom = camera.zoom;\n\t\t\tcache.eyeSep = this.eyeSep;\n\n\t\t\t// Off-axis stereoscopic effect based on\n\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t_projectionMatrix.copy( camera.projectionMatrix );\n\t\t\tconst eyeSepHalf = cache.eyeSep / 2;\n\t\t\tconst eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;\n\t\t\tconst ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom;\n\t\t\tlet xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\t_eyeLeft.elements[ 12 ] = - eyeSepHalf;\n\t\t\t_eyeRight.elements[ 12 ] = eyeSepHalf;\n\n\t\t\t// for left eye\n\n\t\t\txmin = - ymax * cache.aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect + eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraL.projectionMatrix.copy( _projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = - ymax * cache.aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect - eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraR.projectionMatrix.copy( _projectionMatrix );\n\n\t\t}\n\n\t\tthis.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft );\n\t\tthis.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight );\n\n\t}\n\n}\n\nclass Clock {\n\n\tconstructor( autoStart = true ) {\n\n\t\tthis.autoStart = autoStart;\n\n\t\tthis.startTime = 0;\n\t\tthis.oldTime = 0;\n\t\tthis.elapsedTime = 0;\n\n\t\tthis.running = false;\n\n\t}\n\n\tstart() {\n\n\t\tthis.startTime = now();\n\n\t\tthis.oldTime = this.startTime;\n\t\tthis.elapsedTime = 0;\n\t\tthis.running = true;\n\n\t}\n\n\tstop() {\n\n\t\tthis.getElapsedTime();\n\t\tthis.running = false;\n\t\tthis.autoStart = false;\n\n\t}\n\n\tgetElapsedTime() {\n\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\n\t}\n\n\tgetDelta() {\n\n\t\tlet diff = 0;\n\n\t\tif ( this.autoStart && ! this.running ) {\n\n\t\t\tthis.start();\n\t\t\treturn 0;\n\n\t\t}\n\n\t\tif ( this.running ) {\n\n\t\t\tconst newTime = now();\n\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\n\t\t\tthis.elapsedTime += diff;\n\n\t\t}\n\n\t\treturn diff;\n\n\t}\n\n}\n\nfunction now() {\n\n\treturn ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732\n\n}\n\nconst _position$1 = /*@__PURE__*/ new Vector3();\nconst _quaternion$1 = /*@__PURE__*/ new Quaternion();\nconst _scale$1 = /*@__PURE__*/ new Vector3();\nconst _orientation$1 = /*@__PURE__*/ new Vector3();\n\nclass AudioListener extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'AudioListener';\n\n\t\tthis.context = AudioContext.getContext();\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( this.context.destination );\n\n\t\tthis.filter = null;\n\n\t\tthis.timeDelta = 0;\n\n\t\t// private\n\n\t\tthis._clock = new Clock();\n\n\t}\n\n\tgetInput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\tremoveFilter() {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\t\t\tthis.gain.connect( this.context.destination );\n\t\t\tthis.filter = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetFilter() {\n\n\t\treturn this.filter;\n\n\t}\n\n\tsetFilter( value ) {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\n\t\t} else {\n\n\t\t\tthis.gain.disconnect( this.context.destination );\n\n\t\t}\n\n\t\tthis.filter = value;\n\t\tthis.gain.connect( this.filter );\n\t\tthis.filter.connect( this.context.destination );\n\n\t\treturn this;\n\n\t}\n\n\tgetMasterVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\tsetMasterVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tconst listener = this.context.listener;\n\t\tconst up = this.up;\n\n\t\tthis.timeDelta = this._clock.getDelta();\n\n\t\tthis.matrixWorld.decompose( _position$1, _quaternion$1, _scale$1 );\n\n\t\t_orientation$1.set( 0, 0, - 1 ).applyQuaternion( _quaternion$1 );\n\n\t\tif ( listener.positionX ) {\n\n\t\t\t// code path for Chrome (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.timeDelta;\n\n\t\t\tlistener.positionX.linearRampToValueAtTime( _position$1.x, endTime );\n\t\t\tlistener.positionY.linearRampToValueAtTime( _position$1.y, endTime );\n\t\t\tlistener.positionZ.linearRampToValueAtTime( _position$1.z, endTime );\n\t\t\tlistener.forwardX.linearRampToValueAtTime( _orientation$1.x, endTime );\n\t\t\tlistener.forwardY.linearRampToValueAtTime( _orientation$1.y, endTime );\n\t\t\tlistener.forwardZ.linearRampToValueAtTime( _orientation$1.z, endTime );\n\t\t\tlistener.upX.linearRampToValueAtTime( up.x, endTime );\n\t\t\tlistener.upY.linearRampToValueAtTime( up.y, endTime );\n\t\t\tlistener.upZ.linearRampToValueAtTime( up.z, endTime );\n\n\t\t} else {\n\n\t\t\tlistener.setPosition( _position$1.x, _position$1.y, _position$1.z );\n\t\t\tlistener.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z );\n\n\t\t}\n\n\t}\n\n}\n\nclass Audio extends Object3D {\n\n\tconstructor( listener ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Audio';\n\n\t\tthis.listener = listener;\n\t\tthis.context = listener.context;\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( listener.getInput() );\n\n\t\tthis.autoplay = false;\n\n\t\tthis.buffer = null;\n\t\tthis.detune = 0;\n\t\tthis.loop = false;\n\t\tthis.loopStart = 0;\n\t\tthis.loopEnd = 0;\n\t\tthis.offset = 0;\n\t\tthis.duration = undefined;\n\t\tthis.playbackRate = 1;\n\t\tthis.isPlaying = false;\n\t\tthis.hasPlaybackControl = true;\n\t\tthis.source = null;\n\t\tthis.sourceType = 'empty';\n\n\t\tthis._startedAt = 0;\n\t\tthis._progress = 0;\n\t\tthis._connected = false;\n\n\t\tthis.filters = [];\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\tsetNodeSource( audioNode ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'audioNode';\n\t\tthis.source = audioNode;\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetMediaElementSource( mediaElement ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaNode';\n\t\tthis.source = this.context.createMediaElementSource( mediaElement );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetMediaStreamSource( mediaStream ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaStreamNode';\n\t\tthis.source = this.context.createMediaStreamSource( mediaStream );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetBuffer( audioBuffer ) {\n\n\t\tthis.buffer = audioBuffer;\n\t\tthis.sourceType = 'buffer';\n\n\t\tif ( this.autoplay ) this.play();\n\n\t\treturn this;\n\n\t}\n\n\tplay( delay = 0 ) {\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: Audio is already playing.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._startedAt = this.context.currentTime + delay;\n\n\t\tconst source = this.context.createBufferSource();\n\t\tsource.buffer = this.buffer;\n\t\tsource.loop = this.loop;\n\t\tsource.loopStart = this.loopStart;\n\t\tsource.loopEnd = this.loopEnd;\n\t\tsource.onended = this.onEnded.bind( this );\n\t\tsource.start( this._startedAt, this._progress + this.offset, this.duration );\n\n\t\tthis.isPlaying = true;\n\n\t\tthis.source = source;\n\n\t\tthis.setDetune( this.detune );\n\t\tthis.setPlaybackRate( this.playbackRate );\n\n\t\treturn this.connect();\n\n\t}\n\n\tpause() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\t// update current progress\n\n\t\t\tthis._progress += Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate;\n\n\t\t\tif ( this.loop === true ) {\n\n\t\t\t\t// ensure _progress does not exceed duration with looped audios\n\n\t\t\t\tthis._progress = this._progress % ( this.duration || this.buffer.duration );\n\n\t\t\t}\n\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\n\t\t\tthis.isPlaying = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tstop() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._progress = 0;\n\n\t\tthis.source.stop();\n\t\tthis.source.onended = null;\n\t\tthis.isPlaying = false;\n\n\t\treturn this;\n\n\t}\n\n\tconnect() {\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.connect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].connect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].connect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.connect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = true;\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect() {\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.disconnect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].disconnect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].disconnect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.disconnect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = false;\n\n\t\treturn this;\n\n\t}\n\n\tgetFilters() {\n\n\t\treturn this.filters;\n\n\t}\n\n\tsetFilters( value ) {\n\n\t\tif ( ! value ) value = [];\n\n\t\tif ( this._connected === true ) {\n\n\t\t\tthis.disconnect();\n\t\t\tthis.filters = value.slice();\n\t\t\tthis.connect();\n\n\t\t} else {\n\n\t\t\tthis.filters = value.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetDetune( value ) {\n\n\t\tthis.detune = value;\n\n\t\tif ( this.source.detune === undefined ) return; // only set detune when available\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetDetune() {\n\n\t\treturn this.detune;\n\n\t}\n\n\tgetFilter() {\n\n\t\treturn this.getFilters()[ 0 ];\n\n\t}\n\n\tsetFilter( filter ) {\n\n\t\treturn this.setFilters( filter ? [ filter ] : [] );\n\n\t}\n\n\tsetPlaybackRate( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.playbackRate = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetPlaybackRate() {\n\n\t\treturn this.playbackRate;\n\n\t}\n\n\tonEnded() {\n\n\t\tthis.isPlaying = false;\n\n\t}\n\n\tgetLoop() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn this.loop;\n\n\t}\n\n\tsetLoop( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.loop = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.loop = this.loop;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetLoopStart( value ) {\n\n\t\tthis.loopStart = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetLoopEnd( value ) {\n\n\t\tthis.loopEnd = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\tsetVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _position = /*@__PURE__*/ new Vector3();\nconst _quaternion = /*@__PURE__*/ new Quaternion();\nconst _scale = /*@__PURE__*/ new Vector3();\nconst _orientation = /*@__PURE__*/ new Vector3();\n\nclass PositionalAudio extends Audio {\n\n\tconstructor( listener ) {\n\n\t\tsuper( listener );\n\n\t\tthis.panner = this.context.createPanner();\n\t\tthis.panner.panningModel = 'HRTF';\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.panner;\n\n\t}\n\n\tgetRefDistance() {\n\n\t\treturn this.panner.refDistance;\n\n\t}\n\n\tsetRefDistance( value ) {\n\n\t\tthis.panner.refDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetRolloffFactor() {\n\n\t\treturn this.panner.rolloffFactor;\n\n\t}\n\n\tsetRolloffFactor( value ) {\n\n\t\tthis.panner.rolloffFactor = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetDistanceModel() {\n\n\t\treturn this.panner.distanceModel;\n\n\t}\n\n\tsetDistanceModel( value ) {\n\n\t\tthis.panner.distanceModel = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetMaxDistance() {\n\n\t\treturn this.panner.maxDistance;\n\n\t}\n\n\tsetMaxDistance( value ) {\n\n\t\tthis.panner.maxDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) {\n\n\t\tthis.panner.coneInnerAngle = coneInnerAngle;\n\t\tthis.panner.coneOuterAngle = coneOuterAngle;\n\t\tthis.panner.coneOuterGain = coneOuterGain;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.hasPlaybackControl === true && this.isPlaying === false ) return;\n\n\t\tthis.matrixWorld.decompose( _position, _quaternion, _scale );\n\n\t\t_orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion );\n\n\t\tconst panner = this.panner;\n\n\t\tif ( panner.positionX ) {\n\n\t\t\t// code path for Chrome and Firefox (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.listener.timeDelta;\n\n\t\t\tpanner.positionX.linearRampToValueAtTime( _position.x, endTime );\n\t\t\tpanner.positionY.linearRampToValueAtTime( _position.y, endTime );\n\t\t\tpanner.positionZ.linearRampToValueAtTime( _position.z, endTime );\n\t\t\tpanner.orientationX.linearRampToValueAtTime( _orientation.x, endTime );\n\t\t\tpanner.orientationY.linearRampToValueAtTime( _orientation.y, endTime );\n\t\t\tpanner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime );\n\n\t\t} else {\n\n\t\t\tpanner.setPosition( _position.x, _position.y, _position.z );\n\t\t\tpanner.setOrientation( _orientation.x, _orientation.y, _orientation.z );\n\n\t\t}\n\n\t}\n\n}\n\nclass AudioAnalyser {\n\n\tconstructor( audio, fftSize = 2048 ) {\n\n\t\tthis.analyser = audio.context.createAnalyser();\n\t\tthis.analyser.fftSize = fftSize;\n\n\t\tthis.data = new Uint8Array( this.analyser.frequencyBinCount );\n\n\t\taudio.getOutput().connect( this.analyser );\n\n\t}\n\n\n\tgetFrequencyData() {\n\n\t\tthis.analyser.getByteFrequencyData( this.data );\n\n\t\treturn this.data;\n\n\t}\n\n\tgetAverageFrequency() {\n\n\t\tlet value = 0;\n\t\tconst data = this.getFrequencyData();\n\n\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\tvalue += data[ i ];\n\n\t\t}\n\n\t\treturn value / data.length;\n\n\t}\n\n}\n\nclass PropertyMixer {\n\n\tconstructor( binding, typeName, valueSize ) {\n\n\t\tthis.binding = binding;\n\t\tthis.valueSize = valueSize;\n\n\t\tlet mixFunction,\n\t\t\tmixFunctionAdditive,\n\t\t\tsetIdentity;\n\n\t\t// buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n\t\t//\n\t\t// interpolators can use .buffer as their .result\n\t\t// the data then goes to 'incoming'\n\t\t//\n\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t// the cumulative result and are compared to detect\n\t\t// changes\n\t\t//\n\t\t// 'orig' stores the original state of the property\n\t\t//\n\t\t// 'add' is used for additive cumulative results\n\t\t//\n\t\t// 'work' is optional and is only present for quaternion types. It is used\n\t\t// to store intermediate quaternion multiplication results\n\n\t\tswitch ( typeName ) {\n\n\t\t\tcase 'quaternion':\n\t\t\t\tmixFunction = this._slerp;\n\t\t\t\tmixFunctionAdditive = this._slerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityQuaternion;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 6 );\n\t\t\t\tthis._workIndex = 5;\n\t\t\t\tbreak;\n\n\t\t\tcase 'string':\n\t\t\tcase 'bool':\n\t\t\t\tmixFunction = this._select;\n\n\t\t\t\t// Use the regular mix function and for additive on these types,\n\t\t\t\t// additive is not relevant for non-numeric types\n\t\t\t\tmixFunctionAdditive = this._select;\n\n\t\t\t\tsetIdentity = this._setAdditiveIdentityOther;\n\n\t\t\t\tthis.buffer = new Array( valueSize * 5 );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tmixFunction = this._lerp;\n\t\t\t\tmixFunctionAdditive = this._lerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityNumeric;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 5 );\n\n\t\t}\n\n\t\tthis._mixBufferRegion = mixFunction;\n\t\tthis._mixBufferRegionAdditive = mixFunctionAdditive;\n\t\tthis._setIdentity = setIdentity;\n\t\tthis._origIndex = 3;\n\t\tthis._addIndex = 4;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tthis.useCount = 0;\n\t\tthis.referenceCount = 0;\n\n\t}\n\n\t// accumulate data in the 'incoming' region into 'accu'\n\taccumulate( accuIndex, weight ) {\n\n\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t// the weight and shouldn't have made the call in the first place\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = accuIndex * stride + stride;\n\n\t\tlet currentWeight = this.cumulativeWeight;\n\n\t\tif ( currentWeight === 0 ) {\n\n\t\t\t// accuN := incoming * weight\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ offset + i ] = buffer[ i ];\n\n\t\t\t}\n\n\t\t\tcurrentWeight = weight;\n\n\t\t} else {\n\n\t\t\t// accuN := accuN + incoming * weight\n\n\t\t\tcurrentWeight += weight;\n\t\t\tconst mix = weight / currentWeight;\n\t\t\tthis._mixBufferRegion( buffer, offset, 0, mix, stride );\n\n\t\t}\n\n\t\tthis.cumulativeWeight = currentWeight;\n\n\t}\n\n\t// accumulate data in the 'incoming' region into 'add'\n\taccumulateAdditive( weight ) {\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = stride * this._addIndex;\n\n\t\tif ( this.cumulativeWeightAdditive === 0 ) {\n\n\t\t\t// add = identity\n\n\t\t\tthis._setIdentity();\n\n\t\t}\n\n\t\t// add := add + incoming * weight\n\n\t\tthis._mixBufferRegionAdditive( buffer, offset, 0, weight, stride );\n\t\tthis.cumulativeWeightAdditive += weight;\n\n\t}\n\n\t// apply the state of 'accu' to the binding when accus differ\n\tapply( accuIndex ) {\n\n\t\tconst stride = this.valueSize,\n\t\t\tbuffer = this.buffer,\n\t\t\toffset = accuIndex * stride + stride,\n\n\t\t\tweight = this.cumulativeWeight,\n\t\t\tweightAdditive = this.cumulativeWeightAdditive,\n\n\t\t\tbinding = this.binding;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tif ( weight < 1 ) {\n\n\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\n\t\t\tconst originalValueOffset = stride * this._origIndex;\n\n\t\t\tthis._mixBufferRegion(\n\t\t\t\tbuffer, offset, originalValueOffset, 1 - weight, stride );\n\n\t\t}\n\n\t\tif ( weightAdditive > 0 ) {\n\n\t\t\t// accuN := accuN + additive accuN\n\n\t\t\tthis._mixBufferRegionAdditive( buffer, offset, this._addIndex * stride, 1, stride );\n\n\t\t}\n\n\t\tfor ( let i = stride, e = stride + stride; i !== e; ++ i ) {\n\n\t\t\tif ( buffer[ i ] !== buffer[ i + stride ] ) {\n\n\t\t\t\t// value has changed -> update scene graph\n\n\t\t\t\tbinding.setValue( buffer, offset );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// remember the state of the bound property and copy it to both accus\n\tsaveOriginalState() {\n\n\t\tconst binding = this.binding;\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\n\t\t\toriginalValueOffset = stride * this._origIndex;\n\n\t\tbinding.getValue( buffer, originalValueOffset );\n\n\t\t// accu[0..1] := orig -- initially detect changes against the original\n\t\tfor ( let i = stride, e = originalValueOffset; i !== e; ++ i ) {\n\n\t\t\tbuffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];\n\n\t\t}\n\n\t\t// Add to identity for additive\n\t\tthis._setIdentity();\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t}\n\n\t// apply the state previously taken via 'saveOriginalState' to the binding\n\trestoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}\n\n\t_setAdditiveIdentityNumeric() {\n\n\t\tconst startIndex = this._addIndex * this.valueSize;\n\t\tconst endIndex = startIndex + this.valueSize;\n\n\t\tfor ( let i = startIndex; i < endIndex; i ++ ) {\n\n\t\t\tthis.buffer[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\t_setAdditiveIdentityQuaternion() {\n\n\t\tthis._setAdditiveIdentityNumeric();\n\t\tthis.buffer[ this._addIndex * this.valueSize + 3 ] = 1;\n\n\t}\n\n\t_setAdditiveIdentityOther() {\n\n\t\tconst startIndex = this._origIndex * this.valueSize;\n\t\tconst targetIndex = this._addIndex * this.valueSize;\n\n\t\tfor ( let i = 0; i < this.valueSize; i ++ ) {\n\n\t\t\tthis.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ];\n\n\t\t}\n\n\t}\n\n\n\t// mix functions\n\n\t_select( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tif ( t >= 0.5 ) {\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ dstOffset + i ] = buffer[ srcOffset + i ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_slerp( buffer, dstOffset, srcOffset, t ) {\n\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t );\n\n\t}\n\n\t_slerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst workOffset = this._workIndex * stride;\n\n\t\t// Store result in intermediate buffer offset\n\t\tQuaternion.multiplyQuaternionsFlat( buffer, workOffset, buffer, dstOffset, buffer, srcOffset );\n\n\t\t// Slerp to the intermediate result\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t );\n\n\t}\n\n\t_lerp( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst s = 1 - t;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n\t_lerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n}\n\n// Characters [].:/ are reserved for track binding syntax.\nconst _RESERVED_CHARS_RE = '\\\\[\\\\]\\\\.:\\\\/';\nconst _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' );\n\n// Attempts to allow node names from any language. ES5's `\\w` regexp matches\n// only latin characters, and the unicode \\p{L} is not yet supported. So\n// instead, we exclude reserved characters and match everything else.\nconst _wordChar = '[^' + _RESERVED_CHARS_RE + ']';\nconst _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\\\.', '' ) + ']';\n\n// Parent directories, delimited by '/' or ':'. Currently unused, but must\n// be matched to parse the rest of the track name.\nconst _directoryRe = /((?:WC+[\\/:])*)/.source.replace( 'WC', _wordChar );\n\n// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\nconst _nodeRe = /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot );\n\n// Object on target node, and accessor. May not contain reserved\n// characters. Accessor may contain any character except closing bracket.\nconst _objectRe = /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace( 'WC', _wordChar );\n\n// Property and accessor. May not contain reserved characters. Accessor may\n// contain any non-bracket characters.\nconst _propertyRe = /\\.(WC+)(?:\\[(.+)\\])?/.source.replace( 'WC', _wordChar );\n\nconst _trackRe = new RegExp( ''\n\t+ '^'\n\t+ _directoryRe\n\t+ _nodeRe\n\t+ _objectRe\n\t+ _propertyRe\n\t+ '$'\n);\n\nconst _supportedObjectNames = [ 'material', 'materials', 'bones' ];\n\nclass Composite {\n\n\tconstructor( targetGroup, path, optionalParsedPath ) {\n\n\t\tconst parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis._targetGroup = targetGroup;\n\t\tthis._bindings = targetGroup.subscribe_( path, parsedPath );\n\n\t}\n\n\tgetValue( array, offset ) {\n\n\t\tthis.bind(); // bind all binding\n\n\t\tconst firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\tbinding = this._bindings[ firstValidIndex ];\n\n\t\t// and only call .getValue on the first\n\t\tif ( binding !== undefined ) binding.getValue( array, offset );\n\n\t}\n\n\tsetValue( array, offset ) {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].setValue( array, offset );\n\n\t\t}\n\n\t}\n\n\tbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].bind();\n\n\t\t}\n\n\t}\n\n\tunbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].unbind();\n\n\t\t}\n\n\t}\n\n}\n\n// Note: This class uses a State pattern on a per-method basis:\n// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n// prototype version of these methods with one that represents\n// the bound state. When the property is not found, the methods\n// become no-ops.\nclass PropertyBinding {\n\n\tconstructor( rootNode, path, parsedPath ) {\n\n\t\tthis.path = path;\n\t\tthis.parsedPath = parsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName ) || rootNode;\n\n\t\tthis.rootNode = rootNode;\n\n\t\t// initial state of these methods that calls 'bind'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n\n\tstatic create( root, path, parsedPath ) {\n\n\t\tif ( ! ( root && root.isAnimationObjectGroup ) ) {\n\n\t\t\treturn new PropertyBinding( root, path, parsedPath );\n\n\t\t} else {\n\n\t\t\treturn new PropertyBinding.Composite( root, path, parsedPath );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Replaces spaces with underscores and removes unsupported characters from\n\t * node names, to ensure compatibility with parseTrackName().\n\t *\n\t * @param {string} name Node name to be sanitized.\n\t * @return {string}\n\t */\n\tstatic sanitizeNodeName( name ) {\n\n\t\treturn name.replace( /\\s/g, '_' ).replace( _reservedRe, '' );\n\n\t}\n\n\tstatic parseTrackName( trackName ) {\n\n\t\tconst matches = _trackRe.exec( trackName );\n\n\t\tif ( ! matches ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName );\n\n\t\t}\n\n\t\tconst results = {\n\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\tnodeName: matches[ 2 ],\n\t\t\tobjectName: matches[ 3 ],\n\t\t\tobjectIndex: matches[ 4 ],\n\t\t\tpropertyName: matches[ 5 ], // required\n\t\t\tpropertyIndex: matches[ 6 ]\n\t\t};\n\n\t\tconst lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' );\n\n\t\tif ( lastDot !== undefined && lastDot !== - 1 ) {\n\n\t\t\tconst objectName = results.nodeName.substring( lastDot + 1 );\n\n\t\t\t// Object names must be checked against an allowlist. Otherwise, there\n\t\t\t// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n\t\t\t// 'bar' could be the objectName, or part of a nodeName (which can\n\t\t\t// include '.' characters).\n\t\t\tif ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) {\n\n\t\t\t\tresults.nodeName = results.nodeName.substring( 0, lastDot );\n\t\t\t\tresults.objectName = objectName;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( results.propertyName === null || results.propertyName.length === 0 ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName );\n\n\t\t}\n\n\t\treturn results;\n\n\t}\n\n\tstatic findNode( root, nodeName ) {\n\n\t\tif ( ! nodeName || nodeName === '' || nodeName === '.' || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) {\n\n\t\t\treturn root;\n\n\t\t}\n\n\t\t// search into skeleton bones.\n\t\tif ( root.skeleton ) {\n\n\t\t\tconst bone = root.skeleton.getBoneByName( nodeName );\n\n\t\t\tif ( bone !== undefined ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// search into node subtree.\n\t\tif ( root.children ) {\n\n\t\t\tconst searchNodeSubtree = function ( children ) {\n\n\t\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\t\tconst childNode = children[ i ];\n\n\t\t\t\t\tif ( childNode.name === nodeName || childNode.uuid === nodeName ) {\n\n\t\t\t\t\t\treturn childNode;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = searchNodeSubtree( childNode.children );\n\n\t\t\t\t\tif ( result ) return result;\n\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\n\t\t\t};\n\n\t\t\tconst subTreeNode = searchNodeSubtree( root.children );\n\n\t\t\tif ( subTreeNode ) {\n\n\t\t\t\treturn subTreeNode;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// these are used to \"bind\" a nonexistent property\n\t_getValue_unavailable() {}\n\t_setValue_unavailable() {}\n\n\t// Getters\n\n\t_getValue_direct( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.targetObject[ this.propertyName ];\n\n\t}\n\n\t_getValue_array( buffer, offset ) {\n\n\t\tconst source = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = source.length; i !== n; ++ i ) {\n\n\t\t\tbuffer[ offset ++ ] = source[ i ];\n\n\t\t}\n\n\t}\n\n\t_getValue_arrayElement( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.resolvedProperty[ this.propertyIndex ];\n\n\t}\n\n\t_getValue_toArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.toArray( buffer, offset );\n\n\t}\n\n\t// Direct\n\n\t_setValue_direct( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_direct_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// EntireArray\n\n\t_setValue_array( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t}\n\n\t_setValue_array_setNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// ArrayElement\n\n\t_setValue_arrayElement( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_arrayElement_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// HasToFromArray\n\n\t_setValue_fromArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\n\t}\n\n\t_setValue_fromArray_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t_getValue_unbound( targetArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.getValue( targetArray, offset );\n\n\t}\n\n\t_setValue_unbound( sourceArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.setValue( sourceArray, offset );\n\n\t}\n\n\t// create getter / setter pair for a property in the scene graph\n\tbind() {\n\n\t\tlet targetObject = this.node;\n\t\tconst parsedPath = this.parsedPath;\n\n\t\tconst objectName = parsedPath.objectName;\n\t\tconst propertyName = parsedPath.propertyName;\n\t\tlet propertyIndex = parsedPath.propertyIndex;\n\n\t\tif ( ! targetObject ) {\n\n\t\t\ttargetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName ) || this.rootNode;\n\n\t\t\tthis.node = targetObject;\n\n\t\t}\n\n\t\t// set fail state so we can just 'return' on error\n\t\tthis.getValue = this._getValue_unavailable;\n\t\tthis.setValue = this._setValue_unavailable;\n\n\t\t// ensure there is a value node\n\t\tif ( ! targetObject ) {\n\n\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\\'t found.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( objectName ) {\n\n\t\t\tlet objectIndex = parsedPath.objectIndex;\n\n\t\t\t// special cases were we need to reach deeper into the hierarchy to get the face materials....\n\t\t\tswitch ( objectName ) {\n\n\t\t\t\tcase 'materials':\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.materials ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.materials;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bones':\n\n\t\t\t\t\tif ( ! targetObject.skeleton ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t// and convert the integer string to a true integer.\n\n\t\t\t\t\ttargetObject = targetObject.skeleton.bones;\n\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tfor ( let i = 0; i < targetObject.length; i ++ ) {\n\n\t\t\t\t\t\tif ( targetObject[ i ].name === objectIndex ) {\n\n\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif ( targetObject[ objectName ] === undefined ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[ objectName ];\n\n\t\t\t}\n\n\n\t\t\tif ( objectIndex !== undefined ) {\n\n\t\t\t\tif ( targetObject[ objectIndex ] === undefined ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\ttargetObject = targetObject[ objectIndex ];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// resolve property\n\t\tconst nodeProperty = targetObject[ propertyName ];\n\n\t\tif ( nodeProperty === undefined ) {\n\n\t\t\tconst nodeName = parsedPath.nodeName;\n\n\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName +\n\t\t\t\t'.' + propertyName + ' but it wasn\\'t found.', targetObject );\n\t\t\treturn;\n\n\t\t}\n\n\t\t// determine versioning scheme\n\t\tlet versioning = this.Versioning.None;\n\n\t\tthis.targetObject = targetObject;\n\n\t\tif ( targetObject.needsUpdate !== undefined ) { // material\n\n\t\t\tversioning = this.Versioning.NeedsUpdate;\n\n\t\t} else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform\n\n\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\n\t\t}\n\n\t\t// determine how the property gets bound\n\t\tlet bindingType = this.BindingType.Direct;\n\n\t\tif ( propertyIndex !== undefined ) {\n\n\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\n\t\t\tif ( propertyName === 'morphTargetInfluences' ) {\n\n\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\n\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\tif ( ! targetObject.geometry ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( targetObject.geometry.isBufferGeometry ) {\n\n\t\t\t\t\tif ( ! targetObject.geometry.morphAttributes ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( targetObject.morphTargetDictionary[ propertyIndex ] !== undefined ) {\n\n\t\t\t\t\t\tpropertyIndex = targetObject.morphTargetDictionary[ propertyIndex ];\n\n\t\t\t\t\t}\n\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbindingType = this.BindingType.ArrayElement;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\tthis.propertyIndex = propertyIndex;\n\n\t\t} else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) {\n\n\t\t\t// must use copy for Object3D.Euler/Quaternion\n\n\t\t\tbindingType = this.BindingType.HasFromToArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else if ( Array.isArray( nodeProperty ) ) {\n\n\t\t\tbindingType = this.BindingType.EntireArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else {\n\n\t\t\tthis.propertyName = propertyName;\n\n\t\t}\n\n\t\t// select getter / setter\n\t\tthis.getValue = this.GetterByBindingType[ bindingType ];\n\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ];\n\n\t}\n\n\tunbind() {\n\n\t\tthis.node = null;\n\n\t\t// back to the prototype version of getValue / setValue\n\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n}\n\nPropertyBinding.Composite = Composite;\n\nPropertyBinding.prototype.BindingType = {\n\tDirect: 0,\n\tEntireArray: 1,\n\tArrayElement: 2,\n\tHasFromToArray: 3\n};\n\nPropertyBinding.prototype.Versioning = {\n\tNone: 0,\n\tNeedsUpdate: 1,\n\tMatrixWorldNeedsUpdate: 2\n};\n\nPropertyBinding.prototype.GetterByBindingType = [\n\n\tPropertyBinding.prototype._getValue_direct,\n\tPropertyBinding.prototype._getValue_array,\n\tPropertyBinding.prototype._getValue_arrayElement,\n\tPropertyBinding.prototype._getValue_toArray,\n\n];\n\nPropertyBinding.prototype.SetterByBindingTypeAndVersioning = [\n\n\t[\n\t\t// Direct\n\t\tPropertyBinding.prototype._setValue_direct,\n\t\tPropertyBinding.prototype._setValue_direct_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// EntireArray\n\n\t\tPropertyBinding.prototype._setValue_array,\n\t\tPropertyBinding.prototype._setValue_array_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// ArrayElement\n\t\tPropertyBinding.prototype._setValue_arrayElement,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// HasToFromArray\n\t\tPropertyBinding.prototype._setValue_fromArray,\n\t\tPropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate,\n\n\t]\n\n];\n\n/**\n *\n * A group of objects that receives a shared animation state.\n *\n * Usage:\n *\n * - Add objects you would otherwise pass as 'root' to the\n * constructor or the .clipAction method of AnimationMixer.\n *\n * - Instead pass this object as 'root'.\n *\n * - You can also add and remove objects later when the mixer\n * is running.\n *\n * Note:\n *\n * Objects of this class appear as one object to the mixer,\n * so cache control of the individual objects must be done\n * on the group.\n *\n * Limitation:\n *\n * - The animated properties must be compatible among the\n * all objects in the group.\n *\n * - A single property can either be controlled through a\n * target group or directly, but not both.\n */\n\nclass AnimationObjectGroup {\n\n\tconstructor() {\n\n\t\tthis.uuid = generateUUID();\n\n\t\t// cached objects followed by the active ones\n\t\tthis._objects = Array.prototype.slice.call( arguments );\n\n\t\tthis.nCachedObjects_ = 0; // threshold\n\t\t// note: read by PropertyBinding.Composite\n\n\t\tconst indices = {};\n\t\tthis._indicesByUUID = indices; // for bookkeeping\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tindices[ arguments[ i ].uuid ] = i;\n\n\t\t}\n\n\t\tthis._paths = []; // inside: string\n\t\tthis._parsedPaths = []; // inside: { we don't care, here }\n\t\tthis._bindings = []; // inside: Array< PropertyBinding >\n\t\tthis._bindingsIndicesByPath = {}; // inside: indices in these arrays\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tobjects: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._objects.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn this.total - scope.nCachedObjects_;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tget bindingsPerObject() {\n\n\t\t\t\treturn scope._bindings.length;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tadd() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tpaths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet knownObject = undefined,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid;\n\t\t\tlet index = indicesByUUID[ uuid ];\n\n\t\t\tif ( index === undefined ) {\n\n\t\t\t\t// unknown object -> add it to the ACTIVE region\n\n\t\t\t\tindex = nObjects ++;\n\t\t\t\tindicesByUUID[ uuid ] = index;\n\t\t\t\tobjects.push( object );\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tbindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) );\n\n\t\t\t\t}\n\n\t\t\t} else if ( index < nCachedObjects ) {\n\n\t\t\t\tknownObject = objects[ index ];\n\n\t\t\t\t// move existing object to the ACTIVE region\n\n\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ];\n\n\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = firstActiveIndex;\n\t\t\t\tobjects[ firstActiveIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ];\n\n\t\t\t\t\tlet binding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\n\t\t\t\t\tif ( binding === undefined ) {\n\n\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t// or may not exist\n\n\t\t\t\t\t\tbinding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t} else if ( objects[ index ] !== knownObject ) {\n\n\t\t\t\tconsole.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' +\n\t\t\t\t\t'detected. Clean the caches or recreate your infrastructure when reloading scenes.' );\n\n\t\t\t} // else the object is already where we want it to be\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\tremove() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined && index >= nCachedObjects ) {\n\n\t\t\t\t// move existing object into the CACHED region\n\n\t\t\t\tconst lastCachedIndex = nCachedObjects ++,\n\t\t\t\t\tfirstActiveObject = objects[ lastCachedIndex ];\n\n\t\t\t\tindicesByUUID[ firstActiveObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = firstActiveObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = lastCachedIndex;\n\t\t\t\tobjects[ lastCachedIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tfirstActive = bindingsForPath[ lastCachedIndex ],\n\t\t\t\t\t\tbinding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = firstActive;\n\t\t\t\t\tbindingsForPath[ lastCachedIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// remove & forget\n\tuncache() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_,\n\t\t\tnObjects = objects.length;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined ) {\n\n\t\t\t\tdelete indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index < nCachedObjects ) {\n\n\t\t\t\t\t// object is cached, shrink the CACHED region\n\n\t\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ],\n\t\t\t\t\t\tlastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\t// last cached object takes this object's place\n\t\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\t\t// last object goes to the activated slot and pop\n\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = firstActiveIndex;\n\t\t\t\t\tobjects[ firstActiveIndex ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ],\n\t\t\t\t\t\t\tlast = bindingsForPath[ lastIndex ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\t\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = last;\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// object is active, just swap with the last and pop\n\n\t\t\t\t\tconst lastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\tif ( lastIndex > 0 ) {\n\n\t\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = index;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobjects[ index ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = bindingsForPath[ lastIndex ];\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} // cached or active\n\n\t\t\t} // if object is known\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// Internal interface used by befriended PropertyBinding.Composite:\n\n\tsubscribe_( path, parsedPath ) {\n\n\t\t// returns an array of bindings for the given path that is changed\n\t\t// according to the contained objects in the group\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath;\n\t\tlet index = indicesByPath[ path ];\n\t\tconst bindings = this._bindings;\n\n\t\tif ( index !== undefined ) return bindings[ index ];\n\n\t\tconst paths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tobjects = this._objects,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\tbindingsForPath = new Array( nObjects );\n\n\t\tindex = bindings.length;\n\n\t\tindicesByPath[ path ] = index;\n\n\t\tpaths.push( path );\n\t\tparsedPaths.push( parsedPath );\n\t\tbindings.push( bindingsForPath );\n\n\t\tfor ( let i = nCachedObjects, n = objects.length; i !== n; ++ i ) {\n\n\t\t\tconst object = objects[ i ];\n\t\t\tbindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath );\n\n\t\t}\n\n\t\treturn bindingsForPath;\n\n\t}\n\n\tunsubscribe_( path ) {\n\n\t\t// tells the group to forget about a property path and no longer\n\t\t// update the array previously obtained with 'subscribe_'\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath,\n\t\t\tindex = indicesByPath[ path ];\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst paths = this._paths,\n\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\tlastBindings = bindings[ lastBindingsIndex ],\n\t\t\t\tlastBindingsPath = path[ lastBindingsIndex ];\n\n\t\t\tindicesByPath[ lastBindingsPath ] = index;\n\n\t\t\tbindings[ index ] = lastBindings;\n\t\t\tbindings.pop();\n\n\t\t\tparsedPaths[ index ] = parsedPaths[ lastBindingsIndex ];\n\t\t\tparsedPaths.pop();\n\n\t\t\tpaths[ index ] = paths[ lastBindingsIndex ];\n\t\t\tpaths.pop();\n\n\t\t}\n\n\t}\n\n}\n\nAnimationObjectGroup.prototype.isAnimationObjectGroup = true;\n\nclass AnimationAction {\n\n\tconstructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) {\n\n\t\tthis._mixer = mixer;\n\t\tthis._clip = clip;\n\t\tthis._localRoot = localRoot;\n\t\tthis.blendMode = blendMode;\n\n\t\tconst tracks = clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tinterpolants = new Array( nTracks );\n\n\t\tconst interpolantSettings = {\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t};\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst interpolant = tracks[ i ].createInterpolant( null );\n\t\t\tinterpolants[ i ] = interpolant;\n\t\t\tinterpolant.settings = interpolantSettings;\n\n\t\t}\n\n\t\tthis._interpolantSettings = interpolantSettings;\n\n\t\tthis._interpolants = interpolants; // bound by the mixer\n\n\t\t// inside: PropertyMixer (managed by the mixer)\n\t\tthis._propertyBindings = new Array( nTracks );\n\n\t\tthis._cacheIndex = null; // for the memory manager\n\t\tthis._byClipCacheIndex = null; // for the memory manager\n\n\t\tthis._timeScaleInterpolant = null;\n\t\tthis._weightInterpolant = null;\n\n\t\tthis.loop = LoopRepeat;\n\t\tthis._loopCount = - 1;\n\n\t\t// global mixer time when the action is to be started\n\t\t// it's set back to 'null' upon start of the action\n\t\tthis._startTime = null;\n\n\t\t// scaled local time of the action\n\t\t// gets clamped or wrapped to 0..clip.duration according to loop\n\t\tthis.time = 0;\n\n\t\tthis.timeScale = 1;\n\t\tthis._effectiveTimeScale = 1;\n\n\t\tthis.weight = 1;\n\t\tthis._effectiveWeight = 1;\n\n\t\tthis.repetitions = Infinity; // no. of repetitions when looping\n\n\t\tthis.paused = false; // true -> zero effective time scale\n\t\tthis.enabled = true; // false -> zero effective weight\n\n\t\tthis.clampWhenFinished = false;// keep feeding the last frame?\n\n\t\tthis.zeroSlopeAtStart = true;// for smooth interpolation w/o separate\n\t\tthis.zeroSlopeAtEnd = true;// clips for start, loop and end\n\n\t}\n\n\t// State & Scheduling\n\n\tplay() {\n\n\t\tthis._mixer._activateAction( this );\n\n\t\treturn this;\n\n\t}\n\n\tstop() {\n\n\t\tthis._mixer._deactivateAction( this );\n\n\t\treturn this.reset();\n\n\t}\n\n\treset() {\n\n\t\tthis.paused = false;\n\t\tthis.enabled = true;\n\n\t\tthis.time = 0; // restart clip\n\t\tthis._loopCount = - 1;// forget previous loops\n\t\tthis._startTime = null;// forget scheduling\n\n\t\treturn this.stopFading().stopWarping();\n\n\t}\n\n\tisRunning() {\n\n\t\treturn this.enabled && ! this.paused && this.timeScale !== 0 &&\n\t\t\tthis._startTime === null && this._mixer._isActiveAction( this );\n\n\t}\n\n\t// return true when play has been called\n\tisScheduled() {\n\n\t\treturn this._mixer._isActiveAction( this );\n\n\t}\n\n\tstartAt( time ) {\n\n\t\tthis._startTime = time;\n\n\t\treturn this;\n\n\t}\n\n\tsetLoop( mode, repetitions ) {\n\n\t\tthis.loop = mode;\n\t\tthis.repetitions = repetitions;\n\n\t\treturn this;\n\n\t}\n\n\t// Weight\n\n\t// set the weight stopping any scheduled fading\n\t// although .enabled = false yields an effective weight of zero, this\n\t// method does *not* change .enabled, because it would be confusing\n\tsetEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}\n\n\t// return the weight considering fading and .enabled\n\tgetEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}\n\n\tfadeIn( duration ) {\n\n\t\treturn this._scheduleFading( duration, 0, 1 );\n\n\t}\n\n\tfadeOut( duration ) {\n\n\t\treturn this._scheduleFading( duration, 1, 0 );\n\n\t}\n\n\tcrossFadeFrom( fadeOutAction, duration, warp ) {\n\n\t\tfadeOutAction.fadeOut( duration );\n\t\tthis.fadeIn( duration );\n\n\t\tif ( warp ) {\n\n\t\t\tconst fadeInDuration = this._clip.duration,\n\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\n\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\n\t\t\tfadeOutAction.warp( 1.0, startEndRatio, duration );\n\t\t\tthis.warp( endStartRatio, 1.0, duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcrossFadeTo( fadeInAction, duration, warp ) {\n\n\t\treturn fadeInAction.crossFadeFrom( this, duration, warp );\n\n\t}\n\n\tstopFading() {\n\n\t\tconst weightInterpolant = this._weightInterpolant;\n\n\t\tif ( weightInterpolant !== null ) {\n\n\t\t\tthis._weightInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( weightInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Time Scale Control\n\n\t// set the time scale stopping any scheduled warping\n\t// although .paused = true yields an effective time scale of zero, this\n\t// method does *not* change .paused, because it would be confusing\n\tsetEffectiveTimeScale( timeScale ) {\n\n\t\tthis.timeScale = timeScale;\n\t\tthis._effectiveTimeScale = this.paused ? 0 : timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t// return the time scale considering warping and .paused\n\tgetEffectiveTimeScale() {\n\n\t\treturn this._effectiveTimeScale;\n\n\t}\n\n\tsetDuration( duration ) {\n\n\t\tthis.timeScale = this._clip.duration / duration;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\tsyncWith( action ) {\n\n\t\tthis.time = action.time;\n\t\tthis.timeScale = action.timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\thalt( duration ) {\n\n\t\treturn this.warp( this._effectiveTimeScale, 0, duration );\n\n\t}\n\n\twarp( startTimeScale, endTimeScale, duration ) {\n\n\t\tconst mixer = this._mixer,\n\t\t\tnow = mixer.time,\n\t\t\ttimeScale = this.timeScale;\n\n\t\tlet interpolant = this._timeScaleInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._timeScaleInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\ttimes[ 1 ] = now + duration;\n\n\t\tvalues[ 0 ] = startTimeScale / timeScale;\n\t\tvalues[ 1 ] = endTimeScale / timeScale;\n\n\t\treturn this;\n\n\t}\n\n\tstopWarping() {\n\n\t\tconst timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\tif ( timeScaleInterpolant !== null ) {\n\n\t\t\tthis._timeScaleInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( timeScaleInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Object Accessors\n\n\tgetMixer() {\n\n\t\treturn this._mixer;\n\n\t}\n\n\tgetClip() {\n\n\t\treturn this._clip;\n\n\t}\n\n\tgetRoot() {\n\n\t\treturn this._localRoot || this._mixer._root;\n\n\t}\n\n\t// Interna\n\n\t_update( time, deltaTime, timeDirection, accuIndex ) {\n\n\t\t// called by the mixer\n\n\t\tif ( ! this.enabled ) {\n\n\t\t\t// call ._updateWeight() to update ._effectiveWeight\n\n\t\t\tthis._updateWeight( time );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst startTime = this._startTime;\n\n\t\tif ( startTime !== null ) {\n\n\t\t\t// check for scheduled start of action\n\n\t\t\tconst timeRunning = ( time - startTime ) * timeDirection;\n\t\t\tif ( timeRunning < 0 || timeDirection === 0 ) {\n\n\t\t\t\treturn; // yet to come / don't decide when delta = 0\n\n\t\t\t}\n\n\t\t\t// start\n\n\t\t\tthis._startTime = null; // unschedule\n\t\t\tdeltaTime = timeDirection * timeRunning;\n\n\t\t}\n\n\t\t// apply time scale and advance time\n\n\t\tdeltaTime *= this._updateTimeScale( time );\n\t\tconst clipTime = this._updateTime( deltaTime );\n\n\t\t// note: _updateTime may disable the action resulting in\n\t\t// an effective weight of 0\n\n\t\tconst weight = this._updateWeight( time );\n\n\t\tif ( weight > 0 ) {\n\n\t\t\tconst interpolants = this._interpolants;\n\t\t\tconst propertyMixers = this._propertyBindings;\n\n\t\t\tswitch ( this.blendMode ) {\n\n\t\t\t\tcase AdditiveAnimationBlendMode:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulateAdditive( weight );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NormalAnimationBlendMode:\n\t\t\t\tdefault:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulate( accuIndex, weight );\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_updateWeight( time ) {\n\n\t\tlet weight = 0;\n\n\t\tif ( this.enabled ) {\n\n\t\t\tweight = this.weight;\n\t\t\tconst interpolant = this._weightInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\tif ( interpolantValue === 0 ) {\n\n\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\tthis.enabled = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveWeight = weight;\n\t\treturn weight;\n\n\t}\n\n\t_updateTimeScale( time ) {\n\n\t\tlet timeScale = 0;\n\n\t\tif ( ! this.paused ) {\n\n\t\t\ttimeScale = this.timeScale;\n\n\t\t\tconst interpolant = this._timeScaleInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\tif ( timeScale === 0 ) {\n\n\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\tthis.paused = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\tthis.timeScale = timeScale;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveTimeScale = timeScale;\n\t\treturn timeScale;\n\n\t}\n\n\t_updateTime( deltaTime ) {\n\n\t\tconst duration = this._clip.duration;\n\t\tconst loop = this.loop;\n\n\t\tlet time = this.time + deltaTime;\n\t\tlet loopCount = this._loopCount;\n\n\t\tconst pingPong = ( loop === LoopPingPong );\n\n\t\tif ( deltaTime === 0 ) {\n\n\t\t\tif ( loopCount === - 1 ) return time;\n\n\t\t\treturn ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time;\n\n\t\t}\n\n\t\tif ( loop === LoopOnce ) {\n\n\t\t\tif ( loopCount === - 1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tthis._loopCount = 0;\n\t\t\t\tthis._setEndings( true, true, false );\n\n\t\t\t}\n\n\t\t\thandle_stop: {\n\n\t\t\t\tif ( time >= duration ) {\n\n\t\t\t\t\ttime = duration;\n\n\t\t\t\t} else if ( time < 0 ) {\n\n\t\t\t\t\ttime = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tbreak handle_stop;\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\telse this.enabled = false;\n\n\t\t\t\tthis.time = time;\n\n\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\tdirection: deltaTime < 0 ? - 1 : 1\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t} else { // repetitive Repeat or PingPong\n\n\t\t\tif ( loopCount === - 1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tif ( deltaTime >= 0 ) {\n\n\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\tthis._setEndings( true, this.repetitions === 0, pingPong );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t// so leave loopCount at -1\n\n\t\t\t\t\tthis._setEndings( this.repetitions === 0, true, pingPong );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( time >= duration || time < 0 ) {\n\n\t\t\t\t// wrap around\n\n\t\t\t\tconst loopDelta = Math.floor( time / duration ); // signed\n\t\t\t\ttime -= duration * loopDelta;\n\n\t\t\t\tloopCount += Math.abs( loopDelta );\n\n\t\t\t\tconst pending = this.repetitions - loopCount;\n\n\t\t\t\tif ( pending <= 0 ) {\n\n\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\n\t\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\t\telse this.enabled = false;\n\n\t\t\t\t\ttime = deltaTime > 0 ? duration : 0;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\t\tdirection: deltaTime > 0 ? 1 : - 1\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// keep running\n\n\t\t\t\t\tif ( pending === 1 ) {\n\n\t\t\t\t\t\t// entering the last round\n\n\t\t\t\t\t\tconst atStart = deltaTime < 0;\n\t\t\t\t\t\tthis._setEndings( atStart, ! atStart, pingPong );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis._setEndings( false, false, pingPong );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._loopCount = loopCount;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'loop', action: this, loopDelta: loopDelta\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tthis.time = time;\n\n\t\t\t}\n\n\t\t\tif ( pingPong && ( loopCount & 1 ) === 1 ) {\n\n\t\t\t\t// invert time for the \"pong round\"\n\n\t\t\t\treturn duration - time;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn time;\n\n\t}\n\n\t_setEndings( atStart, atEnd, pingPong ) {\n\n\t\tconst settings = this._interpolantSettings;\n\n\t\tif ( pingPong ) {\n\n\t\t\tsettings.endingStart = ZeroSlopeEnding;\n\t\t\tsettings.endingEnd = ZeroSlopeEnding;\n\n\t\t} else {\n\n\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\n\t\t\tif ( atStart ) {\n\n\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t\tif ( atEnd ) {\n\n\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingEnd \t = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_scheduleFading( duration, weightNow, weightThen ) {\n\n\t\tconst mixer = this._mixer, now = mixer.time;\n\t\tlet interpolant = this._weightInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._weightInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\tvalues[ 0 ] = weightNow;\n\t\ttimes[ 1 ] = now + duration;\n\t\tvalues[ 1 ] = weightThen;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass AnimationMixer extends EventDispatcher {\n\n\tconstructor( root ) {\n\n\t\tsuper();\n\n\t\tthis._root = root;\n\t\tthis._initMemoryManager();\n\t\tthis._accuIndex = 0;\n\t\tthis.time = 0;\n\t\tthis.timeScale = 1.0;\n\n\t}\n\n\t_bindAction( action, prototypeAction ) {\n\n\t\tconst root = action._localRoot || this._root,\n\t\t\ttracks = action._clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tbindings = action._propertyBindings,\n\t\t\tinterpolants = action._interpolants,\n\t\t\trootUuid = root.uuid,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName;\n\n\t\tlet bindingsByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingsByName === undefined ) {\n\n\t\t\tbindingsByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingsByName;\n\n\t\t}\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst track = tracks[ i ],\n\t\t\t\ttrackName = track.name;\n\n\t\t\tlet binding = bindingsByName[ trackName ];\n\n\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t} else {\n\n\t\t\t\tbinding = bindings[ i ];\n\n\t\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t\t// existing binding, make sure the cache knows\n\n\t\t\t\t\tif ( binding._cacheIndex === null ) {\n\n\t\t\t\t\t\t++ binding.referenceCount;\n\t\t\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tconst path = prototypeAction && prototypeAction.\n\t\t\t\t\t_propertyBindings[ i ].binding.parsedPath;\n\n\t\t\t\tbinding = new PropertyMixer(\n\t\t\t\t\tPropertyBinding.create( root, trackName, path ),\n\t\t\t\t\ttrack.ValueTypeName, track.getValueSize() );\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t}\n\n\t\t\tinterpolants[ i ].resultBuffer = binding.buffer;\n\n\t\t}\n\n\t}\n\n\t_activateAction( action ) {\n\n\t\tif ( ! this._isActiveAction( action ) ) {\n\n\t\t\tif ( action._cacheIndex === null ) {\n\n\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t// appears to be still using it -> rebind\n\n\t\t\t\tconst rootUuid = ( action._localRoot || this._root ).uuid,\n\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\t\t\tthis._bindAction( action,\n\t\t\t\t\tactionsForClip && actionsForClip.knownActions[ 0 ] );\n\n\t\t\t\tthis._addInactiveAction( action, clipUuid, rootUuid );\n\n\t\t\t}\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// increment reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( binding.useCount ++ === 0 ) {\n\n\t\t\t\t\tthis._lendBinding( binding );\n\t\t\t\t\tbinding.saveOriginalState();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._lendAction( action );\n\n\t\t}\n\n\t}\n\n\t_deactivateAction( action ) {\n\n\t\tif ( this._isActiveAction( action ) ) {\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// decrement reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( -- binding.useCount === 0 ) {\n\n\t\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\t\tthis._takeBackBinding( binding );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._takeBackAction( action );\n\n\t\t}\n\n\t}\n\n\t// Memory manager\n\n\t_initMemoryManager() {\n\n\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\t\tthis._nActiveActions = 0;\n\n\t\tthis._actionsByClip = {};\n\t\t// inside:\n\t\t// {\n\t\t// \tknownActions: Array< AnimationAction > - used as prototypes\n\t\t// \tactionByRoot: AnimationAction - lookup\n\t\t// }\n\n\n\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\t\tthis._nActiveBindings = 0;\n\n\t\tthis._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer >\n\n\n\t\tthis._controlInterpolants = []; // same game as above\n\t\tthis._nActiveControlInterpolants = 0;\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tactions: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._actions.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveActions;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tbindings: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._bindings.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveBindings;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tcontrolInterpolants: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._controlInterpolants.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveControlInterpolants;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t// Memory management for AnimationAction objects\n\n\t_isActiveAction( action ) {\n\n\t\tconst index = action._cacheIndex;\n\t\treturn index !== null && index < this._nActiveActions;\n\n\t}\n\n\t_addInactiveAction( action, clipUuid, rootUuid ) {\n\n\t\tconst actions = this._actions,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tlet actionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip === undefined ) {\n\n\t\t\tactionsForClip = {\n\n\t\t\t\tknownActions: [ action ],\n\t\t\t\tactionByRoot: {}\n\n\t\t\t};\n\n\t\t\taction._byClipCacheIndex = 0;\n\n\t\t\tactionsByClip[ clipUuid ] = actionsForClip;\n\n\t\t} else {\n\n\t\t\tconst knownActions = actionsForClip.knownActions;\n\n\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\tknownActions.push( action );\n\n\t\t}\n\n\t\taction._cacheIndex = actions.length;\n\t\tactions.push( action );\n\n\t\tactionsForClip.actionByRoot[ rootUuid ] = action;\n\n\t}\n\n\t_removeInactiveAction( action ) {\n\n\t\tconst actions = this._actions,\n\t\t\tlastInactiveAction = actions[ actions.length - 1 ],\n\t\t\tcacheIndex = action._cacheIndex;\n\n\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\tactions.pop();\n\n\t\taction._cacheIndex = null;\n\n\n\t\tconst clipUuid = action._clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ],\n\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\n\t\t\tlastKnownAction =\n\t\t\t\tknownActionsForClip[ knownActionsForClip.length - 1 ],\n\n\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\n\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\tknownActionsForClip[ byClipCacheIndex ] = lastKnownAction;\n\t\tknownActionsForClip.pop();\n\n\t\taction._byClipCacheIndex = null;\n\n\n\t\tconst actionByRoot = actionsForClip.actionByRoot,\n\t\t\trootUuid = ( action._localRoot || this._root ).uuid;\n\n\t\tdelete actionByRoot[ rootUuid ];\n\n\t\tif ( knownActionsForClip.length === 0 ) {\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t\tthis._removeInactiveBindingsForAction( action );\n\n\t}\n\n\t_removeInactiveBindingsForAction( action ) {\n\n\t\tconst bindings = action._propertyBindings;\n\n\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tconst binding = bindings[ i ];\n\n\t\t\tif ( -- binding.referenceCount === 0 ) {\n\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_lendAction( action ) {\n\n\t\t// [ active actions | inactive actions ]\n\t\t// [ active actions >| inactive actions ]\n\t\t// s a\n\t\t// <-swap->\n\t\t// a s\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveActions ++,\n\n\t\t\tfirstInactiveAction = actions[ lastActiveIndex ];\n\n\t\taction._cacheIndex = lastActiveIndex;\n\t\tactions[ lastActiveIndex ] = action;\n\n\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = firstInactiveAction;\n\n\t}\n\n\t_takeBackAction( action ) {\n\n\t\t// [ active actions | inactive actions ]\n\t\t// [ active actions |< inactive actions ]\n\t\t// a s\n\t\t// <-swap->\n\t\t// s a\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveActions,\n\n\t\t\tlastActiveAction = actions[ firstInactiveIndex ];\n\n\t\taction._cacheIndex = firstInactiveIndex;\n\t\tactions[ firstInactiveIndex ] = action;\n\n\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = lastActiveAction;\n\n\t}\n\n\t// Memory management for PropertyMixer objects\n\n\t_addInactiveBinding( binding, rootUuid, trackName ) {\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindings = this._bindings;\n\n\t\tlet bindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName === undefined ) {\n\n\t\t\tbindingByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingByName;\n\n\t\t}\n\n\t\tbindingByName[ trackName ] = binding;\n\n\t\tbinding._cacheIndex = bindings.length;\n\t\tbindings.push( binding );\n\n\t}\n\n\t_removeInactiveBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tpropBinding = binding.binding,\n\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\ttrackName = propBinding.path,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ],\n\n\t\t\tlastInactiveBinding = bindings[ bindings.length - 1 ],\n\t\t\tcacheIndex = binding._cacheIndex;\n\n\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\tbindings[ cacheIndex ] = lastInactiveBinding;\n\t\tbindings.pop();\n\n\t\tdelete bindingByName[ trackName ];\n\n\t\tif ( Object.keys( bindingByName ).length === 0 ) {\n\n\t\t\tdelete bindingsByRoot[ rootUuid ];\n\n\t\t}\n\n\t}\n\n\t_lendBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveBindings ++,\n\n\t\t\tfirstInactiveBinding = bindings[ lastActiveIndex ];\n\n\t\tbinding._cacheIndex = lastActiveIndex;\n\t\tbindings[ lastActiveIndex ] = binding;\n\n\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = firstInactiveBinding;\n\n\t}\n\n\t_takeBackBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveBindings,\n\n\t\t\tlastActiveBinding = bindings[ firstInactiveIndex ];\n\n\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\tbindings[ firstInactiveIndex ] = binding;\n\n\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = lastActiveBinding;\n\n\t}\n\n\n\t// Memory management of Interpolants for weight and time scale\n\n\t_lendControlInterpolant() {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tlastActiveIndex = this._nActiveControlInterpolants ++;\n\n\t\tlet interpolant = interpolants[ lastActiveIndex ];\n\n\t\tif ( interpolant === undefined ) {\n\n\t\t\tinterpolant = new LinearInterpolant(\n\t\t\t\tnew Float32Array( 2 ), new Float32Array( 2 ),\n\t\t\t\t1, this._controlInterpolantsResultBuffer );\n\n\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\tinterpolants[ lastActiveIndex ] = interpolant;\n\n\t\t}\n\n\t\treturn interpolant;\n\n\t}\n\n\t_takeBackControlInterpolant( interpolant ) {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tprevIndex = interpolant.__cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveControlInterpolants,\n\n\t\t\tlastActiveInterpolant = interpolants[ firstInactiveIndex ];\n\n\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\tinterpolants[ firstInactiveIndex ] = interpolant;\n\n\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\tinterpolants[ prevIndex ] = lastActiveInterpolant;\n\n\t}\n\n\t// return an action for a clip optionally using a custom root target\n\t// object (this method allocates a lot of dynamic memory in case a\n\t// previously unknown clip/root combination is specified)\n\tclipAction( clip, optionalRoot, blendMode ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid;\n\n\t\tlet clipObject = typeof clip === 'string' ? AnimationClip.findByName( root, clip ) : clip;\n\n\t\tconst clipUuid = clipObject !== null ? clipObject.uuid : clip;\n\n\t\tconst actionsForClip = this._actionsByClip[ clipUuid ];\n\t\tlet prototypeAction = null;\n\n\t\tif ( blendMode === undefined ) {\n\n\t\t\tif ( clipObject !== null ) {\n\n\t\t\t\tblendMode = clipObject.blendMode;\n\n\t\t\t} else {\n\n\t\t\t\tblendMode = NormalAnimationBlendMode;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\tconst existingAction = actionsForClip.actionByRoot[ rootUuid ];\n\n\t\t\tif ( existingAction !== undefined && existingAction.blendMode === blendMode ) {\n\n\t\t\t\treturn existingAction;\n\n\t\t\t}\n\n\t\t\t// we know the clip, so we don't have to parse all\n\t\t\t// the bindings again but can just copy\n\t\t\tprototypeAction = actionsForClip.knownActions[ 0 ];\n\n\t\t\t// also, take the clip from the prototype action\n\t\t\tif ( clipObject === null )\n\t\t\t\tclipObject = prototypeAction._clip;\n\n\t\t}\n\n\t\t// clip must be known when specified via string\n\t\tif ( clipObject === null ) return null;\n\n\t\t// allocate all resources required to run it\n\t\tconst newAction = new AnimationAction( this, clipObject, optionalRoot, blendMode );\n\n\t\tthis._bindAction( newAction, prototypeAction );\n\n\t\t// and make the action known to the memory manager\n\t\tthis._addInactiveAction( newAction, clipUuid, rootUuid );\n\n\t\treturn newAction;\n\n\t}\n\n\t// get an existing action\n\texistingAction( clip, optionalRoot ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid,\n\n\t\t\tclipObject = typeof clip === 'string' ?\n\t\t\t\tAnimationClip.findByName( root, clip ) : clip,\n\n\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\n\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\treturn actionsForClip.actionByRoot[ rootUuid ] || null;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// deactivates all previously scheduled actions\n\tstopAllAction() {\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions;\n\n\t\tfor ( let i = nActions - 1; i >= 0; -- i ) {\n\n\t\t\tactions[ i ].stop();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// advance the time and update apply the animation\n\tupdate( deltaTime ) {\n\n\t\tdeltaTime *= this.timeScale;\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions,\n\n\t\t\ttime = this.time += deltaTime,\n\t\t\ttimeDirection = Math.sign( deltaTime ),\n\n\t\t\taccuIndex = this._accuIndex ^= 1;\n\n\t\t// run active actions\n\n\t\tfor ( let i = 0; i !== nActions; ++ i ) {\n\n\t\t\tconst action = actions[ i ];\n\n\t\t\taction._update( time, deltaTime, timeDirection, accuIndex );\n\n\t\t}\n\n\t\t// update scene graph\n\n\t\tconst bindings = this._bindings,\n\t\t\tnBindings = this._nActiveBindings;\n\n\t\tfor ( let i = 0; i !== nBindings; ++ i ) {\n\n\t\t\tbindings[ i ].apply( accuIndex );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Allows you to seek to a specific time in an animation.\n\tsetTime( timeInSeconds ) {\n\n\t\tthis.time = 0; // Zero out time attribute for AnimationMixer object;\n\t\tfor ( let i = 0; i < this._actions.length; i ++ ) {\n\n\t\t\tthis._actions[ i ].time = 0; // Zero out time attribute for all associated AnimationAction objects.\n\n\t\t}\n\n\t\treturn this.update( timeInSeconds ); // Update used to set exact time. Returns \"this\" AnimationMixer object.\n\n\t}\n\n\t// return this mixer's root target object\n\tgetRoot() {\n\n\t\treturn this._root;\n\n\t}\n\n\t// free all resources specific to a particular clip\n\tuncacheClip( clip ) {\n\n\t\tconst actions = this._actions,\n\t\t\tclipUuid = clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t// iteration state and also require updating the state we can\n\t\t\t// just throw away\n\n\t\t\tconst actionsToRemove = actionsForClip.knownActions;\n\n\t\t\tfor ( let i = 0, n = actionsToRemove.length; i !== n; ++ i ) {\n\n\t\t\t\tconst action = actionsToRemove[ i ];\n\n\t\t\t\tthis._deactivateAction( action );\n\n\t\t\t\tconst cacheIndex = action._cacheIndex,\n\t\t\t\t\tlastInactiveAction = actions[ actions.length - 1 ];\n\n\t\t\t\taction._cacheIndex = null;\n\t\t\t\taction._byClipCacheIndex = null;\n\n\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\t\t\tactions.pop();\n\n\t\t\t\tthis._removeInactiveBindingsForAction( action );\n\n\t\t\t}\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t}\n\n\t// free all resources specific to a particular root target object\n\tuncacheRoot( root ) {\n\n\t\tconst rootUuid = root.uuid,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tfor ( const clipUuid in actionsByClip ) {\n\n\t\t\tconst actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\tif ( action !== undefined ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName !== undefined ) {\n\n\t\t\tfor ( const trackName in bindingByName ) {\n\n\t\t\t\tconst binding = bindingByName[ trackName ];\n\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// remove a targeted clip from the cache\n\tuncacheAction( clip, optionalRoot ) {\n\n\t\tconst action = this.existingAction( clip, optionalRoot );\n\n\t\tif ( action !== null ) {\n\n\t\t\tthis._deactivateAction( action );\n\t\t\tthis._removeInactiveAction( action );\n\n\t\t}\n\n\t}\n\n}\n\nAnimationMixer.prototype._controlInterpolantsResultBuffer = new Float32Array( 1 );\n\nclass Uniform {\n\n\tconstructor( value ) {\n\n\t\tif ( typeof value === 'string' ) {\n\n\t\t\tconsole.warn( 'THREE.Uniform: Type parameter is no longer needed.' );\n\t\t\tvalue = arguments[ 1 ];\n\n\t\t}\n\n\t\tthis.value = value;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Uniform( this.value.clone === undefined ? this.value : this.value.clone() );\n\n\t}\n\n}\n\nclass InstancedInterleavedBuffer extends InterleavedBuffer {\n\n\tconstructor( array, stride, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, stride );\n\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tconst ib = super.clone( data );\n\n\t\tib.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn ib;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tconst json = super.toJSON( data );\n\n\t\tjson.isInstancedInterleavedBuffer = true;\n\t\tjson.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn json;\n\n\t}\n\n}\n\nInstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;\n\nclass GLBufferAttribute {\n\n\tconstructor( buffer, type, itemSize, elementSize, count ) {\n\n\t\tthis.buffer = buffer;\n\t\tthis.type = type;\n\t\tthis.itemSize = itemSize;\n\t\tthis.elementSize = elementSize;\n\t\tthis.count = count;\n\n\t\tthis.version = 0;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tsetBuffer( buffer ) {\n\n\t\tthis.buffer = buffer;\n\n\t\treturn this;\n\n\t}\n\n\tsetType( type, elementSize ) {\n\n\t\tthis.type = type;\n\t\tthis.elementSize = elementSize;\n\n\t\treturn this;\n\n\t}\n\n\tsetItemSize( itemSize ) {\n\n\t\tthis.itemSize = itemSize;\n\n\t\treturn this;\n\n\t}\n\n\tsetCount( count ) {\n\n\t\tthis.count = count;\n\n\t\treturn this;\n\n\t}\n\n}\n\nGLBufferAttribute.prototype.isGLBufferAttribute = true;\n\nclass Raycaster {\n\n\tconstructor( origin, direction, near = 0, far = Infinity ) {\n\n\t\tthis.ray = new Ray( origin, direction );\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\t\tthis.camera = null;\n\t\tthis.layers = new Layers();\n\n\t\tthis.params = {\n\t\t\tMesh: {},\n\t\t\tLine: { threshold: 1 },\n\t\t\tLOD: {},\n\t\t\tPoints: { threshold: 1 },\n\t\t\tSprite: {}\n\t\t};\n\n\t}\n\n\tset( origin, direction ) {\n\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.ray.set( origin, direction );\n\n\t}\n\n\tsetFromCamera( coords, camera ) {\n\n\t\tif ( camera && camera.isPerspectiveCamera ) {\n\n\t\t\tthis.ray.origin.setFromMatrixPosition( camera.matrixWorld );\n\t\t\tthis.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();\n\t\t\tthis.camera = camera;\n\n\t\t} else if ( camera && camera.isOrthographicCamera ) {\n\n\t\t\tthis.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera\n\t\t\tthis.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );\n\t\t\tthis.camera = camera;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type );\n\n\t\t}\n\n\t}\n\n\tintersectObject( object, recursive = true, intersects = [] ) {\n\n\t\tintersectObject( object, this, intersects, recursive );\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n\tintersectObjects( objects, recursive = true, intersects = [] ) {\n\n\t\tfor ( let i = 0, l = objects.length; i < l; i ++ ) {\n\n\t\t\tintersectObject( objects[ i ], this, intersects, recursive );\n\n\t\t}\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n}\n\nfunction ascSort( a, b ) {\n\n\treturn a.distance - b.distance;\n\n}\n\nfunction intersectObject( object, raycaster, intersects, recursive ) {\n\n\tif ( object.layers.test( raycaster.layers ) ) {\n\n\t\tobject.raycast( raycaster, intersects );\n\n\t}\n\n\tif ( recursive === true ) {\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tintersectObject( children[ i ], raycaster, intersects, true );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n *\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\n * The azimuthal angle (theta) is measured from the positive z-axis.\n */\n\nclass Spherical {\n\n\tconstructor( radius = 1, phi = 0, theta = 0 ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\n\t}\n\n\tset( radius, phi, theta ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\n\t\treturn this;\n\n\t}\n\n\t// restrict phi to be betwee EPS and PI-EPS\n\tmakeSafe() {\n\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + y * y + z * z );\n\n\t\tif ( this.radius === 0 ) {\n\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\n\t\t} else {\n\n\t\t\tthis.theta = Math.atan2( x, z );\n\t\t\tthis.phi = Math.acos( clamp( y / this.radius, - 1, 1 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\n */\n\nclass Cylindrical {\n\n\tconstructor( radius = 1, theta = 0, y = 0 ) {\n\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\n\t}\n\n\tset( radius, theta, y ) {\n\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + z * z );\n\t\tthis.theta = Math.atan2( x, z );\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$4 = /*@__PURE__*/ new Vector2();\n\nclass Box2 {\n\n\tconstructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) {\n\n\t\tthis.min = min;\n\t\tthis.max = max;\n\n\t}\n\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$4.copy( size ).multiplyScalar( 0.5 );\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = + Infinity;\n\t\tthis.max.x = this.max.y = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y );\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn point.x < this.min.x || point.x > this.max.x ||\n\t\t\tpoint.y < this.min.y || point.y > this.max.y ? false : true;\n\n\t}\n\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y;\n\n\t}\n\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y )\n\t\t);\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\t// using 4 splitting planes to rule out intersections\n\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x ||\n\t\t\tbox.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\tconst clampedPoint = _vector$4.copy( point ).clamp( this.min, this.max );\n\t\treturn clampedPoint.sub( point ).length();\n\n\t}\n\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n}\n\nBox2.prototype.isBox2 = true;\n\nconst _startP = /*@__PURE__*/ new Vector3();\nconst _startEnd = /*@__PURE__*/ new Vector3();\n\nclass Line3 {\n\n\tconstructor( start = new Vector3(), end = new Vector3() ) {\n\n\t\tthis.start = start;\n\t\tthis.end = end;\n\n\t}\n\n\tset( start, end ) {\n\n\t\tthis.start.copy( start );\n\t\tthis.end.copy( end );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( line ) {\n\n\t\tthis.start.copy( line.start );\n\t\tthis.end.copy( line.end );\n\n\t\treturn this;\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn target.addVectors( this.start, this.end ).multiplyScalar( 0.5 );\n\n\t}\n\n\tdelta( target ) {\n\n\t\treturn target.subVectors( this.end, this.start );\n\n\t}\n\n\tdistanceSq() {\n\n\t\treturn this.start.distanceToSquared( this.end );\n\n\t}\n\n\tdistance() {\n\n\t\treturn this.start.distanceTo( this.end );\n\n\t}\n\n\tat( t, target ) {\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\tclosestPointToPointParameter( point, clampToLine ) {\n\n\t\t_startP.subVectors( point, this.start );\n\t\t_startEnd.subVectors( this.end, this.start );\n\n\t\tconst startEnd2 = _startEnd.dot( _startEnd );\n\t\tconst startEnd_startP = _startEnd.dot( _startP );\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif ( clampToLine ) {\n\n\t\t\tt = clamp( t, 0, 1 );\n\n\t\t}\n\n\t\treturn t;\n\n\t}\n\n\tclosestPointToPoint( point, clampToLine, target ) {\n\n\t\tconst t = this.closestPointToPointParameter( point, clampToLine );\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.start.applyMatrix4( matrix );\n\t\tthis.end.applyMatrix4( matrix );\n\n\t\treturn this;\n\n\t}\n\n\tequals( line ) {\n\n\t\treturn line.start.equals( this.start ) && line.end.equals( this.end );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/ new Vector3();\n\nclass SpotLightHelper extends Object3D {\n\n\tconstructor( light, color ) {\n\n\t\tsuper();\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst positions = [\n\t\t\t0, 0, 0, \t0, 0, 1,\n\t\t\t0, 0, 0, \t1, 0, 1,\n\t\t\t0, 0, 0,\t- 1, 0, 1,\n\t\t\t0, 0, 0, \t0, 1, 1,\n\t\t\t0, 0, 0, \t0, - 1, 1\n\t\t];\n\n\t\tfor ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) {\n\n\t\t\tconst p1 = ( i / l ) * Math.PI * 2;\n\t\t\tconst p2 = ( j / l ) * Math.PI * 2;\n\n\t\t\tpositions.push(\n\t\t\t\tMath.cos( p1 ), Math.sin( p1 ), 1,\n\t\t\t\tMath.cos( p2 ), Math.sin( p2 ), 1\n\t\t\t);\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.cone = new LineSegments( geometry, material );\n\t\tthis.add( this.cone );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tthis.light.updateMatrixWorld();\n\n\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\tconst coneWidth = coneLength * Math.tan( this.light.angle );\n\n\t\tthis.cone.scale.set( coneWidth, coneWidth, coneLength );\n\n\t\t_vector$3.setFromMatrixPosition( this.light.target.matrixWorld );\n\n\t\tthis.cone.lookAt( _vector$3 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.cone.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.cone.material.color.copy( this.light.color );\n\n\t\t}\n\n\t}\n\n}\n\nconst _vector$2 = /*@__PURE__*/ new Vector3();\nconst _boneMatrix = /*@__PURE__*/ new Matrix4();\nconst _matrixWorldInv = /*@__PURE__*/ new Matrix4();\n\n\nclass SkeletonHelper extends LineSegments {\n\n\tconstructor( object ) {\n\n\t\tconst bones = getBoneList( object );\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst color1 = new Color( 0, 0, 1 );\n\t\tconst color2 = new Color( 0, 1, 0 );\n\n\t\tfor ( let i = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tcolors.push( color1.r, color1.g, color1.b );\n\t\t\t\tcolors.push( color2.r, color2.g, color2.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'SkeletonHelper';\n\t\tthis.isSkeletonHelper = true;\n\n\t\tthis.root = object;\n\t\tthis.bones = bones;\n\n\t\tthis.matrix = object.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst bones = this.bones;\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t_matrixWorldInv.copy( this.root.matrixWorld ).invert();\n\n\t\tfor ( let i = 0, j = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j + 1, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\tj += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n}\n\n\nfunction getBoneList( object ) {\n\n\tconst boneList = [];\n\n\tif ( object && object.isBone ) {\n\n\t\tboneList.push( object );\n\n\t}\n\n\tfor ( let i = 0; i < object.children.length; i ++ ) {\n\n\t\tboneList.push.apply( boneList, getBoneList( object.children[ i ] ) );\n\n\t}\n\n\treturn boneList;\n\n}\n\nclass PointLightHelper extends Mesh {\n\n\tconstructor( light, sphereSize, color ) {\n\n\t\tconst geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tconst material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'PointLightHelper';\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\n\t\t/*\n\t// TODO: delete this comment?\n\tconst distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 );\n\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\n\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\n\tconst d = light.distance;\n\n\tif ( d === 0.0 ) {\n\n\t\tthis.lightDistance.visible = false;\n\n\t} else {\n\n\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t}\n\n\tthis.add( this.lightDistance );\n\t*/\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\t/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t}\n\n}\n\nconst _vector$1 = /*@__PURE__*/ new Vector3();\nconst _color1 = /*@__PURE__*/ new Color();\nconst _color2 = /*@__PURE__*/ new Color();\n\nclass HemisphereLightHelper extends Object3D {\n\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tconst geometry = new OctahedronGeometry( size );\n\t\tgeometry.rotateY( Math.PI * 0.5 );\n\n\t\tthis.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\t\tif ( this.color === undefined ) this.material.vertexColors = true;\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\t\tconst colors = new Float32Array( position.count * 3 );\n\n\t\tgeometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) );\n\n\t\tthis.add( new Mesh( geometry, this.material ) );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tconst mesh = this.children[ 0 ];\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tconst colors = mesh.geometry.getAttribute( 'color' );\n\n\t\t\t_color1.copy( this.light.color );\n\t\t\t_color2.copy( this.light.groundColor );\n\n\t\t\tfor ( let i = 0, l = colors.count; i < l; i ++ ) {\n\n\t\t\t\tconst color = ( i < ( l / 2 ) ) ? _color1 : _color2;\n\n\t\t\t\tcolors.setXYZ( i, color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t\tcolors.needsUpdate = true;\n\n\t\t}\n\n\t\tmesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );\n\n\t}\n\n}\n\nclass GridHelper extends LineSegments {\n\n\tconstructor( size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst center = divisions / 2;\n\t\tconst step = size / divisions;\n\t\tconst halfSize = size / 2;\n\n\t\tconst vertices = [], colors = [];\n\n\t\tfor ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) {\n\n\t\t\tvertices.push( - halfSize, 0, k, halfSize, 0, k );\n\t\t\tvertices.push( k, 0, - halfSize, k, 0, halfSize );\n\n\t\t\tconst color = i === center ? color1 : color2;\n\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'GridHelper';\n\n\t}\n\n}\n\nclass PolarGridHelper extends LineSegments {\n\n\tconstructor( radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\t// create the radials\n\n\t\tfor ( let i = 0; i <= radials; i ++ ) {\n\n\t\t\tconst v = ( i / radials ) * ( Math.PI * 2 );\n\n\t\t\tconst x = Math.sin( v ) * radius;\n\t\t\tconst z = Math.cos( v ) * radius;\n\n\t\t\tvertices.push( 0, 0, 0 );\n\t\t\tvertices.push( x, 0, z );\n\n\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\tcolors.push( color.r, color.g, color.b );\n\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t}\n\n\t\t// create the circles\n\n\t\tfor ( let i = 0; i <= circles; i ++ ) {\n\n\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\tconst r = radius - ( radius / circles * i );\n\n\t\t\tfor ( let j = 0; j < divisions; j ++ ) {\n\n\t\t\t\t// first vertex\n\n\t\t\t\tlet v = ( j / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tlet x = Math.sin( v ) * r;\n\t\t\t\tlet z = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t\t// second vertex\n\n\t\t\t\tv = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tx = Math.sin( v ) * r;\n\t\t\t\tz = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'PolarGridHelper';\n\n\t}\n\n}\n\nconst _v1 = /*@__PURE__*/ new Vector3();\nconst _v2 = /*@__PURE__*/ new Vector3();\nconst _v3 = /*@__PURE__*/ new Vector3();\n\nclass DirectionalLightHelper extends Object3D {\n\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tif ( size === undefined ) size = 1;\n\n\t\tlet geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [\n\t\t\t- size, size, 0,\n\t\t\tsize, size, 0,\n\t\t\tsize, - size, 0,\n\t\t\t- size, - size, 0,\n\t\t\t- size, size, 0\n\t\t], 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.lightPlane = new Line( geometry, material );\n\t\tthis.add( this.lightPlane );\n\n\t\tgeometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );\n\n\t\tthis.targetLine = new Line( geometry, material );\n\t\tthis.add( this.targetLine );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.lightPlane.geometry.dispose();\n\t\tthis.lightPlane.material.dispose();\n\t\tthis.targetLine.geometry.dispose();\n\t\tthis.targetLine.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\t_v1.setFromMatrixPosition( this.light.matrixWorld );\n\t\t_v2.setFromMatrixPosition( this.light.target.matrixWorld );\n\t\t_v3.subVectors( _v2, _v1 );\n\n\t\tthis.lightPlane.lookAt( _v2 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.lightPlane.material.color.set( this.color );\n\t\t\tthis.targetLine.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.lightPlane.material.color.copy( this.light.color );\n\t\t\tthis.targetLine.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\tthis.targetLine.lookAt( _v2 );\n\t\tthis.targetLine.scale.z = _v3.length();\n\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/ new Vector3();\nconst _camera = /*@__PURE__*/ new Camera();\n\n/**\n *\t- shows frustum, line of sight and up of the camera\n *\t- suitable for fast updates\n * \t- based on frustum visualization in lightgl.js shadowmap example\n *\t\thttps://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html\n */\n\nclass CameraHelper extends LineSegments {\n\n\tconstructor( camera ) {\n\n\t\tconst geometry = new BufferGeometry();\n\t\tconst material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst pointMap = {};\n\n\t\t// colors\n\n\t\tconst colorFrustum = new Color( 0xffaa00 );\n\t\tconst colorCone = new Color( 0xff0000 );\n\t\tconst colorUp = new Color( 0x00aaff );\n\t\tconst colorTarget = new Color( 0xffffff );\n\t\tconst colorCross = new Color( 0x333333 );\n\n\t\t// near\n\n\t\taddLine( 'n1', 'n2', colorFrustum );\n\t\taddLine( 'n2', 'n4', colorFrustum );\n\t\taddLine( 'n4', 'n3', colorFrustum );\n\t\taddLine( 'n3', 'n1', colorFrustum );\n\n\t\t// far\n\n\t\taddLine( 'f1', 'f2', colorFrustum );\n\t\taddLine( 'f2', 'f4', colorFrustum );\n\t\taddLine( 'f4', 'f3', colorFrustum );\n\t\taddLine( 'f3', 'f1', colorFrustum );\n\n\t\t// sides\n\n\t\taddLine( 'n1', 'f1', colorFrustum );\n\t\taddLine( 'n2', 'f2', colorFrustum );\n\t\taddLine( 'n3', 'f3', colorFrustum );\n\t\taddLine( 'n4', 'f4', colorFrustum );\n\n\t\t// cone\n\n\t\taddLine( 'p', 'n1', colorCone );\n\t\taddLine( 'p', 'n2', colorCone );\n\t\taddLine( 'p', 'n3', colorCone );\n\t\taddLine( 'p', 'n4', colorCone );\n\n\t\t// up\n\n\t\taddLine( 'u1', 'u2', colorUp );\n\t\taddLine( 'u2', 'u3', colorUp );\n\t\taddLine( 'u3', 'u1', colorUp );\n\n\t\t// target\n\n\t\taddLine( 'c', 't', colorTarget );\n\t\taddLine( 'p', 'c', colorCross );\n\n\t\t// cross\n\n\t\taddLine( 'cn1', 'cn2', colorCross );\n\t\taddLine( 'cn3', 'cn4', colorCross );\n\n\t\taddLine( 'cf1', 'cf2', colorCross );\n\t\taddLine( 'cf3', 'cf4', colorCross );\n\n\t\tfunction addLine( a, b, color ) {\n\n\t\t\taddPoint( a, color );\n\t\t\taddPoint( b, color );\n\n\t\t}\n\n\t\tfunction addPoint( id, color ) {\n\n\t\t\tvertices.push( 0, 0, 0 );\n\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\tif ( pointMap[ id ] === undefined ) {\n\n\t\t\t\tpointMap[ id ] = [];\n\n\t\t\t}\n\n\t\t\tpointMap[ id ].push( ( vertices.length / 3 ) - 1 );\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'CameraHelper';\n\n\t\tthis.camera = camera;\n\t\tif ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix();\n\n\t\tthis.matrix = camera.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.pointMap = pointMap;\n\n\t\tthis.update();\n\n\t}\n\n\tupdate() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst pointMap = this.pointMap;\n\n\t\tconst w = 1, h = 1;\n\n\t\t// we need just camera projection matrix inverse\n\t\t// world matrix must be identity\n\n\t\t_camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );\n\n\t\t// center / target\n\n\t\tsetPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 );\n\t\tsetPoint( 't', pointMap, geometry, _camera, 0, 0, 1 );\n\n\t\t// near\n\n\t\tsetPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 );\n\t\tsetPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 );\n\t\tsetPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 );\n\t\tsetPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 );\n\n\t\t// far\n\n\t\tsetPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 );\n\t\tsetPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 );\n\t\tsetPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 );\n\t\tsetPoint( 'f4', pointMap, geometry, _camera, w, h, 1 );\n\n\t\t// up\n\n\t\tsetPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 );\n\t\tsetPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 );\n\t\tsetPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 );\n\n\t\t// cross\n\n\t\tsetPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 );\n\t\tsetPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 );\n\t\tsetPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 );\n\t\tsetPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 );\n\n\t\tsetPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 );\n\t\tsetPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 );\n\t\tsetPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 );\n\t\tsetPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 );\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction setPoint( point, pointMap, geometry, camera, x, y, z ) {\n\n\t_vector.set( x, y, z ).unproject( camera );\n\n\tconst points = pointMap[ point ];\n\n\tif ( points !== undefined ) {\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\tposition.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z );\n\n\t\t}\n\n\t}\n\n}\n\nconst _box = /*@__PURE__*/ new Box3();\n\nclass BoxHelper extends LineSegments {\n\n\tconstructor( object, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\t\tconst positions = new Float32Array( 8 * 3 );\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tgeometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.object = object;\n\t\tthis.type = 'BoxHelper';\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\tupdate( object ) {\n\n\t\tif ( object !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.BoxHelper: .update() has no longer arguments.' );\n\n\t\t}\n\n\t\tif ( this.object !== undefined ) {\n\n\t\t\t_box.setFromObject( this.object );\n\n\t\t}\n\n\t\tif ( _box.isEmpty() ) return;\n\n\t\tconst min = _box.min;\n\t\tconst max = _box.max;\n\n\t\t/*\n\t\t\t5____4\n\t\t1/___0/|\n\t\t| 6__|_7\n\t\t2/___3/\n\n\t\t0: max.x, max.y, max.z\n\t\t1: min.x, max.y, max.z\n\t\t2: min.x, min.y, max.z\n\t\t3: max.x, min.y, max.z\n\t\t4: max.x, max.y, min.z\n\t\t5: min.x, max.y, min.z\n\t\t6: min.x, min.y, min.z\n\t\t7: max.x, min.y, min.z\n\t\t*/\n\n\t\tconst position = this.geometry.attributes.position;\n\t\tconst array = position.array;\n\n\t\tarray[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z;\n\t\tarray[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z;\n\t\tarray[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z;\n\t\tarray[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z;\n\t\tarray[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z;\n\t\tarray[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z;\n\t\tarray[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z;\n\t\tarray[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z;\n\n\t\tposition.needsUpdate = true;\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\n\t}\n\n\tsetFromObject( object ) {\n\n\t\tthis.object = object;\n\t\tthis.update();\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tLineSegments.prototype.copy.call( this, source );\n\n\t\tthis.object = source.object;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass Box3Helper extends LineSegments {\n\n\tconstructor( box, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\n\t\tconst positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ];\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.box = box;\n\n\t\tthis.type = 'Box3Helper';\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst box = this.box;\n\n\t\tif ( box.isEmpty() ) return;\n\n\t\tbox.getCenter( this.position );\n\n\t\tbox.getSize( this.scale );\n\n\t\tthis.scale.multiplyScalar( 0.5 );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n}\n\nclass PlaneHelper extends Line {\n\n\tconstructor( plane, size = 1, hex = 0xffff00 ) {\n\n\t\tconst color = hex;\n\n\t\tconst positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\t\tgeometry.computeBoundingSphere();\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.type = 'PlaneHelper';\n\n\t\tthis.plane = plane;\n\n\t\tthis.size = size;\n\n\t\tconst positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ];\n\n\t\tconst geometry2 = new BufferGeometry();\n\t\tgeometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );\n\t\tgeometry2.computeBoundingSphere();\n\n\t\tthis.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) );\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tlet scale = - this.plane.constant;\n\n\t\tif ( Math.abs( scale ) < 1e-8 ) scale = 1e-8; // sign does not matter\n\n\t\tthis.scale.set( 0.5 * this.size, 0.5 * this.size, scale );\n\n\t\tthis.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here\n\n\t\tthis.lookAt( this.plane.normal );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n}\n\nconst _axis = /*@__PURE__*/ new Vector3();\nlet _lineGeometry, _coneGeometry;\n\nclass ArrowHelper extends Object3D {\n\n\t// dir is assumed to be normalized\n\n\tconstructor( dir = new Vector3( 0, 0, 1 ), origin = new Vector3( 0, 0, 0 ), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ArrowHelper';\n\n\t\tif ( _lineGeometry === undefined ) {\n\n\t\t\t_lineGeometry = new BufferGeometry();\n\t\t\t_lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );\n\n\t\t\t_coneGeometry = new CylinderGeometry( 0, 0.5, 1, 5, 1 );\n\t\t\t_coneGeometry.translate( 0, - 0.5, 0 );\n\n\t\t}\n\n\t\tthis.position.copy( origin );\n\n\t\tthis.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.line.matrixAutoUpdate = false;\n\t\tthis.add( this.line );\n\n\t\tthis.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.cone.matrixAutoUpdate = false;\n\t\tthis.add( this.cone );\n\n\t\tthis.setDirection( dir );\n\t\tthis.setLength( length, headLength, headWidth );\n\n\t}\n\n\tsetDirection( dir ) {\n\n\t\t// dir is assumed to be normalized\n\n\t\tif ( dir.y > 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 0, 0, 0, 1 );\n\n\t\t} else if ( dir.y < - 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 1, 0, 0, 0 );\n\n\t\t} else {\n\n\t\t\t_axis.set( dir.z, 0, - dir.x ).normalize();\n\n\t\t\tconst radians = Math.acos( dir.y );\n\n\t\t\tthis.quaternion.setFromAxisAngle( _axis, radians );\n\n\t\t}\n\n\t}\n\n\tsetLength( length, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tthis.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458\n\t\tthis.line.updateMatrix();\n\n\t\tthis.cone.scale.set( headWidth, headLength, headWidth );\n\t\tthis.cone.position.y = length;\n\t\tthis.cone.updateMatrix();\n\n\t}\n\n\tsetColor( color ) {\n\n\t\tthis.line.material.color.set( color );\n\t\tthis.cone.material.color.set( color );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tthis.line.copy( source.line );\n\t\tthis.cone.copy( source.cone );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass AxesHelper extends LineSegments {\n\n\tconstructor( size = 1 ) {\n\n\t\tconst vertices = [\n\t\t\t0, 0, 0,\tsize, 0, 0,\n\t\t\t0, 0, 0,\t0, size, 0,\n\t\t\t0, 0, 0,\t0, 0, size\n\t\t];\n\n\t\tconst colors = [\n\t\t\t1, 0, 0,\t1, 0.6, 0,\n\t\t\t0, 1, 0,\t0.6, 1, 0,\n\t\t\t0, 0, 1,\t0, 0.6, 1\n\t\t];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'AxesHelper';\n\n\t}\n\n\tsetColors( xAxisColor, yAxisColor, zAxisColor ) {\n\n\t\tconst color = new Color();\n\t\tconst array = this.geometry.attributes.color.array;\n\n\t\tcolor.set( xAxisColor );\n\t\tcolor.toArray( array, 0 );\n\t\tcolor.toArray( array, 3 );\n\n\t\tcolor.set( yAxisColor );\n\t\tcolor.toArray( array, 6 );\n\t\tcolor.toArray( array, 9 );\n\n\t\tcolor.set( zAxisColor );\n\t\tcolor.toArray( array, 12 );\n\t\tcolor.toArray( array, 15 );\n\n\t\tthis.geometry.attributes.color.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass ShapePath {\n\n\tconstructor() {\n\n\t\tthis.type = 'ShapePath';\n\n\t\tthis.color = new Color();\n\n\t\tthis.subPaths = [];\n\t\tthis.currentPath = null;\n\n\t}\n\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPath = new Path();\n\t\tthis.subPaths.push( this.currentPath );\n\t\tthis.currentPath.moveTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tlineTo( x, y ) {\n\n\t\tthis.currentPath.lineTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tthis.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tthis.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tsplineThru( pts ) {\n\n\t\tthis.currentPath.splineThru( pts );\n\n\t\treturn this;\n\n\t}\n\n\ttoShapes( isCCW, noHoles ) {\n\n\t\tfunction toShapesNoHoles( inSubpaths ) {\n\n\t\t\tconst shapes = [];\n\n\t\t\tfor ( let i = 0, l = inSubpaths.length; i < l; i ++ ) {\n\n\t\t\t\tconst tmpPath = inSubpaths[ i ];\n\n\t\t\t\tconst tmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\n\t\t\t\tshapes.push( tmpShape );\n\n\t\t\t}\n\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tfunction isPointInsidePolygon( inPt, inPolygon ) {\n\n\t\t\tconst polyLen = inPolygon.length;\n\n\t\t\t// inPt on polygon contour => immediate success or\n\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t// with the horizontal line through inPt, left of inPt\n\t\t\t// not counting lowerY endpoints of edges and whole edges on that line\n\t\t\tlet inside = false;\n\t\t\tfor ( let p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) {\n\n\t\t\t\tlet edgeLowPt = inPolygon[ p ];\n\t\t\t\tlet edgeHighPt = inPolygon[ q ];\n\n\t\t\t\tlet edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\tlet edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\tif ( Math.abs( edgeDy ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not parallel\n\t\t\t\t\tif ( edgeDy < 0 ) {\n\n\t\t\t\t\t\tedgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx;\n\t\t\t\t\t\tedgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) \t\tcontinue;\n\n\t\t\t\t\tif ( inPt.y === edgeLowPt.y ) {\n\n\t\t\t\t\t\tif ( inPt.x === edgeLowPt.x )\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y );\n\t\t\t\t\t\tif ( perpEdge === 0 )\t\t\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\tif ( perpEdge < 0 ) \t\t\t\tcontinue;\n\t\t\t\t\t\tinside = ! inside;\t\t// true intersection left of inPt\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// parallel or collinear\n\t\t\t\t\tif ( inPt.y !== edgeLowPt.y ) \t\tcontinue;\t\t\t// parallel\n\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\t\t\t\t\tif ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) ||\n\t\t\t\t\t\t ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) )\t\treturn\ttrue;\t// inPt: Point on contour !\n\t\t\t\t\t// continue;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn\tinside;\n\n\t\t}\n\n\t\tconst isClockWise = ShapeUtils.isClockWise;\n\n\t\tconst subPaths = this.subPaths;\n\t\tif ( subPaths.length === 0 ) return [];\n\n\t\tif ( noHoles === true )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\tlet solid, tmpPath, tmpShape;\n\t\tconst shapes = [];\n\n\t\tif ( subPaths.length === 1 ) {\n\n\t\t\ttmpPath = subPaths[ 0 ];\n\t\t\ttmpShape = new Shape();\n\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\tshapes.push( tmpShape );\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tlet holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );\n\t\tholesFirst = isCCW ? ! holesFirst : holesFirst;\n\n\t\t// console.log(\"Holes first\", holesFirst);\n\n\t\tconst betterShapeHoles = [];\n\t\tconst newShapes = [];\n\t\tlet newShapeHoles = [];\n\t\tlet mainIdx = 0;\n\t\tlet tmpPoints;\n\n\t\tnewShapes[ mainIdx ] = undefined;\n\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\tfor ( let i = 0, l = subPaths.length; i < l; i ++ ) {\n\n\t\t\ttmpPath = subPaths[ i ];\n\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\tsolid = isClockWise( tmpPoints );\n\t\t\tsolid = isCCW ? ! solid : solid;\n\n\t\t\tif ( solid ) {\n\n\t\t\t\tif ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) )\tmainIdx ++;\n\n\t\t\t\tnewShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints };\n\t\t\t\tnewShapes[ mainIdx ].s.curves = tmpPath.curves;\n\n\t\t\t\tif ( holesFirst )\tmainIdx ++;\n\t\t\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\t\t\t//console.log('cw', i);\n\n\t\t\t} else {\n\n\t\t\t\tnewShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );\n\n\t\t\t\t//console.log('ccw', i);\n\n\t\t\t}\n\n\t\t}\n\n\t\t// only Holes? -> probably all Shapes with wrong orientation\n\t\tif ( ! newShapes[ 0 ] )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\tif ( newShapes.length > 1 ) {\n\n\t\t\tlet ambiguous = false;\n\t\t\tconst toChange = [];\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tbetterShapeHoles[ sIdx ] = [];\n\n\t\t\t}\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tconst sho = newShapeHoles[ sIdx ];\n\n\t\t\t\tfor ( let hIdx = 0; hIdx < sho.length; hIdx ++ ) {\n\n\t\t\t\t\tconst ho = sho[ hIdx ];\n\t\t\t\t\tlet hole_unassigned = true;\n\n\t\t\t\t\tfor ( let s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) {\n\n\t\t\t\t\t\tif ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) {\n\n\t\t\t\t\t\t\tif ( sIdx !== s2Idx )\ttoChange.push( { froms: sIdx, tos: s2Idx, hole: hIdx } );\n\t\t\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\tbetterShapeHoles[ s2Idx ].push( ho );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tambiguous = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\tbetterShapeHoles[ sIdx ].push( ho );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// console.log(\"ambiguous: \", ambiguous);\n\n\t\t\tif ( toChange.length > 0 ) {\n\n\t\t\t\t// console.log(\"to change: \", toChange);\n\t\t\t\tif ( ! ambiguous )\tnewShapeHoles = betterShapeHoles;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet tmpHoles;\n\n\t\tfor ( let i = 0, il = newShapes.length; i < il; i ++ ) {\n\n\t\t\ttmpShape = newShapes[ i ].s;\n\t\t\tshapes.push( tmpShape );\n\t\t\ttmpHoles = newShapeHoles[ i ];\n\n\t\t\tfor ( let j = 0, jl = tmpHoles.length; j < jl; j ++ ) {\n\n\t\t\t\ttmpShape.holes.push( tmpHoles[ j ].h );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//console.log(\"shape\", shapes);\n\n\t\treturn shapes;\n\n\t}\n\n}\n\nconst _floatView = new Float32Array( 1 );\nconst _int32View = new Int32Array( _floatView.buffer );\n\nclass DataUtils {\n\n\t// Converts float32 to float16 (stored as uint16 value).\n\n\tstatic toHalfFloat( val ) {\n\n\t\tif ( val > 65504 ) {\n\n\t\t\tconsole.warn( 'THREE.DataUtils.toHalfFloat(): value exceeds 65504.' );\n\n\t\t\tval = 65504; // maximum representable value in float16\n\n\t\t}\n\n\t\t// Source: http://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410\n\n\t\t/* This method is faster than the OpenEXR implementation (very often\n\t\t* used, eg. in Ogre), with the additional benefit of rounding, inspired\n\t\t* by James Tursa?s half-precision code. */\n\n\t\t_floatView[ 0 ] = val;\n\t\tconst x = _int32View[ 0 ];\n\n\t\tlet bits = ( x >> 16 ) & 0x8000; /* Get the sign */\n\t\tlet m = ( x >> 12 ) & 0x07ff; /* Keep one extra bit for rounding */\n\t\tconst e = ( x >> 23 ) & 0xff; /* Using int is faster here */\n\n\t\t/* If zero, or denormal, or exponent underflows too much for a denormal\n\t\t\t* half, return signed zero. */\n\t\tif ( e < 103 ) return bits;\n\n\t\t/* If NaN, return NaN. If Inf or exponent overflow, return Inf. */\n\t\tif ( e > 142 ) {\n\n\t\t\tbits |= 0x7c00;\n\t\t\t/* If exponent was 0xff and one mantissa bit was set, it means NaN,\n\t\t\t\t\t\t* not Inf, so make sure we set one mantissa bit too. */\n\t\t\tbits |= ( ( e == 255 ) ? 0 : 1 ) && ( x & 0x007fffff );\n\t\t\treturn bits;\n\n\t\t}\n\n\t\t/* If exponent underflows but not too much, return a denormal */\n\t\tif ( e < 113 ) {\n\n\t\t\tm |= 0x0800;\n\t\t\t/* Extra rounding may overflow and set mantissa to 0 and exponent\n\t\t\t\t* to 1, which is OK. */\n\t\t\tbits |= ( m >> ( 114 - e ) ) + ( ( m >> ( 113 - e ) ) & 1 );\n\t\t\treturn bits;\n\n\t\t}\n\n\t\tbits |= ( ( e - 112 ) << 10 ) | ( m >> 1 );\n\t\t/* Extra rounding. An overflow will set mantissa to 0 and increment\n\t\t\t* the exponent, which is OK. */\n\t\tbits += m & 1;\n\t\treturn bits;\n\n\t}\n\n}\n\nconst LineStrip = 0;\nconst LinePieces = 1;\nconst NoColors = 0;\nconst FaceColors = 1;\nconst VertexColors = 2;\n\nfunction MeshFaceMaterial( materials ) {\n\n\tconsole.warn( 'THREE.MeshFaceMaterial has been removed. Use an Array instead.' );\n\treturn materials;\n\n}\n\nfunction MultiMaterial( materials = [] ) {\n\n\tconsole.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' );\n\tmaterials.isMultiMaterial = true;\n\tmaterials.materials = materials;\n\tmaterials.clone = function () {\n\n\t\treturn materials.slice();\n\n\t};\n\n\treturn materials;\n\n}\n\nfunction PointCloud( geometry, material ) {\n\n\tconsole.warn( 'THREE.PointCloud has been renamed to THREE.Points.' );\n\treturn new Points( geometry, material );\n\n}\n\nfunction Particle( material ) {\n\n\tconsole.warn( 'THREE.Particle has been renamed to THREE.Sprite.' );\n\treturn new Sprite( material );\n\n}\n\nfunction ParticleSystem( geometry, material ) {\n\n\tconsole.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' );\n\treturn new Points( geometry, material );\n\n}\n\nfunction PointCloudMaterial( parameters ) {\n\n\tconsole.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' );\n\treturn new PointsMaterial( parameters );\n\n}\n\nfunction ParticleBasicMaterial( parameters ) {\n\n\tconsole.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' );\n\treturn new PointsMaterial( parameters );\n\n}\n\nfunction ParticleSystemMaterial( parameters ) {\n\n\tconsole.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' );\n\treturn new PointsMaterial( parameters );\n\n}\n\nfunction Vertex( x, y, z ) {\n\n\tconsole.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' );\n\treturn new Vector3( x, y, z );\n\n}\n\n//\n\nfunction DynamicBufferAttribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.' );\n\treturn new BufferAttribute( array, itemSize ).setUsage( DynamicDrawUsage );\n\n}\n\nfunction Int8Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.' );\n\treturn new Int8BufferAttribute( array, itemSize );\n\n}\n\nfunction Uint8Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.' );\n\treturn new Uint8BufferAttribute( array, itemSize );\n\n}\n\nfunction Uint8ClampedAttribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.' );\n\treturn new Uint8ClampedBufferAttribute( array, itemSize );\n\n}\n\nfunction Int16Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.' );\n\treturn new Int16BufferAttribute( array, itemSize );\n\n}\n\nfunction Uint16Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.' );\n\treturn new Uint16BufferAttribute( array, itemSize );\n\n}\n\nfunction Int32Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.' );\n\treturn new Int32BufferAttribute( array, itemSize );\n\n}\n\nfunction Uint32Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.' );\n\treturn new Uint32BufferAttribute( array, itemSize );\n\n}\n\nfunction Float32Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.' );\n\treturn new Float32BufferAttribute( array, itemSize );\n\n}\n\nfunction Float64Attribute( array, itemSize ) {\n\n\tconsole.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.' );\n\treturn new Float64BufferAttribute( array, itemSize );\n\n}\n\n//\n\nCurve.create = function ( construct, getPoint ) {\n\n\tconsole.log( 'THREE.Curve.create() has been deprecated' );\n\n\tconstruct.prototype = Object.create( Curve.prototype );\n\tconstruct.prototype.constructor = construct;\n\tconstruct.prototype.getPoint = getPoint;\n\n\treturn construct;\n\n};\n\n//\n\nPath.prototype.fromPoints = function ( points ) {\n\n\tconsole.warn( 'THREE.Path: .fromPoints() has been renamed to .setFromPoints().' );\n\treturn this.setFromPoints( points );\n\n};\n\n//\n\nfunction AxisHelper( size ) {\n\n\tconsole.warn( 'THREE.AxisHelper has been renamed to THREE.AxesHelper.' );\n\treturn new AxesHelper( size );\n\n}\n\nfunction BoundingBoxHelper( object, color ) {\n\n\tconsole.warn( 'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.' );\n\treturn new BoxHelper( object, color );\n\n}\n\nfunction EdgesHelper( object, hex ) {\n\n\tconsole.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' );\n\treturn new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );\n\n}\n\nGridHelper.prototype.setColors = function () {\n\n\tconsole.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' );\n\n};\n\nSkeletonHelper.prototype.update = function () {\n\n\tconsole.error( 'THREE.SkeletonHelper: update() no longer needs to be called.' );\n\n};\n\nfunction WireframeHelper( object, hex ) {\n\n\tconsole.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' );\n\treturn new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );\n\n}\n\n//\n\nLoader.prototype.extractUrlBase = function ( url ) {\n\n\tconsole.warn( 'THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.' );\n\treturn LoaderUtils.extractUrlBase( url );\n\n};\n\nLoader.Handlers = {\n\n\tadd: function ( /* regex, loader */ ) {\n\n\t\tconsole.error( 'THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.' );\n\n\t},\n\n\tget: function ( /* file */ ) {\n\n\t\tconsole.error( 'THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.' );\n\n\t}\n\n};\n\nfunction XHRLoader( manager ) {\n\n\tconsole.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' );\n\treturn new FileLoader( manager );\n\n}\n\nfunction BinaryTextureLoader( manager ) {\n\n\tconsole.warn( 'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.' );\n\treturn new DataTextureLoader( manager );\n\n}\n\n//\n\nBox2.prototype.center = function ( optionalTarget ) {\n\n\tconsole.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' );\n\treturn this.getCenter( optionalTarget );\n\n};\n\nBox2.prototype.empty = function () {\n\n\tconsole.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' );\n\treturn this.isEmpty();\n\n};\n\nBox2.prototype.isIntersectionBox = function ( box ) {\n\n\tconsole.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' );\n\treturn this.intersectsBox( box );\n\n};\n\nBox2.prototype.size = function ( optionalTarget ) {\n\n\tconsole.warn( 'THREE.Box2: .size() has been renamed to .getSize().' );\n\treturn this.getSize( optionalTarget );\n\n};\n\n//\n\nBox3.prototype.center = function ( optionalTarget ) {\n\n\tconsole.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' );\n\treturn this.getCenter( optionalTarget );\n\n};\n\nBox3.prototype.empty = function () {\n\n\tconsole.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' );\n\treturn this.isEmpty();\n\n};\n\nBox3.prototype.isIntersectionBox = function ( box ) {\n\n\tconsole.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' );\n\treturn this.intersectsBox( box );\n\n};\n\nBox3.prototype.isIntersectionSphere = function ( sphere ) {\n\n\tconsole.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' );\n\treturn this.intersectsSphere( sphere );\n\n};\n\nBox3.prototype.size = function ( optionalTarget ) {\n\n\tconsole.warn( 'THREE.Box3: .size() has been renamed to .getSize().' );\n\treturn this.getSize( optionalTarget );\n\n};\n\n//\n\nSphere.prototype.empty = function () {\n\n\tconsole.warn( 'THREE.Sphere: .empty() has been renamed to .isEmpty().' );\n\treturn this.isEmpty();\n\n};\n\n//\n\nFrustum.prototype.setFromMatrix = function ( m ) {\n\n\tconsole.warn( 'THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().' );\n\treturn this.setFromProjectionMatrix( m );\n\n};\n\n//\n\nLine3.prototype.center = function ( optionalTarget ) {\n\n\tconsole.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' );\n\treturn this.getCenter( optionalTarget );\n\n};\n\n//\n\nMatrix3.prototype.flattenToArrayOffset = function ( array, offset ) {\n\n\tconsole.warn( 'THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );\n\treturn this.toArray( array, offset );\n\n};\n\nMatrix3.prototype.multiplyVector3 = function ( vector ) {\n\n\tconsole.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' );\n\treturn vector.applyMatrix3( this );\n\n};\n\nMatrix3.prototype.multiplyVector3Array = function ( /* a */ ) {\n\n\tconsole.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.' );\n\n};\n\nMatrix3.prototype.applyToBufferAttribute = function ( attribute ) {\n\n\tconsole.warn( 'THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.' );\n\treturn attribute.applyMatrix3( this );\n\n};\n\nMatrix3.prototype.applyToVector3Array = function ( /* array, offset, length */ ) {\n\n\tconsole.error( 'THREE.Matrix3: .applyToVector3Array() has been removed.' );\n\n};\n\nMatrix3.prototype.getInverse = function ( matrix ) {\n\n\tconsole.warn( 'THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' );\n\treturn this.copy( matrix ).invert();\n\n};\n\n//\n\nMatrix4.prototype.extractPosition = function ( m ) {\n\n\tconsole.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' );\n\treturn this.copyPosition( m );\n\n};\n\nMatrix4.prototype.flattenToArrayOffset = function ( array, offset ) {\n\n\tconsole.warn( 'THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );\n\treturn this.toArray( array, offset );\n\n};\n\nMatrix4.prototype.getPosition = function () {\n\n\tconsole.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' );\n\treturn new Vector3().setFromMatrixColumn( this, 3 );\n\n};\n\nMatrix4.prototype.setRotationFromQuaternion = function ( q ) {\n\n\tconsole.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );\n\treturn this.makeRotationFromQuaternion( q );\n\n};\n\nMatrix4.prototype.multiplyToArray = function () {\n\n\tconsole.warn( 'THREE.Matrix4: .multiplyToArray() has been removed.' );\n\n};\n\nMatrix4.prototype.multiplyVector3 = function ( vector ) {\n\n\tconsole.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.' );\n\treturn vector.applyMatrix4( this );\n\n};\n\nMatrix4.prototype.multiplyVector4 = function ( vector ) {\n\n\tconsole.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' );\n\treturn vector.applyMatrix4( this );\n\n};\n\nMatrix4.prototype.multiplyVector3Array = function ( /* a */ ) {\n\n\tconsole.error( 'THREE.Matrix4: .multiplyVector3Array() has been removed.' );\n\n};\n\nMatrix4.prototype.rotateAxis = function ( v ) {\n\n\tconsole.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' );\n\tv.transformDirection( this );\n\n};\n\nMatrix4.prototype.crossVector = function ( vector ) {\n\n\tconsole.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' );\n\treturn vector.applyMatrix4( this );\n\n};\n\nMatrix4.prototype.translate = function () {\n\n\tconsole.error( 'THREE.Matrix4: .translate() has been removed.' );\n\n};\n\nMatrix4.prototype.rotateX = function () {\n\n\tconsole.error( 'THREE.Matrix4: .rotateX() has been removed.' );\n\n};\n\nMatrix4.prototype.rotateY = function () {\n\n\tconsole.error( 'THREE.Matrix4: .rotateY() has been removed.' );\n\n};\n\nMatrix4.prototype.rotateZ = function () {\n\n\tconsole.error( 'THREE.Matrix4: .rotateZ() has been removed.' );\n\n};\n\nMatrix4.prototype.rotateByAxis = function () {\n\n\tconsole.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' );\n\n};\n\nMatrix4.prototype.applyToBufferAttribute = function ( attribute ) {\n\n\tconsole.warn( 'THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.' );\n\treturn attribute.applyMatrix4( this );\n\n};\n\nMatrix4.prototype.applyToVector3Array = function ( /* array, offset, length */ ) {\n\n\tconsole.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' );\n\n};\n\nMatrix4.prototype.makeFrustum = function ( left, right, bottom, top, near, far ) {\n\n\tconsole.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' );\n\treturn this.makePerspective( left, right, top, bottom, near, far );\n\n};\n\nMatrix4.prototype.getInverse = function ( matrix ) {\n\n\tconsole.warn( 'THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' );\n\treturn this.copy( matrix ).invert();\n\n};\n\n//\n\nPlane.prototype.isIntersectionLine = function ( line ) {\n\n\tconsole.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' );\n\treturn this.intersectsLine( line );\n\n};\n\n//\n\nQuaternion.prototype.multiplyVector3 = function ( vector ) {\n\n\tconsole.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' );\n\treturn vector.applyQuaternion( this );\n\n};\n\nQuaternion.prototype.inverse = function ( ) {\n\n\tconsole.warn( 'THREE.Quaternion: .inverse() has been renamed to invert().' );\n\treturn this.invert();\n\n};\n\n//\n\nRay.prototype.isIntersectionBox = function ( box ) {\n\n\tconsole.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );\n\treturn this.intersectsBox( box );\n\n};\n\nRay.prototype.isIntersectionPlane = function ( plane ) {\n\n\tconsole.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );\n\treturn this.intersectsPlane( plane );\n\n};\n\nRay.prototype.isIntersectionSphere = function ( sphere ) {\n\n\tconsole.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );\n\treturn this.intersectsSphere( sphere );\n\n};\n\n//\n\nTriangle.prototype.area = function () {\n\n\tconsole.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' );\n\treturn this.getArea();\n\n};\n\nTriangle.prototype.barycoordFromPoint = function ( point, target ) {\n\n\tconsole.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );\n\treturn this.getBarycoord( point, target );\n\n};\n\nTriangle.prototype.midpoint = function ( target ) {\n\n\tconsole.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' );\n\treturn this.getMidpoint( target );\n\n};\n\nTriangle.prototypenormal = function ( target ) {\n\n\tconsole.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );\n\treturn this.getNormal( target );\n\n};\n\nTriangle.prototype.plane = function ( target ) {\n\n\tconsole.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' );\n\treturn this.getPlane( target );\n\n};\n\nTriangle.barycoordFromPoint = function ( point, a, b, c, target ) {\n\n\tconsole.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );\n\treturn Triangle.getBarycoord( point, a, b, c, target );\n\n};\n\nTriangle.normal = function ( a, b, c, target ) {\n\n\tconsole.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );\n\treturn Triangle.getNormal( a, b, c, target );\n\n};\n\n//\n\nShape.prototype.extractAllPoints = function ( divisions ) {\n\n\tconsole.warn( 'THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.' );\n\treturn this.extractPoints( divisions );\n\n};\n\nShape.prototype.extrude = function ( options ) {\n\n\tconsole.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' );\n\treturn new ExtrudeGeometry( this, options );\n\n};\n\nShape.prototype.makeGeometry = function ( options ) {\n\n\tconsole.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' );\n\treturn new ShapeGeometry( this, options );\n\n};\n\n//\n\nVector2.prototype.fromAttribute = function ( attribute, index, offset ) {\n\n\tconsole.warn( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' );\n\treturn this.fromBufferAttribute( attribute, index, offset );\n\n};\n\nVector2.prototype.distanceToManhattan = function ( v ) {\n\n\tconsole.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );\n\treturn this.manhattanDistanceTo( v );\n\n};\n\nVector2.prototype.lengthManhattan = function () {\n\n\tconsole.warn( 'THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().' );\n\treturn this.manhattanLength();\n\n};\n\n//\n\nVector3.prototype.setEulerFromRotationMatrix = function () {\n\n\tconsole.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' );\n\n};\n\nVector3.prototype.setEulerFromQuaternion = function () {\n\n\tconsole.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' );\n\n};\n\nVector3.prototype.getPositionFromMatrix = function ( m ) {\n\n\tconsole.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' );\n\treturn this.setFromMatrixPosition( m );\n\n};\n\nVector3.prototype.getScaleFromMatrix = function ( m ) {\n\n\tconsole.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' );\n\treturn this.setFromMatrixScale( m );\n\n};\n\nVector3.prototype.getColumnFromMatrix = function ( index, matrix ) {\n\n\tconsole.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' );\n\treturn this.setFromMatrixColumn( matrix, index );\n\n};\n\nVector3.prototype.applyProjection = function ( m ) {\n\n\tconsole.warn( 'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.' );\n\treturn this.applyMatrix4( m );\n\n};\n\nVector3.prototype.fromAttribute = function ( attribute, index, offset ) {\n\n\tconsole.warn( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' );\n\treturn this.fromBufferAttribute( attribute, index, offset );\n\n};\n\nVector3.prototype.distanceToManhattan = function ( v ) {\n\n\tconsole.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );\n\treturn this.manhattanDistanceTo( v );\n\n};\n\nVector3.prototype.lengthManhattan = function () {\n\n\tconsole.warn( 'THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().' );\n\treturn this.manhattanLength();\n\n};\n\n//\n\nVector4.prototype.fromAttribute = function ( attribute, index, offset ) {\n\n\tconsole.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );\n\treturn this.fromBufferAttribute( attribute, index, offset );\n\n};\n\nVector4.prototype.lengthManhattan = function () {\n\n\tconsole.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' );\n\treturn this.manhattanLength();\n\n};\n\n//\n\nObject3D.prototype.getChildByName = function ( name ) {\n\n\tconsole.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );\n\treturn this.getObjectByName( name );\n\n};\n\nObject3D.prototype.renderDepth = function () {\n\n\tconsole.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' );\n\n};\n\nObject3D.prototype.translate = function ( distance, axis ) {\n\n\tconsole.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );\n\treturn this.translateOnAxis( axis, distance );\n\n};\n\nObject3D.prototype.getWorldRotation = function () {\n\n\tconsole.error( 'THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.' );\n\n};\n\nObject3D.prototype.applyMatrix = function ( matrix ) {\n\n\tconsole.warn( 'THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().' );\n\treturn this.applyMatrix4( matrix );\n\n};\n\nObject.defineProperties( Object3D.prototype, {\n\n\teulerOrder: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );\n\t\t\treturn this.rotation.order;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );\n\t\t\tthis.rotation.order = value;\n\n\t\t}\n\t},\n\tuseQuaternion: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );\n\n\t\t}\n\t}\n\n} );\n\nMesh.prototype.setDrawMode = function () {\n\n\tconsole.error( 'THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' );\n\n};\n\nObject.defineProperties( Mesh.prototype, {\n\n\tdrawMode: {\n\t\tget: function () {\n\n\t\t\tconsole.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.' );\n\t\t\treturn TrianglesDrawMode;\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' );\n\n\t\t}\n\t}\n\n} );\n\nSkinnedMesh.prototype.initBones = function () {\n\n\tconsole.error( 'THREE.SkinnedMesh: initBones() has been removed.' );\n\n};\n\n//\n\nPerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {\n\n\tconsole.warn( 'THREE.PerspectiveCamera.setLens is deprecated. ' +\n\t\t\t'Use .setFocalLength and .filmGauge for a photographic setup.' );\n\n\tif ( filmGauge !== undefined ) this.filmGauge = filmGauge;\n\tthis.setFocalLength( focalLength );\n\n};\n\n//\n\nObject.defineProperties( Light.prototype, {\n\tonlyShadow: {\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.Light: .onlyShadow has been removed.' );\n\n\t\t}\n\t},\n\tshadowCameraFov: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' );\n\t\t\tthis.shadow.camera.fov = value;\n\n\t\t}\n\t},\n\tshadowCameraLeft: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' );\n\t\t\tthis.shadow.camera.left = value;\n\n\t\t}\n\t},\n\tshadowCameraRight: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' );\n\t\t\tthis.shadow.camera.right = value;\n\n\t\t}\n\t},\n\tshadowCameraTop: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' );\n\t\t\tthis.shadow.camera.top = value;\n\n\t\t}\n\t},\n\tshadowCameraBottom: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' );\n\t\t\tthis.shadow.camera.bottom = value;\n\n\t\t}\n\t},\n\tshadowCameraNear: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' );\n\t\t\tthis.shadow.camera.near = value;\n\n\t\t}\n\t},\n\tshadowCameraFar: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' );\n\t\t\tthis.shadow.camera.far = value;\n\n\t\t}\n\t},\n\tshadowCameraVisible: {\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' );\n\n\t\t}\n\t},\n\tshadowBias: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' );\n\t\t\tthis.shadow.bias = value;\n\n\t\t}\n\t},\n\tshadowDarkness: {\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowDarkness has been removed.' );\n\n\t\t}\n\t},\n\tshadowMapWidth: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' );\n\t\t\tthis.shadow.mapSize.width = value;\n\n\t\t}\n\t},\n\tshadowMapHeight: {\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' );\n\t\t\tthis.shadow.mapSize.height = value;\n\n\t\t}\n\t}\n} );\n\n//\n\nObject.defineProperties( BufferAttribute.prototype, {\n\n\tlength: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' );\n\t\t\treturn this.array.length;\n\n\t\t}\n\t},\n\tdynamic: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );\n\t\t\treturn this.usage === DynamicDrawUsage;\n\n\t\t},\n\t\tset: function ( /* value */ ) {\n\n\t\t\tconsole.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );\n\t\t\tthis.setUsage( DynamicDrawUsage );\n\n\t\t}\n\t}\n\n} );\n\nBufferAttribute.prototype.setDynamic = function ( value ) {\n\n\tconsole.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.' );\n\tthis.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );\n\treturn this;\n\n};\n\nBufferAttribute.prototype.copyIndicesArray = function ( /* indices */ ) {\n\n\tconsole.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' );\n\n},\n\nBufferAttribute.prototype.setArray = function ( /* array */ ) {\n\n\tconsole.error( 'THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );\n\n};\n\n//\n\nBufferGeometry.prototype.addIndex = function ( index ) {\n\n\tconsole.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );\n\tthis.setIndex( index );\n\n};\n\nBufferGeometry.prototype.addAttribute = function ( name, attribute ) {\n\n\tconsole.warn( 'THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().' );\n\n\tif ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) {\n\n\t\tconsole.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );\n\n\t\treturn this.setAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );\n\n\t}\n\n\tif ( name === 'index' ) {\n\n\t\tconsole.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );\n\t\tthis.setIndex( attribute );\n\n\t\treturn this;\n\n\t}\n\n\treturn this.setAttribute( name, attribute );\n\n};\n\nBufferGeometry.prototype.addDrawCall = function ( start, count, indexOffset ) {\n\n\tif ( indexOffset !== undefined ) {\n\n\t\tconsole.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );\n\n\t}\n\n\tconsole.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );\n\tthis.addGroup( start, count );\n\n};\n\nBufferGeometry.prototype.clearDrawCalls = function () {\n\n\tconsole.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );\n\tthis.clearGroups();\n\n};\n\nBufferGeometry.prototype.computeOffsets = function () {\n\n\tconsole.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );\n\n};\n\nBufferGeometry.prototype.removeAttribute = function ( name ) {\n\n\tconsole.warn( 'THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().' );\n\n\treturn this.deleteAttribute( name );\n\n};\n\nBufferGeometry.prototype.applyMatrix = function ( matrix ) {\n\n\tconsole.warn( 'THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().' );\n\treturn this.applyMatrix4( matrix );\n\n};\n\nObject.defineProperties( BufferGeometry.prototype, {\n\n\tdrawcalls: {\n\t\tget: function () {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );\n\t\t\treturn this.groups;\n\n\t\t}\n\t},\n\toffsets: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );\n\t\t\treturn this.groups;\n\n\t\t}\n\t}\n\n} );\n\nInterleavedBuffer.prototype.setDynamic = function ( value ) {\n\n\tconsole.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.' );\n\tthis.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );\n\treturn this;\n\n};\n\nInterleavedBuffer.prototype.setArray = function ( /* array */ ) {\n\n\tconsole.error( 'THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );\n\n};\n\n//\n\nExtrudeGeometry.prototype.getArrays = function () {\n\n\tconsole.error( 'THREE.ExtrudeGeometry: .getArrays() has been removed.' );\n\n};\n\nExtrudeGeometry.prototype.addShapeList = function () {\n\n\tconsole.error( 'THREE.ExtrudeGeometry: .addShapeList() has been removed.' );\n\n};\n\nExtrudeGeometry.prototype.addShape = function () {\n\n\tconsole.error( 'THREE.ExtrudeGeometry: .addShape() has been removed.' );\n\n};\n\n//\n\nScene.prototype.dispose = function () {\n\n\tconsole.error( 'THREE.Scene: .dispose() has been removed.' );\n\n};\n\n//\n\nUniform.prototype.onUpdate = function () {\n\n\tconsole.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' );\n\treturn this;\n\n};\n\n//\n\nObject.defineProperties( Material.prototype, {\n\n\twrapAround: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.Material: .wrapAround has been removed.' );\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.Material: .wrapAround has been removed.' );\n\n\t\t}\n\t},\n\n\toverdraw: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.Material: .overdraw has been removed.' );\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.Material: .overdraw has been removed.' );\n\n\t\t}\n\t},\n\n\twrapRGB: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.Material: .wrapRGB has been removed.' );\n\t\t\treturn new Color();\n\n\t\t}\n\t},\n\n\tshading: {\n\t\tget: function () {\n\n\t\t\tconsole.error( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );\n\t\t\tthis.flatShading = ( value === FlatShading );\n\n\t\t}\n\t},\n\n\tstencilMask: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );\n\t\t\treturn this.stencilFuncMask;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );\n\t\t\tthis.stencilFuncMask = value;\n\n\t\t}\n\t},\n\n\tvertexTangents: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.' + this.type + ': .vertexTangents has been removed.' );\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.' + this.type + ': .vertexTangents has been removed.' );\n\n\t\t}\n\t},\n\n} );\n\nObject.defineProperties( ShaderMaterial.prototype, {\n\n\tderivatives: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );\n\t\t\treturn this.extensions.derivatives;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );\n\t\t\tthis.extensions.derivatives = value;\n\n\t\t}\n\t}\n\n} );\n\n//\n\nWebGLRenderer.prototype.clearTarget = function ( renderTarget, color, depth, stencil ) {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.' );\n\tthis.setRenderTarget( renderTarget );\n\tthis.clear( color, depth, stencil );\n\n};\n\nWebGLRenderer.prototype.animate = function ( callback ) {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .animate() is now .setAnimationLoop().' );\n\tthis.setAnimationLoop( callback );\n\n};\n\nWebGLRenderer.prototype.getCurrentRenderTarget = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' );\n\treturn this.getRenderTarget();\n\n};\n\nWebGLRenderer.prototype.getMaxAnisotropy = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().' );\n\treturn this.capabilities.getMaxAnisotropy();\n\n};\n\nWebGLRenderer.prototype.getPrecision = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.' );\n\treturn this.capabilities.precision;\n\n};\n\nWebGLRenderer.prototype.resetGLState = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .resetGLState() is now .state.reset().' );\n\treturn this.state.reset();\n\n};\n\nWebGLRenderer.prototype.supportsFloatTextures = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \\'OES_texture_float\\' ).' );\n\treturn this.extensions.get( 'OES_texture_float' );\n\n};\n\nWebGLRenderer.prototype.supportsHalfFloatTextures = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \\'OES_texture_half_float\\' ).' );\n\treturn this.extensions.get( 'OES_texture_half_float' );\n\n};\n\nWebGLRenderer.prototype.supportsStandardDerivatives = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \\'OES_standard_derivatives\\' ).' );\n\treturn this.extensions.get( 'OES_standard_derivatives' );\n\n};\n\nWebGLRenderer.prototype.supportsCompressedTextureS3TC = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \\'WEBGL_compressed_texture_s3tc\\' ).' );\n\treturn this.extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n};\n\nWebGLRenderer.prototype.supportsCompressedTexturePVRTC = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \\'WEBGL_compressed_texture_pvrtc\\' ).' );\n\treturn this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n};\n\nWebGLRenderer.prototype.supportsBlendMinMax = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \\'EXT_blend_minmax\\' ).' );\n\treturn this.extensions.get( 'EXT_blend_minmax' );\n\n};\n\nWebGLRenderer.prototype.supportsVertexTextures = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );\n\treturn this.capabilities.vertexTextures;\n\n};\n\nWebGLRenderer.prototype.supportsInstancedArrays = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \\'ANGLE_instanced_arrays\\' ).' );\n\treturn this.extensions.get( 'ANGLE_instanced_arrays' );\n\n};\n\nWebGLRenderer.prototype.enableScissorTest = function ( boolean ) {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );\n\tthis.setScissorTest( boolean );\n\n};\n\nWebGLRenderer.prototype.initMaterial = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.addPrePlugin = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.addPostPlugin = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.updateShadowMap = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.setFaceCulling = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .setFaceCulling() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.allocTextureUnit = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .allocTextureUnit() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.setTexture = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .setTexture() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.setTexture2D = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .setTexture2D() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.setTextureCube = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .setTextureCube() has been removed.' );\n\n};\n\nWebGLRenderer.prototype.getActiveMipMapLevel = function () {\n\n\tconsole.warn( 'THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().' );\n\treturn this.getActiveMipmapLevel();\n\n};\n\nObject.defineProperties( WebGLRenderer.prototype, {\n\n\tshadowMapEnabled: {\n\t\tget: function () {\n\n\t\t\treturn this.shadowMap.enabled;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );\n\t\t\tthis.shadowMap.enabled = value;\n\n\t\t}\n\t},\n\tshadowMapType: {\n\t\tget: function () {\n\n\t\t\treturn this.shadowMap.type;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );\n\t\t\tthis.shadowMap.type = value;\n\n\t\t}\n\t},\n\tshadowMapCullFace: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' );\n\t\t\treturn undefined;\n\n\t\t},\n\t\tset: function ( /* value */ ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' );\n\n\t\t}\n\t},\n\tcontext: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.' );\n\t\t\treturn this.getContext();\n\n\t\t}\n\t},\n\tvr: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .vr has been renamed to .xr' );\n\t\t\treturn this.xr;\n\n\t\t}\n\t},\n\tgammaInput: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' );\n\t\t\treturn false;\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' );\n\n\t\t}\n\t},\n\tgammaOutput: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' );\n\t\t\treturn false;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' );\n\t\t\tthis.outputEncoding = ( value === true ) ? sRGBEncoding : LinearEncoding;\n\n\t\t}\n\t},\n\ttoneMappingWhitePoint: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );\n\t\t\treturn 1.0;\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );\n\n\t\t}\n\t},\n\tgammaFactor: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );\n\t\t\treturn 2;\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );\n\n\t\t}\n\t}\n} );\n\nObject.defineProperties( WebGLShadowMap.prototype, {\n\n\tcullFace: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' );\n\t\t\treturn undefined;\n\n\t\t},\n\t\tset: function ( /* cullFace */ ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' );\n\n\t\t}\n\t},\n\trenderReverseSided: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' );\n\t\t\treturn undefined;\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' );\n\n\t\t}\n\t},\n\trenderSingleSided: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' );\n\t\t\treturn undefined;\n\n\t\t},\n\t\tset: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' );\n\n\t\t}\n\t}\n\n} );\n\nfunction WebGLRenderTargetCube( width, height, options ) {\n\n\tconsole.warn( 'THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).' );\n\treturn new WebGLCubeRenderTarget( width, options );\n\n}\n\n//\n\nObject.defineProperties( WebGLRenderTarget.prototype, {\n\n\twrapS: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );\n\t\t\treturn this.texture.wrapS;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );\n\t\t\tthis.texture.wrapS = value;\n\n\t\t}\n\t},\n\twrapT: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );\n\t\t\treturn this.texture.wrapT;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );\n\t\t\tthis.texture.wrapT = value;\n\n\t\t}\n\t},\n\tmagFilter: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );\n\t\t\treturn this.texture.magFilter;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );\n\t\t\tthis.texture.magFilter = value;\n\n\t\t}\n\t},\n\tminFilter: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );\n\t\t\treturn this.texture.minFilter;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );\n\t\t\tthis.texture.minFilter = value;\n\n\t\t}\n\t},\n\tanisotropy: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );\n\t\t\treturn this.texture.anisotropy;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );\n\t\t\tthis.texture.anisotropy = value;\n\n\t\t}\n\t},\n\toffset: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );\n\t\t\treturn this.texture.offset;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );\n\t\t\tthis.texture.offset = value;\n\n\t\t}\n\t},\n\trepeat: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );\n\t\t\treturn this.texture.repeat;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );\n\t\t\tthis.texture.repeat = value;\n\n\t\t}\n\t},\n\tformat: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );\n\t\t\treturn this.texture.format;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );\n\t\t\tthis.texture.format = value;\n\n\t\t}\n\t},\n\ttype: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );\n\t\t\treturn this.texture.type;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );\n\t\t\tthis.texture.type = value;\n\n\t\t}\n\t},\n\tgenerateMipmaps: {\n\t\tget: function () {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );\n\t\t\treturn this.texture.generateMipmaps;\n\n\t\t},\n\t\tset: function ( value ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );\n\t\t\tthis.texture.generateMipmaps = value;\n\n\t\t}\n\t}\n\n} );\n\n//\n\nAudio.prototype.load = function ( file ) {\n\n\tconsole.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );\n\tconst scope = this;\n\tconst audioLoader = new AudioLoader();\n\taudioLoader.load( file, function ( buffer ) {\n\n\t\tscope.setBuffer( buffer );\n\n\t} );\n\treturn this;\n\n};\n\n\nAudioAnalyser.prototype.getData = function () {\n\n\tconsole.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );\n\treturn this.getFrequencyData();\n\n};\n\n//\n\nCubeCamera.prototype.updateCubeMap = function ( renderer, scene ) {\n\n\tconsole.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' );\n\treturn this.update( renderer, scene );\n\n};\n\nCubeCamera.prototype.clear = function ( renderer, color, depth, stencil ) {\n\n\tconsole.warn( 'THREE.CubeCamera: .clear() is now .renderTarget.clear().' );\n\treturn this.renderTarget.clear( renderer, color, depth, stencil );\n\n};\n\nImageUtils.crossOrigin = undefined;\n\nImageUtils.loadTexture = function ( url, mapping, onLoad, onError ) {\n\n\tconsole.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );\n\n\tconst loader = new TextureLoader();\n\tloader.setCrossOrigin( this.crossOrigin );\n\n\tconst texture = loader.load( url, onLoad, undefined, onError );\n\n\tif ( mapping ) texture.mapping = mapping;\n\n\treturn texture;\n\n};\n\nImageUtils.loadTextureCube = function ( urls, mapping, onLoad, onError ) {\n\n\tconsole.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );\n\n\tconst loader = new CubeTextureLoader();\n\tloader.setCrossOrigin( this.crossOrigin );\n\n\tconst texture = loader.load( urls, onLoad, undefined, onError );\n\n\tif ( mapping ) texture.mapping = mapping;\n\n\treturn texture;\n\n};\n\nImageUtils.loadCompressedTexture = function () {\n\n\tconsole.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );\n\n};\n\nImageUtils.loadCompressedTextureCube = function () {\n\n\tconsole.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );\n\n};\n\n//\n\nfunction CanvasRenderer() {\n\n\tconsole.error( 'THREE.CanvasRenderer has been removed' );\n\n}\n\n//\n\nfunction JSONLoader() {\n\n\tconsole.error( 'THREE.JSONLoader has been removed.' );\n\n}\n\n//\n\nconst SceneUtils = {\n\n\tcreateMultiMaterialObject: function ( /* geometry, materials */ ) {\n\n\t\tconsole.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );\n\n\t},\n\n\tdetach: function ( /* child, parent, scene */ ) {\n\n\t\tconsole.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );\n\n\t},\n\n\tattach: function ( /* child, scene, parent */ ) {\n\n\t\tconsole.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );\n\n\t}\n\n};\n\n//\n\nfunction LensFlare() {\n\n\tconsole.error( 'THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js' );\n\n}\n\n//\n\nfunction ParametricGeometry() {\n\n\tconsole.error( 'THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js' );\n\treturn new BufferGeometry();\n\n}\n\nfunction TextGeometry() {\n\n\tconsole.error( 'THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js' );\n\treturn new BufferGeometry();\n\n}\n\nfunction FontLoader() {\n\n\tconsole.error( 'THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js' );\n\n}\n\nfunction Font() {\n\n\tconsole.error( 'THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js' );\n\n}\n\nfunction ImmediateRenderObject() {\n\n\tconsole.error( 'THREE.ImmediateRenderObject has been removed.' );\n\n}\n\nif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {\n\t\trevision: REVISION,\n\t} } ) );\n\n}\n\nif ( typeof window !== 'undefined' ) {\n\n\tif ( window.__THREE__ ) {\n\n\t\tconsole.warn( 'WARNING: Multiple instances of Three.js being imported.' );\n\n\t} else {\n\n\t\twindow.__THREE__ = REVISION;\n\n\t}\n\n}\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL25vZGVfbW9kdWxlcy90aHJlZS9idWlsZC90aHJlZS5tb2R1bGUuanM/NWE4OSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0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bjExICogbjM0ICogbjQzIC0gbjEzICogbjMxICogbjQ0ICsgbjExICogbjMzICogbjQ0ICkgKiBkZXRJbnY7XG5cdFx0dGVbIDYgXSA9ICggbjE0ICogbjMyICogbjQxIC0gbjEyICogbjM0ICogbjQxIC0gbjE0ICogbjMxICogbjQyICsgbjExICogbjM0ICogbjQyICsgbjEyICogbjMxICogbjQ0IC0gbjExICogbjMyICogbjQ0ICkgKiBkZXRJbnY7XG5cdFx0dGVbIDcgXSA9ICggbjEyICogbjMzICogbjQxIC0gbjEzICogbjMyICogbjQxICsgbjEzICogbjMxICogbjQyIC0gbjExICogbjMzICogbjQyIC0gbjEyICogbjMxICogbjQzICsgbjExICogbjMyICogbjQzICkgKiBkZXRJbnY7XG5cblx0XHR0ZVsgOCBdID0gdDEzICogZGV0SW52O1xuXHRcdHRlWyA5IF0gPSAoIG4xNCAqIG4yMyAqIG40MSAtIG4xMyAqIG4yNCAqIG40MSAtIG4xNCAqIG4yMSAqIG40MyArIG4xMSAqIG4yNCAqIG40MyArIG4xMyAqIG4yMSAqIG40NCAtIG4xMSAqIG4yMyAqIG40NCApICogZGV0SW52O1xuXHRcdHRlWyAxMCBdID0gKCBuMTIgKiBuMjQgKiBuNDEgLSBuMTQgKiBuMjIgKiBuNDEgKyBuMTQgKiBuMjEgKiBuNDIgLSBuMTEgKiBuMjQgKiBuNDIgLSBuMTIgKiBuMjEgKiBuNDQgKyBuMTEgKiBuMjIgKiBuNDQgKSAqIGRldEludjtcblx0XHR0ZVsgMTEgXSA9ICggbjEzICogbjIyICogbjQxIC0gbjEyICogbjIzICogbjQxIC0gbjEzICogbjIxICogbjQyICsgbjExICogbjIzICogbjQyICsgbjEyICogbjIxICogbjQzIC0gbjExICogbjIyICogbjQzICkgKiBkZXRJbnY7XG5cblx0XHR0ZVsgMTIgXSA9IHQxNCAqIGRldEludjtcblx0XHR0ZVsgMTMgXSA9ICggbjEzICogbjI0ICogbjMxIC0gbjE0ICogbjIzICogbjMxICsgbjE0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NlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/three/build/three.module.js\n"); + +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8od2VicGFjaykvYnVpbGRpbi9nbG9iYWwuanM/Y2QwMCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxDQUFDOztBQUVEO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLDRDQUE0Qzs7QUFFNUMiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvd2VicGFjay9idWlsZGluL2dsb2JhbC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBnO1xuXG4vLyBUaGlzIHdvcmtzIGluIG5vbi1zdHJpY3QgbW9kZVxuZyA9IChmdW5jdGlvbigpIHtcblx0cmV0dXJuIHRoaXM7XG59KSgpO1xuXG50cnkge1xuXHQvLyBUaGlzIHdvcmtzIGlmIGV2YWwgaXMgYWxsb3dlZCAoc2VlIENTUClcblx0ZyA9IGcgfHwgbmV3IEZ1bmN0aW9uKFwicmV0dXJuIHRoaXNcIikoKTtcbn0gY2F0Y2ggKGUpIHtcblx0Ly8gVGhpcyB3b3JrcyBpZiB0aGUgd2luZG93IHJlZmVyZW5jZSBpcyBhdmFpbGFibGVcblx0aWYgKHR5cGVvZiB3aW5kb3cgPT09IFwib2JqZWN0XCIpIGcgPSB3aW5kb3c7XG59XG5cbi8vIGcgY2FuIHN0aWxsIGJlIHVuZGVmaW5lZCwgYnV0IG5vdGhpbmcgdG8gZG8gYWJvdXQgaXQuLi5cbi8vIFdlIHJldHVybiB1bmRlZmluZWQsIGluc3RlYWQgb2Ygbm90aGluZyBoZXJlLCBzbyBpdCdzXG4vLyBlYXNpZXIgdG8gaGFuZGxlIHRoaXMgY2FzZS4gaWYoIWdsb2JhbCkgeyAuLi59XG5cbm1vZHVsZS5leHBvcnRzID0gZztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/webpack/buildin/global.js\n"); + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/*! exports provided: name, description, version, date, leafletExtName, leafletExtVersion, olExtName, olExtVersion, itownsExtName, itownsExtVersion, main, types, module, directories, scripts, repository, author, keywords, license, bugs, homepage, dependencies, devDependencies, default */ +/***/ (function(module) { + +eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"geoportal-extensions\\\",\\\"description\\\":\\\"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries\\\",\\\"version\\\":\\\"2.9.0\\\",\\\"date\\\":\\\"21/09/2023\\\",\\\"leafletExtName\\\":\\\"French Geoportal Extension for Leaflet\\\",\\\"leafletExtVersion\\\":\\\"2.4.0-beta\\\",\\\"olExtName\\\":\\\"French Geoportal Extension for OpenLayers\\\",\\\"olExtVersion\\\":\\\"3.4.0-beta\\\",\\\"itownsExtName\\\":\\\"French Geoportal Extension for Itowns\\\",\\\"itownsExtVersion\\\":\\\"2.5.0-beta\\\",\\\"main\\\":\\\"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js\\\",\\\"types\\\":\\\"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts\\\",\\\"module\\\":\\\"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js\\\",\\\"directories\\\":{},\\\"scripts\\\":{\\\"setup\\\":\\\"npm install\\\",\\\"clean\\\":\\\"echo \\\\\\\"Warning: target not yet implemented!\\\\\\\" && exit 0\\\",\\\"eslint\\\":\\\"eslint src/\\\",\\\"test\\\":\\\"npm run test:serve\\\",\\\"test:serve\\\":\\\"cd test && webpack-dev-server --hot --config webpack.test.serve.js\\\",\\\"sample\\\":\\\"npm run sample:serve\\\",\\\"sample:serve\\\":\\\"npm run sample:ol:serve\\\",\\\"sample:itowns:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path '/dist/itowns/' --port 9001 --open\\\",\\\"sample:leaflet:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path '/dist/leaflet/' --port 9001 --open\\\",\\\"sample:ol:serve\\\":\\\"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path '/dist/openlayers/' --port 9001 --open\\\",\\\"generate-types:ol\\\":\\\"npx tsc -p build/types/tsconfig-openlayers.json\\\",\\\"generate-types:leaflet\\\":\\\"npx tsc -p build/types/tsconfig-leaflet.json\\\",\\\"generate-types:itowns\\\":\\\"npx tsc -p build/types/tsconfig-itowns.json\\\",\\\"generate-jsdoc:ol\\\":\\\"jsdoc -c build/jsdoc/jsdoc-openlayers.json\\\",\\\"generate-jsdoc:leaflet\\\":\\\"jsdoc -c build/jsdoc/jsdoc-leaflet.json\\\",\\\"generate-jsdoc:itowns\\\":\\\"jsdoc -c build/jsdoc/jsdoc-itowns.json\\\",\\\"doc\\\":\\\"npm run doc:serve\\\",\\\"doc:serve\\\":\\\"npm run doc:ol:serve\\\",\\\"doc:itowns:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open\\\",\\\"doc:leaflet:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open\\\",\\\"doc:ol:serve\\\":\\\"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open\\\",\\\"build:dev\\\":\\\"npm-run-all --print-label --print-name build:*:dev\\\",\\\"build:prod\\\":\\\"npm-run-all --print-label --print-name build:*:prod\\\",\\\"build:src\\\":\\\"npm-run-all --print-label --print-name build:*:src\\\",\\\"build\\\":\\\"npm-run-all --print-label --print-name build:*:*\\\",\\\"build:itowns\\\":\\\"npm-run-all --print-label --print-name build:itowns:*\\\",\\\"build:itowns:dev\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=development\\\",\\\"build:itowns:prod\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=production\\\",\\\"build:itowns:src\\\":\\\"webpack --config build/webpack/webpack.config.itowns --mode=none\\\",\\\"build:ol\\\":\\\"npm-run-all --print-label --print-name build:ol:*\\\",\\\"build:ol:dev\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=development\\\",\\\"build:ol:prod\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=production\\\",\\\"build:ol:src\\\":\\\"webpack --config build/webpack/webpack.config.openlayers --mode=none\\\",\\\"build:leaflet\\\":\\\"npm-run-all --print-label --print-name build:leaflet:*\\\",\\\"build:leaflet:dev\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=development\\\",\\\"build:leaflet:prod\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=production\\\",\\\"build:leaflet:src\\\":\\\"webpack --config build/webpack/webpack.config.leaflet --mode=none\\\"},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"https://github.com/IGNF/geoportal-extensions.git\\\"},\\\"author\\\":\\\"IGNF\\\",\\\"keywords\\\":[\\\"geoportail\\\",\\\"javascript\\\",\\\"OpenLayers\\\",\\\"Leaflet\\\",\\\"Itowns\\\",\\\"3D\\\"],\\\"license\\\":\\\"CECILL-B\\\",\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/IGNF/geoportal-extensions/issues\\\"},\\\"homepage\\\":\\\"https://github.com/IGNF/geoportal-extensions#readme\\\",\\\"dependencies\\\":{\\\"@mapbox/mapbox-gl-style-spec\\\":\\\"13.20.1\\\",\\\"eventbusjs\\\":\\\"0.2.0\\\",\\\"geoportal-access-lib\\\":\\\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\\\",\\\"itowns\\\":\\\"2.38.2\\\",\\\"leaflet\\\":\\\"1.7.1\\\",\\\"leaflet-draw\\\":\\\"1.0.4\\\",\\\"loglevel\\\":\\\"^1.6.7\\\",\\\"markdown-toc\\\":\\\"^1.2.0\\\",\\\"ol\\\":\\\"6.9.0\\\",\\\"ol-mapbox-style\\\":\\\"6.7.0\\\",\\\"proj4\\\":\\\"2.7.5\\\",\\\"proj4leaflet\\\":\\\"1.0.2\\\",\\\"sortablejs\\\":\\\"1.14.0\\\",\\\"three\\\":\\\"0.137.5\\\",\\\"typescript\\\":\\\"^4.5.5\\\",\\\"whatwg-fetch\\\":\\\"3.0.0\\\"},\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"^7.4.4\\\",\\\"@babel/plugin-transform-template-literals\\\":\\\"^7.7.4\\\",\\\"@babel/preset-env\\\":\\\"^7.4.4\\\",\\\"babel-loader\\\":\\\"^8.0.5\\\",\\\"chai\\\":\\\"^4.2.0\\\",\\\"chalk\\\":\\\"^4.0.0\\\",\\\"clean-webpack-plugin\\\":\\\"^3.0.0\\\",\\\"copy-webpack-plugin\\\":\\\"^5.0.3\\\",\\\"core-js\\\":\\\"^3.6.4\\\",\\\"css-loader\\\":\\\"^3.4.2\\\",\\\"eslint\\\":\\\"^6.8.0\\\",\\\"eslint-config-standard\\\":\\\"^14.1.1\\\",\\\"eslint-loader\\\":\\\"^4.0.0\\\",\\\"eslint-plugin-import\\\":\\\"^2.17.2\\\",\\\"eslint-plugin-node\\\":\\\"^11.1.0\\\",\\\"eslint-plugin-promise\\\":\\\"^4.1.1\\\",\\\"eslint-plugin-standard\\\":\\\"^4.0.0\\\",\\\"exports-loader\\\":\\\"^0.7.0\\\",\\\"expose-loader\\\":\\\"^0.7.5\\\",\\\"fs-extra\\\":\\\"^9.0.0\\\",\\\"handlebars\\\":\\\"^4.7.5\\\",\\\"handlebars-layouts\\\":\\\"^3.1.4\\\",\\\"html-webpack-plugin\\\":\\\"^4.0.4\\\",\\\"jsdoc-webpack-plugin\\\":\\\"^0.3.0\\\",\\\"mini-css-extract-plugin\\\":\\\"^0.9.0\\\",\\\"mocha\\\":\\\"^7.1.1\\\",\\\"mocha-loader\\\":\\\"^5.0.0\\\",\\\"npm-run-all\\\":\\\"^4.1.5\\\",\\\"optimize-css-assets-webpack-plugin\\\":\\\"^5.0.1\\\",\\\"path\\\":\\\"^0.12.7\\\",\\\"replace-bundle-webpack-plugin\\\":\\\"^1.0.0\\\",\\\"requirejs\\\":\\\"^2.3.6\\\",\\\"responsive-loader\\\":\\\"^1.2.0\\\",\\\"speed-measure-webpack-plugin\\\":\\\"^1.3.0\\\",\\\"string-template\\\":\\\"^1.0.0\\\",\\\"style-loader\\\":\\\"^1.1.3\\\",\\\"terser-webpack-plugin\\\":\\\"^2.0.0\\\",\\\"url-loader\\\":\\\"^4.0.0\\\",\\\"webpack\\\":\\\"^4.30.0\\\",\\\"webpack-cli\\\":\\\"^3.3.1\\\",\\\"webpack-dev-server\\\":\\\"^3.3.1\\\",\\\"webpack-node-externals\\\":\\\"^1.7.2\\\"}}\");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIuL3BhY2thZ2UuanNvbi5qcyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./package.json\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPboostRelief.css": +/*!******************************************!*\ + !*** ./src/Common/CSS/GPboostRelief.css ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQYm9vc3RSZWxpZWYuY3NzPzFmMzIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUGJvb3N0UmVsaWVmLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPboostRelief.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPbuildings.css": +/*!****************************************!*\ + !*** ./src/Common/CSS/GPbuildings.css ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQYnVpbGRpbmdzLmNzcz81YTY3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIiwiZmlsZSI6Ii4vc3JjL0NvbW1vbi9DU1MvR1BidWlsZGluZ3MuY3NzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPbuildings.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPdrawing.css": +/*!**************************************!*\ + !*** ./src/Common/CSS/GPdrawing.css ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQZHJhd2luZy5jc3M/MmI2NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQZHJhd2luZy5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPdrawing.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPelevationPath.css": +/*!********************************************!*\ + !*** ./src/Common/CSS/GPelevationPath.css ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQZWxldmF0aW9uUGF0aC5jc3M/NTAxYSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQZWxldmF0aW9uUGF0aC5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPelevationPath.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPgeneralWidget.css": +/*!********************************************!*\ + !*** ./src/Common/CSS/GPgeneralWidget.css ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQZ2VuZXJhbFdpZGdldC5jc3M/ZjJkYSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQZ2VuZXJhbFdpZGdldC5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPgeneralWidget.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPgetFeatureInfo.css": +/*!*********************************************!*\ + !*** ./src/Common/CSS/GPgetFeatureInfo.css ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQZ2V0RmVhdHVyZUluZm8uY3NzPzU5NTciXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUGdldEZlYXR1cmVJbmZvLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPgetFeatureInfo.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPisochron.css": +/*!***************************************!*\ + !*** ./src/Common/CSS/GPisochron.css ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQaXNvY2hyb24uY3NzPzI2MjIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUGlzb2Nocm9uLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPisochron.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPlayerSwitcher.css": +/*!********************************************!*\ + !*** ./src/Common/CSS/GPlayerSwitcher.css ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQbGF5ZXJTd2l0Y2hlci5jc3M/MzFlZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQbGF5ZXJTd2l0Y2hlci5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPlayerSwitcher.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPlocation.css": +/*!***************************************!*\ + !*** ./src/Common/CSS/GPlocation.css ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQbG9jYXRpb24uY3NzPzIzYjciXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUGxvY2F0aW9uLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPlocation.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPmeasureArea.css": +/*!******************************************!*\ + !*** ./src/Common/CSS/GPmeasureArea.css ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQbWVhc3VyZUFyZWEuY3NzP2Q4ZmUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUG1lYXN1cmVBcmVhLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPmeasureArea.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPmeasureAzimuth.css": +/*!*********************************************!*\ + !*** ./src/Common/CSS/GPmeasureAzimuth.css ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQbWVhc3VyZUF6aW11dGguY3NzP2IxMmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUG1lYXN1cmVBemltdXRoLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPmeasureAzimuth.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPmeasureLength.css": +/*!********************************************!*\ + !*** ./src/Common/CSS/GPmeasureLength.css ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQbWVhc3VyZUxlbmd0aC5jc3M/Njg4NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQbWVhc3VyZUxlbmd0aC5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPmeasureLength.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPmeasureToolTip.css": +/*!*********************************************!*\ + !*** ./src/Common/CSS/GPmeasureToolTip.css ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQbWVhc3VyZVRvb2xUaXAuY3NzPzMyOTciXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUG1lYXN1cmVUb29sVGlwLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPmeasureToolTip.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPmousePosition.css": +/*!********************************************!*\ + !*** ./src/Common/CSS/GPmousePosition.css ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQbW91c2VQb3NpdGlvbi5jc3M/MjliNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQbW91c2VQb3NpdGlvbi5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPmousePosition.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPreverseGeocoding.css": +/*!***********************************************!*\ + !*** ./src/Common/CSS/GPreverseGeocoding.css ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQcmV2ZXJzZUdlb2NvZGluZy5jc3M/OTZiOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQcmV2ZXJzZUdlb2NvZGluZy5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPreverseGeocoding.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GProute.css": +/*!************************************!*\ + !*** ./src/Common/CSS/GProute.css ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQcm91dGUuY3NzPzU1MzkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NTUy9HUHJvdXRlLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/CSS/GProute.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPsearchEngine.css": +/*!*******************************************!*\ + !*** ./src/Common/CSS/GPsearchEngine.css ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQc2VhcmNoRW5naW5lLmNzcz81ZTIxIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIiwiZmlsZSI6Ii4vc3JjL0NvbW1vbi9DU1MvR1BzZWFyY2hFbmdpbmUuY3NzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPsearchEngine.css\n"); + +/***/ }), + +/***/ "./src/Common/CSS/GPwaiting.css": +/*!**************************************!*\ + !*** ./src/Common/CSS/GPwaiting.css ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ1NTL0dQd2FpdGluZy5jc3M/OTMwNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9Db21tb24vQ1NTL0dQd2FpdGluZy5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/CSS/GPwaiting.css\n"); + +/***/ }), + +/***/ "./src/Common/Controls/AttributionDOM.js": +/*!***********************************************!*\ + !*** ./src/Common/Controls/AttributionDOM.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// FIXME not use !?\nvar AttributionDOM = {\n // ################################################################### //\n // ######################### Main container ########################## //\n // ################################################################### //\n\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Creation du container principal (DOM)\n *\n * @returns {DOMElement} div DOM\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPAttribution\");\n container.className = \"GPwidget\";\n return container;\n },\n /**\n * Creation du selecteur (caché) pour l'affichage/masquage des attributions (DOM)\n *\n * @returns {DOMElement} checkbox DOM\n */\n _createMainAttributionsShowElement: function _createMainAttributionsShowElement() {\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPshowAttributionsList\");\n input.type = \"checkbox\";\n return input;\n },\n /**\n * Création de l'élément liste des attributions (DOM)\n *\n * @returns {DOMElement} liste DOM\n */\n _createAttributionsList: function _createAttributionsList() {\n var ul = document.createElement(\"ul\");\n ul.id = this._addUID(\"GPAttributionsList\");\n return ul;\n },\n /**\n * Création du conteneur principal des attributions (DOM)\n *\n * @returns {DOMElement} div DOM\n */\n _createMainAttributionsListContainer: function _createMainAttributionsListContainer() {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPAttributionsListContainer\");\n return div;\n },\n /**\n * Création du container du picto du controle (DOM)\n * @param {Boolean} collapsed - collapsed\n * @returns {DOMElement} label DOM\n */\n _createMainPictoElement: function _createMainPictoElement(collapsed) {\n var self = this;\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowAttributionsListPicto\");\n label.className = \"GPshowAdvancedToolPicto\";\n label.htmlFor = this._addUID(\"GPshowAttributionsList\");\n label.title = \"Afficher/masquer les attributions\";\n var spanOpen = document.createElement(\"span\");\n spanOpen.id = this._addUID(\"GPshowAttributionsListOpenClose\");\n spanOpen.className = \"GPshowAdvancedToolOpen\";\n spanOpen.innerHTML = collapsed ? \"i\" : \"»\";\n /** Evenement de type 'click' sur le picto du controle */\n spanOpen.addEventListener(\"click\", function () {\n spanOpen.innerHTML = document.getElementById(self._addUID(\"GPshowAttributionsList\")).checked ? \"i\" : \"»\";\n });\n label.appendChild(spanOpen);\n return label;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AttributionDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvQXR0cmlidXRpb25ET00uanM/ODEyNCJdLCJuYW1lcyI6WyJBdHRyaWJ1dGlvbkRPTSIsIl9hZGRVSUQiLCJpZCIsInVpZCIsIl91aWQiLCJfY3JlYXRlTWFpbkNvbnRhaW5lckVsZW1lbnQiLCJjb250YWluZXIiLCJkb2N1bWVudCIsImNyZWF0ZUVsZW1lbnQiLCJjbGFzc05hbWUiLCJfY3JlYXRlTWFpbkF0dHJpYnV0aW9uc1Nob3dFbGVtZW50IiwiaW5wdXQiLC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cbiAgICAgICAgc3Bhbk9wZW4uaWQgPSB0aGlzLl9hZGRVSUQoXCJHUHNob3dBdHRyaWJ1dGlvbnNMaXN0T3BlbkNsb3NlXCIpO1xuICAgICAgICBzcGFuT3Blbi5jbGFzc05hbWUgPSBcIkdQc2hvd0FkdmFuY2VkVG9vbE9wZW5cIjtcbiAgICAgICAgc3Bhbk9wZW4uaW5uZXJIVE1MID0gY29sbGFwc2VkID8gXCJpXCIgOiBcIsK7XCI7XG4gICAgICAgIC8qKiBFdmVuZW1lbnQgZGUgdHlwZSAnY2xpY2snIHN1ciBsZSBwaWN0byBkdSBjb250cm9sZSAqL1xuICAgICAgICBzcGFuT3Blbi5hZGRFdmVudExpc3RlbmVyKFwiY2xpY2tcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgc3Bhbk9wZW4uaW5uZXJIVE1MID0gKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNlbGYuX2FkZFVJRChcIkdQc2hvd0F0dHJpYnV0aW9uc0xpc3RcIikpLmNoZWNrZWQpID8gXCJpXCIgOiBcIsK7XCI7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGxhYmVsLmFwcGVuZENoaWxkKHNwYW5PcGVuKTtcblxuICAgICAgICByZXR1cm4gbGFiZWw7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBBdHRyaWJ1dGlvbkRPTTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/Controls/AttributionDOM.js\n"); + +/***/ }), + +/***/ "./src/Common/Controls/BoostReliefDOM.js": +/*!***********************************************!*\ + !*** ./src/Common/Controls/BoostReliefDOM.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar BoostReliefDOM = {\n // ################################################################### //\n // ######################### Main container ########################## //\n // ################################################################### //\n\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Creation du container principal (DOM)\n *\n * @returns {DOMElement} container - layer switcher DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPboostRelief\");\n container.className = \"GPwidget\";\n return container;\n },\n /**\n * Creation du selecteur (caché) pour l'affichage/masquage des slides de boostRelief (DOM)\n *\n * @param {Boolean} collapsed - option indiquant si le control est déplié\n *\n * @returns {DOMElement} checkbox DOM\n */\n _createMainBoostReliefShowElement: function _createMainBoostReliefShowElement(collapsed) {\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPshowBoostReliefList\");\n input.type = \"checkbox\";\n if (collapsed) {\n input.checked = true;\n }\n return input;\n },\n // ################################################################### //\n // ############################ Relief tool ########################### //\n // ################################################################### //\n\n /**\n * Creation du container des outils avancés du layer (DOM)\n *\n * @param {Object} brOptions - options du control boostRelief\n *\n * @returns {DOMElement} container\n */\n _createAdvancedToolElement: function _createAdvancedToolElement(brOptions) {\n // exemple :\n //
\n // \n //
\n var container = document.createElement(\"div\");\n container.className = \"GPlayerAdvancedToolsRelief\";\n var array = this._createAdvancedToolReliefElement(brOptions.scale, brOptions.defaultBoost);\n for (var j = 0; j < array.length; j++) {\n container.appendChild(array[j]);\n }\n return container;\n },\n /**\n * Creation de l'icone de gestion du relief du layer (DOM)\n *\n * @param {Object} scale - définition de l'echelle que le slider utilise (min,max,step)\n * @param {Number} defaultBoost - valeur d'exageration par défaut\n *\n * @returns {DOMElement[]} array of two containers\n */\n _createAdvancedToolReliefElement: function _createAdvancedToolReliefElement(scale, defaultBoost) {\n // exemple :\n //
\n // Layer1\n //
\n //\n //
\n // \n //
\n //
\n // 100\n // %\n //
\n\n var list = [];\n\n // curseur pour changer l'exageration du relief\n var divB = document.createElement(\"div\");\n divB.className = \"GPlayerRelief\";\n divB.title = \"Relief\";\n\n // le relief est à un facteur 1 par défaut\n var relief = 1;\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPreliefValueDiv\");\n input.type = \"range\";\n\n // echelle de 1 à 50 par defaut\n if (!scale) {\n scale = {\n min: 1,\n max: 50,\n step: 1\n };\n }\n ;\n input.min = scale.min || 1;\n input.max = scale.max || 50;\n input.step = scale.step || 1;\n\n // le relief est à un facteur 1 par défaut\n var defaultBoostValue = 1;\n if (defaultBoost) {\n defaultBoostValue = defaultBoost;\n }\n\n // the reliefValue given must me in the slider range\n if (defaultBoostValue > input.max) {\n defaultBoostValue = input.max;\n }\n if (defaultBoostValue < input.min) {\n defaultBoostValue = input.min;\n }\n\n // mise à jour des couches et du slider une fois le controle ajouté\n input.value = defaultBoostValue;\n\n // add event for relief change\n var context = this;\n if (input.addEventListener) {\n input.addEventListener(\"change\", function (e) {\n context._onChangeLayerRelief(e);\n });\n } else if (input.attachEvent) {\n // internet explorer\n input.attachEvent(\"onchange\", function (e) {\n context._onChangeLayerRelief(e);\n });\n }\n if (input.addEventListener) {\n input.addEventListener(\"input\", function (e) {\n context._onChangeLayerRelief(e);\n });\n } else if (input.attachEvent) {\n // internet explorer\n input.attachEvent(\"oninput\", function (e) {\n context._onChangeLayerRelief(e);\n });\n }\n divB.appendChild(input);\n\n // Valeur d'echelle du relief\n var divC = document.createElement(\"div\");\n divC.id = this._addUID(\"GPreliefValueDiv\");\n divC.className = \"GPlayerReliefValue\";\n var span = document.createElement(\"span\");\n span.id = this._addUID(\"GPreliefValue\");\n span.innerHTML = \"x\" + relief;\n divC.appendChild(span);\n list.push(divB);\n list.push(divC);\n return list;\n },\n /**\n * Création du conteneur principal des couches MNT boostRelief (DOM)\n *\n * @returns {DOMElement} div DOM\n */\n _createMainBoostReliefListContainer: function _createMainBoostReliefListContainer() {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPBoostReliefListContainer\");\n div.className = \"GPpanel\";\n return div;\n },\n /**\n * Show boostRelief control\n * @param {Boolean} isDesktop - specifies if the support is desktop or tactile\n *\n * @returns {DOMElement} DOM element\n */\n\n _createMainPictoElement: function _createMainPictoElement() {\n var self = this;\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowBoostReliefListPicto\");\n label.className = \"GPshowAdvancedToolPicto\";\n label.htmlFor = this._addUID(\"GPshowBoostReliefList\");\n label.title = \"Afficher/Masquer le control d'exageration du relief\";\n var spanOpenClose = document.createElement(\"span\");\n spanOpenClose.id = this._addUID(\"GPshowBoostReliefOpenClose\");\n spanOpenClose.className = \"GPshowAdvancedToolOpen\";\n\n /** Evenement de type 'click' sur le picto du controle */\n label.addEventListener(\"click\", function () {\n if (document.getElementById(self._addUID(\"GPshowBoostReliefList\")).checked) {\n document.getElementById(self._addUID(\"GPBoostReliefListContainer\")).style.display = \"none\";\n } else {\n document.getElementById(self._addUID(\"GPBoostReliefListContainer\")).style.display = \"block\";\n }\n });\n label.appendChild(spanOpenClose);\n return label;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (BoostReliefDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvQm9vc3RSZWxpZWZET00uanM/NWNiZCJdLCJuYW1lcyI6WyJCb29zdFJlbGllZkRPTSIsIl9hZGRVSUQiLCJpZCIsInVpZCIsIl91aWQiLCJfY3JlYXRlTWFpbkNvbnRhaW5lckVsZW1lbnQiLCJjb250YWluZXIiLCJkb2N1bWVudCIsImNyZWF0ZUVsZW1lbnQiLCJjbGFzc05hbWUiLCJfY3JlYXRlTWFpbkJvb3N0UmVsaWVmU2hvd0VsZW1lbnQiLCJjb2xsYXBzZWQiLCJpbnB1dCIsInR5cGUiLCJjaGVja2VkIiwiX2NyZWF0ZUFkdmFuY2VkVG9vbEVsZW1lbnQiLCJick9wdGlvbnMiLCJhcnJheSIsIl9jcmVhd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VyUmVsaWVmKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuYXR0YWNoRXZlbnQpIHtcbiAgICAgICAgICAgIC8vIGludGVybmV0IGV4cGxvcmVyXG4gICAgICAgICAgICBpbnB1dC5hdHRhY2hFdmVudChcbiAgICAgICAgICAgICAgICBcIm9uY2hhbmdlXCIsXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5fb25DaGFuZ2VMYXllclJlbGllZihlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlucHV0LmFkZEV2ZW50TGlzdGVuZXIpIHtcbiAgICAgICAgICAgIGlucHV0LmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgXCJpbnB1dFwiLFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuX29uQ2hhbmdlTGF5ZXJSZWxpZWYoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5hdHRhY2hFdmVudCkge1xuICAgICAgICAgICAgLy8gaW50ZXJuZXQgZXhwbG9yZXJcbiAgICAgICAgICAgIGlucHV0LmF0dGFjaEV2ZW50KFxuICAgICAgICAgICAgICAgIFwib25pbnB1dFwiLFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuX29uQ2hhbmdlTGF5ZXJSZWxpZWYoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGRpdkIuYXBwZW5kQ2hpbGQoaW5wdXQpO1xuXG4gICAgICAgIC8vIFZhbGV1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gdHlwZSAnY2xpY2snIHN1ciBsZSBwaWN0byBkdSBjb250cm9sZSAqL1xuICAgICAgICBsYWJlbC5hZGRFdmVudExpc3RlbmVyKFwiY2xpY2tcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNlbGYuX2FkZFVJRChcIkdQc2hvd0Jvb3N0UmVsaWVmTGlzdFwiKSkuY2hlY2tlZCkge1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNlbGYuX2FkZFVJRChcIkdQQm9vc3RSZWxpZWZMaXN0Q29udGFpbmVyXCIpKS5zdHlsZS5kaXNwbGF5ID0gXCJub25lXCI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNlbGYuX2FkZFVJRChcIkdQQm9vc3RSZWxpZWZMaXN0Q29udGFpbmVyXCIpKS5zdHlsZS5kaXNwbGF5ID0gXCJibG9ja1wiO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICBsYWJlbC5hcHBlbmRDaGlsZChzcGFuT3BlbkNsb3NlKTtcblxuICAgICAgICByZXR1cm4gbGFiZWw7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQm9vc3RSZWxpZWZET007XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/Controls/BoostReliefDOM.js\n"); + +/***/ }), + +/***/ "./src/Common/Controls/BuildingsDOM.js": +/*!*********************************************!*\ + !*** ./src/Common/Controls/BuildingsDOM.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar BuildingsDOM = {\n // ################################################################### //\n // ######################### Main container ########################## //\n // ################################################################### //\n\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Creation du container principal (DOM)\n *\n * @returns {DOMElement} container - layer switcher DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPbuildings\");\n container.className = \"GPwidget\";\n return container;\n },\n /**\n * Show buildings control\n * @param {Boolean} isDesktop - specifies if the support is desktop or tactile\n *\n * @returns {DOMElement} DOM element\n */\n\n _createMainPictoElement: function _createMainPictoElement() {\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowBuildingsPicto\");\n label.title = \"Afficher/Masquer les bâtiments 3D\";\n return label;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (BuildingsDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvQnVpbGRpbmdzRE9NLmpzP2ZmMDgiXSwibmFtZXMiOlsiQnVpbGRpbmdzRE9NIiwiX2FkZFVJRCIsImlkIiwidWlkIiwiX3VpZCIsIl9jcmVhdGVNYWluQ29udGFpbmVyRWxlbWVudCIsImNvbnRhaW5lciIsImRvY3VtZW50IiwiY3JlYXRlRWxlbWVudCIsImNsYXNzTmFtZSIsIl9jcmVhdGVNYWluUGljdG9FbGVtZW50IiwibGFiZWwiLCJ0aXRsZSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQSxJQUFJQSxZQUFZLEdBQUc7RUFFZjtFQUNBO0VBQ0E7O0VBRUE7QUFDSjtBQUNBO0FBQ0E7QUFDQTtFQUNJQyxPQUFPLEVBQUcsU0FBQUEsUUFBVUMsRUFBRSxFQUFFO0lBQ3BCLElBQUlDLEdBQUcsR0FBSSxJQUFJLENBQUNDLElBQUksR0FBSUYsRUFBRSxHQUFHLEdBQUcsR0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bGVhbn0gaXNEZXNrdG9wIC0gc3BlY2lmaWVzIGlmIHRoZSBzdXBwb3J0IGlzIGRlc2t0b3Agb3IgdGFjdGlsZVxuICAgICAqXG4gICAgICogQHJldHVybnMge0RPTUVsZW1lbnR9IERPTSBlbGVtZW50XG4gICAgICovXG5cbiAgICBfY3JlYXRlTWFpblBpY3RvRWxlbWVudCA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGxhYmVsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImxhYmVsXCIpO1xuICAgICAgICBsYWJlbC5pZCA9IHRoaXMuX2FkZFVJRChcIkdQc2hvd0J1aWxkaW5nc1BpY3RvXCIpO1xuICAgICAgICBsYWJlbC50aXRsZSA9IFwiQWZmaWNoZXIvTWFzcXVlciBsZXMgYsOidGltZW50cyAzRFwiO1xuICAgICAgICByZXR1cm4gbGFiZWw7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQnVpbGRpbmdzRE9NO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Controls/BuildingsDOM.js\n"); + +/***/ }), + +/***/ "./src/Common/Controls/LayerSwitcherDOM.js": +/*!*************************************************!*\ + !*** ./src/Common/Controls/LayerSwitcherDOM.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n\nvar LayerSwitcherDOM = {\n /**\n * Creation du drag and drop\n *\n * @param {Object} elementDraggable - Element HTML (DOM) Container\n * @param {Object} context - this\n */\n _createDraggableElement: function _createDraggableElement(elementDraggable, context) {\n // FIXME retirer cette détection user-agent pour solution propre\n // option forcefallback pour réparer sortable sous Chrome 97\n // option forcefallback casse le layerswitcher du portail sous firefox\n if (navigator.userAgent.match(/chrome|chromium|crios/i)) {\n sortablejs__WEBPACK_IMPORTED_MODULE_0__[\"default\"].create(elementDraggable, {\n handle: \".GPlayerName\",\n draggable: \".draggable-layer\",\n ghostClass: \"GPghostLayer\",\n animation: 200,\n forceFallback: true,\n // Call event function on drag and drop\n onEnd: function onEnd(e) {\n // FIXME pas terrrible, mais il faut bien passer ce contexte...\n context._onDragAndDropLayerClick(e);\n }\n });\n } else {\n sortablejs__WEBPACK_IMPORTED_MODULE_0__[\"default\"].create(elementDraggable, {\n handle: \".GPlayerName\",\n draggable: \".draggable-layer\",\n ghostClass: \"GPghostLayer\",\n animation: 200,\n // Call event function on drag and drop\n onEnd: function onEnd(e) {\n // FIXME pas terrrible, mais il faut bien passer ce contexte...\n context._onDragAndDropLayerClick(e);\n }\n });\n }\n },\n // ################################################################### //\n // ######################### Main container ########################## //\n // ################################################################### //\n\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Creation du container principal (DOM)\n *\n * @returns {DOMElement} container - layer switcher DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPlayerSwitcher\");\n container.className = \"GPwidget\";\n return container;\n },\n /**\n * Creation du container principal d\"affichage des layers (DOM)\n *\n * @returns {DOMElement} input - element for minimizing/maximizing the layer switcher\n */\n _createMainLayersShowElement: function _createMainLayersShowElement() {\n // \n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPshowLayersList\");\n input.type = \"checkbox\";\n return input;\n },\n /**\n * Creation du container principal des layers (DOM)\n *\n * @returns {DOMElement} container - layers list container\n */\n _createMainLayersElement: function _createMainLayersElement() {\n // ajout de la liste des layers dans le container principal\n //
\n // (...)\n //
\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPlayersList\");\n div.className = \"GPpanel\";\n return div;\n },\n /**\n * Creation du container du picto du controle (DOM)\n *\n * @returns {DOMElement} label\n */\n _createMainPictoElement: function _createMainPictoElement() {\n var self = this;\n\n // exemple :\n // \n // \n\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowLayersListPicto\");\n label.className = \"GPshowAdvancedToolPicto\";\n label.htmlFor = this._addUID(\"GPshowLayersList\");\n label.title = \"Afficher/masquer le gestionnaire de couches\";\n var spanOpen = document.createElement(\"span\");\n spanOpen.id = this._addUID(\"GPshowLayersListOpen\");\n spanOpen.className = \"GPshowAdvancedToolOpen\";\n spanOpen.addEventListener(\"click\", function () {\n if (document.getElementById(self._addUID(\"GPshowLayersList\")).checked) {\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n document.getElementById(self._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n }\n });\n label.appendChild(spanOpen);\n var spanClose = document.createElement(\"span\");\n spanClose.addEventListener(\"click\", function () {\n if (document.getElementById(self._addUID(\"GPshowLayersList\")).checked) {\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n document.getElementById(self._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n }\n });\n spanClose.id = self._addUID(\"GPshowLayersListClose\");\n label.appendChild(spanClose);\n return label;\n },\n /**\n * Creation du container du panneau d\"information (DOM)\n *\n * @returns {DOMElement} container\n */\n _createMainInfoElement: function _createMainInfoElement() {\n // gestion du panneau d\"information dans le container principal\n //
...
\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPlayerInfoPanel\");\n div.className = \"GPpanel GPlayerInfoPanelClosed\";\n return div;\n },\n // ################################################################### //\n // ######################### Layer container ######################### //\n // ################################################################### //\n\n /**\n * Creation du container du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n * @param {Object} obj.layer - couche (ol ou leaflet)\n * @param {String} obj.id - identifiant de la couche (pour ol ou leaflet)\n * @param {String} obj.title - nom de la couche à afficher dans le controle\n * @param {String} obj.description - description de la couche à afficher\n * @param {Boolean} obj.visibility - visibilité de la couche dans la carte (true or false)\n * @param {Float} obj.opacity - opacité de la couche\n *\n * @returns {DOMElement} container\n */\n _createContainerLayerElement: function _createContainerLayerElement(obj) {\n // exemple :\n //
\n // \n // \n // \n //
\n\n // \n // \n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPlayerSwitcher_ID_\" + obj.id);\n container.className = \"GPlayerSwitcher_layer draggable-layer\";\n\n // ajout des outils basiques (visibility / layer name)\n container.appendChild(this._createBasicToolElement(obj));\n\n // liste des outils avancés (layer info / opacity slider / opacity value / removal)\n var array = this._createAdvancedToolShowElement(obj);\n for (var i = 0; i < array.length; i++) {\n container.appendChild(array[i]);\n }\n\n // ajout des outils avancés\n container.appendChild(this._createAdvancedToolElement(obj));\n return container;\n },\n // ################################################################### //\n // ############################ Layer tool ########################### //\n // ################################################################### //\n\n /**\n * Creation du container des outils basiques du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement} container\n */\n _createBasicToolElement: function _createBasicToolElement(obj) {\n // exemple :\n //
\n // \n // \n //
\n\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPbasicTools_ID_\" + obj.id);\n div.className = \"GPlayerBasicTools\";\n div.appendChild(this._createBasicToolNameElement(obj));\n var array = this._createBasicToolVisibilityElement(obj);\n for (var i = 0; i < array.length; i++) {\n div.appendChild(array[i]);\n }\n return div;\n },\n /**\n * Creation du nom du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement} container\n */\n _createBasicToolNameElement: function _createBasicToolNameElement(obj) {\n // exemple :\n // Quartiers prioritaires de la ville\n var span = document.createElement(\"span\");\n span.id = this._addUID(\"GPname_ID_\" + obj.id);\n span.className = \"GPlayerName\";\n span.title = obj.description || obj.title;\n span.innerHTML = obj.title;\n return span;\n },\n /**\n * Creation de l'icone de visibilité du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n * @returns {DOMElement[]} array containing input and label elements\n */\n _createBasicToolVisibilityElement: function _createBasicToolVisibilityElement(obj) {\n // exemple :\n // \n // \n\n var list = [];\n var checked = typeof obj.visibility !== \"undefined\" ? obj.visibility : true;\n var id = this._addUID(\"GPvisibility_ID_\" + obj.id);\n var input = document.createElement(\"input\");\n input.id = id;\n input.type = \"checkbox\";\n input.checked = checked;\n var label = document.createElement(\"label\");\n label.htmlFor = id;\n label.id = this._addUID(\"GPvisibilityPicto_ID_\" + obj.id);\n label.className = \"GPlayerVisibility\";\n label.title = \"Afficher/masquer la couche\";\n\n // add event for visibility change\n var context = this;\n if (input.addEventListener) {\n input.addEventListener(\"click\", function (e) {\n context._onVisibilityLayerClick(e);\n });\n } else if (input.attachEvent) {\n // internet explorer\n input.attachEvent(\"onclick\", function (e) {\n context._onVisibilityLayerClick(e);\n });\n }\n list.push(input);\n list.push(label);\n return list;\n },\n /**\n * Creation de l'affichage du menu des outils avancés du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement[]} array containing input and label elements\n */\n _createAdvancedToolShowElement: function _createAdvancedToolShowElement(obj) {\n // \n // \n\n var list = [];\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowAdvancedToolsPicto_ID_\" + obj.id);\n label.htmlFor = this._addUID(\"GPshowAdvancedTools_ID_\" + obj.id);\n label.title = \"Plus d'outils\";\n label.className = \"GPshowMoreOptions GPshowLayerAdvancedTools\";\n var input = document.createElement(\"input\");\n input.type = \"checkbox\";\n input.id = this._addUID(\"GPshowAdvancedTools_ID_\" + obj.id);\n list.push(input);\n list.push(label);\n return list;\n },\n /**\n * Creation du container des outils avancés du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement} container\n */\n _createAdvancedToolElement: function _createAdvancedToolElement(obj) {\n // exemple :\n //
\n // \n // \n // \n //
\n\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPadvancedTools_ID_\" + obj.id);\n container.className = \"GPlayerAdvancedTools\";\n container.appendChild(this._createAdvancedToolDeleteElement(obj));\n\n // si on n'a de l'informations à afficher, on met en place ce composant\n if (obj.title && obj.description) {\n container.appendChild(this._createAdvancedToolInformationElement(obj));\n }\n if (obj.type !== \"feature\") {\n var array = this._createAdvancedToolOpacityElement(obj);\n for (var i = 0; i < array.length; i++) {\n container.appendChild(array[i]);\n }\n }\n return container;\n },\n /**\n * Creation de l'icone de suppression du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement} container\n */\n _createAdvancedToolDeleteElement: function _createAdvancedToolDeleteElement(obj) {\n // exemple :\n //
\n\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPremove_ID_\" + obj.id);\n div.className = \"GPlayerRemove\";\n div.title = \"Supprimer la couche\";\n div.layerId = obj.id;\n var context = this;\n if (div.addEventListener) {\n div.addEventListener(\"click\", function (e) {\n context._onDropLayerClick(e);\n });\n } else if (div.attachEvent) {\n // internet explorer\n div.attachEvent(\"onclick\", function (e) {\n context._onDropLayerClick(e);\n });\n }\n return div;\n },\n /**\n * Creation de l'icone d'information du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement} container\n */\n _createAdvancedToolInformationElement: function _createAdvancedToolInformationElement(obj) {\n // exemple :\n //
\n\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPinfo_ID_\" + obj.id);\n div.className = \"GPlayerInfo\";\n div.title = \"Informations/légende\";\n div.layerId = obj.id;\n // add event on click\n var context = this;\n if (div.addEventListener) {\n div.addEventListener(\"click\", function (e) {\n context._onOpenLayerInfoClick(e);\n });\n } else if (div.attachEvent) {\n // internet explorer\n div.attachEvent(\"onclick\", function (e) {\n context._onOpenLayerInfoClick(e);\n });\n }\n return div;\n },\n /**\n * Creation de l'icone de gestion de l'opacité du layer (DOM)\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement[]} array of two containers\n */\n _createAdvancedToolOpacityElement: function _createAdvancedToolOpacityElement(obj) {\n // exemple :\n //
\n // \n //
\n //
\n // 100\n // %\n //
\n\n var list = [];\n\n // curseur pour changer l'opacité\n var divO = document.createElement(\"div\");\n divO.id = this._addUID(\"GPopacity_ID_\" + obj.id);\n divO.className = \"GPlayerOpacity\";\n divO.title = \"Opacité\";\n var opacity = typeof obj.opacity !== \"undefined\" ? obj.opacity : 1;\n opacity = Math.round(opacity * 100);\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPopacityValueDiv_ID_\" + obj.id);\n input.type = \"range\";\n input.value = opacity;\n\n // add event for opacity change\n var context = this;\n if (input.addEventListener) {\n input.addEventListener(\"change\", function (e) {\n context._onChangeLayerOpacity(e);\n });\n } else if (input.attachEvent) {\n // internet explorer\n input.attachEvent(\"onchange\", function (e) {\n context._onChangeLayerOpacity(e);\n });\n }\n if (input.addEventListener) {\n input.addEventListener(\"input\", function (e) {\n context._onChangeLayerOpacity(e);\n });\n } else if (input.attachEvent) {\n // internet explorer\n input.attachEvent(\"oninput\", function (e) {\n context._onChangeLayerOpacity(e);\n });\n }\n divO.appendChild(input);\n\n // Valeur d'opacité\n var divC = document.createElement(\"div\");\n divC.id = this._addUID(\"GPopacityValueDiv_ID_\" + obj.id);\n divC.className = \"GPlayerOpacityValue\";\n var span = document.createElement(\"span\");\n span.id = this._addUID(\"GPopacityValue_ID_\" + obj.id);\n span.innerHTML = opacity + \"%\";\n divC.appendChild(span);\n list.push(divO);\n list.push(divC);\n return list;\n },\n // ################################################################### //\n // ############################ Layer info ########################### //\n // ################################################################### //\n\n /**\n * Creation du container du layer info (DOM)\n *\n * TODO GPlayerInfoPopup : ???\n * TODO GPlayerInfoLink : mettre en forme les échelles !\n *\n * @param {Object} obj - options de la couche à ajouter dans le layer switcher\n *\n * @returns {DOMElement} container\n */\n _createContainerLayerInfoElement: function _createContainerLayerInfoElement(obj) {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPlayerInfoContent\");\n var title = document.createElement(\"div\");\n title.id = this._addUID(\"GPlayerInfoTitle\");\n title.innerHTML = obj.title;\n container.appendChild(title);\n if (obj.quicklookUrl) {\n var quick = document.createElement(\"div\");\n quick.id = this._addUID(\"GPlayerInfoQuicklook\");\n quick.title = \"Afficher un aperçu de la couche\";\n var refquick = document.createElement(\"a\");\n refquick.href = obj.quicklookUrl;\n refquick.appendChild(quick);\n container.appendChild(refquick);\n }\n var close = document.createElement(\"div\");\n close.id = this._addUID(\"GPlayerInfoClose\");\n close.title = \"Fermer la fenêtre\";\n var self = this;\n /** Call event function on close click */\n var onCloseClick = function onCloseClick() {\n document.getElementById(self._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n };\n if (close.addEventListener) {\n close.addEventListener(\"click\", onCloseClick);\n } else if (close.attachEvent) {\n // internet explorer\n close.attachEvent(\"onclick\", onCloseClick);\n }\n container.appendChild(close);\n var desc = document.createElement(\"div\");\n desc.id = this._addUID(\"GPlayerInfoDescription\");\n desc.innerHTML = obj.description;\n container.appendChild(desc);\n if (obj.metadata) {\n var mtd = document.createElement(\"div\");\n mtd.id = this._addUID(\"GPlayerInfoMetadata\");\n var mtdtitle = document.createElement(\"div\");\n mtdtitle.className = \"GPlayerInfoSubtitle\";\n mtdtitle.innerHTML = \"Métadonnées\";\n mtd.appendChild(mtdtitle);\n for (var i = 0; i < obj.metadata.length; i++) {\n var urlmtd = obj.metadata[i].url;\n var mtdlink = document.createElement(\"div\");\n mtdlink.className = \"GPlayerInfoLink\";\n var refmtd = document.createElement(\"a\");\n refmtd.href = urlmtd;\n refmtd.innerHTML = urlmtd;\n mtdlink.appendChild(refmtd);\n mtd.appendChild(mtdlink);\n }\n if (obj.metadata.length !== 0) {\n container.appendChild(mtd);\n }\n }\n if (obj.legends) {\n var lgd = document.createElement(\"div\");\n lgd.id = this._addUID(\"GPlayerInfoLegend\");\n var lgdtitle = document.createElement(\"div\");\n lgdtitle.className = \"GPlayerInfoSubtitle\";\n lgdtitle.innerHTML = \"Légende\";\n lgd.appendChild(lgdtitle);\n var legends = {};\n var maxScale = obj.maxScaleDenominator || 560000000;\n\n // on crée un tableau temporaire pour ordonner les légendes selon le dénominateur d'échelle\n for (var k = 0; k < obj.legends.length; k++) {\n var minScale = obj.legends[k].minScaleDenominator;\n if (minScale) {\n var s = minScale.toString();\n minScale = Math.round(parseInt(s.substring(0, 3), 10) / 10) * Math.pow(10, s.length - 2);\n } else {\n minScale = 270;\n }\n legends[minScale] = obj.legends[k];\n }\n for (var scale in legends) {\n if (legends.hasOwnProperty(scale)) {\n var urllgd = legends[scale].url;\n // on n'affiche pas les légendes pointant vers \"nolegend.jpg\"\n if (typeof urllgd === \"string\" && urllgd.toLowerCase().indexOf(\"nolegend.jpg\") === -1) {\n // TODO GPlayerInfoPopup\n var lgdlink = document.createElement(\"div\");\n lgdlink.className = \"GPlayerInfoLink\";\n maxScale = legends[scale].maxScaleDenominator || maxScale;\n var reflgd = document.createElement(\"a\");\n reflgd.href = urllgd;\n reflgd.innerHTML = \"Du 1/\" + scale + \" au 1/\" + maxScale;\n lgdlink.appendChild(reflgd);\n lgd.appendChild(lgdlink);\n } else {\n delete legends[scale];\n }\n }\n }\n if (Object.keys(legends).length !== 0) {\n container.appendChild(lgd);\n }\n }\n return container;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerSwitcherDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8u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lbGVjdG9yIHdpdGggYW4gdW5pcXVlIGlkXG4gICAgKi9cbiAgICBfYWRkVUlEIDogZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgIHZhciB1aWQgPSAodGhpcy5fdWlkKSA/IGlkICsgXCItXCIgKyB0aGlzLl91aWQgOiBpZDtcbiAgICAgICAgcmV0dXJuIHVpZDtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRpb24gZHUgY29udGFpbmVyIHByaW5jaXBhbCAoRE9NKVxuICAgICAqXG4gICAgICogQHJldHVybnMge0RPTUVsZW1lbnR9IGNvbnRhaW5lciAtIGxheWVyIHN3aXRjaGVyIERPTSBlbGVtZW50XG4gICAgICovXG4gICAgX2NyZWF0ZU1haW5Db250YWluZXJFbGVtZW50IDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgY29udGFpbmVyLmlkID0gdGhpcy5fYWRkVUlEKFwiR1BsYXllclN3aXRjaGVyXCIpO1xuICAgICAgICBjb250YWluZXIuY2xhc3NOYW1lID0gXCJHUHdpZGdldFwiO1xuICAgICAgICByZXR1cm4gY29udGFpbmVyO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBDcmVhdGlvbiBkdSBjb250YWluZXIgcHJpbmNpcGFsIGRcImFmZmljaGFnZSBkZXMgbGF5ZXJzIChET00pXG4gICAgICpcbiAgICAgKiBAcmV0dXJucyB7RE9NRWxlbWVudH0gaW5wdXQgLSBlbGVtZW50IGZvciBtaW5pbWl6aW5nL21heGltaXppbmcgdGhlIGxheWVyIHN3aXRjaGVyXG4gICAgICovXG4gICAgX2NyZWF0ZU1haW5MYXllcnNTaG93RWxlbWVudCA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgLy8gPCEtLSBIaWRkZW4gY2hlY2tib3ggZm9yIG1pbmltaXppbmcvbWF4aW1pemluZyAtLT5cbiAgIC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W50KFwibGFiZWxcIik7XG4gICAgICAgIGxhYmVsLmh0bWxGb3IgPSBpZDtcbiAgICAgICAgbGFiZWwuaWQgPSB0aGlzLl9hZGRVSUQoXCJHUHZpc2liaWxpdHlQaWN0b19JRF9cIiArIG9iai5pZCk7XG4gICAgICAgIGxhYmVsLmNsYXNzTmFtZSA9IFwiR1BsYXllclZpc2liaWxpdHlcIjtcbiAgICAgICAgbGFiZWwudGl0bGUgPSBcIkFmZmljaGVyL21hc3F1ZXIgbGEgY291Y2hlXCI7XG5cbiAgICAgICAgLy8gYWRkIGV2ZW50IGZvciB2aXNpYmlsaXR5IGNoYW5nZVxuICAgICAgICB2YXIgY29udGV4dCA9IHRoaXM7XG4gICAgICAgIGlmIChpbnB1dC5hZGRFdmVudExpc3RlbmVyKSB7XG4gICAgICAgICAgICBpbnB1dC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgIFwiY2xpY2tcIixcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0Ll9vblZpc2liaWxpdHlMYXllckNsaWNrKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuYXR0YWNoRXZlbnQpIHtcbiAgICAgICAgICAgIC8vIGludGVybmV0IGV4cGxvcmVyXG4gICAgICAgICAgICBpbnB1dC5hdHRhY2hFdmVudChcbiAgICAgICAgICAgICAgICBcIm9uY2xpY2tcIixcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0Ll9vblZpc2liaWxpdHlMYXllckNsaWNrKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBsaXN0LnB1c2goaW5wdXQpO1xuICAgICAgICBsaXN0LnB1c2gobGFiZWwpO1xuXG4gICAgICAgIHJldHVybi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cbiAgICAgICAgICAgICAgICBcImNsaWNrXCIsXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5fb25Ecm9wTGF5ZXJDbGljayhlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICApO1xuICAgICAgICB9IGVsc2UgaWYgKGRpdi5hdHRhY2hFdmVudCkge1xuICAgICAgICAgICAgLy8gaW50ZXJuZXQgZXhwbG9yZXJcbiAgICAgICAgICAgIGRpdi5hdHRhY2hFdmVudChcbiAgICAgICAgICAgICAgICBcIm9uY2xpY2tcIixcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0Ll9vbkRyb3BMYXllckNsaWNrKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZGl2O1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBDcmVhdGlvbiBkZSBsJ2ljb25lIGQnaW5mb3JtYXRpb24gZHUgbGF5ZXIgKERPTSlcbiAgICAgKlxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvYmogLSBvcHRpb25zIGRlIGxhIGNvdWNoZSDDoCBham91dGVyIGRhbnMgbGUgbGF5ZXIgc3dpdGNoZXJcbiAgICAgKlxuICAgICAqIEByZXR1cm5zIHtET01FbGVtZW50fSBjb250YWluZXJcbiAgICAgKi9cbiAgICBfY3JlYXRlQWR2YW5jZWRUb29sSW5mb3JtYXRpb25FbGVtZW50IDogZnVuY3Rpb24gKG9iaikge1xuICAgICAgICAvLyBleGVtcGxlIDpcbiAgICAgICAgLy8gPGRpdiBpZD1cIkdQaW5mb19JRF9MYXllcjFcIiBjbGFzcz1cIkdQbGF5ZXJJbmZvXCIgdGl0bGU9XCJJbmZvcm1hdGlvbnMvbMOpZ2VuZGVcIiBvbmNsaWNrPVwiR1BvcGVuTGF5ZXJJbmZvKHRoaXMpO1wiPjwvZGl2PlxuXG4gICAgICAgIHZhciBkaXYgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiZGl2XCIpO1xuICAgICAgICBkaXYuaWQgPSB0aGlzLl9hZGRVSUQoXCJHUGluZm9fSURfXCIgKyBvYmouaWQpO1xuICAgICAgICBkaXYuY2xhc3NOYW1lID0gXCJHUGxheWVySW5mb1wiO1xuICAgICAgICBkaXYudGl0bGUgPSBcIkluZm9ybWF0aW9ucy9sw6lnZW5kZVwiO1xuICAgICAgICBkaXYubGF5ZXJJZCA9IG9iai5pZDtcbiAgICAgICAgLy8gYWRkIGV2ZW50IG9uIGNsaWNrXG4gICAgICAgIHZhciBjb250ZXh0ID0gdGhpcztcbiAgICAgICAgaWYgKGRpdi5hZGRFdmVudExpc3RlbmVyKSB7XG4gICAgICAgICAgICBkaXYuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICBcImNsaWNrXCIsXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5fb25PcGVuTGF5ZXJJbmZvQ2xpY2soZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmIChkaXYuYXR0YWNoRXZlbnQpIHtcbiAgICAgICAgICAgIC8vIGludGVybmV0IGV4cGxvcmVyXG4gICAgICAgICAgICBkaXYuYXR0YWNoRXZlbnQoXG4gICAgICAgICAgICAgICAgXCJvbmNsaWNrXCIsXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5fb25PcGVuTGF5ZXJJbmZvQ2xpY2soZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBkaXY7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIENyZWF0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ICApO1xuICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmF0dGFjaEV2ZW50KSB7XG4gICAgICAgICAgICAvLyBpbnRlcm5ldCBleHBsb3JlclxuICAgICAgICAgICAgaW5wdXQuYXR0YWNoRXZlbnQoXG4gICAgICAgICAgICAgICAgXCJvbmNoYW5nZVwiLFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuX29uQ2hhbmdlTGF5ZXJPcGFjaXR5KGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcikge1xuICAgICAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICBcImlucHV0XCIsXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5fb25DaGFuZ2VMYXllck9wYWNpdHkoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5hdHRhY2hFdmVudCkge1xuICAgICAgICAgICAgLy8gaW50ZXJuZXQgZXhwbG9yZXJcbiAgICAgICAgICAgIGlucHV0LmF0dGFjaEV2ZW50KFxuICAgICAgICAgICAgICAgIFwib25pbnB1dFwiLFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuX29uQ2hhbmdlTGF5ZXJPcGFjaXR5KGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBkaXZPLmFwcGVuZENoaWxkKGlucHV0KTtcblxuICAgICAgICAvLyBWYWxldXIgZCdvcGFjaXTDqVxuICAgICAgICB2YXIgZGl2QyA9IGRvY3VtZW50LmNy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GVuIGZvcm1lIGxlcyDDqWNoZWxsZXMgIVxuICAgICAqXG4gICAgICogQHBhcmFtIHtPYmplY3R9IG9iaiAtIG9wdGlvbnMgZGUgbGEgY291Y2hlIMOgIGFqb3V0ZXIgZGFucyBsZSBsYXllciBzd2l0Y2hlclxuICAgICAqXG4gICAgICogQHJldHVybnMge0RPTUVsZW1lbnR9IGNvbnRhaW5lclxuICAgICAqL1xuICAgIF9jcmVhdGVDb250YWluZXJMYXllckluZm9FbGVtZW50IDogZnVuY3Rpb24gKG9iaikge1xuICAgICAgICB2YXIgY29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgY29udGFpbmVyLmlkID0gdGhpcy5fYWRkVUlEKFwiR1BsYXllckluZm9Db250ZW50XCIpO1xuXG4gICAgICAgIHZhciB0aXRsZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICAgIHRpdGxlLmlkID0gdGhpcy5fYWRkVUlEKFwiR1BsYXllckluZm9UaXRsZVwiKTtcbiAgICAgICAgdGl0bGUuaW5uZXJIVE1MID0gb2JqLnRpdGxlO1xuICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQodGl0bGUpO1xuXG4gICAgICAgIGlmIChvYmoucXVpY2tsb29rVXJsKSB7XG4gICAgICAgICAgICB2YXIgcXVpY2sgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiZGl2XCIpO1xuICAgICAgICAgICAgcXVpY2suaWQgPSB0aGlzLl9hZGRVSUQoXCJHUGxheWVySW5mb1F1aWNrbG9va1wiKTtcbiAgICAgICAgICAgIHF1aWNrLnRpdGxlID0gXCJBZmZpY2hlciB1biBhcGVyw6d1IGRlIGxhIGNvdWNoZVwiO1xuICAgICAgICAgICAgdmFyIHJlZnF1aWNrID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImFcIik7XG4gICAgICAgICAgICByZWZxdWljay5ocmVmID0g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kYXRhW2ldLnVybDtcblxuICAgICAgICAgICAgICAgIHZhciBtdGRsaW5rID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgICAgICAgICBtdGRsaW5rLmNsYXNzTmFtZSA9IFwiR1BsYXllckluZm9MaW5rXCI7XG5cbiAgICAgICAgICAgICAgICB2YXIgcmVmbXRkID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImFcIik7XG4gICAgICAgICAgICAgICAgcmVmbXRkLmhyZWYgPSB1cmxtdGQ7XG4gICAgICAgICAgICAgICAgcmVmbXRkLmlubmVySFRNTCA9IHVybG10ZDtcbiAgICAgICAgICAgICAgICBtdGRsaW5rLmFwcGVuZENoaWxkKHJlZm10ZCk7XG4gICAgICAgICAgICAgICAgbXRkLmFwcGVuZENoaWxkKG10ZGxpbmspO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAob2JqLm1ldGFkYXRhLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRhaW5lci5hcHBlbmRDaGlsZChtdGQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG9iai5sZWdlbmRzKSB7XG4gICAgICAgICAgICB2YXIgbGdkID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgICAgIGxnZC5pZCA9IHRoaXMuX2FkZFVJRChcIkdQbGF5ZXJJbmZvTGVnZW5kXCIpO1xuXG4gICAgICAgICAgICB2YXIgbGdkdGl0bGUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiZGl2XCIpO1xuICAgICAgICAgICAgbGdkdGl0bGUuY2xhc3NOYW1lID0gXCJHUGxheWVySW5mb1N1YnRpdGxlXCI7XG4gICAgICAgICAgICBsZ2R0aXRsZS5pbm5lckhUTUwgPSBcIkzDqWdlbmRlXCI7XG4gICAgICAgICAgICBsZ2QuYXBwZW5kQ2hpbGQobGdkdGl0bGUpO1xuXG4gICAgICAgICAgICB2YXIgbGVnZW5kcyA9IHt9O1xuICAgICAgICAgICAgdmFyIG1heFNjYWxlID0gb2JqLm1heFNjYWxlRGVub21pbmF0b3IgfHwgNTYwMDAwMDAwO1xuXG4gICAgICAgICAgICAvLyBvbiBjcsOpZSB1biB0YWJsZWF1IHRlbXBvcmFpcmUgcG91ciBvcmRvbm5lciBsZXMgbMOpZ2VuZGVzIHNlbG9uIGxlIGTDqW5vbWluYXRldXIgZCfDqWNoZWxsZVxuICAgICAgICAgICAgZm9yICh2YXIgayA9IDA7IGsgPCBvYmoubGVnZW5kcy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgIHZhciBtaW5TY2FsZSA9IG9iai5sZWdlbmRzW2tdLm1pblNjYWxlRGVub21pbmF0b3I7XG4gICAgICAgICAgICAgICAgaWYgKG1pblNjYWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzID0gbWluU2NhbGUudG9TdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgICAgbWluU2NhbGUgPSBNYXRoLnJvdW5kKHBhcnNlSW50KHMuc3Vic3RyaW5nKDAsIDMpLCAxMCkgLyAxMCkgKiBNYXRoLnBvdygxMCwgcy5sZW5ndGggLSAyKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBtaW5TY2FsZSA9IDI3MDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGVnZW5kc1ttaW5TY2FsZV0gPSBvYmoubGVnZW5kc1trXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yICh2YXIgc2NhbGUgaW4gbGVnZW5kcykge1xuICAgICAgICAgICAgICAgIGlmIChsZWdlbmRzLmhhc093blByb3BlcnR5KHNjYWxlKSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsbGdkID0gbGVnZW5kc1tzY2FsZV0udXJsO1xuICAgICAgICAgICAgICAgICAgICAvLyBvbiBuJ2FmZmljaGUgcGFzIGxlcyBsw6lnZW5kZXMgcG9pbnRhbnQgdmVycyBcIm5vbGVnZW5kLmpwZ1wiXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdXJsbGdkID09PSBcInN0cmluZ1wiICYmIHVybGxnZC50b0xvd2VyQ2FzZSgpLmluZGV4T2YoXCJub2xlZ2VuZC5qcGdcIikgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIEdQbGF5ZXJJbmZvUG9wdXBcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZ2RsaW5rID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxnZGxpbmsuY2xhc3NOYW1lID0gXCJHUGxheWVySW5mb0xpbmtcIjtcblxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4U2NhbGUgPSBsZWdlbmRzW3NjYWxlXS5tYXhTY2FsZURlbm9taW5hdG9yIHx8IG1heFNjYWxlO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVmbGdkID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImFcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWZsZ2QuaHJlZiA9IHVybGxnZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZmxnZC5pbm5lckhUTUwgPSBcIkR1IDEvXCIgKyBzY2FsZSArIFwiIGF1IDEvXCIgKyBtYXhTY2FsZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxnZGxpbmsuYXBwZW5kQ2hpbGQocmVmbGdkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxnZC5hcHBlbmRDaGlsZChsZ2RsaW5rKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBsZWdlbmRzW3NjYWxlXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzKGxlZ2VuZHMpLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRhaW5lci5hcHBlbmRDaGlsZChsZ2QpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNvbnRhaW5lcjtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBMYXllclN3aXRjaGVyRE9NO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Controls/LayerSwitcherDOM.js\n"); + +/***/ }), + +/***/ "./src/Common/Controls/MiniGlobeDOM.js": +/*!*********************************************!*\ + !*** ./src/Common/Controls/MiniGlobeDOM.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar MiniGlobeDOM = {\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Main container (DOM)\n *\n * @returns {DOMElement} DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPminiglobeContainer\");\n container.className = \"GPwidget\";\n container.style.width = \"100px\";\n container.style.height = \"100px\";\n return container;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MiniGlobeDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvTWluaUdsb2JlRE9NLmpzPzBiNTQiXSwibmFtZXMiOlsiTWluaUdsb2JlRE9NIiwiX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ICAgLyoqXG4gICAgKiBBZGQgdXVpZCB0byB0aGUgdGFnIElEXG4gICAgKiBAcGFyYW0ge1N0cmluZ30gaWQgLSBpZCBzZWxlY3RvclxuICAgICogQHJldHVybnMge1N0cmluZ30gdWlkIC0gaWQgc2VsZWN0b3Igd2l0aCBhbiB1bmlxdWUgaWRcbiAgICAqL1xuICAgIF9hZGRVSUQgOiBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgdmFyIHVpZCA9ICh0aGlzLl91aWQpID8gaWQgKyBcIi1cIiArIHRoaXMuX3VpZCA6IGlkO1xuICAgICAgICByZXR1cm4gdWlkO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBNYWluIGNvbnRhaW5lciAoRE9NKVxuICAgICAqXG4gICAgICogQHJldHVybnMge0RPTUVsZW1lbnR9IERPTSBlbGVtZW50XG4gICAgICovXG4gICAgX2NyZWF0ZU1haW5Db250YWluZXJFbGVtZW50IDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgY29udGFpbmVyLmlkID0gdGhpcy5fYWRkVUlEKFwiR1BtaW5pZ2xvYmVDb250YWluZXJcIik7XG4gICAgICAgIGNvbnRhaW5lci5jbGFzc05hbWUgPSBcIkdQd2lkZ2V0XCI7XG4gICAgICAgIGNvbnRhaW5lci5zdHlsZS53aWR0aCA9IFwiMTAwcHhcIjtcbiAgICAgICAgY29udGFpbmVyLnN0eWxlLmhlaWdodCA9IFwiMTAwcHhcIjtcbiAgICAgICAgcmV0dXJuIGNvbnRhaW5lcjtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBNaW5pR2xvYmVET007XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/Controls/MiniGlobeDOM.js\n"); + +/***/ }), + +/***/ "./src/Common/Controls/MousePositionDOM.js": +/*!*************************************************!*\ + !*** ./src/Common/Controls/MousePositionDOM.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar MousePositionDOM = {\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Main container (DOM)\n *\n * @returns {DOMElement} DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePosition\");\n container.className = \"GPwidget\";\n return container;\n },\n // ################################################################### //\n // ################### Methods of main container ##################### //\n // ################################################################### //\n\n /**\n * Hidden checkbox for minimizing/maximizing\n *\n * @returns {DOMElement} DOM element\n */\n _createShowMousePositionElement: function _createShowMousePositionElement() {\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPshowMousePosition\");\n input.type = \"checkbox\";\n return input;\n },\n /**\n * Show mouse position control\n * @param {Boolean} isDesktop - specifies if the support is desktop or tactile\n *\n * @returns {DOMElement} DOM element\n */\n _createShowMousePositionPictoElement: function _createShowMousePositionPictoElement(isDesktop) {\n // contexte d'execution\n var self = this;\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowMousePositionPicto\");\n label.className = \"GPshowAdvancedToolPicto\";\n label.htmlFor = this._addUID(\"GPshowMousePosition\");\n label.title = \"Afficher les coordonnées du curseur\";\n\n // FIXME detection disponible dans le JS !\n // Detection : test for desktop or tactile\n // var isDesktop = true;\n // var userAgent = window.navigator.userAgent.toLowerCase();\n // if (userAgent.indexOf(\"iphone\") !== -1 ||\n // userAgent.indexOf(\"ipod\") !== -1 ||\n // userAgent.indexOf(\"ipad\") !== -1 ||\n // userAgent.indexOf(\"android\") !== -1 ||\n // userAgent.indexOf(\"mobile\") !== -1 ||\n // userAgent.indexOf(\"blackberry\") !== -1 ||\n // userAgent.indexOf(\"tablet\") !== -1 ||\n // userAgent.indexOf(\"phone\") !== -1 ||\n // userAgent.indexOf(\"touch\") !== -1 ) {\n // isDesktop = false;\n // }\n // if (userAgent.indexOf(\"msie\") !== -1 ||\n // userAgent.indexOf(\"trident\") !== -1) {\n // isDesktop = true;\n // }\n\n // Show map center localisation if panel opened and tactile support\n label.addEventListener(\"click\", function (e) {\n var mapCenterClass = \"\";\n if (!document.getElementById(self._addUID(\"GPshowMousePosition\")).checked && !isDesktop) {\n mapCenterClass = \"GPmapCenterVisible\";\n }\n document.getElementById(\"GPmapCenter\").className = mapCenterClass;\n self.onShowMousePositionClick(e);\n });\n var spanOpen = document.createElement(\"span\");\n spanOpen.id = this._addUID(\"GPshowMousePositionOpen\");\n spanOpen.className = \"GPshowAdvancedToolOpen\";\n label.appendChild(spanOpen);\n return label;\n },\n /**\n * mouse position panel\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionPanelElement: function _createMousePositionPanelElement() {\n var panel = document.createElement(\"div\");\n panel.id = this._addUID(\"GPmousePositionPanel\");\n panel.className = \"GPpanel\";\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // div.appendChild(this._createMousePositionPanelHeaderElement());\n // div.appendChild(this._createMousePositionPanelBasicElement());\n // div.appendChild(this._createShowMousePositionSettingsElement());\n // div.appendChild(this._createMousePositionSettingsElement());\n\n return panel;\n },\n /**\n * Map center localisation (tactile use)\n *\n * @returns {DOMElement} container\n */\n _createMapCenter: function _createMapCenter() {\n var div = document.createElement(\"div\");\n div.id = \"GPmapCenter\";\n div.className = \"\";\n return div;\n },\n // ################################################################### //\n // ####################### Panel container ########################### //\n // ################################################################### //\n\n /**\n * @returns {DOMElement} container\n */\n _createMousePositionPanelHeaderElement: function _createMousePositionPanelHeaderElement() {\n var container = document.createElement(\"div\");\n container.className = \"GPpanelHeader\";\n var divTitle = document.createElement(\"div\");\n divTitle.className = \"GPpanelTitle\";\n divTitle.innerHTML = \"Coordonnées\";\n container.appendChild(divTitle);\n var divClose = document.createElement(\"div\");\n divClose.id = \"GPmousePositionPanelClose\";\n divClose.className = \"GPpanelClose\";\n divClose.title = \"Fermer le panneau\";\n\n // Link panel close / visibility checkbox\n var self = this;\n if (divClose.addEventListener) {\n divClose.addEventListener(\"click\", function () {\n document.getElementById(self._addUID(\"GPshowMousePositionPicto\")).click();\n }, false);\n } else if (divClose.attachEvent) {\n divClose.attachEvent(\"onclick\", function () {\n document.getElementById(self._addUID(\"GPshowMousePositionPicto\")).click();\n });\n }\n container.appendChild(divClose);\n return container;\n },\n /**\n * coordinate panel\n * @param {Boolean} [displayAltitude] - specifies if the altitude panel must be displayed\n * @param {Boolean} [displayCoordinates] - specifies if the coordinates panel must be displayed\n * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed\n * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units\n *\n * FIXME\n * call this._createMousePositionPanelBasicCoordinateElement\n * call this._createMousePositionPanelBasicAltitudeElement\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionPanelBasicElement: function _createMousePositionPanelBasicElement(displayAltitude, displayCoordinates, editCoordinates, currentProjectionUnits) {\n // default Values\n displayAltitude = typeof displayAltitude === \"undefined\" ? true : displayAltitude;\n displayCoordinates = typeof displayCoordinates === \"undefined\" ? true : displayCoordinates;\n editCoordinates = typeof editCoordinates === \"undefined\" ? false : editCoordinates;\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePositionBasicPanel\");\n\n // FIXME on devrait decomposer la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n container.appendChild(this._createMousePositionPanelBasicCoordinateElement(displayCoordinates, editCoordinates, currentProjectionUnits));\n container.appendChild(this._createMousePositionPanelEditToolsElement(editCoordinates));\n container.appendChild(this._createMousePositionPanelBasicAltitudeElement(displayAltitude));\n return container;\n },\n /**\n * create coordinate elements\n *\n * @param {String} coordType - (\"Lon\" ou \"Lat\")\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {Array} list of DOM elements\n */\n _createCoordinateElement: function _createCoordinateElement(coordType, editCoordinates) {\n var context = this;\n if ([\"Lon\", \"Lat\"].indexOf(coordType) === -1) {\n return [];\n }\n var list = [];\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPmousePosition\" + coordType);\n input.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input.readOnly = true;\n if (editCoordinates) {\n input.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input.addEventListener(\"change\", function (e) {\n this.classList.remove(\"error\");\n var valid = context.validateExtentCoordinate(coordType, this.value, e);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input);\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionUnits\";\n list.push(span);\n return list;\n },\n /**\n *\n * @param {String} coordType - (\"Lon\" ou \"Lat\")\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {Array} list of DOM elements\n */\n _createDMSCoordinateElement: function _createDMSCoordinateElement(coordType, editCoordinates) {\n if ([\"Lon\", \"Lat\"].indexOf(coordType) === -1) {\n return [];\n }\n var context = this;\n var list = [];\n var input = document.createElement(\"input\");\n input.id = this._addUID(\"GPmousePosition\" + coordType + \"Degrees\");\n input.className = \"GPSexagesimal\";\n input.setAttribute(\"name\", \"degrees\");\n input.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input.readOnly = true;\n input.dataset.min = 0;\n input.dataset.max = coordType === \"Lon\" ? 180 : 90;\n if (editCoordinates) {\n input.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSDegrees(coordType, this);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input);\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionSexagesimalLabel\";\n span.innerHTML = \"°\";\n list.push(span);\n var input1 = document.createElement(\"input\");\n input1.id = this._addUID(\"GPmousePosition\" + coordType + \"Minutes\");\n input1.className = \"GPSexagesimal\";\n input1.setAttribute(\"name\", \"minutes\");\n input1.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input1.readOnly = true;\n input1.dataset.min = 0;\n input1.dataset.max = 59;\n if (editCoordinates) {\n input1.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input1.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSElement(this);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input1);\n var span1 = document.createElement(\"span\");\n span1.className = \"GPmousePositionSexagesimalLabel\";\n span1.innerHTML = \"'\";\n list.push(span1);\n var input2 = document.createElement(\"input\");\n input2.id = this._addUID(\"GPmousePosition\" + coordType + \"Seconds\");\n input2.className = \"GPSexagesimalsec\";\n input2.setAttribute(\"name\", \"seconds\");\n input2.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n input2.readOnly = true;\n input2.dataset.min = 0;\n input2.dataset.max = 59;\n if (editCoordinates) {\n input2.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(true);\n });\n input2.addEventListener(\"change\", function () {\n this.classList.remove(\"error\");\n var valid = context._checkDMSElement(this, true);\n valid ? this.classList.remove(\"error\") : this.classList.add(\"error\");\n });\n }\n list.push(input2);\n var span2 = document.createElement(\"span\");\n span2.className = \"GPmousePositionSexagesimalLabel\";\n span2.innerHTML = \"''\";\n list.push(span2);\n var select = document.createElement(\"select\");\n select.id = this._addUID(\"GPmousePosition\" + coordType + \"Direction\");\n select.className = \"GPmousePositionDirection\";\n select.setAttribute(\"name\", \"direction\");\n select.disabled = true;\n var option = document.createElement(\"option\");\n option.value = coordType === \"Lon\" ? \"E\" : \"N\";\n option.innerHTML = coordType === \"Lon\" ? \"E\" : \"N\";\n select.appendChild(option);\n var option1 = document.createElement(\"option\");\n option1.value = coordType === \"Lon\" ? \"O\" : \"S\";\n option1.innerHTML = coordType === \"Lon\" ? \"O\" : \"S\";\n select.appendChild(option1);\n list.push(select);\n return list;\n },\n /**\n * @param {Boolean} [display=false] - specifies if the coordinates panel must be displayed\n * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed\n * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelBasicCoordinateElement: function _createMousePositionPanelBasicCoordinateElement(display, editCoordinates, currentProjectionUnits) {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPmousePositionCoordinate\");\n div.style.display = display ? \"block\" : \"none\";\n\n // latitude\n var divLat = document.createElement(\"div\");\n var spanLat = document.createElement(\"span\");\n spanLat.className = \"GPmousePositionLabel\";\n spanLat.id = this._addUID(\"GPmousePositionLatLabel\");\n spanLat.innerHTML = \"Latitude : \";\n divLat.appendChild(spanLat);\n var span = document.createElement(\"span\");\n span.id = this._addUID(\"GPmousePositionLatCoordinate\");\n var arrayCoords;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords = this._createDMSCoordinateElement(\"Lat\", editCoordinates);\n } else {\n arrayCoords = this._createCoordinateElement(\"Lat\", editCoordinates);\n }\n for (var i = 0; i < arrayCoords.length; i++) {\n span.appendChild(arrayCoords[i]);\n }\n divLat.appendChild(span);\n div.appendChild(divLat);\n\n // longitude\n var divLon = document.createElement(\"div\");\n var spanLon = document.createElement(\"span\");\n spanLon.className = \"GPmousePositionLabel\";\n spanLon.id = this._addUID(\"GPmousePositionLonLabel\");\n spanLon.innerHTML = \"Longitude : \";\n divLon.appendChild(spanLon);\n var span1 = document.createElement(\"span\");\n span1.id = this._addUID(\"GPmousePositionLonCoordinate\");\n var arrayCoords1;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords1 = this._createDMSCoordinateElement(\"Lon\", editCoordinates);\n } else {\n arrayCoords1 = this._createCoordinateElement(\"Lon\", editCoordinates);\n }\n for (var j = 0; j < arrayCoords1.length; j++) {\n span1.appendChild(arrayCoords1[j]);\n }\n divLon.appendChild(span1);\n div.appendChild(divLon);\n return div;\n },\n /**\n * @param {Boolean} [display=false] - specifies if the altitude panel must be displayed\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelBasicAltitudeElement: function _createMousePositionPanelBasicAltitudeElement(display) {\n var div = document.createElement(\"div\");\n div.id = this._addUID(\"GPmousePositionAltitude\");\n div.style.display = display ? \"block\" : \"none\";\n var spanLabel = document.createElement(\"span\");\n spanLabel.className = \"GPmousePositionLabel\";\n spanLabel.innerHTML = \"Altitude : \";\n div.appendChild(spanLabel);\n var spanAlt = document.createElement(\"span\");\n spanAlt.className = \"GPmousePositionCoords\";\n spanAlt.id = this._addUID(\"GPmousePositionAlt\");\n spanAlt.innerHTML = \"...\";\n div.appendChild(spanAlt);\n var spanUnits = document.createElement(\"span\");\n spanUnits.className = \"GPmousePositionAltitudeUnits\";\n spanUnits.innerHTML = \"m\";\n div.appendChild(spanUnits);\n return div;\n },\n /**\n * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed\n *\n * @returns {DOMElement} container\n */\n _createMousePositionPanelEditToolsElement: function _createMousePositionPanelEditToolsElement(editCoordinates) {\n var context = this;\n var div = document.createElement(\"div\");\n div.className = \"GPmousePositionPanelEditTools\";\n div.id = this._addUID(\"GPmousePositionPanelEditTools\");\n if (!editCoordinates) {\n div.style.display = \"none\";\n }\n var span1 = document.createElement(\"span\");\n span1.className = \"GPmousePositionEditTool\";\n span1.id = this._addUID(\"GPmousePositionLocate\");\n span1.title = editCoordinates === true ? \"Cliquer pour saisir des coordonnées\" : \"\";\n if (editCoordinates) {\n span1.addEventListener(\"click\", function () {\n context.onMousePositionEditModeLocateClick();\n });\n }\n div.appendChild(span1);\n var span2 = document.createElement(\"span\");\n span2.className = \"GPmousePositionEditTool\";\n span2.id = this._addUID(\"GPmousePositionCloseEdit\");\n span2.title = \"Quitter la saisie des coordonnées\";\n span2.style.display = \"none\";\n if (editCoordinates) {\n span2.addEventListener(\"click\", function () {\n context.onMousePositionEditModeClick(false);\n });\n }\n div.appendChild(span2);\n return div;\n },\n // ################################################################### //\n // #################### Settings container ########################### //\n // ################################################################### //\n\n /**\n * @param {Boolean} [display=false] - specifies if the settings panel must be displayed\n *\n * @returns {DOMElement[]} array containing input and label elements\n */\n _createShowMousePositionSettingsElement: function _createShowMousePositionSettingsElement(display) {\n var list = [];\n var context = this;\n var input = document.createElement(\"input\");\n input.type = \"checkbox\";\n input.id = this._addUID(\"GPshowMousePositionSettings\");\n var label = document.createElement(\"label\");\n label.id = this._addUID(\"GPshowMousePositionSettingsPicto\");\n label.htmlFor = this._addUID(\"GPshowMousePositionSettings\");\n label.title = \"Réglages\";\n label.className = \"GPshowMoreOptionsImage GPshowMoreOptions GPshowMousePositionSettingsPicto\"; // FIXME classname and id ?\n label.style.display = display ? \"block\" : \"none\";\n if (label.addEventListener) {\n label.addEventListener(\"click\", function (e) {\n if (typeof context.onShowMousePositionSettingsClick === \"function\") {\n context.onShowMousePositionSettingsClick(e);\n }\n }, false);\n } else if (label.attachEvent) {\n label.attachEvent(\"onclick\", function (e) {\n if (typeof context.onShowMousePositionSettingsClick === \"function\") {\n context.onShowMousePositionSettingsClick(e);\n }\n });\n }\n list.push(input);\n list.push(label);\n return list;\n },\n /**\n * settings panel\n * @param {Boolean} [display=true] - specifies if the settings panel must be displayed\n *\n * FIXME\n * don't call this._createMousePositionSettingsSystemsElement\n * don't call this._createMousePositionSettingsUnitsElement\n *\n * @returns {DOMElement} DOM element\n */\n _createMousePositionSettingsElement: function _createMousePositionSettingsElement(display) {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPmousePositionSettings\");\n container.style.display = display === undefined || display ? \"block\" : \"none\";\n var span = document.createElement(\"span\");\n span.className = \"GPmousePositionSettingsLabel\";\n span.innerHTML = \"Système de référence\";\n container.appendChild(span);\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // FIXME tableau statique !\n // var systems = [\n // {\n // code : \"GEOGRAPHIC\",\n // label : \"Géographique\"\n // },\n // {\n // code : \"MERCATOR\",\n // label : \"Mercator\"\n // },\n // {\n // code : \"LAMB93\",\n // label : \"Lambert 93\"\n // },\n // {\n // code : \"LAMB2E\",\n // label : \"Lambert II étendu\"\n // }\n // ];\n //\n // var selectSystem = this._createMousePositionSettingsSystemsElement(systems);\n //\n // container.appendChild(selectSystem);\n\n // FIXME on decompose la fonction pour les besoins du controle,\n // on ajoutera ces childs à la main...\n // FIXME tableau statique !\n // var units = [\n // {\n // code : \"DEC\",\n // label : \"degrés décimaux\",\n // },\n // {\n // code : \"DMS\",\n // label : \"degrés sexagésimaux\",\n // },\n // {\n // code : \"RAD\",\n // label : \"radians\",\n // },\n // {\n // code : \"GON\",\n // label : \"grades\"\n // }\n // ];\n //\n // var selectUnits = this._createMousePositionSettingsUnitsElement(units);\n //\n // container.appendChild(selectUnits);\n\n return container;\n },\n /**\n * @param {Object[]} systems - list of systems\n *\n * @returns {DOMElement} DOM element select\n */\n _createMousePositionSettingsSystemsElement: function _createMousePositionSettingsSystemsElement(systems) {\n // contexte d'execution\n var context = this;\n var selectSystem = document.createElement(\"select\");\n selectSystem.id = this._addUID(\"GPmousePositionProjectionSystem\");\n selectSystem.className = \"GPinputSelect GPmousePositionSettingsSelect\";\n selectSystem.addEventListener(\"change\", function (e) {\n context.onMousePositionProjectionSystemChange(e);\n });\n selectSystem.addEventListener(\"mouseover\", function (e) {\n // FIXME mettre une condition si target === option\n if (e.target.nodeName !== \"OPTION\") {\n context.onMousePositionProjectionSystemMouseOver(e);\n }\n });\n for (var i = 0; i < systems.length; i++) {\n var obj = systems[i];\n var option = document.createElement(\"option\");\n option.value = obj.code;\n option.text = obj.label || i;\n // option.label = obj.label;\n selectSystem.appendChild(option);\n }\n return selectSystem;\n },\n /**\n * @param {Object[]} units - list of units\n *\n * @returns {DOMElement} DOM element select\n */\n _createMousePositionSettingsUnitsElement: function _createMousePositionSettingsUnitsElement(units) {\n // contexte d'execution\n var context = this;\n var selectUnits = document.createElement(\"select\");\n selectUnits.id = this._addUID(\"GPmousePositionProjectionUnits\");\n selectUnits.className = \"GPinputSelect GPmousePositionSettingsSelect\";\n selectUnits.addEventListener(\"change\", function (e) {\n context.onMousePositionProjectionUnitsChange(e);\n });\n for (var j = 0; j < units.length; j++) {\n var obj = units[j];\n var option = document.createElement(\"option\");\n option.value = obj.code ? obj.code : j;\n option.text = obj.label || j;\n // option.label = obj.label;\n selectUnits.appendChild(option);\n }\n return selectUnits;\n },\n /**\n * @param {String} [currentProjectionType=\"Metric\"] - \"Geographical\" or \"Metric\"\n */\n _resetLabelElements: function _resetLabelElements(currentProjectionType) {\n // Changement des labels dans le formulaire de saisie\n var spanLat = document.getElementById(this._addUID(\"GPmousePositionLatLabel\"));\n spanLat.innerHTML = currentProjectionType === \"Geographical\" ? \"Latitude :\" : \"X :\";\n var spanLon = document.getElementById(this._addUID(\"GPmousePositionLonLabel\"));\n spanLon.innerHTML = currentProjectionType === \"Geographical\" ? \"Longitude :\" : \"Y :\";\n },\n /**\n * @param {String} currentProjectionUnits - projection units\n */\n _resetUnitElements: function _resetUnitElements(currentProjectionUnits) {\n var value = \"\";\n if (currentProjectionUnits === \"M\" || currentProjectionUnits === \"KM\") {\n value = currentProjectionUnits.toLowerCase();\n }\n var elts = document.getElementsByClassName(\"GPmousePositionUnits\");\n for (var e = 0; e < elts.length; e++) {\n elts[e].innerHTML = value;\n }\n },\n /**\n * @param {Boolean} editCoordinates - edit coordinates option\n * @param {String} currentProjectionType - current projection type\n * @param {String} currentProjectionUnits - current projection unit\n */\n _resetCoordinateElements: function _resetCoordinateElements(editCoordinates, currentProjectionType, currentProjectionUnits) {\n // Suppression de tous les enfants de GPmousePositionLatCoordinate\n var latElt = document.getElementById(this._addUID(\"GPmousePositionLatCoordinate\"));\n while (latElt.firstChild) {\n latElt.removeChild(latElt.firstChild);\n }\n var arrayCoords;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords = this._createDMSCoordinateElement(\"Lat\", editCoordinates);\n } else {\n arrayCoords = this._createCoordinateElement(\"Lat\", editCoordinates);\n }\n for (var i = 0; i < arrayCoords.length; i++) {\n latElt.appendChild(arrayCoords[i]);\n }\n\n // Suppression de tous les enfants de GPmousePositionLonCoordinate\n var lonElt = document.getElementById(this._addUID(\"GPmousePositionLonCoordinate\"));\n while (lonElt.firstChild) {\n lonElt.removeChild(lonElt.firstChild);\n }\n var arrayCoords1;\n if (currentProjectionUnits === \"DMS\") {\n arrayCoords1 = this._createDMSCoordinateElement(\"Lon\", editCoordinates);\n } else {\n arrayCoords1 = this._createCoordinateElement(\"Lon\", editCoordinates);\n }\n for (var j = 0; j < arrayCoords1.length; j++) {\n lonElt.appendChild(arrayCoords1[j]);\n }\n\n // FIXME on simule un deplacement ?\n // this.onMapMove();\n },\n\n /**\n * Set/unset editing mode\n *\n * @param {Boolean} editing - active edit coordinates mode\n */\n _setEditMode: function _setEditMode(editing) {\n var locateElt = document.getElementById(this._addUID(\"GPmousePositionLocate\"));\n locateElt.title = editing ? \"Aller à la position ...\" : \"Cliquer pour saisir des coordonnées\";\n var closeEditElt = document.getElementById(this._addUID(\"GPmousePositionCloseEdit\"));\n closeEditElt.style.display = editing ? \"inline-block\" : \"none\";\n var selector = \"div[id^=\" + this._addUID(\"GPmousePositionCoordinate\") + \"]\";\n var inputs = document.querySelectorAll(selector + \" input\");\n for (var i = 0; i < inputs.length; i++) {\n inputs[i].readOnly = !editing;\n if (editing) {\n inputs[i].value = \"\";\n inputs[i].classList.remove(\"error\");\n }\n }\n var selects = document.querySelectorAll(selector + \" select\");\n for (var j = 0; j < selects.length; j++) {\n selects[j].disabled = !editing;\n }\n },\n /**\n *\n * @param {DOMElement} input - input element\n * @param {Boolean} isFloat - check for float value\n *\n * @returns {Boolean} true if input value is within bounds\n */\n _checkDMSElement: function _checkDMSElement(input, isFloat) {\n var b = isFloat !== undefined;\n var value = input.value;\n if (b) {\n value = value.replace(\",\", \".\");\n }\n if (isNaN(value)) {\n return false;\n }\n var v = parseFloat(value);\n if (!b && (v | 0) !== v) {\n // is it an integer\n return false;\n }\n var min = Number(input.dataset.min);\n var max = Number(input.dataset.max);\n return v >= min && v <= max;\n },\n /**\n * @param {String} coordType - \"Lon\" or \"Lat\"\n * @param {DOMElement} input - input element\n *\n * @returns {Boolean} true if input value is within bounds\n */\n _checkDMSDegrees: function _checkDMSDegrees(coordType, input) {\n if (isNaN(input.value)) {\n return false;\n }\n var v = parseFloat(input.value);\n if ((v | 0) !== v) {\n // is it an integer\n return false;\n }\n var min = Number(input.dataset.min);\n var max = Number(input.dataset.max);\n if (v < min || v > max) {\n return false;\n }\n var inputMinutes = document.getElementById(this._addUID(\"GPmousePosition\" + coordType + \"Minutes\"));\n var inputSeconds = document.getElementById(this._addUID(\"GPmousePosition\" + coordType + \"Seconds\"));\n if (v >= max) {\n inputMinutes.dataset.max = 0;\n inputSeconds.dataset.max = 0;\n } else {\n inputMinutes.dataset.max = 59;\n inputSeconds.dataset.max = 59.9999;\n }\n return true;\n },\n // ################################################################### //\n // ####################### handlers Event ############################ //\n // ################################################################### //\n\n /**\n * Function displaying coordinates from cursor position (desktop)\n * or map center (tactile)\n * @param {Object} coordinate - coordinates\n */\n GPdisplayCoords: function GPdisplayCoords(coordinate) {\n // Compute coords in case of cursor position (desktop)\n if (coordinate) {\n var labelLon = document.getElementById(this._addUID(\"GPmousePositionLonLabel\"));\n var labelLat = document.getElementById(this._addUID(\"GPmousePositionLatLabel\"));\n if (coordinate.x || coordinate.y) {\n labelLat.innerHTML = \"X : \";\n labelLon.innerHTML = \"Y : \";\n } else if (coordinate.e || coordinate.n) {\n labelLat.innerHTML = \"E : \";\n labelLon.innerHTML = \"N : \";\n } else {\n labelLat.innerHTML = \"Latitude : \";\n labelLon.innerHTML = \"Longitude : \";\n }\n if (_typeof(coordinate.lat) === \"object\" && _typeof(coordinate.lng) === \"object\") {\n var parts = {\n lng: \"Lon\",\n lat: \"Lat\"\n };\n var units = [\"Degrees\", \"Minutes\", \"Seconds\"];\n for (var p in parts) {\n for (var u = 0; u < units.length; ++u) {\n var selector = \"GPmousePosition\" + parts[p] + units[u];\n var elt = document.getElementById(this._addUID(selector));\n var key = units[u].charAt(0).toLowerCase();\n elt.value = coordinate[p][key];\n }\n }\n // directions\n document.getElementById(this._addUID(\"GPmousePositionLonDirection\")).value = coordinate.lng.direction;\n document.getElementById(this._addUID(\"GPmousePositionLatDirection\")).value = coordinate.lat.direction;\n } else {\n var elLat = document.getElementById(this._addUID(\"GPmousePositionLat\"));\n var elLon = document.getElementById(this._addUID(\"GPmousePositionLon\"));\n elLat.value = coordinate.x || coordinate.lat || coordinate.e || \"0\";\n elLon.value = coordinate.y || coordinate.lng || coordinate.lon || coordinate.n || \"0\";\n\n // les unites\n var unit = coordinate.unit === undefined ? \"\" : coordinate.unit;\n var elements = document.getElementsByClassName(\"GPmousePositionUnits\");\n for (var n = 0; n < elements.length; ++n) {\n elements[n].innerHTML = unit;\n }\n }\n }\n },\n /**\n * Function displaying altitude from cursor position (desktop)\n * or map center (tactile)\n * @param {Object} coordinate - coordinates\n * @param {Number} altitudeTimeoutDelay - when the mouse stop moving, delay before the altitude request is launched\n * @param {Number} noDataValue - the no data value\n * @param {Number} noDataValueTolerance - the no data value tolerance\n */\n GPdisplayElevation: function GPdisplayElevation(coordinate, altitudeTimeoutDelay, noDataValue, noDataValueTolerance) {\n // contexte d'execution\n var self = this;\n\n // Latency for altitude request\n var altitudeTimeout;\n if (!altitudeTimeoutDelay) {\n altitudeTimeoutDelay = 500;\n }\n clearTimeout(altitudeTimeout);\n document.getElementById(this._addUID(\"GPmousePositionAlt\")).innerHTML = \"...\";\n if (noDataValue == null) {\n noDataValue = -99999;\n }\n if (noDataValueTolerance == null) {\n noDataValueTolerance = 99980;\n }\n var maxThreshold = noDataValue + noDataValueTolerance;\n var minThreshold = noDataValue - noDataValueTolerance;\n\n // Compute coords in case of cursor position (desktop)\n if (coordinate) {\n // If no altitude panel, don't call altitude request\n if (document.getElementById(this._addUID(\"GPmousePositionAltitude\"))) {\n altitudeTimeout = setTimeout(function () {\n self.onRequestAltitude(coordinate, function (z) {\n if (minThreshold < z && z < maxThreshold) {\n self.GPresetElevation();\n } else {\n document.getElementById(self._addUID(\"GPmousePositionAlt\")).innerHTML = z;\n }\n });\n }, altitudeTimeoutDelay);\n }\n }\n },\n /**\n * Function reseting altitude value\n */\n GPresetElevation: function GPresetElevation() {\n if (document.getElementById(this._addUID(\"GPmousePositionAltitude\"))) {\n document.getElementById(this._addUID(\"GPmousePositionAlt\")).innerHTML = \"---\";\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MousePositionDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvTW91c2VQb3NpdGlvbkRPTS5qcz8xNjljIl0sIm5hbWVzIjpbIk1vdXNlUG9zaXRpb25ET00iLCJfYWRkVUlEIiwiaWQiLCJ1aWQiLCJfdWlkIiwiX2NyZWF0ZU1haW5Db250YWluZXJFbGVtZW50IiwiY29udGFpbmVyIiwiZG9jdW1lbnQiLCJjcmVhdGVFbGVtZW50IiwiY2xhc3NOYW1lIiwiX2NyZWF0ZVNob3dNb3VzZVBvc2l0aW9uRWxlbWVudCIsImlucHV0IiwidHlwZSIsIl9jcmVhdGVTaG93TW91c2VQb3NpdGlvblBpY3RvRWxlbWVudCIsImlzRGVza3RvcCIsInNlbGYiLCJsYWJlbCIsImh0bWxGb3IiLCJ0aXRsZSIsImFkZEV2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biAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJMQU1COTNcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiTGFtYmVydCA5M1wiXG4gICAgICAgIC8vICAgICB9LFxuICAgICAgICAvLyAgICAge1xuICAgICAgICAvLyAgICAgICAgIGNvZGUgOiBcIkxBTUIyRVwiLFxuICAgICAgICAvLyAgICAgICAgIGxhYmVsIDogXCJMYW1iZXJ0IElJIMOpdGVuZHVcIlxuICAgICAgICAvLyAgICAgfVxuICAgICAgICAvLyBdO1xuICAgICAgICAvL1xuICAgICAgICAvLyB2YXIgc2VsZWN0U3lzdGVtID0gdGhpcy5fY3JlYXRlTW91c2VQb3NpdGlvblNldHRpbmdzU3lzdGVtc0VsZW1lbnQoc3lzdGVtcyk7XG4gICAgICAgIC8vXG4gICAgICAgIC8vIGNvbnRhaW5lci5hcHBlbmRDaGlsZChzZWxlY3RTeXN0ZW0pO1xuXG4gICAgICAgIC8vIEZJWE1FIG9uIGRlY29tcG9zZSBsYSBmb25jdGlvbiBwb3VyIGxlcyBiZXNvaW5zIGR1IGNvbnRyb2xlLFxuICAgICAgICAvLyBvbiBham91dGVyYSBjZXMgY2hpbGRzIMOgIGxhIG1haW4uLi5cbiAgICAgICAgLy8gRklYTUUgdGFibGVhdSBzdGF0aXF1ZSAhXG4gICAgICAgIC8vIHZhciB1bml0cyA9IFtcbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBjb2RlIDogXCJERUNcIixcbiAgICAgICAgLy8gICAgICAgICBsYWJlbCA6IFwiZGVncsOpcyBkw6ljaW1hdXhcIixcbiAgICAgICAgLy8gICAgIH0sXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgY29kZSA6IFwiRE1TXCIsXG4gICAgICAgIC8vICAgICAgICAgbGFiZWwgOiBcImRlZ3LDqXMgc2V4YWfDqXNpbWF1eFwiLFxuICAgICAgICAvLyAgICAgfSxcbiAgICAgICAgLy8g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vbiAoZGVza3RvcClcbiAgICAgICAgaWYgKGNvb3JkaW5hdGUpIHtcbiAgICAgICAgICAgIHZhciBsYWJlbExvbiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxvbkxhYmVsXCIpKTtcbiAgICAgICAgICAgIHZhciBsYWJlbExhdCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxhdExhYmVsXCIpKTtcblxuICAgICAgICAgICAgaWYgKGNvb3JkaW5hdGUueCB8fCBjb29yZGluYXRlLnkpIHtcbiAgICAgICAgICAgICAgICBsYWJlbExhdC5pbm5lckhUTUwgPSBcIlggOiBcIjtcbiAgICAgICAgICAgICAgICBsYWJlbExvbi5pbm5lckhUTUwgPSBcIlkgOiBcIjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29vcmRpbmF0ZS5lIHx8IGNvb3JkaW5hdGUubikge1xuICAgICAgICAgICAgICAgIGxhYmVsTGF0LmlubmVySFRNTCA9IFwiRSA6IFwiO1xuICAgICAgICAgICAgICAgIGxhYmVsTG9uLmlubmVySFRNTCA9IFwiTiA6IFwiO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsYWJlbExhdC5pbm5lckhUTUwgPSBcIkxhdGl0dWRlIDogXCI7XG4gICAgICAgICAgICAgICAgbGFiZWxMb24uaW5uZXJIVE1MID0gXCJMb25naXR1ZGUgOiBcIjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBjb29yZGluYXRlLmxhdCA9PT0gXCJvYmplY3RcIiAmJiB0eXBlb2YgY29vcmRpbmF0ZS5sbmcgPT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFydHMgPSB7XG4gICAgICAgICAgICAgICAgICAgIGxuZyA6IFwiTG9uXCIsXG4gICAgICAgICAgICAgICAgICAgIGxhdCA6IFwiTGF0XCJcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciB1bml0cyA9IFtcIkRlZ3JlZXNcIiwgXCJNaW51dGVzXCIsIFwiU2Vjb25kc1wiXTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwIGluIHBhcnRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHUgPSAwOyB1IDwgdW5pdHMubGVuZ3RoOyArK3UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RvciA9IFwiR1Btb3VzZVBvc2l0aW9uXCIgKyBwYXJ0c1twXSArIHVuaXRzW3VdO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsdCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChzZWxlY3RvcikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleSA9IHVuaXRzW3VdLmNoYXJBdCgwKS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWx0LnZhbHVlID0gY29vcmRpbmF0ZVtwXVtrZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGRpcmVjdGlvbnNcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCh0aGlzLl9hZGRVSUQoXCJHUG1vdXNlUG9zaXRpb25Mb25EaXJlY3Rpb25cIikpLnZhbHVlID0gY29vcmRpbmF0ZS5sbmcuZGlyZWN0aW9uO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkxhdERpcmVjdGlvblwiKSkudmFsdWUgPSBjb29yZGluYXRlLmxhdC5kaXJlY3Rpb247XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgIC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GRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNlbGYuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkFsdFwiKSkuaW5uZXJIVE1MID0gejtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgYWx0aXR1ZGVUaW1lb3V0RGVsYXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIEZ1bmN0aW9uIHJlc2V0aW5nIGFsdGl0dWRlIHZhbHVlXG4gICAgICovXG4gICAgR1ByZXNldEVsZXZhdGlvbiA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHRoaXMuX2FkZFVJRChcIkdQbW91c2VQb3NpdGlvbkFsdGl0dWRlXCIpKSkge1xuICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQodGhpcy5fYWRkVUlEKFwiR1Btb3VzZVBvc2l0aW9uQWx0XCIpKS5pbm5lckhUTUwgPSBcIi0tLVwiO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgTW91c2VQb3NpdGlvbkRPTTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/Controls/MousePositionDOM.js\n"); + +/***/ }), + +/***/ "./src/Common/Controls/ScaleDOM.js": +/*!*****************************************!*\ + !*** ./src/Common/Controls/ScaleDOM.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar ScaleDOM = {\n /**\n * Add uuid to the tag ID\n * @param {String} id - id selector\n * @returns {String} uid - id selector with an unique id\n */\n _addUID: function _addUID(id) {\n var uid = this._uid ? id + \"-\" + this._uid : id;\n return uid;\n },\n /**\n * Main container (DOM)\n *\n * @returns {DOMElement} DOM element\n */\n _createMainContainerElement: function _createMainContainerElement() {\n var container = document.createElement(\"div\");\n container.id = this._addUID(\"GPscaleContainer\");\n container.className = \"GPwidget\";\n return container;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ScaleDOM);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vQ29udHJvbHMvU2NhbGVET00uanM/ZTM3MiJdLCJuYW1lcyI6WyJTY2FsZURPTSIsIl9hZGRVSUQiLCJpZCIsInVpZCIsIl91aWQiLCJfY3JlYXRlTWFpbkNvbnRhaW5lckVsZW1lbnQiLCJjb250YWluZXIiLCJkb2N1bWVudCIsImNyZWF0ZUVsZW1lbnQiLCJjbGFzc05hbWUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUEsSUFBSUEsUUFBUSxHQUFHO0VBRVg7QUFDSjtBQUNBO0FBQ0E7QUFDQTtFQUNJQyxPQUFPLEVBQUcsU0FBQUEsUUFBVUMsRUFBRSxFQUFFO0lBQ3BCLElBQUlDLEdBQUcsR0FBSSxJQUFJLENBQUNDLElBQUksR0FBSUYsRUFBRSxHQUFHLEdBQUcsR0FBRyxJQUFJLENBQUNFLElBQUksR0FBR0YsRUFBRTtJQUNqRCxPQUFPQyxHQUFHO0VBQ2QsQ0FBQztFQUVEO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7RUFDSUUsMkJBQTJCLEVBQUcsU0FBQUEsNEJBQUEsRUFBWTtJQUN0QyxJQUFJQyxTQUFTLEdBQUdDLFFBQVEsQ0FBQ0MsYUFBYSxDQUFDLEtBQUssQ0FBQztJQUM3Q0YsU0FBUyxDQUFDSixFQUFFLEdBQUcsSUFBSSxDQUFDRCxPQUFPLENBQUMsa0JBQWtCLENBQUM7SUFDL0NLLFNBQVMsQ0FBQ0csU0FBUyxHQUFHLFVBQVU7SUFDaEMsT0FBT0gsU0FBUztFQUNwQjtBQUNKLENBQUM7QUFFY04sdUVBQVEiLCJmaWxlIjoiLi9zcmMvQ29tbW9uL0NvbnRyb2xzL1NjYWxlRE9NLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIFNjYWxlRE9NID0ge1xuXG4gICAgLyoqXG4gICAgKiBBZGQgdXVpZCB0byB0aGUgdGFnIElEXG4gICAgKiBAcGFyYW0ge1N0cmluZ30gaWQgLSBpZCBzZWxlY3RvclxuICAgICogQHJldHVybnMge1N0cmluZ30gdWlkIC0gaWQgc2VsZWN0b3Igd2l0aCBhbiB1bmlxdWUgaWRcbiAgICAqL1xuICAgIF9hZGRVSUQgOiBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgdmFyIHVpZCA9ICh0aGlzLl91aWQpID8gaWQgKyBcIi1cIiArIHRoaXMuX3VpZCA6IGlkO1xuICAgICAgICByZXR1cm4gdWlkO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBNYWluIGNvbnRhaW5lciAoRE9NKVxuICAgICAqXG4gICAgICogQHJldHVybnMge0RPTUVsZW1lbnR9IERPTSBlbGVtZW50XG4gICAgICovXG4gICAgX2NyZWF0ZU1haW5Db250YWluZXJFbGVtZW50IDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgY29udGFpbmVyLmlkID0gdGhpcy5fYWRkVUlEKFwiR1BzY2FsZUNvbnRhaW5lclwiKTtcbiAgICAgICAgY29udGFpbmVyLmNsYXNzTmFtZSA9IFwiR1B3aWRnZXRcIjtcbiAgICAgICAgcmV0dXJuIGNvbnRhaW5lcjtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBTY2FsZURPTTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/Controls/ScaleDOM.js\n"); + +/***/ }), + +/***/ "./src/Common/Styles.js": +/*!******************************!*\ + !*** ./src/Common/Styles.js ***! + \******************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CSS_GPboostRelief_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CSS/GPboostRelief.css */ \"./src/Common/CSS/GPboostRelief.css\");\n/* harmony import */ var _CSS_GPboostRelief_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPboostRelief_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _CSS_GPbuildings_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CSS/GPbuildings.css */ \"./src/Common/CSS/GPbuildings.css\");\n/* harmony import */ var _CSS_GPbuildings_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPbuildings_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _CSS_GPdrawing_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CSS/GPdrawing.css */ \"./src/Common/CSS/GPdrawing.css\");\n/* harmony import */ var _CSS_GPdrawing_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPdrawing_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _CSS_GPelevationPath_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CSS/GPelevationPath.css */ \"./src/Common/CSS/GPelevationPath.css\");\n/* harmony import */ var _CSS_GPelevationPath_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPelevationPath_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _CSS_GPgeneralWidget_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CSS/GPgeneralWidget.css */ \"./src/Common/CSS/GPgeneralWidget.css\");\n/* harmony import */ var _CSS_GPgeneralWidget_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPgeneralWidget_css__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _CSS_GPgetFeatureInfo_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CSS/GPgetFeatureInfo.css */ \"./src/Common/CSS/GPgetFeatureInfo.css\");\n/* harmony import */ var _CSS_GPgetFeatureInfo_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPgetFeatureInfo_css__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _CSS_GPisochron_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CSS/GPisochron.css */ \"./src/Common/CSS/GPisochron.css\");\n/* harmony import */ var _CSS_GPisochron_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPisochron_css__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _CSS_GPlayerSwitcher_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CSS/GPlayerSwitcher.css */ \"./src/Common/CSS/GPlayerSwitcher.css\");\n/* harmony import */ var _CSS_GPlayerSwitcher_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPlayerSwitcher_css__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _CSS_GPlocation_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CSS/GPlocation.css */ \"./src/Common/CSS/GPlocation.css\");\n/* harmony import */ var _CSS_GPlocation_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPlocation_css__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _CSS_GPmeasureArea_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CSS/GPmeasureArea.css */ \"./src/Common/CSS/GPmeasureArea.css\");\n/* harmony import */ var _CSS_GPmeasureArea_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureArea_css__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _CSS_GPmeasureAzimuth_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./CSS/GPmeasureAzimuth.css */ \"./src/Common/CSS/GPmeasureAzimuth.css\");\n/* harmony import */ var _CSS_GPmeasureAzimuth_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureAzimuth_css__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _CSS_GPmeasureLength_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./CSS/GPmeasureLength.css */ \"./src/Common/CSS/GPmeasureLength.css\");\n/* harmony import */ var _CSS_GPmeasureLength_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureLength_css__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _CSS_GPmeasureToolTip_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CSS/GPmeasureToolTip.css */ \"./src/Common/CSS/GPmeasureToolTip.css\");\n/* harmony import */ var _CSS_GPmeasureToolTip_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureToolTip_css__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _CSS_GPmousePosition_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./CSS/GPmousePosition.css */ \"./src/Common/CSS/GPmousePosition.css\");\n/* harmony import */ var _CSS_GPmousePosition_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmousePosition_css__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _CSS_GPreverseGeocoding_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./CSS/GPreverseGeocoding.css */ \"./src/Common/CSS/GPreverseGeocoding.css\");\n/* harmony import */ var _CSS_GPreverseGeocoding_css__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPreverseGeocoding_css__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var _CSS_GProute_css__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CSS/GProute.css */ \"./src/Common/CSS/GProute.css\");\n/* harmony import */ var _CSS_GProute_css__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_CSS_GProute_css__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var _CSS_GPsearchEngine_css__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./CSS/GPsearchEngine.css */ \"./src/Common/CSS/GPsearchEngine.css\");\n/* harmony import */ var _CSS_GPsearchEngine_css__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPsearchEngine_css__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var _CSS_GPwaiting_css__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./CSS/GPwaiting.css */ \"./src/Common/CSS/GPwaiting.css\");\n/* harmony import */ var _CSS_GPwaiting_css__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPwaiting_css__WEBPACK_IMPORTED_MODULE_17__);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vU3R5bGVzLmpzP2QzOWIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQT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G1lYXN1cmVUb29sVGlwLmNzc1wiO1xuaW1wb3J0IFwiLi9DU1MvR1Btb3VzZVBvc2l0aW9uLmNzc1wiO1xuaW1wb3J0IFwiLi9DU1MvR1ByZXZlcnNlR2VvY29kaW5nLmNzc1wiO1xuaW1wb3J0IFwiLi9DU1MvR1Byb3V0ZS5jc3NcIjtcbmltcG9ydCBcIi4vQ1NTL0dQc2VhcmNoRW5naW5lLmNzc1wiO1xuaW1wb3J0IFwiLi9DU1MvR1B3YWl0aW5nLmNzc1wiO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Styles.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils.js": +/*!*****************************!*\ + !*** ./src/Common/Utils.js ***! + \*****************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n* @module Utils\n* @alias Gp.olUtils\n* @description\n* ...\n*\n* @example\n* detectSupport();\n* assign();\n* mergeParams();\n*/\nvar Utils = {\n /**\n * this method is called by the constructor.\n * this information is useful to switch to touch mode.\n * Detection : test for desktop or tactile\n *\n * @function detectSupport\n * @returns {Boolean} isDesktop - true for desktop userAgent, false for mobile\n */\n detectSupport: function detectSupport() {\n var isDesktop = true;\n var userAgent = window.navigator.userAgent.toLowerCase();\n if (userAgent.indexOf(\"iphone\") !== -1 || userAgent.indexOf(\"ipod\") !== -1 || userAgent.indexOf(\"ipad\") !== -1 || userAgent.indexOf(\"android\") !== -1 || userAgent.indexOf(\"mobile\") !== -1 || userAgent.indexOf(\"blackberry\") !== -1 || userAgent.indexOf(\"tablet\") !== -1 || userAgent.indexOf(\"phone\") !== -1 || userAgent.indexOf(\"touch\") !== -1) {\n isDesktop = false;\n }\n if (userAgent.indexOf(\"msie\") !== -1 || userAgent.indexOf(\"trident\") !== -1) {\n isDesktop = true;\n }\n return isDesktop;\n },\n /**\n * Copies all source object members to dest\n *\n * @function assign\n * @param {Object} dest - destination object where properties and method will be copied\n * @param {Object} source - source object from which properties and method will be copied\n * @returns {Object} dest\n */\n assign: function assign(dest, source) {\n dest = dest || {};\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n dest[prop] = source[prop];\n }\n }\n return dest;\n },\n /**\n * Merge two objects parameters (deeper than assign)\n *\n * @function mergeParams\n * @param {Object} dest - destination object where properties and method will be merge\n * @param {Object} source - source object from which properties and method will be merge\n * @param {Boolean} replace - replace destination value by source if exists or not (true by default)\n */\n mergeParams: function mergeParams(dest, source, replace) {\n if (!dest || !source) {\n return;\n }\n if (typeof replace === \"undefined\") {\n replace = true;\n }\n for (var param in source) {\n if (source.hasOwnProperty(param)) {\n if (_typeof(source[param]) === \"object\") {\n if (dest.hasOwnProperty(param)) {\n this.mergeParams(dest[param], source[param], replace);\n } else {\n dest[param] = source[param];\n }\n } else {\n if (dest.hasOwnProperty(param)) {\n if (replace) {\n dest[param] = source[param];\n }\n } else {\n dest[param] = source[param];\n }\n }\n }\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Utils);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMuanM/MTM1ZSJdLCJuYW1lcyI6WyJVdGlscyIsImRldGVjdFN1cHBvcnQiLCJpc0Rlc2t0b3AiLCJ1c2VyQWdlbnQiLCJ3aW5kb3ciLCJuYXZpZ2F0b3IiLCJ0b0xvd2VyQ2FzZSIsImluZGV4T2YiLCJhc3NpZ24iLCJkZXN0Iiwic291cmNlIiwicHJvcCIsImhhc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XG4gICAgICAgICAgICB1c2VyQWdlbnQuaW5kZXhPZihcInBob25lXCIpICE9PSAtMSB8fFxuICAgICAgICAgICAgdXNlckFnZW50LmluZGV4T2YoXCJ0b3VjaFwiKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIGlzRGVza3RvcCA9IGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHVzZXJBZ2VudC5pbmRleE9mKFwibXNpZVwiKSAhPT0gLTEgfHxcbiAgICAgICAgICAgIHVzZXJBZ2VudC5pbmRleE9mKFwidHJpZGVudFwiKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIGlzRGVza3RvcCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaXNEZXNrdG9wO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiAgQ29waWVzIGFsbCBzb3VyY2Ugb2JqZWN0IG1lbWJlcnMgdG8gZGVzdFxuICAgICAqXG4gICAgICogQGZ1bmN0aW9uIGFzc2lnblxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBkZXN0IC0gZGVzdGluYXRpb24gb2JqZWN0IHdoZXJlIHByb3BlcnRpZXMgYW5kIG1ldGhvZCB3aWxsIGJlIGNvcGllZFxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBzb3VyY2UgLSBzb3VyY2Ugb2JqZWN0IGZyb20gd2hpY2ggcHJvcGVydGllcyBhbmQgbWV0aG9kIHdpbGwgYmUgY29waWVkXG4gICAgICogQHJldHVybnMge09iamVjdH0gZGVzdFxuICAgICAqL1xuICAgIGFzc2lnbiA6IGZ1bmN0aW9uIChkZXN0LCBzb3VyY2UpIHtcbiAgICAgICAgZGVzdCA9IGRlc3QgfHwge307XG4gICAgICAgIGZvciAodmFyIHByb3AgaW4gc291cmNlKSB7XG4gICAgICAgICAgICBpZiAoc291cmNlLmhhc093blByb3BlcnR5KHByb3ApKSB7XG4gICAgICAgICAgICAgICAgZGVzdFtwcm9wXSA9IHNvdXJjZVtw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ICAgICAgICBpZiAoZGVzdC5oYXNPd25Qcm9wZXJ0eShwYXJhbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubWVyZ2VQYXJhbXMoZGVzdFtwYXJhbV0sIHNvdXJjZVtwYXJhbV0sIHJlcGxhY2UpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtwYXJhbV0gPSBzb3VyY2VbcGFyYW1dO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRlc3QuaGFzT3duUHJvcGVydHkocGFyYW0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVwbGFjZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbcGFyYW1dID0gc291cmNlW3BhcmFtXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbcGFyYW1dID0gc291cmNlW3BhcmFtXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFV0aWxzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Utils.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/AutoLoadConfig.js": +/*!********************************************!*\ + !*** ./src/Common/Utils/AutoLoadConfig.js ***! + \********************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n\n(function () {\n var scripts = document.getElementsByTagName(\"script\");\n var key = scripts[scripts.length - 1].getAttribute(\"data-key\");\n var url = scripts[scripts.length - 1].getAttribute(\"data-url\");\n var timeout = scripts[scripts.length - 1].getAttribute(\"data-timeout\");\n\n // callback\n var success = function success() {\n // Pas de messages en mode prod\n // console.log(\"GetConfig success!\");\n };\n\n // callback\n var error = function error(e) {\n throw new Error(\"Configuration load failed : \" + e.message);\n };\n if (!key && !url) {\n // pas de message d'information !\n // console.log(\"WARNING : parameters missing 'data-key' and 'data-url', the loading of configuration can not be done !\");\n return;\n }\n var options = {\n apiKey: key,\n sync: true,\n onSuccess: success,\n onFailure: error\n };\n if (url) {\n options.customConfigFile = url;\n options.callbackSuffix = \"\";\n }\n if (timeout) {\n options.timeOut = timeout;\n }\n\n // test d'existance de la varibale globale Gp.Config\n if (!window.Gp) {\n // appel du service\n geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Services.getConfig(options);\n }\n})();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvQXV0b0xvYWRDb25maWcuanM/ODA0YyJdLCJuYW1lcyI6WyJzY3JpcHRzIiwiZG9jdW1lbnQiLCJnZXRFbGVtZW50c0J5VGFnTmFtZSIsImtleSIsImxlbmd0aCIsImdldEF0dHJpYnV0ZSIsInVybCIsInRpbWVvdXQiLCJzdWNjZXNzIiwiZXJyb3IiLCJlIiwiRXJyb3IiLCJtZXNzYWdlIiwib3B0aW9ucyIsImFwaUtleSIsInN5bmMiLCJvblN1Y2Nlc3MiLCJvbkZhaWx1cmUiLCJjdXN0b21Db25maWdGaWxlIiwiY2FsbGJhY2tTdWZmaXgiLCJ0aW1lT3V0Iiwid2luZG93IiwiR3AiLCJTZXJ2aWNlcyIsImdldENvbmZpZyJdLCJtYXBwaW5ncyI6IkF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O1xuICAgIH1cbn0pKCk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/Utils/AutoLoadConfig.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/ColorUtils.js": +/*!****************************************!*\ + !*** ./src/Common/Utils/ColorUtils.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ColorUtils\n * @alias Gp.ColorUtils\n * @description\n * ...\n *\n * @example\n * arrayTorgba();\n * arrayToHex();\n * rgbaToHex();\n * hexToRgba();\n * isHex();\n * isRGB();\n */\nvar ColorUtils = {\n /**\n * Number to hex conversion\n *\n * @param {Number} number - 0-255\n * @returns {String} hex value\n */\n hex: function hex(number) {\n if (number > 255) {\n throw new Error(\"'\" + number + \"'' is greater than 255(0xff);\");\n }\n var str = Number(number).toString(16);\n return (\"0\" + str).slice(-2);\n },\n /**\n * Hexa to number conversion\n *\n * @param {*} hexa 00-FF\n * @returns {Number} number value\n */\n num: function num(hexa) {\n return parseInt(hexa, 16);\n },\n /**\n * Converts an array ([255,255,255,1]) to rgba string\n *\n * @function arrayToRgba\n * @param {Array} values - array of values\n * @returns {String} A color of RGB or RGBA format\n */\n arrayToRgba: function arrayToRgba(values) {\n if (!Array.isArray(values)) {\n throw new Error(\"Not an array !\");\n }\n var red = values[0];\n var green = values[1];\n var blue = values[2];\n var alpha = values[3] || 1;\n var result = \"rgba(\" + red + \", \" + green + \", \" + blue + \", \" + parseFloat(alpha) + \")\";\n return result;\n },\n /**\n * Converts an array ([255,255,255,1]) to #RRGGBBAA\n *\n * @function arrayToHex\n * @param {Array} values - array of values\n * @returns {Object} hex and opacity formated values\n */\n arrayToHex: function arrayToHex(values) {\n if (!Array.isArray(values)) {\n throw new Error(\"Not an array !\");\n }\n var red = values[0];\n var green = values[1];\n var blue = values[2];\n var alpha = values[3];\n var elems = [this.hex(red), this.hex(green), this.hex(blue)];\n var result = {};\n result.hex = \"#\" + elems.join(\"\");\n if (alpha) {\n // elems.push(hex(alpha));\n result.opacity = parseFloat(alpha);\n }\n return result;\n },\n /**\n * Converts rgba string to #RRGGBBAA\n * (Code adapted from : https://gist.github.com/mstssk/afda4ce9e5c335fd79cd)\n *\n * @function rgbaToHex\n * @param {String} rgba - A color of RGB or RGBA format.\n * @returns {Object} hex and opacity formated values\n */\n rgbaToHex: function rgbaToHex(rgba) {\n var regex = /rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(0?.?\\d+)\\s*)?\\)/;\n var parsed = regex.exec(rgba);\n if (!parsed) {\n throw new Error(\"Invalid format: \" + rgba);\n }\n var red = parsed[1];\n var green = parsed[2];\n var blue = parsed[3];\n var alpha = parsed[4];\n var elems = [this.hex(red), this.hex(green), this.hex(blue)];\n var result = {};\n result.hex = \"#\" + elems.join(\"\");\n if (alpha) {\n // elems.push(hex(alpha));\n result.opacity = parseFloat(alpha);\n }\n return result;\n },\n /**\n * Converts hex color and opacity value to rgba string.\n * (Code adapted from : http://stackoverflow.com/a/5624139)\n *\n * @function hexToRgba\n * @param {String} hex - A color value on RGB format (hexa).\n * @param {Number} opacity - A opacity value.\n * @returns {String} A color of RGB or RGBA format\n */\n hexToRgba: function hexToRgba(hex, opacity) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n if (!hex) {\n throw new Error(\"Invalid format\");\n }\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n var rgb = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n rgb = rgb ? {\n r: parseInt(rgb[1], 16),\n g: parseInt(rgb[2], 16),\n b: parseInt(rgb[3], 16)\n } : null;\n var result = rgb ? \"rgba(\" + rgb.r + \", \" + rgb.g + \", \" + rgb.b + \", \" + opacity + \")\" : null;\n return result;\n },\n /**\n * Determine if value is a correct hexa color.\n * @param {*} value - hex color (#FFFFFF)\n * @returns {Boolean} True if value is a hexa color\n */\n isHex: function isHex(value) {\n if (!value) {\n return false;\n }\n if (value.charAt(0) !== \"#\") {\n return false;\n }\n var regex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i;\n var parsed = regex.exec(value);\n if (!parsed) {\n return false;\n }\n return true;\n },\n /**\n * Determine if value is a correct rgba color.\n * @param {*} value - rgba color (rgba(125,125,125,1))\n * @returns {Boolean} True if value is a rgba color\n */\n isRGB: function isRGB(value) {\n if (!value) {\n return false;\n }\n var regex = /rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(0?.?\\d+)\\s*)?\\)/;\n var parsed = regex.exec(value);\n if (!parsed) {\n return false;\n }\n return true;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ColorUtils);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvQ29sb3JVdGlscy5qcz8zYjhkIl0sIm5hbWVzIjpbIkNvbG9yVXRpbHMiLCJoZXgiLCJudW1iZXIiLCJFcnJvciIsInN0ciIsIk51bWJlciIsInRvU3RyaW5nIiwic2xpY2UiLCJudW0iLCJoZXhhIiwicGFyc2VJbnQiLCJhcnJheVRvUmdiYSIsInZhbHVlcyIsIkFycmF5IiwiaXNBcnJheSIsInJlZCIsImdyZWVuIiwiYmx1ZSIsImFscGhhIiwicmVzdWx0IiwicGFyc2VGbG9hdCIsImFycmF5VG9IZXgiLCJlbGVtcyIsImpvaW4iLCJvcGFjaXR5IiwicmdiYVRvSGV4IiwicmdiYSIsInJlZ2V4IiwicGFyc2VkIiwiZXhlYyIsImhleFRvUmdiYSIsInNob3J0aGFuZF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mVnZXggPSAvXiM/KFthLWZcXGRdezJ9KShbYS1mXFxkXXsyfSkoW2EtZlxcZF17Mn0pJC9pO1xuICAgICAgICB2YXIgcGFyc2VkID0gcmVnZXguZXhlYyh2YWx1ZSk7XG4gICAgICAgIGlmICghcGFyc2VkKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIERldGVybWluZSBpZiB2YWx1ZSBpcyBhIGNvcnJlY3QgcmdiYSBjb2xvci5cbiAgICAgKiBAcGFyYW0geyp9IHZhbHVlIC0gcmdiYSBjb2xvciAocmdiYSgxMjUsMTI1LDEyNSwxKSlcbiAgICAgKiBAcmV0dXJucyB7Qm9vbGVhbn0gVHJ1ZSBpZiB2YWx1ZSBpcyBhIHJnYmEgY29sb3JcbiAgICAgKi9cbiAgICBpc1JHQiA6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICBpZiAoIXZhbHVlKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHJlZ2V4ID0gL3JnYmE/XFwoXFxzKihcXGQrKVxccyosXFxzKihcXGQrKVxccyosXFxzKihcXGQrKVxccyooPzosXFxzKigwPy4/XFxkKylcXHMqKT9cXCkvO1xuICAgICAgICB2YXIgcGFyc2VkID0gcmVnZXguZXhlYyh2YWx1ZSk7XG4gICAgICAgIGlmICghcGFyc2VkKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ29sb3JVdGlscztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/Utils/ColorUtils.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/Config.js": +/*!************************************!*\ + !*** ./src/Common/Utils/Config.js ***! + \************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/**\n * @module Config\n * @alias [private] Config\n * @description\n * ...\n *\n * @example\n * isConfigLoaded();\n */\nvar Config = {\n /**\n * Config\n *\n * @public\n * @type {Object}\n */\n configuration: {},\n /**\n * Check if the configuration is loaded\n *\n * @returns {Boolean} True if Config is loaded, false otherwise\n */\n isConfigLoaded: function isConfigLoaded() {\n // config already loaded !\n if (this.configuration && Object.keys(this.configuration).length !== 0) {\n return true;\n }\n var scope = typeof window !== \"undefined\" ? window : typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : {};\n if (scope.Gp && scope.Gp.Config && scope.Gp.Config.layers && Object.keys(scope.Gp.Config.layers).length !== 0) {\n /** ts-syntax */this.configuration = scope.Gp.Config;\n return true;\n }\n return false;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Config);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvQ29uZmlnLmpzPzdmOTUiXSwibmFtZXMiOlsiQ29uZmlnIiwiY29uZmlndXJhdGlvbiIsImlzQ29uZmlnTG9hZGVkIiwiT2JqZWN0Iiwia2V5cyIsImxlbmd0aCIsInNjb3BlIiwid2luZG93Iiwic2VsZiIsImdsb2JhbCIsIkdwIiwibGF5ZXJzIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUlBLE1BQU0sR0FBRztFQUVUO0FBQ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5sYXllcnMpLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgLyoqIHRzLXN5bnRheCAqLyAodGhpcy5jb25maWd1cmF0aW9uKSA9IHNjb3BlLkdwLkNvbmZpZztcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbn07XG5cbmV4cG9ydCBkZWZhdWx0IENvbmZpZztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Common/Utils/Config.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/LayerUtils.js": +/*!****************************************!*\ + !*** ./src/Common/Utils/LayerUtils.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n* @module LayerUtils\n* @alias Gp.LayerUtils\n* @description\n* ...\n*\n* @example\n* getZoomLevelFromScaleDenominator();\n* getAttributions();\n* intersects();\n*/\nvar LayerUtils = {\n /**\n * Obtenir le ZoomLevel à partir du ScaleDenominator\n * @function getZoomLevelFromScaleDenominator\n * @param {Number} scaleDenominator - the scale denominator\n * @param {String} crs - the crs\n *\n * @returns {Integer} zoom level\n */\n getZoomLevelFromScaleDenominator: function getZoomLevelFromScaleDenominator(scaleDenominator, crs) {\n // ------------------------------------------------- //\n // Code issu de l'API Geoportal/Catalogue/Config.js //\n // ------------------------------------------------- //\n // var configuration = Gp.Config;\n // var general = configuration.generalOptions;\n // var layers = configuration.layersContext;\n //\n // for (var tms in general.tileMatrixSets) {\n // var tileMatrixSet = general.tileMatrixSets[tms];\n // // IGN's WMTS bug : epsg:nnnn instead of EPSG:nnnn\n // var crs = tileMatrixSet.supportedCRS = tileMatrixSet.supportedCRS.replace(/epsg/,\"EPSG\");\n //\n // if (!Geoportal.Catalogue.CRSRESOLUTIONS.hasOwnProperty(crs)) {\n // var p= new OpenLayers.Projection(crs);\n // Geoportal.Catalogue.CRSRESOLUTIONS[crs]= [];\n // var matrixIds= tileMatrixSet.matrixIds;\n // for (var i= 0, li= matrixIds.length; i} params.extent - map current geographical extent (EPSG:4326) : [top, left, bottom, right] = [maxy, minx, miny, maxx]\n * @param {Number} params.zoom - map current zoom\n * @param {String} params.crs - map current projection code (ex \"EPSG:2154\")\n * @param {Boolean} params.visibility - layer visibility\n * @param {Gp.Services.Config.Originator} params.originators - resource originators (from Gp.Config.layers[].originators)\n * @returns {Object} attributions - associative array, mapping originators url (keys) with their properties : html attributions elements\n */\n getAttributions: function getAttributions(params) {\n var zoom = params.zoom;\n var attributions = [];\n if (params.originators != null && params.visibility) {\n // drawLogo = boolean, true if attribution should be displayed (zoom, extent), false otherwise\n var drawLogo;\n for (var j = 0, jl = params.originators.length; j < jl; j++) {\n drawLogo = true;\n var originator = params.originators[j];\n var constraints = params.originators[j].constraints || [];\n for (var k = 0, kl = constraints.length; k < kl; k++) {\n var constraint = constraints[k];\n drawLogo = true;\n var minZoomLevel = this.getZoomLevelFromScaleDenominator(constraint.maxScaleDenominator, params.crs);\n var maxZoomLevel = this.getZoomLevelFromScaleDenominator(constraint.minScaleDenominator, params.crs) || 21;\n\n // min zoom constraints\n if (minZoomLevel && minZoomLevel > zoom) {\n drawLogo = false;\n }\n\n // max zoom constraints\n if (drawLogo && maxZoomLevel && maxZoomLevel < zoom) {\n drawLogo = false;\n }\n\n // bbox constraints\n var bbox = constraint.bbox;\n if (drawLogo && bbox) {\n drawLogo = false;\n var viewExtent = params.extent;\n if (viewExtent) {\n var bounds = [bbox.top, bbox.left, bbox.bottom, bbox.right];\n if (this.intersects(viewExtent, bounds)) {\n // at least one constraint matches the map ones\n drawLogo = true;\n break;\n }\n }\n }\n }\n if (drawLogo) {\n // on a un originator qui correspond au zoom et à l'étendue.\n\n var logo = originator.logo;\n var url = originator.url;\n var name = originator.name ? originator.name : \"\";\n var text = originator.attribution;\n var container = document.createElement(\"div\");\n container.className = \"gp-control-attribution\";\n\n // on crée un lien dans tous les cas (même s'il ne pointe pas vers une référence), pour avoir accès à la class CSS (pour surcharge)\n var link = null;\n link = document.createElement(\"a\");\n link.className = \"gp-control-attribution-link\";\n link.target = \"_blank\";\n container.appendChild(link);\n if (url) {\n link.href = url;\n }\n var bImage = !!logo;\n var image = null;\n // si on a un logo, on l'affiche à l'interieur du lien\n if (bImage) {\n image = document.createElement(\"img\");\n if (link) {\n image.className = \"gp-control-attribution-image\";\n link.appendChild(image);\n } else {\n image.className = \"\";\n container.appendChild(image);\n }\n image.src = logo;\n image.title = text || name;\n image.style.height = \"30px\";\n image.style.width = \"30px\";\n } else {\n // sinon, on affiche le nom de l'originator, ou sa description ou l'url.\n if (name) {\n link.textContent = name;\n } else if (text) {\n link.textContent = text;\n } else if (url) {\n link.textContent = url;\n } else {\n link.textContent = \"\";\n }\n }\n attributions.push(container.innerHTML + \" \");\n }\n }\n }\n return attributions;\n },\n /**\n * Determines if one extent (extent1) intersects another (extent2)\n *\n * @function intersects\n * @param {Array.} extent1 - First extent : [top, left, bottom, right] = [maxy, minx, miny, maxx]\n * @param {Array.} extent2 - Second extent : [top, left, bottom, right] = [maxy, minx, miny, maxx]\n * @return {Boolean} intersects - True if the two extents intersect, false otherwise.\n */\n intersects: function intersects(extent1, extent2) {\n var intersectsX = extent1[1] <= extent2[3] && extent2[1] <= extent1[3];\n var intersectsY = extent1[2] <= extent2[0] && extent2[2] <= extent1[0];\n return intersectsX && intersectsY;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerUtils);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvTGF5ZXJVdGlscy5qcz85ZjkxIl0sIm5hbWVzIjpbIkxheWVyVXRpbHMiLCJnZXRab29tTGV2ZWxGcm9tU2NhbGVEZW5vbWluYXRvciIsInNjYWxlRGVub21pbmF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NdO1xuICAgICAgICAvLyAgICAgICAgIC8vIElHTidzIFdNVFMgYnVnIDogZXBzZzpubm5uIGluc3RlYWQgb2YgRVBTRzpubm5uXG4gICAgICAgIC8vICAgICAgICAgdmFyIGNycyA9IHRpbGVNYXRyaXhTZXQuc3VwcG9ydGVkQ1JTID0gdGlsZU1hdHJpeFNldC5zdXBwb3J0ZWRDUlMucmVwbGFjZSgvZXBzZy8sXCJFUFNHXCIpO1xuICAgICAgICAvL1xuICAgICAgICAvLyAgICAgICAgIGlmICghR2VvcG9ydGFsLkNhdGFsb2d1ZS5DUlNSRVNPTFVUSU9OUy5oYXNPd25Qcm9wZXJ0eShjcnMpKSB7XG4gICAgICAgIC8vICAgICAgICAgICAgIHZhciBwPSBuZXcgT3BlbkxheWVycy5Qcm9qZWN0aW9uKGNycyk7XG4gICAgICAgIC8vICAgICAgICAgICAgIEdlb3BvcnRhbC5DYXRhbG9ndWUuQ1JTUkVTT0xVVElPTlNbY3JzXT0gW107XG4gICAgICAgIC8vICAgICAgICAgICAgIHZhciBtYXRyaXhJZHM9IHRpbGVNYXRyaXhTZXQubWF0cml4SWRzO1xuICAgICAgICAvLyAgICAgICAgICAgICBmb3IgKHZhciBpPSAwLCBsaT0gbWF0cml4SWRzLmxlbmd0aDsgaTxsaTsgKytpKSB7XG4gICAgICAgIC8vICAgICAgICAgICAgICAgICB2YXIgbWlkPSBtYXRyaXhJZHNbaV07XG4gICAgICAgIC8vICAgICAgICAgICAgICAgICBHZW9wb3J0YWwuQ2F0YWxvZ3VlLkNSU1JFU09MVVRJT05TW2Nyc10ucHVzaChcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAwLjAwMDI4Km1pZC5zY2FsZURlbm9taW5hdG9yXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgLyhPcGVuTGF5ZXJzLk1FVEVSU19QRVJfSU5DSCpPcGVuTGF5ZXJzLklOQ0hFU19QRVJfVU5JVFtwLmdldFVuaXRzKCldKSk7XG4gIC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OjM4NTcnXT0gbmV3IEFycmF5KGxsUi5sZW5ndGgpO1xuICAgICAgICAvLyAgICAgICAgICAgICBmb3IgKHZhciBpPSAwLCBsZW49IGxsUi5sZW5ndGg7IGk8bGVuOyBpKyspIHtcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgIHZhciBwdD0gbmV3IE9wZW5MYXllcnMuTG9uTGF0KGxsUltpXSwgMCk7XG4gICAgICAgIC8vICAgICAgICAgICAgICAgICBwdC50cmFuc2Zvcm0oT3BlbkxheWVycy5Qcm9qZWN0aW9uLkNSUzg0LCBPcGVuTGF5ZXJzLlByb2plY3Rpb24uV2ViTWVyY2F0b3IpO1xuICAgICAgICAvLyAgICAgICAgICAgICAgICAgd21SW2ldPSBwdC5sb247XG4gICAgICAgIC8vICAgICAgICAgICAgIH1cbiAgICAgICAgLy8gICAgICAgICB9XG4gICAgICAgIC8vICAgICAgICAgR2VvcG9ydGFsLkNhdGFsb2d1ZS5SRVNPTFVUSU9OUz0gd21SO1xuICAgICAgICAvL1xuICAgICAgICAvLyAgICAgICAgIHZhciBnZXRSZXNvbHV0aW9uc0Zyb21DUlM9IGZ1bmN0aW9uKGNycykge1xuICAgICAgICAvLyAgICAgICAgICAgICBpZiAoT3BlbkxheWVycy5Qcm9qZWN0aW9uLldlYk1lcmNhdG9yLmlzQWxpYXNPZihjcnMpKSB7XG4gICAgICAgIC8vICAgICAgICAgICAgICAgICByZXR1cm4gd21SO1xuICAgICAgICAvLyAgICAgICAgICAgICB9XG4gICAgICAgIC8vICAgICAgICAgICAgIGlmIChPcGVuTGF5ZXJzLlByb2plY3Rpb24uQ1JTODQuaXNBbGlhc09mKGNycykpIHtcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgIHJldHVybiBsbFI7XG4gICAgICAgIC8vICAgICAgICAgICAgIH1cbiAgICAgICAgLy8gICAgICAgICAgICAgcmV0dXJuIEdlb3BvcnRhbC5DYXRhbG9ndWUuQ1JTUkVTT0xVVElPTlNbY3JzXT9HZW9wb3J0YWwuQ2F0YWxvZ3VlLkNSU1JFU09MVVRJT05TW2Nyc106bnVsbCA7XG4gICAgICAgIC8vICAgICAgICAgfTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgICAgICB2YXIgcmV0cmlldmVab29tRnJvbVJlc29sdXRpb249IGZ1bmN0aW9uKHJlc29sdXRpb25zLCByZXNvbHV0aW9uKSB7XG4gICAgICAgIC8vICAgICAgICAgICAgIGZvciAodmFyIGk9IDAsIGxpPSByZXNvbHV0aW9ucy5sZW5ndGg7IGk8bGk7IGkrKykge1xuICAgICAgICAvLyAgICAgICAgICAgICAgICAgaWYgKHJlc29sdXRpb25zW2ldLXJlc29sdXRpb24gPD0gcmVzb2x1dGlvbnNbbGktMV0pIHtcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgLy8gICAgICAgICAgICAgfVxuICAgICAgICAvLyAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgIC8vICAgICAgICAgfTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgICAgICB2YXIgZ2V0Wm9vbUxldmVsRnJvbVNjYWxlRGVub21pbmF0b3I9IGZ1bmN0aW9uKHNjYWxlRGVub21pbmF0b3IsY3JzKSB7XG4gICAgICAgIC8vICAgICAgICAgICAgIHZhciByZXNvbHV0aW9uPSBzY2FsZURlbm9taW5hdG9yICogMC4wMDAyODtcbiAgICAgICAgLy8gICAgICAgICAgICAgdmFyIFI9IGdldFJlc29sdXRpb25zRnJvbUNSUyhjcnMpO1xuICAgICAgICAvLyAgICAgICAgICAgICBpZiAoUikge1xuICAgICAgICAvLyAgICAgICAgICAgICAgICAgcmV0dXJuIHJldHJpZXZlWm9vbUZyb21SZXNvbHV0aW9uKFIscmVzb2x1dGlvbik7XG4gICAgICAgIC8vICAgICAgICAgICAgIH1cbiAgICAgICAgLy8gICAgICAgICAgICAgcmVzb2x1dGlvbj0gcmVzb2x1dGlvbi8oT3BlbkxheWVycy5NRVRFUlNfUEVSX0lOQ0ggKiBPcGVuTGF5ZXJzLklOQ0hFU19QRVJfVU5JVFtcImRlZ3JlZXNcIl0pO1xuICAgICAgICAvLyAgICAgICAgICAgICByZXR1cm4gcmV0cmlldmVab29tRnJvbVJlc29sdXRpb24obGxSLHJlc29sdXRpb24pO1xuICAgICAgICAvLyAgICAgICAgIH07XG4gICAgICAgIC8vXG4gICAgICAgIC8vICAgICAgICAgdmFyIGdldFpvb21MZXZlbEZyb21SZXNvbHV0aW9uPSBmdW5jdGlvbihyZXNvbHV0aW9uLGNycyl7XG4gICAgICAgIC8vICAgICAgICAgICAgIHZhciBSPSBnZXRSZXNvbHV0aW9uc0Zyb21DUlMoY3JzKTtcbiAgICAgICAgLy8gICAgICAgICAgICAgaWYgKFIpIHtcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgIHJldHVybiByZXRyaWV2ZVpvb21Gcm9tUmVzb2x1dGlvbihSLHJlc29sdXRpb24pO1xuICAgICAgICAvLyAgICAgICAgICAgICB9XG4gICAgICAgIC8vICAgICAgICAgICAgIHZhciBwdDA9IG5ldyBPcGVuTGF5ZXJzLkxvbkxhdCgwLCAwKTtcbiAgICAgICAgLy8gICAgICAgICAgICAgdmFyIHB0MT0gbmV3IE9wZW5MYXllcnMuTG9uTGF0KDEsIDApO1xuICAgICAgICAvLyAgICAgICAgICAgICBwdDAudHJhbnNmb3JtKG5ldyBPcGVuTGF5ZXJzLlByb2plY3Rpb24oY3JzKSxPcGVuTGF5ZXJzLlByb2plY3Rpb24uQ1JTODQpO1xuICAgICAgICAvLyAgICAgICAgICAgICBwdDEudHJhbnNmb3JtKG5ldyBPcGVuTGF5ZXJzLlByb2plY3Rpb24oY3JzKSxPcGVuTGF5ZXJzLlByb2plY3Rpb24uQ1JTODQpO1xuICAgICAgICAvLyAgICAgICAgICAgICByZXNvbHV0aW9uPSByZXNvbHV0aW9uKihNYXRoLmFicyhwdDEubG9uLXB0MC5sb24pKTtcbiAgICAgICAgLy8gICAgICAgICAgICAgcmV0dXJuIHJldHJpZXZlWm9vbUZyb21SZXNvbHV0aW9uKGxsUixyZXNvbHV0aW9uKTtcbiAgICAgICAgLy8gICAgICAgICB9O1xuXG4gICAgICAgIC8vIHBhciBkZWZhdXQsIG9uIHV0aWxpc2UgbGEgcHJvamVjdGlvbiBXZWJNZXJjYXRvciAoRVBTRzozODU3ID0gUE0pXG4gICAgICAgIC8vIHNvaXQgbGEgbGlzdGUgZGVzIHJlc29sdXRpb25zIG5hdGl2ZXNcbiAgICAgICAgdmFyIHJlc29sdXRpb25zTmF0aXZlcyA9IHt9O1xuICAgICAgICBzd2l0Y2ggKGNycykge1xuICAgICAgICAgICAgY2FzZSBcIkVQU0c6MjE1NFwiOlxuICAgICAgICAgICAgICAgIHJlc29sdXRpb25zTmF0aXZlcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgMCA6IDEwNDU3OS4yMjQ1NDk4OTQsXG4gICAgICAgICAgICAgICAgICAgIDEgOiA1MjI3Ny41MzIzNTM3OTA1LFxuICAgICAgICAgICAgICAgICAgICAyIDogMjYxMzUuNDg3MDc4NTk1NCxcbiAgICAgICAgICAgICAgICAgICAgMyA6IDEzMDY2Ljg5MTM4MTgsXG4gICAgICAgICAgICAgICAgICAgIDQgOiA2NTMzLjIyODYwNDExMzUsXG4gICAgICAgICAgICAgICAgICAgIDUgOiAzMjY2LjU1OTUyNDQ2MjcsXG4gICAgICAgICAgICAgICAgICAgIDYgOiAxNjMzLjI2NjAwNDU5NzQsXG4gICAgICAgICAgICAgICAgICAgIDcgOiA4MTYuNjI5NTU0OTg2LFxuICAgICAgICAgICAgICAgICAgICA4IDogNDA4LjMxMzkxNDY3NjgsXG4gICAgICAgICAgICAgICAgICAgIDkgOiAyMDQuMTU2NzQxNTEwOSxcbiAgICAgICAgICAgICAgICAgICAgMTAgOiAxMDIuMDc4MzE2NzgzMixcbiAgICAgICAgICAgICAgICAgICAgMTEgOiA1MS4wMzkxNDQ4OTY2LFxuICAgICAgICAgICAgICAgICAgICAxMiA6IDI1LjUxOTU2OTA3NDMsXG4gICAgICAgICAgICAgICAgICAgIDEzIDogMTIuNzU5NzgzNjkzNixcbiAgICAgICAgICAgICAgICAgICAgMTQgOiA2LjM3OTg5MTYzNixcbiAgICAgICAgICAgICAgICAgICAgMTUgOiAzLjE4OTk0NTc2NTMsXG4gICAgICAgICAgICAgICAgICAgIDE2IDogMS41OTQ5NzI4Njk1LFxuICAgICAgICAgICAgICAgICAgICAxNyA6IDAuNzk3NDg2NDMxNSxcbiAgICAgICAgICAgICAgICAgICAgMTggOiAwLjM5ODc0MzIxNDksXG4gICAgICAgICAgICAgICAgICAgIDE5IDogMC4xOTkzNzE2MDczLFxuICAgICAgICAgICAgICAgICAgICAyMCA6IDAuMDk5Njg1ODAzNyxcbiAgICAgICAgICAgICAgICAgICAgMjEgOiAwLjA0OTg0MjkwMThcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICByZXNvbHV0aW9uc05hdGl2ZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgIDAgOiAxNTY1NDMuMDMzOTI4MDQxLFxuICAgICAgICAgICAgICAgICAgICAxIDogNzgyNzEuNTE2OTY0MDIwNDgsXG4gICAgICAgICAgICAgICAgICAgIDIgOiAzOTEzNS43NTg0ODIwMTAyMzUsXG4gICAgICAgICAgICAgICAgICAgIDMgOiAxOTU2Ny44NzkyNDEwMDUxMixcbiAgICAgICAgICAgICAgICAgICAgNCA6IDk3ODMuOTM5NjIwNTAyNTYsXG4gICAgICAgICAgICAgICAgICAgIDUgOiA0ODkxLjk2OTgxMDI1MTI4LFxuICAgICAgICAgICAgICAgICAgICA2IDogMjQ0NS45ODQ5MDUxMjU2NCxcbiAgICAgICAgICAgICAgICAgICAgNyA6IDEyMjIuOTkyNDUyNTYyODIsXG4gICAgICAgICAgICAgICAgICAgIDggOiA2MTEuNDk2MjI2MjgxNDEsXG4gICAgICAgICAgICAgICAgICAgIDkgOiAzMDUuNzQ4MTEzMTQwNzA0OCxcbiAgICAgICAgICAgICAgICAgICAgMTAgOiAxNTIuODc0MDU2NTcwMzUyNSxcbiAgICAgICAgICAgICAgICAgICAgMTEgOiA3Ni40MzcwMjgyODUxNzYyNCxcbiAgICAgICAgICAgICAgICAgICAgMTIgOiAzOC4yMTg1MTQxNDI1ODgxMyxcbiAgICAgICAgICAgICAgICAgICAgMTMgOiAxOS4xMDkyNTcwNzEyOTQwNixcbiAgICAgICAgICAgICAgICAgICAgMTQgOiA5LjU1NDYyODUzNTY0NzAzMixcbiAgICAgICAgICAgICAgICAgICAgMTUgOiA0Ljc3NzMxNDI2NzgyMzUxNixcbiAgICAgICAgICAgICAgICAgICAgMTYgOiAyLjM4ODY1NzEzMzkxMTc1OCxcbiAgICAgICAgICAgICAgICAgICAgMTcgOiAxLjE5NDMyODU2Njk1NTg3OSxcbiAgICAgICAgICAgICAgICAgICAgMTggOiAwLjU5NzE2NDI4MzQ3NzkzOTUsXG4gICAgICAgICAgICAgICAgICAgIDE5IDogMC4yOTg1ODIxNDE3Mzg5Njk3LFxuICAgICAgICAgICAgICAgICAgICAyMCA6IDAuMTQ5MjkxMDcwODY5NDg0OSxcbiAgICAgICAgICAgICAgICAgICAgMjEgOiAwLjA3NDY0NTUzNTQzNDc0MjRcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gZ2VzdGlvbiBkZXMgYXV0cmVzIFNSU1xuICAgICAgICAvLyBUT0RPXG4gICAgICAgIC8vIGlmIChjcnMpIHtcbiAgICAgICAgLy8gfVxuXG4gICAgICAgIHZhciByZXNvbHV0aW9uID0gc2NhbGVEZW5vbWluYXRvciAqIDAuMDAwMjg7XG5cbiAgICAgICAgZm9yICh2YXIgaW5kZXggaW4gcmVzb2x1dGlvbnNOYXRpdmVzKSB7XG4gICAgICAgICAgICBpZiAocmVzb2x1dGlvbnNOYXRpdmVzLmhhc093blByb3BlcnR5KGluZGV4KSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNvbHV0aW9uc05hdGl2ZXNbaW5kZXhdIDw9IHJlc29sdXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBwYXJzZUludChpbmRleCwgMTApO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIDA7IC8vIC0xID9cbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogR2V0IGF0dHJpYnV0aW9ucyBsaXN0IGZvciBhIGxheWVyLCBiYXNlZCBvbiBjdXJyZW50IHpvb20gYW5kIGV4dGVudFxuICAgICAqXG4gICAgICogQGZ1bmN0aW9uIGdldEF0dHJpYnV0aW9uc1xuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBwYXJhbXMgLSBmdW5jdGlvbiBwYXJhbXNcbiAgICAgKiBAcGFyYW0ge0FycmF5LjxGbG9hdD59IHBhcmFtcy5leHRlbnQgLSBtYXAgY3VycmVudCBnZW9ncmFwaGljYWwgZXh0ZW50IChFUFNHOjQzMjYpIDogW3RvcCwgbGVmdCwgYm90dG9tLCByaWdodF0gPSBbbWF4eSwgbWlueCwgbWlueSwgbWF4eF1cbiAgICAgKiBAcGFyYW0ge051bWJlcn0gcGFyYW1zLnpvb20gLSBtYXAgY3VycmVudCB6b29tXG4gICAgICogQHBhcmFtIHtTdHJpbmd9IHBhcmFtcy5jcnMgLSBtYXAgY3VycmVudCBwcm9qZWN0aW9uIGNvZGUgKGV4IFwiRVBTRzoyMTU0XCIpXG4gICAgICogQHBhcmFtIHtCb29sZWFufSBwYXJhbXMudmlzaWJpbGl0eSAtIGxheWVyIHZpc2liaWxpdHlcbiAgICAgKiBAcG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ICAgICBmb3IgKHZhciBrID0gMCwga2wgPSBjb25zdHJhaW50cy5sZW5ndGg7IGsgPCBrbDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb25zdHJhaW50ID0gY29uc3RyYWludHNba107XG4gICAgICAgICAgICAgICAgICAgIGRyYXdMb2dvID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgICAgICB2YXIgbWluWm9vbUxldmVsID0gdGhpcy5nZXRab29tTGV2ZWxGcm9tU2NhbGVEZW5vbWluYXRvcihjb25zdHJhaW50Lm1heFNjYWxlRGVub21pbmF0b3IsIHBhcmFtcy5jcnMpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF4Wm9vbUxldmVsID0gdGhpcy5nZXRab29tTGV2ZWxGcm9tU2NhbGVEZW5vbWluYXRvcihjb25zdHJhaW50Lm1pblNjYWxlRGVub21pbmF0b3IsIHBhcmFtcy5jcnMpIHx8IDIxO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIG1pbiB6b29tIGNvbnN0cmFpbnRzXG4gICAgICAgICAgICAgICAgICAgIGlmIChtaW5ab29tTGV2ZWwgJiYgKG1pblpvb21MZXZlbCA+IHpvb20pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkcmF3TG9nbyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gbWF4IHpvb20gY29uc3RyYWludHNcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRyYXdMb2dvICYmIG1heFpvb21MZXZlbCAmJiAobWF4Wm9vbUxldmVsIDwgem9vbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdMb2dvID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAvLyBiYm94IGNvbnN0cmFpbnRzXG4gICAgICAgICAgICAgICAgICAgIHZhciBiYm94ID0gY29uc3RyYWludC5iYm94O1xuICAgICAgICAgICAgICAgICAgICBpZiAoZHJhd0xvZ28gJiYgYmJveCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0xvZ28gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWV3RXh0ZW50ID0gcGFyYW1zLmV4dGVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2aWV3RXh0ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJvdW5kcyA9IFtiYm94LnRvcCwgYmJveC5sZWZ0LCBiYm94LmJvdHRvbSwgYmJveC5yaWdodF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuaW50ZXJzZWN0cyh2aWV3RXh0ZW50LCBib3VuZHMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF0IGxlYXN0IG9uZSBjb25zdHJhaW50IG1hdGNoZXMgdGhlIG1hcCBvbmVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdMb2dvID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGRyYXdMb2dvKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG9uIGEgdW4gb3JpZ2luYXRvciBxdWkgY29ycmVzcG9uZCBhdSB6b29tIGV0IMOgIGwnw6l0ZW5kdWUuXG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGxvZ28gPSBvcmlnaW5hdG9yLmxvZ287XG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBvcmlnaW5hdG9yLnVybDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBvcmlnaW5hdG9yLm5hbWUgPyBvcmlnaW5hdG9yLm5hbWUgOiBcIlwiO1xuICAgICAgICAgICAgICAgICAgICB2YXIgdGV4dCA9IG9yaWdpbmF0b3IuYXR0cmlidXRpb247XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lciA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5jbGFzc05hbWUgPSBcImdwLWNvbnRyb2wtYXR0cmlidXRpb25cIjtcblxuICAgICAgICAgICAgICAgICAgICAvLyBvbiBjcsOpZSB1biBsaWVuIGRhbnMgdG91cyBsZXMgY2FzIChtw6ptZSBzJ2lsIG5lIHBvaW50ZSBwYXMgdmVycyB1bmUgcsOpZsOpcmVuY2UpLCBwb3VyIGF2b2lyIGFjY8OocyDDoCBsYSBjbGFzcyBDU1MgKHBvdXIgc3VyY2hhcmdlKVxuICAgICAgICAgICAgICAgICAgICB2YXIgbGluayA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGxpbmsgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiYVwiKTtcbiAgICAgICAgICAgICAgICAgICAgbGluay5jbGFzc05hbWUgPSBcImdwLWNvbnRyb2wtYXR0cmlidXRpb24tbGlua1wiO1xuICAgICAgICAgICAgICAgICAgICBsaW5rLnRhcmdldCA9IFwiX2JsYW5rXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5hcHBlbmRDaGlsZChsaW5rKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluay5ocmVmID0gdXJsO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGJJbWFnZSA9ICEhKGxvZ28pO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW1hZ2UgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAvLyBzaSBvbiBhIHVuIGxvZ28sIG9uIGwnYWZmaWNoZSDDoCBsJ2ludGVyaWV1ciBkdSBsaWVuXG4gICAgICAgICAgICAgICAgICAgIGlmIChiSW1hZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImltZ1wiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaW5rKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UuY2xhc3NOYW1lID0gXCJncC1jb250cm9sLWF0dHJpYnV0aW9uLWltYWdlXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluay5hcHBlbmRDaGlsZChpbWFnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlLmNsYXNzTmFtZSA9IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyLmFwcGVuZENoaWxkKGltYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlLnNyYyA9IGxvZ287XG4gICAgICAgICAgICAgICAgICAgICAgICBpbWFnZS50aXRsZSA9IHRleHQgfHwgbmFtZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlLnN0eWxlLmhlaWdodCA9IFwiMzBweFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2Uuc3R5bGUud2lkdGggPSBcIjMwcHhcIjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNpbm9uLCBvbiBhZmZpY2hlIGxlIG5vbSBkZSBsJ29yaWdpbmF0b3IsIG91IHNhIGRlc2NyaXB0aW9uIG91IGwndXJsLlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rLnRleHRDb250ZW50ID0gbmFtZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGV4dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmsudGV4dENvbnRlbnQgPSB0ZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rLnRleHRDb250ZW50ID0gdXJsO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rLnRleHRDb250ZW50ID0gXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0aW9ucy5wdXNoKGNvbnRhaW5lci5pbm5lckhUTUwgKyBcIiBcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGF0dHJpYnV0aW9ucztcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogRGV0ZXJtaW5lcyBpZiBvbmUgZXh0ZW50IChleHRlbnQxKSBpbnRlcnNlY3RzIGFub3RoZXIgKGV4dGVudDIpXG4gICAgICpcbiAgICAgKiBAZnVuY3Rpb24gaW50ZXJzZWN0c1xuICAgICAqIEBwYXJhbSB7QXJyYXkuPEZsb2F0Pn0gZXh0ZW50MSAtIEZpcnN0IGV4dGVudCA6IFt0b3AsIGxlZnQsIGJvdHRvbSwgcmlnaHRdID0gW21heHksIG1pbngsIG1pbnksIG1heHhdXG4gICAgICogQHBhcmFtIHtBcnJheS48RmxvYXQ+fSBleHRlbnQyIC0gU2Vjb25kIGV4dGVudCA6IFt0b3AsIGxlZnQsIGJvdHRvbSwgcmlnaHRdID0gW21heHksIG1pbngsIG1pbnksIG1heHhdXG4gICAgICogQHJldHVybiB7Qm9vbGVhbn0gaW50ZXJzZWN0cyAtIFRydWUgaWYgdGhlIHR3byBleHRlbnRzIGludGVyc2VjdCwgZmFsc2Ugb3RoZXJ3aXNlLlxuICAgICAqL1xuICAgIGludGVyc2VjdHMgOiBmdW5jdGlvbiAoZXh0ZW50MSwgZXh0ZW50Mikge1xuICAgICAgICB2YXIgaW50ZXJzZWN0c1ggPSAoZXh0ZW50MVsxXSA8PSBleHRlbnQyWzNdKSAmJiAoZXh0ZW50MlsxXSA8PSBleHRlbnQxWzNdKTtcbiAgICAgICAgdmFyIGludGVyc2VjdHNZID0gKGV4dGVudDFbMl0gPD0gZXh0ZW50MlswXSkgJiYgKGV4dGVudDJbMl0gPD0gZXh0ZW50MVswXSk7XG4gICAgICAgIHJldHVybiBpbnRlcnNlY3RzWCAmJiBpbnRlcnNlY3RzWTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBMYXllclV0aWxzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Utils/LayerUtils.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/LoggerByDefault.js": +/*!*********************************************!*\ + !*** ./src/Common/Utils/LoggerByDefault.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! loglevel */ \"./node_modules/loglevel/lib/loglevel.js\");\n/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_0__);\n\n\n/**\n * @module LoggerByDefault\n * @alias [private] LoggerByDefault\n * @description\n * ...\n *\n * @example\n * getLogger();\n * disableAll();\n * enableAll();\n */\nvar LoggerByDefault = {\n /**\n * creation d'un logger statique\n *\n * @function getLogger\n * @param {String} [name=\"default\"] - the logger name\n * @returns {Object} logger\n */\n getLogger: function getLogger(name) {\n // INFO :\n // à la compilation en mode production, on substitue false\n // avec \"true\", ceci desactive les loggers !\n //\n // à la compilation en mode developpement, on substitue false\n // avec \"false\", ceci permet d'avoir les loggers actifs !\n //\n // lors d'une utilisation en module es6, il n'y a pas de substitution de false,\n // les loggers sont donc actifs par defaut !\n //\n // > Substitute global constants configured at compile time\n // cf. webpack.config.js\n // on masque cette constante afin d'eviter \"referenceerror not defined\"\n \"false\".match(/true/) ? loglevel__WEBPACK_IMPORTED_MODULE_0__[\"disableAll\"]() : loglevel__WEBPACK_IMPORTED_MODULE_0__[\"enableAll\"]();\n var logname = name || \"default\";\n return loglevel__WEBPACK_IMPORTED_MODULE_0__[\"getLogger\"](logname);\n },\n /**\n * desactive tous les loggers\n * @function disableAll\n */\n disableAll: function disableAll() {\n var loggers = loglevel__WEBPACK_IMPORTED_MODULE_0__[\"getLoggers\"]();\n for (var key in loggers) {\n if (Object.hasOwnProperty.call(loggers, key)) {\n var logger = loggers[key];\n logger.disableAll();\n }\n }\n },\n /**\n * active tous les loggers\n * @function enableAll\n */\n enableAll: function enableAll() {\n var loggers = loglevel__WEBPACK_IMPORTED_MODULE_0__[\"getLoggers\"]();\n for (var key in loggers) {\n if (Object.hasOwnProperty.call(loggers, key)) {\n var logger = loggers[key];\n logger.enableAll();\n }\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (LoggerByDefault);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvTG9nZ2VyQnlEZWZhdWx0LmpzPzVjOTAiXSwibmFtZXMiOlsiTG9nZ2VyQnlEZWZhdWx0IiwiZ2V0TG9nZ2VyIiwibmFtZSIsIm1hdGNoIiwiTG9nIiwibG9nbmFtZSIsImRpc2FibGVBbGwiLCJsb2dnZXJzIiwia2V5IiwiT2JqZWN0Iiwi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vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/Utils/LoggerByDefault.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/MathUtils.js": +/*!***************************************!*\ + !*** ./src/Common/Utils/MathUtils.js ***! + \***************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n* @module MathUtils\n* @alias Gp.MathUtils\n* @description\n* ...\n*\n* @example\n* modulo();\n* decimalToDMS();\n* toInteger();\n* isInteger();\n* toFloat();\n*/\nvar MathUtils = {\n /**\n * Reste de la division euclidienne\n * @function modulo\n * @param {Number} a - divisor\n * @param {Number} b - quotient\n * @returns {Number} Modulo\n */\n modulo: function modulo(a, b) {\n var r = a % b;\n return r * b < 0 ? r + b : r;\n },\n /**\n * Transform degrees, minutes, seconds form decimal degrees -\n * Largely inspired by the private function degreesToStringHDMS from ol/coordinate.js\n *\n * @function decimalToDMS\n * @param {Number} degrees - decimal degrees\n * @param {Array} hemispheres - \"NS\" ou \"EO\"\n * @param {Number} numDigits - number of digits for seconds\n * @returns {Object} DMS coordinate\n */\n decimalToDMS: function decimalToDMS(degrees, hemispheres, numDigits) {\n var normalizedDegrees = this.modulo(degrees + 180, 360) - 180;\n var x = Math.abs(3600 * normalizedDegrees);\n var dflPrecision = numDigits || 0;\n var precision = Math.pow(10, dflPrecision);\n var deg = Math.floor(x / 3600);\n var min = Math.floor((x - deg * 3600) / 60);\n var sec = x - deg * 3600 - min * 60;\n sec = Math.ceil(sec * precision) / precision;\n if (sec >= 60) {\n sec = 0;\n min += 1;\n }\n if (min >= 60) {\n min = 0;\n deg += 1;\n }\n var direction = hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);\n return {\n d: deg,\n m: min,\n s: sec,\n direction: direction\n };\n },\n /**\n * Converts string to Integer\n *\n * @function toInteger\n * @param {String} s - string number\n * @param {Numeric} base - between 2 and 36\n * @returns {null|Numeric} result\n */\n toInteger: function toInteger(s, base) {\n var _base = base || 10;\n var n = parseInt(s, _base);\n if (!isNaN(n) && isFinite(n)) {\n return n;\n }\n return null;\n },\n /**\n * check if s represents an integer\n *\n * @function isInteger\n * @param {String} s - string number\n * @returns {Boolean} is integer\n */\n isInteger: function isInteger(s) {\n if (isNaN(s)) {\n return false;\n }\n var v = parseFloat(s);\n return (v | 0) === v;\n },\n /**\n * Converts s to float\n *\n * @function toFloat\n * @param {String} s - string number\n * @returns {null|Numeric} result\n */\n toFloat: function toFloat(s) {\n var n = parseFloat(s);\n if (!isNaN(n) && isFinite(n)) {\n return n;\n }\n return null;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MathUtils);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvTWF0aFV0aWxzLmpzPzIzMWUiXSwibmFtZXMiOlsiTWF0aFV0aWxzIiwibW9kdWxvIiwiYSIsImIiLCJyIiwiZGVjaW1hbFRvRE1TIiwiZGVncmVlcyIsImhlbWlzcGhlcmVzIiwibnVtRGlnaXRzIiwibm9ybWFsaXplZERlZ3JlZXMiLCJ4IiwiTWF0aCIsImFicyIsImRmbFByZWNpc2lvbiIsInByZWNpc2lvbiIsInBvdyIsImRlZyIsImZsb29yIiwibWluIiwic2VjIiwiY2VpbCIsImRpcmVjdGlvbiIsImNoYXJBdCIsImQiLCJtIiwicyIsInRvSW50ZWdlciIsImJhc2UiLCJfYmFzZSIsIm4iLCJwYXJzZUludCIsImlzTmFOIiwiaXNGaW5pdGUiLCJpc0ludGVnZXIiLCJ2IiwicGFyc2VGbG9hdCIsInRvRmxvYXQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJ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ICogbm9ybWFsaXplZERlZ3JlZXMpO1xuICAgICAgICB2YXIgZGZsUHJlY2lzaW9uID0gbnVtRGlnaXRzIHx8IDA7XG4gICAgICAgIHZhciBwcmVjaXNpb24gPSBNYXRoLnBvdygxMCwgZGZsUHJlY2lzaW9uKTtcblxuICAgICAgICB2YXIgZGVnID0gTWF0aC5mbG9vcih4IC8gMzYwMCk7XG4gICAgICAgIHZhciBtaW4gPSBNYXRoLmZsb29yKCh4IC0gZGVnICogMzYwMCkgLyA2MCk7XG4gICAgICAgIHZhciBzZWMgPSB4IC0gKGRlZyAqIDM2MDApIC0gKG1pbiAqIDYwKTtcbiAgICAgICAgc2VjID0gTWF0aC5jZWlsKHNlYyAqIHByZWNpc2lvbikgLyBwcmVjaXNpb247XG5cbiAgICAgICAgaWYgKHNlYyA+PSA2MCkge1xuICAgICAgICAgICAgc2VjID0gMDtcbiAgICAgICAgICAgIG1pbiArPSAxO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1pbiA+PSA2MCkge1xuICAgICAgICAgICAgbWluID0gMDtcbiAgICAgICAgICAgIGRlZyArPSAxO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGRpcmVjdGlvbiA9IGhlbWlzcGhlcmVzLmNoYXJBdChub3JtYWxpemVkRGVncmVlcyA8IDAgPyAxIDogMCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBkIDogZGVnLFxuICAgICAgICAgICAgbSA6IG1pbixcbiAgICAgICAgICAgIHMgOiBzZWMsXG4gICAgICAgICAgICBkaXJlY3Rpb24gOiBkaXJlY3Rpb25cbiAgICAgICAgfTtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogQ29udmVydHMgc3RyaW5nIHRvIEludGVnZXJcbiAgICAgKlxuICAgICAqIEBmdW5jdGlvbiB0b0ludGVnZXJcbiAgICAgKiBAcGFyYW0ge1N0cmluZ30gcyAtIHN0cmluZyBudW1iZXJcbiAgICAgKiBAcGFyYW0ge051bWVyaWN9IGJhc2UgLSBiZXR3ZWVuIDIgYW5kIDM2XG4gICAgICogQHJldHVybnMge251bGx8TnVtZXJpY30gcmVzdWx0XG4gICAgICovXG4gICAgdG9JbnRlZ2VyIDogZnVuY3Rpb24gKHMsIGJhc2UpIHtcbiAgICAgICAgdmFyIF9iYXNlID0gYmFzZSB8fCAxMDtcbiAgICAgICAgdmFyIG4gPSBwYXJzZUludChzLCBfYmFzZSk7XG4gICAgICAgIGlmICghaXNOYU4obikgJiYgaXNGaW5pdGUobikpIHtcbiAgICAgICAgICAgIHJldHVybiBuO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBjaGVjayBpZiBzIHJlcHJlc2VudHMgYW4gaW50ZWdlclxuICAgICAqXG4gICAgICogQGZ1bmN0aW9uIGlzSW50ZWdlclxuICAgICAqIEBwYXJhbSB7U3RyaW5nfSBzIC0gc3RyaW5nIG51bWJlclxuICAgICAqIEByZXR1cm5zIHtCb29sZWFufSBpcyBpbnRlZ2VyXG4gICAgICovXG4gICAgaXNJbnRlZ2VyIDogZnVuY3Rpb24gKHMpIHtcbiAgICAgICAgaWYgKGlzTmFOKHMpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgdiA9IHBhcnNlRmxvYXQocyk7XG4gICAgICAgIHJldHVybiAoKHYgfCAwKSA9PT0gdik7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIENvbnZlcnRzIHMgdG8gZmxvYXRcbiAgICAgKlxuICAgICAqIEBmdW5jdGlvbiB0b0Zsb2F0XG4gICAgICogQHBhcmFtIHtTdHJpbmd9IHMgLSBzdHJpbmcgbnVtYmVyXG4gICAgICogQHJldHVybnMge251bGx8TnVtZXJpY30gcmVzdWx0XG4gICAgICovXG4gICAgdG9GbG9hdCA6IGZ1bmN0aW9uIChzKSB7XG4gICAgICAgIHZhciBuID0gcGFyc2VGbG9hdChzKTtcbiAgICAgICAgaWYgKCFpc05hTihuKSAmJiBpc0Zpbml0ZShuKSkge1xuICAgICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgTWF0aFV0aWxzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Utils/MathUtils.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/ProxyUtils.js": +/*!****************************************!*\ + !*** ./src/Common/Utils/ProxyUtils.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n\n\n/**\n* @module ProxyUtils\n* @alias Gp.ProxyUtils\n* @description\n* ...\n*\n* @example\n* proxifyUrl();\n*/\nvar ProxyUtils = {\n /**\n * Ajoute un proxy aux url des couches vecteurs si besoin.\n *\n * @function proxifyUrl\n * @param {String} url - Url to proxify.\n * @param {Object} [proxyOptions] - Object defining proxy options.\n * @param {String} proxyOptions.proxyUrl - Proxy URL.\n * @param {Array.} [proxyOptions.noProxyDomains] - Proxy will not be used for this list of domain names.\n *\n * @returns {String} proxy url\n */\n proxifyUrl: function proxifyUrl(url, proxyOptions) {\n // logger\n\n var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"proxifyUrl\");\n if (!proxyOptions || !proxyOptions.hasOwnProperty(\"proxyUrl\") || proxyOptions.proxyUrl === null || proxyOptions.proxyUrl.trim().length === 0) {\n return url;\n }\n // on regarde si l'url nest pas dans les domaines sans proxy\n if (proxyOptions.noProxyDomains && Array.isArray(proxyOptions.noProxyDomains) && proxyOptions.noProxyDomains.length > 0) {\n for (var i in proxyOptions.noProxyDomains) {\n logger.trace(\"[ProxyUtils] proxifyUrl : analyzing \" + proxyOptions.noProxyDomains[i]);\n if (url.indexOf(proxyOptions.noProxyDomains[i]) !== -1) {\n logger.info(\"[ProxyUtils] proxifyUrl : \" + url + \" found in noProxyDomains list (\" + proxyOptions.noProxyDomains[i] + \").\");\n return url;\n }\n }\n }\n return proxyOptions.proxyUrl + encodeURIComponent(url);\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ProxyUtils);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvUHJveHlVdGlscy5qcz8wYmY1Il0sIm5hbWVzIjpbIlByb3h5VXRpbHMiLCJwcm94aWZ5VXJsIiwidXJsIiwicHJveHlPcHRpb25zIiwibG9nZ2VyIiwiTG9nZ2VyIiwiZ2V0TG9nZ2VyIiwiaGFzT3duUHJvcGVydHkiLCJwcm94eVVybCIsInRyaW0iLCJsZW5ndGgiLCJub1Byb3h5RG9tYWlucyIsIkFycmF5IiwiaXNBcnJheSIsImkiLCJ0cmFjZSIsImluZGV4T2YiLCJpbmZvIiwiZW5jb2RlVVJJQ29tcG9uZW50Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQXdEOztBQUV4RDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJQSxVQUFVLEdBQUc7RUFDYjtBQUNKO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0VBQ0lDLFVBQVUsRUFBRyxTQUFBQSxXQUFVQyxHQUFHLEVBQUVDLFlBQVksRUFBRTtJQUN0Qzs7SUFFQSxJQUFJQyxNQUFNLEdBQUdDLHFFQUFNLENBQUNDLFN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dlcihcInByb3hpZnlVcmxcIik7XG5cbiAgICAgICAgaWYgKCFwcm94eU9wdGlvbnMgfHxcbiAgICAgICAgICAgICFwcm94eU9wdGlvbnMuaGFzT3duUHJvcGVydHkoXCJwcm94eVVybFwiKSB8fFxuICAgICAgICAgICAgcHJveHlPcHRpb25zLnByb3h5VXJsID09PSBudWxsIHx8XG4gICAgICAgICAgICBwcm94eU9wdGlvbnMucHJveHlVcmwudHJpbSgpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIHVybDtcbiAgICAgICAgfVxuICAgICAgICAvLyBvbiByZWdhcmRlIHNpIGwndXJsIG5lc3QgcGFzIGRhbnMgbGVzIGRvbWFpbmVzIHNhbnMgcHJveHlcbiAgICAgICAgaWYgKHByb3h5T3B0aW9ucy5ub1Byb3h5RG9tYWlucyAmJlxuICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcm94eU9wdGlvbnMubm9Qcm94eURvbWFpbnMpICYmXG4gICAgICAgICAgICBwcm94eU9wdGlvbnMubm9Qcm94eURvbWFpbnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBwcm94eU9wdGlvbnMubm9Qcm94eURvbWFpbnMpIHtcbiAgICAgICAgICAgICAgICBsb2dnZXIudHJhY2UoXCJbUHJveHlVdGlsc10gcHJveGlmeVVybCA6IGFuYWx5emluZyBcIiArIHByb3h5T3B0aW9ucy5ub1Byb3h5RG9tYWluc1tpXSk7XG4gICAgICAgICAgICAgICAgaWYgKHVybC5pbmRleE9mKHByb3h5T3B0aW9ucy5ub1Byb3h5RG9tYWluc1tpXSkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGxvZ2dlci5pbmZvKFwiW1Byb3h5VXRpbHNdIHByb3hpZnlVcmwgOiBcIiArIHVybCArIFwiIGZvdW5kIGluIG5vUHJveHlEb21haW5zIGxpc3QgKFwiICsgcHJveHlPcHRpb25zLm5vUHJveHlEb21haW5zW2ldICsgXCIpLlwiKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHByb3h5T3B0aW9ucy5wcm94eVVybCArIGVuY29kZVVSSUNvbXBvbmVudCh1cmwpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFByb3h5VXRpbHM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Common/Utils/ProxyUtils.js\n"); + +/***/ }), + +/***/ "./src/Common/Utils/SelectorID.js": +/*!****************************************!*\ + !*** ./src/Common/Utils/SelectorID.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module SelectorID\n * @alias [private] SelectorID\n * @description\n * formalisme d'un tag ID :\n * -> NAME(_ORDER)-1460636385836\n *\n * @example\n * Ex.\n * GProutePoints-1460636385836\n * GProutePoint_10-1460636385836\n */\nvar SelectorID = {\n /**\n * Construction d'un identifiant statique basé sur le timestamp,\n * et qui s'incremente de +1 à chaque appel\n * @function generate\n */\n generate: function () {\n var timestamp = Math.floor(Date.now());\n return function () {\n return timestamp++;\n };\n }(),\n /**\n * nom du tag\n * @function name\n * @param {String} id - the id\n * @returns {String} index\n */\n name: function name(id) {\n var name = null;\n var i = id.lastIndexOf(\"-\");\n if (i === -1) {\n name = id;\n } else {\n name = id.substring(0, i);\n }\n return name;\n },\n /**\n * numero d'identifiant du tag\n *\n * @function index\n * @param {String} id - the id\n * @returns {String} index\n */\n index: function index(id) {\n var index = null;\n var name = this.name(id);\n // if (name !== id) {\n var i = name.lastIndexOf(\"_\");\n if (i !== -1) {\n index = name.substring(i + 1);\n }\n // }\n\n return index;\n },\n /**\n * uuid du tag\n *\n * @function uuid\n * @param {String} id - the id\n * @returns {String} uuid\n */\n uuid: function uuid(id) {\n var uuid = null;\n var i = id.lastIndexOf(\"-\");\n if (i !== -1) {\n uuid = parseInt(id.substring(i + 1), 10);\n }\n return uuid;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (SelectorID);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9Db21tb24vVXRpbHMvU2VsZWN0b3JJRC5qcz9lNmM1Il0sIm5hbWVzIjpbIlNlbGVjdG9ySUQiLCJnZW5lcmF0ZSIsInRpbWVzdGFtcCIsIk1hdGgiLCJmbG9vciIsIkRhdGUiLCJub3ciLCJuYW1lIiwiaWQiLCJpIiwibGFzdEluZGV4T2YiLCJzdWJzdHJpbmciLCJpbmRleCIsInV1aWQiLCJwYXJzZUludCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJQSxVQUFVLEdBQUc7RUFFYjtBQUNKO0FBQ0E7QUFDQTtBQUNBO0VBQ0lDLFFBQVEsRUFBSSxZQUFZO0lBQ3BCLElBQUlDLFNBQVMsR0FBR0MsSUFBSSxDQUFDQyxLQUFLLENBQUNDLElBQUksQ0FBQ0MsR0FBRyxDQUFDLENBQUMsQ0FBQztJQUN0QyxPQUFPLFlBQVk7TUFDZixPQUFPSixTQUFTLEVBQUU7SUFDdEIsQ0FBQztFQUNMLENBQUMsQ0FBRSxDQUFDO0VBRUo7QUFDSjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0VBQ0lLLElBQUksRUFBRyxTQUFBQSxLQUFVQyxFQUFFLEVBQUU7SUFDakIsSUFBSUQsSUFBSSxHQUFHLElBQUk7SUFFZixJQUFJRSxDQUFDLEdBQUdELEVBQUUsQ0FBQ0UsV0FBVyxDQUFDLEdBQUcsQ0FBQztJ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ZXR1cm5zIHtTdHJpbmd9IGluZGV4XG4gICAgICovXG4gICAgbmFtZSA6IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICB2YXIgbmFtZSA9IG51bGw7XG5cbiAgICAgICAgdmFyIGkgPSBpZC5sYXN0SW5kZXhPZihcIi1cIik7XG4gICAgICAgIGlmIChpID09PSAtMSkge1xuICAgICAgICAgICAgbmFtZSA9IGlkO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbmFtZSA9IGlkLnN1YnN0cmluZygwLCBpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBuYW1lO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBudW1lcm8gZCdpZGVudGlmaWFudCBkdSB0YWdcbiAgICAgKlxuICAgICAqIEBmdW5jdGlvbiBpbmRleFxuICAgICAqIEBwYXJhbSB7U3RyaW5nfSBpZCAtIHRoZSBpZFxuICAgICAqIEByZXR1cm5zIHtTdHJpbmd9IGluZGV4XG4gICAgICovXG4gICAgaW5kZXggOiBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgdmFyIGluZGV4ID0gbnVsbDtcblxuICAgICAgICB2YXIgbmFtZSA9IHRoaXMubmFtZShpZCk7XG4gICAgICAgIC8vIGlmIChuYW1lICE9PSBpZCkge1xuICAgICAgICB2YXIgaSA9IG5hbWUubGFzdEluZGV4T2YoXCJfXCIpO1xuICAgICAgICBpZiAoaSAhPT0gLTEpIHtcbiAgICAgICAgICAgIGluZGV4ID0gbmFtZS5zdWJzdHJpbmcoaSArIDEpO1xuICAgICAgICB9XG4gICAgICAgIC8vIH1cblxuICAgICAgICByZXR1cm4gaW5kZXg7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIHV1aWQgZHUgdGFnXG4gICAgICpcbiAgICAgKiBAZnVuY3Rpb24gdXVpZFxuICAgICAqIEBwYXJhbSB7U3RyaW5nfSBpZCAtIHRoZSBpZFxuICAgICAqIEByZXR1cm5zIHtTdHJpbmd9IHV1aWRcbiAgICAgKi9cbiAgICB1dWlkIDogZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgIHZhciB1dWlkID0gbnVsbDtcblxuICAgICAgICB2YXIgaSA9IGlkLmxhc3RJbmRleE9mKFwiLVwiKTtcbiAgICAgICAgaWYgKGkgIT09IC0xKSB7XG4gICAgICAgICAgICB1dWlkID0gcGFyc2VJbnQoaWQuc3Vic3RyaW5nKGkgKyAxKSwgMTApO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHV1aWQ7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBTZWxlY3RvcklEO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Common/Utils/SelectorID.js\n"); + +/***/ }), + +/***/ "./src/Itowns/CRS/CRS.js": +/*!*******************************!*\ + !*** ./src/Itowns/CRS/CRS.js ***! + \*******************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar CRS = {\n /**\n * CRS : WGS84\n *\n * @property EPSG:4326\n * @private\n */\n \"EPSG:4326\": \"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +units=degrees\",\n /**\n * CRS : PseudoMercator\n *\n * @property EPSG:3857\n * @private\n */\n \"EPSG:3857\": \"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs\",\n /**\n * CRS : Lambert 93\n *\n * @property EPSG:2154\n * @private\n */\n \"EPSG:2154\": \"+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\",\n /**\n * CRS : Lambert 2 extended\n *\n * @property EPSG:27572\n * @private\n */\n \"EPSG:27572\": \"+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs\",\n /**\n * CRS : UTM 20N (Guadeloupe, Martinique)\n *\n * @property EPSG:32620\n * @private\n */\n \"EPSG:32620\": \"+proj=utm +zone=20 +ellps=WGS84 +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 21N (Saint-Pierre-et-Miquelon)\n *\n * @property EPSG:4467\n * @private\n */\n \"EPSG:4467\": \"+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\",\n /**\n * CRS : UTM 22N (Guyane)\n *\n * @property EPSG:2972\n * @private\n */\n \"EPSG:2972\": \"+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\",\n /**\n * CRS : UTM 30N (France métropolitaine)\n *\n * @property EPSG:32630\n * @private\n */\n \"EPSG:32630\": \"+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 31N (France métropolitaine)\n *\n * @property EPSG:32631\n * @private\n */\n \"EPSG:32631\": \"+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 32N (France métropolitaine)\n *\n * @property EPSG:32632\n * @private\n */\n \"EPSG:32632\": \"+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 38S (Mayotte)\n *\n * @property EPSG:4471\n * @private\n */\n \"EPSG:4471\": \"+proj=utm +zone=38 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\",\n /**\n * CRS : UTM 40S (Réunion)\n *\n * @property EPSG:2975\n * @private\n */\n \"EPSG:2975\": \"+proj=utm +zone=40 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\",\n /**\n * CRS : UTM 5S (Polynésie)\n *\n * @property EPSG:3296\n * @private\n */\n \"EPSG:3296\": \"+proj=utm +zone=5 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs\",\n /**\n * CRS : UTM 6S (Polynésie)\n *\n * @property EPSG:3297\n * @private\n */\n \"EPSG:3297\": \"+proj=utm +zone=6 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs\",\n /**\n * CRS : UTM 7S (Polynésie)\n *\n * @property EPSG:32707\n * @private\n */\n \"EPSG:32707\": \"+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 8S (Polynésie)\n *\n * @property EPSG:32708\n * @private\n */\n \"EPSG:32708\": \"+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 12N (Ile de Clipperton)\n *\n * @property EPSG:26912\n * @private\n */\n \"EPSG:26912\": \"+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\",\n /**\n * CRS : UTM 42S (Iles Kerguelen)\n *\n * @property EPSG:32742\n * @private\n */\n \"EPSG:32742\": \"+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 39S (Iles Crozet)\n *\n * @property EPSG:32739\n * @private\n */\n \"EPSG:32739\": \"+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 43S (Iles St-Paul et Amsterdam)\n *\n * @property EPSG:32743\n * @private\n */\n \"EPSG:32743\": \"+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : Stéréographique polaire (Terre Adelie)\n *\n * @property EPSG:2986\n * @private\n */\n \"EPSG:2986\": \"\",\n /**\n * CRS : UTM 37S (Iles du canal de Mozambique)\n *\n * @property EPSG:32737\n * @private\n */\n \"EPSG:32737\": \"+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 38S (Iles du canal de Mozambique)\n *\n * @property EPSG:32738\n * @private\n */\n \"EPSG:32738\": \"+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs\",\n /**\n * CRS : UTM 1S (Wallis-et-Futuna)\n *\n * @property EPSG:2988\n * @private\n */\n \"EPSG:2988\": \"+proj=utm +zone=1 +south +ellps=intl +towgs84=253,-132,-127,0,0,0,0 +units=m +no_defs\",\n /**\n * CRS : RGNC91-93 (Nouvelle-Calédonie)\n *\n * @property EPSG:3163\n * @private\n */\n \"EPSG:3163\": \"+proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\"\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (CRS);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1JTL0NSUy5qcz9lNTVhIl0sIm5hbWVzIjpbIkNSUyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQSxJQUFJQSxHQUFHLEdBQUc7RUFFTjtBQUNKO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7RUFDSSxXQUFXLEVBQUcsMEZBQTBGO0VBRXhHO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QUFDQTtFQUNJLFdBQVcsRUFBRywySEFBMkg7RUFFekk7QUFDSjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0VBQ0ksV0FBVyxFQUFHLG1JQUFtSTtFQUVqSjtBQUNKO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7RUFDSSxZQUFZLEVBQUcsdUtBQXVLO0VBRXRMO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QUFDQTtFQUNJLFlBQVksRUFBRyxnRUFBZ0U7RUFFL0U7QUFDSjtBQU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wMCArZWxscHM9R1JTODAgK3Rvd2dzODQ9MCwwLDAsMCwwLDAsMCArdW5pdHM9bSArbm9fZGVmc1wiXG59O1xuXG5leHBvcnQgZGVmYXVsdCBDUlM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/CRS/CRS.js\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/Controls/Attribution/GPattributionItowns.css": +/*!*********************************************************************!*\ + !*** ./src/Itowns/CSS/Controls/Attribution/GPattributionItowns.css ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL0F0dHJpYnV0aW9uL0dQYXR0cmlidXRpb25JdG93bnMuY3NzPzY0YjAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvSXRvd25zL0NTUy9Db250cm9scy9BdHRyaWJ1dGlvbi9HUGF0dHJpYnV0aW9uSXRvd25zLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/Controls/Attribution/GPattributionItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/Controls/BoostRelief/GPboostReliefItowns.css": +/*!*********************************************************************!*\ + !*** ./src/Itowns/CSS/Controls/BoostRelief/GPboostReliefItowns.css ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL0Jvb3N0UmVsaWVmL0dQYm9vc3RSZWxpZWZJdG93bnMuY3NzPzE3MmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvSXRvd25zL0NTUy9Db250cm9scy9Cb29zdFJlbGllZi9HUGJvb3N0UmVsaWVmSXRvd25zLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/Controls/BoostRelief/GPboostReliefItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/Controls/Buildings/GPbuildingsItowns.css": +/*!*****************************************************************!*\ + !*** ./src/Itowns/CSS/Controls/Buildings/GPbuildingsItowns.css ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL0J1aWxkaW5ncy9HUGJ1aWxkaW5nc0l0b3ducy5jc3M/Y2UyMCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL0J1aWxkaW5ncy9HUGJ1aWxkaW5nc0l0b3ducy5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/Controls/Buildings/GPbuildingsItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/Controls/LayerSwitcher/GPlayerSwitcherItowns.css": +/*!*************************************************************************!*\ + !*** ./src/Itowns/CSS/Controls/LayerSwitcher/GPlayerSwitcherItowns.css ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL0xheWVyU3dpdGNoZXIvR1BsYXllclN3aXRjaGVySXRvd25zLmNzcz85ZWFlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIiwiZmlsZSI6Ii4vc3JjL0l0b3ducy9DU1MvQ29udHJvbHMvTGF5ZXJTd2l0Y2hlci9HUGxheWVyU3dpdGNoZXJJdG93bnMuY3NzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/Controls/LayerSwitcher/GPlayerSwitcherItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/Controls/MiniGlobe/GPminiGlobeItowns.css": +/*!*****************************************************************!*\ + !*** ./src/Itowns/CSS/Controls/MiniGlobe/GPminiGlobeItowns.css ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL01pbmlHbG9iZS9HUG1pbmlHbG9iZUl0b3ducy5jc3M/MTU2YyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL01pbmlHbG9iZS9HUG1pbmlHbG9iZUl0b3ducy5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/Controls/MiniGlobe/GPminiGlobeItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/Controls/MousePosition/GPmousePositionItowns.css": +/*!*************************************************************************!*\ + !*** ./src/Itowns/CSS/Controls/MousePosition/GPmousePositionItowns.css ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL01vdXNlUG9zaXRpb24vR1Btb3VzZVBvc2l0aW9uSXRvd25zLmNzcz9iNDY4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIiwiZmlsZSI6Ii4vc3JjL0l0b3ducy9DU1MvQ29udHJvbHMvTW91c2VQb3NpdGlvbi9HUG1vdXNlUG9zaXRpb25JdG93bnMuY3NzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/Controls/MousePosition/GPmousePositionItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/Controls/Scale/GPscaleItowns.css": +/*!*********************************************************!*\ + !*** ./src/Itowns/CSS/Controls/Scale/GPscaleItowns.css ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0NvbnRyb2xzL1NjYWxlL0dQc2NhbGVJdG93bnMuY3NzPzZlNTYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi9zcmMvSXRvd25zL0NTUy9Db250cm9scy9TY2FsZS9HUHNjYWxlSXRvd25zLmNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/Controls/Scale/GPscaleItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/CSS/GPgeneralWidgetItowns.css": +/*!**************************************************!*\ + !*** ./src/Itowns/CSS/GPgeneralWidgetItowns.css ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ1NTL0dQZ2VuZXJhbFdpZGdldEl0b3ducy5jc3M/OTk1OCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiIuL3NyYy9JdG93bnMvQ1NTL0dQZ2VuZXJhbFdpZGdldEl0b3ducy5jc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/CSS/GPgeneralWidgetItowns.css\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/Attributions.js": +/*!*********************************************!*\ + !*** ./src/Itowns/Controls/Attributions.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Utils/LayerUtils */ \"./src/Common/Utils/LayerUtils.js\");\n/* harmony import */ var _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Common/Controls/AttributionDOM */ \"./src/Common/Controls/AttributionDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"Attributions\");\n\n/**\n * @classdesc\n * Control to manage layers attributions\n *\n * @constructor\n * @alias itowns.control.Attributions\n * @extends {itowns.control.Widget}\n * @param {Object} aOptions - control options\n * @param {Object} [aOptions.options] - Itowns.control.Control options\n * @param {Boolean} [aOptions.options.collapsed = false] - Specify if the control has to be opened or not.\n * @fires attributions:update\n * @example\n * var attribution = new itowns.control.Attritbution({\n * options : {\n * collapsed: true\n * }\n * });\n * // listeners for attributions update :\n * attribution.addEventListener(\"attributions:update\", function (e) {...});\n */\nfunction Attributions(aOptions) {\n aOptions = aOptions || {};\n var options = aOptions.options || {};\n if (!(this instanceof Attributions)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options);\n var container = this._initContainer(options);\n _Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].call(this, {\n name: \"Attributions\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:Attributions\n */\nAttributions.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].prototype, {});\n\n// retrieves methods of the common class AttributionDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].assign(Attributions.prototype, _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nAttributions.prototype.constructor = Attributions;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nAttributions.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var self = this;\n\n // Adding of the listeners\n\n // At every globe movement, attributions may be updated,\n // according to layers on globe, and their visibility.\n this._callbacks.onPreRenderCallBack = function (e) {\n var allLayers = e.colorLayersId.concat(e.elevationLayersId);\n self._inRangeUpdate(allLayers, e.extent);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack);\n globe.preRenderEventFetchViewExtent();\n globe.preRenderEventFetchLayersDisplayed();\n } else {\n // delete listener\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack);\n\n // delete DOM\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_6__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nAttributions.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"Attributions:setCollapsed - missing collapsed parameter\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n document.getElementById(this._addUID(\"GPshowAttributionsList\")).checked = !collapsed;\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n *\n * @return {Boolean} collapsed\n */\nAttributions.prototype.getCollapsed = function () {\n return !document.getElementById(this._addUID(\"GPshowAttributionsList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Attributions control (called by constructor)\n *\n * @param {Object} options - Itowns.control.Control options\n * @private\n */\nAttributions.prototype._initialize = function (options) {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._AttributionContainer = null;\n\n // callbacks\n this._callbacks = {};\n\n // options\n this._options = options;\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nAttributions.prototype._initContainer = function (options) {\n var container = this._createMainContainerElement();\n\n // adds in the main container the layer display selector\n var inputShow = this._createMainAttributionsShowElement();\n container.appendChild(inputShow);\n\n // handles the \"collapsed\" mode\n if (!options.collapsed) {\n inputShow.checked = \"checked\";\n }\n // adds the layer list in the main container\n var divA = this._attributionListContainer = this._createMainAttributionsListContainer();\n var ulA = this._createAttributionsList();\n divA.appendChild(ulA);\n container.appendChild(divA);\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement(options.collapsed);\n container.appendChild(picto);\n return container;\n};\n\n/**\n * Checks layers range\n *\n * @method _inRangeUpdate\n * @param {Array} layersDisplayed - Id of the layers diplayed on screen\n * @param {Object} extent - The globe view extent\n * @private\n */\n\nAttributions.prototype._inRangeUpdate = function (layersDisplayed, extent) {\n var globe = this.getGlobe();\n var scaleDenominator = 1 / globe.getScale();\n var attributions = new Map();\n for (var h = 0; h < layersDisplayed.length; h++) {\n var layer = globe.getLayerById(layersDisplayed[h]);\n var ori = layer.source.attribution;\n if (ori) {\n for (var j = 0; j < ori.length; j++) {\n // if the attribution is already added, we skip to not add it several times\n if (attributions.has(ori[j].name)) {\n continue;\n }\n ;\n // if no constraints are associated to the originator, we just add the attribution\n if (!ori[j].constraints || !ori[j].constraints[0]) {\n // adds the attribution in the Map() called 'attributions'\n attributions.set(ori[j].name, ori[j]);\n continue;\n }\n // if the minScaleDenominator exists\n if (ori[j].constraints[0].minScaleDenominator) {\n // if min/maxScaleDenominator are equals, we display the attribution corresponding to the zoom level associated to the scale denominator\n if (ori[j].constraints[0].minScaleDenominator === ori[j].constraints[0].maxScaleDenominator) {\n // retrieves the zoom level\n var attributionZoomLevel = _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getZoomLevelFromScaleDenominator(ori[j].constraints[0].minScaleDenominator);\n // selects the scaledenominators around the corresponding zoom level\n var maxAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel - 1]) / (0.00028 * 2);\n var minAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel + 1]) / (0.00028 * 2);\n if (!(maxAttributionScaleDenominator > scaleDenominator && scaleDenominator > minAttributionScaleDenominator)) {\n continue;\n }\n // either, we check we are located between the minScaleDenominator and the maxScaleDenominator\n } else if (!(ori[j].constraints[0].minScaleDenominator < scaleDenominator && scaleDenominator < ori[j].constraints[0].maxScaleDenominator)) {\n continue;\n }\n }\n // checks if 'bbox\" exists\n if (ori[j].constraints[0].bbox) {\n // checks if we are into the bbox limits\n var intersectsX = ori[j].constraints[0].bbox.left <= extent.east && extent.west <= ori[j].constraints[0].bbox.right;\n var intersectsY = ori[j].constraints[0].bbox.bottom <= extent.north && extent.south <= ori[j].constraints[0].bbox.top;\n if (intersectsX && intersectsY) {\n // adds the attribution in the Map() called 'attributions'\n attributions.set(ori[j].name, ori[j]);\n }\n // if 'bbox' attribute doesn't exist\n } else if (!ori[j].constraints[0].bbox) {\n attributions.set(ori[j].name, ori[j]);\n }\n }\n }\n }\n if (attributions.size) {\n this._updateAttributionListContainer(attributions);\n /**\n * event triggered when the attributions are updated\n *\n * @event attributions:update\n * @type Object\n * @property {Map} attributions - list of attributions\n */\n this.dispatchEvent({\n type: \"attributions:update\",\n attributions: attributions\n });\n }\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Updates the layer list container\n *\n * @method _updateAttributionListContainer\n * @param {Map} attributions - map of attributions\n * @private\n */\nAttributions.prototype._updateAttributionListContainer = function (attributions) {\n var element = document.getElementById(this._addUID(\"GPAttributionsList\"));\n if (document.getElementById(this._addUID(\"GPAttributionsList\"))) {\n document.getElementById(this._addUID(\"GPAttributionsList\")).parentNode.removeChild(element);\n }\n var ul = this._createAttributionsList();\n attributions.forEach(function (a) {\n if (a.name) {\n var li = document.createElement(\"li\");\n var link = document.createElement(\"a\");\n link.href = a.url;\n link.innerHTML = a.name + \" \";\n link.target = \"_blank\";\n li.id = a.name.replace(/\\s/g, \"\");\n li.appendChild(link);\n ul.appendChild(li);\n }\n });\n this._attributionListContainer.appendChild(ul);\n};\nAttributions.prototype._resolutionsWGS84 = {\n 0: 156543.033928041,\n 1: 78271.51696402048,\n 2: 39135.758482010235,\n 3: 19567.87924100512,\n 4: 9783.93962050256,\n 5: 4891.96981025128,\n 6: 2445.98490512564,\n 7: 1222.99245256282,\n 8: 611.49622628141,\n 9: 305.7481131407048,\n 10: 152.8740565703525,\n 11: 76.43702828517624,\n 12: 38.21851414258813,\n 13: 19.10925707129406,\n 14: 9.554628535647032,\n 15: 4.777314267823516,\n 16: 2.388657133911758,\n 17: 1.194328566955879,\n 18: 0.5971642834779395,\n 19: 0.2985821417389697,\n 20: 0.1492910708694849,\n 21: 0.0746455354347424\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Attributions);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQXR0cmlidXRpb25zLmpzP2Q5ZjYiXSwibmFtZXMiOlsibG9nZ2VyIiwiTG9nZ2VyIiwiZ2V0TG9nZ2VyIiwiQXR0cmlidXRpb25zIiwiYU9wdGlvbnMiLCJvcHRpb25zIiwiVHlwZUVycm9yIiwiX3R5cGVvZiIsIkVycm9yIiwiX2luaXRpYWxpemUiLCJjb250YWluZXIiLCJfaW5pdENvbnRhaW5lciIsIldpZGdldCIsImNhbGwiLCJuYW1lIiwiZWxlbWVudCIsInRhcmdldCIsInBvc2l0aW9uIiwicHJvdG90eXBlIiwiT2Jq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ChhdHRyaWJ1dGlvbnMuaGFzKG9yaVtqXS5uYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vIGlmIG5vIGNvbnN0cmFpbnRzIGFyZSBhc3NvY2lhdGVkIHRvIHRoZSBvcmlnaW5hdG9yLCB3ZSBqdXN0IGFkZCB0aGUgYXR0cmlidXRpb25cbiAgICAgICAgICAgICAgICBpZiAoIW9yaVtqXS5jb25zdHJhaW50cyB8fCAhb3JpW2pdLmNvbnN0cmFpbnRzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGFkZHMgdGhlIGF0dHJpYnV0aW9uIGluIHRoZSBNYXAoKSBjYWxsZWQgJ2F0dHJpYnV0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25zLnNldChvcmlbal0ubmFtZSwgb3JpW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBtaW5TY2FsZURlbm9taW5hdG9yIGV4aXN0c1xuICAgICAgICAgICAgICAgIGlmIChvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvcikge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiBtaW4vbWF4U2NhbGVEZW5vbWluYXRvciBhcmUgZXF1YWxzLCB3ZSBkaXNwbGF5IHRoZSBhdHRyaWJ1dGlvbiBjb3JyZXNwb25kaW5nIHRvIHRoZSB6b29tIGxldmVsIGFzc29jaWF0ZWQgdG8gdGhlIHNjYWxlIGRlbm9taW5hdG9yXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvciA9PT0gb3JpW2pdLmNvbnN0cmFpbnRzWzBdLm1heFNjYWxlRGVub21pbmF0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHJpZXZlcyB0aGUgem9vbSBsZXZlbFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dHJpYnV0aW9uWm9vbUxldmVsID0gTGF5ZXJVdGlscy5nZXRab29tTGV2ZWxGcm9tU2NhbGVEZW5vbWluYXRvcihvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzZWxlY3RzIHRoZSBzY2FsZWRlbm9taW5hdG9ycyBhcm91bmQgdGhlIGNvcnJlc3BvbmRpbmcgem9vbSBsZXZlbFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1heEF0dHJpYnV0aW9uU2NhbGVEZW5vbWluYXRvciA9ICh0aGlzLl9yZXNvbHV0aW9uc1dHUzg0W2F0dHJpYnV0aW9uWm9vbUxldmVsXSArIHRoaXMuX3Jlc29sdXRpb25zV0dTODRbYXR0cmlidXRpb25ab29tTGV2ZWwgLSAxXSkgLyAoMC4wMDAyOCAqIDIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1pbkF0dHJpYnV0aW9uU2NhbGVEZW5vbWluYXRvciA9ICh0aGlzLl9yZXNvbHV0aW9uc1dHUzg0W2F0dHJpYnV0aW9uWm9vbUxldmVsXSArIHRoaXMuX3Jlc29sdXRpb25zV0dTODRbYXR0cmlidXRpb25ab29tTGV2ZWwgKyAxXSkgLyAoMC4wMDAyOCAqIDIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEobWF4QXR0cmlidXRpb25TY2FsZURlbm9taW5hdG9yID4gc2NhbGVEZW5vbWluYXRvciAmJiBzY2FsZURlbm9taW5hdG9yID4gbWluQXR0cmlidXRpb25TY2FsZURlbm9taW5hdG9yKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBlaXRoZXIsIHdlIGNoZWNrIHdlIGFyZSBsb2NhdGVkIGJldHdlZW4gdGhlIG1pblNjYWxlRGVub21pbmF0b3IgYW5kIHRoZSBtYXhTY2FsZURlbm9taW5hdG9yXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIShvcmlbal0uY29uc3RyYWludHNbMF0ubWluU2NhbGVEZW5vbWluYXRvciA8IHNjYWxlRGVub21pbmF0b3IgJiYgc2NhbGVEZW5vbWluYXRvciA8IG9yaVtqXS5jb25zdHJhaW50c1swXS5tYXhTY2FsZURlbm9taW5hdG9yKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gY2hlY2tzIGlmICdiYm94XCIgZXhpc3RzXG4gICAgICAgICAgICAgICAgaWYgKG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrcyBpZiB3ZSBhcmUgaW50byB0aGUgYmJveCBsaW1pdHNcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVyc2VjdHNYID0gKG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94LmxlZnQgPD0gZXh0ZW50LmVhc3QpICYmIChleHRlbnQud2VzdCA8PSBvcmlbal0uY29uc3RyYWludHNbMF0uYmJveC5yaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcnNlY3RzWSA9IChvcmlbal0uY29uc3RyYWludHNbMF0uYmJveC5ib3R0b20gPD0gZXh0ZW50Lm5vcnRoKSAmJiAoZXh0ZW50LnNvdXRoIDw9IG9yaVtqXS5jb25zdHJhaW50c1swXS5iYm94LnRvcCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnRlcnNlY3RzWCAmJiBpbnRlcnNlY3RzWSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWRkcyB0aGUgYXR0cmlidXRpb24gaW4gdGhlIE1hcCgpIGNhbGxlZCAnYXR0cmlidXRpb25zJ1xuICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25zLnNldChvcmlbal0ubmFtZSwgb3JpW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBpZiAnYmJveCcgYXR0cmlidXRlIGRvZXNuJ3QgZXhpc3RcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFvcmlbal0uY29uc3RyYWludHNbMF0uYmJveCkge1xuICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1dGlvbnMuc2V0KG9yaVtqXS5uYW1lLCBvcmlbal0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAoYXR0cmlidXRpb25zLnNpemUpIHtcbiAgICAgICAgdGhpcy5fdXBkYXRlQXR0cmlidXRpb25MaXN0Q29udGFpbmVyKGF0dHJpYnV0aW9ucyk7XG4gICAgICAgIC8qKlxuICAgICAgICAqIGV2ZW50IHRyaWdnZXJlZCB3aGVuIHRoZSBhdHRyaWJ1dGlvbnMgYXJlIHVwZGF0ZWRcbiAgICAgICAgKlxuICAgICAgICAqIEBldmVudCBhdHRyaWJ1dGlvbnM6dXBkYXRlXG4gICAgICAgICogQHR5cGUgT2JqZWN0XG4gICAgICAgICogQHByb3BlcnR5IHtNYXB9IGF0dHJpYnV0aW9ucyAtIGxpc3Qgb2YgYXR0cmlidXRpb25zXG4gICAgICAgICovXG4gICAgICAgIHRoaXMuZGlzcGF0Y2hFdmVudCh7XG4gICAgICAgICAgICB0eXBlIDogXCJhdHRyaWJ1dGlvbnM6dXBkYXRlXCIsXG4gICAgICAgICAgICBhdHRyaWJ1dGlvbnMgOiBhdHRyaWJ1dGlvbnNcbiAgICAgICAgfSk7XG4gICAgfVxufTtcblxuLy8gIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy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IDEyIDogMzguMjE4NTE0MTQyNTg4MTMsXG4gICAgMTMgOiAxOS4xMDkyNTcwNzEyOTQwNixcbiAgICAxNCA6IDkuNTU0NjI4NTM1NjQ3MDMyLFxuICAgIDE1IDogNC43NzczMTQyNjc4MjM1MTYsXG4gICAgMTYgOiAyLjM4ODY1NzEzMzkxMTc1OCxcbiAgICAxNyA6IDEuMTk0MzI4NTY2OTU1ODc5LFxuICAgIDE4IDogMC41OTcxNjQyODM0Nzc5Mzk1LFxuICAgIDE5IDogMC4yOTg1ODIxNDE3Mzg5Njk3LFxuICAgIDIwIDogMC4xNDkyOTEwNzA4Njk0ODQ5LFxuICAgIDIxIDogMC4wNzQ2NDU1MzU0MzQ3NDI0XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBdHRyaWJ1dGlvbnM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Attributions.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/BoostRelief.js": +/*!********************************************!*\ + !*** ./src/Itowns/Controls/BoostRelief.js ***! + \********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/BoostReliefDOM */ \"./src/Common/Controls/BoostReliefDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"BoostRelief\");\n\n/**\n * @classdesc\n * Control to exagerate the elevation\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.BoostRelief\n * @param {Object} brOptions - control options\n * @param {Object} [brOptions.scale] - Defines the scale used to boost the relief\n * @param {Number} [brOptions.scale.min] - Minimum of the scale - 1 by default\n * @param {Number} [brOptions.scale.max] - Maximum of the scale - 50 by default\n * @param {Number} [brOptions.scale.step] - Step of the scale - 1 by default\n * @param {Boolean} [brOptions.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading.\n * @param {Boolean} [brOptions.defaultBoost = 1] - Default boost value applied to the widget and the elevation layers when loaded\n * @example\n * var boostRelief = new itowns.control.BoostRelief({\n * scale : {\n * max : 30,\n * step : 2\n * },\n * defaultBoost : 6\n * })\n */\nfunction BoostRelief(brOptions) {\n brOptions = brOptions || {};\n var options = brOptions.options || {};\n if (!(this instanceof BoostRelief)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer(brOptions);\n var targetDiv = document.getElementById(options.target) || null;\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"BoostRelief\",\n element: container,\n target: targetDiv\n });\n}\n\n/*\n * @lends module:BoostRelief\n */\nBoostRelief.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class BoostReliefDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(BoostRelief.prototype, _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nBoostRelief.prototype.constructor = BoostRelief;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nBoostRelief.prototype.setGlobe = function (globe) {\n // TODO - removing listeners\n // this._globe.removeLayerListener(layers[j], GlobeViewExtended.EVENTS.Relief_PROPERTY_CHANGED, this._callbacks.onReliefLayerCallBack);\n // deletes the layerSwitcher DOM\n if (!globe) {\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nBoostRelief.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"BoostRelief:setCollapsed - missing collapsed parameter\");\n return;\n }\n if (typeof collapsed !== \"boolean\") {\n logger.error(\"BoostRelief:setCollapsed - collapsed parameter is not a boolean\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n var controlDiv = document.getElementById(this._addUID(\"GPBoostReliefListContainer\"));\n if (collapsed) {\n controlDiv.style.display = \"block\";\n document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked = true;\n } else {\n controlDiv.style.display = \"none\";\n document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked = false;\n }\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n * @return {Boolean} is collapsed\n */\nBoostRelief.prototype.getCollapsed = function () {\n return document.getElementById(this._addUID(\"GPshowBoostReliefList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize BoostRelief control (called by constructor)\n *\n * @private\n */\nBoostRelief.prototype._initialize = function () {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...)\n this._layers = {};\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} brOptions - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nBoostRelief.prototype._initContainer = function (brOptions) {\n var container = this._createMainContainerElement();\n\n // adds in the main container the layer display selector\n var inputShow = this._createMainBoostReliefShowElement(brOptions.collapsed);\n container.appendChild(inputShow);\n\n // adds the layer list in the main container\n var divA = this._boostReliefListContainer = this._createMainBoostReliefListContainer();\n var boostReliefList = this._createAdvancedToolElement(brOptions);\n divA.appendChild(boostReliefList);\n container.appendChild(divA);\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n if (brOptions.collapsed) {\n divA.style.display = \"block\";\n } else {\n divA.style.display = \"none\";\n }\n return container;\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Changes layer relief on layer relief picto click\n *\n * @method _onChangeLayerRelief\n * @param {Object} e - HTML event\n * @private\n */\n\nBoostRelief.prototype._onChangeLayerRelief = function (e) {\n var reliefValue = parseInt(e.target.value);\n var reliefId = document.getElementById(this._addUID(\"GPreliefValue\"));\n reliefId.innerHTML = \"x\" + reliefValue;\n this._updateLayersRelief(reliefValue);\n};\n\n/**\n * Updates relief values of all elevation layers\n *\n * @method _updateLayerRelief\n * @param {Number} reliefValue - relief value\n * @private\n */\n\nBoostRelief.prototype._updateLayersRelief = function (reliefValue) {\n var globe = this.getGlobe();\n function updateScale(layer, value) {\n layer.scale = value;\n globe.notifyChange(layer);\n }\n // if the scale of a single elevationLayer change, we update the scale of all others\n var elevationLayers = globe.getElevationLayers();\n for (var i = 0; i < elevationLayers.length; i++) {\n updateScale(elevationLayers[i], reliefValue);\n }\n};\n\n/**\n * Updates relief slider and all elevation layers with the given boost value\n *\n * @method changeBoost\n * @param {Number} reliefValue - relief value\n */\n\nBoostRelief.prototype.changeBoost = function (reliefValue) {\n var layerReliefInput = document.getElementById(this._addUID(\"GPreliefValueDiv\"));\n if (!layerReliefInput) {\n logger.error(\"BoostRelief:changeBoost - boostRelief slider not loaded\");\n return;\n }\n\n // the reliefValue given must me in the slider range\n if (reliefValue > layerReliefInput.max) {\n reliefValue = layerReliefInput.max;\n }\n if (reliefValue < layerReliefInput.min) {\n reliefValue = layerReliefInput.min;\n }\n\n // updates the relief of all the elevationlayers\n this._updateLayersRelief(reliefValue);\n\n // updates the slider cursor\n layerReliefInput.value = reliefValue;\n\n // updates the slider text\n var layerReliefSpan = document.getElementById(this._addUID(\"GPreliefValue\"));\n if (layerReliefSpan) {\n layerReliefSpan.innerHTML = \"x\" + reliefValue;\n }\n};\n\n/**\n * Gets layer id from div id\n *\n * @method _resolveLayerId\n * @param {String} divId - HTML div id\n * @returns {String} layer id\n * @private\n */\nBoostRelief.prototype._resolveLayerId = function (divId) {\n var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].name(divId); // ex GPvisibilityPicto_ID_26\n return divName.substring(divName.indexOf(\"_ID_\") + 4); // ex. 26\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (BoostRelief);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQm9vc3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1xuICAgICAgICBsYXllclJlbGllZlNwYW4uaW5uZXJIVE1MID0gXCJ4XCIgKyByZWxpZWZWYWx1ZTtcbiAgICB9XG59O1xuXG4vKipcbiAqIEdldHMgbGF5ZXIgaWQgZnJvbSBkaXYgaWRcbiAqXG4gKiBAbWV0aG9kIF9yZXNvbHZlTGF5ZXJJZFxuICogQHBhcmFtIHtTdHJpbmd9IGRpdklkIC0gSFRNTCBkaXYgaWRcbiAqIEByZXR1cm5zIHtTdHJpbmd9IGxheWVyIGlkXG4gKiBAcHJpdmF0ZVxuICovXG5Cb29zdFJlbGllZi5wcm90b3R5cGUuX3Jlc29sdmVMYXllcklkID0gZnVuY3Rpb24gKGRpdklkKSB7XG4gICAgdmFyIGRpdk5hbWUgPSBTZWxlY3RvcklELm5hbWUoZGl2SWQpOyAvLyBleCBHUHZpc2liaWxpdHlQaWN0b19JRF8yNlxuICAgIHJldHVybiBkaXZOYW1lLnN1YnN0cmluZyhkaXZOYW1lLmluZGV4T2YoXCJfSURfXCIpICsgNCk7IC8vIGV4LiAyNlxufTtcblxuZXhwb3J0IGRlZmF1bHQgQm9vc3RSZWxpZWY7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/BoostRelief.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/Buildings.js": +/*!******************************************!*\ + !*** ./src/Itowns/Controls/Buildings.js ***! + \******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Controls/BuildingsDOM */ \"./src/Common/Controls/BuildingsDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_4__);\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display buildings on the map\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.Buildings\n * @param {Object} buildingsOptions - control options\n * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT\n * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground\n * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation\n * @param {Integer} [buildingsOptions.minZoom = 15] - minimum level of zoom the buildings are displayed. 15 by default. Lower is the value, lower are the performances.\n * @example\n * var buildings = new itowns.control.Buildings ({\n * MNT : false,\n * buildingsOnGround : false,\n * target : “controlDiv”\n * })\n */\nfunction Buildings(buildingsOptions) {\n var options = buildingsOptions || {};\n if (!(this instanceof Buildings)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n options = this.setOptions(options);\n this._initialize(options);\n var container = this._initContainer(options);\n var targetDiv = document.getElementById(options.target) || null;\n _Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].call(this, {\n name: \"Buildings\",\n element: container,\n target: targetDiv\n });\n}\n\n/*\n * @lends module:Buildings\n */\nBuildings.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype, {});\n\n// retrieves methods of the common class BuildingsDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assign(Buildings.prototype, _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nBuildings.prototype.constructor = Buildings;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nBuildings.prototype.setGlobe = function (globe) {\n if (!globe) {\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Buildings control (called by constructor)\n *\n * @param {Object} options - control options\n *\n * @private\n */\nBuildings.prototype._initialize = function (options) {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...)\n this._options = options;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nBuildings.prototype._initContainer = function (options) {\n var container = this._createMainContainerElement();\n\n // adds the widget picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n return container;\n};\n\n/**\n * Adds the default french ELEVATION.ELEVATIONGRIDCOVERAGE MNT to the globe\n *\n * @method addMNT\n * @param {Object} globe - globeView\n * @private\n */\nBuildings.prototype.addMNT = function (globe) {\n var mntLayer = {\n type: \"elevation\",\n id: \"IGN_MNT_HIGHRES\",\n noDataValue: -99999,\n source: {\n protocol: \"wmts\",\n url: \"https://data.geopf.fr/wmts\",\n name: \"ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES\",\n attribution: [{\n name: \"IGN\",\n attribution: \"IGN Grandes Echelles\",\n url: \"http://www.ign.fr\",\n constraints: [{\n crs: \"EPSG:4326\"\n }]\n }],\n updateStrategy: {\n type: 1,\n options: {\n groups: [3, 7, 11, 14]\n }\n },\n networkOptions: {\n crossOrigin: \"omit\"\n },\n format: \"image/x-bil;bits=32\",\n crs: \"EPSG:4326\",\n tileMatrixSet: \"WGS84G\",\n tileMatrixSetLimits: {\n 6: {\n minTileRow: 13,\n maxTileRow: 36,\n minTileCol: 62,\n maxTileCol: 80\n },\n 7: {\n minTileRow: 27,\n maxTileRow: 73,\n minTileCol: 124,\n maxTileCol: 160\n },\n 8: {\n minTileRow: 55,\n maxTileRow: 146,\n minTileCol: 248,\n maxTileCol: 320\n },\n 9: {\n minTileRow: 110,\n maxTileRow: 292,\n minTileCol: 497,\n maxTileCol: 640\n },\n 10: {\n minTileRow: 221,\n maxTileRow: 585,\n minTileCol: 994,\n maxTileCol: 1281\n },\n 11: {\n minTileRow: 442,\n maxTileRow: 1171,\n minTileCol: 1989,\n maxTileCol: 2563\n },\n 12: {\n minTileRow: 885,\n maxTileRow: 2343,\n minTileCol: 3978,\n maxTileCol: 5126\n },\n 13: {\n minTileRow: 1770,\n maxTileRow: 4687,\n minTileCol: 7957,\n maxTileCol: 10253\n },\n 14: {\n minTileRow: 3540,\n maxTileRow: 9375,\n minTileCol: 15914,\n maxTileCol: 20507\n }\n }\n }\n };\n function createWMTSSourceFromConfig(config) {\n config.source = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"WMTSSource\"](config.source);\n return config;\n }\n ;\n function addElevationLayerFromConfig(config, globe) {\n var layer = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"ElevationLayer\"](config.id, config);\n globe.addLayer(layer);\n }\n ;\n var mntConfig = createWMTSSourceFromConfig(mntLayer);\n addElevationLayerFromConfig(mntConfig, globe);\n};\n\n/**\n * Adds or removes the buildings layer on click\n *\n * @method addBuildings\n * @param {options} options for the buildings control\n */\nBuildings.prototype.addBuildings = function (options) {\n var vectorStyle = \"https://wxs.ign.fr/static/vectorTiles/styles/PLAN.IGN/essentiels/standard.json\";\n var layerId = \"VTBuilding\";\n // ---------- DISPLAY VECTOR TILED BUILDING DATA AS 3D MESHES : ----------\n // Define the source of the building data : those are vector tiled data from the geoportail.\n var buildingsSource = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"VectorTilesSource\"]({\n style: vectorStyle,\n // We only want to display buildings related data.\n // We remove some buildings without alti_sol property (it causes graphical)\n filter: function filter(layer) {\n return layer[\"source-layer\"].includes(\"bati_surf\") && !layer[\"filter\"].includes(\"CIMETIERE_SURF\") && !layer[\"filter\"].includes(\"FOOT_SURF\") && !layer[\"filter\"].includes(\"TENNIS_SURF\") && !layer[\"filter\"].includes(\"MULTI_SPORT_SURF\") && layer.paint[\"fill-color\"];\n }\n });\n\n // Defines if the buildings must be displayed on the MNT or at the zero level\n var baseAltitude;\n var extrusionHeight;\n // To extend the extrusion on the ground when altitude is not accurate, we add a delta parameter\n var delta = 10;\n if (options.buildingsOnGround) {\n baseAltitude = 0;\n extrusionHeight = function extrusionHeight(p) {\n return p.hauteur || 0;\n };\n } else {\n baseAltitude = function baseAltitude(p) {\n return p.alti_sol - delta || 0;\n };\n extrusionHeight = function extrusionHeight(p) {\n return p.hauteur + delta || 0;\n };\n }\n\n // Create a FeatureGeometryLayer to support building data.\n var buildingsLayer = new itowns__WEBPACK_IMPORTED_MODULE_4__[\"FeatureGeometryLayer\"](layerId, {\n source: buildingsSource,\n zoom: {\n min: options.minZoom\n },\n accurate: false,\n style: new itowns__WEBPACK_IMPORTED_MODULE_4__[\"Style\"]({\n fill: {\n base_altitude: baseAltitude,\n extrusion_height: extrusionHeight\n }\n })\n });\n this.getGlobe().addLayer(buildingsLayer);\n\n // initial settings for buildings visibility and button\n this.getGlobe().setLayerVisibility(layerId, options.defaultVisibility);\n if (options.defaultVisibility === true) {\n this._toggleBuildingsButton(this.getElement(), \"off\");\n } else {\n this._toggleBuildingsButton(this.getElement(), \"on\");\n }\n};\n\n/**\n * Set the buildings visibility on click\n *\n * @method setBuildingsVisibility\n * @param {Tring} layerId - layer id for the building layer\n */\nBuildings.prototype.setBuildingsVisibility = function (layerId) {\n if (this.getGlobe().getFeatureGeometryLayers()[0].visible === true) {\n this.getGlobe().setLayerVisibility(layerId, false);\n this._toggleBuildingsButton(this.getElement(), \"on\");\n } else {\n this.getGlobe().setLayerVisibility(layerId, true);\n this._toggleBuildingsButton(this.getElement(), \"off\");\n }\n};\n\n/**\n * Set the button picture on click\n *\n * @method _toggleBuildingsButton\n * @param {DOM} element - DOM element of the buildings Widget\n * @param {String} mode - \"on\" or \"off\" to display the deactivated or activated buildings image\n *\n * @private\n */\nBuildings.prototype._toggleBuildingsButton = function (element, mode) {\n if (mode === \"on\") {\n element.lastChild.classList.remove(\"buildingsOff\");\n element.lastChild.classList.add(\"buildingsOn\");\n } else {\n element.lastChild.classList.remove(\"buildingsOn\");\n element.lastChild.classList.add(\"buildingsOff\");\n }\n};\n\n/**\n * onWidgetAdded : function called when globeVewExtended.addwidget is called\n *\n * @method onWidgetAdded\n * @param {Object} widget - buildings widget\n *\n * @private\n */\nBuildings.prototype.onWidgetAdded = function (widget) {\n var widgetOptions = widget.getOptions();\n if (widgetOptions.MNT !== false) {\n this.addMNT(widget.getGlobe());\n }\n this.addBuildings(widgetOptions);\n this.addListener(this.getElement());\n};\n\n/**\n * addListener : adds the clic listener to handle buildings visibility on the given element\n *\n * @param {DOM} element - DOM element where the listener has to be added\n *\n * @private\n */\nBuildings.prototype.addListener = function (element) {\n element.onclick = function () {\n this.setBuildingsVisibility(\"VTBuilding\");\n }.bind(this);\n};\n\n/**\n * setOptions : set the options of the widget\n *\n * @param {Object} options - options to set\n * @returns {Object} buildingOptions - widget options\n * @private\n */\nBuildings.prototype.setOptions = function (options) {\n var buildingsOptions = {};\n buildingsOptions.MNT = options.MNT !== false;\n buildingsOptions.buildingsOnGround = options.buildingsOnGround || false;\n buildingsOptions.defaultVisibility = options.defaultVisibility !== false;\n buildingsOptions.minZoom = options.minZoom || 15;\n // common widget options\n buildingsOptions.target = options.target;\n buildingsOptions.name = options.name;\n buildingsOptions.element = options.element;\n buildingsOptions.position = options.position;\n return buildingsOptions;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Buildings);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvQnVpbGRpbmdzLmpzPzhmYWQiXSwibmFtZXMiOlsiQnVpbGRpbmdzIiwiYnVpbGRpbmdzT3B0aW9ucyIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJfdHlwZW9mIiwiRXJyb3IiLCJzZXRPcHRpb25zIiwiX2luaXRpYWxpemUiLCJjb250YWluZXIiLCJfaW5pdENvbnRhaW5lciIsInRhcmdldERpdiIsImRvY3VtZW50IiwiZ2V0RWxlbWVudEJ5SWQiLCJ0YXJnZXQiLCJXaWRnZXQiLCJjYWxsIiwibmFtZSIsImVsZW1lbnQiLCJwcm90b3R5cGUiLCJPYmplY3QiLCJjcmVhdGUiLCJVdGlscyIsImFzc2lnbiIsIkJ1aWxkaW5nc0RPTSIsImNvbnN0cnVjdG9yIiwic2V0R2xvYmUiLCJnbG9iZSIsIl9lbGVtZW50IiwiaGFzQ2hpbGROb2RlcyIsInJlbW92ZUNoaWxkIiwibGFzdENoaWxkIiwicGFyZW50Tm9kZSIsIl91aWQiLCJTZWxlY3RvcklEIiwiZ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jdH0gZ2xvYmUgLSBnbG9iZVZpZXdcbiAqIEBwcml2YXRlXG4gKi9cbkJ1aWxkaW5ncy5wcm90b3R5cGUuYWRkTU5UID0gZnVuY3Rpb24gKGdsb2JlKSB7XG4gICAgdmFyIG1udExheWVyID0ge1xuICAgICAgICB0eXBlIDogXCJlbGV2YXRpb25cIixcbiAgICAgICAgaWQgOiBcIklHTl9NTlRfSElHSFJFU1wiLFxuICAgICAgICBub0RhdGFWYWx1ZSA6IC05OTk5OSxcbiAgICAgICAgc291cmNlIDoge1xuICAgICAgICAgICAgcHJvdG9jb2wgOiBcIndtdHNcIixcbiAgICAgICAgICAgIHVybCA6IFwiaHR0cHM6Ly9kYXRhLmdlb3BmLmZyL3dtdHNcIixcbiAgICAgICAgICAgIG5hbWUgOiBcIkVMRVZBVElPTi5FTEVWQVRJT05HUklEQ09WRVJBR0UuSElHSFJFU1wiLFxuICAgICAgICAgICAgYXR0cmlidXRpb24gOiBbe1xuICAgICAgICAgICAgICAgIG5hbWUgOiBcIklHTlwiLFxuICAgICAgICAgICAgICAgIGF0dHJpYnV0aW9uIDogXCJJR04gR3JhbmRlcyBFY2hlbGxlc1wiLFxuICAgICAgICAgICAgICAgIHVybCA6IFwiaHR0cDovL3d3dy5pZ24uZnJcIixcbiAgICAgICAgICAgICAgICBjb25zdHJhaW50cyA6IFt7XG4gICAgICAgICAgICAgICAgICAgIGNycyA6IFwiRVBTRzo0MzI2XCJcbiAgICAgICAgICAgICAgICB9XVxuICAgICAgICAgICAgfV0sXG4gICAgICAgICAgICB1cGRhdGVTdHJhdGVneSA6IHtcbiAgICAgICAgICAgICAgICB0eXBlIDogMSxcbiAgICAgICAgICAgICAgICBvcHRpb25zIDoge1xuICAgICAgICAgICAgICAgICAgICBncm91cHMgOiBbMywgNywgMTEsIDE0XVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXR3b3JrT3B0aW9ucyA6IHtcbiAgICAgICAgICAgICAgICBjcm9zc09yaWdpbiA6IFwib21pdFwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZm9ybWF0IDogXCJpbWFnZS94LWJpbDtiaXRzPTMyXCIsXG4gICAgICAgICAgICBjcnMgOiBcIkVQU0c6NDMyNlwiLFxuICAgICAgICAgICAgdGlsZU1hdHJpeFNldCA6IFwiV0dTODRHXCIsXG4gICAgICAgICAgICB0aWxlTWF0cml4U2V0TGltaXRzIDoge1xuICAgICAgICAgICAgICAgIDYgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiAxMyxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDM2LFxuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlQ29sIDogNjIsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiA4MFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgNyA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDI3LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlUm93IDogNzMsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiAxNjBcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIDggOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiA1NSxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDE0NixcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDI0OCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDMyMFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgOSA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDExMCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDI5MixcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZUNvbCA6IDQ5NyxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDY0MFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgMTAgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiAyMjEsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVSb3cgOiA1ODUsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiA5OTQsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVDb2wgOiAxMjgxXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAxMSA6IHtcbiAgICAgICAgICAgICAgICAgICAgbWluVGlsZVJvdyA6IDQ0MixcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDExNzEsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiAxOTg5LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogMjU2M1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgMTIgOiB7XG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVSb3cgOiA4ODUsXG4gICAgICAgICAgICAgICAgICAgIG1heFRpbGVSb3cgOiAyMzQzLFxuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlQ29sIDogMzk3OCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZUNvbCA6IDUxMjZcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIDEzIDoge1xuICAgICAgICAgICAgICAgICAgICBtaW5UaWxlUm93IDogMTc3MCxcbiAgICAgICAgICAgICAgICAgICAgbWF4VGlsZVJvdyA6IDQ2ODcsXG4gICAgICAgICAgICAgICAgICAgIG1pblRpbGVDb2wgOiA3OTU3LFxuICAgICAgICAgICAgICAgICAgICBtYXhUaWxlQ29sIDogMTAyNTNcbiAgICAgICAgICAgICAgICB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luWm9vbSA9IG9wdGlvbnMubWluWm9vbSB8fCAxNTtcbiAgICAvLyBjb21tb24gd2lkZ2V0IG9wdGlvbnNcbiAgICBidWlsZGluZ3NPcHRpb25zLnRhcmdldCA9IG9wdGlvbnMudGFyZ2V0O1xuICAgIGJ1aWxkaW5nc09wdGlvbnMubmFtZSA9IG9wdGlvbnMubmFtZTtcbiAgICBidWlsZGluZ3NPcHRpb25zLmVsZW1lbnQgPSBvcHRpb25zLmVsZW1lbnQ7XG4gICAgYnVpbGRpbmdzT3B0aW9ucy5wb3NpdGlvbiA9IG9wdGlvbnMucG9zaXRpb247XG5cbiAgICByZXR1cm4gYnVpbGRpbmdzT3B0aW9ucztcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEJ1aWxkaW5ncztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Buildings.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/LayerSwitcher.js": +/*!**********************************************!*\ + !*** ./src/Itowns/Controls/LayerSwitcher.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Controls/LayerSwitcherDOM */ \"./src/Common/Controls/LayerSwitcherDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"LayerSwitcher\");\n\n/**\n * @classdesc\n * Control to manage globe layers : their order, visibility and opacity, and display their informations (title, description, legends, metadata...)\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.LayerSwitcher\n * @param {Object} lsOptions - control options\n * @param {Array} [lsOptions.layers] - list of layers to be configured. Each array element is an object, with following properties :\n * @param {String} [lsOptions.layers.id] - ol.layer.Layer layer to be configured (that has been added to globe)\n * @param {Object} [lsOptions.layers.config] - custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties :\n * @param {String} [lsOptions.layers.config.title] - layer alias, to be displayed in widget layer list. E.g. : \"Cartes IGN\"\n * @param {String} [lsOptions.layers.config.description] - layer description, to be displayed on title hover, or in layer information panel.\n * @param {String} [lsOptions.layers.config.quicklookUrl] - link to a quick look image for this layer.\n * @param {Array} [lsOptions.layers.config.legends] - array of layer legends. Each array element is an object, with following properties :\n * - url (String, mandatory) : link to a legend\n * - minScaleDenominator (Number, optional) : min scale denominator for legend validity.\n * @param {Array} [lsOptions.layers.config.metadata] - array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata\n * @param {Object} [lsOptions.options] - Itowns.control.Control options\n * @param {Boolean} [lsOptions.options.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading.\n * @example\n * var layerSwitcher = new itowns.control.LayerSwitcher({\n * layers : [\n * {\n * id : \"myLayer\",\n * config : {\n * title : \"test layer name 1\",\n * description : \"test layer desc 1\",\n * }\n * }\n * ],\n * options : {\n * collapsed : false\n * }\n * ));\n */\nfunction LayerSwitcher(lsOptions) {\n lsOptions = lsOptions || {};\n var options = lsOptions.options || {};\n var layers = lsOptions.layers || [];\n if (!(this instanceof LayerSwitcher)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (!Array.isArray(layers)) {\n throw new Error(\"ERROR WRONG_TYPE : layers should be an array\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options, layers);\n var container = this._initContainer(options);\n // property to save layers conf added after the LS is initialized\n this._addedLayerConf = {};\n _Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].call(this, {\n name: \"LayerSwitcher\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:LayerSwitcher\n */\nLayerSwitcher.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].prototype, {});\n\n// retrieves methods of the common class LayerSwitcherDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].assign(LayerSwitcher.prototype, _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nLayerSwitcher.prototype.constructor = LayerSwitcher;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nLayerSwitcher.prototype.setGlobe = function (globe) {\n var layers;\n if (globe) {\n // in the case the control is added to the globe\n var self = this;\n\n // add options layers to layerlist.\n // (only the layers configurated by the user in the options of the layerSwitcher )\n // the other layers of the map will be added in the setGlobe method\n for (var i = 0; i < this._initLayers.length; i++) {\n // retrieves the layer...\n var layer = null;\n if (this._initLayers[i].id) {\n layer = globe.getLayerById(this._initLayers[i].id);\n }\n if (layer && this._initLayers[i].displayed) {\n // .. and the infos of the configuration if they exist (title, description, legends, quicklook, metadata)\n var conf = this._initLayers[i].config || {};\n var layerOptions = {\n title: conf.title || layer.title || this._initLayers[i].id,\n description: conf.description || null,\n legends: conf.legends || [],\n metadata: conf.metadata || [],\n quicklookUrl: conf.quicklookUrl || null\n };\n if (typeof conf.ipr !== \"undefined\") {\n layerOptions.ipr = conf.ipr;\n }\n if (typeof conf.opacity !== \"undefined\") {\n layerOptions.opacity = conf.opacity;\n }\n if (typeof conf.visibility !== \"undefined\") {\n layerOptions.visibility = conf.visibility;\n }\n this._layers[layer.id] = layerOptions;\n }\n }\n\n // adds the layers\n this._addGlobeLayers(globe);\n\n // adding of listeners\n this._callbacks.onOpacityLayerCallBack = function (e) {\n self._updateLayerOpacity(e.target.id, e[\"new\"].opacity);\n };\n this._callbacks.onVisibilityLayerCallBack = function (e) {\n self._updateLayerVisibility(e.target.id, e[\"new\"].visible);\n };\n\n // At every globe movement, layer switcher may be updated,\n // according to layers on globe, and their range.\n this._callbacks.onChangedViewCallBack = function (e) {\n self._inRangeUpdate(e.colorLayersId);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack);\n // prerender events returns visible layers\n globe.preRenderEventFetchColorLayersDisplayed();\n this._callbacks.onAddedLayerCallBack = function (e) {\n var id = e.layerId;\n if (self) {\n if (!self._layerDisplayedInLayerSwitcher(id)) {\n return;\n }\n var layer = self.getGlobe().getLayerById(id);\n if (layer.type === \"elevation\") {\n return;\n }\n var layerConf = self._getLayerConf(id) || self._addedLayerConf[id];\n if (layerConf) {\n self.addLayer(layer, layerConf);\n } else {\n self.addLayer(layer);\n }\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack);\n this._callbacks.onRemovedLayerCallBack = function (e) {\n var id = e.layerId;\n\n // update the index max and delete the layer from the layerswitcher\n if (self) {\n self.removeLayer(id);\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack);\n this._callbacks.onIndexLayerCallBack = function (e) {\n var arraysEquals = function arraysEquals(a1, a2) {\n if (a1.length !== a2.length) {\n return false;\n }\n for (var i = 0; i < a1.length; ++i) {\n if (a1[i] !== a2[i]) {\n return false;\n }\n }\n return true;\n };\n if (!arraysEquals(e[\"new\"].sequence, e.previous.sequence)) {\n self._updateLayerListContainer();\n }\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack);\n layers = globe.getColorLayers();\n for (var ii = 0; ii < layers.length; ++ii) {\n globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n self._updateLayerVisibility(layers[ii].id, layers[ii].visible);\n self._updateLayerOpacity(layers[ii].id, layers[ii].opacity);\n }\n } else {\n // removes the listeners associated to the deleted layerswitcher\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack);\n layers = this._globe.getColorLayers();\n for (var j = 0; j < layers.length; ++j) {\n this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n }\n // deletes the layerSwitcher DOM\n while (this._element.hasChildNodes()) {\n this._element.removeChild(this._element.lastChild);\n }\n this._element.parentNode.removeChild(this._element);\n }\n\n // calls original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_5__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n/**\n * Adds a new layer to control (when added to globe) or add new layer configuration\n *\n * @param {Object} layer - layer to add to layer switcher\n * @param {Object} [config] - additional options for layer configuration\n * @param {Object} [config.title] - layer title (default is layer identifier)\n * @param {Object} [config.description] - layer description (default is null)\n * @param {Object} [config.legends] - layer legends (default is an empty array)\n * @param {Object} [config.metadata] - layer metadata (default is an empty array)\n * @param {Object} [config.quicklookUrl] - layer quicklookUrl (default is null)\n * @example\n * layerSwitcher.addLayer({\n * layer : gpParcels,\n * config : {\n * title : \"Parcelles cadastrales\",\n * description : \"description de la couche\",\n * quicklookUrl : \"http://quicklookUrl.fr\"\n * }\n * })\n */\nLayerSwitcher.prototype.addLayer = function (layer, config) {\n config = config || {};\n var globe = this.getGlobe();\n if (!layer) {\n logger.error(\"LayerSwitcher:addLayer - missing layer parameter\");\n return;\n }\n var id = layer.id;\n if (id === \"undefined\") {\n logger.error(\"LayerSwitcher:addLayer - configuration cannot be set for \" + layer + \" layer (layer id not found)\");\n return;\n }\n\n // subscription to the events\n globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack);\n globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack);\n\n // make sure layer is in globe layers\n var LayerInGlobe = globe.getLayerById(id);\n if (!LayerInGlobe) {\n logger.error(\"LayerSwitcher:addLayer - configuration cannot be set for \", layer, \" layer (layer is not in globe layers )\");\n return;\n }\n\n // if layer is not already in layers list, add it to control (layers list and container div)\n if (!this._layers[id]) {\n // 1. add layer to layers list\n var layerInfos = this._getLayerInfo(layer) || {};\n var layerOptions = {\n title: config.title || layerInfos._title || id,\n description: config.description || layerInfos._description || null,\n legends: config.legends || layerInfos._legends || [],\n metadata: config.metadata || layerInfos._metadata || [],\n quicklookUrl: config.quicklookUrl || layerInfos._quicklookUrl || null\n };\n if (typeof config.ipr !== \"undefined\") {\n layerOptions.ipr = config.ipr;\n layer.attribution = layerOptions.ipr;\n }\n if (typeof config.opacity !== \"undefined\") {\n layerOptions.opacity = config.opacity;\n layer.opacity = layerOptions.opacity;\n }\n if (typeof config.visibility !== \"undefined\") {\n layerOptions.visibility = config.visibility;\n layer.visible = layerOptions.visibility;\n }\n this._layers[id] = layerOptions;\n\n // creation of the div of the layer which will be added to the layerSwitcher\n this._layers[id].div = this._createLayerDiv(id);\n this._updateLayerListContainer();\n\n // user may also add a new configuration for an already added layer\n } else {\n // add new configuration parameters to layer informations\n for (var prop in config) {\n if (config.hasOwnProperty(prop)) {\n this._layers[id][prop] = config[prop];\n }\n }\n if (typeof config.ipr !== \"undefined\") {\n layer.attribution = config.ipr;\n }\n if (typeof config.opacity !== \"undefined\") {\n layer.opacity = config.opacity;\n }\n if (typeof config.visibility !== \"undefined\") {\n layer.visible = config.visibility;\n }\n // set new title in layer div\n if (config.title) {\n var nameDiv = document.getElementById(this._addUID(\"GPname_ID_\" + id));\n if (nameDiv) {\n nameDiv.innerHTML = config.title;\n // FIXME a ajouter?\n // nameDiv.title = config.description || config.title;\n }\n }\n // add layer info picto if necessary\n var infodiv = document.getElementById(this._addUID(\"GPinfo_ID_\" + id));\n if (!document.getElementById(this._addUID(\"GPinfo_ID_\" + id)) && config.description && (config.legends || config.metadata || config.quicklookUrl)) {\n var advancedTools = document.getElementById(this._addUID(\"GPadvancedTools_ID_\" + id));\n if (advancedTools) {\n advancedTools.appendChild(this._createAdvancedToolInformationElement({\n id: id\n }));\n }\n }\n // close layer info element if open, to update information.\n if (infodiv && infodiv.className === \"GPlayerInfoOpened\") {\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n infodiv.className = \"GPlayerInfo\";\n }\n }\n};\n\n/**\n * Removes a layer from control\n *\n * @param {Object} layerId - layer to remove to layer switcher\n */\nLayerSwitcher.prototype.removeLayer = function (layerId) {\n var layerList = document.getElementById(this._addUID(\"GPlayersList\"));\n // close layer info element if open.\n var infodiv = document.getElementById(this._addUID(\"GPinfo_ID_\" + layerId));\n if (infodiv && infodiv.className === \"GPlayerInfoOpened\") {\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n infodiv.className = \"GPlayerInfo\";\n }\n // remove layer div\n var layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layerId));\n\n // no layerDiv retrieved for VT-label layers\n if (layerDiv) {\n layerList.removeChild(layerDiv);\n }\n\n // removes layer of the layer list\n delete this._layers[layerId];\n};\n\n/**\n * Collapse or display control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nLayerSwitcher.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"LayerSwitcher:setCollapsed - missing collapsed parameter\");\n return;\n }\n var isCollapsed = this.getCollapsed();\n if (collapsed && isCollapsed || !collapsed && !isCollapsed) {\n return;\n }\n // simulates the panel opening after a click\n if (!isCollapsed) {\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n document.getElementById(this._addUID(\"GPlayerInfoPanel\")).className = \"GPlayerInfoPanelClosed\";\n }\n document.getElementById(this._addUID(\"GPshowLayersList\")).checked = !collapsed;\n};\n\n/**\n * Returns true if widget is collapsed (minimize), false otherwise\n * @return {Boolean} is collapsed\n */\nLayerSwitcher.prototype.getCollapsed = function () {\n return !document.getElementById(this._addUID(\"GPshowLayersList\")).checked;\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize LayerSwitcher control (called by constructor)\n *\n * @param {Object} options - Itowns.control.Control options\n * @param {Array} layers - list of layers to be configured. Each array element is an object, with following properties :\n * @private\n */\nLayerSwitcher.prototype._initialize = function (options, layers) {\n // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].generate();\n\n // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, opacity, visibility, title, description...)\n this._layers = {};\n\n // div which will contain the divs of the lists\n this._layerListContainer = null;\n\n // callbacks\n this._callbacks = {};\n\n // options\n this._options = options;\n this._initLayers = layers;\n};\n\n/**\n * Returns the layer configuration defined at widget initialization\n *\n * @method _getLayerConf\n * @param {String} layerId - layer id\n * @return {Object} layerConfig - layer configuration\n * @private\n */\nLayerSwitcher.prototype._getLayerConf = function (layerId) {\n for (var i = 0; i < this._initLayers.length; ++i) {\n if (this._initLayers[i].id === layerId) {\n return this._initLayers[i].config;\n }\n }\n return null;\n};\n\n/**\n * Indicates if the layer must be displayed in the layerSwitcher\n *\n * @method _layerDisplayedInLayerSwitcher\n * @param {String} layerId - layer id\n * @return {Boolean} displayed\n * @private\n */\nLayerSwitcher.prototype._layerDisplayedInLayerSwitcher = function (layerId) {\n for (var i = 0; i < this._initLayers.length; ++i) {\n if (this._initLayers[i].id === layerId) {\n return typeof this._initLayers[i].displayed === \"undefined\" || this._initLayers[i].displayed;\n }\n }\n return true;\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @param {Object} options - control options\n * @returns {DOMElement} container - widget container\n * @private\n */\nLayerSwitcher.prototype._initContainer = function (options) {\n // creation of the main container\n var container = this._createMainContainerElement();\n\n // adding in the main container\n var input = this._createMainLayersShowElement();\n container.appendChild(input);\n\n // handling of the \"collapsed\" mode\n if (!options.collapsed) {\n input.checked = \"checked\";\n }\n // adds the layer list in the main container\n var divL = this._layerListContainer = this._createMainLayersElement();\n container.appendChild(divL);\n\n // creates the draggable mode\n this._createDraggableElement(divL, this);\n\n // adds the control picto in the main container\n var picto = this._createMainPictoElement();\n container.appendChild(picto);\n\n // adds the info panel in the main container\n var divI = this._createMainInfoElement();\n container.appendChild(divI);\n return container;\n};\n\n/**\n * Adds control layers to control main container\n *\n * @method _addGlobeLayers\n * @param {Object} globe - the Itowns.GlobeViewExtended object\n * @private\n */\nLayerSwitcher.prototype._addGlobeLayers = function (globe) {\n // Retrieves the element which contains the different layers\n var elementLayersList;\n var childNodes = this.getElement().childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].id === this._addUID(\"GPlayersList\")) {\n elementLayersList = childNodes[i];\n break;\n }\n }\n // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array)\n var layers = globe.getColorLayers();\n var orderedLayers = layers.sort(function (a, b) {\n return b.sequence - a.sequence;\n });\n\n // loop over all the layers of the map in order to add them to the control layer list (if they are not already added)\n orderedLayers.forEach(function (layer) {\n // adds the map layers to the list\n var id;\n id = layer.id;\n if (!this._layerDisplayedInLayerSwitcher(id)) {\n return;\n }\n var layerConf = this._getLayerConf(id) || this._addedLayerConf[id] || {};\n var layerInfos = this._getLayerInfo(layer) || {};\n if (!this._layers[id]) {\n // if the layer is not yet in the layer list (this._layers), we add it\n var layerOptions = {\n title: layerConf.title || layerInfos._title || id,\n description: layerConf.description || layerInfos._description || null,\n legends: layerConf.legends || layerInfos._legends || [],\n metadata: layerConf.metadata || layerInfos._metadata || [],\n quicklookUrl: layerConf.quicklookUrl || layerInfos._quicklookUrl || null\n };\n this._layers[id] = layerOptions;\n } else {\n var lsLayerConf = this._layers[id];\n if (typeof lsLayerConf.ipr !== \"undefined\") {\n layer.options.attribution = lsLayerConf.ipr;\n }\n if (typeof lsLayerConf.opacity !== \"undefined\") {\n layer.opacity = lsLayerConf.opacity;\n }\n if (typeof lsLayerConf.visibility !== \"undefined\") {\n layer.visible = lsLayerConf.visibility;\n }\n }\n var layerDiv = this._createLayerDiv(id);\n this._layers[id].div = layerDiv;\n elementLayersList.appendChild(layerDiv);\n }, this);\n};\n\n/**\n * creates layer div (to append to control DOM element).\n *\n * @method _createLayerDiv\n * @param {String} layerId - layer id\n * @returns {DOMElement} layer div\n * @private\n */\nLayerSwitcher.prototype._createLayerDiv = function (layerId) {\n var layerOptions = this._layers[layerId];\n var isLegends = layerOptions.legends && layerOptions.legends.length !== 0;\n var isMetadata = layerOptions.metadata && layerOptions.metadata.length !== 0;\n var isQuicklookUrl = layerOptions.quicklookUrl;\n if (isLegends || isMetadata || isQuicklookUrl) {\n layerOptions.displayInformationElement = true;\n }\n\n // adds a specific div in the control for the layer\n layerOptions.id = layerId;\n var layerDiv = this._createContainerLayerElement(layerOptions);\n if (!layerOptions.inRange) {\n layerDiv.classList.add(\"outOfRange\");\n }\n return layerDiv;\n};\n\n// ################################################################### //\n// ######################### DOM events ############################## //\n// ################################################################### //\n\n/**\n * Changes layer opacity on layer opacity picto click\n *\n * @method _onChangeLayerOpacity\n * @param {Object} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onChangeLayerOpacity = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n var opacityValue = e.target.value;\n var opacityId = document.getElementById(this._addUID(\"GPopacityValue_ID_\" + layerID));\n opacityId.innerHTML = opacityValue + \"%\";\n globe.setLayerOpacity(layerID, opacityValue / 100);\n};\n\n/**\n * Updates picto opacity value on layer opacity change\n *\n * @method _updateLayerOpacity\n * @param {String} layerId - layer id\n * @param {Number} opacity - opacity value\n * @private\n */\nLayerSwitcher.prototype._updateLayerOpacity = function (layerId, opacity) {\n if (opacity > 1) {\n opacity = 1;\n }\n if (opacity < 0) {\n opacity = 0;\n }\n var layerOpacityInput = document.getElementById(this._addUID(\"GPopacityValueDiv_ID_\" + layerId));\n if (layerOpacityInput) {\n layerOpacityInput.value = Math.round(opacity * 100);\n }\n var layerOpacitySpan = document.getElementById(this._addUID(\"GPopacityValue_ID_\" + layerId));\n if (layerOpacitySpan) {\n layerOpacitySpan.innerHTML = Math.round(opacity * 100) + \"%\";\n }\n};\n\n/**\n * Changes layer visibility on layer visibility picto click\n *\n * @method _onVisibilityLayerClick\n * @param {Object} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onVisibilityLayerClick = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n globe.setLayerVisibility(layerID, e.target.checked); // update viewer\n};\n\n/**\n * Changes picto visibility on layer visibility change\n *\n * @method _updateLayerVisibility\n * @param {String} layerId - layer id\n * @param {Boolean} visibility - visible if true\n * @private\n */\nLayerSwitcher.prototype._updateLayerVisibility = function (layerId, visibility) {\n var layerVisibilityInput = document.getElementById(this._addUID(\"GPvisibility_ID_\" + layerId));\n if (layerVisibilityInput) {\n layerVisibilityInput.checked = visibility;\n }\n};\n\n/**\n * Opens layer information panel on picto click\n *\n * @method _onOpenLayerInfoClick\n * @param {Event} e - MouseEvent\n * @private\n */\nLayerSwitcher.prototype._onOpenLayerInfoClick = function (e) {\n var layerID = this._resolveLayerId(e.target.id);\n var layerOptions = this._layers[layerID];\n var panel;\n var info;\n\n // Close layer info panel\n var divId = document.getElementById(e.target.id);\n if (divId.className === \"GPlayerInfoOpened\") {\n if (divId.classList !== undefined) {\n divId.classList.remove(\"GPlayerInfoOpened\");\n divId.classList.add(\"GPlayerInfo\");\n }\n panel = document.getElementById(this._addUID(\"GPlayerInfoPanel\"));\n if (panel.classList !== undefined) {\n panel.classList.remove(\"GPpanel\");\n panel.classList.remove(\"GPlayerInfoPanelOpened\");\n panel.classList.add(\"GPlayerInfoPanelClosed\");\n }\n info = document.getElementById(this._addUID(\"GPlayerInfoContent\"));\n panel.removeChild(info);\n return;\n }\n var layers = document.getElementsByClassName(\"GPlayerInfoOpened\");\n for (var i = 0; i < layers.length; i++) {\n layers[i].className = \"GPlayerInfo\";\n }\n\n // Open layer info panel\n if (divId.classList !== undefined) {\n divId.classList.remove(\"GPlayerInfo\");\n divId.classList.add(\"GPlayerInfoOpened\");\n }\n panel = document.getElementById(this._addUID(\"GPlayerInfoPanel\"));\n if (panel.classList !== undefined) {\n panel.classList.add(\"GPpanel\");\n panel.classList.remove(\"GPlayerInfoPanelClosed\");\n panel.classList.add(\"GPlayerInfoPanelOpened\");\n }\n info = document.getElementById(this._addUID(\"GPlayerInfoContent\"));\n if (info) {\n panel.removeChild(info);\n }\n\n // on récupère les infos associées au layer pour mettre dynamiquement le contenu du panel d'informations\n var obj = {\n title: layerOptions.title,\n description: layerOptions.description,\n quicklookUrl: layerOptions.quicklookUrl,\n metadata: layerOptions.metadata,\n legends: layerOptions.legends\n };\n var infoLayer = this._createContainerLayerInfoElement(obj);\n panel.appendChild(infoLayer);\n};\n\n/**\n * removes layer from layer switcher and globe on picto click\n *\n * @method _onDropLayerClick\n * @param {Event} e - MouseEvent\n * @private\n */\nLayerSwitcher.prototype._onDropLayerClick = function (e) {\n var globe = this.getGlobe();\n var layerID = this._resolveLayerId(e.target.id);\n // removing the layer will trigger the event listener\n // which will call this.removeLayer and delete the div\n globe.removeLayer(layerID);\n this._updateLayerListContainer();\n};\n\n/**\n * changes layers order on drag and drop\n *\n * @method _onDropLayerClick\n * @param {Event} e - HTML event\n * @private\n */\nLayerSwitcher.prototype._onDragAndDropLayerClick = function (e) {\n var globe = this.getGlobe();\n\n // Handling of the indexes : gives the little indexes (lowest layers) to the non-visible layers (displayed: false)\n // when the index of a visible layer changes.\n // Always moves the non-visible layers under the other layers (to not hide them)\n\n if (e.newIndex - e.oldIndex === 0) {\n return;\n }\n var targetIndex = null;\n if (e.newIndex) {\n var layerTargetID = this._resolveLayerId(e.from.childNodes[e.newIndex + (e.newIndex - e.oldIndex < 0 ? 1 : -1)].id);\n targetIndex = globe.getLayerById(layerTargetID).sequence;\n } else {\n targetIndex = globe.getColorLayers().length - 1;\n }\n var layerID = this._resolveLayerId(e.item.id);\n globe.moveLayerToIndex(layerID, targetIndex);\n};\n\n/**\n * Checks layers range\n *\n * @method _inRangeUpdate\n * @param {Array} layersDisplayed - list of displayed layers id\n * @private\n */\nLayerSwitcher.prototype._inRangeUpdate = function (layersDisplayed) {\n for (var layerKey in this._layers) {\n var layer = this._layers[layerKey];\n if (!layer) {\n continue;\n }\n // Check if layer is displayed.\n var layerDiv;\n var bInRange = layersDisplayed.indexOf(layer.id) >= 0;\n if (bInRange && !layer.inRange) {\n layer.inRange = true;\n layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layer.id));\n layerDiv.classList.remove(\"outOfRange\");\n } else if (!bInRange && layer.inRange) {\n layer.inRange = false;\n layerDiv = document.getElementById(this._addUID(\"GPlayerSwitcher_ID_\" + layer.id));\n layerDiv.classList.add(\"outOfRange\");\n }\n }\n};\n\n/**\n * Update the layer list container\n *\n * @method _updateLayerListContainer\n * @private\n */\nLayerSwitcher.prototype._updateLayerListContainer = function () {\n if (this._layerListContainer) {\n var globe = this.getGlobe();\n\n // empty the previous container\n while (this._layerListContainer.firstChild) {\n this._layerListContainer.removeChild(this._layerListContainer.firstChild);\n }\n // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array)..\n var layers = globe.getColorLayers();\n var orderedLayers = layers.sort(function (a, b) {\n return b.sequence - a.sequence;\n });\n // ... and adds the correct div to the different layers, in the zindex decreasing order\n for (var j = 0; j < orderedLayers.length; j++) {\n if (!this._layers[orderedLayers[j].id]) {\n continue;\n }\n // retrieves the div of the layer, stored in the _layers array\n var layerDiv = this._layers[orderedLayers[j].id].div;\n this._layerListContainer.appendChild(layerDiv);\n }\n } else {\n logger.error(\"[Itowns.control.LayerSwitcher] _updateLayerListContainer : layer list container not found to update layers order ?!\");\n }\n};\n\n// ################################################################### //\n// ############################ Utils ################################ //\n// ################################################################### //\n\n/**\n * Gets layer informations : title, description, quicklookurl, legends, metadata\n *\n * @private\n * @memberof LayerSwitcher\n * @method _getLayerInfo\n * @param {Object} layer - the layer object\n * @returns {Object} layerInfo - layer informations\n */\nLayerSwitcher.prototype._getLayerInfo = function (layer) {\n var layerInfo = {};\n if (layer) {\n layerInfo._title = layer.title || null;\n layerInfo._description = layer.description || null;\n layerInfo._quicklookUrl = layer.quicklookUrl || null;\n layerInfo._metadata = layer.metadata || null;\n layerInfo._legends = layer.legends || null;\n }\n return layerInfo;\n};\n\n/**\n * Gets layer id from div id\n *\n * @method _resolveLayerId\n * @param {String} divId - HTML div id\n * @returns {String} layer id\n * @private\n */\nLayerSwitcher.prototype._resolveLayerId = function (divId) {\n var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__[\"default\"].name(divId); // ex GPvisibilityPicto_ID_26\n return divName.substring(divName.indexOf(\"_ID_\") + 4); // ex. 26\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerSwitcher);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTGF5ZXJTd2l0Y2hlci5qcz82ODk1Il0sIm5hbWVzIjpbImxvZ2dlciIsIkxvZ2dlciIsImdldExvZ2dlciIsIkxheWVyU3dpdGNoZXIiLCJsc09wdGlvbnMiLCJ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JlIGxvYWRpbmcuXG4gKiBAZXhhbXBsZVxuICogdmFyIGxheWVyU3dpdGNoZXIgPSBuZXcgaXRvd25zLmNvbnRyb2wuTGF5ZXJTd2l0Y2hlcih7XG4gKiAgbGF5ZXJzIDogW1xuICogICAgICB7XG4gKiAgICAgICAgICBpZCA6IFwibXlMYXllclwiLFxuICogICAgICAgICAgY29uZmlnIDoge1xuICogICAgICAgICAgICAgIHRpdGxlIDogXCJ0ZXN0IGxheWVyIG5hbWUgMVwiLFxuICogICAgICAgICAgICAgIGRlc2NyaXB0aW9uIDogXCJ0ZXN0IGxheWVyIGRlc2MgMVwiLFxuICogICAgICAgICAgfVxuICogICAgICB9XG4gKiAgXSxcbiAqICBvcHRpb25zIDoge1xuICogICAgICBjb2xsYXBzZWQgOiBmYWxzZVxuICogIH1cbiAqICkpO1xuICovXG5mdW5jdGlvbiBMYXllclN3aXRjaGVyIChsc09wdGlvbnMpIHtcbiAgICBsc09wdGlvbnMgPSBsc09wdGlvbnMgfHwge307XG4gICAgdmFyIG9wdGlvbnMgPSBsc09wdGlvbnMub3B0aW9ucyB8fCB7fTtcbiAgICB2YXIgbGF5ZXJzID0gbHNPcHRpb25zLmxheWVycyB8fCBbXTtcblxuICAgIGlmICghKHRoaXMgaW5zdGFuY2VvZiBMYXllclN3aXRjaGVyKSkge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwiRVJST1IgQ0xBU1NfQ09OU1RSVUNUT1JcIik7XG4gICAgfVxuXG4gICAgaWYgKCFBcnJheS5pc0FycmF5KGxheWVycykpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1IgV1JPTkdfVFlQRSA6IGxheWVycyBzaG91bGQgYmUgYW4gYXJyYXlcIik7XG4gICAgfVxuXG4gICAgaWYgKHR5cGVvZiBvcHRpb25zICE9PSBcIm9iamVjdFwiKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SIFdST05HX1RZUEUgOiBvcHR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5pdExheWVyc1tpXS5pZCkge1xuICAgICAgICAgICAgICAgIGxheWVyID0gZ2xvYmUuZ2V0TGF5ZXJCeUlkKHRoaXMuX2luaXRMYXllcnNbaV0uaWQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAobGF5ZXIgJiYgdGhpcy5faW5pdExheWVyc1tpXS5kaXNwbGF5ZWQpIHtcbiAgICAgICAgICAgICAgICAvLyAuLiBhbmQgdGhlIGluZm9zIG9mIHRoZSBjb25maWd1cmF0aW9uIGlmIHRoZXkgZXhpc3QgKHRpdGxlLCBkZXNjcmlwdGlvbiwgbGVnZW5kcywgcXVpY2tsb29rLCBtZXRhZGF0YSlcbiAgICAgICAgICAgICAgICB2YXIgY29uZiA9IHRoaXMuX2luaXRMYXllcnNbaV0uY29uZmlnIHx8IHt9O1xuICAgICAgICAgICAgICAgIHZhciBsYXllck9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlIDogY29uZi50aXRsZSB8fCBsYXllci50aXRsZSB8fCB0aGlzLl9pbml0TGF5ZXJzW2ldLmlkLFxuICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdGlvbiA6IGNvbmYuZGVzY3JpcHRpb24gfHwgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbGVnZW5kcyA6IGNvbmYubGVnZW5kcyB8fCBbXSxcbiAgICAgICAgICAgICAgICAgICAgbWV0YWRhdGEgOiBjb25mLm1ldGFkYXRhIHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBjb25mLnF1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvbmYuaXByICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyT3B0aW9ucy5pcHIgPSBjb25mLmlwcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaW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Y29yZGluZyB0byBsYXllcnMgb24gZ2xvYmUsIGFuZCB0aGVpciByYW5nZS5cbiAgICAgICAgdGhpcy5fY2FsbGJhY2tzLm9uQ2hhbmdlZFZpZXdDYWxsQmFjayA9IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICBzZWxmLl9pblJhbmdlVXBkYXRlKGUuY29sb3JMYXllcnNJZCk7XG4gICAgICAgIH07XG4gICAgICAgIGdsb2JlLmxpc3RlbihHbG9iZVZpZXdFeHRlbmRlZC5FVkVOVFMuUFJFX1JFTkRFUiwgdGhpcy5fY2FsbGJhY2tzLm9uQ2hhbmdlZFZpZXdDYWxsQmFjayk7XG4gICAgICAgIC8vIHByZXJlbmRlciBldmVudHMgcmV0dXJucyB2aXNpYmxlIGxheWVyc1xuICAgICAgICBnbG9iZS5wcmVSZW5kZXJFdmVudEZldGNoQ29sb3JMYXllcnNEaXNwbGF5ZWQoKTtcblxuICAgICAgICB0aGlzLl9jYWxsYmFja3Mub25BZGRlZExheWVyQ2FsbEJhY2sgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgdmFyIGlkID0gZS5sYXllcklkO1xuICAgICAgICAgICAgaWYgKHNlbGYpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXNlbGYuX2xheWVyRGlzcGxheWVkSW5MYXllclN3aXRjaGVyKGlkKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBsYXllciA9IHNlbGYuZ2V0R2xvYmUoKS5nZXRMYXllckJ5SWQoaWQpO1xuICAgICAgICAgICAgICAgIGlmIChsYXllci50eXBlID09PSBcImVsZXZhdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGxheWVyQ29uZiA9IHNlbGYuX2dldExheWVyQ29uZihpZCkgfHwgc2VsZi5fYWRkZWRMYXllckNvbmZbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChsYXllckNvbmYpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5hZGRMYXllcihsYXllciwgbGF5ZXJDb25mKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZExheWVyKGxheWVyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGdsb2JlLmxpc3RlbihHbG9iZVZpZXdFeHRlbmRlZC5FVkVOVFMuTEFZRVJfQURERUQsIHRoaXMuX2NhbGxiYWNrcy5vbkFkZGVkTGF5ZXJDYWxsQmFjayk7XG5cbiAgICAgICAgdGhpcy5fY2FsbGJhY2tzLm9uUmVtb3ZlZExheWVyQ2FsbEJhY2sgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgdmFyIGlkID0gZS5sYXllcklkO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGluZGV4IG1heCBhbmQgZGVsZXRlIHRoZSBsYXllciBmcm9tIHRoZSBsYXllcnN3aXRjaGVyXG4gICAgICAgICAgICBpZiAoc2VsZikge1xuICAgICAgICAgICAgICAgIHNlbGYucmVtb3ZlTGF5ZXIoaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBnbG9iZS5saXN0ZW4oR2xvYmVWaWV3RXh0ZW5kZWQuRVZFTlRTLkxBWUVSX1JFTU9WRUQsIHRoaXMuX2NhbGxiYWNrcy5vblJlbW92ZWRMYXllckNhbGxCYWNrKTtcblxuICAgICAgICB0aGlzLl9jYWxsYmFja3Mub25JbmRleExheWVyQ2FsbEJhY2sgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgdmFyIGFycmF5c0VxdWFscyA9IGZ1bmN0aW9uIChhMSwgYTIpIHtcbiAgICAgICAgICAgICAgICBpZiAoYTEubGVuZ3RoICE9PSBhMi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGExLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhMVtpXSAhPT0gYTJbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGlmICghYXJyYXlzRXF1YWxzKGUubmV3LnNlcXVlbmNlLCBlLnByZXZpb3VzLnNlcXVlbmNlKSkge1xuICAgICAgICAgICAgICAgIHNlbGYuX3VwZGF0ZUxheWVyTGlzdENvbnRhaW5lcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBnbG9iZS5saXN0ZW4oR2xvYmVWaWV3RXh0ZW5kZWQuRVZFTlRTLkxBWUVSU19PUkRFUl9DSEFOR0VELCB0aGlzLl9jYWxsYmFja3Mub25JbmRleExheWVyQ2FsbEJhY2spO1xuXG4gICAgICAgIGxheWVycyA9IGdsb2JlLmdldENvbG9yTGF5ZXJzKCk7XG4gICAgICAgIGZvciAodmFyIGlpID0gMDsgaWkgPCBsYXllcnMubGVuZ3RoOyArK2lpKSB7XG4gICAgICAgICAgICBnbG9iZS5hZGRMYXllckxpc3RlbmVyKGxheWVyc1tpaV0sIEdsb2JlVmlld0V4dGVuZGVkLkVWRU5UUy5PUEFDSVRZX1BST1BFUlRZX0NIQU5HRUQsIHRoaXMuX2NhbGxiYWNrcy5vbk9wYWNpdHlMYXllckNhbGxCYWNrKTtcbiAgICAgICAgICAgIGdsb2JlLmFkZExheWVyTGlzdGVuZXIobGF5ZXJzW2lpXSwgR2xvYmVWaWV3RXh0ZW5kZWQuRVZFTlRTLlZJU0lC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dG8gbGF5ZXIgaW5mb3JtYXRpb25zXG4gICAgICAgIGZvciAodmFyIHByb3AgaW4gY29uZmlnKSB7XG4gICAgICAgICAgICBpZiAoY29uZmlnLmhhc093blByb3BlcnR5KHByb3ApKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fbGF5ZXJzW2lkXVtwcm9wXSA9IGNvbmZpZ1twcm9wXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvbmZpZy5pcHIgIT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgIGxheWVyLmF0dHJpYnV0aW9uID0gY29uZmlnLmlwcjtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvbmZpZy5vcGFjaXR5ICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICBsYXllci5vcGFjaXR5ID0gY29uZmlnLm9wYWNpdHk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBjb25maWcudmlzaWJpbGl0eSAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgbGF5ZXIudmlzaWJsZSA9IGNvbmZpZy52aXNpYmlsaXR5O1xuICAgICAgICB9XG4gICAgICAgIC8vIHNldCBuZXcgdGl0bGUgaW4gbGF5ZXIgZGl2XG4gICAgICAgIGlmIChjb25maWcudGl0bGUpIHtcbiAgICAgICAgICAgIHZhciBuYW1lRGl2ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQodGhpcy5fYWRkVUlEKFwiR1BuYW1lX0lEX1wiICsgaWQpKTtcbiAgICAgICAgICAgIGlmIChuYW1lRGl2KSB7XG4gICAgICAgICAgICAgICAgbmFtZURpdi5pbm5lckhUTUwgPSBjb25maWcudGl0bGU7XG4gICAgICAgICAgICAgICAgLy8gRklYTUUgYSBham91dGVyP1xuICAgICAgICAgICAgICAgIC8vIG5hbWVEaXYudGl0bGUgPSBjb25maWcuZGVzY3JpcHRpb24gf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mUgbm90IGFscmVhZHkgYWRkZWQpXG4gICAgb3JkZXJlZExheWVycy5mb3JFYWNoKFxuICAgICAgICBmdW5jdGlvbiAobGF5ZXIpIHtcbiAgICAgICAgICAgIC8vIGFkZHMgdGhlIG1hcCBsYXllcnMgdG8gdGhlIGxpc3RcbiAgICAgICAgICAgIHZhciBpZDtcbiAgICAgICAgICAgIGlkID0gbGF5ZXIuaWQ7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX2xheWVyRGlzcGxheWVkSW5MYXllclN3aXRjaGVyKGlkKSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBsYXllckNvbmYgPSB0aGlzLl9nZXRMYXllckNvbmYoaWQpIHx8IHRoaXMuX2FkZGVkTGF5ZXJDb25mW2lkXSB8fCB7fTtcbiAgICAgICAgICAgIHZhciBsYXllckluZm9zID0gdGhpcy5fZ2V0TGF5ZXJJbmZvKGxheWVyKSB8fCB7fTtcbiAgICAgICAgICAgIGlmICghdGhpcy5fbGF5ZXJzW2lkXSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBsYXllciBpcyBub3QgeWV0IGluIHRoZSBsYXllciBsaXN0ICh0aGlzLl9sYXllcnMpLCB3ZSBhZGQgaXRcbiAgICAgICAgICAgICAgICB2YXIgbGF5ZXJPcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICB0aXRsZSA6IGxheWVyQ29uZi50aXRsZSB8fCBsYXllckluZm9zLl90aXRsZSB8fCBpZCxcbiAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRpb24gOiBsYXllckNvbmYuZGVzY3JpcHRpb24gfHwgbGF5ZXJJbmZvcy5fZGVzY3JpcHRpb24gfHwgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbGVnZW5kcyA6IGxheWVyQ29uZi5sZWdlbmRzIHx8IGxheWVySW5mb3MuX2xlZ2VuZHMgfHwgW10sXG4gICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhIDogbGF5ZXJDb25mLm1ldGFkYXRhIHx8IGxheWVySW5mb3MuX21ldGFkYXRhIHx8IFtdLFxuICAgICAgICAgICAgICAgICAgICBxdWlja2xvb2tVcmwgOiBsYXllckNvbmYucXVpY2tsb29rVXJsIHx8IGxheWVySW5mb3MuX3F1aWNrbG9va1VybCB8fCBudWxsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB0aGlzLl9sYXllcnNbaWRdID0gbGF5ZXJPcHRpb25zO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgbHNMYXllckNvbmYgPSB0aGlzLl9sYXllcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbHNMYXllckNvbmYuaXByICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyLm9wdGlvbnMuYXR0cmlidXRpb24gPSBsc0xheWVyQ29uZi5pcHI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbHNMYXllckNvbmYub3BhY2l0eSAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgICAgICAgICBsYXllci5vcGFjaXR5ID0gbHNMYXllckNvbmYub3BhY2l0eTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBsc0xheWVyQ29uZi52aXNpYmlsaXR5ICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyLnZpc2libGUgPSBsc0xheWVyQ29uZi52aXNpYmlsaXR5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGxheWVyRGl2ID0gdGhpcy5fY3JlYXRlTGF5ZXJEaXYoaWQpO1xuICAgICAgICAgICAgdGhpcy5fbGF5ZXJzW2lkXS5kaXYgPSBsYXllckRpdjtcbi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G4gKiBAbWV0aG9kIF9yZXNvbHZlTGF5ZXJJZFxuICogQHBhcmFtIHtTdHJpbmd9IGRpdklkIC0gSFRNTCBkaXYgaWRcbiAqIEByZXR1cm5zIHtTdHJpbmd9IGxheWVyIGlkXG4gKiBAcHJpdmF0ZVxuICovXG5MYXllclN3aXRjaGVyLnByb3RvdHlwZS5fcmVzb2x2ZUxheWVySWQgPSBmdW5jdGlvbiAoZGl2SWQpIHtcbiAgICB2YXIgZGl2TmFtZSA9IFNlbGVjdG9ySUQubmFtZShkaXZJZCk7IC8vIGV4IEdQdmlzaWJpbGl0eVBpY3RvX0lEXzI2XG4gICAgcmV0dXJuIGRpdk5hbWUuc3Vic3RyaW5nKGRpdk5hbWUuaW5kZXhPZihcIl9JRF9cIikgKyA0KTsgLy8gZXguIDI2XG59O1xuXG5leHBvcnQgZGVmYXVsdCBMYXllclN3aXRjaGVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/LayerSwitcher.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/MiniGlobe.js": +/*!******************************************!*\ + !*** ./src/Itowns/Controls/MiniGlobe.js ***! + \******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/MiniGlobeDOM */ \"./src/Common/Controls/MiniGlobeDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display the MiniGlobe with itowns\n *\n * @constructor\n * @extends {itowns.control.Widget}\n * @alias itowns.control.MiniGlobe\n * @param {Object} [options] - control options\n * @param {Object} [options.layer] - custom itowns layer to display on the mini globe\n * @example\n * var miniglobe = new itowns.control.MiniGlobe();\n *\n */\nfunction MiniGlobe(options) {\n options = options || {};\n if (!(this instanceof MiniGlobe)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer();\n this._options = options;\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"Overview\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:MiniGlobe\n */\nMiniGlobe.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class MiniGlobeDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(MiniGlobe.prototype, _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nMiniGlobe.prototype.constructor = MiniGlobe;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nMiniGlobe.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var minDistance = 6650000;\n var maxDistance = 30000000;\n var positionOnGlobe = globe.getCenter();\n var miniView = new _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._element, positionOnGlobe, {\n // `limit globe' subdivision level:\n // we're don't need a precise globe model\n // since the mini globe will always be seen from a far point of view (see minDistance above)\n maxSubdivisionLevel: 6,\n sseSubdivisionThreshold: 3,\n // Don't instance default controls since miniview's camera will be synced\n // on the main view's one (see globeView.onAfterRender)\n noControls: true\n });\n miniView.setBackground();\n var updateMiniGlobeHandler = function updateMiniGlobeHandler() {\n // clamp distance camera from globe\n var distanceCamera = globe.getGlobeView().camera.camera3D.position.length();\n var distance = Math.min(Math.max(distanceCamera, minDistance), maxDistance);\n var camera = miniView.getGlobeView().camera.camera3D;\n var cameraTargetPosition = globe.getGlobeView().controls.getCameraTargetPosition();\n // Update target miniview's camera\n camera.position.copy(cameraTargetPosition).setLength(distance);\n camera.lookAt(cameraTargetPosition);\n miniView.notifyChange(camera);\n };\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.AFTER_RENDER, updateMiniGlobeHandler);\n if (globe.isInitialized()) {\n updateMiniGlobeHandler();\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, updateMiniGlobeHandler);\n }\n\n /**\n * Add one imagery layer to the miniview (by default, the ortho)\n */\n var miniGlobeLayer = this._options.layer;\n miniView.addLayer(miniGlobeLayer);\n // save as property of the control the globe created for the overview\n this._globeObj = miniView;\n } else if (globe == null) {\n // if globe == null we remove the overview control\n // we delete the overview control DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize MiniGlobe control (called by constructor)\n *\n * @private\n */\nMiniGlobe.prototype._initialize = function () {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._MiniGlobeContainer = null;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Creates control main container\n *\n * @method _initContainer\n * @returns {DOMElement} container - widget container\n * @private\n */\nMiniGlobe.prototype._initContainer = function () {\n var container = this._createMainContainerElement();\n return container;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MiniGlobe);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTWluaUdsb2JlLmpzP2UxNTIiXSwibmFtZXMiOlsiTWluaUdsb2JlIiwib3B0aW9ucyIsIlR5cGVFcnJvciIsIl90eXBlb2YiLCJFcnJvciIsIl9pbml0aWFsaXplIiwiY29udGFpbmVyIiwiX2luaXRDb250YWluZXIiLCJfb3B0aW9ucyIsIldpZGdldCIsImNhbGwiLCJuYW1lIiwiZWxlbWVudCIsInRhcmdldCIsInBvc2l0aW9uIiwicHJvdG90eXBlIiwiT2JqZWN0IiwiY3JlYXRlIiwiVXRpbHMiLCJhc3NpZ24iLCJNaW5pR2xvYmVET00iLCJjb25zdHJ1Y3RvciIsInNldEdsb2JlIiwiZ2xvYmUiLCJtaW5EaXN0YW5jZSIsIm1heERpc3RhbmNlIiwicG9zaXRpb25Pbkdsb2JlIiwiZ2V0Q2VudGVyIiwibWluaVZpZXciLCJHbG9iZVZpZXdFeHRlbmRlZC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BzZXZlcmFsIHdpZGdldHMgb24gdGhlIHNhbWUgcGFnZSlcbiAgICB0aGlzLl91aWQgPSBTZWxlY3RvcklELmdlbmVyYXRlKCk7XG5cbiAgICAvLyBkaXYgd2hpY2ggd2lsbCBjb250YWluIHRoZSBsaXN0IGRpdnMuXG4gICAgdGhpcy5fTWluaUdsb2JlQ29udGFpbmVyID0gbnVsbDtcblxuICAgIC8vIGNhbGxiYWNrc1xuICAgIHRoaXMuX2NhbGxiYWNrcyA9IHt9O1xufTtcblxuLyoqXG4gKiBDcmVhdGVzIGNvbnRyb2wgbWFpbiBjb250YWluZXJcbiAqXG4gKiBAbWV0aG9kIF9pbml0Q29udGFpbmVyXG4gKiBAcmV0dXJucyB7RE9NRWxlbWVudH0gY29udGFpbmVyIC0gd2lkZ2V0IGNvbnRhaW5lclxuICogQHByaXZhdGVcbiAqL1xuTWluaUdsb2JlLnByb3RvdHlwZS5faW5pdENvbnRhaW5lciA9IGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgY29udGFpbmVyID0gdGhpcy5fY3JlYXRlTWFpbkNvbnRhaW5lckVsZW1lbnQoKTtcblxuICAgIHJldHVybiBjb250YWluZXI7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBNaW5pR2xvYmU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/MiniGlobe.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/MousePosition.js": +/*!**********************************************!*\ + !*** ./src/Itowns/Controls/MousePosition.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! proj4 */ \"./node_modules/proj4/dist/proj4-src.js-exposed\");\n/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(proj4__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Common/Controls/MousePositionDOM */ \"./src/Common/Controls/MousePositionDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\n/* harmony import */ var _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Utils/PositionFormater */ \"./src/Itowns/Controls/Utils/PositionFormater.js\");\n/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../CRS/CRS */ \"./src/Itowns/CRS/CRS.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n\n\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"MousePosition\");\n\n/**\n * @classdesc\n *\n * MousePosition Control.\n *\n * @constructor\n * @alias itowns.control.MousePosition\n * @extends {itowns.control.Control}\n * @param {Object} options - options for function call.\n * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol)\n * @param {Boolean} [options.collapsed = true] - Specify if MousePosition control should be collapsed at startup. Default is true.\n * @param {Array} [options.systems] - list of projection systems, default are Geographical (\"EPSG:4326\"), Web Mercator (\"EPSG:3857\"), Lambert 93 (\"EPSG:2154\") and extended Lambert 2 (\"EPSG:27572\").\n * Each array element (=system) is an object with following properties :\n * @param {String} options.systems.crs - Proj4 crs alias (from proj4 defs). e.g. : \"EPSG:4326\". Required\n * @param {String} [options.systems.label] - CRS label to be displayed in control. Default is crs code (e.g. \"EPSG:4326\")\n * @param {String} options.systems.type - CRS units type for coordinates conversion : \"Geographical\" or \"Metric\". Default: \"Metric\"\n * @param {Object} [options.systems.geoBBox] - Aera covered by the system (WGS84 coordinates).\n * @param {Number} options.systems.geoBBox.right - Right bound.\n * @param {Number} options.systems.geoBBox.left - Left bound.\n * @param {Number} options.systems.geoBBox.top - Top bound.\n * @param {Number} options.systems.geoBBox.bottom - Bottom bound.\n * @param {Array} [options.units] - list of coordinates units, to be displayed in control units list.\n * Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal), \"RAD\" (radians) and \"GON\" (grades) for geographical coordinates,\n * and \"M\" or \"KM\" for metric coordinates\n * @param {Array} [options.displayAltitude = true] - activate (true) or deactivate (false) the altitude panel. True by default\n * @param {Array} [options.displayCoordinates = true] - activate (true) or deactivate (false) the coordinates panel. True by default\n * @param {Object} [options.altitude] - elevation configuration\n * @param {Object} [options.altitude.serviceOptions] - options of elevation service\n * @param {Number} [options.altitude.responseDelay] - latency for altitude request, 500 ms by default\n * @param {Number} [options.altitude.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default\n * @example\n * var mousePosition = new itowns.control.MousePosition({\n * collapsed : false,\n * displayCoordinates : true,\n * displayAltitude : true,\n * altitude : {\n * triggerDelay : 100,\n * responseDelay : 500,\n * serviceOptions : {}\n * },\n * systems : [\n * {\n * crs : \"EPSG:3857\",\n * label : \"Mercator\",\n * type : \"Metric\"\n * },\n * {\n * crs : \"EPSG:32620\",\n * label : \"UTM 20N (Guadeloupe, Martinique)\",\n * type : \"Metric\",\n * geoBBox : {\n * left: -66.00,\n * bottom : 0.00,\n * right : -60.00,\n * top : 84.00\n * }\n * }\n * ],\n * units : [\"DEC\", \"DMS\"]\n * });\n */\nfunction MousePosition(options) {\n options = options || {};\n if (!(this instanceof MousePosition)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize(options);\n this._callbacks = {};\n\n // init control DOM container\n var container = this._initContainer(options);\n _Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].call(this, {\n name: \"MousePosition\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n;\n\n/**\n * @lends module:MousePosition\n */\nMousePosition.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].prototype, {});\n_Common_Utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].assign(MousePosition.prototype, _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n\n/**\n * Constructor (alias)\n */\nMousePosition.prototype.constructor = MousePosition;\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nMousePosition.prototype.setGlobe = function (globe) {\n if (globe) {\n // In the case of the adding of a control to the globe\n this._centerElement = this._createMapCenter();\n globe.getTargetElement().appendChild(this._centerElement);\n\n // defines the callback on the map to retrieve the coordinates\n this._callbacks.mouseMove = this.onMouseMove.bind(this);\n\n // valid event for desktop mode\n if (!this.collapsed) {\n if (this._isDesktop) {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n }\n } else if (globe == null) {\n // if globe == null we remove the MP control\n // deletes the listener associated to the mousePosition control\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n // deletes the mousePosition control DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n this._globe.getTargetElement().removeChild(this._centerElement);\n }\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// #################### user interface methods ####################### //\n// ################################################################### //\n\n/**\n * Sets additional projection system\n *\n * @param {Object} system - Projection system defined in the Itowns/CRS/CRS.js class\n * @param {String} system.crs - Proj4 crs alias (from proj4 defs) e.g. \"EPSG:4326\"\n * @param {String} [system.label] - CRS label to be displayed in control. Default is system.crs alias\n * @param {String} [system.type] - CRS units type for coordinates conversion (one of control options.units). Default is \"Metric\"\n */\nMousePosition.prototype.addSystem = function (system) {\n if (_typeof(system) !== \"object\") {\n logger.error(\"MousePosition:addSystem - system parameter should be an object\");\n return;\n }\n if (!system.crs) {\n logger.error(\"crs not defined !\");\n return;\n }\n if (!system.label) {\n logger.warn(\"crs label not defined, use crs code by default.\");\n system.label = system.crs;\n }\n if (!system.type) {\n logger.warn(\"type srs not defined, use 'Metric' by default.\");\n system.type = \"Metric\";\n }\n\n // 1. adds system to control systems\n for (var j = 0; j < this._projectionSystems.length; j++) {\n var obj = this._projectionSystems[j];\n if (system.crs === obj.crs) {\n // warn user\n logger.warn(\"crs '{}' already configured\", obj.crs);\n }\n }\n system.code = this._projectionSystems.length;\n this._projectionSystems.push(system);\n\n // 2. adds system settings option to container (if it was already build)\n var selectSystem = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n if (selectSystem) {\n var option = document.createElement(\"option\");\n option.value = system.code;\n option.text = system.label;\n selectSystem.appendChild(option);\n }\n};\n\n/**\n * Sets additional projection systems\n *\n * @param {Array} systems - Array of system object, with following properties :\n * @param {String} systems.crs - Proj4 CRS alias (from proj4 defs) e.g. \"EPSG:4326\"\n * @param {String} systems.label - CRS label (for coordinates conversion)\n * @param {String} systems.type - CRS units type to be displayed in control (one of control options.units). Default is \"Metric\"\n */\nMousePosition.prototype.addSystems = function (systems) {\n if (!systems) {\n return;\n }\n if (!Array.isArray(systems)) {\n logger.error(\"MousePosition:addSystems - systems parameter should be an array\");\n return;\n }\n for (var i = 0; i < systems.length; i++) {\n this.addSystem(systems[i]);\n }\n};\n\n/**\n * Removes projection system (in case there are several system with same code, only the first one will be removed)\n *\n * @param {String} systemCrs - CRS alias (from proj4 defs)\n */\nMousePosition.prototype.removeSystem = function (systemCrs) {\n if (!systemCrs || typeof systemCrs !== \"string\") {\n logger.error(\"MousePosition:removeSystem - systemCode parameter should be a string\");\n return;\n }\n var systemCode = null;\n // finds system in control projection systems list\n for (var i = 0; i < this._projectionSystems.length; i++) {\n var proj = this._projectionSystems[i];\n if (systemCrs === proj.crs) {\n systemCode = proj.code;\n // removes system from control projection systems list\n this._projectionSystems.splice(i, 1);\n break;\n }\n }\n if (systemCode == null) {\n logger.warn(\"MousePosition:removeSystem - system not found\");\n return;\n }\n\n // re-initialization of codes\n var oldNewCodeGlobe = [];\n for (var ii = 0; ii < this._projectionSystems.length; ii++) {\n oldNewCodeGlobe[Number(this._projectionSystems[ii].code)] = ii;\n this._projectionSystems[ii].code = ii;\n }\n\n // finds system in control container systems list\n var indexChildToRemove = null;\n var systemList = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n for (var j = 0; j < systemList.childNodes.length; j++) {\n if (systemCode === systemList.childNodes[j].value) {\n indexChildToRemove = j;\n continue;\n }\n systemList.childNodes[j].value = oldNewCodeGlobe[Number(systemList.childNodes[j].value)];\n }\n // removes system from control container systems list\n if (indexChildToRemove != null) {\n systemList.removeChild(systemList.childNodes[indexChildToRemove]);\n }\n\n // choose arbitrarily a new current system if needed\n if (this._currentProjectionSystems.code === systemCode) {\n systemList.childNodes[0].setAttribute(\"selected\", \"selected\");\n this._setCurrentSystem(systemList.childNodes[0].value);\n }\n};\n\n/**\n * Sets control units (to be displayed)\n *\n * @param {Array} units - list of all coordinates units, to be displayed in control units list.\n * Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal), \"RAD\" (radians) and \"GON\" (grades) for geographical coordinates,\n * and \"M\" or \"KM\" for metric coordinates\n */\nMousePosition.prototype.setUnits = function (units) {\n if (!units || !Array.isArray(units)) {\n return;\n }\n this.options.units = units;\n this._projectionUnits = {};\n this._initProjectionUnits();\n if (this._currentProjectionType) {\n this._setTypeUnitsPanel(this._currentProjectionType);\n }\n};\n\n/**\n * Sets control altitude options (useless if displayAltitude == false)\n *\n * @param {Object} options - altitude options\n * @param {Object} [options.serviceOptions] - options of elevation service\n * @param {Number} [options.responseDelay] - latency for elevation request, 500 ms by default\n * @param {Number} [options.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default\n */\nMousePosition.prototype.setAltitudeOptions = function (options) {\n if (!options || _typeof(options) !== \"object\") {\n return;\n }\n this.options.altitude.triggerDelay = options.triggerDelay;\n this.options.altitude.responseDelay = options.responseDelay;\n if (options.serviceOptions) {\n for (var opt in options.serviceOptions) {\n if (options.serviceOptions.hasOwnProperty(opt)) {\n this.options.altitude.serviceOptions[opt] = options.serviceOptions[opt];\n }\n }\n }\n};\n\n/**\n * Displays or hides elevation panel\n *\n * @param {Boolean} displayAltitude - true to display elevation panel, false to hide it\n */\nMousePosition.prototype.displayAltitude = function (displayAltitude) {\n if (displayAltitude === undefined) {\n return;\n }\n this.options.displayAltitude = displayAltitude;\n this._setElevationPanel(displayAltitude);\n};\n\n/**\n * Displays or hides coordinates panel\n *\n * @param {Boolean} displayCoordinates - true to display coordinates panel, false to hide it\n */\nMousePosition.prototype.displayCoordinates = function (displayCoordinates) {\n if (displayCoordinates === undefined) {\n return;\n }\n this.options.displayCoordinates = displayCoordinates;\n this._setCoordinatesPanel(displayCoordinates);\n this._setSettingsPanel(displayCoordinates);\n};\n\n/**\n * Collapses or displays control main container\n *\n * @param {Boolean} collapsed - True to collapse control, False to display it\n */\nMousePosition.prototype.setCollapsed = function (collapsed) {\n if (collapsed === undefined) {\n logger.error(\"MousePosition:setCollapsed - missing collapsed parameter\");\n return;\n }\n if (collapsed && this.collapsed || !collapsed && !this.collapsed) {\n return;\n }\n if (!this._isDesktop) {\n document.getElementById(this._addUID(\"GPmapCenter\")).className = collapsed ? \"\" : \"GPmapCenterVisible\";\n }\n // simulates the opening of the panel after a click\n this.onShowMousePositionClick();\n this._showMousePositionContainer.checked = !collapsed;\n};\n\n// ################################################################### //\n// ######################## initialize control ####################### //\n// ################################################################### //\n\n/**\n * Initializes control (called by MousePosition constructor)\n *\n * @method _initialize\n * @param {Object} options - control options (set by user)\n * @private\n */\nMousePosition.prototype._initialize = function (options) {\n // Set default options\n // {Object} control options - set by user or by default\n this.options = options || {};\n this.options.collapsed = options.collapsed !== undefined ? options.collapsed : true;\n /** {Boolean} specify if MousePosition control is collapsed (true) or not (false) */\n this.collapsed = this.options.collapsed;\n this.options.units = options.units || [];\n this.options.displayAltitude = options.displayAltitude !== undefined ? options.displayAltitude : true;\n this.options.displayCoordinates = options.displayCoordinates !== undefined ? options.displayCoordinates : true;\n this.options.systems = options.systems || [];\n if (options.altitude) {\n var altitude = options.altitude;\n this.options.altitude = {\n triggerDelay: altitude.triggerDelay !== undefined ? altitude.triggerDelay : 200,\n responseDelay: altitude.responseDelay !== undefined ? altitude.responseDelay : 500,\n serviceOptions: altitude.serviceOptions || {},\n noDataValue: altitude.noDataValue !== undefined ? altitude.noDataValue : -99999,\n noDataValueTolerance: altitude.noDataValueTolerance !== undefined ? altitude.noDataValueTolerance : 90000\n };\n // on surcharge l'outputFormat pour du json si non spécifié par utilisateur\n this.options.altitude.serviceOptions.outputFormat = altitude.serviceOptions && altitude.serviceOptions.outputFormat ? altitude.serviceOptions.outputFormat : \"json\";\n } else {\n this.options.altitude = {\n triggerDelay: 200,\n responseDelay: 500,\n serviceOptions: {\n outputFormat: \"json\"\n }\n };\n }\n\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__[\"default\"].generate();\n\n // initialization of the projections systems\n this._projectionSystems = [];\n this._initProjectionSystems();\n\n // initialization of the units systems\n this._projectionUnits = {};\n this._initProjectionUnits();\n\n // support detect : desktop or tactile\n this._isDesktop = _Common_Utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].detectSupport();\n\n // implements a timer threshold\n if (this.options.altitude.triggerDelay < 100) {\n this.options.altitude.triggerDelay = 100;\n }\n\n // {Number} timer on movestopped delay (altitude calculation)\n this._timer = this.options.altitude.triggerDelay;\n\n // {Object} Selected projection system\n this._currentProjectionSystems = this._projectionSystems[0];\n\n // {String} Selected projection units typs : Geographical or metric\n this._currentProjectionType = this._projectionSystems[0].type;\n\n // {String} Selected projection unit\n this._currentProjectionUnits = this._projectionUnits[this._currentProjectionType][0].code;\n\n // {Object} Projection units container (DOM Element)\n this._projectionUnitsContainer = null;\n\n // {Object} control panel container (DOM Element)\n this._showMousePositionContainer = null;\n\n // management of the altitude panel display\n if (!this.options.displayAltitude && !this.options.displayCoordinates) {\n // reactivate the display of coordinates, to not display an empty panel\n this.options.displayCoordinates = true;\n }\n};\n\n/**\n * this method is called by the constructor and initialize the projection\n * systems.\n * getting coordinates in the requested projection :\n * see this.onMousePositionProjectionSystemChange()\n *\n * @method _initProjectionSystems\n * @private\n */\nMousePosition.prototype._initProjectionSystems = function () {\n // user has the possibility to modify the list of systems to display\n // Ex. this.options.systems\n\n // available projection systems vy default\n var projectionSystemsByDefault = [{\n label: \"Géographique\",\n crs: \"EPSG:4326\",\n type: \"Geographical\"\n }, {\n label: \"Mercator\",\n crs: \"EPSG:3857\",\n type: \"Metric\"\n }, {\n label: \"Lambert 93\",\n crs: \"EPSG:2154\",\n type: \"Metric\",\n geoBBox: {\n left: -9.86,\n bottom: 41.15,\n right: 10.38,\n top: 51.56\n }\n }, {\n label: \"Lambert II étendu\",\n crs: \"EPSG:27572\",\n type: \"Metric\",\n geoBBox: {\n left: -4.87,\n bottom: 42.33,\n right: 8.23,\n top: 51.14\n }\n }];\n var systems = this.options.systems;\n for (var i = 0; i < systems.length; i++) {\n // definition of a reference system\n var sys = systems[i];\n this.addSystem(sys);\n }\n if (this._projectionSystems.length === 0) {\n // we add the default projection systems\n for (var ii = 0; ii < projectionSystemsByDefault.length; ii++) {\n this.addSystem(projectionSystemsByDefault[ii]);\n }\n }\n};\n\n/**\n * this method is called by the constructor and initialize the units.\n * getting coordinates in the requested units :\n * see this.onMousePositionProjectionUnitsChange()\n *\n * @method _initProjectionUnits\n * @private\n */\nMousePosition.prototype._initProjectionUnits = function () {\n // user has the possibility to modify the list of units to display\n // Ex.\n // this.options.units : [\"DEC\", \"DMS\"]\n\n // available units systems by default\n var projectionUnitsByDefault = {\n Geographical: [{\n code: \"DEC\",\n label: \"degrés décimaux\",\n convert: this._displayDEC\n }, {\n code: \"DMS\",\n label: \"degrés sexagésimaux\",\n convert: this._displayDMS\n }, {\n code: \"RAD\",\n label: \"radians\",\n convert: this._displayRAD\n }, {\n code: \"GON\",\n label: \"grades\",\n convert: this._displayGON\n }],\n Metric: [{\n code: \"M\",\n label: \"mètres\",\n convert: this._displayMeter\n }, {\n code: \"KM\",\n label: \"kilomètres\",\n convert: this._displayKMeter\n }]\n };\n var units = this.options.units;\n for (var type in projectionUnitsByDefault) {\n if (projectionUnitsByDefault.hasOwnProperty(type)) {\n var found = false;\n for (var j = 0; j < projectionUnitsByDefault[type].length; j++) {\n var obj = projectionUnitsByDefault[type][j];\n for (var i = 0; i < units.length; i++) {\n var unit = units[i];\n if (obj.code === unit) {\n found = true;\n if (!this._projectionUnits[type]) {\n this._projectionUnits[type] = [];\n }\n this._projectionUnits[type].push(obj);\n }\n }\n }\n if (!found) {\n this._projectionUnits[type] = projectionUnitsByDefault[type];\n }\n }\n }\n\n // in case of...\n if (_typeof(this._projectionUnits) === \"object\" && Object.keys(this._projectionUnits).length === 0) {\n this._projectionUnits = projectionUnitsByDefault;\n }\n};\n\n// ################################################################### //\n// ######################## methods handle dom ####################### //\n// ################################################################### //\n\n/**\n * Create control main container (called by MousePosition constructor)\n *\n * @method _initContainer\n * @param {Object} options - options\n * @param {Boolean} options.collapsed - Specify if MousePosition control should be collapsed\n * @param {Array} options.displayAltitude - activate (true) or deactivate (false) the altitude panel\n * @param {Array} options.displayCoordinates - activate (true) or deactivate (false) the coordinates panel\n * @returns {DOMElement} container - widget container\n * @private\n */\nMousePosition.prototype._initContainer = function (options) {\n // creates the main container\n var container = this._createMainContainerElement();\n var inputShow = this._showMousePositionContainer = this._createShowMousePositionElement();\n if (!options.collapsed) {\n inputShow.checked = \"checked\";\n }\n container.appendChild(inputShow);\n var picto = this._createShowMousePositionPictoElement(this._isDesktop);\n container.appendChild(picto);\n var panel = this._createMousePositionPanelElement();\n var header = this._createMousePositionPanelHeaderElement();\n panel.appendChild(header);\n var basic = this._createMousePositionPanelBasicElement(options.displayAltitude, options.displayCoordinates);\n panel.appendChild(basic);\n var arraySettings = this._createShowMousePositionSettingsElement(options.displayCoordinates);\n for (var j = 0; j < arraySettings.length; j++) {\n panel.appendChild(arraySettings[j]);\n }\n var settings = this._createMousePositionSettingsElement(options.displayCoordinates);\n var systems = this._projectionSystemsContainer = this._createMousePositionSettingsSystemsElement(this._projectionSystems);\n var units = this._projectionUnitsContainer = this._createMousePositionSettingsUnitsElement(this._projectionUnits[this._currentProjectionType]);\n settings.appendChild(systems);\n settings.appendChild(units);\n panel.appendChild(settings);\n container.appendChild(panel);\n return container;\n};\n\n/**\n * this method is called by this.()\n * and it changes the elevation view panel into the dom.\n *\n * @method _setElevationPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setElevationPanel = function (active) {\n var div = null;\n if (!active) {\n div = document.getElementById(\"GPmousePositionAltitude-\" + this._uid);\n div.style.display = \"none\";\n } else {\n div = document.getElementById(\"GPmousePositionAltitude-\" + this._uid);\n div.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.()\n * and it changes the coordinate view panel into the dom.\n *\n * @method _setCoordinatesPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setCoordinatesPanel = function (active) {\n var div = document.getElementById(\"GPmousePositionCoordinate-\" + this._uid);\n if (!active) {\n div.style.display = \"none\";\n } else {\n div.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.()\n * and it changes the settings view panel into the dom.\n *\n * @method _setSettingsPanel\n * @param {Boolean} active - true:active, false:disable\n * @private\n */\nMousePosition.prototype._setSettingsPanel = function (active) {\n var divPicto = document.getElementById(\"GPshowMousePositionSettingsPicto-\" + this._uid);\n var divPanel = document.getElementById(\"GPmousePositionSettings-\" + this._uid);\n if (!active) {\n divPicto.style.display = \"none\";\n divPanel.style.display = \"none\";\n } else {\n divPicto.style.display = \"\";\n divPanel.style.display = \"\";\n }\n};\n\n/**\n * this method is called by this.onMousePositionProjectionSystemChange()\n * when changes to a metric or a geographical units.\n *\n * @method _setTypeUnitsPanel\n * @param {String} type - Geographical or Metric\n * @private\n */\nMousePosition.prototype._setTypeUnitsPanel = function (type) {\n var container = this._projectionUnitsContainer;\n\n // deletes the childNodes\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n var units = this._projectionUnits[type];\n for (var j = 0; j < units.length; j++) {\n var obj = units[j];\n var option = document.createElement(\"option\");\n option.value = obj.code ? obj.code : j;\n option.text = obj.label || j;\n // option.label = obj.label;\n container.appendChild(option);\n }\n\n // the new type of system\n this._currentProjectionType = type;\n // as the system changed, the unit system has to change too !\n this._currentProjectionUnits = this._projectionUnits[type][0].code;\n};\n\n// ################################################################### //\n// ######################## method units convert ##################### //\n// ################################################################### //\n\n/**\n * degreedecimal\n *\n * @method _displayDEC\n * @param {Object} coords - coordinatesobject {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : 48, lng : 2} par exemple\n * @private\n */\nMousePosition.prototype._displayDEC = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].roundToDecimal(coords.lat, 6);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].roundToDecimal(coords.lon, 6);\n return coordinate;\n};\n\n/**\n * degreedecimal2sexagecimal\n *\n * @method _displayDMS\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lng : \"2° 00′ 00″ E\", lat : \"48° 00′ 00″ N\"} par exemple\n * @private\n */\nMousePosition.prototype._displayDMS = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalLatToDMS(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalLongToDMS(coords.lon);\n return coordinate;\n};\n\n/**\n * degreedecimal2radian\n *\n * @method _displayRAD\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : \"0.02837864\", lng : \"0.84300269\"} par exemple\n * @private\n */\nMousePosition.prototype._displayRAD = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToRadian(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToRadian(coords.lon);\n return coordinate;\n};\n\n/**\n * degreedecimal2grade\n *\n * @method _displayGON\n * @param {Object} coords - coordinates object {lon, lat}\n * @return {Object} coordinate - coordinate object : {lat : \"4.09545898\", lng : \"53.68751528\"} par exemple\n * @private\n */\nMousePosition.prototype._displayGON = function (coords) {\n var coordinate = {};\n coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToGrade(coords.lat);\n coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__[\"default\"].decimalToGrade(coords.lon);\n return coordinate;\n};\n\n/**\n * meter\n *\n * @method _displayMeter\n * @param {Object} coords - coords object {lon, lat}\n * @return {Object} coordinate - coordinate object : {x : \"148593.58\", y : \"6176560.95\"} par exemple\n * @private\n */\nMousePosition.prototype._displayMeter = function (coords) {\n // on recoit toujours des coordonnées metriques\n var coordinate = {};\n coordinate.x = coords.lon.toFixed(2);\n coordinate.y = coords.lat.toFixed(2);\n coordinate.unit = \"m\";\n return coordinate;\n};\n\n/**\n * kilometer\n *\n * @method _displayKMeter\n * @param {Object} coords - coords object {lon, lat}\n * @return {Object} coordinate - coordinate object : {x : \"214.96\", y : \"6250.09\"} par exemple\n * @private\n */\nMousePosition.prototype._displayKMeter = function (coords) {\n var coordinate = {};\n coordinate.x = (coords.lon / 1000).toFixed(2);\n coordinate.y = (coords.lat / 1000).toFixed(2);\n coordinate.unit = \"km\";\n return coordinate;\n};\n\n// ################################################################### //\n// ##################### handlers events to control ################## //\n// ################################################################### //\n\n/**\n * this sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method _setCoordinate\n * @param {Array} coords - coordinate object {lon, lat}\n * @private\n */\nMousePosition.prototype._setCoordinate = function (coords) {\n // structure\n // coords\n // {\n // lon: 5,\n // lat : 48\n // }\n //\n // structure for the coordinates depending on the system type :\n // {x:, y:, unit:} or {lng:, lat:} or {lon:, lat:} or {e:, n:, unit:}...\n\n var coord = [];\n var coordinates = {};\n\n // transforms the point in the wanted coords system\n var oSrs = this._currentProjectionSystems;\n var crsProp = oSrs ? oSrs.crs : null;\n if (!crsProp) {\n logger.error(\"system crs not found\");\n return;\n }\n // reproject coordinates from their CRS of origin (WGS84) to the wanted CRS (crsProp)\n if (crsProp !== \"EPSG:4326\") {\n coord = proj4__WEBPACK_IMPORTED_MODULE_0___default()(_CRS_CRS__WEBPACK_IMPORTED_MODULE_9__[\"default\"][crsProp], [coords.lon, coords.lat]);\n // projected values are affected to the coord var\n coordinates.lon = coord[0];\n coordinates.lat = coord[1];\n } else {\n coordinates = coords;\n }\n\n // system type : Geographical or Metric\n\n var type = this._currentProjectionSystems.type;\n\n // checks for a formatting function in the wanted unit\n var convert = null;\n var units = this._projectionUnits[type];\n for (var i = 0; i < units.length; i++) {\n if (units[i].code === this._currentProjectionUnits) {\n convert = units[i].convert;\n break;\n }\n }\n if (!convert || typeof convert !== \"function\") {\n logger.warn(\"coordinates format function not found\");\n return;\n } else {\n coord = convert(coordinates);\n }\n if (!coord || Object.keys(coord).length === 0) {\n return;\n }\n this.GPdisplayCoords(coord);\n};\n\n/**\n * this sends the coordinates to the panel.\n * (cf. this.GPdisplayElevation() into the DOM functions)\n *\n * @method _setElevation\n * @param {Object} coords - Coordinate position object {lon, lat}\n * @private\n */\nMousePosition.prototype._setElevation = function (coords) {\n // management of the timer of the altitude service request\n var delay = this.options.altitude.responseDelay;\n this.GPdisplayElevation(coords, delay);\n};\n\n/**\n * this method is triggered when the mouse or the globe is stopped.\n * (cf. onMouseMove and onGlobeMove)\n *\n * @method onMoveStopped\n * @param {Object} coords - Coordinate position object {lon, lat}\n * @private\n */\nMousePosition.prototype.onMoveStopped = function (coords) {\n this._setElevation(coords);\n};\n\n/**\n * this method is an handler event to control. The event is 'mousemove' on\n * the globe. The handler sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method onMouseMove\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMouseMove = function (e) {\n var self = this;\n var position = this.getGlobe().getCoordinateFromMouseEvent(e);\n if (!position) {\n this.GPdisplayCoords({\n lon: \"---\",\n lat: \"---\"\n });\n this.GPresetElevation();\n return;\n }\n var coordinate = {\n lon: position.x,\n lat: position.y\n };\n this._setCoordinate(coordinate);\n\n // calculation of the altitude after a time limit from the moment where the mouse movement is stopped\n if (this.options.displayAltitude) {\n clearTimeout(this._timer);\n this._timer = setTimeout(function () {\n self.onMoveStopped(coordinate);\n }, this.options.altitude.triggerDelay);\n }\n};\n\n/**\n * this method is an handler event to control. The event is 'moveend' on\n * the globe. The handler sends the coordinates to the panel.\n * (cf. this.GPdisplayCoords() into the DOM functions)\n *\n * @method onGlobeMove\n * @private\n */\nMousePosition.prototype.onGlobeMove = function () {\n\n // var self = this;\n\n // info: coordinate = [x, y]\n // var coordinate = e.coordinate;\n // if ( !e.map || !e.map.getView() ) {\n // return;\n // }\n // var crs = e.map.getView().getProjection();\n //\n // this._setCoordinate(coordinate, crs);\n //\n // // calcul de l'altitude après un certain délai après l'arrêt du mouvement de la carte\n // clearTimeout(this._timer);\n // this._timer = setTimeout( function () {\n // self.onMoveStopped(coordinate, crs);\n // }, this.options.altitude.triggerDelay);\n};\n\n// ################################################################### //\n// ####################### handlers events to dom #################### //\n// ################################################################### //\n\n/**\n * this method is called by this.GPdisplayElevation() in the dom, and\n * it executes a request to the elevation service.\n *\n * @method onRequestAltitude\n * @param {Object} coordinate - {lat:..., lng:...}\n * @param {Function} callback - function callback\n * @private\n */\nMousePosition.prototype.onRequestAltitude = function (coordinate, callback) {\n // INFORMATION\n // we launch the request to the altitude services\n // we implement callbacks in order to retrieve results or errors\n // from the service.\n // The result is displayed in a DOM element.\n // The error messages are display in the dev console (?)\n\n if (!coordinate || Object.keys(coordinate).length === 0) {\n return;\n }\n\n // if we do not want any altitude calculation, we just stop !\n if (!this.options.displayAltitude) {\n return;\n }\n\n // we retrieve the service options...\n var options = this.options.altitude.serviceOptions || {};\n\n // ... and the coordinates...\n options.zonly = true;\n options.positions = [{\n lon: coordinate.lon,\n lat: coordinate.lat\n }];\n\n // ... and the callbacks\n options.scope = this;\n if (!options.rawResponse) {\n // in the general case\n options.onSuccess = function (results) {\n if (results && Object.keys(results).length) {\n callback.call(this, results.elevations[0].z);\n }\n };\n } else {\n options.onSuccess = function (results) {\n logger.info(\"alti service raw response : \", results);\n };\n }\n options.onFailure = function (error) {\n logger.error(\"[getAltitude] \" + error.message);\n };\n // we use the key \"calcul\"\n options.apiKey = \"calcul\";\n\n // si l'utilisateur a spécifié le paramètre ssl au niveau du control, on s'en sert\n // true par défaut (https)\n if (typeof this.options.ssl === \"boolean\") {\n options.ssl = this.options.ssl;\n }\n geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Services.getAltitude(options);\n};\n\n/**\n * this method is called by event 'click' on 'GPshowMousePositionPicto' tag label\n * (cf. this._createShowMousePositionPictoElement),\n * and toggles event 'mousemove' on globe.\n *\n * @method onShowMousePositionClick\n * @private\n */\nMousePosition.prototype.onShowMousePositionClick = function () {\n // checked : true - panel close\n // checked : false - panel open\n var globe = this.getGlobe();\n this.collapsed = this._showMousePositionContainer.checked;\n\n // event triggered when opening/closing the panel\n // and depending on the mode : desktop or tactile!\n if (this._showMousePositionContainer.checked) {\n // FIXME handle or not mobile case\n if (this._isDesktop) {\n globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n } else {\n // FIXME handle or not mobile case\n if (this._isDesktop) {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove);\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__[\"default\"].EVENTS.CENTER_CHANGED, this.onGlobeMove);\n }\n }\n\n // FIXME\n // we handle here the panel display..., but this is not really the good\n // place to do it...\n this._setElevationPanel(this.options.displayAltitude);\n this._setCoordinatesPanel(this.options.displayCoordinates);\n if (!this.options.displayCoordinates) {\n this._setSettingsPanel(false);\n }\n};\n\n/**\n * this method is called by event 'change' on 'GPmousePositionProjectionSystem'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the system projection.\n *\n * @method onMousePositionProjectionSystemChange\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionSystemChange = function (e) {\n var idx = e.target.selectedIndex; // index\n var value = e.target.options[idx].value; // crs\n\n this._setCurrentSystem(value);\n};\n\n/**\n * this method selects the current system projection.\n *\n * @method _setCurrentSystem\n * @param {String} systemCode - inner code (rank in array _projectionSystems)\n * @private\n */\nMousePosition.prototype._setCurrentSystem = function (systemCode) {\n // if we change of system type, we must change the unit type too !\n var type = null;\n for (var i = 0; i < this._projectionSystems.length; ++i) {\n if (this._projectionSystems[i].code === Number(systemCode)) {\n type = this._projectionSystems[i].type;\n break;\n }\n }\n if (!type) {\n logger.log(\"system not found in projection systems container\");\n return;\n }\n if (type !== this._currentProjectionType) {\n this._setTypeUnitsPanel(type);\n }\n\n // registers the current system\n this._currentProjectionSystems = this._projectionSystems[Number(systemCode)];\n\n // simulates a movement in tactile mode to update the results\n if (!this._isDesktop) {\n this.onGlobeMove();\n }\n};\n\n/**\n * this method is called by event 'mouseover' on 'GPmousePositionProjectionSystem'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the system projection whose geoBBox interstects the current view extent.\n *\n * @method onMousePositionProjectionSystemMouseOver\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionSystemMouseOver = function () {\n // globe infos\n var globe = this.getGlobe();\n if (!globe) {\n return;\n }\n var globeExtent = globe.getExtent();\n\n // clear select\n var systemList = document.getElementById(this._addUID(\"GPmousePositionProjectionSystem\"));\n systemList.innerHTML = \"\";\n var option;\n\n // add systems whose extent intersects the globe extent\n for (var j = 0; j < this._projectionSystems.length; j++) {\n var proj = this._projectionSystems[j];\n if (proj.geoBBox) {\n // bboxes intersection test\n if (globeExtent.west > proj.geoBBox.right || globeExtent.south > proj.geoBBox.top || globeExtent.east < proj.geoBBox.left || globeExtent.north < proj.geoBBox.bottom) {\n if (proj === this._currentProjectionSystems) {\n option = document.createElement(\"option\");\n option.value = proj.code;\n option.text = proj.label || j;\n option.setAttribute(\"selected\", \"selected\");\n option.setAttribute(\"disabled\", \"disabled\");\n systemList.appendChild(option);\n }\n continue; // do not intersect\n }\n }\n\n option = document.createElement(\"option\");\n option.value = proj.code;\n option.text = proj.label || j;\n if (proj === this._currentProjectionSystems) {\n option.setAttribute(\"selected\", \"selected\");\n }\n systemList.appendChild(option);\n }\n};\n\n/**\n * this method is called by event 'change' on 'GPmousePositionProjectionUnits'\n * tag select (cf. this._createMousePositionSettingsElement),\n * and selects the units projection.\n *\n * @method onMousePositionProjectionUnitsChange\n * @param {Object} e - HTMLElement\n * @private\n */\nMousePosition.prototype.onMousePositionProjectionUnitsChange = function (e) {\n var idx = e.target.selectedIndex;\n var value = e.target.options[idx].value;\n this._currentProjectionUnits = value;\n\n // simulates a movement in tactile mode to update the results\n if (!this._isDesktop) {\n this.onGlobeMove();\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MousePosition);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvTW91c2VQb3NpdGlvbi5qcz8wMDlkIl0sIm5hbWVzIjpbImxvZ2dlciIsIkxvZ2dlciIsImdldExvZ2dlciIsIk1vdXNlUG9zaXRpb24iLCJvcHRpb25zIiwiVHlwZUVycm9yIiwiX3R5cGVvZiIsIkVycm9yIiwiX2luaXRpYWxpemUiLCJfY2FsbGJhY2tzIiwiY29udGFpbmVyIiwiX2luaXRDb250YWluZXIiLCJXaWRnZXQiLCJjYWxsI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AqICAgICAgICAgICAgICBib3R0b20gOiAwLjAwLFxuICogICAgICAgICAgICAgIHJpZ2h0IDogLTYwLjAwLFxuICogICAgICAgICAgICAgIHRvcCA6IDg0LjAwXG4gKiAgICAgICAgICB9XG4gKiAgICAgICAgfVxuICogICAgICBdLFxuICogICAgICB1bml0cyA6IFtcIkRFQ1wiLCBcIkRNU1wiXVxuICogIH0pO1xuICovXG5mdW5jdGlvbiBNb3VzZVBvc2l0aW9uIChvcHRpb25zKSB7XG4gICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XG5cbiAgICBpZiAoISh0aGlzIGluc3RhbmNlb2YgTW91c2VQb3NpdGlvbikpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcIkVSUk9SIENMQVNTX0NPTlNUUlVDVE9SXCIpO1xuICAgIH1cblxuICAgIGlmICh0eXBlb2Ygb3B0aW9ucyAhPT0gXCJvYmplY3RcIikge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUiBXUk9OR19UWVBFIDogb3B0aW9ucyBzaG91bGQgYmUgYW4gb2JqZWN0XCIpO1xuICAgIH1cblxuICAgIHRoaXMuX2luaXRpYWxpemUob3B0aW9ucyk7XG5cbiAgICB0aGlzLl9jYWxsYmFja3MgPSB7fTtcblxuICAgIC8vIGluaXQgY29udHJvbCBET00gY29udGFpbmVyXG4gICAgdmFyIGNvbnRhaW5lciA9IHRoaXMuX2luaXRDb250YWluZXIob3B0aW9ucyk7XG5cbiAgICBXaWRnZXQuY2FsbChcbiAgICAgICAgdGhpcywge1xuICAgICAgICAgICAgbmFtZSA6IFwiTW91c2VQb3NpdGlvblwiLFxuICAgICAgICAgICAgZWxlbWVudCA6IGNvbnRhaW5lcixcbiAgICAgICAgICAgIHRhcmdldCA6IG9wdGlvbnMudGFyZ2V0LFxuICAgICAgICAgICAgcG9zaXRpb24gOiBvcHRpb25zLnBvc2l0aW9uXG4gICAgICAgIH1cbiAgICApO1xufTtcblxuLyo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ydCA6IHRoaXMuX2Rpc3BsYXlERUNcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgY29kZSA6IFwiRE1TXCIsXG4gICAgICAgICAgICBsYWJlbCA6IFwiZGVncsOpcyBzZXhhZ8Opc2ltYXV4XCIsXG4gICAgICAgICAgICBjb252ZXJ0IDogdGhpcy5fZGlzcGxheURNU1xuICAgICAgICB9LCB7XG4gICAgICAgICAgICBjb2RlIDogXCJSQURcIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJyYWRpYW5zXCIsXG4gICAgICAgICAgICBjb252ZXJ0IDogdGhpcy5fZGlzcGxheVJBRFxuICAgICAgICB9LCB7XG4gICAgICAgICAgICBjb2RlIDogXCJHT05cIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJncmFkZXNcIixcbiAgICAgICAgICAgIGNvbnZlcnQgOiB0aGlzLl9kaXNwbGF5R09OXG4gICAgICAgIH1dLFxuICAgICAgICBNZXRyaWMgOiBbe1xuICAgICAgICAgICAgY29kZSA6IFwiTVwiLFxuICAgICAgICAgICAgbGFiZWwgOiBcIm3DqHRyZXNcIixcbiAgICAgICAgICAgIGNvbnZlcnQgOiB0aGlzLl9kaXNwbGF5TWV0ZXJcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgY29kZSA6IFwiS01cIixcbiAgICAgICAgICAgIGxhYmVsIDogXCJraWxvbcOodHJlc1wiLFxuICAgICAgICAgICAgY29udmVydCA6IHRoaXMuX2Rpc3BsYXlLTWV0ZXJcbiAgICAgICAgfV1cbiAgICB9O1xuXG4gICAgdmFyIHVuaXRzID0gdGhpcy5vcHRpb25zLnVuaXRzO1xuXG4gICAgZm9yICh2YXIgdHlwZSBpbiBwcm9qZWN0aW9uVW5pdHNCeURlZmF1bHQpIHtcbiAgICAgICAgaWYgKHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdC5oYXNPd25Qcm9wZXJ0eSh0eXBlKSkge1xuICAgICAgICAgICAgdmFyIGZvdW5kID0gZmFsc2U7XG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdFt0eXBlXS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIHZhciBvYmogPSBwcm9qZWN0aW9uVW5pdHNCeURlZmF1bHRbdHlwZV1bal07XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1bml0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdW5pdCA9IHVuaXRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAob2JqLmNvZGUgPT09IHVuaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fcHJvamVjdGlvblVuaXRzW3R5cGVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fcHJvamVjdGlvblVuaXRzW3R5cGVdID0gW107XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9wcm9qZWN0aW9uVW5pdHNbdHlwZV0ucHVzaChvYmopO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFmb3VuZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3Byb2plY3Rpb25Vbml0c1t0eXBlXSA9IHByb2plY3Rpb25Vbml0c0J5RGVmYXVsdFt0eXBlXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIGluIGNhc2Ugb2YuLi5cbiAgICBpZiAodHlwZW9mIHRoaXMuX3Byb2plY3Rpb25Vbml0cyA9PT0gXCJvYmplY3RcIiAmJiBPYmplY3Qua2V5cyh0aGlzLl9wcm9qZWN0aW9uVW5pdHMpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICB0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GlzdC5pbm5lckhUTUwgPSBcIlwiO1xuXG4gICAgdmFyIG9wdGlvbjtcblxuICAgIC8vIGFkZCBzeXN0ZW1zIHdob3NlIGV4dGVudCBpbnRlcnNlY3RzIHRoZSBnbG9iZSBleHRlbnRcbiAgICBmb3IgKHZhciBqID0gMDsgaiA8IHRoaXMuX3Byb2plY3Rpb25TeXN0ZW1zLmxlbmd0aDsgaisrKSB7XG4gICAgICAgIHZhciBwcm9qID0gdGhpcy5fcHJvamVjdGlvblN5c3RlbXNbal07XG4gICAgICAgIGlmIChwcm9qLmdlb0JCb3gpIHtcbiAgICAgICAgICAgIC8vIGJib3hlcyBpbnRlcnNlY3Rpb24gdGVzdFxuICAgICAgICAgICAgaWYgKGdsb2JlRXh0ZW50Lndlc3QgPiBwcm9qLmdlb0JCb3gucmlnaHQgfHxcbiAgICAgICAgICAgICAgICBnbG9iZUV4dGVudC5zb3V0aCA+IHByb2ouZ2VvQkJveC50b3AgfHxcbiAgICAgICAgICAgICAgICBnbG9iZUV4dGVudC5lYXN0IDwgcHJvai5nZW9CQm94LmxlZnQgfHxcbiAgICAgICAgICAgICAgICBnbG9iZUV4dGVudC5ub3J0aCA8IHByb2ouZ2VvQkJveC5ib3R0b21cbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIGlmIChwcm9qID09PSB0aGlzLl9jdXJyZW50UHJvamVjdGlvblN5c3RlbXMpIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcIm9wdGlvblwiKTtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uLnZhbHVlID0gcHJvai5jb2RlO1xuICAgICAgICAgICAgICAgICAgICBvcHRpb24udGV4dCA9IHByb2oubGFiZWwgfHwgajtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uLnNldEF0dHJpYnV0ZShcInNlbGVjdGVkXCIsIFwic2VsZWN0ZWRcIik7XG4gICAgICAgICAgICAgICAgICAgIG9w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lLm9uTW91c2VQb3NpdGlvblByb2plY3Rpb25Vbml0c0NoYW5nZSA9IGZ1bmN0aW9uIChlKSB7XG4gICAgdmFyIGlkeCA9IGUudGFyZ2V0LnNlbGVjdGVkSW5kZXg7XG4gICAgdmFyIHZhbHVlID0gZS50YXJnZXQub3B0aW9uc1tpZHhdLnZhbHVlO1xuXG4gICAgdGhpcy5fY3VycmVudFByb2plY3Rpb25Vbml0cyA9IHZhbHVlO1xuXG4gICAgLy8gc2ltdWxhdGVzIGEgbW92ZW1lbnQgaW4gdGFjdGlsZSBtb2RlIHRvIHVwZGF0ZSB0aGUgcmVzdWx0c1xuICAgIGlmICghdGhpcy5faXNEZXNrdG9wKSB7XG4gICAgICAgIHRoaXMub25HbG9iZU1vdmUoKTtcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBNb3VzZVBvc2l0aW9uO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/MousePosition.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/Scale.js": +/*!**************************************!*\ + !*** ./src/Itowns/Controls/Scale.js ***! + \**************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/SelectorID */ \"./src/Common/Utils/SelectorID.js\");\n/* harmony import */ var _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Controls/ScaleDOM */ \"./src/Common/Controls/ScaleDOM.js\");\n/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Widget */ \"./src/Itowns/Controls/Widget.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n/**\n * @classdesc\n * Control to display the scalebar with itowns\n *\n * @constructor\n * @alias itowns.control.Scale\n * @extends {itowns.control.Widget}\n * @alias itowns.control.Scale\n * @param {Object} options - widget options\n * @param {String} options.target - HTML target element or HTML target element id\n * @param {String} options.position - \"absolute\" or \"relative\"\n * @example\n * var scale = new itowns.control.Scale();\n *\n */\nfunction Scale(options) {\n if (!(this instanceof Scale)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n if (_typeof(options) !== \"object\") {\n throw new Error(\"ERROR WRONG_TYPE : options should be an object\");\n }\n this._initialize();\n var container = this._initContainer();\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].call(this, {\n name: \"GraphicScale\",\n element: container,\n target: options.target,\n position: options.position\n });\n}\n\n/*\n * @lends module:Scale\n */\nScale.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype, {});\n\n// retrieves methods of the common class ScaleDOM\n_Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].assign(Scale.prototype, _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/**\n * Constructor (alias)\n *\n * @private\n */\nScale.prototype.constructor = Scale;\n\n// ################################################################### //\n// ############## public methods (getters, setters) ################## //\n// ################################################################### //\n\n/**\n * Bind globe to control\n *\n * @param {GlobeViewExtended} globe - the globe\n */\nScale.prototype.setGlobe = function (globe) {\n // info : this function is called after a globe.addWidget() or a globe.removeWidget()\n\n if (globe) {\n // In the case of the adding of a control to the globe\n var self = this;\n /**\n * Definition of the scaleControl callback :\n * when the view is changing, we recalculate the graphic scale\n */\n this._callbacks.onChangedViewCallback = function () {\n var value = globe.pixelsToMeters(200);\n value = Math.floor(value);\n var digit = Math.pow(10, value.toString().length - 1);\n value = Math.round(value / digit) * digit;\n var pix = globe.metersToPixels(value);\n var unit = \"m\";\n if (value >= 1000) {\n value /= 1000;\n unit = \"km\";\n }\n self.getElement().innerHTML = value + \" \" + unit;\n self.getElement().style.width = pix + \"px\";\n };\n // Ajout des listeners\n // initialization\n if (globe.isInitialized()) {\n this._callbacks.onChangedViewCallback();\n } else {\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback);\n }\n\n // At every globe range movement, scale bar may be updated,\n globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback);\n } else if (globe == null) {\n // we remove the listeners linked to the scalecontrol which has been deleted\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback);\n this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback);\n\n // if globe == null we remove the scale control\n // delete the scaleControl DOM\n while (this.getElement().hasChildNodes()) {\n this.getElement().removeChild(this.getElement().lastChild);\n }\n this.getElement().parentNode.removeChild(this.getElement());\n }\n\n // call original setGlobe method\n _Widget__WEBPACK_IMPORTED_MODULE_4__[\"default\"].prototype.setGlobe.call(this, globe);\n};\n\n// ################################################################### //\n// ##################### init component ############################## //\n// ################################################################### //\n\n/**\n * Initialize Scale control (called by constructor)\n *\n * @private\n */\nScale.prototype._initialize = function () {\n // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page)\n this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__[\"default\"].generate();\n\n // div which will contain the list divs.\n this._ScaleContainer = null;\n\n // callbacks\n this._callbacks = {};\n};\n\n/**\n * Create control main container\n *\n * @method _initContainer\n * @returns {DOMElement} container - widget container\n * @private\n */\nScale.prototype._initContainer = function () {\n var container = this._createMainContainerElement();\n return container;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Scale);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvU2NhbGUuanM/YzZjMSJdLCJuYW1lcyI6WyJTY2FsZSIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJfdHlwZW9mIiwiRXJyb3IiLCJfaW5pdGlhbGl6ZSIsImNvbnRhaW5lciIsIl9pbml0Q29udGFpbmVyIiwiV2lkZ2V0IiwiY2FsbCIsIm5hbWUiLCJlbGVtZW50IiwidGFyZ2V0IiwicG9zaXRpb24iLCJwcm90b3R5cGUiLCJPYmplY3QiLCJjcmVhdGUiLCJVdGlscyIsImFzc2lnbiIsIlNjYWxlRE9NIiwiY29uc3RydWN0b3IiLCJzZXRHbG9iZSIsImdsb2JlIiwic2VsZiIsIl9jYWxsYmFja3MiLCJvbkNoYW5nZWRWaWV3Q2FsbGJhY2siLCJ2YWx1ZSIsInBpeGVsc1RvTWV0ZXJzIiwiTWF0aCIsImZsb29yIiwiZGlnaXQiLCJwb3ciLCJ0b1N0cmluZyIsImxlbmd0aCIsInJvdW5kIiwicGl4IiwibWV0ZXJzVG9QaXhlbHMiLCJ1bml0IiwiZ2V0RWxlbWVudCIsImlubmVySFRNTCIsInN0eWxlIiwid2lkdGgiLCJpc0luaXRpYWxpemVkIiwibGlzdGVuIiwiR2xvYmVWaWV3RXh0ZW5kZWQiLCJFVkVOVFMiLCJHTE9C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3JlYXRlIGNvbnRyb2wgbWFpbiBjb250YWluZXJcbiAqXG4gKiBAbWV0aG9kIF9pbml0Q29udGFpbmVyXG4gKiBAcmV0dXJucyB7RE9NRWxlbWVudH0gY29udGFpbmVyIC0gd2lkZ2V0IGNvbnRhaW5lclxuICogQHByaXZhdGVcbiAqL1xuU2NhbGUucHJvdG90eXBlLl9pbml0Q29udGFpbmVyID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBjb250YWluZXIgPSB0aGlzLl9jcmVhdGVNYWluQ29udGFpbmVyRWxlbWVudCgpO1xuXG4gICAgcmV0dXJuIGNvbnRhaW5lcjtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFNjYWxlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Scale.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/Utils/PositionFormater.js": +/*!*******************************************************!*\ + !*** ./src/Itowns/Controls/Utils/PositionFormater.js ***! + \*******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n* implementation :\n* cf. http://uihacker.blogspot.fr/2011/07/javascript-formatting-latitudelongitude.html?m=1\n* cf. http://andrew.hedges.name/experiments/convert_lat_long/\n* FIXME formater la sortie\n* cf. http://mottie.github.io/javascript-number-formatter/\n* cf. https://github.com/j-/number-formatter\n*\n*/\n/** ... */\nvar PositionFormater = {\n /** ... */\n NORTH: \"N\",\n /** ... */\n SOUTH: \"S\",\n /** ... */\n EAST: \"E\",\n /** ... */\n WEST: \"W\",\n /** ... */\n digitSecond: 2,\n /** ... */\n digitDecimal: 5,\n /** ... */\n digitRadian: 8,\n roundToDecimal: function roundToDecimal(inputNum, numPoints) {\n var multiplier = Math.pow(10, numPoints);\n return Math.round(inputNum * multiplier) / multiplier;\n },\n decimalToRadian: function decimalToRadian(location) {\n var d = 0.01745329251994329577;\n return this.roundToDecimal(location * d, this.digitRadian);\n },\n decimalToGrade: function decimalToGrade(location) {\n var d = 1.11111111111111111111;\n return this.roundToDecimal(location * d, this.digitRadian);\n },\n decimalToDMS: function decimalToDMS(location, hemisphere) {\n if (location < 0) {\n location *= -1; // strip dash '-'\n }\n\n var degrees = Math.floor(location); // strip decimal remainer for degrees\n var minutesFromRemainder = (location - degrees) * 60; // multiply the remainer by 60\n var minutes = Math.floor(minutesFromRemainder); // get minutes from integer\n var secondsFromRemainder = (minutesFromRemainder - minutes) * 60; // multiply the remainer by 60\n var seconds = this.roundToDecimal(secondsFromRemainder, this.digitSecond); // get minutes by rounding to integer\n\n var dms = degrees + \"° \" + minutes + \"' \" + seconds + \"\\\" \";\n if (hemisphere) {\n dms += hemisphere;\n }\n return dms;\n },\n decimalLatToDMS: function decimalLatToDMS(location) {\n var hemisphere = location < 0 ? this.SOUTH : this.NORTH; // south if negative\n return this.decimalToDMS(location, hemisphere);\n },\n decimalLongToDMS: function decimalLongToDMS(location) {\n var hemisphere = location < 0 ? this.WEST : this.EAST; // west if negative\n return this.decimalToDMS(location, hemisphere);\n },\n DMSToDecimal: function DMSToDecimal(degrees, minutes, seconds, hemisphere) {\n var ddVal = degrees + minutes / 60 + seconds / 3600;\n ddVal = hemisphere === this.SOUTH || hemisphere === this.WEST ? ddVal * -1 : ddVal;\n var decimal = this.roundToDecimal(ddVal, this.digitDecimal);\n return decimal;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (PositionFormater);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvVXRpbHMvUG9zaXRpb25Gb3JtYXRlci5qcz84ZmJjIl0sIm5hbWVzIjpbIlBvc2l0aW9uRm9ybWF0ZXIiLCJOT1JUSCIsIlNPVVRIIiwiRUFTVCIsIldFU1QiLCJkaWdpdFNlY29uZCIs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XIgaGVtaXNwaGVyZSA9IChsb2NhdGlvbiA8IDApID8gdGhpcy5XRVNUIDogdGhpcy5FQVNUOyAvLyB3ZXN0IGlmIG5lZ2F0aXZlXG4gICAgICAgIHJldHVybiB0aGlzLmRlY2ltYWxUb0RNUyhsb2NhdGlvbiwgaGVtaXNwaGVyZSk7XG4gICAgfSxcblxuICAgIERNU1RvRGVjaW1hbCA6IGZ1bmN0aW9uIChkZWdyZWVzLCBtaW51dGVzLCBzZWNvbmRzLCBoZW1pc3BoZXJlKSB7XG4gICAgICAgIHZhciBkZFZhbCA9IGRlZ3JlZXMgKyBtaW51dGVzIC8gNjAgKyBzZWNvbmRzIC8gMzYwMDtcbiAgICAgICAgZGRWYWwgPSAoaGVtaXNwaGVyZSA9PT0gdGhpcy5TT1VUSCB8fCBoZW1pc3BoZXJlID09PSB0aGlzLldFU1QpID8gZGRWYWwgKiAtMSA6IGRkVmFsO1xuXG4gICAgICAgIHZhciBkZWNpbWFsID0gdGhpcy5yb3VuZFRvRGVjaW1hbChkZFZhbCwgdGhpcy5kaWdpdERlY2ltYWwpO1xuICAgICAgICByZXR1cm4gZGVjaW1hbDtcbiAgICB9XG5cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFBvc2l0aW9uRm9ybWF0ZXI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Utils/PositionFormater.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Controls/Widget.js": +/*!***************************************!*\ + !*** ./src/Itowns/Controls/Widget.js ***! + \***************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n// import { THREE } from \"itowns\";\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getLogger(\"Widget\");\n\n/**\n* @classdesc\n* iTowns Widget class.\n* Every geoportal control inherits of this class.\n*\n* @constructor\n* @alias itowns.control.Widget\n* @param {Object} options - options for function call.\n* @param {String} options.name - Name of the widget.\n* @param {Object} options.element - HTML element of the widget\n* @param {Object|String} options.target - HTML element or HTML element id where to put the widget\n* @param {String} options.position - \"absolute\" or \"relative\"\n* @example\n* var myWidget = new itowns.control.Widget({\n* name : \"myWidget\",\n* element : myWidgetDiv,\n* target : myWidgetTargetDiv,\n* position: \"absolute\"\n* });\n*/\nfunction Widget(options) {\n this._name = options.name !== undefined ? options.name : null;\n this._element = options.element !== undefined ? options.element : null;\n this._position = options.position !== undefined ? options.position : null;\n this._target = null;\n this._globe = null;\n if (options.target) {\n this.setTarget(options.target, this._position);\n }\n}\n\n/*\n * @lends module:Attributions\n */\nWidget.prototype = Object.create( /* THREE */three__WEBPACK_IMPORTED_MODULE_0__[\"EventDispatcher\"].prototype, {});\n\n/**\n * Constructor (alias)\n */\nWidget.prototype.constructor = Widget;\n\n/**\n * Return the widget's container element.\n *\n * @method\n * @return {HTMLElement} widget's container element.\n */\nWidget.prototype.getElement = function getElement() {\n return this._element;\n};\n\n/**\n * Associates the widget to a specified target div.\n *\n * @method\n * @param {HTMLElement|String} target - widget target div html element or target div id.\n * @param {String} position - html position attribute.\n */\nWidget.prototype.setTarget = function setTarget(target, position) {\n this._target = typeof target === \"string\" ? document.getElementById(target) : target;\n if (!this._element) {\n logger.error(\"Widget:setTarget - widget element not created\");\n return;\n }\n this._element.style.position = position || \"relative\";\n this._target.appendChild(this._element);\n};\n\n/**\n * Return the widget's target div.\n *\n * @method\n * @return {HTMLElement} widget's target div.\n */\nWidget.prototype.getTarget = function getTarget() {\n return this._target;\n};\n\n/**\n * Return the widget's element div.\n *\n * @method\n * @return {HTMLElement} widget's element div.\n */\nWidget.prototype.getElement = function getElement() {\n return this._element;\n};\n\n/**\n * Return the widget's element position.\n *\n * @method\n * @return {String} widget's element position.\n */\nWidget.prototype.getPosition = function getPosition() {\n return this._position;\n};\n\n/**\n * Get the globe associated with the widget. Undefined if the widget is not added to a globe.\n *\n * @method\n * @return {Object} globe\n */\nWidget.prototype.getGlobe = function getGlobe() {\n return this._globe;\n};\n\n/**\n * Associate a globe to the widget.\n *\n * @method\n * @param {Object} globe - Globe to associate to the widget.\n */\nWidget.prototype.setGlobe = function setGlobe(globe) {\n this._globe = globe;\n};\n\n/**\n * Get the options associated with the widget.\n *\n * @method\n * @return {Object} options\n */\nWidget.prototype.getOptions = function getOptions() {\n return this._options;\n};\n\n/**\n * Set the options of the control\n *\n * @method\n * @param {Object} options - Options to associate to the widget.\n */\nWidget.prototype.setOptions = function setOptions(options) {\n this._options = options;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Widget);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvQ29udHJvbHMvV2lkZ2V0LmpzP2IwMGQiXSwibmFtZXMiOlsibG9nZ2VyIiwiTG9nZ2VyIiwiZ2V0TG9nZ2VyIiwiV2lkZ2V0Iiwib3B0aW9ucyIsIl9uYW1lIiwibmFtZSIsInVuZGVmaW5lZCIsIl9lbGVtZW50IiwiZWxlbWVudCIsIl9wb3NpdGlvbiIsInBvc2l0aW9uIiwiX3RhcmdldCIsIl9nbG9iZSIsInRhcmdldCIsInNldFRhcmdldCIsInByb3RvdHlwZSIsIk9iamVjdCIsImNyZWF0ZSIsIkV2ZW50RGlzcGF0Y2hlciIsImNvbnN0cnVjdG9yIiwiZ2V0RWxlbWVudCIsImRvY3VtZW50IiwiZ2V0RWxlbWVudEJ5SWQiLCJlcnJvciIsInN0eWxlIiwiYXBw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XJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Controls/Widget.js\n"); + +/***/ }), + +/***/ "./src/Itowns/GlobeViewExtended.js": +/*!*****************************************!*\ + !*** ./src/Itowns/GlobeViewExtended.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"GlobeViewExtended\");\n\n/**\n * @classdesc\n *\n * Extended itowns.GlobeView.\n *\n * @constructor\n * @extends {itowns.GlobeView}\n * @param {HTMLElement} viewerDiv - Where to instanciate the Three.js scene in the DOM\n * @param {Object} coordCarto - longitude, latitude, altitude\n * @param {Object} [options] - Optional properties which includes Itowns GlobeView optional properties (see Itowns documentation).\n * @param {Boolean} [options.renderer.isWebGL2=True] - is an Itowns GlobeView optional property to enable webgl 2.0 for THREE.js.\n * @param {String} [options.position=\"relative\"] - \"absolute\" or \"relative\"\n */\nfunction GlobeViewExtended(viewerDiv, coordCarto, options) {\n if (!viewerDiv.style.position || options && options.position) {\n viewerDiv.style.position = !options || !options.position ? \"relative\" : options.position;\n }\n\n // stockage de l'élément html porteur du globe\n var globeViewDiv = document.createElement(\"div\");\n globeViewDiv.style.width = \"100%\";\n globeViewDiv.style.height = \"100%\";\n viewerDiv.appendChild(globeViewDiv);\n this._viewerDiv = viewerDiv;\n\n // widget container\n this._widgets = [];\n\n // mapping des evenements\n this._initEventMap();\n\n // pour savoir si le globe est initialise\n this._isInitialized = false;\n\n // call constructor\n this._globeView = new itowns__WEBPACK_IMPORTED_MODULE_1__[\"GlobeView\"](globeViewDiv, coordCarto, options);\n var self = this;\n this.listen(GlobeViewExtended.EVENTS.GLOBE_INITIALIZED, function () {\n self._isInitialized = true;\n });\n this._globeView.addFrameRequester(itowns__WEBPACK_IMPORTED_MODULE_1__[\"MAIN_LOOP_EVENTS\"].BEFORE_RENDER, function () {\n clearTimeout(this._preRenderTimer);\n self._preRenderTimer = setTimeout(function () {\n var visibleColorLayersIds = [];\n var visibleElevationLayersIds = [];\n for (var i = 0; i < self.getGlobeView().tileLayer.info.displayed.layers.length; ++i) {\n if (self.getGlobeView().tileLayer.info.displayed.layers[i].isColorLayer) {\n visibleColorLayersIds.push(self.getGlobeView().tileLayer.info.displayed.layers[i].id);\n }\n if (self.getGlobeView().tileLayer.info.displayed.layers[i].isElevationLayer) {\n visibleElevationLayersIds.push(self.getGlobeView().tileLayer.info.displayed.layers[i].id);\n }\n }\n var currentExtent = self.getGlobeView().tileLayer.info.displayed.extent;\n self._globeView.dispatchEvent({\n type: GlobeViewExtended.EVENTS.PRE_RENDER,\n colorLayersId: visibleColorLayersIds,\n elevationLayersId: visibleElevationLayersIds,\n extent: currentExtent\n });\n }, 100);\n }.bind(this));\n if (this._globeView.controls) {\n this.freezeControl();\n }\n}\n\n/**\n * intializes the evenements map\n */\nGlobeViewExtended.prototype._initEventMap = function () {\n if (!GlobeViewExtended.EVENTS) {\n GlobeViewExtended.EVENTS = {\n RANGE_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"CONTROL_EVENTS\"].RANGE_CHANGED,\n CENTER_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"CONTROL_EVENTS\"].CAMERA_TARGET_CHANGED,\n ORIENTATION_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"CONTROL_EVENTS\"].ORIENTATION_CHANGED,\n LAYER_ADDED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"GLOBE_VIEW_EVENTS\"].LAYER_ADDED,\n LAYER_REMOVED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"GLOBE_VIEW_EVENTS\"].LAYER_REMOVED,\n LAYERS_ORDER_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"GLOBE_VIEW_EVENTS\"].COLOR_LAYERS_ORDER_CHANGED,\n GLOBE_INITIALIZED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"GLOBE_VIEW_EVENTS\"].GLOBE_INITIALIZED,\n LAYERS_INITIALIZED: itowns__WEBPACK_IMPORTED_MODULE_1__[\"VIEW_EVENTS\"].LAYERS_INITIALIZED,\n VIEW_INITIALIZED: \"viewinitialized\",\n PRE_RENDER: \"prerender\",\n MOUSE_MOVE: \"mousemove\",\n AFTER_RENDER: itowns__WEBPACK_IMPORTED_MODULE_1__[\"MAIN_LOOP_EVENTS\"].AFTER_RENDER,\n OPACITY_PROPERTY_CHANGED: \"opacity-property-changed\",\n VISIBLE_PROPERTY_CHANGED: \"visible-property-changed\",\n SEQUENCE_PROPERTY_CHANGED: \"sequence-property-changed\"\n };\n }\n};\n\n/**\n * Constructor (alias)\n */\nGlobeViewExtended.prototype.constructor = GlobeViewExtended;\n\n/**\n * Get GlobeViex Object (parent)\n * @returns {Object} itowns GlobeView object\n */\nGlobeViewExtended.prototype.getGlobeView = function () {\n return this._globeView;\n};\n\n/**\n * Indicates if the globe is initialized or not\n *\n * @return {Boolean} isInitialized\n *\n */\nGlobeViewExtended.prototype.isInitialized = function () {\n return this._isInitialized;\n};\n\n/**\n * Detects when the camera movement stops, then launch the callback given as parameter\n *\n * @param {Function} cb - The function to execute when the event occures.\n *\n */\nGlobeViewExtended.prototype.onCameraMoveStop = function (cb) {\n var self = this;\n function afterRenderHandler() {\n self._globeView.removeFrameRequester(itowns__WEBPACK_IMPORTED_MODULE_1__[\"MAIN_LOOP_EVENTS\"].AFTER_CAMERA_UPDATE, afterRenderHandler);\n cb();\n }\n ;\n this._globeView.addFrameRequester(itowns__WEBPACK_IMPORTED_MODULE_1__[\"MAIN_LOOP_EVENTS\"].AFTER_CAMERA_UPDATE, afterRenderHandler);\n};\n\n/**\n * Disables globe controls until the globe rendering is completed\n */\nGlobeViewExtended.prototype.freezeControl = function () {\n // disable navigation\n this._globeView.controls.enabled = false;\n this.onCameraMoveStop(function () {\n this._globeView.controls.enabled = true;\n }.bind(this));\n};\n\n/**\n * Associates a function to trigger when an event is received.\n *\n * @param {String} type - the event type. Can be any of {@link EVENTS}\n * @param {Function} callback - The function to execute when the event occures.\n * @return {Object} key - The event key\n *\n */\nGlobeViewExtended.prototype.listen = function (type, callback) {\n if (typeof callback !== \"function\") {\n logger.warn(\"no callback provided for event : \" + type);\n return null;\n }\n var target = this._getEventTarget(type);\n if (!target) {\n return null;\n }\n if (type === GlobeViewExtended.EVENTS.AFTER_RENDER) {\n target.addFrameRequester(type, callback);\n } else {\n target.addEventListener(type, callback);\n }\n return {\n target: target,\n callback: callback,\n type: type\n };\n};\n\n/**\n * Associates a function to trigger when a layer event is received.\n *\n * @param {Object} layer - The itowns layer.\n * @param {String} type - the event type. Can be any of {@link EVENTS}.\n * @param {Function} callback - The function to execute when the event occures.\n * @return {Object} key - The event key\n *\n */\nGlobeViewExtended.prototype.addLayerListener = function (layer, type, callback) {\n if (typeof callback !== \"function\") {\n logger.warn(\"no callback provided for event : \" + type);\n return null;\n }\n layer.addEventListener(type, callback);\n return {\n target: layer,\n callback: callback,\n type: type\n };\n};\n\n/**\n * Returns the target of a given event type\n *\n * @param {String} type - the event type. Can be any of {@link EVENTS}\n * @return {Object} target - The event target.\n *\n */\nGlobeViewExtended.prototype._getEventTarget = function (type) {\n switch (type) {\n case GlobeViewExtended.EVENTS.RANGE_CHANGED:\n case GlobeViewExtended.EVENTS.CENTER_CHANGED:\n case GlobeViewExtended.EVENTS.ORIENTATION_CHANGED:\n return this.getGlobeView().controls;\n case GlobeViewExtended.EVENTS.LAYER_ADDED:\n case GlobeViewExtended.EVENTS.LAYER_REMOVED:\n case GlobeViewExtended.EVENTS.LAYERS_ORDER_CHANGED:\n case GlobeViewExtended.EVENTS.LAYERS_INITIALIZED:\n case GlobeViewExtended.EVENTS.GLOBE_INITIALIZED:\n case GlobeViewExtended.EVENTS.PRE_RENDER:\n case GlobeViewExtended.EVENTS.AFTER_RENDER:\n case GlobeViewExtended.EVENTS.VIEW_INITIALIZED:\n return this.getGlobeView();\n case GlobeViewExtended.EVENTS.MOUSE_MOVE:\n return this._viewerDiv;\n default:\n logger.warn(\"unhandled event : \" + type);\n return null;\n }\n};\n\n/**\n * Cancels an event listening\n *\n * @param {Object} key - The event key\n *\n */\nGlobeViewExtended.prototype.forgetByKey = function (key) {\n if (key.type === GlobeViewExtended.EVENTS.AFTER_RENDER) {\n key.target.removeFrameRequester(key.type, key.callback);\n } else {\n key.target.removeEventListener(key.type, key.callback);\n }\n};\n\n/**\n * Cancels an layer event listening\n *\n * @param {Object} layer - The itowns layer\n * @param {String} type - the event type\n * @param {Function} callback - The function to execute when the event occures\n *\n */\nGlobeViewExtended.prototype.removeLayerListener = function (layer, type, callback) {\n this.forgetByKey({\n target: layer,\n callback: callback,\n type: type\n });\n};\n\n/**\n * Cancels an event listening\n *\n * @param {Object} type - The event type\n * @param {Function} callback - The event handler\n */\nGlobeViewExtended.prototype.forget = function (type, callback) {\n var target = this._getEventTarget(type);\n if (!target) return;\n this.forgetByKey({\n target: target,\n callback: callback,\n type: type\n });\n};\n\n/**\n * Overload itowns.GlobeView addLayer method\n *\n * @param {Object} layer - The itowns layer\n * @return {Promise} promise\n */\nGlobeViewExtended.prototype.addLayer = function (layer) {\n // FIXME : to delete when itowns commit 2e9ed61eb4aa2a4bbe0e17c8e2650953844b099e\n // is integrated into an iTowns release\n try {\n var promise = this.getGlobeView().addLayer(layer);\n } catch (error) {\n return Promise.reject(error);\n }\n return promise;\n};\n\n/**\n * Overload itowns.GlobeView removeLayer method\n *\n * @param {String} layerId - The layer id\n */\nGlobeViewExtended.prototype.removeLayer = function (layerId) {\n this.getGlobeView().removeLayer(layerId);\n};\n\n/**\n * Set layer opacity\n *\n * @param {String} layerId - Layer id\n * @param {Number} opacityValue - opacity value in [0 1]\n */\nGlobeViewExtended.prototype.setLayerOpacity = function (layerId, opacityValue) {\n var layer = this.getColorLayerById(layerId);\n layer.opacity = opacityValue;\n this.getGlobeView().notifyChange(layer);\n};\n\n/**\n * Set layer visibility\n *\n * @param {String} layerId - Layer id\n * @param {Boolean} visible - New visibility of the layer\n */\nGlobeViewExtended.prototype.setLayerVisibility = function (layerId, visible) {\n var layer = this.getLayerById(layerId);\n layer.visible = visible;\n this.getGlobeView().notifyChange(layer);\n};\n\n/**\n * Move layer to the specified index\n *\n * @param {String} layerId - Layer id\n * @param {Boolean} index - new index of the layer\n */\nGlobeViewExtended.prototype.moveLayerToIndex = function (layerId, index) {\n itowns__WEBPACK_IMPORTED_MODULE_1__[\"ColorLayersOrdering\"].moveLayerToIndex(this.getGlobeView(), layerId, index);\n};\n\n/**\n * Remove event listener from the globe\n *\n * @param {String} type - event type\n * @param {Function} callback - event handler\n */\nGlobeViewExtended.prototype.removeEventListener = function (type, callback) {\n switch (type) {\n case \"mousemove\":\n this._viewerDiv.removeEventListener(type, callback);\n break;\n case \"centerchanged\":\n this.getGlobeView().controls.removeEventListener(type, callback);\n break;\n default:\n this.getGlobeView().removeEventListener(type, callback);\n break;\n }\n};\n\n/**\n * Defines if the current view extent have to be computed on pre-render event\n *\n * @param {Boolean} b - tells if the view extent info should be fetched by the event PRE_RENDER\n */\nGlobeViewExtended.prototype.preRenderEventFetchViewExtent = function (b) {\n if (typeof b === \"undefined\") {\n b = true;\n }\n this._fetchExtent = b;\n};\n\n/**\n * Defines if the list of the color layers displayed have to be computed on pre-render event\n *\n * @param {Boolean} b - tells if the displayed color layers info should be fetched by the event PRE_RENDER\n */\nGlobeViewExtended.prototype.preRenderEventFetchColorLayersDisplayed = function (b) {\n if (typeof b === \"undefined\") {\n b = true;\n }\n this._fetchVisibleColorLayers = b;\n};\n\n/**\n * Defines if the list of the elevation layers displayed have to be computed on pre-render event\n *\n * @param {Boolean} b - tells if the displayed elevation layers info should be fetched by the event PRE_RENDER\n */\nGlobeViewExtended.prototype.preRenderEventFetchElevationLayersDisplayed = function (b) {\n if (typeof b === \"undefined\") {\n b = true;\n }\n this._fetchVisibleElevationLayers = b;\n};\n\n/**\n * Defines if the list of the layers of all types displayed have to be computed on pre-render event\n *\n * @param {Boolean} b - tells if both displayed color layers and displayed elevation layers infos should be fetched by the event PRE_RENDER\n */\nGlobeViewExtended.prototype.preRenderEventFetchLayersDisplayed = function (b) {\n if (typeof b === \"undefined\") {\n b = true;\n }\n this._fetchVisibleColorLayers = b;\n this._fetchVisibleElevationLayers = b;\n};\n\n/**\n * Get layer by its id\n *\n * @param {String} layerId - Layer id\n * @return {Object} layer Object\n */\nGlobeViewExtended.prototype.getLayerById = function (layerId) {\n var layer = this.getGlobeView().getLayers(function (l) {\n if (l.id === layerId) {\n return l;\n }\n })[0];\n if (!layer) {\n logger.trace(\"[GlobeViewExtended] : no Layer found for the id '\" + layerId + \"'\");\n return;\n }\n return layer;\n};\n\n/**\n * Get color layer by its id\n *\n * @param {String} layerId - Color layer id\n * @return {Object} layer Object\n */\nGlobeViewExtended.prototype.getColorLayerById = function (layerId) {\n var layer = this.getGlobeView().getLayers(function (l) {\n if (l.id === layerId && l.isColorLayer) {\n return l;\n }\n })[0];\n if (!layer) {\n logger.trace(\"[GlobeViewExtended] : no colorLayer found for the id '\" + layerId + \"'\");\n return;\n }\n return layer;\n};\n\n/**\n * Get imagery layers\n *\n * @return {Array} imagery layers\n */\nGlobeViewExtended.prototype.getColorLayers = function () {\n return this.getGlobeView().getLayers(function (layer) {\n if (layer.isColorLayer) {\n return layer;\n }\n });\n};\n\n/**\n * Get vector layers\n *\n * @return {Array} vector layers\n */\nGlobeViewExtended.prototype.getVectorLayers = function () {\n return this.getGlobeView().getLayers(function (layer) {\n if (layer.source && layer.source.isFileSource) {\n return layer;\n }\n });\n};\n\n/**\n * Get featureGeometry layers\n *\n * @return {Array} imagery layers\n */\nGlobeViewExtended.prototype.getFeatureGeometryLayers = function () {\n return this.getGlobeView().getLayers(function (layer) {\n if (layer.isFeatureGeometryLayer) {\n return layer;\n }\n });\n};\n\n/**\n * Get elevation layers\n *\n * @return {Array} elevation layers\n */\nGlobeViewExtended.prototype.getElevationLayers = function () {\n return this.getGlobeView().getLayers(function (layer) {\n if (layer.isElevationLayer) {\n return layer;\n }\n });\n};\n\n/**\n * Get the current view extent\n *\n * @returns {Array} current view extent\n */\nGlobeViewExtended.prototype.getExtent = function () {\n return this.getGlobeView().tileLayer.info.displayed.extent;\n};\n\n/**\n * Add a widget to the globe\n *\n * @param {Object} widget - The Widget object to add\n */\nGlobeViewExtended.prototype.addWidget = function (widget) {\n if (!widget.getTarget()) {\n // default position value is 'absolute' if the target div is the viewer div\n widget.setTarget(this._viewerDiv, widget.getPosition() ? widget.getPosition() : \"absolute\");\n }\n widget.setGlobe(this);\n\n // calls the widget code that is needed to be used after the globe is associated to the control (ex. Buildings wdget)\n if (typeof widget.onWidgetAdded === \"function\") {\n widget.onWidgetAdded(widget);\n }\n this._widgets.push(widget);\n};\n\n/**\n * Returns all widgets.\n *\n * @return {Array} widgets - The array of widgets.\n */\nGlobeViewExtended.prototype.getWidgets = function () {\n return this._widgets;\n};\n\n/**\n * Removes a widget.\n *\n * @param {Object} widget - The Widget object to remove\n */\nGlobeViewExtended.prototype.removeWidget = function (widget) {\n widget.setGlobe();\n for (var idx = 0; idx < this._widgets.length; idx++) {\n if (this._widgets[idx] === widget) {\n this._widgets.splice(idx, 1);\n }\n }\n};\n\n/**\n * Get html target element\n *\n * @return {HTMLElement} Globe container element\n */\nGlobeViewExtended.prototype.getTargetElement = function () {\n return this._viewerDiv;\n};\n\n/**\n * Returns current view scale\n *\n * @return {Number} Scale\n */\nGlobeViewExtended.prototype.getScale = function () {\n return this.getGlobeView().getScale();\n};\n\n/**\n * Sets tilt\n *\n * @param {Number} tilt - Tilt value\n * @return {Promise} - Promise when setTilt is done\n */\nGlobeViewExtended.prototype.setTilt = function (tilt) {\n return this.getGlobeView().controls.setTilt(tilt, false);\n};\n\n/**\n * Returns tilt\n *\n * @return {Number} - Tilt\n */\nGlobeViewExtended.prototype.getTilt = function () {\n return this.getGlobeView().controls.getTilt();\n};\n\n/**\n * Sets azimuth\n *\n * @param {Number} azimuth - Azimuth value\n * @return {Promise} - Promise when setAzimuth is done\n */\nGlobeViewExtended.prototype.setAzimuth = function (azimuth) {\n return this.getGlobeView().controls.setHeading(azimuth, false);\n};\n\n/**\n * Returns azimuth\n *\n * @return {Number} azimuth\n */\nGlobeViewExtended.prototype.getAzimuth = function () {\n return this.getGlobeView().controls.getHeading();\n};\n\n/**\n * Gets the coordinate in lat,lon for a given pixel.\n *\n * @param {Number} x - The pixel x-position inside the Globe element.\n * @param {Number} y - The pixel y-position inside the Globe element.\n * @return {Coordinates} position\n */\nGlobeViewExtended.prototype.getCoordinateFromPixel = function (x, y) {\n return this.getGlobeView().controls.pickGeoPosition({\n x: x,\n y: y\n });\n};\n\n/**\n * Gets the coordinate in lat,lon for a given mouse position.\n *\n * @param {MouseEvent} mouseEvent - A mouse event.\n * @return {Coordinates} position\n */\nGlobeViewExtended.prototype.getCoordinateFromMouseEvent = function (mouseEvent) {\n var coords = this.getGlobeView().eventToViewCoords(mouseEvent);\n return this.getGlobeView().controls.pickGeoPosition(coords);\n};\n\n/**\n * Get all visible features that intersect a pixel\n *\n * @param {MouseEvent} mouseEvent - A mouse event.\n * @return {Promise} promise\n */\nGlobeViewExtended.prototype.getFeaturesAtMousePosition = function (mouseEvent) {\n var vectorLayers = this.getVectorLayers();\n if (!vectorLayers) {\n return Promise.resolve([]);\n }\n // array of the visible features on the clicker coord\n var geoCoord = this.getCoordinateFromMouseEvent(mouseEvent);\n if (!geoCoord) {\n return Promise.resolve([]);\n }\n // buffer around the click inside we retrieve the features\n var precisionInMeters = this.getGlobeView().getPixelsToMeters(5);\n var precision = this.getGlobeView().getMetersToDegrees(precisionInMeters);\n var promises = [];\n for (var i = 0; i < vectorLayers.length; i++) {\n if (!vectorLayers[i].visible) {\n continue;\n }\n if (vectorLayers[i].isColorLayer) {\n promises.push(vectorLayers[i].source.loadData({}, {\n crs: \"EPSG:4326\"\n }));\n }\n }\n return Promise.all(promises).then(function (result) {\n var visibleFeatures = [];\n for (var _i = 0; _i < result.length; _i++) {\n visibleFeatures = visibleFeatures.concat(itowns__WEBPACK_IMPORTED_MODULE_1__[\"FeaturesUtils\"].filterFeaturesUnderCoordinate(geoCoord, result[_i], precision));\n }\n return visibleFeatures;\n });\n};\n\n/**\n * Changes the center of the scene on screen to the specified in lat, lon.\n *\n * @param {Object} center - Center object\n * @param {Number} center.longitude - Coordinate longitude WGS84 in degree\n * @param {Number} center.latitude - Coordinate latitude WGS84 in degree\n * @return {Promise} A promise that resolves when the next 'globe initilazed' event fires.\n */\nGlobeViewExtended.prototype.setCameraTargetGeoPosition = function (center) {\n var itownsCoord = this._transformCoords(center);\n return this.getGlobeView().controls.lookAtCoordinate(itownsCoord, false);\n};\n\n/**\n * Retuns the coordinates of the central point on screen in lat,lon and alt\n *\n * @return {Object} center\n */\nGlobeViewExtended.prototype.getCenter = function () {\n var cameraCenter = this.getGlobeView().controls.getLookAtCoordinate();\n return this._fromItownsCoords(cameraCenter);\n};\n\n/**\n * Returns the actual zoom.\n *\n * @return {Number} zoom\n */\nGlobeViewExtended.prototype.getZoom = function () {\n return this.getGlobeView().controls.getZoom();\n};\n\n/**\n * Sets the current zoom.\n *\n * @param {Number} zoom - The zoom\n * @return {Promise} promise\n */\nGlobeViewExtended.prototype.setZoom = function (zoom) {\n return this.getGlobeView().controls.setZoom(zoom, false);\n};\n\n/**\n * To convert the projection in meters on the globe of a number of pixels of screen\n * @param {Number} pixels - count pixels to project\n * @return {Number} projection in meters on globe\n */\nGlobeViewExtended.prototype.pixelsToMeters = function (pixels) {\n return this.getGlobeView().getPixelsToMeters(pixels);\n};\n\n/**\n * Projection on screen in pixels of length in meter on globe\n * @param {Number} value - Length in meter on globe\n * @return {Number} projection in pixels on screen\n */\nGlobeViewExtended.prototype.metersToPixels = function (value) {\n return this.getGlobeView().getMetersToPixels(value);\n};\n\n/**\n * Returns the \"range\": the distance in meters between the camera and the current central point on the screen.\n * @return {Number} number\n */\nGlobeViewExtended.prototype.getRange = function () {\n return this.getGlobeView().controls.getRange();\n};\n\n/**\n * @return {THREE.Vector3} position\n */\nGlobeViewExtended.prototype.getCameraTargetPosition = function () {\n return this.getGlobeView().controls.getCameraTargetPosition();\n};\n\n/**\n * To get the layer event infos\n *\n * @param {Object} evt - event\n * @returns {Object} object with event properties\n */\nGlobeViewExtended.prototype.getLayerEventInfos = function (evt) {\n var propertyName = evt.type.replace(\"-property-changed\", \"\");\n return {\n propertyName: propertyName,\n previousValue: evt.previous[propertyName],\n newValue: evt[\"new\"][propertyName]\n };\n};\n\n/**\n * Sets background (specific to miniglobe)\n */\nGlobeViewExtended.prototype.setBackground = function () {\n // Set a 0 alpha clear value (instead of the default '1')\n // because we want a transparent background for the miniglobe view to be able\n // to see the main view \"behind\"\n this.getGlobeView().mainLoop.gfxEngine.renderer.setClearColor(0x000000, 0);\n};\n\n/**\n * Sets camera position\n * @param {THREE.Vector3} target - Target position\n * @param {Number} distance - Distance from target\n */\nGlobeViewExtended.prototype.setCameraPosition = function (target, distance) {\n this.getGlobeView().camera.camera3D.position.copy(target).setLength(distance);\n};\n\n/**\n * Sets camera orientation to look at specified target\n * @param {THREE.Vector3} target - Target position\n */\nGlobeViewExtended.prototype.lookAt = function (target) {\n this.getGlobeView().camera.camera3D.lookAt(target);\n};\n\n/**\n * Notifies the scene it needs to be updated\n * @param {String} styleUrl - style url\n * @returns {Object} json object\n */\nGlobeViewExtended.prototype.parseMapboxStyle = function (styleUrl) {\n return itowns__WEBPACK_IMPORTED_MODULE_1__[\"Fetcher\"].json(styleUrl);\n};\n\n/**\n * Notifies the scene it needs to be updated\n */\nGlobeViewExtended.prototype.notifyChange = function () {\n this.getGlobeView().notifyChange(this.getGlobeView().camera.camera3D);\n};\n\n/**\n* Resizes itowns\n*\n* @param {Integer} width - canvas width in pixels\n* @param {Integer} height - canvas height in pixels\n*/\nGlobeViewExtended.prototype.resize = function (width, height) {\n this.getGlobeView().mainLoop.gfxEngine.onWindowResize(width, height);\n this.notifyChange();\n};\n\n/**\n* Transform to itowns coordinates\n*\n* @param {Object} coordCarto - longitude, latitude, altitude\n* @returns {Object} itowns coordinates\n*/\nGlobeViewExtended.prototype._transformCoords = function (coordCarto) {\n if (coordCarto === undefined) return;\n var itownsCoord = {};\n if (coordCarto.zoom !== undefined) itownsCoord.zoom = coordCarto.zoom;\n if (coordCarto.tilt !== undefined) itownsCoord.tilt = coordCarto.tilt;\n if (coordCarto.heading !== undefined) itownsCoord.heading = coordCarto.heading;\n if (coordCarto.longitude !== undefined && coordCarto.latitude !== undefined) {\n var altitude = coordCarto.altitude || 0;\n itownsCoord.coord = new itowns__WEBPACK_IMPORTED_MODULE_1__[\"Coordinates\"](\"EPSG:4326\", parseFloat(coordCarto.longitude), parseFloat(coordCarto.latitude), parseFloat(altitude));\n }\n return itownsCoord;\n};\n\n/**\n* Transform from itowns coordinates\n*\n* @param {Object} itownsCoord - itowns coordinates\n* @returns {Object} coordinates\n*/\nGlobeViewExtended.prototype._fromItownsCoords = function (itownsCoord) {\n return {\n lon: itownsCoord.x,\n lat: itownsCoord.y,\n alt: itownsCoord.z\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (GlobeViewExtended);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvR2xvYmVWaWV3RXh0ZW5kZWQuanM/M2MzNiJdLCJuYW1lcyI6WyJsb2dnZXIiLC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pbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHZpc2libGVDb2xvckxheWVyc0lkcyA9IFtdO1xuICAgICAgICAgICAgdmFyIHZpc2libGVFbGV2YXRpb25MYXllcnNJZHMgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzZWxmLmdldEdsb2JlVmlldygpLnRpbGVMYXllci5pbmZvLmRpc3BsYXllZC5sYXllcnMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2VsZi5nZXRHbG9iZVZpZXcoKS50aWxlTGF5ZXIuaW5mby5kaXNwbGF5ZWQubGF5ZXJzW2ldLmlzQ29sb3JMYXllcikge1xuICAgICAgICAgICAgICAgICAgICB2aXNpYmxlQ29sb3JMYXllcnNJZHMucHVzaChzZWxmLmdldEdsb2JlVmlldygpLnRpbGVMYXllci5pbmZvLmRpc3BsYXllZC5sYXllcnNbaV0uaWQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2VsZi5nZXRHbG9iZVZpZXcoKS50aWxlTGF5ZXIuaW5mby5kaXNwbGF5ZWQubGF5ZXJzW2ldLmlzRWxldmF0aW9uTGF5ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmlzaWJsZUVsZXZhdGlvbkxheWVyc0lkcy5wdXNoKHNlbGYuZ2V0R2xvYmVWaWV3KCkudGlsZUxheWVyLmluZm8uZGlzcGxheWVkLmxheWVyc1tpXS5pZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGN1cnJlbnRFeHRlbnQgPSBzZWxmLmdldEdsb2JlVmlldygpLnRpbGVMYXllci5pbmZvLmRpc3BsYXllZC5leHRlbnQ7XG4gICAgICAgICAgICBzZWxmLl9nbG9iZVZpZXcuZGlzcGF0Y2hFdmVudCh7XG4gICAgICAgICAgICAgICAgdHlwZSA6IEdsb2JlVmlld0V4dGVuZ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hwb3J0IGRlZmF1bHQgR2xvYmVWaWV3RXh0ZW5kZWQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/GlobeViewExtended.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Layer/LayerElevation.js": +/*!********************************************!*\ + !*** ./src/Itowns/Layer/LayerElevation.js ***! + \********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/Config */ \"./src/Common/Utils/Config.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../../package.json */ \"./package.json\", 1);\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__);\n/* globals self */\n\n\n\n\n\n\n/* import Extent from \"itowns/Core/Geographic/Extent\";\nimport WMTSSource from \"itowns/Source/WMTSSource\";\nimport ElevationLayer from \"itowns/Layer/ElevationLayer\"; */\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getLogger(\"elevationLayer\");\n\n/**\n * @classdesc\n * Geoportal elevation source creation\n *\n * @constructor\n * @alias itowns.layer.GeoportalElevation\n * @param {Object} options - options for function call.\n * @param {String} options.layer - Elevation layer name (e.g. \"ELEVATION.ELEVATIONGRIDCOVERAGE\")\n * @param {Boolean} [options.ssl] - if set true, enforce protocol https (only for nodejs)\n * @param {String} [options.apiKey] - Access key to Geoportal platform\n * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer\n * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer\n * @param {String} [options.title] - Overloads the default title of the layer\n * @param {String} [options.description] - Overloads the default description of the layer\n * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer\n * @param {Object} [options.itownsParams] - options to overload default geoportal layer options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer})\n * @example\n * var geoportalElevation = new itowns.layer.GeoportalElevation({\n * layer : \"ELEVATION.ELEVATIONGRIDCOVERAGE\"\n * });\n */\nfunction LayerElevation(options) {\n if (!(this instanceof LayerElevation)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n\n // check layer params\n if (!options.layer) {\n throw new Error(\"ERROR PARAM_MISSING : layer\");\n }\n if (typeof options.layer !== \"string\") {\n throw new Error(\"ERROR WRONG TYPE : layer\");\n }\n\n // par defaut\n if (typeof options.ssl === \"undefined\") {\n options.ssl = false;\n }\n\n // Check if configuration is loaded\n if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isConfigLoaded()) {\n throw new Error(\"ERROR : Configuration has to be loaded\");\n }\n var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerId(options.layer, \"WMTS\");\n if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerParams(options.layer, \"WMTS\")) {\n var config = {};\n var wmtsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerParams(options.layer, \"WMTS\");\n if (wmtsParams.projection === \"EPSG:3857\") {\n wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"Extent\"](\"EPSG:4326\", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top).as(\"EPSG:3857\");\n } else {\n wmtsParams.projection = \"EPSG:4326\";\n wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"Extent\"](\"EPSG:4326\", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top);\n }\n // les originators ne sont pas renvoyés dans la configuration, on prend donc ceux donnés par l'utilisateur\n if (options.itownsParams && options.itownsParams.source && options.itownsParams.source.attribution) {\n wmtsParams.originators = options.itownsParams.source.attribution;\n }\n // gestion de mixContent dans l'url du service...\n var ctx = typeof window !== \"undefined\" ? window : typeof self !== \"undefined\" ? self : null;\n var protocol = ctx ? ctx.location && ctx.location.protocol && ctx.location.protocol.indexOf(\"https:\") === 0 ? \"https://\" : \"http://\" : options.ssl ? \"https://\" : \"http://\";\n config.id = layerId;\n config.noDataValue = -99999;\n config.updateStrategy = {\n type: 0,\n options: {\n groups: [11, 14]\n }\n };\n config.source = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"WMTSSource\"]({\n protocol: \"wmts\",\n url: wmtsParams.url.replace(/(http|https):\\/\\//, protocol),\n networkOptions: {\n crossOrigin: \"omit\"\n },\n attribution: wmtsParams.originators,\n projection: wmtsParams.projection,\n name: options.layer,\n format: \"image/x-bil;bits=32\",\n tileMatrixSet: wmtsParams.TMSLink,\n tileMatrixSetLimits: wmtsParams.tileMatrixSetLimits,\n extent: {\n west: wmtsParams.extent.west,\n east: wmtsParams.extent.east,\n south: wmtsParams.extent.south,\n north: wmtsParams.extent.north\n }\n });\n\n // ajout du tag gp-itowns-ext dans les requêtes WMTS elevation\n config.source.url = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Helper.normalyzeUrl(config.source.url, {\n \"gp-itowns-ext\": _package_json__WEBPACK_IMPORTED_MODULE_4__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_4__.version\n }, false);\n\n // récupération des autres paramètres passés par l'utilisateur\n _Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].mergeParams(config, options.itownsParams);\n\n // add legends and metadata (to be added to LayerSwitcher control)\n // we take in priority the explicit options given by the user\n config.legends = options.legends || wmtsParams.legends;\n config.metadata = options.metadata || wmtsParams.metadata;\n config.description = options.description || wmtsParams.description;\n config.title = options.title || wmtsParams.title;\n config.quicklookUrl = options.quicklookUrl || wmtsParams.quicklookUrl;\n return new itowns__WEBPACK_IMPORTED_MODULE_5__[\"ElevationLayer\"](config.id, config);\n } else {\n // If layer is not in Gp.Config\n logger.log(\"[source WMTS] ERROR : \" + options.layer + \" cannot be found in Geoportal Configuration. Make sure that this resource is included in your contract key.\");\n }\n}\n\n/*\n * Constructor (alias)\n */\nLayerElevation.prototype.constructor = LayerElevation;\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerElevation);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvTGF5ZXIvTGF5ZXJFbGV2YXRpb24uanM/MjUyMCJdLCJuYW1lcyI6WyJsb2dnZXIiLCJMb2dnZXIiLCJnZXRMb2dnZXIiLCJMYXllckVsZXZhdGlvbiIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiLCJsYXllciIsIkVycm9yIiwic3NsIiwiQ29uZmlnIiwiaXNDb25maWdMb2FkZWQiLCJsYXllcklkIiwiY29uZmlndXJhdGlvbiIsImdldExheWVySWQiLCJnZXRMYXllclBhcmFtc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gOiBcIndtdHNcIixcbiAgICAgICAgICAgIHVybCA6IHdtdHNQYXJhbXMudXJsLnJlcGxhY2UoLyhodHRwfGh0dHBzKTpcXC9cXC8vLCBwcm90b2NvbCksXG4gICAgICAgICAgICBuZXR3b3JrT3B0aW9ucyA6IHtcbiAgICAgICAgICAgICAgICBjcm9zc09yaWdpbiA6IFwib21pdFwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYXR0cmlidXRpb24gOiB3bXRzUGFyYW1zLm9yaWdpbmF0b3JzLFxuICAgICAgICAgICAgcHJvamVjdGlvbiA6IHdtdHNQYXJhbXMucHJvamVjdGlvbixcbiAgICAgICAgICAgIG5hbWUgOiBvcHRpb25zLmxheWVyLFxuICAgICAgICAgICAgZm9ybWF0IDogXCJpbWFnZS94LWJpbDtiaXRzPTMyXCIsXG4gICAgICAgICAgICB0aWxlTWF0cml4U2V0IDogd210c1BhcmFtcy5UTVNMaW5rLFxuICAgICAgICAgICAgdGlsZU1hdHJpeFNldExpbWl0cyA6IHdtdHNQYXJhbXMudGlsZU1hdHJpeFNldExpbWl0cyxcbiAgICAgICAgICAgIGV4dGVudCA6IHtcbiAgICAgICAgICAgICAgICB3ZXN0IDogd210c1BhcmFtcy5leHRlbnQud2VzdCxcbiAgICAgICAgICAgICAgICBlYXN0IDogd210c1BhcmFtcy5leHRlbnQuZWFzdCxcbiAgICAgICAgICAgICAgICBzb3V0aCA6IHdtdHNQYXJhbXMuZXh0ZW50LnNvdXRoLFxuICAgICAgICAgICAgICAgIG5vcnRoIDogd210c1BhcmFtcy5leHRlbnQubm9ydGhcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gYWpvdXQgZHUgdGFnIGdwLWl0b3ducy1leHQgZGFucyBsZXMgcmVxdcOqdGVzIFdNVFMgZWxldmF0aW9uXG4gICAgICAgIGNvbmZpZy5zb3VyY2UudXJsID0gR3AuSGVscGVyLm5vcm1hbHl6ZVVybChjb25maWcuc291cmNlL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aXMgbm90IGluIEdwLkNvbmZpZ1xuICAgICAgICBsb2dnZXIubG9nKFwiW3NvdXJjZSBXTVRTXSBFUlJPUiA6IFwiICsgb3B0aW9ucy5sYXllciArIFwiIGNhbm5vdCBiZSBmb3VuZCBpbiBHZW9wb3J0YWwgQ29uZmlndXJhdGlvbi4gTWFrZSBzdXJlIHRoYXQgdGhpcyByZXNvdXJjZSBpcyBpbmNsdWRlZCBpbiB5b3VyIGNvbnRyYWN0IGtleS5cIik7XG4gICAgfVxufVxuXG4vKlxuICogQ29uc3RydWN0b3IgKGFsaWFzKVxuICovXG5MYXllckVsZXZhdGlvbi5wcm90b3R5cGUuY29uc3RydWN0b3IgPSBMYXllckVsZXZhdGlvbjtcblxuZXhwb3J0IGRlZmF1bHQgTGF5ZXJFbGV2YXRpb247XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Layer/LayerElevation.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Layer/LayerWMS.js": +/*!**************************************!*\ + !*** ./src/Itowns/Layer/LayerWMS.js ***! + \**************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/Config */ \"./src/Common/Utils/Config.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../../package.json */ \"./package.json\", 1);\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__);\n\n\n\n\n\n\n/* import Extent from \"itowns/Core/Geographic/Extent\";\nimport WMSSource from \"itowns/Source/WMSSource\";\nimport ColorLayer from \"itowns/Layer/ColorLayer\"; */\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getLogger(\"wmsLayer\");\n\n/**\n * @classdesc\n * Geoportal WMTS source creation\n *\n * @constructor\n * @alias itowns.layer.GeoportalWMS\n * @param {Object} options - options for function call.\n * @param {String} options.layer - Layer name (e.g. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol)\n * @param {String} [options.apiKey] - Access key to Geoportal platform\n * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer\n * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer\n * @param {String} [options.title] - Overloads the default title of the layer\n * @param {String} [options.description] - Overloads the default description of the layer\n * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer\n * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer})\n * @example\n * var geoportalWMS = new itowns.layer.GeoportalWMS({\n * layer : \"ORTHOIMAGERY.ORTHOPHOTOS\"\n * });\n */\nfunction LayerWMS(options) {\n if (!(this instanceof LayerWMS)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n\n // check layer params\n if (!options.layer) {\n throw new Error(\"ERROR PARAM_MISSING : layer\");\n }\n if (typeof options.layer !== \"string\") {\n throw new Error(\"ERROR WRONG TYPE : layer\");\n }\n\n // par defaut\n if (typeof options.ssl === \"undefined\") {\n options.ssl = true;\n }\n\n // Check if configuration is loaded\n if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isConfigLoaded()) {\n throw new Error(\"ERROR : Configuration has to be loaded\");\n }\n var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerId(options.layer, \"WMS\");\n if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerParams(options.layer, \"WMS\")) {\n var config = {};\n var wmsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerParams(options.layer, \"WMS\");\n if (wmsParams.projection === \"EPSG:3857\") {\n wmsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"Extent\"](\"EPSG:4326\", wmsParams.extent.left, wmsParams.extent.right, wmsParams.extent.bottom, wmsParams.extent.top).as(\"EPSG:3857\");\n } else {\n wmsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"Extent\"](\"EPSG:4326\", wmsParams.extent.left, wmsParams.extent.right, wmsParams.extent.bottom, wmsParams.extent.top);\n }\n\n // les originators ne sont pas renvoyés dans la configuration, on prend donc ceux donnés par l'utilisateur\n if (options.itownsParams && options.itownsParams.source && options.itownsParams.source.attribution) {\n wmsParams.originators = options.itownsParams.source.attribution;\n }\n\n // si ssl = false on fait du http\n // par défaut, ssl = true, on fait du https\n var protocol = options.ssl === false ? \"http://\" : \"https://\";\n config.id = layerId;\n config.source = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"WMSSource\"]({\n protocol: \"wms\",\n version: wmsParams.version,\n attribution: wmsParams.originators,\n url: wmsParams.url.replace(/(http|https):\\/\\//, protocol),\n name: options.layer,\n projection: wmsParams.projection,\n style: \"\",\n heightMapWidth: 256,\n waterMask: false,\n networkOptions: {\n crossOrigin: \"omit\"\n },\n updateStrategy: {\n type: 0,\n options: {}\n },\n format: wmsParams.format,\n extent: {\n west: wmsParams.extent.west,\n east: wmsParams.extent.east,\n south: wmsParams.extent.south,\n north: wmsParams.extent.north\n }\n });\n\n // ajout du tag gp-itowns-ext dans les requêtes WMS\n config.source.url = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Helper.normalyzeUrl(config.source.url, {\n \"gp-itowns-ext\": _package_json__WEBPACK_IMPORTED_MODULE_4__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_4__.version\n }, false);\n\n // récupération des autres paramètres passés par l'utilisateur\n _Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].mergeParams(config, options.itownsParams);\n\n // add legends and metadata (to be added to LayerSwitcher control)\n // we take in priority the explicit options given by the user\n config.legends = options.legends || wmsParams.legends;\n config.metadata = options.metadata || wmsParams.metadata;\n config.description = options.description || wmsParams.description;\n config.title = options.title || wmsParams.title;\n config.quicklookUrl = options.quicklookUrl || wmsParams.quicklookUrl;\n return new itowns__WEBPACK_IMPORTED_MODULE_5__[\"ColorLayer\"](config.id, config);\n } else {\n // If layer is not in Gp.Config\n logger.error(\"ERROR layer id (layer name: \" + options.layer + \" / service: WMS ) was not found !?\");\n }\n}\n\n/*\n * Constructor (alias)\n */\nLayerWMS.prototype.constructor = LayerWMS;\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerWMS);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvTGF5ZXIvTGF5ZXJXTVMuanM/YTZhYyJdLCJuYW1lcyI6WyJsb2dnZXIiLCJMb2dnZXIiLCJnZXRMb2dnZXIiLCJMYXllcldNUyIsIm9wdGlvbnMiLCJUeXBlRXJyb3IiL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AgICAgIHVybCA6IHdtc1BhcmFtcy51cmwucmVwbGFjZSgvKGh0dHB8aHR0cHMpOlxcL1xcLy8sIHByb3RvY29sKSxcbiAgICAgICAgICAgIG5hbWUgOiBvcHRpb25zLmxheWVyLFxuICAgICAgICAgICAgcHJvamVjdGlvbiA6IHdtc1BhcmFtcy5wcm9qZWN0aW9uLFxuICAgICAgICAgICAgc3R5bGUgOiBcIlwiLFxuICAgICAgICAgICAgaGVpZ2h0TWFwV2lkdGggOiAyNTYsXG4gICAgICAgICAgICB3YXRlck1hc2sgOiBmYWxzZSxcbiAgICAgICAgICAgIG5ldHdvcmtPcHRpb25zIDoge1xuICAgICAgICAgICAgICAgIGNyb3NzT3JpZ2luIDogXCJvbWl0XCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB1cGRhdGVTdHJhdGVneSA6IHtcbiAgICAgICAgICAgICAgICB0eXBlIDogMCxcbiAgICAgICAgICAgICAgICBvcHRpb25zIDoge31cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmb3JtYXQgOiB3bXNQYXJhbXMuZm9ybWF0LFxuICAgICAgICAgICAgZXh0ZW50IDoge1xuICAgICAgICAgICAgICAgIHdlc3QgOiB3bXNQYXJhbXMuZXh0ZW50Lndlc3QsXG4gICAgICAgICAgICAgICAgZWFzdCA6IHdtc1BhcmFtcy5leHRlbnQuZWFzdCxcbiAgICAgICAgICAgICAgICBzb3V0aCA6IHdtc1BhcmFtcy5leHRlbnQuc291dGgsXG4gICAgICAgICAgICAgICAgbm9ydGggOiB3bXNQYXJhbXMuZXh0ZW50Lm5vcnRoXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGFqb3V0IGR1IHRhZyBncC1pdG93bnMtZXh0IGRhbnMgbGVzIHJlcXXDqnRlcyBXTVNcbiAgICAgICAgY29uZmlnLnNvdXJjZS51cmwgPSBHcC5IZWxwZXIubm9ybWFseXplVXJsKGNvbmZpZy5zb3VyY2UudXJsLC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3AuQ29uZmlnXG4gICAgICAgIGxvZ2dlci5lcnJvcihcIkVSUk9SIGxheWVyIGlkIChsYXllciBuYW1lOiBcIiArIG9wdGlvbnMubGF5ZXIgKyBcIiAvIHNlcnZpY2U6IFdNUyApIHdhcyBub3QgZm91bmQgIT9cIik7XG4gICAgfVxufVxuXG4vKlxuICogQ29uc3RydWN0b3IgKGFsaWFzKVxuICovXG5MYXllcldNUy5wcm90b3R5cGUuY29uc3RydWN0b3IgPSBMYXllcldNUztcblxuZXhwb3J0IGRlZmF1bHQgTGF5ZXJXTVM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/Itowns/Layer/LayerWMS.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Layer/LayerWMTS.js": +/*!***************************************!*\ + !*** ./src/Itowns/Layer/LayerWMTS.js ***! + \***************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils */ \"./src/Common/Utils.js\");\n/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Common/Utils/Config */ \"./src/Common/Utils/Config.js\");\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../../package.json */ \"./package.json\", 1);\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__);\n\n\n\n\n\n\n/* import Extent from \"itowns/Core/Geographic/Extent\";\nimport WMTSSource from \"itowns/Source/WMTSSource\";\nimport ColorLayer from \"itowns/Layer/ColorLayer\"; */\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getLogger(\"wmtsLayer\");\n\n/**\n * @classdesc\n * Geoportal WMTS source creation\n *\n * @constructor\n * @alias itowns.layer.GeoportalWMTS\n * @param {Object} options - options for function call.\n * @param {String} options.layer - Layer name (e.g. \"ORTHOIMAGERY.ORTHOPHOTOS\")\n * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol)\n * @param {String} [options.apiKey] - Access key to Geoportal platform\n * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer\n * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer\n * @param {String} [options.title] - Overloads the default title of the layer\n * @param {String} [options.description] - Overloads the default description of the layer\n * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer\n * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer})\n * @example\n * var geoportalWMTS = new itowns.layer.GeoportalWMTS({\n * layer : \"ORTHOIMAGERY.ORTHOPHOTOS\"\n * });\n */\nfunction LayerWMTS(options) {\n if (!(this instanceof LayerWMTS)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n\n // check layer params\n if (!options.layer) {\n throw new Error(\"ERROR PARAM_MISSING : layer\");\n }\n if (typeof options.layer !== \"string\") {\n throw new Error(\"ERROR WRONG TYPE : layer\");\n }\n\n // par defaut\n if (typeof options.ssl === \"undefined\") {\n options.ssl = true;\n }\n\n // Check if configuration is loaded\n if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isConfigLoaded()) {\n throw new Error(\"ERROR : Configuration has to be loaded\");\n }\n var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerId(options.layer, \"WMTS\");\n if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerParams(options.layer, \"WMTS\")) {\n var config = {};\n var wmtsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__[\"default\"].configuration.getLayerParams(options.layer, \"WMTS\");\n if (wmtsParams.projection === \"EPSG:3857\") {\n wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"Extent\"](\"EPSG:4326\", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top).as(\"EPSG:3857\");\n } else {\n wmtsParams.projection = \"EPSG:4326\";\n wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"Extent\"](\"EPSG:4326\", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top);\n }\n if (Object.entries(wmtsParams.tileMatrixSetLimits).length === 0 && wmtsParams.tileMatrixSetLimits.constructor === Object) {\n wmtsParams.tileMatrixSetLimits = undefined;\n }\n\n // les originators ne sont pas renvoyés dans la configuration, on prend donc ceux donnés par l'utilisateur\n if (options.itownsParams && options.itownsParams.source && options.itownsParams.source.attribution) {\n wmtsParams.originators = options.itownsParams.source.attribution;\n }\n\n // si ssl = false on fait du http\n // par défaut, ssl = true, on fait du https\n var protocol = options.ssl === false ? \"http://\" : \"https://\";\n config.id = layerId;\n config.source = new itowns__WEBPACK_IMPORTED_MODULE_5__[\"WMTSSource\"]({\n protocol: \"wmts\",\n url: wmtsParams.url.replace(/(http|https):\\/\\//, protocol),\n networkOptions: {\n crossOrigin: \"omit\"\n },\n updateStrategy: {\n type: 0,\n options: {}\n },\n projection: wmtsParams.projection,\n attribution: wmtsParams.originators,\n name: options.layer,\n format: wmtsParams.format,\n tileMatrixSet: wmtsParams.TMSLink,\n tileMatrixSetLimits: wmtsParams.tileMatrixSetLimits,\n extent: {\n west: wmtsParams.extent.west,\n east: wmtsParams.extent.east,\n south: wmtsParams.extent.south,\n north: wmtsParams.extent.north\n }\n });\n\n // ajout du tag gp-itowns-ext dans les requêtes WMTS\n config.source.url = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Helper.normalyzeUrl(config.source.url, {\n \"gp-itowns-ext\": _package_json__WEBPACK_IMPORTED_MODULE_4__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_4__.version\n }, false);\n\n // récupération des autres paramètres passés par l'utilisateur\n _Common_Utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].mergeParams(config, options.itownsParams);\n\n // add legends and metadata (to be added to LayerSwitcher control)\n // we take in priority the explicit options given by the user\n config.legends = options.legends || wmtsParams.legends;\n config.metadata = options.metadata || wmtsParams.metadata;\n config.description = options.description || wmtsParams.description;\n config.title = options.title || wmtsParams.title;\n config.quicklookUrl = options.quicklookUrl || wmtsParams.quicklookUrl;\n return new itowns__WEBPACK_IMPORTED_MODULE_5__[\"ColorLayer\"](config.id, config);\n } else {\n // If layer is not in Gp.Config\n logger.error(\"ERROR layer id (layer name: \" + options.layer + \" / service: WMTS ) was not found !?\");\n }\n}\n\n/*\n * Constructor (alias)\n */\nLayerWMTS.prototype.constructor = LayerWMTS;\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerWMTS);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvTGF5ZXIvTGF5ZXJXTVRTLmpzPzZiNTAiXSwibmFtZXMiOlsibG9nZ2VyIiwiTG9nZ2VyIiwiZ2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l0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Layer/LayerWMTS.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Layer/VectorTileLayer.js": +/*!*********************************************!*\ + !*** ./src/Itowns/Layer/VectorTileLayer.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Common/Utils/Config */ \"./src/Common/Utils/Config.js\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! itowns */ \"itowns\");\n/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n/* import Extent from \"itowns/Core/Geographic/Extent\";\nimport WMSSource from \"itowns/Source/WMSSource\";\nimport ColorLayer from \"itowns/Layer/ColorLayer\"; */\n\nvar logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getLogger(\"vectorTileLayer\");\n\n/**\n * @classdesc\n * Geoportal VT source creation\n *\n * @constructor\n * @alias itowns.layer.VectorTileLayer\n * @param {Object} options - options for function call.\n * @param {String} options.id - id to give to the layer\n * @param {String} options.layer - Layer name (e.g. \"PLAN.IGN\")\n * @param {String} [options.url] - Url to the vector Tile json style\n * @param {String} [options.urlService] - Url to the pbf file. Retrieved in the style file by default.\n * @param {Function} [options.filter] - Filter applied to the vector layer style. Fill/Line layer type by default.\n * @param {Object} [options.attributions] - Attributions of the layer.\n * @param {Object} [options.zoom] - Between which zoom levels the layer is displayed (zoom.min and zoom.max)\n * @example\n * var vectorTileLayer = new itowns.layer.VectorTileLayer({\n * layer : \"PLAN.IGN\"\n * });\n */\nfunction VectorTileLayer(options) {\n if (!(this instanceof VectorTileLayer)) {\n throw new TypeError(\"ERROR CLASS_CONSTRUCTOR\");\n }\n\n // check layer params\n if (!options.layer) {\n throw new Error(\"ERROR PARAM_MISSING : layer\");\n }\n if (typeof options.layer !== \"string\") {\n throw new Error(\"ERROR WRONG TYPE : layer\");\n }\n\n // Check if configuration is loaded\n if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isConfigLoaded()) {\n throw new Error(\"ERROR : Configuration has to be loaded\");\n }\n var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__[\"default\"].configuration.getLayerId(options.layer, \"TMS\");\n if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__[\"default\"].configuration.getLayerParams(options.layer, \"TMS\")) {\n var config = {};\n var tmsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__[\"default\"].configuration.getLayerParams(options.layer, \"TMS\");\n\n // si ssl = false on fait du http\n // par défaut, ssl = true, on fait du https\n var protocol = options.ssl === false ? \"http://\" : \"https://\";\n config.id = layerId;\n config.source = new itowns__WEBPACK_IMPORTED_MODULE_2__[\"VectorTilesSource\"]({\n style: tmsParams.url.replace(/(http|https):\\/\\//, protocol),\n url: options.urlService,\n attribution: options.attributions,\n filter: options.filter,\n zoom: options.zoom\n });\n\n // FIXME wait for next itowns release to remove this\n config.isValidData = function () {\n return false;\n };\n return new itowns__WEBPACK_IMPORTED_MODULE_2__[\"ColorLayer\"](config.id, config);\n } else {\n // If layer is not in Gp.Config\n logger.error(\"ERROR layer id (layer name: \" + options.layer + \" / service: TMS ) was not found !?\");\n }\n}\n;\n\n/*\n * Constructor (alias)\n */\nVectorTileLayer.prototype.constructor = VectorTileLayer;\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorTileLayer);//# sourceURL=[module]\n//# sour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B0aW9ucy56b29tXG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEZJWE1FIHdhaXQgZm9yIG5leHQgaXRvd25zIHJlbGVhc2UgdG8gcmVtb3ZlIHRoaXNcbiAgICAgICAgY29uZmlnLmlzVmFsaWREYXRhID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBuZXcgSXRDb2xvckxheWVyKGNvbmZpZy5pZCwgY29uZmlnKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICAvLyBJZiBsYXllciBpcyBub3QgaW4gR3AuQ29uZmlnXG4gICAgICAgIGxvZ2dlci5lcnJvcihcIkVSUk9SIGxheWVyIGlkIChsYXllciBuYW1lOiBcIiArIG9wdGlvbnMubGF5ZXIgKyBcIiAvIHNlcnZpY2U6IFRNUyApIHdhcyBub3QgZm91bmQgIT9cIik7XG4gICAgfVxufTtcblxuLypcbiAqIENvbnN0cnVjdG9yIChhbGlhcylcbiAqL1xuVmVjdG9yVGlsZUxheWVyLnByb3RvdHlwZS5jb25zdHJ1Y3RvciA9IFZlY3RvclRpbGVMYXllcjtcblxuZXhwb3J0IGRlZmF1bHQgVmVjdG9yVGlsZUxheWVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Itowns/Layer/VectorTileLayer.js\n"); + +/***/ }), + +/***/ "./src/Itowns/Styles.js": +/*!******************************!*\ + !*** ./src/Itowns/Styles.js ***! + \******************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CSS_GPgeneralWidgetItowns_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CSS/GPgeneralWidgetItowns.css */ \"./src/Itowns/CSS/GPgeneralWidgetItowns.css\");\n/* harmony import */ var _CSS_GPgeneralWidgetItowns_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPgeneralWidgetItowns_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _CSS_Controls_Attribution_GPattributionItowns_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CSS/Controls/Attribution/GPattributionItowns.css */ \"./src/Itowns/CSS/Controls/Attribution/GPattributionItowns.css\");\n/* harmony import */ var _CSS_Controls_Attribution_GPattributionItowns_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_Attribution_GPattributionItowns_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _CSS_Controls_BoostRelief_GPboostReliefItowns_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CSS/Controls/BoostRelief/GPboostReliefItowns.css */ \"./src/Itowns/CSS/Controls/BoostRelief/GPboostReliefItowns.css\");\n/* harmony import */ var _CSS_Controls_BoostRelief_GPboostReliefItowns_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_BoostRelief_GPboostReliefItowns_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _CSS_Controls_Buildings_GPbuildingsItowns_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CSS/Controls/Buildings/GPbuildingsItowns.css */ \"./src/Itowns/CSS/Controls/Buildings/GPbuildingsItowns.css\");\n/* harmony import */ var _CSS_Controls_Buildings_GPbuildingsItowns_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_Buildings_GPbuildingsItowns_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _CSS_Controls_LayerSwitcher_GPlayerSwitcherItowns_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CSS/Controls/LayerSwitcher/GPlayerSwitcherItowns.css */ \"./src/Itowns/CSS/Controls/LayerSwitcher/GPlayerSwitcherItowns.css\");\n/* harmony import */ var _CSS_Controls_LayerSwitcher_GPlayerSwitcherItowns_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_LayerSwitcher_GPlayerSwitcherItowns_css__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _CSS_Controls_MiniGlobe_GPminiGlobeItowns_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CSS/Controls/MiniGlobe/GPminiGlobeItowns.css */ \"./src/Itowns/CSS/Controls/MiniGlobe/GPminiGlobeItowns.css\");\n/* harmony import */ var _CSS_Controls_MiniGlobe_GPminiGlobeItowns_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_MiniGlobe_GPminiGlobeItowns_css__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _CSS_Controls_MousePosition_GPmousePositionItowns_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CSS/Controls/MousePosition/GPmousePositionItowns.css */ \"./src/Itowns/CSS/Controls/MousePosition/GPmousePositionItowns.css\");\n/* harmony import */ var _CSS_Controls_MousePosition_GPmousePositionItowns_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_MousePosition_GPmousePositionItowns_css__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _CSS_Controls_Scale_GPscaleItowns_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CSS/Controls/Scale/GPscaleItowns.css */ \"./src/Itowns/CSS/Controls/Scale/GPscaleItowns.css\");\n/* harmony import */ var _CSS_Controls_Scale_GPscaleItowns_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_Scale_GPscaleItowns_css__WEBPACK_IMPORTED_MODULE_7__);\n\n\n\n\n\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=ut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owns/Styles.js\n"); + +/***/ }), + +/***/ "./src/Itowns/index.js": +/*!*****************************!*\ + !*** ./src/Itowns/index.js ***! + \*****************************/ +/*! exports provided: Services, Error, Helper, Protocols, servicesDate, servicesVersion, LayerUtils, ProxyUtils, ColorUtils, MathUtils, Logger, itownsExtVersion, itownsExtDate, itownsExtended */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Services\", function() { return Services; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Error\", function() { return Error; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Helper\", function() { return Helper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Protocols\", function() { return Protocols; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesDate\", function() { return servicesDate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"servicesVersion\", function() { return servicesVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtVersion\", function() { return itownsExtVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtDate\", function() { return itownsExtDate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itownsExtended\", function() { return Itowns; });\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../package.json */ \"./package.json\");\nvar _package_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../package.json */ \"./package.json\", 1);\n/* harmony import */ var _Common_Styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/Styles */ \"./src/Common/Styles.js\");\n/* harmony import */ var _Styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Styles */ \"./src/Itowns/Styles.js\");\n/* harmony import */ var _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Controls/MousePosition */ \"./src/Itowns/Controls/MousePosition.js\");\n/* harmony import */ var _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Controls/LayerSwitcher */ \"./src/Itowns/Controls/LayerSwitcher.js\");\n/* harmony import */ var _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Controls/BoostRelief */ \"./src/Itowns/Controls/BoostRelief.js\");\n/* harmony import */ var _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Controls/Buildings */ \"./src/Itowns/Controls/Buildings.js\");\n/* harmony import */ var _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Controls/Attributions */ \"./src/Itowns/Controls/Attributions.js\");\n/* harmony import */ var _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Controls/Scale */ \"./src/Itowns/Controls/Scale.js\");\n/* harmony import */ var _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Controls/MiniGlobe */ \"./src/Itowns/Controls/MiniGlobe.js\");\n/* harmony import */ var _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Layer/LayerWMTS */ \"./src/Itowns/Layer/LayerWMTS.js\");\n/* harmony import */ var _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Layer/LayerWMS */ \"./src/Itowns/Layer/LayerWMS.js\");\n/* harmony import */ var _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Layer/LayerElevation */ \"./src/Itowns/Layer/LayerElevation.js\");\n/* harmony import */ var _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Layer/VectorTileLayer */ \"./src/Itowns/Layer/VectorTileLayer.js\");\n/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./GlobeViewExtended */ \"./src/Itowns/GlobeViewExtended.js\");\n/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CRS/CRS */ \"./src/Itowns/CRS/CRS.js\");\n/* harmony import */ var _Common_Utils_AutoLoadConfig__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../Common/Utils/AutoLoadConfig */ \"./src/Common/Utils/AutoLoadConfig.js\");\n/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! geoportal-access-lib */ \"./node_modules/geoportal-access-lib/src/Gp.js\");\n/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../Common/Utils/LayerUtils */ \"./src/Common/Utils/LayerUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LayerUtils\", function() { return _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../Common/Utils/ProxyUtils */ \"./src/Common/Utils/ProxyUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ProxyUtils\", function() { return _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../Common/Utils/ColorUtils */ \"./src/Common/Utils/ColorUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ColorUtils\", function() { return _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../Common/Utils/MathUtils */ \"./src/Common/Utils/MathUtils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MathUtils\", function() { return _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__[\"default\"]; });\n\n/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../Common/Utils/LoggerByDefault */ \"./src/Common/Utils/LoggerByDefault.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Logger\", function() { return _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__[\"default\"]; });\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n* Global variable Gp.\n*\n* @module Gp\n* @alias Gp\n* @desc\n*\n* This is the global variable that is exposed in the browser environment.\n* Content is composed of constructor, functions and properties...\n*\n* > ColorUtils: (...)\n* > LayerUtils: (...)\n* > MathUtils: (...)\n* > ProxyUtils: (...)\n* > Logger: (...)\n*\n* > itownsExtended: (...)\n*\n* > itownsExtVersion: \"YYYY-MM-DD\"\n* > itownsExtVersion: \"X.X.X\"\n*\n* > Error: (...)\n* > Helper: (...)\n* > Protocols: (...)\n* > Services: (...)\n* > servicesDate: \"YYYY-MM-DD\"\n* > servicesVersion: \"X.X.X\"\n*\n* The following variables are aslo global :\n* - proj4,\n* - itowns\n*/\n\n\n\n// CSS communes aux extensions !\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Autoload...\n\n\n// export des services\n\n\n// reconstruction des ns\nvar Services = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Services;\nvar Error = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Error;\nvar Helper = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Helper;\nvar Protocols = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].Protocols;\nvar servicesDate = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].servicesDate;\nvar servicesVersion = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__[\"default\"].servicesVersion;\n\n\n// Adds the extensions properties in the namespace\n\n\n\n\n\nfunction deepCopy(source, target) {\n // Implementing Tail Call Elimination\n function tce(source, target) {\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n if (!target.hasOwnProperty(prop)) {\n target[prop] = source[prop];\n } else if (_typeof(source[prop]) === \"object\") {\n tce(source[prop], target[prop]);\n }\n }\n }\n }\n return tce(source, target);\n}\n\n// Adds extensions properties in the namespace\n/** Version */\nvar itownsExtVersion = _package_json__WEBPACK_IMPORTED_MODULE_0__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_0__.version;\n/** Publication date */\nvar itownsExtDate = _package_json__WEBPACK_IMPORTED_MODULE_0__.date;\n\n// creation of the namespace for the itowns extensions\nvar Itowns = {};\nItowns.control = {};\nItowns.control.MousePosition = _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\nItowns.control.LayerSwitcher = _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\nItowns.control.BoostRelief = _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\nItowns.control.Buildings = _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\nItowns.control.Attributions = _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\nItowns.control.Scale = _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\nItowns.control.MiniGlobe = _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\nItowns.layer = {};\nItowns.layer.GeoportalWMTS = _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__[\"default\"];\nItowns.layer.GeoportalWMS = _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\nItowns.layer.GeoportalElevation = _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\nItowns.layer.VectorTileLayer = _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__[\"default\"];\nItowns.CRS = _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__[\"default\"];\nItowns.GlobeViewExtended = _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__[\"default\"];\n\n\n// Expose extensions extended into itowns\nif (window.itowns) {\n // on fusionne les fonctionnalités o\n deepCopy(Itowns, window.itowns);\n deepCopy(window.itowns, Itowns);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC8uL3NyYy9JdG93bnMvaW5kZXguanM/NGYwYSJdLCJuYW1lcyI6WyJTZXJ2aWNlcyIsIkdwIiwiRXJyb3IiLCJIZWxwZXIiLCJQcm90b2NvbHMiLCJzZXJ2aWNlc0RhdGUiLCJzZXJ2aWNlc1ZlcnNpb24iLCJkZWVwQ29weSIsInNvdXJjZSIsInRhcmdldCIsInRjZSIsInByb3AiLCJoYXNPd25Qcm9wZXJ0eSIsIl90eXBlb2YiLCJpdG93bnNFeHRWZXJzaW9uIiwiUGtnIiwidmVyc2lvbiIsIml0b3duc0V4dERhdGUiLCJkYXRlIiwiSXRvd25zIiwiY29udHJvbCIsIk1vdXNlUG9zaXRpb24iLCJMYXllclN3aXRjaGVyIiwiQm9vc3RSZWxpZWYiLCJCdWlsZGluZ3MiLCJBdHRyaWJ1dGlvbnMiLCJTY2FsZSIsIk1pbmlHbG9iZSIsImxheWVyIiwiR2VvcG9ydGFsV01UUyIsIkdlb3BvcnRhbFdNUyIsIkdlb3BvcnRhbEVsZXZhdGlvbiIsIlZlY3RvclRpbGVMYXllciIsI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pbGRpbmdzO1xuSXRvd25zLmNvbnRyb2wuQXR0cmlidXRpb25zID0gQXR0cmlidXRpb25zO1xuSXRvd25zLmNvbnRyb2wuU2NhbGUgPSBTY2FsZTtcbkl0b3ducy5jb250cm9sLk1pbmlHbG9iZSA9IE1pbmlHbG9iZTtcbkl0b3ducy5sYXllciA9IHt9O1xuSXRvd25zLmxheWVyLkdlb3BvcnRhbFdNVFMgPSBHZW9wb3J0YWxXTVRTO1xuSXRvd25zLmxheWVyLkdlb3BvcnRhbFdNUyA9IEdlb3BvcnRhbFdNUztcbkl0b3ducy5sYXllci5HZW9wb3J0YWxFbGV2YXRpb24gPSBHZW9wb3J0YWxFbGV2YXRpb247XG5JdG93bnMubGF5ZXIuVmVjdG9yVGlsZUxheWVyID0gVmVjdG9yVGlsZUxheWVyO1xuSXRvd25zLkNSUyA9IENSUztcbkl0b3ducy5HbG9iZVZpZXdFeHRlbmRlZCA9IEdsb2JlVmlld0V4dGVuZGVkO1xuXG5leHBvcnQge1xuICAgIC8qKiBFeHBvc2UgZXh0ZW5zaW9ucyBleHRlbmRlZCAqL1xuICAgIEl0b3ducyBhcyBpdG93bnNFeHRlbmRlZFxufTtcblxuLy8gRXhwb3NlIGV4dGVuc2lvbnMgZXh0ZW5kZWQgaW50byBpdG93bnNcbmlmICh3aW5kb3cuaXRvd25zKSB7XG4gICAgLy8gb24gZnVzaW9ubmUgbGVzIGZvbmN0aW9ubmFsaXTDqXMgb1xuICAgIGRlZXBDb3B5KEl0b3ducywgd2luZG93Lml0b3ducyk7XG4gICAgZGVlcENvcHkod2luZG93Lml0b3ducywgSXRvd25zKTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Itowns/index.js\n"); + +/***/ }), + +/***/ "itowns": +/*!******************************************************************************************!*\ + !*** external {"commonjs2":"itowns","commonjs":"itowns","amd":"itowns","root":"itowns"} ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports = __WEBPACK_EXTERNAL_MODULE_itowns__;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcIml0b3duc1wiLFwiY29tbW9uanNcIjpcIml0b3duc1wiLFwiYW1kXCI6XCJpdG93bnNcIixcInJvb3RcIjpcIml0b3duc1wifT9lMzU0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIiwiZmlsZSI6Iml0b3ducy5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gX19XRUJQQUNLX0VYVEVSTkFMX01PRFVMRV9pdG93bnNfXzsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///itowns\n"); + +/***/ }), + +/***/ "node-fetch": +/*!***********************************************************************************!*\ + !*** external {"commonjs2":"node-fetch","commonjs":"node-fetch","amd":"require"} ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports = __WEBPACK_EXTERNAL_MODULE_node_fetch__;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcIm5vZGUtZmV0Y2hcIixcImNvbW1vbmpzXCI6XCJub2RlLWZldGNoXCIsXCJhbWRcIjpcInJlcXVpcmVcIn0/YWJiZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiJub2RlLWZldGNoLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBfX1dFQlBBQ0tfRVhURVJOQUxfTU9EVUxFX25vZGVfZmV0Y2hfXzsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///node-fetch\n"); + +/***/ }), + +/***/ "xmldom": +/*!***************************************************************************!*\ + !*** external {"commonjs2":"xmldom","commonjs":"xmldom","amd":"require"} ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports = __WEBPACK_EXTERNAL_MODULE_xmldom__;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9HcC9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcInhtbGRvbVwiLFwiY29tbW9uanNcIjpcInhtbGRvbVwiLFwiYW1kXCI6XCJyZXF1aXJlXCJ9P2E2YmIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoieG1sZG9tLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBfX1dFQlBBQ0tfRVhURVJOQUxfTU9EVUxFX3htbGRvbV9fOyJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///xmldom\n"); + +/***/ }) + +/******/ }); +}); \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/GpPluginItowns-src.css b/itowns-2.5.0-beta/dist/GpPluginItowns-src.css new file mode 100644 index 000000000..b47ec69ac --- /dev/null +++ b/itowns-2.5.0-beta/dist/GpPluginItowns-src.css @@ -0,0 +1,3098 @@ +/*! + * @brief French Geoportal Extension for Itowns + * + * This software is released under the licence CeCILL-B (Free BSD compatible) + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * @see http://www.cecill.info/ + * + * @copyright copyright (c) IGN + * @license CeCILL-B + * @author IGN + * @version 2.5.0-beta + * @date 21/09/2023 + * + */ + +/*! + * Sortable -- JavaScript library for reorderable drag-and-drop lists on modern + * browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, + * React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap. + * + * Released under MIT LICENSE + * + * Copyright Lebedev Konstantin + * https://github.com/SortableJS/Sortable + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @version 1.14.0 + */ + +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.4 + */ + +/*! + * @overview Proj4js - Javascript reprojection library. + * + * @authors + * - Mike Adair madairATdmsolutions.ca + * - Richard Greenwood richATgreenwoodmap.com + * - Didier Richard didier.richardATign.fr + * - Stephen Irons stephen.ironsATclear.net.nz + * - Olivier Terral oterralATgmail.com + * - Calvin Metcalf cmetcalfATappgeo.com + * + * @copyright Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/proj4js/proj4js/master/LICENSE.md + * @version 2.7.5 + */ + +/* BOOST RELIEF */ + + div[id^=GPboostRelief-] { + font-size: 11px; + width: 150px; + } + + div[id^=GPboostRelief-] label { + display: block; + } + + div[id^=GPBoostReliefListContainer-] { + position: relative; + width: 100%; + height: 28px; + padding-left: 8px; + line-height: 28px; + } + + .GPlayerRelief, + .GPlayerReliefValue { + position: absolute; + top: 0; + } + + .GPlayerRelief { + width: calc(100% - 60px); + height: 28px; + padding-left: 8px; + } + + .GPlayerReliefValue { + width: 32px; + left: calc(100% - 40px); + line-height: 28px; + font-size: 10px; + font-style: italic; + cursor: default; + } + + /* Showing/hiding boost relief panel */ + + label[id^=GPshowBoostReliefPicto] { + display: inline-block; + } + + input[id^=GPshowBoostRelief-] + label { + display: block; + } + + input[id^=GPshowBoostRelief-]:checked + label { + display: none; + } + + input[id^=GPshowBoostRelief-] + label + div { + display: none; + } + + input[id^=GPshowBoostRelief-]:checked + label + div { + display: block; + } + + /* Showing layer advanced tools */ + + div[id^=GPboostRelief-] input[type="checkbox"]:checked + label + .GPlayerAdvancedToolsRelief { + max-height: 28px; + opacity: 1; + } + + .GPlayerAdvancedToolsRelief { + display: block; + position: relative; + width: 100%; + border-bottom : 1px dotted #CCC; + background-color : #FFF; + } + + .GPlayerReliefLayerId { + position: relative; + width: 100px; + height: 28px; + padding-left: 8px; + line-height: 28px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + /* Relief slider : general */ + + .GPlayerRelief input { + -webkit-appearance: none; + -moz-appearance: none; + background: none; + display: block; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + cursor: pointer; + } + + .GPlayerRelief input[type="range"]:focus { + box-shadow: none; + outline: none; + } + + /* Relief slider : Chrome, Safari, Opera */ + + .GPlayerRelief input[type="range"]::-webkit-slider-runnable-track { + -webkit-appearance: none; + height: 3px; + } + + .GPlayerRelief input[type="range"]::-webkit-slider-thumb:before { + position: absolute; + top: 0; + right: 50%; + left: -200px; + height: 3px; + pointer-events: none; + } + + .GPlayerRelief input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + width: 9px; + height: 17px; + -webkit-appearance: none; + border: 2px solid #FFF; + background-color: #505050; + position: relative; + top: -7px; + } + + /* Relief slider : Firefox */ + + .GPlayerRelief input[type="range"]::-moz-range-track { + width: 80px; + height: 3px; + } + + .GPlayerRelief input[type="range"]::-moz-range-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + border-radius: 0; + box-shadow: 0; + background-color: #505050; + position: relative; + } + + /* Relief slider : IE */ + + .GPlayerRelief input[type="range"]::-ms-track { + border: 0; + border-color: transparent; + border-radius: 0; + border-width: 0; + color: transparent; + height: 3px; + width: 80px; + } + + .GPlayerRelief input[type="range"]::-ms-fill-lower, + .GPlayerRelief input[type="range"]::-ms-fill-upper { + background: transparent; + border-radius: 0; + } + + .GPlayerRelief input[type="range"]::-ms-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + background-color: #505050; + } + + .GPlayerRelief input[type="range"]::-ms-tooltip { + display: none; + } +/* BUILDINGS */ + + div[id^=GPbuildings-] { + font-size: 11px; + } + + div[id^=GPbuildings-] label { + display: block; + } + + label[id^=GPshowBuildingsPicto] { + display: inline-block; + cursor: pointer; + } + + +/* MOUSE POSITION */ + +/* Showing/hiding drawing panel */ + +label[id^=GPshowDrawingPicto-] { + display: inline-block; +} + +input[id^=GPshowDrawing-] + label { + display: block; +} + +input[id^=GPshowDrawing-]:checked + label { + display: none; +} + +input[id^=GPshowDrawing-] + label + div { + display: none; +} + +input[id^=GPshowDrawing-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPdrawingPanel-] { + width: 240px; + overflow: hidden; +} + +/* Basic infos */ + +div[id^=GPdrawingBasicPanel-] { + padding: 10px 15px; +} + +.GPdrawingLabel, +.GPdrawingCoords { + display: inline-block; + line-height: 20px; +} + +.GPdrawingLabel { + width: 80px; + font-weight: bold; +} + +.GPdrawingCoords { + width: 110px; +} + +/* markers selector */ +.marker-input-radio { + display : none ; +} + +input.marker-input-radio:checked + label { + border: 1px solid red; +} + + +div[id^=GPelevationPathPanelInfo] { + display: none; /* on n'affiche pas le bouton d'information par defaut */ +} + +/* Calc waiting */ + +.GPelevationPathCalcWaitingContainerVisible, +.GPelevationPathCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPelevationPathInformationsContainerVisible, +.GPelevationPathInformationsContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 13px; + font-weight: bold; + overflow: hidden; +} + +.GPelevationPathCalcWaitingContainerVisible { + display: -webkit-flex; + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.GPelevationPathInformationsContainerVisible { + display: -webkit-flex; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + flex-direction: column; +} + +.GPelevationPathCalcWaitingContainerHidden, +.GPelevationPathInformationsContainerHidden { + display: none; +} + +.GPelevationPathCalcWaiting, +.GPelevationPathInformations { + margin: auto; +} + +.GPelevationPathInformations { + font-size: 0.8em; +} + +.GPelevationPathCalcWaitingContainerVisible, +.GPelevationPathCalcWaitingContainerHidden, +.GPelevationPathInformationsContainerVisible, +.GPelevationPathInformationsContainerHidden { + border-radius: 5px; +} + +/* CSS : Raw */ + +#profileElevationRaw { + resize: none; + padding: unset; +} + +/* CSS : default */ + +#profileElevationByDefault { + display:-webkit-flex; + display:-webkit-box; + display:-ms-flexbox; + display:flex; + -webkit-box-orient:vertical; + -webkit-box-direction:normal; + -webkit-flex-direction:column; + -ms-flex-direction:column; + flex-direction:column; + height:100%; +} + +.altiPathValue { + font-weight: 700; + fill: #5E5E5E; +} + +.altiPathCoords { + font-style: italic; + fill: #5E5E5E; +} + +.tooltipInit { + opacity: 0; +} + +.tooltipFadeIn { + transition: opacity 300ms ease 0ms, transform 50ms ease 0s, top 50ms ease 0s, left 50ms ease 0s; + opacity: 1; +} + +.tooltipFadeOut { + transition: opacity 500ms ease 0ms; + opacity: 0; +} + + + +/* CSS : D3 */ + +.axis-d3 > text { + fill: rgb(94, 94, 94); + font-family: Verdana; + font-size: 10px; + opacity: 1; + text-anchor: end; +} + +.axis-d3 { + fill: none; + stroke: #5E5E5E; + stroke-width: 1; + shape-rendering: crispEdges; +} + +.area-d3 { + fill: #C77A04; + stroke: #5E5E5E; + stroke-width: 0; + fill-opacity: 0.4; +} + +.line-d3 { + fill: none; + stroke: #C77A04; + stroke-width: 1px; +} + +.grid-d3 .tick { + stroke: lightgrey; + opacity: 0.7; +} + +.grid-d3 path { + stroke-width: 0; +} + +.grid-d3 .tick { + stroke: lightgrey; + opacity: 0.7; +} + +.grid-d3 path { + stroke-width: 0; +} + +.overlay-d3 { + fill: none; + pointer-events: all; +} + +.focusLine-d3 { + fill: none; + stroke: #C77A04; + stroke-width: 0.5px; +} + +.focusCircle-d3 { + fill: #C77A04; +} + +div.tooltip-d3 { + position: inherit;; + text-align: left; + width: 80px; + height: 45px; + padding: 5px; + font: 8px sans-serif; + background: white; + border: 0px; + border-radius: 8px; + pointer-events: none; +} + +/* Widgets : general */ + +.GPwidget { + position: absolute; + font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; + font-size: 13px; + color: #333; +} + +.GPwidget input[type='text'], +.GPwidget input[type='button'] { + -webkit-appearance: none; + color: #333333; +} + +.GPwidget input[type="checkbox"] { + display: none; +} + +.GPwidget select { + padding-left: 3px; + border-radius: 3px; +} + +.GPwidget form { + margin-bottom: 0; +} + +.GPwidget * { + box-sizing: border-box; + background-repeat: no-repeat; +} + +/* waiting */ + +.GPwaiting { + background-image : url(data:image/gif;base64,R0lGODlhNAA0AIQSAAFkpSZ5sAGV3k2Ruiao3kOj1/GUBk225pe/B4S83XrK75HH3qrS5szMzNbW1sHe797e3ubm5v///////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAQAfACwAAAAANAA0AAAF5u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rA806p946Tu8isbMNca1ozIpHLJTCKeiCYUupxOlVaqMxvdZqtWqbZJLpvPyEK5wGYz23AlPJ6c0412t9yucjQaDi98KX+FDTBtfYZ/gUmLhUqPf0p+i42Oi00QfxAiIQAh+QQFAQAfACwEAAQAGgAnAAAFc+AnjmRZGqhhrmyasrDounE7o/V64yvi6zuTb4gA0oTEn+lYSg5zSGcROpJOqVUntknc9rzgsHhMLhXOhTEaHV6vwW62N36G09tutbzM7/v/JhFlDYQNDmKFhYdeEYmFYA6OhIJbEJINYZdhlolkEA6UUCEAIfkEAQEAHwAsBAAEACcAGgAABXXgJ45kWSIoYq5sS6apK8swPN9mHeP8p6O9UmG4+qlMhmRryCwUa6uk1LBqMp9A5FQptBKDW2nX6+SFxSRyuXemjpvBz5lljYu2srX9vu/7/4CBgh8NhQ6DK4WKDYgkEIuGjSKQipKElIySj5CHlpSWIw6RoCEAOw==); + background-position : center center; + background-repeat : no-repeat; +} + +/* General panels */ + +.GPpanel { + background-color: #FFF; +} + +.GPpanelHeader { + position: relative; + width: 100%; +} + +.GPpanelTitle { + width: 100%; + height: 100%; + text-align: center; + font-weight: bold; +} + +.GPpanelClose, .GPpanelReduce, .GPpanelInfo { + position: absolute; + cursor: pointer; +} + +/* Showing/hiding advanced panels */ + +.GPshowAdvancedToolPicto { + position: relative; + box-sizing: border-box; + cursor: pointer; +} + +.GPshowAdvancedToolOpen { + position: absolute; + display: block; + box-sizing: border-box; +} + +/* Flex inputs */ + +.GPflexInput { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + transition: max-height 0.3s ease-out, opacity 0.3s ease-out; +} + +/* FIXME tempory hack with :not(.GPlocationOriginHidden) ! +.GPflexInput > *:not(.GPlocationOriginHidden) */ +.GPflexInput > * { + display: block; + height: 28px; + line-height: 26px; + border: 1px solid #999; + border-radius: 0; +} + +.GPflexInput *:not(:last-child) { + border-right:none; +} + +.GPflexInput *:first-child { + border-radius: 3px 0 0 3px; +} + +.GPflexInput *:last-child { + border-radius: 0 3px 3px 0; +} + +.GPflexInput > *:not(input) { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.GPflexInput > input { + -webkit-flex: 1; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; + padding: 0 5px; + min-width: 0; +} + +.GPflexInput > select { + -webkit-flex: 1; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; + padding-right: 7px; +} + +.GPflexInput > label { + background-color: #F2F2F2; + color: #666; + padding-left: 7px; + padding-right: 9px; + cursor: pointer; +} + +/* Particular inputs */ + +.GPinputSelect { + display: block; + height: 28px; + line-height: 26px; + margin: auto; + border: 1px solid #999; + color: #333; + cursor: pointer; +} + +input.GPinputSubmit { + display: block; + width: 80px; + margin: auto; + height: 28px; + line-height: 26px; + padding: 0; + background: none; + border: none; + border-radius: 3px; + font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; + color: #FFF; + font-weight: bold; + opacity: 0.8; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +input.GPinputSubmit:hover { + opacity: 1; +} + +/* Autocomplete/geocode results */ + +.GPautoCompleteList, +.GPadvancedAutoCompleteList { + z-index: 2; + display: none; + position: absolute; + max-height: 140px; + background-color: #FFF; + border: 1px solid #999; + overflow-y: hidden; +} + +.GPadvancedAutoCompleteList { + width: calc(100% - 28px); + border-top: none; + font-size: 0.9em; +} + +.GPautoCompleteProposal { + width: 100%; + height: 28px; + line-height: 16px; + padding: 6px 10px; + color: #5E5E5E; + font-size: 1.0em; + overflow: hidden; + white-space: nowrap; + text-overflow:ellipsis; + cursor: pointer; +} + +.GPautoCompleteProposal:hover { + color: #000000; + background-color: #CEDBEF +} + +/* Showing additional hidden options */ + +.GPshowMoreOptions { + display: block; + position: absolute; + width: 28px; + height: 28px; + cursor: pointer; + transition: all 0.5s ease-out 0s; +} + +input[type="checkbox"]:checked + .GPshowMoreOptions { + -webkit-transform: rotateX(180deg); + transform: rotateX(180deg); + /* bottom: 90px; */ +} + +/* GET FEATURE INFO */ + +label[id^=GPgetFeatureInfoPicto] { + display: inline-block; +} + +div[id^=GPgetFeatureInfo-] + label { + display: block; +} + +span[id^=GPgetFeatureInfoActivate], +span[id^=GPgetFeatureInfoDeactivate] { + position: absolute; + display: block; + transition: border-radius 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +span[id^=GPgetFeatureInfoActivate] { + background-position: 0 0; + opacity: 1; +} + +span[id^=GPgetFeatureInfoDeactivate] { + opacity: 0; +} + +div[id^=GPgetFeatureInfo-] input[type="checkbox"]:not(:checked) + label[id^=GPgetFeatureInfoPicto] span[id^=GPgetFeatureInfoDeactivate] { + opacity: 1; +} + +/* ISOCHRON */ + +div[id^=GPisochron-] { + top: 140px; +} + +/* Showing/hiding mouse position panel */ + +label[id^=GPshowIsochronPicto] { + display: inline-block; +} + +input[id^=GPshowIsochron-] + label { + display: block; +} + +input[id^=GPshowIsochron-]:checked + label { + display: none; +} + +input[id^=GPshowIsochron-] + label + div { + display: none; +} + +input[id^=GPshowIsochron-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPisochronPanel-] { + width: 280px; +} + +/* Calc waiting */ + +.GPisochronCalcWaitingContainerVisible, +.GPisochronCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPisochronCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GPisochronCalcWaitingContainerHidden { + display: none; +} + +.GPisochronCalcWaiting { + margin: auto; +} + +/* Isochron form */ + +form[id^=GPisochronForm] { + padding: 15px; +} + +.GPisochronFormMini { + max-height: 58px; + overflow: hidden; +} + +.GPisochronFormMini div[id^="GPisochronReset-"], +.GPisochronFormMini label[id^="GPshowIsoExclusionsPicto-"] { + display: none; +} + +.GPisochronOriginVisible { + display: block; +} + +.GPisochronOriginHidden { + display: none; +} + +.GPisochronOriginPointerImg { + width: 28px; + background-color: #F2F2F2; + cursor: pointer; +} + +input[id^="GPisochronOriginPointer"] + .GPisochronOriginPointerImg { + background-position: -1px -1px; +} + +input[id^="GPisochronOriginPointer"]:checked + .GPisochronOriginPointerImg { + background-position: -29px -1px; +} + +input[id^=GPisochronSubmit] { + margin-top: 5px; +} + +/* Alternative choice */ + +div[id^=GPisochronChoice] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + width: 160px; + -webkit-justify-content: space-between; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + margin: auto; + margin-top: 15px; + margin-bottom: 5px; +} + +.GPisochronChoiceAlt input { + display: none; +} + +.GPisochronChoiceAltImg { + display: block; + width: 28px; + height: 28px; + margin: auto; + cursor: pointer; +} + +input[id^=GPisochronChoiceAltChron] + .GPisochronChoiceAltImg { + background-position: -56px 0; +} + +input[id^=GPisochronChoiceAltChron]:checked + .GPisochronChoiceAltImg { + background-position: -84px 0; +} + +input[id^=GPisochronChoiceAltDist] + .GPisochronChoiceAltImg { + background-position: -112px 0; +} + +input[id^=GPisochronChoiceAltDist]:checked + .GPisochronChoiceAltImg { + background-position: -140px 0; +} + +.GPisochronChoiceAlt span { + cursor: pointer; + display:block; + color: #999; +} + +.GPisochronValueHidden { + display: none; +} + +div[id^=GPisochronValueChron], +div[id^=GPisochronValueDist] { + width: 220px; + margin: auto; +} + +/* Mode choice */ + +div[id^=GPisochronModeChoice] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-between; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + margin: 15px 0; +} + +.GPisochronModeLabel { + display: block; + text-align: center; + margin-bottom: 5px; +} + +div[id^=GPisochronTransportChoice] input { + display: none; +} + +.GPisochronTransportImg { + display: inline-block; + width: 28px; + height: 28px; + cursor: pointer; +} + +.GPisochronTransportImg:first-of-type { + margin-left: 18px; + margin-right: 10px; +} + +input[id^=GPisochronTransportCar] + .GPisochronTransportImg { + background-position: -168px 0; +} + +input[id^=GPisochronTransportCar]:checked + .GPisochronTransportImg { + background-position: -196px 0; +} + +input[id^=GPisochronTransportPedestrian] + .GPisochronTransportImg { + background-position: -224px 0; +} + +input[id^=GPisochronTransportPedestrian]:checked + .GPisochronTransportImg { + background-position: -252px 0; +} + +select[id^=GPisochronDirectionSelect] { + width: 80px; +} + +/* Showing/hiding exclusions */ + +input[id^=GPshowIsoExclusions] { + display: none; +} + +.GPshowIsoExclusionsPicto { + top: 250px; + right: 0; + transition: all 0.5s ease-out 0s; +} + +input[id^=GPshowIsoExclusions] + label + div[id^=GPisoExclusions] { + max-height: 0; + opacity: 0; + margin-bottom: 0; +} + +input[id^=GPshowIsoExclusions]:checked + label + div[id^=GPisoExclusions] { + display: block; + max-height: 60px; + opacity: 1; + margin-bottom: 15px; +} + +/* Exclusions */ + +div[id^=GPisoExclusions] { + transition: max-height 0.5s ease-in-out 0.25s, opacity 0.5s ease-in-out 0.25s, margin 0.3s ease-in-out 0.25s; + overflow: hidden; +} + +.GPisoExclusionsLabel { + display: block; + text-align: center; + margin-bottom: 10px; + font-weight: bold; + line-height: 16px; +} + +.GPisoExclusionsOptions { + display: -webkit-flex; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; +} + +.GPisoExclusionsOption { + display: block; + height: 28px; + line-height: 26px; + color: #A77; + background-color: #FEE; + padding-left: 28px; + padding-right: 5px; + border: 1px solid #A77; + border-radius: 3px; + cursor: pointer; +} + +input:checked + .GPisoExclusionsOption { + background-color: #EFE; + background-position: 0 -28px; + color: #797; + border: 1px solid #797; +} + +/* Reset picto */ +div[id^=GPisochronReset] { + position: absolute; + margin-top: 5px; + width: 28px; + height: 28px; + border-radius: 3px; + opacity: 0.8; + background-position: -281px 0; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +div[id^=GPisochronReset]:hover { + opacity: 1; +} + +/* LAYER SWITCHER */ + +div[id^=GPlayerSwitcher-] { + font-size: 11px; +} + +div[id^=GPlayerSwitcher-] [draggable] { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + user-select: none; + /* Required to make elements draggable in old WebKit */ + -khtml-user-drag: element; + -webkit-user-drag: element; +} + +/* Manage opening of the components through hiden checkboxes */ + +div[id^=GPlayerSwitcher-] input[type="checkbox"] + div, +div[id^=GPlayerSwitcher-] input[type="checkbox"] + label + div { + max-height: 0px; +} + +div[id^=GPlayerSwitcher-] label { + display: block; +} + +/* Showing/hiding layers list */ + +label[id^=GPshowLayersListPicto] { + position: relative; + float: right; + display: block; + opacity: 1; + transition: opacity 0.5s ease-out 0s, box-shadow 0.5s ease-out 0s, border 0.5s ease-out 0s, border-radius 0.5s ease-out 0s; + cursor: pointer; +} + +span[id^=GPshowLayersListOpen], +span[id^=GPshowLayersListClose] { + position: absolute; + display: block; + transition: border-radius 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +span[id^=GPshowLayersListOpen] { + background-position: 0 0; + opacity: 1; +} + +span[id^=GPshowLayersListClose] { + opacity: 0; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListClose] { + opacity: 1; +} + +/* Layers list */ + +div[id^=GPlayersList] { + position: relative; + width: 180px; + border-bottom-right-radius: 0; + opacity: 0; + overflow: auto; + transition: max-height 0.5s ease-out 0s, opacity 0.5s ease-out 0.25s; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div[id^=GPlayersList] { + max-height: 232px; + opacity: 1; + transition: max-height 0.5s ease-in 0s, opacity 0.25s ease-in 0s; +} + +/* Layer : general */ + +.GPlayerSwitcher_layer { + position: relative; + top: 0; + background-color: #FFF; + border-bottom: 1px dotted #CCC; + overflow: hidden; +} + +div[id^=GPlayersList] .GPlayerSwitcher_layer:last-child { + border-bottom: none; +} + +.GPlayerBasicTools, +.GPlayerAdvancedTools { + position: relative; + width: 100%; + height: 28px; +} + +.GPlayerVisibility, +.GPlayerInfo, +.GPlayerInfoOpened, +.GPlayerRemove { + width: 28px; + height: 28px; + cursor: pointer; +} + +.GPlayerVisibility, +.GPlayerName, +.GPlayerInfo, +.GPlayerInfoOpened, +.GPlayerRemove, +.GPlayerOpacity, +.GPlayerOpacityValue { + position: absolute; + top: 0; +} + +.GPghostLayer { + opacity: 0; +} + +/* Layer basic tools */ + +.GPlayerBasicTools { + background-color: #FFF; +} + +.GPlayerVisibility { + left: 0; + background-position: -28px 0; +} + +input[type="checkbox"]:checked + .GPlayerVisibility { + background-position: 0 0; +} + +.GPlayerName { + left: 28px; + width: calc(100% - 56px); + line-height: 28px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding-left: 4px; + cursor: move; +} + +.outOfRange .GPlayerName { + color: #AAA; +} + +/* Showing layer advanced tools */ + +.GPshowLayerAdvancedTools { + top: 0; + right: 0; + background-position: -112px 0; +} + +.GPlayerAdvancedTools { + display: block; + max-height: 0; + opacity: 0; + transition: max-height 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + label + .GPlayerAdvancedTools { + max-height: 28px; + opacity: 1; +} + +/* Layer advanced tools */ + +.GPlayerInfo { + left: 0; + background-position: -55px 0; +} + +.GPlayerInfoOpened { + left: 0; + background-position: -83px 0; +} + +.GPlayerOpacity { + left: 28px; + width: calc(100% - 100px); + height: 28px; + padding-left: 8px; +} + +.GPlayerOpacityValue { + width: 32px; + left: calc(100% - 60px); + line-height: 28px; + font-size: 10px; + font-style: italic; + cursor: default; +} + +.GPlayerRemove { + right: 0; + background-position: -140px 0; +} + +/* Opacity slider : general */ + +.GPlayerOpacity input { + -webkit-appearance: none; + -moz-appearance: none; + background: none; + display: block; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + cursor: pointer; +} + +.GPlayerOpacity input[type="range"]:focus { + box-shadow: none; + outline: none; +} + +/* Opacity slider : Chrome, Safari, Opera */ + +.GPlayerOpacity input[type="range"]::-webkit-slider-runnable-track { + -webkit-appearance: none; + height: 3px; +} + +.GPlayerOpacity input[type="range"]::-webkit-slider-thumb:before { + position: absolute; + top: 0; + right: 50%; + left: -200px; + height: 3px; + pointer-events: none; +} + +.GPlayerOpacity input[type="range"]::-webkit-slider-thumb { + width: 9px; + height: 17px; + -webkit-appearance: none; + border: 2px solid #FFF; + background-color: #505050; + position: relative; + top: -7px; +} + +/* Opacity slider : Firefox */ + +.GPlayerOpacity input[type="range"]::-moz-range-track { + width: 80px; + height: 3px; +} + +.GPlayerOpacity input[type="range"]::-moz-range-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + border-radius: 0; + box-shadow: 0; + background-color: #505050; + position: relative; +} + +/* Opacity slider : IE */ + +.GPlayerOpacity input[type="range"]::-ms-track { + border: 0; + border-color: transparent; + border-radius: 0; + border-width: 0; + color: transparent; + height: 3px; + width: 80px; +} + +.GPlayerOpacity input[type="range"]::-ms-fill-lower, +.GPlayerOpacity input[type="range"]::-ms-fill-upper { + background: transparent; + border-radius: 0; +} + +.GPlayerOpacity input[type="range"]::-ms-thumb { + width: 5px; + height: 13px; + border: 2px solid #FFF; + background-color: #505050; +} + +.GPlayerOpacity input[type="range"]::-ms-tooltip { + display: none; +} + +/* Layer info panel */ + +div[id^=GPlayerInfoPanel] { + position: absolute; + top: 0; + overflow-y: hidden; + padding-top: 10px; + padding-bottom: 10px; +} + +.GPlayerInfoPanelOpened { + display: block; +} + +.GPlayerInfoPanelClosed { + display: none; +} + +div[id^=GPlayerInfoContent] { + position: relative; + width: 280px; + max-height: 200px; + overflow-y: auto; + padding-left: 10px; + padding-right: 10px; +} + +div[id^=GPlayerInfoTitle] { + width: calc(100% - 52px); + margin: auto; + margin-bottom: 10px; + padding-bottom: 5px; + text-align: center; + font-size: 1.1em; + font-weight: bold; +} + +div[id^=GPlayerInfoQuicklook] { + position: absolute; + top: -2px; + left: 10px; + width: 20px; + height: 20px; + cursor: pointer; +} + +div[id^=GPlayerInfoClose] { + position: absolute; + top: -8px; + right: 10px; + width: 28px; + height: 28px; + cursor: pointer; +} + +div[id^=GPlayerInfoDescription] { + font-size: 0.9em; +} + +div[id^=GPlayerInfoLegend] { + +} + +div[id^=GPlayerInfoMetadata] { + +} + +.GPlayerInfoSubtitle { + padding-left: 35px; + font-weight: bold; + margin-top: 10px; + margin-bottom: 4px; +} + +.GPlayerInfoLink, +.GPlayerInfoPopup { + line-height: 20px; + padding-left: 23px; + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; + color: #999999; + background-repeat: no-repeat; + cursor: pointer; +} + +.GPlayerInfoLink { + background-position: 0 -20px; +} + +.GPlayerInfoLink:hover, +.GPlayerInfoPopup:hover { + color: #333; +} + +.GPlayerInfoLink a, +.GPlayerInfoLink a:visited +.GPlayerInfoLink a:focus +.GPlayerInfoLink a:hover { + text-decoration: none; + color: inherit; +} + +/* Location */ + +/* Location form */ + +.GPlocationStageFlexInput { + max-height: 28px; + opacity: 1; +} + +.GPlocationStageFlexInputHidden { + max-height: 0; + opacity: 0; + overflow: hidden; +} + +.GPlocationOriginVisible { + display: block; +} + +.GPlocationOriginHidden { + display: none; +} + +label.GPlocationOriginPointerImg[id*="GPlocationOriginPointerImg"] { + width: 28px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + border-right: 1px solid #999; +} + +input[id*="GPlocationOriginPointer"] + .GPlocationOriginPointerImg { + background-position: -1px -1px; +} + +input[id*="GPlocationOriginPointer"]:checked + .GPlocationOriginPointerImg { + background-position: -29px -1px; +} + +.GPlocationStageRemove, +div[id^=GPlocationStageAdd] { + width: 28px; + border: none; + cursor: pointer; +} + +.GPlocationStageRemove { + background-position: -84px 0; +} + +div[id^=GPlocationStageAdd] { + background-position: -56px 0; +} + +/* Showing/hiding drawing panel */ + +label[id^=GPshowMeasureAreaPicto-] { + display: inline-block; +} + +input[id^=GPshowMeasureArea-] + label { + display: block; +} + +input[id^=GPshowMeasureArea-]:checked + label { + display: block; + background-color: rgba(0,60,136,0.5); +} + +input[id^=GPshowMeasureArea-] + label + div { + display: block; +} + +input[id^=GPshowMeasureArea-]:checked + label + div { + display: block; +} + +/* Showing/hiding drawing panel */ + +label[id^=GPshowMeasureAzimuthPicto-] { + display: inline-block; +} + +input[id^=GPshowMeasureAzimuth-] + label { + display: block; +} + +input[id^=GPshowMeasureAzimuth-]:checked + label { + display: block; + background-color: rgba(0,60,136,0.5); +} + +input[id^=GPshowMeasureAzimuth-] + label + div { + display: block; +} + +input[id^=GPshowMeasureAzimuth-]:checked + label + div { + display: block; +} + +/* Showing/hiding drawing panel */ + +label[id^=GPshowMeasureLengthPicto-] { + display: inline-block; +} + +input[id^=GPshowMeasureLength-] + label { + display: block; +} + +input[id^=GPshowMeasureLength-]:checked + label { + display: block; + background-color: rgba(0,60,136,0.5); +} + +input[id^=GPshowMeasureLength-] + label + div { + display: block; +} + +input[id^=GPshowMeasureLength-]:checked + label + div { + display: block; +} + +/* MEASURE TOOL */ + +.GPmeasureTooltip { + position: relative; + background: rgba(0, 0, 0, 0.5); + border-radius: 4px; + color: white; + padding: 4px 8px; + white-space: nowrap; +} + +.GPmeasureTooltip-measure { + font-weight: bold; +} + +.GPmeasureTooltip-info { + font-size: 0.75em; + text-align: center; +} + +.GPmeasureTooltip-static { + background-color: #ffcc33; + color: black; + border: 1px solid white; +} + +.GPmeasureTooltip-hidden { + display: none; +} + +.GPmeasureTooltip-measure::before, +.GPmeasureTooltip-info::before, +.GPmeasureTooltip-static::before { + border-top: 6px solid rgba(0, 0, 0, 0.5); + border-right: 6px solid transparent; + border-left: 6px solid transparent; + content: ""; + position: absolute; + bottom: -6px; + margin-left: -7px; + left: 50%; +} + +.GPmeasureTooltip-static::before { + border-top-color: #ffcc33; +} + +/* MOUSE POSITION */ + +/* Showing/hiding mouse position panel */ + +label[id^=GPshowMousePositionPicto] { + display: inline-block; +} + +input[id^=GPshowMousePosition-] + label { + display: block; +} + +input[id^=GPshowMousePosition-]:checked + label { + display: none; +} + +input[id^=GPshowMousePosition-] + label + div { + display: none; +} + +input[id^=GPshowMousePosition-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPmousePositionPanel-] { + width: 300px; + overflow: hidden; +} + +/* Basic infos */ + +div[id^=GPmousePositionBasicPanel] { + padding: 10px 15px; + position: relative; +} + +.GPmousePositionLabel, +.GPmousePositionCoords { + display: inline-block; + line-height: 20px; +} + +.GPmousePositionLabel { + width: 80px; + font-weight: bold; +} + +.GPmousePositionCoords { + width: 110px; +} + +/* Showing settings */ + +.GPshowMousePositionSettingsPicto { + bottom: 5px; + right: 0; + transition: all 0.5s ease-out 0s; +} + +div[id^=GPmousePosition-] input[type="checkbox"]:checked + .GPshowMousePositionSettingsPicto { + bottom: 100px; +} + +div[id^=GPmousePositionSettings-] { + display: block; + max-height: 0; + opacity: 0; + transition: max-height 0.5s ease-out 0s, opacity 0.5s ease-out 0s; +} + +div[id^=GPmousePosition-] input[type="checkbox"]:checked + label + div[id^=GPmousePositionSettings-] { + max-height: 95px; + opacity: 1; +} + +/* Settings */ + +div[id^=GPmousePositionSettings-] { + height: 95px; + padding-left: 0 15px; + overflow: hidden; +} + +.GPmousePositionSettingsLabel { + display: block; + margin: auto; + text-align: center; + font-weight: bold; + line-height: 16px; +} + +.GPmousePositionSettingsSelect { + width: 180px; + margin-top: 5px; +} + +/* General panels */ + +div[id^=GPmousePositionCoordinate-] input.error { + border: 1px solid rgb(255, 0, 0); +} +div[id^=GPmousePositionCoordinate-] input[readonly] { + border: 1px solid transparent; + padding: 2px; + text-align: right; +} + +input[id^=GPmousePositionLat-], input[id^=GPmousePositionLon-] { + width: 120px; +} + +span[id^=GPmousePositionAlt-] { + display: inline-block; + padding: 2px; + width: 120px; + line-height: 20px; + text-align: right; +} + +/* sexagesimal coordinates */ + +.GPSexagesimal, .GPSexagesimalsec { + margin:0; + border: 1px solid rgb(204, 204, 204); + border-radius: 4px; +} + +input:read-only.GPSexagesimal, input:read-only.GPSexagesimalsec { + text-align: right; +} + +.GPSexagesimal { + width: 30px; +} + +.GPSexagesimalsec { + width: 45px; +} +.GPmousePositionSexagesimalLabel { + font-size: 1.2em; + vertical-align: middle; + padding: 0; +} + +/* direction N/S ou E/O */ +select.GPmousePositionDirection { + border: 1px solid #999; + margin-left: 2px; +} + +select.GPmousePositionDirection:disabled{ + border: none; + background: transparent; + color: black; + /*For FireFox*/ + -webkit-appearance: none; + /*For Chrome*/ + -moz-appearance: none; +} + +/*For IE10+*/ +select.GPmousePositionDirection:disabled::-ms-expand { + display: none; +} +select.GPmousePositionDirection:disabled::-ms-value { + color: black; +} + +.GPmousePositionUnits, +.GPmousePositionAltitudeUnits { + margin-left: 5px; +} + +/* EDIT COORDINATES TOOLS */ +.GPmousePositionPanelEditTools { + position: absolute; + top: 20px; + right: 5px; +} + +.GPmousePositionEditTool { + width: 18px; + height: 18px; + display: inline-block; + cursor: pointer; +} + +span[id^=GPmousePositionCloseEdit] { + background-position: -18px 0; + margin-left: 5px; +} + +img[id^=GPmousePositionMarker]:hover { + cursor: pointer; + opacity: 0.7; +} + +/* Map center localisation */ + +#GPmapCenter { + display: none; + position: absolute; + top: 50%; + left: 50%; + width: 50px; + height: 50px; + margin-top: -25px; + margin-left: -25px; +} + +#GPmapCenter.GPmapCenterVisible { + display: block; +} + +/* REVERSE GEOCODING */ + +[id^="GPreverseGeocoding-"] { + top: 180px; +} + +/* Showing/hiding reverse geocoding panel */ + +[id^="GPshowReverseGeocodingPicto-"] { + display: inline-block; +} + +[id^="GPshowReverseGeocoding-"] + label { + display: block; +} + +[id^="GPshowReverseGeocoding-"]:checked + label { + display: none; +} + +[id^="GPshowReverseGeocoding-"] + label + div { + display: none; +} + +[id^="GPshowReverseGeocoding-"]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GPreverseGeocodingResultsClose] { + top: 0; + right: 0; + width: 30px; + height: 32px; + /*background-position: -26px 0;*/ +} + +[id^="GPreverseGeocodingPanel-"] { + width: 280px; +} + +.GPreverseGeocodingComponentHidden { + display: none; +} + +div[id^="GPreverseGeocodingReturnPicto-"] { + position: absolute; + width: 26px; + height: 26px; + border-radius: 3px; + opacity: 1; + background-position: 0 0; + cursor: pointer; +} + +.GPreverseGeocodingReturnPictoHidden { + display: none; +} + +/* Calc waiting */ + +.GPreverseGeocodingCalcWaitingContainerVisible, +.GPreverseGeocodingCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPreverseGeocodingCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GPreverseGeocodingCalcWaitingContainerHidden { + display: none; +} + +.GPreverseGeocodingCalcWaiting { + margin: auto; +} + +/* Search panel */ + +[id^="GPreverseGeocodingForm-"] { + position: relative; + max-height: 270px; + overflow-y: auto; + padding-left: 15px; + padding-right: 15px; + padding-top: 10px; +} + +.GPreverseGeocodingCodeLabel, +.GPreverseGeocodingFilterLabel { + max-width: 105px; +} + +.GPreverseGeocodingCodeLabel, +.GPreverseGeocodingCode { + margin-top: 5px; + margin-bottom: 0; +} + +.GPreverseGeocodingFilterLabel, +.GPreverseGeocodingFilterInput { + margin-bottom: 5px; +} + +input[id^="GPreverseGeocodingSubmit-"] { + margin-top: 5px; + margin-bottom: 15px; + width: 100px; +} + +/* Calc waiting */ + +/* TODO: waiting */ +.GPreverseGeocodingCalcWaitingContainerVisible, +.GPreverseGeocodingCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GPreverseGeocodingCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GPreverseGeocodingCalcWaitingContainerHidden { + display: none; +} + +.GPreverseGeocodingCalcWaiting { + margin: auto; +} + +/* Result panel */ + +div[id^=GPreverseGeocodingResultsList-] { + position: relative; + max-height: 210px; + overflow-y: auto; +} + +/* ROUTE */ + +div[id^=GProute-] { + top: 100px; +} + +/* Showing/hiding route panel */ + +label[id^=GPshowRoutePicto] { + display: inline-block; +} + +input[id^=GPshowRoute-] + label { + display: block; +} + +input[id^=GPshowRoute-]:checked + label { + display: none; +} + +input[id^=GPshowRoute-] + label + div { + display: none; +} + +input[id^=GPshowRoute-]:checked + label + div { + display: block; +} + +/* General panels */ + +div[id^=GProutePanel-] { + width: 320px; +} + +.GProuteComponentHidden { + display: none; +} + +/* Calc waiting */ + +.GProuteCalcWaitingContainerVisible, +.GProuteCalcWaitingContainerHidden { + position: absolute; + top: 32px; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255,255,255,0.9); + font-size: 1.5em; + font-weight: bold; + overflow: hidden; +} + +.GProuteCalcWaitingContainerVisible { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +.GProuteCalcWaitingContainerHidden { + display: none; +} + +.GProuteCalcWaiting { + margin: auto; +} + +/* Route form */ + +form[id^=GProuteForm] { + padding: 15px; +} + +.GProuteFormMini { + max-height: 58px; + overflow: hidden; + -webkit-transform: translateY(-5px); + transform: translateY(-5px); +} + +.GProuteStageFlexInput { + max-height: 28px; + opacity: 1; +} + +.GProuteStageFlexInputHidden { + max-height: 0; + opacity: 0; + overflow: hidden; +} + +form[id^=GProuteForm] > .GPlocationStageFlexInput { + margin-top: 5px; +} + +form[id^=GProuteForm] > .GPlocationStageFlexInputHidden { + margin-top: 0; +} + +form[id^=GProuteForm].GProuteFormMini .GPlocationStageFlexInput:first-child { + margin-top: 5px; +} + +.GProuteOriginVisible { + display: block; +} + +.GProuteOriginHidden { + display: none; +} + +label.GProuteOriginPointerImg[id*="GProuteOriginPointerImg"] { + width: 28px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + border-right: 1px solid #999; +} + +input[id*="GProuteOriginPointer"] + .GProuteOriginPointerImg { + background-position: -1px -1px; +} + +input[id*="GProuteOriginPointer"]:checked + .GProuteOriginPointerImg { + background-position: -29px -1px; +} + +.GProuteStageRemove, +div[id^=GProuteStageAdd] { + width: 28px; + border: none; + cursor: pointer; +} + +.GProuteFormMini .GProuteStageRemove, +.GProuteFormMini div[id^=GProuteStageAdd] { + display: none; +} + +.GProuteStageRemove { + background-position: -84px 0; +} + +div[id^=GProuteStageAdd] { + background-position: -56px 0; +} + +/* Mode choice */ + +div[id^=GProuteModeChoice] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; + margin: 15px 0; +} + +.GProuteModeLabel { + display: block; + text-align: center; + margin-bottom: 5px; +} + +div[id^=GProuteTransportChoice] input { + display: none; +} + +.GProuteTransportImg { + display: inline-block; + width: 28px; + height: 28px; + cursor: pointer; +} + +.GProuteTransportImg:first-of-type { + margin-left: 18px; + margin-right: 10px; +} + +input[id^=GProuteTransportCar] + .GProuteTransportImg { + background-position: -112px 0; +} + +input[id^=GProuteTransportCar]:checked + .GProuteTransportImg { + background-position: -140px 0; +} + +input[id^=GProuteTransportPedestrian] + .GProuteTransportImg { + background-position: -168px 0; +} + +input[id^=GProuteTransportPedestrian]:checked + .GProuteTransportImg { + background-position: -196px 0; +} + +select[id^=GProuteComputationSelect] { + width: 100px; +} + +/* Showing/hiding exclusions */ + +input[id^=GPshowRouteExclusions] { + display: none; +} + +.GPshowRouteExclusionsPicto { + /* top: 185px; */ + /* bottom: 25px; */ + right: 0; + transition: all 0.3s ease-out 0s; +} + +input[id^=GPshowRouteExclusions] + label + div[id^=GProuteExclusions] { + max-height: 0; + opacity: 0; + margin-bottom: 0; +} + +input[id^=GPshowRouteExclusions]:checked + label + div[id^=GProuteExclusions] { + display: block; + max-height: 60px; + opacity: 1; + margin-bottom: 15px; +} + +/* Exclusions */ + +div[id^=GProuteExclusions] { + transition: max-height 0.5s ease-in-out 0.25s, opacity 0.5s ease-in-out 0.25s, margin 0.3s ease-in-out 0.25s; + overflow: hidden; +} + +.GProuteExclusionsLabel { + display: block; + text-align: center; + margin-bottom: 10px; + font-weight: bold; + line-height: 16px; +} + +.GProuteExclusionsOptions { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; +} + +.GProuteExclusionsOption { + display: block; + height: 28px; + line-height: 26px; + color: #A77; + background-color: #FEE; + padding-left: 28px; + padding-right: 5px; + border: 1px solid #A77; + border-radius: 3px; + cursor: pointer; +} + +input:checked + .GProuteExclusionsOption { + background-color: #EFE; + background-position: 0 -28px; + color: #797; + border: 1px solid #797; +} + +/* Reset picto */ +div[id^=GProuteReset] { + position: absolute; + width: 28px; + height: 28px; + border-radius: 3px; + opacity: 0.8; + background-position: -224px 0; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +div[id^=GProuteReset]:hover { + opacity: 1; +} + +/* Result panel */ + +div[id^=GProuteResultsPanel] { + padding: 15px; +} + +.GProuteResultStage { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; +} + +div[id^=GProuteResultsStages] { + margin-bottom: 15px; +} + +.GProuteResultStageLabel, +.GProuteResultStageValue, +.GProuteResultsValueLabel, +div[id^=GProuteResultsValueDist], +div[id^=GProuteResultsValueTime] { + display: inline-block; + line-height: 18px; +} + +.GProuteResultStageLabel, +.GProuteResultsValueLabel { + color: #666; +} + +.GProuteResultStageLabel { + width: 60px; +} + +.GProuteResultsValueLabel { + width: 65px; +} + +.GProuteResultStageValue { + -webkit-flex: 1; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +div[id^=GProuteResultsValueDist], +div[id^=GProuteResultsValueTime] { + width: 80px; + font-weight: bold; +} + +div[id^=GProuteResults-] { + display: -webkit-flex; + display: -ms-flexbox; + display: -webkit-box; + display: flex; + -webkit-justify-content: space-between; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + margin-bottom: 10px; +} + +select[id^=GProuteResultsComputationSelect] { + width: 100px; +} + +div[id^=GProuteResultsNew] { + width: 28px; + height: 28px; + border-radius: 3px; + opacity: 0.8; + background-position: -224px 0; + transition: opacity 0.2s ease-out; + cursor: pointer; +} + +div[id^=GProuteResultsNew]:hover { + opacity: 1; +} + +/* Results details header */ + +.GPfakeBorder { + display: inline-block; + height: 14px; + width: 60px; + border-bottom: 1px solid #999; +} + +.GPfakeBorderLeft { + margin-left:15px; +} + +input[id^=GProuteResultsShowDetails] + label, +input[id^=GProuteResultsShowDetails] + label + label { + width: 130px; + line-height: 28px; + vertical-align: top; + text-align: center; + font-weight: bold; + cursor: pointer; + transition: color 0.2s ease-out; +} + +input[id^=GProuteResultsShowDetails] + label, +input[id^=GProuteResultsShowDetails]:checked + label + label { + display: inline-block; +} + +input[id^=GProuteResultsShowDetails]:checked + label, +input[id^=GProuteResultsShowDetails] + label + label { + display: none; +} + +input[id^=GProuteResultsShowDetails] + label + label + div + div[id^=GProuteResultsDetails] { + max-height: 0; + opacity: 0; +} + +input[id^=GProuteResultsShowDetails]:checked + label + label + div + div[id^=GProuteResultsDetails] { + max-height: 200px; + opacity: 1; +} + +div[id^=GProuteResultsDetails] { + overflow-y: auto; + transition: max-height 0.5s ease-in-out 0.25s, opacity 0.5s ease-in-out 0.25s; +} + +.GProuteResultsDetailsNumber, +.GProuteResultsDetailsInstruction { + display: inline-block; + margin-top: 4px; + line-height: 16px; + color: #666; +} + +.GProuteResultsDetailsNumber { + font-weight: bold; + width: 22px; + text-align: right; + vertical-align: top; +} + +.GProuteResultsDetailsInstruction { + width: calc(100% - 30px); + padding-left: 5px; +} + +/* SEARCH ENGINE */ + +input[id^=GPshowSearchEngine-] + label + form[id^=GPsearchInput-] { + max-width: 0px; +} + +/* Showing/hiding search engine input */ + +input[id^=GPshowSearchEngine-] { + display: none; +} + +label[id^=GPshowSearchEnginePicto] { + display: inline-block; + transition: border-radius 0s ease-out 0s; + transition-delay: 0.5s; +} + +input[id^=GPshowSearchEngine-]:checked + label { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + transition-delay: 0s; +} + +input[id^=GPshowSearchEngine-] + label + form[id^=GPsearchInput-] { + max-width: 0px; + border: none; + transition: max-width 0.5s ease-out 0s; +} + +input[id^=GPshowSearchEngine-]:checked + label + form[id^=GPsearchInput-] { + max-width: 280px; +} + +input[id^=GPshowSearchEngine-] + label + form[id^=GPsearchInput-] + div[id^=GPshowAdvancedSearch] { + display: none; +} + +input[id^=GPshowSearchEngine-]:checked + label + form[id^=GPsearchInput-] + div[id^=GPshowAdvancedSearch] { + display: inline-block; +} + +div[id^=GPautoCompleteList] { + display: none; +} + +input[id^=GPshowSearchEngine-]:checked + label + form[id^=GPsearchInput-] + div[id^=GPautoCompleteList] { + display: block; +} + +/* Simple search input */ + +form[id^=GPsearchInput-] { + display: inline-block; + position: relative; + left: -3px; + width: 280px; + overflow: hidden; +} + +form[id^=GPsearchInput-] input { + display: block; + width: 100%; + height: 100%; + border: 1px solid #999; + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; + padding: 0; + padding-right: 30px; + padding-left: 5px; + color: #333; + font-size: 1.0em; +} + +form[id^=GPsearchInput-] input:disabled { + background-color: #DDD; + color: #999; +} + +div[id^=GPsearchInputReset] { + position: absolute; + top: 0; + right: 0; + width: 30px; + height: 32px; + background-position: -30px 0; + cursor: pointer; +} + +/* General panels */ + +div[id^=GPgeocodeResultsClose], +div[id^=GPadvancedSearchClose] { + top: 0; + right: 0; + width: 30px; + height: 32px; +} + +div[id^=GPgeocodeResultsClose] { + background-position: 0 0; +} + +div[id^=GPadvancedSearchClose] { + background-repeat: no-repeat; +} + +/* Advanced search picto */ + +div[id^=GPshowAdvancedSearch] { + transition: border-radius 0s ease-out 0s; + transition-delay: 0.5s; +} + +/* Advanced search panel */ + +div[id^=GPadvancedSearchPanel] { + display: none; + width: 280px; + vertical-align: top; + overflow: hidden; +} + +form[id^=GPadvancedSearchForm] { + max-height: 220px; + overflow-y: auto; + padding-left: 15px; + padding-right: 15px; +} + +.GPadvancedSearchCodeLabel, +.GPadvancedSearchFilterLabel { + max-width: 105px; +} + +.GPadvancedSearchCodeLabel, +.GPadvancedSearchCode, + div[id^=GPadvancedSearchFilters] { + margin-top: 15px; +} + +.GPadvancedSearchFilterLabel, +.GPadvancedSearchFilterInput { + margin-bottom: 5px; +} + +input[id^=GPadvancedSearchSubmit] { + margin-top: 10px; + margin-bottom: 15px; +} + +/* Autocomplete list / geocode results */ + +div[id^=GPautoCompleteList], +div[id^=GPgeocodeResultsList] { + width: 280px; +} + +div[id^=GPautoCompleteList] { + top: 35px; +} + +div[id^=GPgeocodeResultsList] { + display: none; + position: absolute; + top: 40px; + border-radius: 4px; + overflow: hidden; +} + +div[id^=GPgeocodeResults-] { + background-color: #FFF; + max-height: 140px; + overflow-y: auto; +} + +/** +* Map loading +* @sample +* function setMap(map) { +* var center = this._createLoadingElement(); +* map.getViewport().appendChild(center); +* center.className = ""; // invisible ! +* center.className = "GPmapLoadingVisible"; // visible ! +* } +* +* function _createLoadingElement() { +* var div = document.createElement("div"); +* div.id = "GPmapLoading"; +* div.className = ""; +* return div; +* } +*/ + +#GPmapLoading { + display: none; + position: absolute; + z-index: 50; + top: 50%; + left: 50%; + width: 50px; + height: 50px; + margin-top: -25px; + margin-left: -25px; +} + +#GPmapLoading.GPmapLoadingVisible { + display: block; +} + +#GPmapLoading { + background-image: url(data:image/gif;base64,R0lGODlhNAA0AIQSAAFkpSZ5sAGV3k2Ruiao3kOj1/GUBk225pe/B4S83XrK75HH3qrS5szMzNbW1sHe797e3ubm5v///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aWgJgnmpucIpagjpc3IQAh+QQFAQAfACwEAAkAGgAnAAAFb+AnjqJhkmiamqyhvmjLwrA806p946Tu8isbMNca1ozIpHLJTCKeiCYUupxOlVaqMxvdZqtWqbZJLpvPyEK5wGYz23AlPJ6c0412t9yucjQaDi98KX+FDTBtfYZ/gUmLhUqPf0p+i42Oi00QfxAiIQAh+QQFAQAfACwEAAQAGgAnAAAFc+AnjmRZGqhhrmyasrDounE7o/V64yvi6zuTb4gA0oTEn+lYSg5zSGcROpJOqVUntknc9rzgsHhMLhXOhTEaHV6vwW62N36G09tutbzM7/v/JhFlDYQNDmKFhYdeEYmFYA6OhIJbEJINYZdhlolkEA6UUCEAIfkEAQEAHwAsBAAEACcAGgAABXXgJ45kWSIoYq5sS6apK8swPN9mHeP8p6O9UmG4+qlMhmRryCwUa6uk1LBqMp9A5FQptBKDW2nX6+SFxSRyuXemjpvBz5lljYu2srX9vu/7/4CBgh8NhQ6DK4WKDYgkEIuGjSKQipKElIySj5CHlpSWIw6RoCEAOw==); +} + +/* General panels */ + +.GPpanel { + box-shadow: 0 0 6px #000; + border-radius: 4px; +} + +.GPpanelHeader { + height: 32px; + padding: 3px; + background-color: #9DB1BD; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +.GPpanelTitle { + line-height: 26px; + border-top-left-radius: 2px; + border-top-right-radius: 2px; + background-color: #366291; + color: #FFF; +} + +.GPpanelClose { + top: 3px; + right: 3px; + width: 26px; + height: 26px; + background-position: -26px 0; +} + +/* Showing/hiding advanced panels */ + +.GPshowAdvancedToolPicto { + width: 32px; + height: 32px; + padding: 3px; + background-color: rgba(255, 255, 255, 0.4); + border-radius: 4px; +} + +.GPshowAdvancedToolPicto:hover { + background-color: rgba(255, 255, 255, 0.6); +} + +.GPshowAdvancedToolOpen { + width: 26px; + height: 26px; + background-color: rgba(0,60,136,0.5); + border-radius: 2px; +} + +.GPshowAdvancedToolPicto:hover .GPshowAdvancedToolOpen { + background-color: rgba(0,60,136,0.7); +} + +/* Submit inputs */ + +input.GPinputSubmit { + background-color: #366291; +} + +/* Showing additional hidden options */ + +.GPshowMoreOptionsImage { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAA7ElEQVRIx+3UvUoDQRSG4ffMLhbaLIEFvQSxtN1ALiGymkswpZVoupS6Vt6BYBMWf+s0Kaa1FG9BEBYbDQRnj4UKqTRgtjtPeWaYb4YPBowxpmmyyKbs6PpJVCfVan3wOOzN5te2huVK692dq0jHn+abf53lFrqWMlKRfjKNxu1Bmf6M24MyTabRWEX6KKOlvRAgO77ZQ/UCqBDXdSqzmnAPbKDs+yK/XGrgV+jtNlrfAcn36BVxXX+y89BYh+kbrQ+JrgBiDbsva1SNdhhigi/yzBd5FmKCdfivQIDOYbk+3+HkrPds35kx5lef+y50/JHC/FoAAAAASUVORK5CYII=); +} + +div[id^=GPAttribution-] { + display: flex; + bottom: 8px; + right: 8px; + width: calc(90% - 1.3em); + z-index: 1; +} + +div[id^=GPAttributionsListContainer-] { + display: none; + width: 80%; + height: 80%; + background: white; + opacity: 0.5; + border-radius: 4px; + z-index: 0; + position: absolute; +} + +div[id^=GPAttributionsListContainer-] ul { + display: flex; + margin: auto; + list-style: none; +} + +label[id^=GPshowAttributionsListPicto-] { + display: flex; + z-index: auto; + position: relative; + margin-left: auto; +} + +input[id^=GPshowAttributionsList-]:checked + div[id^=GPAttributionsListContainer-] { + display: flex; +} + +input[id^=GPshowAttributionsList-]:checked + div[id^=GPAttributionsListContainer-] + label[id^=GPshowAttributionsListPicto-] { + background-color: transparent; +} + +span[id^=GPshowAttributionsListOpenClose-] { + color: #fff; + font-size: 1.6em; + font-weight: 700; + text-align: center; + line-height: 1.2em; +} + +div[id^=GPAttributionsListContainer-] li:before { + content: " | "; +} + +div[id^=GPAttributionsListContainer-] ul li:nth-child(1):before { + content: ""; +} + +div[id^=GPAttributionsListContainer-] ul li:first-child:before { + content: ""; +} + +div[id^=GPAttributionsListContainer-] a:link { + text-decoration: none; +} + +div[id^=GPAttributionsListContainer-] a:visited { + text-decoration: none; +} + +/* BOOST RELIEF ITOWNS */ + +div[id^=GPboostRelief-] { + top: 8px; + left: 8px; + z-index: 1; +} + +/* Showing/hiding boostRelief panel */ +label[id^=GPshowBoostReliefPicto-] { + display: flex; + z-index: 1; + position: relative; + margin-left: auto; +} + +label[id^=GPshowBoostReliefListPicto-] { + display: flex; + z-index: 1; + position: relative; +} + +/* +span[id^=GPshowBoostReliefOpenClose-] { + color: #fff; + font-size: 1.6em; + font-weight: 700; + text-align: center; + line-height: 1.2em; +}*/ + +span[id^="GPshowBoostReliefOpenClose-"] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAA5ElEQVRIx+2VTQ+CMBBE31Y0hnjz//9RDYwHi6nYLiVF4sE5Qd9OPwayNQBJARBgwMBTwcwUeQeMQADukR/MbKzxf0jSNLGm5y35W1H6no618vlODjGGt+KEn2KMJZ71AwRJMjOLrAdeE03jCb8CZ4dn/ZJk6fESA7mMW3kx4y3fwwyeJB0pSNJFUu/woj9kxgZ83Ra47/92dJ0Hlzazlv+1j9yGueUiX1+sqjs7Cj+Vf2nnXn2x16XXRUv+7jxe/jXdoFSbMptdfNnFc7y2riqd2gibeuDa77RUH/b8pa31NDW+B1R2l0Qaq9wyAAAAAElFTkSuQmCC); +} + +.spanClose span[id^="GPshowBoostReliefOpenClose-"] { + background-position: 0 0; +} + +.spanOpen span[id^="GPshowBoostReliefOpenClose-"] { + background-position: -26px 0; +} + +/* +div[id^=GPboostRelief-] input[type="checkbox"]:checked + div + label[id^=GPshowBoostReliefPicto] span[id^=GPshowBoostReliefOpen] { + opacity: 0.7; +} + +div[id^=GPboostRelief-] input[type="checkbox"]:checked + div + label[id^=GPshowBoostReliefPicto] span[id^=GPshowBoostReliefClose] { + background-color: rgba(0,60,136,0.3); +} + +div[id^=GPboostRelief-] input[type="checkbox"]:checked + div + label[id^=GPshowBoostReliefPicto] :hover span[id^=GPshowBoostReliefClose] { + background-color: rgba(0,60,136,0.4); +} + +*/ + +/* Relief slider : Chrome, Safari, Opera */ + +.GPlayerRelief input[type="range"]::-webkit-slider-runnable-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Relief slider : Firefox */ + +.GPlayerRelief input[type="range"]::-moz-range-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Relief slider : IE */ + +.GPlayerRelief input[type="range"]::-ms-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* BUILDINGS ITOWNS */ + +div[id^=GPbuildings-] { + top: 8px; + right: 8px; + z-index: 1; + padding: 3px; + background-color: rgba(255, 255, 255, 0.4); + border-radius: 4px; +} + +/* Showing/hiding buildings panel */ +label[id^=GPshowBuildingsPicto-] { + display: flex; + height: 28px; + width: 28px; + z-index: 1; + position: relative; + margin-left: auto; + width: 26px; + height: 26px; + background-color: rgba(0,60,136,0.5); + border-radius: 2px; +} + +label[id^=GPshowBuildingsPicto-].buildingsOn { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAZS3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjaxZxZciu7jkX/OYoaQrInh8M24s2ghl8LJCXLkm3Z73zUcVxLllJMEM3GBghdNf73P1P9D/+Sc0E5H1PIIVz8c9llU3iSrv2vrN/6cuv3/qOc9/Tn19X9DcNLlke7/0zhXH97Xd8XuC2oL/+wUGrnjfr5jezO+ulpoXMjKxIZnvSzUD4LWbPf0GeBciQNOcXHLdSxH8/ntxr4T8mvedNJ3A/Pf7uI9rrnPtaYYbW9+G1s2gJY+c8oW3gS+K2t50LNi4X/5BVr9ZFEFPmFnu7/MhJNEdV9edEnq9yf6a9fV8/WcuZcYp+UHO6PX76utP/aKkv1D3d26Twzn18vU88t0ZP2l/JnT3PtmV0UF1B1OJu6bWU947rKLeTWSSFawDoBH0o8yk/mJ+HVDVfoV7sqP01nbTDX1E53XfTUYz023RDRmaFM5Ikxzdj1YrLRZNOs2M/Jj54m2my7TdiyYXbLq+Yui163zVdT626JO3fNpUazmLjAn3/UXz8wp4SC1le66wq5jBFlI4ZYTn5zGRbZdlixpx9+nv+JXS0W9KJlCZGMYuteonr9gQR2Gdpyoedxx6CO/SyAiri1RxhtsQBWIzZ00Fc0JmqNIhMGKohurDMVC2jvTUdI46wN2CYZuTUfiXpdarzhZcXrgBmW8MRXxDbZFozlnMd/okv4UPHWO+998NEnn30JNrjgQwgxCCiWaKNT0ccQY0wxx5JscsmnkGJKKaeSTbaAps8hx5xyzqVwz8LKhU8XLiilmmqrq17VUGNNNdfScJ/mmm+hxZZabqWbbjv40UOPPfXcy9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iCiAgICAgIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZTY5MGI1ZDctNjc4Mi00YmFlLTk3ZjEtMmMwNjQ2ODY4ODgxIgogICAgICBzdEV2dDpzb2Z0d2FyZUFnZW50PSJHaW1wIDIuMTAgKExpbnV4KSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMi0wNi0xNFQxNzo1MTozMCswMjowMCIvPgogICAgIDxyZGY6bGkKICAgICAgc3RFdnQ6YWN0aW9uPSJzYXZlZCIKICAgICAgc3RFdnQ6Y2hhbmdlZD0iLyIKICAgICAgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDo1MjAzZmE0Ny1kYTQ0LTQ0MmItODM3MS1hM2JkZDY2MmZjNTQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkdpbXAgMi4xMCAoTGludXgpIgogICAgICBzdEV2dDp3aGVuPSIyMDIyLTA2LTE1VDEyOjI2OjMxKzAyOjAwIi8+CiAgICA8L3JkZjpTZXE+CiAgIDwveG1wTU06SGlzdG9yeT4KICA8L3JkZjpEZXNjcmlwdGlvbj4KIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/PlXnzYgAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmBg8KGh/rWMUxAAAAyUlEQVRIx+1Wuw7CMAy0oyAGEAMb/P9PsnBdUsmynMS1YgQSt6Rtoju/YpfojyB4FREAdEWYOVUEDUREBcBDbd4jIjCwzJOZN3ItAK4/UU1uj9RmzTKoqPf3p4R2z07ZQhdPTiS8QtVIHslV3uz9jLwfXrHaI9AkvTNuj0ZWMjNri4+Eaxi6USO0vh0K3ShkqeWdgertzNpTT1HIDl4nIufG+YqEVBrD1tyYTcvIrCkjwkZ2E8/fXwxmmETyn71/gGVCAEr0clrYAONE4R0PSBonAAAAAElFTkSuQmCC); +} + +label[id^=GPshowBuildingsPicto-].buildingsOff { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAbu3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjapZxrdhw7DqT/cxWzhCSTz+Xwec7sYJY/X5BZsp72tdvuK5VLJSaTAAIRALLN/H//d5n/w59ylcv4kHIsMV788cUXV3mRr/On7q/28vvr+Ud9fmY/vm/efuB46+b7ff6Z4/P51/v2bYHXgvYK7xbK/flB+/iD4p/186eFngvd2pHjxXgWKs9Ctzs/sM8C9dlpLDm9v4U2z/fn988x8J/Rl/U6k3S+ff63T5zeCFzndm7e9r746u58NnDrP2fuyovIV3cXPmjvcF7v99OzEx3kN+f09qewo6Wt+m8/9MEqb6/s9++bz9by7vnI/emQ49v3b983NnxvlX30767s8/PKfXz/9s6dHX06/X34a+S175m7qD5y1PG5qdet7Fd8rnEJXTobthaxTsSHMt/1Vx6f8eqOK4yrX42/3RbrMNey3g5b7bJzf++2s0XvpnGJF851d+83851ccf2W/bz+2uUSNhx3xpYds9+86972Yvdly9XNvlrmysPyUWdZzMov/vav+dtfWEuhYO2V386KfTmnw2Ybspy+8jEsYtdzqGEf8Ovv5z+y640Fg05ZIVI42HaWaMH+QoJ7G/rmg4HvJwZtGs8CHBGXDmzG3lgAqxEVNtorOZes5SAzBqps3eEiDQvYENxgk87fd8Q22enS/Eqy+6MuON42vA+YYYlAxCVsQ5RhLO8D/pN8xodquIMPIcSQQg4l1HhHH0OMMUWBYk138iaFFFNKOZVU8519DjnmlHMuuRZXbkAzlFhSyaWUWrlmZeXKb1c+UGtz7W6+BdNiSy230mrHfbrvoceeeu6l1+HGPcCPEUcaeZRRp5240vQzzDjTzLPMunC1dZvlV1hxpZVXWfXNao9Zv/z9C6vZx2puW0ofTG9W492UXktYwUmQzTCYM95i8SQT4NBONruy9d7JcrLZVRxRERybDLLZsLIYFvTTurDsy3bGHYvKcv+T3UzyH+zm/tVyRqb7S8t9tdt3VhtKQ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3MS1hM2JkZDY2MmZjNTQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkdpbXAgMi4xMCAoTGludXgpIgogICAgICBzdEV2dDp3aGVuPSIyMDIyLTA2LTE1VDEyOjI2OjMxKzAyOjAwIi8+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjM1MDAzNzUxLWE5ODYtNDk1Yy1iMThiLTA3NTMzNDY0ZmExMSIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChMaW51eCkiCiAgICAgIHN0RXZ0OndoZW49IjIwMjItMDYtMjlUMTU6Mjk6MDkrMDI6MDAiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+VUdqhwAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB+YGHQ0dCa+SbzYAAADhSURBVEjHxVZBDsMgDItZtB027QH9/w+3Sy/NLkVCESQZAuoLUithbJwEiIiQAgDQYCRaBNQUzVDHo05sHRgAeBRJTXlJnohos+yRApYSqaDcFxHp1n1ZagAgr0lEXitSxwC++rSeTT1pTGojnqVIF+yxiijjjhNeGnuJntPCUKkHKtehRJlEW1V+t2yKpDHVSGqVPdy6WTOJLcusFhQp6ksGH0dmjF57xgc7JI/Tsb2VLo88//d6265rSkfdi757R0ULenvtaNmbIZLG5Pi7AfhEJmroudWooxuA41+SlqIfMHbgRNt5fX8AAAAASUVORK5CYII=); +} + +/* LAYER SWITCHER OL3 */ + +div[id^=GPlayerSwitcher-] { + top: 8px; + right: 8px; + z-index: 1; +} + +/* Showing/hiding layers list */ + +label[id^=GPshowLayersListPicto] { + width: 38px; + height: 38px; +} + +span[id^=GPshowLayersListOpen] , +span[id^=GPshowLayersListClose] { + top: 3px; + left: 3px; + width: 32px; + height: 32px; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAACAklEQVRo3u3YsWsUQRgF8DMoBlFzikUQbMRGSG1xJ8QYWxFrMb3YpFI7g1jYibX4B4ilqI2EgIeVkE4sLCIWYmOCEVEUfxZ+J8uy5wVvZ3c192CbY/Z78958OzfzWq0xxhjjfwNmML1dxU9gFZvopCZro90wAxb8whomU5Hsw1V8wEfcwoEGiJ/EmzDgQmrhedRuBK7FXFYxkVp4D6fRwcO6jcDBzPzOJBdeMLZWI3AneB9VKrwJRuAovuA7ZkYttoiNjIDX6P5FnW6828cGFhMZ8CA47ta6+nV0AU7gBz7jSCUbX8Pa/1lw3Si78O6tGjFMeL9WAvHng+899pdVtBti8iKmcB3rGaFP4+ljPcZMFZjXw3yJ4nfiZfBeKtPVkzlReSOKOmIrY3o4W+I8L0fdV9iVor2GGdHviEErnkR48OzFu6h/LvUB449GVCk8w3czOJ5jR9nF+yv7GLOZ3+ewUvC95/eFFcxl3puNWr87ZcT5Hcan+OvrpHA3fxBazhmR74jCFQ/hy2UfhHAv6t1P2faDWnq+oCPyK95NdRbAcXzDVxyr4oIx1IgqhGc4nkTt21Xfs9tYKvo0BrT6UtlJEU5l9p5DdQUOtQQikfO9CJ4rTcjdKo3EcDHEv8WeJgWQyUPRyPnWwoCF1nZDXLQ2S8/5/jETpkdOesYYY4wi/ATOin+8BhQ7TwAAAABJRU5ErkJggg==); +} + +span[id^=GPshowLayersListClose] { + background-position: -32px 0; +} + + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListOpen] { + opacity: 0.7; +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListClose] { + background-color: rgba(0,60,136,0.3); +} + +div[id^=GPlayerSwitcher-] input[type="checkbox"]:checked + div + label[id^=GPshowLayersListPicto] :hover span[id^=GPshowLayersListClose] { + background-color: rgba(0,60,136,0.4); +} + +/* Layers list */ + +.GPlayerVisibility, +.GPshowLayerAdvancedTools, +.GPlayerInfo, +.GPlayerInfoOpened, +.GPlayerRemove { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAAAcCAYAAAD1EPTXAAAIgElEQVR42u2abWxT1xnHf8dOINhQXqpbRUEkiBECd0IghseLYhKhIAZkCIibfUFFQmpRPoAT8f62lQ8wSBaFJB/8CSEYIJoZglRKhFpFycgaJnspGZ1ZwoJITS23Fw2lyM40x/fsA7HLS4D4ha6p7u+Tfc699/Fzzv885znPNRgYGBgYGBgYGBgYGBgYGIwNhDEEBm+KnTt3zjWbzSuebotGo3+ura3952ifkTHWnL527Zr85ptvmDVrFkVFRWlbYDU1Ne+MGzduh5RyHZA/3NwLfBKJRBp37979bTr9WL7r8jumDHYg9XUg8gEk9Ar4RI+Kxs//sOnbsS5Qs9m8QkppF0LcAJBS2s1mM8CoBTrmIui2bdvkvXv3OHToUNoEevLkyXeBU8Ckl1zyWEq5taqqyp0Oe4X7Lr+LlK+0JyRbb1SXucfS3NTV1c0ymUwlUsoS4Fev8O8/QogOKeVnQojPnE7n39IWQc+dOyfb29vRNC3epigKRUVFbN68Oa2C9/v9MhAIcP/+fcLhMAAXLlwAICsrC7/fL2fMmCHSIM6PXrNYJwkhmurq6spTFemwOF9rTwqa7HsulY8lkQoh+qSUo7k0a1jEJcPXi5QjaF1dnfR6vaxZs4aioiK2b98e71NVFVVVcbvdOByOtAi1tbVVBgIB8vPzycvLo6WlhWAwSGtrK7m5uXzwwQf4fD5UVWXJkiVJ2aupqXknMzPzX8+vdKfTCUB9ff3zt3xnMplm79ixQ0t6WzfLF+zdOL4JAPu+y8/dIb8TJn32jd+Xayktir2X7ggp2/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* Opacity slider : Chrome, Safari, Opera */ + +.GPlayerOpacity input[type="range"]::-webkit-slider-runnable-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Opacity slider : Firefox */ + +.GPlayerOpacity input[type="range"]::-moz-range-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Opacity slider : IE */ + +.GPlayerOpacity input[type="range"]::-ms-track { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=); +} + +/* Layer info panel */ + +div[id^=GPlayerInfoPanel] { + right: 190px; +} + +div[id^=GPlayerInfoTitle] { + color: #366291; + border-bottom: 1px solid #366291; +} + +div[id^=GPlayerInfoQuicklook] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJTSURBVEiJ7ZZdSJNRGMd/59Vo9m6jQYKWRV/MQYGBXSStC2/S27YmXYfQZRexZiBhdNE2ke68qq5rY3rRjRFE1Du0KKIcwQYtaGpCH+r01ZrsPV2lc853c0IE+r87z3P+Px7OOc85B7adROFgcHDQAbRWYtR1fdTv9+vF8do1dCFanE7nU6vVagpbWFgglUq1A89NgQB2ux2Hw2EKVBRl45ypswqtq7BYM/oyD8emSE7rgMTVaKPTtac64E99mZtDKRZzeZobVABef55lPDPH6b2W+k0DH72aYjGX51rnEU4csAGQmJhnYCTNmx/qFSBa7DFdw+RXneYGdQUGcLLJxvF6C78M5VQpT5lNkebpzQJdjTaS0zqJifmVWGJynk/fflNXa7wr5Vm3htlsFsMwADjvtDCeEQyMpDm2bzcA6e85LLWwvy434vNFaqLRrnyhf03r9ff3q6qqthXGJhct9W9nrN1LeaUFoK7GeH/YujScmLWGhRCRl5YPl+nrM0oCNyN3INYL3AbxQAtd6AYhAWqqBX6JR14cOndpF8irB90f7Zl45AlssfW0oKdXIu8qQslshbOjba+SneIOxFavGSG6tKAn6u4ZCiBlsHCeFvKu85sd7AkgKg2ZAdCCnpCU3CtXodmNPaqFvF0rVfcMtyINbzlgRa139nrsDDL/DHCAzAL3twQE2kHYQWalFB1ayNuN4FbVwHjYewfkDSlFRzzsHXP3xI6C8rjU3LLv8l9poYurOywJguGjxCn5pz+HNncgFtkoVw2wCfBVUtWO/nP9AYuuwXn+Xm/WAAAAAElFTkSuQmCC); +} + +div[id^=GPlayerInfoClose] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAgCAYAAAAFQMh/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGUSURBVEiJ7ZQxT8JQEMf/hxOsDg6GOGtiYgyy0I4Ormj8BBqpZW9HFhNxRKom8AU0tHFRRx1KYlwcQIkrzM4mGnoOtlJKsa/q2N/4ernfu97dAxISEhJ+CYkEyZq1y8w5O9NRUKk44VFMsm7VHIdf2kdb9aicM0JS8BkIuezH3PxgfekKd3cclEqaeQxQmYg2soXt10H74uGnvKkoMROveHFE2JHelusAkz9C0iwDINU9IErRYlTeyIr79vnNgtybBZB3j9ayhZ5b+S3cSvd9F2nY6a46+VfGEeqx1z9mlL9PmJqE4TsoFZSWps9BbHG4PPBdWBpT7Mkva8zOmJzZabYzT3uiUkBguCbUPAy5LMUsQGC4fEpvZdTgFyJanb5qfxKHSbkB4B6g/JccseQC4nCpne6W+gfKtX/V4sgjeyPppgGGb2VwaleLKkA8uphlAFB8WU/sw82JlviJHC4CHgG408oNO90pj6QAQGxXiyoRvPeZwfQclVcIWWspkm4a409lECZJNw1ZaynTYxISEhL+gU/lu7XSwAzyjAAAAABJRU5ErkJggg==); +} + +.GPlayerInfoLink, +.GPlayerInfoPopup { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJTSURBVEiJ7ZZdSJNRGMd/59Vo9m6jQYKWRV/MQYGBXSStC2/S27YmXYfQZRexZiBhdNE2ke68qq5rY3rRjRFE1Du0KKIcwQYtaGpCH+r01ZrsPV2lc853c0IE+r87z3P+Px7OOc85B7adROFgcHDQAbRWYtR1fdTv9+vF8do1dCFanE7nU6vVagpbWFgglUq1A89NgQB2ux2Hw2EKVBRl45ypswqtq7BYM/oyD8emSE7rgMTVaKPTtac64E99mZtDKRZzeZobVABef55lPDPH6b2W+k0DH72aYjGX51rnEU4csAGQmJhnYCTNmx/qFSBa7DFdw+RXneYGdQUGcLLJxvF6C78M5VQpT5lNkebpzQJdjTaS0zqJifmVWGJynk/fflNXa7wr5Vm3htlsFsMwADjvtDCeEQyMpDm2bzcA6e85LLWwvy434vNFaqLRrnyhf03r9ff3q6qqthXGJhct9W9nrN1LeaUFoK7GeH/YujScmLWGhRCRl5YPl+nrM0oCNyN3INYL3AbxQAtd6AYhAWqqBX6JR14cOndpF8irB90f7Zl45AlssfW0oKdXIu8qQslshbOjba+SneIOxFavGSG6tKAn6u4ZCiBlsHCeFvKu85sd7AkgKg2ZAdCCnpCU3CtXodmNPaqFvF0rVfcMtyINbzlgRa139nrsDDL/DHCAzAL3twQE2kHYQWalFB1ayNuN4FbVwHjYewfkDSlFRzzsHXP3xI6C8rjU3LLv8l9poYurOywJguGjxCn5pz+HNncgFtkoVw2wCfBVUtWO/nP9AYuuwXn+Xm/WAAAAAElFTkSuQmCC); +} + +div[id^=GPminiglobeContainer-] { + display: block; + width:100px; + height:100px; + left: 20px; + bottom: 20px; + color: white; +} + +/* MOUSE POSITION */ + +div[id^=GPmousePosition-] { + bottom: 8px; + left: 10px; + z-index: 2; /* > z-index attribution*/ +} + +/* Showing/hiding mouse position panel */ + +span[id^=GPshowMousePositionOpen] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAaCAYAAAD43n+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD2SURBVFiF7ZbRDoIwDEUZ36oPRP9GMVF+k1c5vpQ4l24CFkfITsIDY2l70+6yqirsDITcdcSocxdQKHxhjTMEHIE7ED0CgAMuwNkyt7kgEfOUsJ0mSsRcZc9gLsoSoOWTG+C8707WfNqcNSfxRsmnA+qgMyOP1GjOSaxioCklKuyejRhJOtLLYyZI4muilosJC4y89957P2H/LMEJUapZaGzxpuAmrv3Gn0YuNIBFXZqaUMUodszNwjVbUWuQEDPatmrpueuOQu4fq+WoSbwD76uPas1BpwbgZJV/rctpI52KupmIaoHGMndh86wxcpZs1/4KO+UFLQ+rEigj9BAAAAAASUVORK5CYII=); +} + +/* General panels */ + +div[id^=GPmousePositionPanel-] { + position: relative; + left: 0px; + top: 0px; +} + +div[id^=GPmousePositionPanelClose] { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAaCAYAAAD43n+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD2SURBVFiF7ZbRDoIwDEUZ36oPRP9GMVF+k1c5vpQ4l24CFkfITsIDY2l70+6yqirsDITcdcSocxdQKHxhjTMEHIE7ED0CgAMuwNkyt7kgEfOUsJ0mSsRcZc9gLsoSoOWTG+C8707WfNqcNSfxRsmnA+qgMyOP1GjOSaxioCklKuyejRhJOtLLYyZI4muilosJC4y89957P2H/LMEJUapZaGzxpuAmrv3Gn0YuNIBFXZqaUMUodszNwjVbUWuQEDPatmrpueuOQu4fq+WoSbwD76uPas1BpwbgZJV/rctpI52KupmIaoHGMndh86wxcpZs1/4KO+UFLQ+rEigj9BAAAAAASUVORK5CYII=); +} + +/* Map center localisation */ + +#GPmapCenter { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAc0SURBVGiB1ZptTBzHGcefmdnz+e72bvcAO8UYUCtTKgMGmsSpGhtcJSTCRTXIaoJUjNUm5kCkFv7SSLaVqpUdKeqHIDcIDqdSgnFLXUXGqmUrNVV9pI0UavsM2FYoqKl5MQ0Gbve4F69vZ6YfeCkQXm7JwSU/6T7cvD3//+3u7MzNgzjnEAumGhyJgFkJRyQXESEVOKRwzpKBs62IM8Sx8Dl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nskMdo0p95UPjW8E2Fyk9PIB5TQS2vJCoqJkYWmEiTCIsUAeHc0iWcArIti01Ujt89K/A+D1E+N+7GXOgAAAABJRU5ErkJggg==); +} + +div[id^=GPscaleContainer-] { + border: 2px solid white; + border-top: none; + text-align: center; + display: block; + background-image: linear-gradient(rgba(200, 200, 200, 0.3), rgba(200, 200, 200, 0.3)); + height: 18px; + width: 200px; + color: white; + font-family: 'Open Sans', + sans-serif; + font-size: 16px; + right: 20px; + bottom: 20px; +} + diff --git a/itowns-2.5.0-beta/dist/GpPluginItowns-src.js b/itowns-2.5.0-beta/dist/GpPluginItowns-src.js new file mode 100644 index 000000000..785e968bf --- /dev/null +++ b/itowns-2.5.0-beta/dist/GpPluginItowns-src.js @@ -0,0 +1,81923 @@ +/*! + * @brief French Geoportal Extension for Itowns + * + * This software is released under the licence CeCILL-B (Free BSD compatible) + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * @see http://www.cecill.info/ + * + * @copyright copyright (c) IGN + * @license CeCILL-B + * @author IGN + * @version 2.5.0-beta + * @date 21/09/2023 + * + */ + +/*! + * Sortable -- JavaScript library for reorderable drag-and-drop lists on modern + * browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, + * React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap. + * + * Released under MIT LICENSE + * + * Copyright Lebedev Konstantin + * https://github.com/SortableJS/Sortable + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @version 1.14.0 + */ + +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.4 + */ + +/*! + * @overview Proj4js - Javascript reprojection library. + * + * @authors + * - Mike Adair madairATdmsolutions.ca + * - Richard Greenwood richATgreenwoodmap.com + * - Didier Richard didier.richardATign.fr + * - Stephen Irons stephen.ironsATclear.net.nz + * - Olivier Terral oterralATgmail.com + * - Calvin Metcalf cmetcalfATappgeo.com + * + * @copyright Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/proj4js/proj4js/master/LICENSE.md + * @version 2.7.5 + */ + +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("node-fetch"), require("xmldom"), require("itowns")); + else if(typeof define === 'function' && define.amd) + define("Gp", ["require", "require", "itowns"], factory); + else if(typeof exports === 'object') + exports["Gp"] = factory(require("node-fetch"), require("xmldom"), require("itowns")); + else + root["Gp"] = factory(root[undefined], root[undefined], root["itowns"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE__47__, __WEBPACK_EXTERNAL_MODULE__48__, __WEBPACK_EXTERNAL_MODULE__94__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Services", function() { return Services; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Error", function() { return Error; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Helper", function() { return Helper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Protocols", function() { return Protocols; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "servicesDate", function() { return servicesDate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "servicesVersion", function() { return servicesVersion; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "itownsExtVersion", function() { return itownsExtVersion; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "itownsExtDate", function() { return itownsExtDate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "itownsExtended", function() { return Itowns; }); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +var _package_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(1, 1); +/* harmony import */ var _Common_Styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var _Styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21); +/* harmony import */ var _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30); +/* harmony import */ var _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(102); +/* harmony import */ var _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(105); +/* harmony import */ var _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(107); +/* harmony import */ var _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(109); +/* harmony import */ var _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(112); +/* harmony import */ var _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(114); +/* harmony import */ var _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(116); +/* harmony import */ var _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(118); +/* harmony import */ var _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(119); +/* harmony import */ var _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(120); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(93); +/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(101); +/* harmony import */ var _Common_Utils_AutoLoadConfig__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(121); +/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36); +/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(110); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LayerUtils", function() { return _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_18__["default"]; }); + +/* harmony import */ var _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(122); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProxyUtils", function() { return _Common_Utils_ProxyUtils__WEBPACK_IMPORTED_MODULE_19__["default"]; }); + +/* harmony import */ var _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(123); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorUtils", function() { return _Common_Utils_ColorUtils__WEBPACK_IMPORTED_MODULE_20__["default"]; }); + +/* harmony import */ var _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(124); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MathUtils", function() { return _Common_Utils_MathUtils__WEBPACK_IMPORTED_MODULE_21__["default"]; }); + +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(34); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_22__["default"]; }); + +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +/** +* Global variable Gp. +* +* @module Gp +* @alias Gp +* @desc +* +* This is the global variable that is exposed in the browser environment. +* Content is composed of constructor, functions and properties... +* +* > ColorUtils: (...) +* > LayerUtils: (...) +* > MathUtils: (...) +* > ProxyUtils: (...) +* > Logger: (...) +* +* > itownsExtended: (...) +* +* > itownsExtVersion: "YYYY-MM-DD" +* > itownsExtVersion: "X.X.X" +* +* > Error: (...) +* > Helper: (...) +* > Protocols: (...) +* > Services: (...) +* > servicesDate: "YYYY-MM-DD" +* > servicesVersion: "X.X.X" +* +* The following variables are aslo global : +* - proj4, +* - itowns +*/ + + + +// CSS communes aux extensions ! + + + + + + + + + + + + + + + + +// Autoload... + + +// export des services + + +// reconstruction des ns +var Services = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__["default"].Services; +var Error = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__["default"].Error; +var Helper = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__["default"].Helper; +var Protocols = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__["default"].Protocols; +var servicesDate = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__["default"].servicesDate; +var servicesVersion = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_17__["default"].servicesVersion; + + +// Adds the extensions properties in the namespace + + + + + +function deepCopy(source, target) { + // Implementing Tail Call Elimination + function tce(source, target) { + for (var prop in source) { + if (source.hasOwnProperty(prop)) { + if (!target.hasOwnProperty(prop)) { + target[prop] = source[prop]; + } else if (_typeof(source[prop]) === "object") { + tce(source[prop], target[prop]); + } + } + } + } + return tce(source, target); +} + +// Adds extensions properties in the namespace +/** Version */ +var itownsExtVersion = _package_json__WEBPACK_IMPORTED_MODULE_0__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_0__.version; +/** Publication date */ +var itownsExtDate = _package_json__WEBPACK_IMPORTED_MODULE_0__.date; + +// creation of the namespace for the itowns extensions +var Itowns = {}; +Itowns.control = {}; +Itowns.control.MousePosition = _Controls_MousePosition__WEBPACK_IMPORTED_MODULE_3__["default"]; +Itowns.control.LayerSwitcher = _Controls_LayerSwitcher__WEBPACK_IMPORTED_MODULE_4__["default"]; +Itowns.control.BoostRelief = _Controls_BoostRelief__WEBPACK_IMPORTED_MODULE_5__["default"]; +Itowns.control.Buildings = _Controls_Buildings__WEBPACK_IMPORTED_MODULE_6__["default"]; +Itowns.control.Attributions = _Controls_Attributions__WEBPACK_IMPORTED_MODULE_7__["default"]; +Itowns.control.Scale = _Controls_Scale__WEBPACK_IMPORTED_MODULE_8__["default"]; +Itowns.control.MiniGlobe = _Controls_MiniGlobe__WEBPACK_IMPORTED_MODULE_9__["default"]; +Itowns.layer = {}; +Itowns.layer.GeoportalWMTS = _Layer_LayerWMTS__WEBPACK_IMPORTED_MODULE_10__["default"]; +Itowns.layer.GeoportalWMS = _Layer_LayerWMS__WEBPACK_IMPORTED_MODULE_11__["default"]; +Itowns.layer.GeoportalElevation = _Layer_LayerElevation__WEBPACK_IMPORTED_MODULE_12__["default"]; +Itowns.layer.VectorTileLayer = _Layer_VectorTileLayer__WEBPACK_IMPORTED_MODULE_13__["default"]; +Itowns.CRS = _CRS_CRS__WEBPACK_IMPORTED_MODULE_15__["default"]; +Itowns.GlobeViewExtended = _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_14__["default"]; + + +// Expose extensions extended into itowns +if (window.itowns) { + // on fusionne les fonctionnalités o + deepCopy(Itowns, window.itowns); + deepCopy(window.itowns, Itowns); +} + +/***/ }), +/* 1 */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"name\":\"geoportal-extensions\",\"description\":\"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries\",\"version\":\"2.9.0\",\"date\":\"21/09/2023\",\"leafletExtName\":\"French Geoportal Extension for Leaflet\",\"leafletExtVersion\":\"2.4.0-beta\",\"olExtName\":\"French Geoportal Extension for OpenLayers\",\"olExtVersion\":\"3.4.0-beta\",\"itownsExtName\":\"French Geoportal Extension for Itowns\",\"itownsExtVersion\":\"2.5.0-beta\",\"main\":\"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js\",\"types\":\"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts\",\"module\":\"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js\",\"directories\":{},\"scripts\":{\"setup\":\"npm install\",\"clean\":\"echo \\\"Warning: target not yet implemented!\\\" && exit 0\",\"eslint\":\"eslint src/\",\"test\":\"npm run test:serve\",\"test:serve\":\"cd test && webpack-dev-server --hot --config webpack.test.serve.js\",\"sample\":\"npm run sample:serve\",\"sample:serve\":\"npm run sample:ol:serve\",\"sample:itowns:serve\":\"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path '/dist/itowns/' --port 9001 --open\",\"sample:leaflet:serve\":\"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path '/dist/leaflet/' --port 9001 --open\",\"sample:ol:serve\":\"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path '/dist/openlayers/' --port 9001 --open\",\"generate-types:ol\":\"npx tsc -p build/types/tsconfig-openlayers.json\",\"generate-types:leaflet\":\"npx tsc -p build/types/tsconfig-leaflet.json\",\"generate-types:itowns\":\"npx tsc -p build/types/tsconfig-itowns.json\",\"generate-jsdoc:ol\":\"jsdoc -c build/jsdoc/jsdoc-openlayers.json\",\"generate-jsdoc:leaflet\":\"jsdoc -c build/jsdoc/jsdoc-leaflet.json\",\"generate-jsdoc:itowns\":\"jsdoc -c build/jsdoc/jsdoc-itowns.json\",\"doc\":\"npm run doc:serve\",\"doc:serve\":\"npm run doc:ol:serve\",\"doc:itowns:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open\",\"doc:leaflet:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open\",\"doc:ol:serve\":\"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open\",\"build:dev\":\"npm-run-all --print-label --print-name build:*:dev\",\"build:prod\":\"npm-run-all --print-label --print-name build:*:prod\",\"build:src\":\"npm-run-all --print-label --print-name build:*:src\",\"build\":\"npm-run-all --print-label --print-name build:*:*\",\"build:itowns\":\"npm-run-all --print-label --print-name build:itowns:*\",\"build:itowns:dev\":\"webpack --config build/webpack/webpack.config.itowns --mode=development\",\"build:itowns:prod\":\"webpack --config build/webpack/webpack.config.itowns --mode=production\",\"build:itowns:src\":\"webpack --config build/webpack/webpack.config.itowns --mode=none\",\"build:ol\":\"npm-run-all --print-label --print-name build:ol:*\",\"build:ol:dev\":\"webpack --config build/webpack/webpack.config.openlayers --mode=development\",\"build:ol:prod\":\"webpack --config build/webpack/webpack.config.openlayers --mode=production\",\"build:ol:src\":\"webpack --config build/webpack/webpack.config.openlayers --mode=none\",\"build:leaflet\":\"npm-run-all --print-label --print-name build:leaflet:*\",\"build:leaflet:dev\":\"webpack --config build/webpack/webpack.config.leaflet --mode=development\",\"build:leaflet:prod\":\"webpack --config build/webpack/webpack.config.leaflet --mode=production\",\"build:leaflet:src\":\"webpack --config build/webpack/webpack.config.leaflet --mode=none\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/IGNF/geoportal-extensions.git\"},\"author\":\"IGNF\",\"keywords\":[\"geoportail\",\"javascript\",\"OpenLayers\",\"Leaflet\",\"Itowns\",\"3D\"],\"license\":\"CECILL-B\",\"bugs\":{\"url\":\"https://github.com/IGNF/geoportal-extensions/issues\"},\"homepage\":\"https://github.com/IGNF/geoportal-extensions#readme\",\"dependencies\":{\"@mapbox/mapbox-gl-style-spec\":\"13.20.1\",\"eventbusjs\":\"0.2.0\",\"geoportal-access-lib\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"itowns\":\"2.38.2\",\"leaflet\":\"1.7.1\",\"leaflet-draw\":\"1.0.4\",\"loglevel\":\"^1.6.7\",\"markdown-toc\":\"^1.2.0\",\"ol\":\"6.9.0\",\"ol-mapbox-style\":\"6.7.0\",\"proj4\":\"2.7.5\",\"proj4leaflet\":\"1.0.2\",\"sortablejs\":\"1.14.0\",\"three\":\"0.137.5\",\"typescript\":\"^4.5.5\",\"whatwg-fetch\":\"3.0.0\"},\"devDependencies\":{\"@babel/core\":\"^7.4.4\",\"@babel/plugin-transform-template-literals\":\"^7.7.4\",\"@babel/preset-env\":\"^7.4.4\",\"babel-loader\":\"^8.0.5\",\"chai\":\"^4.2.0\",\"chalk\":\"^4.0.0\",\"clean-webpack-plugin\":\"^3.0.0\",\"copy-webpack-plugin\":\"^5.0.3\",\"core-js\":\"^3.6.4\",\"css-loader\":\"^3.4.2\",\"eslint\":\"^6.8.0\",\"eslint-config-standard\":\"^14.1.1\",\"eslint-loader\":\"^4.0.0\",\"eslint-plugin-import\":\"^2.17.2\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.1.1\",\"eslint-plugin-standard\":\"^4.0.0\",\"exports-loader\":\"^0.7.0\",\"expose-loader\":\"^0.7.5\",\"fs-extra\":\"^9.0.0\",\"handlebars\":\"^4.7.5\",\"handlebars-layouts\":\"^3.1.4\",\"html-webpack-plugin\":\"^4.0.4\",\"jsdoc-webpack-plugin\":\"^0.3.0\",\"mini-css-extract-plugin\":\"^0.9.0\",\"mocha\":\"^7.1.1\",\"mocha-loader\":\"^5.0.0\",\"npm-run-all\":\"^4.1.5\",\"optimize-css-assets-webpack-plugin\":\"^5.0.1\",\"path\":\"^0.12.7\",\"replace-bundle-webpack-plugin\":\"^1.0.0\",\"requirejs\":\"^2.3.6\",\"responsive-loader\":\"^1.2.0\",\"speed-measure-webpack-plugin\":\"^1.3.0\",\"string-template\":\"^1.0.0\",\"style-loader\":\"^1.1.3\",\"terser-webpack-plugin\":\"^2.0.0\",\"url-loader\":\"^4.0.0\",\"webpack\":\"^4.30.0\",\"webpack-cli\":\"^3.3.1\",\"webpack-dev-server\":\"^3.3.1\",\"webpack-node-externals\":\"^1.7.2\"}}"); + +/***/ }), +/* 2 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _CSS_GPboostRelief_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var _CSS_GPboostRelief_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPboostRelief_css__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _CSS_GPbuildings_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); +/* harmony import */ var _CSS_GPbuildings_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPbuildings_css__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _CSS_GPdrawing_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5); +/* harmony import */ var _CSS_GPdrawing_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPdrawing_css__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _CSS_GPelevationPath_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6); +/* harmony import */ var _CSS_GPelevationPath_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPelevationPath_css__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _CSS_GPgeneralWidget_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7); +/* harmony import */ var _CSS_GPgeneralWidget_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPgeneralWidget_css__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _CSS_GPgetFeatureInfo_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8); +/* harmony import */ var _CSS_GPgetFeatureInfo_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPgetFeatureInfo_css__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _CSS_GPisochron_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9); +/* harmony import */ var _CSS_GPisochron_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPisochron_css__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _CSS_GPlayerSwitcher_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(10); +/* harmony import */ var _CSS_GPlayerSwitcher_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPlayerSwitcher_css__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _CSS_GPlocation_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(11); +/* harmony import */ var _CSS_GPlocation_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPlocation_css__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _CSS_GPmeasureArea_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12); +/* harmony import */ var _CSS_GPmeasureArea_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureArea_css__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var _CSS_GPmeasureAzimuth_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(13); +/* harmony import */ var _CSS_GPmeasureAzimuth_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureAzimuth_css__WEBPACK_IMPORTED_MODULE_10__); +/* harmony import */ var _CSS_GPmeasureLength_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(14); +/* harmony import */ var _CSS_GPmeasureLength_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureLength_css__WEBPACK_IMPORTED_MODULE_11__); +/* harmony import */ var _CSS_GPmeasureToolTip_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(15); +/* harmony import */ var _CSS_GPmeasureToolTip_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmeasureToolTip_css__WEBPACK_IMPORTED_MODULE_12__); +/* harmony import */ var _CSS_GPmousePosition_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(16); +/* harmony import */ var _CSS_GPmousePosition_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPmousePosition_css__WEBPACK_IMPORTED_MODULE_13__); +/* harmony import */ var _CSS_GPreverseGeocoding_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(17); +/* harmony import */ var _CSS_GPreverseGeocoding_css__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPreverseGeocoding_css__WEBPACK_IMPORTED_MODULE_14__); +/* harmony import */ var _CSS_GProute_css__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(18); +/* harmony import */ var _CSS_GProute_css__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_CSS_GProute_css__WEBPACK_IMPORTED_MODULE_15__); +/* harmony import */ var _CSS_GPsearchEngine_css__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(19); +/* harmony import */ var _CSS_GPsearchEngine_css__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPsearchEngine_css__WEBPACK_IMPORTED_MODULE_16__); +/* harmony import */ var _CSS_GPwaiting_css__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(20); +/* harmony import */ var _CSS_GPwaiting_css__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPwaiting_css__WEBPACK_IMPORTED_MODULE_17__); + + + + + + + + + + + + + + + + + + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 21 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _CSS_GPgeneralWidgetItowns_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22); +/* harmony import */ var _CSS_GPgeneralWidgetItowns_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_CSS_GPgeneralWidgetItowns_css__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _CSS_Controls_Attribution_GPattributionItowns_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23); +/* harmony import */ var _CSS_Controls_Attribution_GPattributionItowns_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_Attribution_GPattributionItowns_css__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _CSS_Controls_BoostRelief_GPboostReliefItowns_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24); +/* harmony import */ var _CSS_Controls_BoostRelief_GPboostReliefItowns_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_BoostRelief_GPboostReliefItowns_css__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _CSS_Controls_Buildings_GPbuildingsItowns_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25); +/* harmony import */ var _CSS_Controls_Buildings_GPbuildingsItowns_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_Buildings_GPbuildingsItowns_css__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _CSS_Controls_LayerSwitcher_GPlayerSwitcherItowns_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26); +/* harmony import */ var _CSS_Controls_LayerSwitcher_GPlayerSwitcherItowns_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_LayerSwitcher_GPlayerSwitcherItowns_css__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _CSS_Controls_MiniGlobe_GPminiGlobeItowns_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(27); +/* harmony import */ var _CSS_Controls_MiniGlobe_GPminiGlobeItowns_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_MiniGlobe_GPminiGlobeItowns_css__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _CSS_Controls_MousePosition_GPmousePositionItowns_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28); +/* harmony import */ var _CSS_Controls_MousePosition_GPmousePositionItowns_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_MousePosition_GPmousePositionItowns_css__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _CSS_Controls_Scale_GPscaleItowns_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(29); +/* harmony import */ var _CSS_Controls_Scale_GPscaleItowns_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_CSS_Controls_Scale_GPscaleItowns_css__WEBPACK_IMPORTED_MODULE_7__); + + + + + + + + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), +/* 30 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31); +/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(proj4__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); +/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98); +/* harmony import */ var _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(100); +/* harmony import */ var _CRS_CRS__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(101); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } + + + + + + + + + + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__["default"].getLogger("MousePosition"); + +/** + * @classdesc + * + * MousePosition Control. + * + * @constructor + * @alias itowns.control.MousePosition + * @extends {itowns.control.Control} + * @param {Object} options - options for function call. + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {Boolean} [options.collapsed = true] - Specify if MousePosition control should be collapsed at startup. Default is true. + * @param {Array} [options.systems] - list of projection systems, default are Geographical ("EPSG:4326"), Web Mercator ("EPSG:3857"), Lambert 93 ("EPSG:2154") and extended Lambert 2 ("EPSG:27572"). + * Each array element (=system) is an object with following properties : + * @param {String} options.systems.crs - Proj4 crs alias (from proj4 defs). e.g. : "EPSG:4326". Required + * @param {String} [options.systems.label] - CRS label to be displayed in control. Default is crs code (e.g. "EPSG:4326") + * @param {String} options.systems.type - CRS units type for coordinates conversion : "Geographical" or "Metric". Default: "Metric" + * @param {Object} [options.systems.geoBBox] - Aera covered by the system (WGS84 coordinates). + * @param {Number} options.systems.geoBBox.right - Right bound. + * @param {Number} options.systems.geoBBox.left - Left bound. + * @param {Number} options.systems.geoBBox.top - Top bound. + * @param {Number} options.systems.geoBBox.bottom - Bottom bound. + * @param {Array} [options.units] - list of coordinates units, to be displayed in control units list. + * Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates, + * and "M" or "KM" for metric coordinates + * @param {Array} [options.displayAltitude = true] - activate (true) or deactivate (false) the altitude panel. True by default + * @param {Array} [options.displayCoordinates = true] - activate (true) or deactivate (false) the coordinates panel. True by default + * @param {Object} [options.altitude] - elevation configuration + * @param {Object} [options.altitude.serviceOptions] - options of elevation service + * @param {Number} [options.altitude.responseDelay] - latency for altitude request, 500 ms by default + * @param {Number} [options.altitude.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default + * @example + * var mousePosition = new itowns.control.MousePosition({ + * collapsed : false, + * displayCoordinates : true, + * displayAltitude : true, + * altitude : { + * triggerDelay : 100, + * responseDelay : 500, + * serviceOptions : {} + * }, + * systems : [ + * { + * crs : "EPSG:3857", + * label : "Mercator", + * type : "Metric" + * }, + * { + * crs : "EPSG:32620", + * label : "UTM 20N (Guadeloupe, Martinique)", + * type : "Metric", + * geoBBox : { + * left: -66.00, + * bottom : 0.00, + * right : -60.00, + * top : 84.00 + * } + * } + * ], + * units : ["DEC", "DMS"] + * }); + */ +function MousePosition(options) { + options = options || {}; + if (!(this instanceof MousePosition)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + if (_typeof(options) !== "object") { + throw new Error("ERROR WRONG_TYPE : options should be an object"); + } + this._initialize(options); + this._callbacks = {}; + + // init control DOM container + var container = this._initContainer(options); + _Widget__WEBPACK_IMPORTED_MODULE_7__["default"].call(this, { + name: "MousePosition", + element: container, + target: options.target, + position: options.position + }); +} +; + +/** + * @lends module:MousePosition + */ +MousePosition.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_7__["default"].prototype, {}); +_Common_Utils__WEBPACK_IMPORTED_MODULE_4__["default"].assign(MousePosition.prototype, _Common_Controls_MousePositionDOM__WEBPACK_IMPORTED_MODULE_6__["default"]); + +/** + * Constructor (alias) + */ +MousePosition.prototype.constructor = MousePosition; + +/** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ +MousePosition.prototype.setGlobe = function (globe) { + if (globe) { + // In the case of the adding of a control to the globe + this._centerElement = this._createMapCenter(); + globe.getTargetElement().appendChild(this._centerElement); + + // defines the callback on the map to retrieve the coordinates + this._callbacks.mouseMove = this.onMouseMove.bind(this); + + // valid event for desktop mode + if (!this.collapsed) { + if (this._isDesktop) { + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__["default"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove); + } else { + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__["default"].EVENTS.CENTER_CHANGED, this.onGlobeMove); + } + } + } else if (globe == null) { + // if globe == null we remove the MP control + // deletes the listener associated to the mousePosition control + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__["default"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove); + // deletes the mousePosition control DOM + while (this.getElement().hasChildNodes()) { + this.getElement().removeChild(this.getElement().lastChild); + } + this.getElement().parentNode.removeChild(this.getElement()); + this._globe.getTargetElement().removeChild(this._centerElement); + } + // call original setGlobe method + _Widget__WEBPACK_IMPORTED_MODULE_7__["default"].prototype.setGlobe.call(this, globe); +}; + +// ################################################################### // +// #################### user interface methods ####################### // +// ################################################################### // + +/** + * Sets additional projection system + * + * @param {Object} system - Projection system defined in the Itowns/CRS/CRS.js class + * @param {String} system.crs - Proj4 crs alias (from proj4 defs) e.g. "EPSG:4326" + * @param {String} [system.label] - CRS label to be displayed in control. Default is system.crs alias + * @param {String} [system.type] - CRS units type for coordinates conversion (one of control options.units). Default is "Metric" + */ +MousePosition.prototype.addSystem = function (system) { + if (_typeof(system) !== "object") { + logger.error("MousePosition:addSystem - system parameter should be an object"); + return; + } + if (!system.crs) { + logger.error("crs not defined !"); + return; + } + if (!system.label) { + logger.warn("crs label not defined, use crs code by default."); + system.label = system.crs; + } + if (!system.type) { + logger.warn("type srs not defined, use 'Metric' by default."); + system.type = "Metric"; + } + + // 1. adds system to control systems + for (var j = 0; j < this._projectionSystems.length; j++) { + var obj = this._projectionSystems[j]; + if (system.crs === obj.crs) { + // warn user + logger.warn("crs '{}' already configured", obj.crs); + } + } + system.code = this._projectionSystems.length; + this._projectionSystems.push(system); + + // 2. adds system settings option to container (if it was already build) + var selectSystem = document.getElementById(this._addUID("GPmousePositionProjectionSystem")); + if (selectSystem) { + var option = document.createElement("option"); + option.value = system.code; + option.text = system.label; + selectSystem.appendChild(option); + } +}; + +/** + * Sets additional projection systems + * + * @param {Array} systems - Array of system object, with following properties : + * @param {String} systems.crs - Proj4 CRS alias (from proj4 defs) e.g. "EPSG:4326" + * @param {String} systems.label - CRS label (for coordinates conversion) + * @param {String} systems.type - CRS units type to be displayed in control (one of control options.units). Default is "Metric" + */ +MousePosition.prototype.addSystems = function (systems) { + if (!systems) { + return; + } + if (!Array.isArray(systems)) { + logger.error("MousePosition:addSystems - systems parameter should be an array"); + return; + } + for (var i = 0; i < systems.length; i++) { + this.addSystem(systems[i]); + } +}; + +/** + * Removes projection system (in case there are several system with same code, only the first one will be removed) + * + * @param {String} systemCrs - CRS alias (from proj4 defs) + */ +MousePosition.prototype.removeSystem = function (systemCrs) { + if (!systemCrs || typeof systemCrs !== "string") { + logger.error("MousePosition:removeSystem - systemCode parameter should be a string"); + return; + } + var systemCode = null; + // finds system in control projection systems list + for (var i = 0; i < this._projectionSystems.length; i++) { + var proj = this._projectionSystems[i]; + if (systemCrs === proj.crs) { + systemCode = proj.code; + // removes system from control projection systems list + this._projectionSystems.splice(i, 1); + break; + } + } + if (systemCode == null) { + logger.warn("MousePosition:removeSystem - system not found"); + return; + } + + // re-initialization of codes + var oldNewCodeGlobe = []; + for (var ii = 0; ii < this._projectionSystems.length; ii++) { + oldNewCodeGlobe[Number(this._projectionSystems[ii].code)] = ii; + this._projectionSystems[ii].code = ii; + } + + // finds system in control container systems list + var indexChildToRemove = null; + var systemList = document.getElementById(this._addUID("GPmousePositionProjectionSystem")); + for (var j = 0; j < systemList.childNodes.length; j++) { + if (systemCode === systemList.childNodes[j].value) { + indexChildToRemove = j; + continue; + } + systemList.childNodes[j].value = oldNewCodeGlobe[Number(systemList.childNodes[j].value)]; + } + // removes system from control container systems list + if (indexChildToRemove != null) { + systemList.removeChild(systemList.childNodes[indexChildToRemove]); + } + + // choose arbitrarily a new current system if needed + if (this._currentProjectionSystems.code === systemCode) { + systemList.childNodes[0].setAttribute("selected", "selected"); + this._setCurrentSystem(systemList.childNodes[0].value); + } +}; + +/** + * Sets control units (to be displayed) + * + * @param {Array} units - list of all coordinates units, to be displayed in control units list. + * Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates, + * and "M" or "KM" for metric coordinates + */ +MousePosition.prototype.setUnits = function (units) { + if (!units || !Array.isArray(units)) { + return; + } + this.options.units = units; + this._projectionUnits = {}; + this._initProjectionUnits(); + if (this._currentProjectionType) { + this._setTypeUnitsPanel(this._currentProjectionType); + } +}; + +/** + * Sets control altitude options (useless if displayAltitude == false) + * + * @param {Object} options - altitude options + * @param {Object} [options.serviceOptions] - options of elevation service + * @param {Number} [options.responseDelay] - latency for elevation request, 500 ms by default + * @param {Number} [options.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default + */ +MousePosition.prototype.setAltitudeOptions = function (options) { + if (!options || _typeof(options) !== "object") { + return; + } + this.options.altitude.triggerDelay = options.triggerDelay; + this.options.altitude.responseDelay = options.responseDelay; + if (options.serviceOptions) { + for (var opt in options.serviceOptions) { + if (options.serviceOptions.hasOwnProperty(opt)) { + this.options.altitude.serviceOptions[opt] = options.serviceOptions[opt]; + } + } + } +}; + +/** + * Displays or hides elevation panel + * + * @param {Boolean} displayAltitude - true to display elevation panel, false to hide it + */ +MousePosition.prototype.displayAltitude = function (displayAltitude) { + if (displayAltitude === undefined) { + return; + } + this.options.displayAltitude = displayAltitude; + this._setElevationPanel(displayAltitude); +}; + +/** + * Displays or hides coordinates panel + * + * @param {Boolean} displayCoordinates - true to display coordinates panel, false to hide it + */ +MousePosition.prototype.displayCoordinates = function (displayCoordinates) { + if (displayCoordinates === undefined) { + return; + } + this.options.displayCoordinates = displayCoordinates; + this._setCoordinatesPanel(displayCoordinates); + this._setSettingsPanel(displayCoordinates); +}; + +/** + * Collapses or displays control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ +MousePosition.prototype.setCollapsed = function (collapsed) { + if (collapsed === undefined) { + logger.error("MousePosition:setCollapsed - missing collapsed parameter"); + return; + } + if (collapsed && this.collapsed || !collapsed && !this.collapsed) { + return; + } + if (!this._isDesktop) { + document.getElementById(this._addUID("GPmapCenter")).className = collapsed ? "" : "GPmapCenterVisible"; + } + // simulates the opening of the panel after a click + this.onShowMousePositionClick(); + this._showMousePositionContainer.checked = !collapsed; +}; + +// ################################################################### // +// ######################## initialize control ####################### // +// ################################################################### // + +/** + * Initializes control (called by MousePosition constructor) + * + * @method _initialize + * @param {Object} options - control options (set by user) + * @private + */ +MousePosition.prototype._initialize = function (options) { + // Set default options + // {Object} control options - set by user or by default + this.options = options || {}; + this.options.collapsed = options.collapsed !== undefined ? options.collapsed : true; + /** {Boolean} specify if MousePosition control is collapsed (true) or not (false) */ + this.collapsed = this.options.collapsed; + this.options.units = options.units || []; + this.options.displayAltitude = options.displayAltitude !== undefined ? options.displayAltitude : true; + this.options.displayCoordinates = options.displayCoordinates !== undefined ? options.displayCoordinates : true; + this.options.systems = options.systems || []; + if (options.altitude) { + var altitude = options.altitude; + this.options.altitude = { + triggerDelay: altitude.triggerDelay !== undefined ? altitude.triggerDelay : 200, + responseDelay: altitude.responseDelay !== undefined ? altitude.responseDelay : 500, + serviceOptions: altitude.serviceOptions || {}, + noDataValue: altitude.noDataValue !== undefined ? altitude.noDataValue : -99999, + noDataValueTolerance: altitude.noDataValueTolerance !== undefined ? altitude.noDataValueTolerance : 90000 + }; + // on surcharge l'outputFormat pour du json si non spécifié par utilisateur + this.options.altitude.serviceOptions.outputFormat = altitude.serviceOptions && altitude.serviceOptions.outputFormat ? altitude.serviceOptions.outputFormat : "json"; + } else { + this.options.altitude = { + triggerDelay: 200, + responseDelay: 500, + serviceOptions: { + outputFormat: "json" + } + }; + } + + // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page) + this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_5__["default"].generate(); + + // initialization of the projections systems + this._projectionSystems = []; + this._initProjectionSystems(); + + // initialization of the units systems + this._projectionUnits = {}; + this._initProjectionUnits(); + + // support detect : desktop or tactile + this._isDesktop = _Common_Utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectSupport(); + + // implements a timer threshold + if (this.options.altitude.triggerDelay < 100) { + this.options.altitude.triggerDelay = 100; + } + + // {Number} timer on movestopped delay (altitude calculation) + this._timer = this.options.altitude.triggerDelay; + + // {Object} Selected projection system + this._currentProjectionSystems = this._projectionSystems[0]; + + // {String} Selected projection units typs : Geographical or metric + this._currentProjectionType = this._projectionSystems[0].type; + + // {String} Selected projection unit + this._currentProjectionUnits = this._projectionUnits[this._currentProjectionType][0].code; + + // {Object} Projection units container (DOM Element) + this._projectionUnitsContainer = null; + + // {Object} control panel container (DOM Element) + this._showMousePositionContainer = null; + + // management of the altitude panel display + if (!this.options.displayAltitude && !this.options.displayCoordinates) { + // reactivate the display of coordinates, to not display an empty panel + this.options.displayCoordinates = true; + } +}; + +/** + * this method is called by the constructor and initialize the projection + * systems. + * getting coordinates in the requested projection : + * see this.onMousePositionProjectionSystemChange() + * + * @method _initProjectionSystems + * @private + */ +MousePosition.prototype._initProjectionSystems = function () { + // user has the possibility to modify the list of systems to display + // Ex. this.options.systems + + // available projection systems vy default + var projectionSystemsByDefault = [{ + label: "Géographique", + crs: "EPSG:4326", + type: "Geographical" + }, { + label: "Mercator", + crs: "EPSG:3857", + type: "Metric" + }, { + label: "Lambert 93", + crs: "EPSG:2154", + type: "Metric", + geoBBox: { + left: -9.86, + bottom: 41.15, + right: 10.38, + top: 51.56 + } + }, { + label: "Lambert II étendu", + crs: "EPSG:27572", + type: "Metric", + geoBBox: { + left: -4.87, + bottom: 42.33, + right: 8.23, + top: 51.14 + } + }]; + var systems = this.options.systems; + for (var i = 0; i < systems.length; i++) { + // definition of a reference system + var sys = systems[i]; + this.addSystem(sys); + } + if (this._projectionSystems.length === 0) { + // we add the default projection systems + for (var ii = 0; ii < projectionSystemsByDefault.length; ii++) { + this.addSystem(projectionSystemsByDefault[ii]); + } + } +}; + +/** + * this method is called by the constructor and initialize the units. + * getting coordinates in the requested units : + * see this.onMousePositionProjectionUnitsChange() + * + * @method _initProjectionUnits + * @private + */ +MousePosition.prototype._initProjectionUnits = function () { + // user has the possibility to modify the list of units to display + // Ex. + // this.options.units : ["DEC", "DMS"] + + // available units systems by default + var projectionUnitsByDefault = { + Geographical: [{ + code: "DEC", + label: "degrés décimaux", + convert: this._displayDEC + }, { + code: "DMS", + label: "degrés sexagésimaux", + convert: this._displayDMS + }, { + code: "RAD", + label: "radians", + convert: this._displayRAD + }, { + code: "GON", + label: "grades", + convert: this._displayGON + }], + Metric: [{ + code: "M", + label: "mètres", + convert: this._displayMeter + }, { + code: "KM", + label: "kilomètres", + convert: this._displayKMeter + }] + }; + var units = this.options.units; + for (var type in projectionUnitsByDefault) { + if (projectionUnitsByDefault.hasOwnProperty(type)) { + var found = false; + for (var j = 0; j < projectionUnitsByDefault[type].length; j++) { + var obj = projectionUnitsByDefault[type][j]; + for (var i = 0; i < units.length; i++) { + var unit = units[i]; + if (obj.code === unit) { + found = true; + if (!this._projectionUnits[type]) { + this._projectionUnits[type] = []; + } + this._projectionUnits[type].push(obj); + } + } + } + if (!found) { + this._projectionUnits[type] = projectionUnitsByDefault[type]; + } + } + } + + // in case of... + if (_typeof(this._projectionUnits) === "object" && Object.keys(this._projectionUnits).length === 0) { + this._projectionUnits = projectionUnitsByDefault; + } +}; + +// ################################################################### // +// ######################## methods handle dom ####################### // +// ################################################################### // + +/** + * Create control main container (called by MousePosition constructor) + * + * @method _initContainer + * @param {Object} options - options + * @param {Boolean} options.collapsed - Specify if MousePosition control should be collapsed + * @param {Array} options.displayAltitude - activate (true) or deactivate (false) the altitude panel + * @param {Array} options.displayCoordinates - activate (true) or deactivate (false) the coordinates panel + * @returns {DOMElement} container - widget container + * @private + */ +MousePosition.prototype._initContainer = function (options) { + // creates the main container + var container = this._createMainContainerElement(); + var inputShow = this._showMousePositionContainer = this._createShowMousePositionElement(); + if (!options.collapsed) { + inputShow.checked = "checked"; + } + container.appendChild(inputShow); + var picto = this._createShowMousePositionPictoElement(this._isDesktop); + container.appendChild(picto); + var panel = this._createMousePositionPanelElement(); + var header = this._createMousePositionPanelHeaderElement(); + panel.appendChild(header); + var basic = this._createMousePositionPanelBasicElement(options.displayAltitude, options.displayCoordinates); + panel.appendChild(basic); + var arraySettings = this._createShowMousePositionSettingsElement(options.displayCoordinates); + for (var j = 0; j < arraySettings.length; j++) { + panel.appendChild(arraySettings[j]); + } + var settings = this._createMousePositionSettingsElement(options.displayCoordinates); + var systems = this._projectionSystemsContainer = this._createMousePositionSettingsSystemsElement(this._projectionSystems); + var units = this._projectionUnitsContainer = this._createMousePositionSettingsUnitsElement(this._projectionUnits[this._currentProjectionType]); + settings.appendChild(systems); + settings.appendChild(units); + panel.appendChild(settings); + container.appendChild(panel); + return container; +}; + +/** + * this method is called by this.() + * and it changes the elevation view panel into the dom. + * + * @method _setElevationPanel + * @param {Boolean} active - true:active, false:disable + * @private + */ +MousePosition.prototype._setElevationPanel = function (active) { + var div = null; + if (!active) { + div = document.getElementById("GPmousePositionAltitude-" + this._uid); + div.style.display = "none"; + } else { + div = document.getElementById("GPmousePositionAltitude-" + this._uid); + div.style.display = ""; + } +}; + +/** + * this method is called by this.() + * and it changes the coordinate view panel into the dom. + * + * @method _setCoordinatesPanel + * @param {Boolean} active - true:active, false:disable + * @private + */ +MousePosition.prototype._setCoordinatesPanel = function (active) { + var div = document.getElementById("GPmousePositionCoordinate-" + this._uid); + if (!active) { + div.style.display = "none"; + } else { + div.style.display = ""; + } +}; + +/** + * this method is called by this.() + * and it changes the settings view panel into the dom. + * + * @method _setSettingsPanel + * @param {Boolean} active - true:active, false:disable + * @private + */ +MousePosition.prototype._setSettingsPanel = function (active) { + var divPicto = document.getElementById("GPshowMousePositionSettingsPicto-" + this._uid); + var divPanel = document.getElementById("GPmousePositionSettings-" + this._uid); + if (!active) { + divPicto.style.display = "none"; + divPanel.style.display = "none"; + } else { + divPicto.style.display = ""; + divPanel.style.display = ""; + } +}; + +/** + * this method is called by this.onMousePositionProjectionSystemChange() + * when changes to a metric or a geographical units. + * + * @method _setTypeUnitsPanel + * @param {String} type - Geographical or Metric + * @private + */ +MousePosition.prototype._setTypeUnitsPanel = function (type) { + var container = this._projectionUnitsContainer; + + // deletes the childNodes + while (container.firstChild) { + container.removeChild(container.firstChild); + } + var units = this._projectionUnits[type]; + for (var j = 0; j < units.length; j++) { + var obj = units[j]; + var option = document.createElement("option"); + option.value = obj.code ? obj.code : j; + option.text = obj.label || j; + // option.label = obj.label; + container.appendChild(option); + } + + // the new type of system + this._currentProjectionType = type; + // as the system changed, the unit system has to change too ! + this._currentProjectionUnits = this._projectionUnits[type][0].code; +}; + +// ################################################################### // +// ######################## method units convert ##################### // +// ################################################################### // + +/** + * degreedecimal + * + * @method _displayDEC + * @param {Object} coords - coordinatesobject {lon, lat} + * @return {Object} coordinate - coordinate object : {lat : 48, lng : 2} par exemple + * @private + */ +MousePosition.prototype._displayDEC = function (coords) { + var coordinate = {}; + coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].roundToDecimal(coords.lat, 6); + coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].roundToDecimal(coords.lon, 6); + return coordinate; +}; + +/** + * degreedecimal2sexagecimal + * + * @method _displayDMS + * @param {Object} coords - coordinates object {lon, lat} + * @return {Object} coordinate - coordinate object : {lng : "2° 00′ 00″ E", lat : "48° 00′ 00″ N"} par exemple + * @private + */ +MousePosition.prototype._displayDMS = function (coords) { + var coordinate = {}; + coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].decimalLatToDMS(coords.lat); + coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].decimalLongToDMS(coords.lon); + return coordinate; +}; + +/** + * degreedecimal2radian + * + * @method _displayRAD + * @param {Object} coords - coordinates object {lon, lat} + * @return {Object} coordinate - coordinate object : {lat : "0.02837864", lng : "0.84300269"} par exemple + * @private + */ +MousePosition.prototype._displayRAD = function (coords) { + var coordinate = {}; + coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].decimalToRadian(coords.lat); + coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].decimalToRadian(coords.lon); + return coordinate; +}; + +/** + * degreedecimal2grade + * + * @method _displayGON + * @param {Object} coords - coordinates object {lon, lat} + * @return {Object} coordinate - coordinate object : {lat : "4.09545898", lng : "53.68751528"} par exemple + * @private + */ +MousePosition.prototype._displayGON = function (coords) { + var coordinate = {}; + coordinate.lat = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].decimalToGrade(coords.lat); + coordinate.lng = _Utils_PositionFormater__WEBPACK_IMPORTED_MODULE_8__["default"].decimalToGrade(coords.lon); + return coordinate; +}; + +/** + * meter + * + * @method _displayMeter + * @param {Object} coords - coords object {lon, lat} + * @return {Object} coordinate - coordinate object : {x : "148593.58", y : "6176560.95"} par exemple + * @private + */ +MousePosition.prototype._displayMeter = function (coords) { + // on recoit toujours des coordonnées metriques + var coordinate = {}; + coordinate.x = coords.lon.toFixed(2); + coordinate.y = coords.lat.toFixed(2); + coordinate.unit = "m"; + return coordinate; +}; + +/** + * kilometer + * + * @method _displayKMeter + * @param {Object} coords - coords object {lon, lat} + * @return {Object} coordinate - coordinate object : {x : "214.96", y : "6250.09"} par exemple + * @private + */ +MousePosition.prototype._displayKMeter = function (coords) { + var coordinate = {}; + coordinate.x = (coords.lon / 1000).toFixed(2); + coordinate.y = (coords.lat / 1000).toFixed(2); + coordinate.unit = "km"; + return coordinate; +}; + +// ################################################################### // +// ##################### handlers events to control ################## // +// ################################################################### // + +/** + * this sends the coordinates to the panel. + * (cf. this.GPdisplayCoords() into the DOM functions) + * + * @method _setCoordinate + * @param {Array} coords - coordinate object {lon, lat} + * @private + */ +MousePosition.prototype._setCoordinate = function (coords) { + // structure + // coords + // { + // lon: 5, + // lat : 48 + // } + // + // structure for the coordinates depending on the system type : + // {x:, y:, unit:} or {lng:, lat:} or {lon:, lat:} or {e:, n:, unit:}... + + var coord = []; + var coordinates = {}; + + // transforms the point in the wanted coords system + var oSrs = this._currentProjectionSystems; + var crsProp = oSrs ? oSrs.crs : null; + if (!crsProp) { + logger.error("system crs not found"); + return; + } + // reproject coordinates from their CRS of origin (WGS84) to the wanted CRS (crsProp) + if (crsProp !== "EPSG:4326") { + coord = proj4__WEBPACK_IMPORTED_MODULE_0___default()(_CRS_CRS__WEBPACK_IMPORTED_MODULE_9__["default"][crsProp], [coords.lon, coords.lat]); + // projected values are affected to the coord var + coordinates.lon = coord[0]; + coordinates.lat = coord[1]; + } else { + coordinates = coords; + } + + // system type : Geographical or Metric + + var type = this._currentProjectionSystems.type; + + // checks for a formatting function in the wanted unit + var convert = null; + var units = this._projectionUnits[type]; + for (var i = 0; i < units.length; i++) { + if (units[i].code === this._currentProjectionUnits) { + convert = units[i].convert; + break; + } + } + if (!convert || typeof convert !== "function") { + logger.warn("coordinates format function not found"); + return; + } else { + coord = convert(coordinates); + } + if (!coord || Object.keys(coord).length === 0) { + return; + } + this.GPdisplayCoords(coord); +}; + +/** + * this sends the coordinates to the panel. + * (cf. this.GPdisplayElevation() into the DOM functions) + * + * @method _setElevation + * @param {Object} coords - Coordinate position object {lon, lat} + * @private + */ +MousePosition.prototype._setElevation = function (coords) { + // management of the timer of the altitude service request + var delay = this.options.altitude.responseDelay; + this.GPdisplayElevation(coords, delay); +}; + +/** + * this method is triggered when the mouse or the globe is stopped. + * (cf. onMouseMove and onGlobeMove) + * + * @method onMoveStopped + * @param {Object} coords - Coordinate position object {lon, lat} + * @private + */ +MousePosition.prototype.onMoveStopped = function (coords) { + this._setElevation(coords); +}; + +/** + * this method is an handler event to control. The event is 'mousemove' on + * the globe. The handler sends the coordinates to the panel. + * (cf. this.GPdisplayCoords() into the DOM functions) + * + * @method onMouseMove + * @param {Object} e - HTMLElement + * @private + */ +MousePosition.prototype.onMouseMove = function (e) { + var self = this; + var position = this.getGlobe().getCoordinateFromMouseEvent(e); + if (!position) { + this.GPdisplayCoords({ + lon: "---", + lat: "---" + }); + this.GPresetElevation(); + return; + } + var coordinate = { + lon: position.x, + lat: position.y + }; + this._setCoordinate(coordinate); + + // calculation of the altitude after a time limit from the moment where the mouse movement is stopped + if (this.options.displayAltitude) { + clearTimeout(this._timer); + this._timer = setTimeout(function () { + self.onMoveStopped(coordinate); + }, this.options.altitude.triggerDelay); + } +}; + +/** + * this method is an handler event to control. The event is 'moveend' on + * the globe. The handler sends the coordinates to the panel. + * (cf. this.GPdisplayCoords() into the DOM functions) + * + * @method onGlobeMove + * @private + */ +MousePosition.prototype.onGlobeMove = function () { + + // var self = this; + + // info: coordinate = [x, y] + // var coordinate = e.coordinate; + // if ( !e.map || !e.map.getView() ) { + // return; + // } + // var crs = e.map.getView().getProjection(); + // + // this._setCoordinate(coordinate, crs); + // + // // calcul de l'altitude après un certain délai après l'arrêt du mouvement de la carte + // clearTimeout(this._timer); + // this._timer = setTimeout( function () { + // self.onMoveStopped(coordinate, crs); + // }, this.options.altitude.triggerDelay); +}; + +// ################################################################### // +// ####################### handlers events to dom #################### // +// ################################################################### // + +/** + * this method is called by this.GPdisplayElevation() in the dom, and + * it executes a request to the elevation service. + * + * @method onRequestAltitude + * @param {Object} coordinate - {lat:..., lng:...} + * @param {Function} callback - function callback + * @private + */ +MousePosition.prototype.onRequestAltitude = function (coordinate, callback) { + // INFORMATION + // we launch the request to the altitude services + // we implement callbacks in order to retrieve results or errors + // from the service. + // The result is displayed in a DOM element. + // The error messages are display in the dev console (?) + + if (!coordinate || Object.keys(coordinate).length === 0) { + return; + } + + // if we do not want any altitude calculation, we just stop ! + if (!this.options.displayAltitude) { + return; + } + + // we retrieve the service options... + var options = this.options.altitude.serviceOptions || {}; + + // ... and the coordinates... + options.zonly = true; + options.positions = [{ + lon: coordinate.lon, + lat: coordinate.lat + }]; + + // ... and the callbacks + options.scope = this; + if (!options.rawResponse) { + // in the general case + options.onSuccess = function (results) { + if (results && Object.keys(results).length) { + callback.call(this, results.elevations[0].z); + } + }; + } else { + options.onSuccess = function (results) { + logger.info("alti service raw response : ", results); + }; + } + options.onFailure = function (error) { + logger.error("[getAltitude] " + error.message); + }; + // we use the key "calcul" + options.apiKey = "calcul"; + + // si l'utilisateur a spécifié le paramètre ssl au niveau du control, on s'en sert + // true par défaut (https) + if (typeof this.options.ssl === "boolean") { + options.ssl = this.options.ssl; + } + geoportal_access_lib__WEBPACK_IMPORTED_MODULE_2__["default"].Services.getAltitude(options); +}; + +/** + * this method is called by event 'click' on 'GPshowMousePositionPicto' tag label + * (cf. this._createShowMousePositionPictoElement), + * and toggles event 'mousemove' on globe. + * + * @method onShowMousePositionClick + * @private + */ +MousePosition.prototype.onShowMousePositionClick = function () { + // checked : true - panel close + // checked : false - panel open + var globe = this.getGlobe(); + this.collapsed = this._showMousePositionContainer.checked; + + // event triggered when opening/closing the panel + // and depending on the mode : desktop or tactile! + if (this._showMousePositionContainer.checked) { + // FIXME handle or not mobile case + if (this._isDesktop) { + globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__["default"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove); + } else { + globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__["default"].EVENTS.CENTER_CHANGED, this.onGlobeMove); + } + } else { + // FIXME handle or not mobile case + if (this._isDesktop) { + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__["default"].EVENTS.MOUSE_MOVE, this._callbacks.mouseMove); + } else { + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_3__["default"].EVENTS.CENTER_CHANGED, this.onGlobeMove); + } + } + + // FIXME + // we handle here the panel display..., but this is not really the good + // place to do it... + this._setElevationPanel(this.options.displayAltitude); + this._setCoordinatesPanel(this.options.displayCoordinates); + if (!this.options.displayCoordinates) { + this._setSettingsPanel(false); + } +}; + +/** + * this method is called by event 'change' on 'GPmousePositionProjectionSystem' + * tag select (cf. this._createMousePositionSettingsElement), + * and selects the system projection. + * + * @method onMousePositionProjectionSystemChange + * @param {Object} e - HTMLElement + * @private + */ +MousePosition.prototype.onMousePositionProjectionSystemChange = function (e) { + var idx = e.target.selectedIndex; // index + var value = e.target.options[idx].value; // crs + + this._setCurrentSystem(value); +}; + +/** + * this method selects the current system projection. + * + * @method _setCurrentSystem + * @param {String} systemCode - inner code (rank in array _projectionSystems) + * @private + */ +MousePosition.prototype._setCurrentSystem = function (systemCode) { + // if we change of system type, we must change the unit type too ! + var type = null; + for (var i = 0; i < this._projectionSystems.length; ++i) { + if (this._projectionSystems[i].code === Number(systemCode)) { + type = this._projectionSystems[i].type; + break; + } + } + if (!type) { + logger.log("system not found in projection systems container"); + return; + } + if (type !== this._currentProjectionType) { + this._setTypeUnitsPanel(type); + } + + // registers the current system + this._currentProjectionSystems = this._projectionSystems[Number(systemCode)]; + + // simulates a movement in tactile mode to update the results + if (!this._isDesktop) { + this.onGlobeMove(); + } +}; + +/** + * this method is called by event 'mouseover' on 'GPmousePositionProjectionSystem' + * tag select (cf. this._createMousePositionSettingsElement), + * and selects the system projection whose geoBBox interstects the current view extent. + * + * @method onMousePositionProjectionSystemMouseOver + * @private + */ +MousePosition.prototype.onMousePositionProjectionSystemMouseOver = function () { + // globe infos + var globe = this.getGlobe(); + if (!globe) { + return; + } + var globeExtent = globe.getExtent(); + + // clear select + var systemList = document.getElementById(this._addUID("GPmousePositionProjectionSystem")); + systemList.innerHTML = ""; + var option; + + // add systems whose extent intersects the globe extent + for (var j = 0; j < this._projectionSystems.length; j++) { + var proj = this._projectionSystems[j]; + if (proj.geoBBox) { + // bboxes intersection test + if (globeExtent.west > proj.geoBBox.right || globeExtent.south > proj.geoBBox.top || globeExtent.east < proj.geoBBox.left || globeExtent.north < proj.geoBBox.bottom) { + if (proj === this._currentProjectionSystems) { + option = document.createElement("option"); + option.value = proj.code; + option.text = proj.label || j; + option.setAttribute("selected", "selected"); + option.setAttribute("disabled", "disabled"); + systemList.appendChild(option); + } + continue; // do not intersect + } + } + + option = document.createElement("option"); + option.value = proj.code; + option.text = proj.label || j; + if (proj === this._currentProjectionSystems) { + option.setAttribute("selected", "selected"); + } + systemList.appendChild(option); + } +}; + +/** + * this method is called by event 'change' on 'GPmousePositionProjectionUnits' + * tag select (cf. this._createMousePositionSettingsElement), + * and selects the units projection. + * + * @method onMousePositionProjectionUnitsChange + * @param {Object} e - HTMLElement + * @private + */ +MousePosition.prototype.onMousePositionProjectionUnitsChange = function (e) { + var idx = e.target.selectedIndex; + var value = e.target.options[idx].value; + this._currentProjectionUnits = value; + + // simulates a movement in tactile mode to update the results + if (!this._isDesktop) { + this.onGlobeMove(); + } +}; +/* harmony default export */ __webpack_exports__["default"] = (MousePosition); + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {module.exports = global["proj4"] = __webpack_require__(33); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32))) + +/***/ }), +/* 32 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +(function (global, factory) { + true ? module.exports = factory() : + undefined; +}(this, (function () { 'use strict'; + + var globals = function(defs) { + defs('EPSG:4326', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"); + defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"); + defs('EPSG:3857', "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"); + + defs.WGS84 = defs['EPSG:4326']; + defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857 + defs.GOOGLE = defs['EPSG:3857']; + defs['EPSG:900913'] = defs['EPSG:3857']; + defs['EPSG:102113'] = defs['EPSG:3857']; + }; + + var PJD_3PARAM = 1; + var PJD_7PARAM = 2; + var PJD_GRIDSHIFT = 3; + var PJD_WGS84 = 4; // WGS84 or equivalent + var PJD_NODATUM = 5; // WGS84 or equivalent + var SRS_WGS84_SEMIMAJOR = 6378137.0; // only used in grid shift transforms + var SRS_WGS84_SEMIMINOR = 6356752.314; // only used in grid shift transforms + var SRS_WGS84_ESQUARED = 0.0066943799901413165; // only used in grid shift transforms + var SEC_TO_RAD = 4.84813681109535993589914102357e-6; + var HALF_PI = Math.PI/2; + // ellipoid pj_set_ell.c + var SIXTH = 0.1666666666666666667; + /* 1/6 */ + var RA4 = 0.04722222222222222222; + /* 17/360 */ + var RA6 = 0.02215608465608465608; + var EPSLN = 1.0e-10; + // you'd think you could use Number.EPSILON above but that makes + // Mollweide get into an infinate loop. + + var D2R = 0.01745329251994329577; + var R2D = 57.29577951308232088; + var FORTPI = Math.PI/4; + var TWO_PI = Math.PI * 2; + // SPI is slightly greater than Math.PI, so values that exceed the -180..180 + // degree range by a tiny amount don't get wrapped. This prevents points that + // have drifted from their original location along the 180th meridian (due to + // floating point error) from changing their sign. + var SPI = 3.14159265359; + + var exports$1 = {}; + exports$1.greenwich = 0.0; //"0dE", + exports$1.lisbon = -9.131906111111; //"9d07'54.862\"W", + exports$1.paris = 2.337229166667; //"2d20'14.025\"E", + exports$1.bogota = -74.080916666667; //"74d04'51.3\"W", + exports$1.madrid = -3.687938888889; //"3d41'16.58\"W", + exports$1.rome = 12.452333333333; //"12d27'8.4\"E", + exports$1.bern = 7.439583333333; //"7d26'22.5\"E", + exports$1.jakarta = 106.807719444444; //"106d48'27.79\"E", + exports$1.ferro = -17.666666666667; //"17d40'W", + exports$1.brussels = 4.367975; //"4d22'4.71\"E", + exports$1.stockholm = 18.058277777778; //"18d3'29.8\"E", + exports$1.athens = 23.7163375; //"23d42'58.815\"E", + exports$1.oslo = 10.722916666667; //"10d43'22.5\"E" + + var units = { + ft: {to_meter: 0.3048}, + 'us-ft': {to_meter: 1200 / 3937} + }; + + var ignoredChar = /[\s_\-\/\(\)]/g; + function match(obj, key) { + if (obj[key]) { + return obj[key]; + } + var keys = Object.keys(obj); + var lkey = key.toLowerCase().replace(ignoredChar, ''); + var i = -1; + var testkey, processedKey; + while (++i < keys.length) { + testkey = keys[i]; + processedKey = testkey.toLowerCase().replace(ignoredChar, ''); + if (processedKey === lkey) { + return obj[testkey]; + } + } + } + + var parseProj = function(defData) { + var self = {}; + var paramObj = defData.split('+').map(function(v) { + return v.trim(); + }).filter(function(a) { + return a; + }).reduce(function(p, a) { + var split = a.split('='); + split.push(true); + p[split[0].toLowerCase()] = split[1]; + return p; + }, {}); + var paramName, paramVal, paramOutname; + var params = { + proj: 'projName', + datum: 'datumCode', + rf: function(v) { + self.rf = parseFloat(v); + }, + lat_0: function(v) { + self.lat0 = v * D2R; + }, + lat_1: function(v) { + self.lat1 = v * D2R; + }, + lat_2: function(v) { + self.lat2 = v * D2R; + }, + lat_ts: function(v) { + self.lat_ts = v * D2R; + }, + lon_0: function(v) { + self.long0 = v * D2R; + }, + lon_1: function(v) { + self.long1 = v * D2R; + }, + lon_2: function(v) { + self.long2 = v * D2R; + }, + alpha: function(v) { + self.alpha = parseFloat(v) * D2R; + }, + gamma: function(v) { + self.rectified_grid_angle = parseFloat(v); + }, + lonc: function(v) { + self.longc = v * D2R; + }, + x_0: function(v) { + self.x0 = parseFloat(v); + }, + y_0: function(v) { + self.y0 = parseFloat(v); + }, + k_0: function(v) { + self.k0 = parseFloat(v); + }, + k: function(v) { + self.k0 = parseFloat(v); + }, + a: function(v) { + self.a = parseFloat(v); + }, + b: function(v) { + self.b = parseFloat(v); + }, + r_a: function() { + self.R_A = true; + }, + zone: function(v) { + self.zone = parseInt(v, 10); + }, + south: function() { + self.utmSouth = true; + }, + towgs84: function(v) { + self.datum_params = v.split(",").map(function(a) { + return parseFloat(a); + }); + }, + to_meter: function(v) { + self.to_meter = parseFloat(v); + }, + units: function(v) { + self.units = v; + var unit = match(units, v); + if (unit) { + self.to_meter = unit.to_meter; + } + }, + from_greenwich: function(v) { + self.from_greenwich = v * D2R; + }, + pm: function(v) { + var pm = match(exports$1, v); + self.from_greenwich = (pm ? pm : parseFloat(v)) * D2R; + }, + nadgrids: function(v) { + if (v === '@null') { + self.datumCode = 'none'; + } + else { + self.nadgrids = v; + } + }, + axis: function(v) { + var legalAxis = "ewnsud"; + if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) { + self.axis = v; + } + }, + approx: function() { + self.approx = true; + } + }; + for (paramName in paramObj) { + paramVal = paramObj[paramName]; + if (paramName in params) { + paramOutname = params[paramName]; + if (typeof paramOutname === 'function') { + paramOutname(paramVal); + } + else { + self[paramOutname] = paramVal; + } + } + else { + self[paramName] = paramVal; + } + } + if(typeof self.datumCode === 'string' && self.datumCode !== "WGS84"){ + self.datumCode = self.datumCode.toLowerCase(); + } + return self; + }; + + var NEUTRAL = 1; + var KEYWORD = 2; + var NUMBER = 3; + var QUOTED = 4; + var AFTERQUOTE = 5; + var ENDED = -1; + var whitespace = /\s/; + var latin = /[A-Za-z]/; + var keyword = /[A-Za-z84]/; + var endThings = /[,\]]/; + var digets = /[\d\.E\-\+]/; + // const ignoredChar = /[\s_\-\/\(\)]/g; + function Parser(text) { + if (typeof text !== 'string') { + throw new Error('not a string'); + } + this.text = text.trim(); + this.level = 0; + this.place = 0; + this.root = null; + this.stack = []; + this.currentObject = null; + this.state = NEUTRAL; + } + Parser.prototype.readCharicter = function() { + var char = this.text[this.place++]; + if (this.state !== QUOTED) { + while (whitespace.test(char)) { + if (this.place >= this.text.length) { + return; + } + char = this.text[this.place++]; + } + } + switch (this.state) { + case NEUTRAL: + return this.neutral(char); + case KEYWORD: + return this.keyword(char) + case QUOTED: + return this.quoted(char); + case AFTERQUOTE: + return this.afterquote(char); + case NUMBER: + return this.number(char); + case ENDED: + return; + } + }; + Parser.prototype.afterquote = function(char) { + if (char === '"') { + this.word += '"'; + this.state = QUOTED; + return; + } + if (endThings.test(char)) { + this.word = this.word.trim(); + this.afterItem(char); + return; + } + throw new Error('havn\'t handled "' +char + '" in afterquote yet, index ' + this.place); + }; + Parser.prototype.afterItem = function(char) { + if (char === ',') { + if (this.word !== null) { + this.currentObject.push(this.word); + } + this.word = null; + this.state = NEUTRAL; + return; + } + if (char === ']') { + this.level--; + if (this.word !== null) { + this.currentObject.push(this.word); + this.word = null; + } + this.state = NEUTRAL; + this.currentObject = this.stack.pop(); + if (!this.currentObject) { + this.state = ENDED; + } + + return; + } + }; + Parser.prototype.number = function(char) { + if (digets.test(char)) { + this.word += char; + return; + } + if (endThings.test(char)) { + this.word = parseFloat(this.word); + this.afterItem(char); + return; + } + throw new Error('havn\'t handled "' +char + '" in number yet, index ' + this.place); + }; + Parser.prototype.quoted = function(char) { + if (char === '"') { + this.state = AFTERQUOTE; + return; + } + this.word += char; + return; + }; + Parser.prototype.keyword = function(char) { + if (keyword.test(char)) { + this.word += char; + return; + } + if (char === '[') { + var newObjects = []; + newObjects.push(this.word); + this.level++; + if (this.root === null) { + this.root = newObjects; + } else { + this.currentObject.push(newObjects); + } + this.stack.push(this.currentObject); + this.currentObject = newObjects; + this.state = NEUTRAL; + return; + } + if (endThings.test(char)) { + this.afterItem(char); + return; + } + throw new Error('havn\'t handled "' +char + '" in keyword yet, index ' + this.place); + }; + Parser.prototype.neutral = function(char) { + if (latin.test(char)) { + this.word = char; + this.state = KEYWORD; + return; + } + if (char === '"') { + this.word = ''; + this.state = QUOTED; + return; + } + if (digets.test(char)) { + this.word = char; + this.state = NUMBER; + return; + } + if (endThings.test(char)) { + this.afterItem(char); + return; + } + throw new Error('havn\'t handled "' +char + '" in neutral yet, index ' + this.place); + }; + Parser.prototype.output = function() { + while (this.place < this.text.length) { + this.readCharicter(); + } + if (this.state === ENDED) { + return this.root; + } + throw new Error('unable to parse string "' +this.text + '". State is ' + this.state); + }; + + function parseString(txt) { + var parser = new Parser(txt); + return parser.output(); + } + + function mapit(obj, key, value) { + if (Array.isArray(key)) { + value.unshift(key); + key = null; + } + var thing = key ? {} : obj; + + var out = value.reduce(function(newObj, item) { + sExpr(item, newObj); + return newObj + }, thing); + if (key) { + obj[key] = out; + } + } + + function sExpr(v, obj) { + if (!Array.isArray(v)) { + obj[v] = true; + return; + } + var key = v.shift(); + if (key === 'PARAMETER') { + key = v.shift(); + } + if (v.length === 1) { + if (Array.isArray(v[0])) { + obj[key] = {}; + sExpr(v[0], obj[key]); + return; + } + obj[key] = v[0]; + return; + } + if (!v.length) { + obj[key] = true; + return; + } + if (key === 'TOWGS84') { + obj[key] = v; + return; + } + if (key === 'AXIS') { + if (!(key in obj)) { + obj[key] = []; + } + obj[key].push(v); + return; + } + if (!Array.isArray(key)) { + obj[key] = {}; + } + + var i; + switch (key) { + case 'UNIT': + case 'PRIMEM': + case 'VERT_DATUM': + obj[key] = { + name: v[0].toLowerCase(), + convert: v[1] + }; + if (v.length === 3) { + sExpr(v[2], obj[key]); + } + return; + case 'SPHEROID': + case 'ELLIPSOID': + obj[key] = { + name: v[0], + a: v[1], + rf: v[2] + }; + if (v.length === 4) { + sExpr(v[3], obj[key]); + } + return; + case 'PROJECTEDCRS': + case 'PROJCRS': + case 'GEOGCS': + case 'GEOCCS': + case 'PROJCS': + case 'LOCAL_CS': + case 'GEODCRS': + case 'GEODETICCRS': + case 'GEODETICDATUM': + case 'EDATUM': + case 'ENGINEERINGDATUM': + case 'VERT_CS': + case 'VERTCRS': + case 'VERTICALCRS': + case 'COMPD_CS': + case 'COMPOUNDCRS': + case 'ENGINEERINGCRS': + case 'ENGCRS': + case 'FITTED_CS': + case 'LOCAL_DATUM': + case 'DATUM': + v[0] = ['name', v[0]]; + mapit(obj, key, v); + return; + default: + i = -1; + while (++i < v.length) { + if (!Array.isArray(v[i])) { + return sExpr(v, obj[key]); + } + } + return mapit(obj, key, v); + } + } + + var D2R$1 = 0.01745329251994329577; + function rename(obj, params) { + var outName = params[0]; + var inName = params[1]; + if (!(outName in obj) && (inName in obj)) { + obj[outName] = obj[inName]; + if (params.length === 3) { + obj[outName] = params[2](obj[outName]); + } + } + } + + function d2r(input) { + return input * D2R$1; + } + + function cleanWKT(wkt) { + if (wkt.type === 'GEOGCS') { + wkt.projName = 'longlat'; + } else if (wkt.type === 'LOCAL_CS') { + wkt.projName = 'identity'; + wkt.local = true; + } else { + if (typeof wkt.PROJECTION === 'object') { + wkt.projName = Object.keys(wkt.PROJECTION)[0]; + } else { + wkt.projName = wkt.PROJECTION; + } + } + if (wkt.AXIS) { + var axisOrder = ''; + for (var i = 0, ii = wkt.AXIS.length; i < ii; ++i) { + var axis = [wkt.AXIS[i][0].toLowerCase(), wkt.AXIS[i][1].toLowerCase()]; + if (axis[0].indexOf('north') !== -1 || ((axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'north')) { + axisOrder += 'n'; + } else if (axis[0].indexOf('south') !== -1 || ((axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'south')) { + axisOrder += 's'; + } else if (axis[0].indexOf('east') !== -1 || ((axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'east')) { + axisOrder += 'e'; + } else if (axis[0].indexOf('west') !== -1 || ((axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'west')) { + axisOrder += 'w'; + } + } + if (axisOrder.length === 2) { + axisOrder += 'u'; + } + if (axisOrder.length === 3) { + wkt.axis = axisOrder; + } + } + if (wkt.UNIT) { + wkt.units = wkt.UNIT.name.toLowerCase(); + if (wkt.units === 'metre') { + wkt.units = 'meter'; + } + if (wkt.UNIT.convert) { + if (wkt.type === 'GEOGCS') { + if (wkt.DATUM && wkt.DATUM.SPHEROID) { + wkt.to_meter = wkt.UNIT.convert*wkt.DATUM.SPHEROID.a; + } + } else { + wkt.to_meter = wkt.UNIT.convert; + } + } + } + var geogcs = wkt.GEOGCS; + if (wkt.type === 'GEOGCS') { + geogcs = wkt; + } + if (geogcs) { + //if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){ + // wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R; + //} + if (geogcs.DATUM) { + wkt.datumCode = geogcs.DATUM.name.toLowerCase(); + } else { + wkt.datumCode = geogcs.name.toLowerCase(); + } + if (wkt.datumCode.slice(0, 2) === 'd_') { + wkt.datumCode = wkt.datumCode.slice(2); + } + if (wkt.datumCode === 'new_zealand_geodetic_datum_1949' || wkt.datumCode === 'new_zealand_1949') { + wkt.datumCode = 'nzgd49'; + } + if (wkt.datumCode === 'wgs_1984' || wkt.datumCode === 'world_geodetic_system_1984') { + if (wkt.PROJECTION === 'Mercator_Auxiliary_Sphere') { + wkt.sphere = true; + } + wkt.datumCode = 'wgs84'; + } + if (wkt.datumCode.slice(-6) === '_ferro') { + wkt.datumCode = wkt.datumCode.slice(0, - 6); + } + if (wkt.datumCode.slice(-8) === '_jakarta') { + wkt.datumCode = wkt.datumCode.slice(0, - 8); + } + if (~wkt.datumCode.indexOf('belge')) { + wkt.datumCode = 'rnb72'; + } + if (geogcs.DATUM && geogcs.DATUM.SPHEROID) { + wkt.ellps = geogcs.DATUM.SPHEROID.name.replace('_19', '').replace(/[Cc]larke\_18/, 'clrk'); + if (wkt.ellps.toLowerCase().slice(0, 13) === 'international') { + wkt.ellps = 'intl'; + } + + wkt.a = geogcs.DATUM.SPHEROID.a; + wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10); + } + + if (geogcs.DATUM && geogcs.DATUM.TOWGS84) { + wkt.datum_params = geogcs.DATUM.TOWGS84; + } + if (~wkt.datumCode.indexOf('osgb_1936')) { + wkt.datumCode = 'osgb36'; + } + if (~wkt.datumCode.indexOf('osni_1952')) { + wkt.datumCode = 'osni52'; + } + if (~wkt.datumCode.indexOf('tm65') + || ~wkt.datumCode.indexOf('geodetic_datum_of_1965')) { + wkt.datumCode = 'ire65'; + } + if (wkt.datumCode === 'ch1903+') { + wkt.datumCode = 'ch1903'; + } + if (~wkt.datumCode.indexOf('israel')) { + wkt.datumCode = 'isr93'; + } + } + if (wkt.b && !isFinite(wkt.b)) { + wkt.b = wkt.a; + } + + function toMeter(input) { + var ratio = wkt.to_meter || 1; + return input * ratio; + } + var renamer = function(a) { + return rename(wkt, a); + }; + var list = [ + ['standard_parallel_1', 'Standard_Parallel_1'], + ['standard_parallel_1', 'Latitude of 1st standard parallel'], + ['standard_parallel_2', 'Standard_Parallel_2'], + ['standard_parallel_2', 'Latitude of 2nd standard parallel'], + ['false_easting', 'False_Easting'], + ['false_easting', 'False easting'], + ['false-easting', 'Easting at false origin'], + ['false_northing', 'False_Northing'], + ['false_northing', 'False northing'], + ['false_northing', 'Northing at false origin'], + ['central_meridian', 'Central_Meridian'], + ['central_meridian', 'Longitude of natural origin'], + ['central_meridian', 'Longitude of false origin'], + ['latitude_of_origin', 'Latitude_Of_Origin'], + ['latitude_of_origin', 'Central_Parallel'], + ['latitude_of_origin', 'Latitude of natural origin'], + ['latitude_of_origin', 'Latitude of false origin'], + ['scale_factor', 'Scale_Factor'], + ['k0', 'scale_factor'], + ['latitude_of_center', 'Latitude_Of_Center'], + ['latitude_of_center', 'Latitude_of_center'], + ['lat0', 'latitude_of_center', d2r], + ['longitude_of_center', 'Longitude_Of_Center'], + ['longitude_of_center', 'Longitude_of_center'], + ['longc', 'longitude_of_center', d2r], + ['x0', 'false_easting', toMeter], + ['y0', 'false_northing', toMeter], + ['long0', 'central_meridian', d2r], + ['lat0', 'latitude_of_origin', d2r], + ['lat0', 'standard_parallel_1', d2r], + ['lat1', 'standard_parallel_1', d2r], + ['lat2', 'standard_parallel_2', d2r], + ['azimuth', 'Azimuth'], + ['alpha', 'azimuth', d2r], + ['srsCode', 'name'] + ]; + list.forEach(renamer); + if (!wkt.long0 && wkt.longc && (wkt.projName === 'Albers_Conic_Equal_Area' || wkt.projName === 'Lambert_Azimuthal_Equal_Area')) { + wkt.long0 = wkt.longc; + } + if (!wkt.lat_ts && wkt.lat1 && (wkt.projName === 'Stereographic_South_Pole' || wkt.projName === 'Polar Stereographic (variant B)')) { + wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90); + wkt.lat_ts = wkt.lat1; + } + } + var wkt = function(wkt) { + var lisp = parseString(wkt); + var type = lisp.shift(); + var name = lisp.shift(); + lisp.unshift(['name', name]); + lisp.unshift(['type', type]); + var obj = {}; + sExpr(lisp, obj); + cleanWKT(obj); + return obj; + }; + + function defs(name) { + /*global console*/ + var that = this; + if (arguments.length === 2) { + var def = arguments[1]; + if (typeof def === 'string') { + if (def.charAt(0) === '+') { + defs[name] = parseProj(arguments[1]); + } + else { + defs[name] = wkt(arguments[1]); + } + } else { + defs[name] = def; + } + } + else if (arguments.length === 1) { + if (Array.isArray(name)) { + return name.map(function(v) { + if (Array.isArray(v)) { + defs.apply(that, v); + } + else { + defs(v); + } + }); + } + else if (typeof name === 'string') { + if (name in defs) { + return defs[name]; + } + } + else if ('EPSG' in name) { + defs['EPSG:' + name.EPSG] = name; + } + else if ('ESRI' in name) { + defs['ESRI:' + name.ESRI] = name; + } + else if ('IAU2000' in name) { + defs['IAU2000:' + name.IAU2000] = name; + } + else { + console.log(name); + } + return; + } + + + } + globals(defs); + + function testObj(code){ + return typeof code === 'string'; + } + function testDef(code){ + return code in defs; + } + var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS','GEOCCS','PROJCS','LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS']; + function testWKT(code){ + return codeWords.some(function (word) { + return code.indexOf(word) > -1; + }); + } + var codes = ['3857', '900913', '3785', '102113']; + function checkMercator(item) { + var auth = match(item, 'authority'); + if (!auth) { + return; + } + var code = match(auth, 'epsg'); + return code && codes.indexOf(code) > -1; + } + function checkProjStr(item) { + var ext = match(item, 'extension'); + if (!ext) { + return; + } + return match(ext, 'proj4'); + } + function testProj(code){ + return code[0] === '+'; + } + function parse(code){ + if (testObj(code)) { + //check to see if this is a WKT string + if (testDef(code)) { + return defs[code]; + } + if (testWKT(code)) { + var out = wkt(code); + // test of spetial case, due to this being a very common and often malformed + if (checkMercator(out)) { + return defs['EPSG:3857']; + } + var maybeProjStr = checkProjStr(out); + if (maybeProjStr) { + return parseProj(maybeProjStr); + } + return out; + } + if (testProj(code)) { + return parseProj(code); + } + }else{ + return code; + } + } + + var extend = function(destination, source) { + destination = destination || {}; + var value, property; + if (!source) { + return destination; + } + for (property in source) { + value = source[property]; + if (value !== undefined) { + destination[property] = value; + } + } + return destination; + }; + + var msfnz = function(eccent, sinphi, cosphi) { + var con = eccent * sinphi; + return cosphi / (Math.sqrt(1 - con * con)); + }; + + var sign = function(x) { + return x<0 ? -1 : 1; + }; + + var adjust_lon = function(x) { + return (Math.abs(x) <= SPI) ? x : (x - (sign(x) * TWO_PI)); + }; + + var tsfnz = function(eccent, phi, sinphi) { + var con = eccent * sinphi; + var com = 0.5 * eccent; + con = Math.pow(((1 - con) / (1 + con)), com); + return (Math.tan(0.5 * (HALF_PI - phi)) / con); + }; + + var phi2z = function(eccent, ts) { + var eccnth = 0.5 * eccent; + var con, dphi; + var phi = HALF_PI - 2 * Math.atan(ts); + for (var i = 0; i <= 15; i++) { + con = eccent * Math.sin(phi); + dphi = HALF_PI - 2 * Math.atan(ts * (Math.pow(((1 - con) / (1 + con)), eccnth))) - phi; + phi += dphi; + if (Math.abs(dphi) <= 0.0000000001) { + return phi; + } + } + //console.log("phi2z has NoConvergence"); + return -9999; + }; + + function init() { + var con = this.b / this.a; + this.es = 1 - con * con; + if(!('x0' in this)){ + this.x0 = 0; + } + if(!('y0' in this)){ + this.y0 = 0; + } + this.e = Math.sqrt(this.es); + if (this.lat_ts) { + if (this.sphere) { + this.k0 = Math.cos(this.lat_ts); + } + else { + this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)); + } + } + else { + if (!this.k0) { + if (this.k) { + this.k0 = this.k; + } + else { + this.k0 = 1; + } + } + } + } + + /* Mercator forward equations--mapping lat,long to x,y + --------------------------------------------------*/ + + function forward(p) { + var lon = p.x; + var lat = p.y; + // convert to radians + if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) { + return null; + } + + var x, y; + if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) { + return null; + } + else { + if (this.sphere) { + x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0); + y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat)); + } + else { + var sinphi = Math.sin(lat); + var ts = tsfnz(this.e, lat, sinphi); + x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0); + y = this.y0 - this.a * this.k0 * Math.log(ts); + } + p.x = x; + p.y = y; + return p; + } + } + + /* Mercator inverse equations--mapping x,y to lat/long + --------------------------------------------------*/ + function inverse(p) { + + var x = p.x - this.x0; + var y = p.y - this.y0; + var lon, lat; + + if (this.sphere) { + lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0))); + } + else { + var ts = Math.exp(-y / (this.a * this.k0)); + lat = phi2z(this.e, ts); + if (lat === -9999) { + return null; + } + } + lon = adjust_lon(this.long0 + x / (this.a * this.k0)); + + p.x = lon; + p.y = lat; + return p; + } + + var names$1 = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"]; + var merc = { + init: init, + forward: forward, + inverse: inverse, + names: names$1 + }; + + function init$1() { + //no-op for longlat + } + + function identity(pt) { + return pt; + } + var names$2 = ["longlat", "identity"]; + var longlat = { + init: init$1, + forward: identity, + inverse: identity, + names: names$2 + }; + + var projs = [merc, longlat]; + var names = {}; + var projStore = []; + + function add(proj, i) { + var len = projStore.length; + if (!proj.names) { + console.log(i); + return true; + } + projStore[len] = proj; + proj.names.forEach(function(n) { + names[n.toLowerCase()] = len; + }); + return this; + } + + function get(name) { + if (!name) { + return false; + } + var n = name.toLowerCase(); + if (typeof names[n] !== 'undefined' && projStore[names[n]]) { + return projStore[names[n]]; + } + } + + function start() { + projs.forEach(add); + } + var projections = { + start: start, + add: add, + get: get + }; + + var exports$2 = {}; + exports$2.MERIT = { + a: 6378137.0, + rf: 298.257, + ellipseName: "MERIT 1983" + }; + + exports$2.SGS85 = { + a: 6378136.0, + rf: 298.257, + ellipseName: "Soviet Geodetic System 85" + }; + + exports$2.GRS80 = { + a: 6378137.0, + rf: 298.257222101, + ellipseName: "GRS 1980(IUGG, 1980)" + }; + + exports$2.IAU76 = { + a: 6378140.0, + rf: 298.257, + ellipseName: "IAU 1976" + }; + + exports$2.airy = { + a: 6377563.396, + b: 6356256.910, + ellipseName: "Airy 1830" + }; + + exports$2.APL4 = { + a: 6378137, + rf: 298.25, + ellipseName: "Appl. Physics. 1965" + }; + + exports$2.NWL9D = { + a: 6378145.0, + rf: 298.25, + ellipseName: "Naval Weapons Lab., 1965" + }; + + exports$2.mod_airy = { + a: 6377340.189, + b: 6356034.446, + ellipseName: "Modified Airy" + }; + + exports$2.andrae = { + a: 6377104.43, + rf: 300.0, + ellipseName: "Andrae 1876 (Den., Iclnd.)" + }; + + exports$2.aust_SA = { + a: 6378160.0, + rf: 298.25, + ellipseName: "Australian Natl & S. Amer. 1969" + }; + + exports$2.GRS67 = { + a: 6378160.0, + rf: 298.2471674270, + ellipseName: "GRS 67(IUGG 1967)" + }; + + exports$2.bessel = { + a: 6377397.155, + rf: 299.1528128, + ellipseName: "Bessel 1841" + }; + + exports$2.bess_nam = { + a: 6377483.865, + rf: 299.1528128, + ellipseName: "Bessel 1841 (Namibia)" + }; + + exports$2.clrk66 = { + a: 6378206.4, + b: 6356583.8, + ellipseName: "Clarke 1866" + }; + + exports$2.clrk80 = { + a: 6378249.145, + rf: 293.4663, + ellipseName: "Clarke 1880 mod." + }; + + exports$2.clrk58 = { + a: 6378293.645208759, + rf: 294.2606763692654, + ellipseName: "Clarke 1858" + }; + + exports$2.CPM = { + a: 6375738.7, + rf: 334.29, + ellipseName: "Comm. des Poids et Mesures 1799" + }; + + exports$2.delmbr = { + a: 6376428.0, + rf: 311.5, + ellipseName: "Delambre 1810 (Belgium)" + }; + + exports$2.engelis = { + a: 6378136.05, + rf: 298.2566, + ellipseName: "Engelis 1985" + }; + + exports$2.evrst30 = { + a: 6377276.345, + rf: 300.8017, + ellipseName: "Everest 1830" + }; + + exports$2.evrst48 = { + a: 6377304.063, + rf: 300.8017, + ellipseName: "Everest 1948" + }; + + exports$2.evrst56 = { + a: 6377301.243, + rf: 300.8017, + ellipseName: "Everest 1956" + }; + + exports$2.evrst69 = { + a: 6377295.664, + rf: 300.8017, + ellipseName: "Everest 1969" + }; + + exports$2.evrstSS = { + a: 6377298.556, + rf: 300.8017, + ellipseName: "Everest (Sabah & Sarawak)" + }; + + exports$2.fschr60 = { + a: 6378166.0, + rf: 298.3, + ellipseName: "Fischer (Mercury Datum) 1960" + }; + + exports$2.fschr60m = { + a: 6378155.0, + rf: 298.3, + ellipseName: "Fischer 1960" + }; + + exports$2.fschr68 = { + a: 6378150.0, + rf: 298.3, + ellipseName: "Fischer 1968" + }; + + exports$2.helmert = { + a: 6378200.0, + rf: 298.3, + ellipseName: "Helmert 1906" + }; + + exports$2.hough = { + a: 6378270.0, + rf: 297.0, + ellipseName: "Hough" + }; + + exports$2.intl = { + a: 6378388.0, + rf: 297.0, + ellipseName: "International 1909 (Hayford)" + }; + + exports$2.kaula = { + a: 6378163.0, + rf: 298.24, + ellipseName: "Kaula 1961" + }; + + exports$2.lerch = { + a: 6378139.0, + rf: 298.257, + ellipseName: "Lerch 1979" + }; + + exports$2.mprts = { + a: 6397300.0, + rf: 191.0, + ellipseName: "Maupertius 1738" + }; + + exports$2.new_intl = { + a: 6378157.5, + b: 6356772.2, + ellipseName: "New International 1967" + }; + + exports$2.plessis = { + a: 6376523.0, + rf: 6355863.0, + ellipseName: "Plessis 1817 (France)" + }; + + exports$2.krass = { + a: 6378245.0, + rf: 298.3, + ellipseName: "Krassovsky, 1942" + }; + + exports$2.SEasia = { + a: 6378155.0, + b: 6356773.3205, + ellipseName: "Southeast Asia" + }; + + exports$2.walbeck = { + a: 6376896.0, + b: 6355834.8467, + ellipseName: "Walbeck" + }; + + exports$2.WGS60 = { + a: 6378165.0, + rf: 298.3, + ellipseName: "WGS 60" + }; + + exports$2.WGS66 = { + a: 6378145.0, + rf: 298.25, + ellipseName: "WGS 66" + }; + + exports$2.WGS7 = { + a: 6378135.0, + rf: 298.26, + ellipseName: "WGS 72" + }; + + var WGS84 = exports$2.WGS84 = { + a: 6378137.0, + rf: 298.257223563, + ellipseName: "WGS 84" + }; + + exports$2.sphere = { + a: 6370997.0, + b: 6370997.0, + ellipseName: "Normal Sphere (r=6370997)" + }; + + function eccentricity(a, b, rf, R_A) { + var a2 = a * a; // used in geocentric + var b2 = b * b; // used in geocentric + var es = (a2 - b2) / a2; // e ^ 2 + var e = 0; + if (R_A) { + a *= 1 - es * (SIXTH + es * (RA4 + es * RA6)); + a2 = a * a; + es = 0; + } else { + e = Math.sqrt(es); // eccentricity + } + var ep2 = (a2 - b2) / b2; // used in geocentric + return { + es: es, + e: e, + ep2: ep2 + }; + } + function sphere(a, b, rf, ellps, sphere) { + if (!a) { // do we have an ellipsoid? + var ellipse = match(exports$2, ellps); + if (!ellipse) { + ellipse = WGS84; + } + a = ellipse.a; + b = ellipse.b; + rf = ellipse.rf; + } + + if (rf && !b) { + b = (1.0 - 1.0 / rf) * a; + } + if (rf === 0 || Math.abs(a - b) < EPSLN) { + sphere = true; + b = a; + } + return { + a: a, + b: b, + rf: rf, + sphere: sphere + }; + } + + var exports$3 = {}; + exports$3.wgs84 = { + towgs84: "0,0,0", + ellipse: "WGS84", + datumName: "WGS84" + }; + + exports$3.ch1903 = { + towgs84: "674.374,15.056,405.346", + ellipse: "bessel", + datumName: "swiss" + }; + + exports$3.ggrs87 = { + towgs84: "-199.87,74.79,246.62", + ellipse: "GRS80", + datumName: "Greek_Geodetic_Reference_System_1987" + }; + + exports$3.nad83 = { + towgs84: "0,0,0", + ellipse: "GRS80", + datumName: "North_American_Datum_1983" + }; + + exports$3.nad27 = { + nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat", + ellipse: "clrk66", + datumName: "North_American_Datum_1927" + }; + + exports$3.potsdam = { + towgs84: "598.1,73.7,418.2,0.202,0.045,-2.455,6.7", + ellipse: "bessel", + datumName: "Potsdam Rauenberg 1950 DHDN" + }; + + exports$3.carthage = { + towgs84: "-263.0,6.0,431.0", + ellipse: "clark80", + datumName: "Carthage 1934 Tunisia" + }; + + exports$3.hermannskogel = { + towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232", + ellipse: "bessel", + datumName: "Hermannskogel" + }; + + exports$3.osni52 = { + towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", + ellipse: "airy", + datumName: "Irish National" + }; + + exports$3.ire65 = { + towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", + ellipse: "mod_airy", + datumName: "Ireland 1965" + }; + + exports$3.rassadiran = { + towgs84: "-133.63,-157.5,-158.62", + ellipse: "intl", + datumName: "Rassadiran" + }; + + exports$3.nzgd49 = { + towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", + ellipse: "intl", + datumName: "New Zealand Geodetic Datum 1949" + }; + + exports$3.osgb36 = { + towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", + ellipse: "airy", + datumName: "Airy 1830" + }; + + exports$3.s_jtsk = { + towgs84: "589,76,480", + ellipse: 'bessel', + datumName: 'S-JTSK (Ferro)' + }; + + exports$3.beduaram = { + towgs84: '-106,-87,188', + ellipse: 'clrk80', + datumName: 'Beduaram' + }; + + exports$3.gunung_segara = { + towgs84: '-403,684,41', + ellipse: 'bessel', + datumName: 'Gunung Segara Jakarta' + }; + + exports$3.rnb72 = { + towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1", + ellipse: "intl", + datumName: "Reseau National Belge 1972" + }; + + function datum(datumCode, datum_params, a, b, es, ep2, nadgrids) { + var out = {}; + + if (datumCode === undefined || datumCode === 'none') { + out.datum_type = PJD_NODATUM; + } else { + out.datum_type = PJD_WGS84; + } + + if (datum_params) { + out.datum_params = datum_params.map(parseFloat); + if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) { + out.datum_type = PJD_3PARAM; + } + if (out.datum_params.length > 3) { + if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) { + out.datum_type = PJD_7PARAM; + out.datum_params[3] *= SEC_TO_RAD; + out.datum_params[4] *= SEC_TO_RAD; + out.datum_params[5] *= SEC_TO_RAD; + out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0; + } + } + } + + if (nadgrids) { + out.datum_type = PJD_GRIDSHIFT; + out.grids = nadgrids; + } + out.a = a; //datum object also uses these values + out.b = b; + out.es = es; + out.ep2 = ep2; + return out; + } + + /** + * Resources for details of NTv2 file formats: + * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf + * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm + */ + + var loadedNadgrids = {}; + + /** + * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=. Pass the NTv2 file + * as an ArrayBuffer. + */ + function nadgrid(key, data) { + var view = new DataView(data); + var isLittleEndian = detectLittleEndian(view); + var header = readHeader(view, isLittleEndian); + if (header.nSubgrids > 1) { + console.log('Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored'); + } + var subgrids = readSubgrids(view, header, isLittleEndian); + var nadgrid = {header: header, subgrids: subgrids}; + loadedNadgrids[key] = nadgrid; + return nadgrid; + } + + /** + * Given a proj4 value for nadgrids, return an array of loaded grids + */ + function getNadgrids(nadgrids) { + // Format details: http://proj.maptools.org/gen_parms.html + if (nadgrids === undefined) { return null; } + var grids = nadgrids.split(','); + return grids.map(parseNadgridString); + } + + function parseNadgridString(value) { + if (value.length === 0) { + return null; + } + var optional = value[0] === '@'; + if (optional) { + value = value.slice(1); + } + if (value === 'null') { + return {name: 'null', mandatory: !optional, grid: null, isNull: true}; + } + return { + name: value, + mandatory: !optional, + grid: loadedNadgrids[value] || null, + isNull: false + }; + } + + function secondsToRadians(seconds) { + return (seconds / 3600) * Math.PI / 180; + } + + function detectLittleEndian(view) { + var nFields = view.getInt32(8, false); + if (nFields === 11) { + return false; + } + nFields = view.getInt32(8, true); + if (nFields !== 11) { + console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian'); + } + return true; + } + + function readHeader(view, isLittleEndian) { + return { + nFields: view.getInt32(8, isLittleEndian), + nSubgridFields: view.getInt32(24, isLittleEndian), + nSubgrids: view.getInt32(40, isLittleEndian), + shiftType: decodeString(view, 56, 56 + 8).trim(), + fromSemiMajorAxis: view.getFloat64(120, isLittleEndian), + fromSemiMinorAxis: view.getFloat64(136, isLittleEndian), + toSemiMajorAxis: view.getFloat64(152, isLittleEndian), + toSemiMinorAxis: view.getFloat64(168, isLittleEndian), + }; + } + + function decodeString(view, start, end) { + return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end))); + } + + function readSubgrids(view, header, isLittleEndian) { + var gridOffset = 176; + var grids = []; + for (var i = 0; i < header.nSubgrids; i++) { + var subHeader = readGridHeader(view, gridOffset, isLittleEndian); + var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian); + var lngColumnCount = Math.round( + 1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval); + var latColumnCount = Math.round( + 1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval); + // Proj4 operates on radians whereas the coordinates are in seconds in the grid + grids.push({ + ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)], + del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)], + lim: [lngColumnCount, latColumnCount], + count: subHeader.gridNodeCount, + cvs: mapNodes(nodes) + }); + } + return grids; + } + + function mapNodes(nodes) { + return nodes.map(function (r) {return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];}); + } + + function readGridHeader(view, offset, isLittleEndian) { + return { + name: decodeString(view, offset + 8, offset + 16).trim(), + parent: decodeString(view, offset + 24, offset + 24 + 8).trim(), + lowerLatitude: view.getFloat64(offset + 72, isLittleEndian), + upperLatitude: view.getFloat64(offset + 88, isLittleEndian), + lowerLongitude: view.getFloat64(offset + 104, isLittleEndian), + upperLongitude: view.getFloat64(offset + 120, isLittleEndian), + latitudeInterval: view.getFloat64(offset + 136, isLittleEndian), + longitudeInterval: view.getFloat64(offset + 152, isLittleEndian), + gridNodeCount: view.getInt32(offset + 168, isLittleEndian) + }; + } + + function readGridNodes(view, offset, gridHeader, isLittleEndian) { + var nodesOffset = offset + 176; + var gridRecordLength = 16; + var gridShiftRecords = []; + for (var i = 0; i < gridHeader.gridNodeCount; i++) { + var record = { + latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian), + longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian), + latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian), + longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian), + }; + gridShiftRecords.push(record); + } + return gridShiftRecords; + } + + function Projection(srsCode,callback) { + if (!(this instanceof Projection)) { + return new Projection(srsCode); + } + callback = callback || function(error){ + if(error){ + throw error; + } + }; + var json = parse(srsCode); + if(typeof json !== 'object'){ + callback(srsCode); + return; + } + var ourProj = Projection.projections.get(json.projName); + if(!ourProj){ + callback(srsCode); + return; + } + if (json.datumCode && json.datumCode !== 'none') { + var datumDef = match(exports$3, json.datumCode); + if (datumDef) { + json.datum_params = json.datum_params || (datumDef.towgs84 ? datumDef.towgs84.split(',') : null); + json.ellps = datumDef.ellipse; + json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode; + } + } + json.k0 = json.k0 || 1.0; + json.axis = json.axis || 'enu'; + json.ellps = json.ellps || 'wgs84'; + json.lat1 = json.lat1 || json.lat0; // Lambert_Conformal_Conic_1SP, for example, needs this + + var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere); + var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A); + var nadgrids = getNadgrids(json.nadgrids); + var datumObj = json.datum || datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2, + nadgrids); + + extend(this, json); // transfer everything over from the projection because we don't know what we'll need + extend(this, ourProj); // transfer all the methods from the projection + + // copy the 4 things over we calulated in deriveConstants.sphere + this.a = sphere_.a; + this.b = sphere_.b; + this.rf = sphere_.rf; + this.sphere = sphere_.sphere; + + // copy the 3 things we calculated in deriveConstants.eccentricity + this.es = ecc.es; + this.e = ecc.e; + this.ep2 = ecc.ep2; + + // add in the datum object + this.datum = datumObj; + + // init the projection + this.init(); + + // legecy callback from back in the day when it went to spatialreference.org + callback(null, this); + + } + Projection.projections = projections; + Projection.projections.start(); + + 'use strict'; + function compareDatums(source, dest) { + if (source.datum_type !== dest.datum_type) { + return false; // false, datums are not equal + } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) { + // the tolerance for es is to ensure that GRS80 and WGS84 + // are considered identical + return false; + } else if (source.datum_type === PJD_3PARAM) { + return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2]); + } else if (source.datum_type === PJD_7PARAM) { + return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6]); + } else { + return true; // datums are equal + } + } // cs_compare_datums() + + /* + * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates + * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z), + * according to the current ellipsoid parameters. + * + * Latitude : Geodetic latitude in radians (input) + * Longitude : Geodetic longitude in radians (input) + * Height : Geodetic height, in meters (input) + * X : Calculated Geocentric X coordinate, in meters (output) + * Y : Calculated Geocentric Y coordinate, in meters (output) + * Z : Calculated Geocentric Z coordinate, in meters (output) + * + */ + function geodeticToGeocentric(p, es, a) { + var Longitude = p.x; + var Latitude = p.y; + var Height = p.z ? p.z : 0; //Z value not always supplied + + var Rn; /* Earth radius at location */ + var Sin_Lat; /* Math.sin(Latitude) */ + var Sin2_Lat; /* Square of Math.sin(Latitude) */ + var Cos_Lat; /* Math.cos(Latitude) */ + + /* + ** Don't blow up if Latitude is just a little out of the value + ** range as it may just be a rounding issue. Also removed longitude + ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001. + */ + if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) { + Latitude = -HALF_PI; + } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) { + Latitude = HALF_PI; + } else if (Latitude < -HALF_PI) { + /* Latitude out of range */ + //..reportError('geocent:lat out of range:' + Latitude); + return { x: -Infinity, y: -Infinity, z: p.z }; + } else if (Latitude > HALF_PI) { + /* Latitude out of range */ + return { x: Infinity, y: Infinity, z: p.z }; + } + + if (Longitude > Math.PI) { + Longitude -= (2 * Math.PI); + } + Sin_Lat = Math.sin(Latitude); + Cos_Lat = Math.cos(Latitude); + Sin2_Lat = Sin_Lat * Sin_Lat; + Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat)); + return { + x: (Rn + Height) * Cos_Lat * Math.cos(Longitude), + y: (Rn + Height) * Cos_Lat * Math.sin(Longitude), + z: ((Rn * (1 - es)) + Height) * Sin_Lat + }; + } // cs_geodetic_to_geocentric() + + function geocentricToGeodetic(p, es, a, b) { + /* local defintions and variables */ + /* end-criterium of loop, accuracy of sin(Latitude) */ + var genau = 1e-12; + var genau2 = (genau * genau); + var maxiter = 30; + + var P; /* distance between semi-minor axis and location */ + var RR; /* distance between center and location */ + var CT; /* sin of geocentric latitude */ + var ST; /* cos of geocentric latitude */ + var RX; + var RK; + var RN; /* Earth radius at location */ + var CPHI0; /* cos of start or old geodetic latitude in iterations */ + var SPHI0; /* sin of start or old geodetic latitude in iterations */ + var CPHI; /* cos of searched geodetic latitude */ + var SPHI; /* sin of searched geodetic latitude */ + var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */ + var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */ + + var X = p.x; + var Y = p.y; + var Z = p.z ? p.z : 0.0; //Z value not always supplied + var Longitude; + var Latitude; + var Height; + + P = Math.sqrt(X * X + Y * Y); + RR = Math.sqrt(X * X + Y * Y + Z * Z); + + /* special cases for latitude and longitude */ + if (P / a < genau) { + + /* special case, if P=0. (X=0., Y=0.) */ + Longitude = 0.0; + + /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis + * of ellipsoid (=center of mass), Latitude becomes PI/2 */ + if (RR / a < genau) { + Latitude = HALF_PI; + Height = -b; + return { + x: p.x, + y: p.y, + z: p.z + }; + } + } else { + /* ellipsoidal (geodetic) longitude + * interval: -PI < Longitude <= +PI */ + Longitude = Math.atan2(Y, X); + } + + /* -------------------------------------------------------------- + * Following iterative algorithm was developped by + * "Institut for Erdmessung", University of Hannover, July 1988. + * Internet: www.ife.uni-hannover.de + * Iterative computation of CPHI,SPHI and Height. + * Iteration of CPHI and SPHI to 10**-12 radian resp. + * 2*10**-7 arcsec. + * -------------------------------------------------------------- + */ + CT = Z / RR; + ST = P / RR; + RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST); + CPHI0 = ST * (1.0 - es) * RX; + SPHI0 = CT * RX; + iter = 0; + + /* loop to find sin(Latitude) resp. Latitude + * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */ + do { + iter++; + RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0); + + /* ellipsoidal (geodetic) height */ + Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0); + + RK = es * RN / (RN + Height); + RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST); + CPHI = ST * (1.0 - RK) * RX; + SPHI = CT * RX; + SDPHI = SPHI * CPHI0 - CPHI * SPHI0; + CPHI0 = CPHI; + SPHI0 = SPHI; + } + while (SDPHI * SDPHI > genau2 && iter < maxiter); + + /* ellipsoidal (geodetic) latitude */ + Latitude = Math.atan(SPHI / Math.abs(CPHI)); + return { + x: Longitude, + y: Latitude, + z: Height + }; + } // cs_geocentric_to_geodetic() + + /****************************************************************/ + // pj_geocentic_to_wgs84( p ) + // p = point to transform in geocentric coordinates (x,y,z) + + + /** point object, nothing fancy, just allows values to be + passed back and forth by reference rather than by value. + Other point classes may be used as long as they have + x and y properties, which will get modified in the transform method. + */ + function geocentricToWgs84(p, datum_type, datum_params) { + + if (datum_type === PJD_3PARAM) { + // if( x[io] === HUGE_VAL ) + // continue; + return { + x: p.x + datum_params[0], + y: p.y + datum_params[1], + z: p.z + datum_params[2], + }; + } else if (datum_type === PJD_7PARAM) { + var Dx_BF = datum_params[0]; + var Dy_BF = datum_params[1]; + var Dz_BF = datum_params[2]; + var Rx_BF = datum_params[3]; + var Ry_BF = datum_params[4]; + var Rz_BF = datum_params[5]; + var M_BF = datum_params[6]; + // if( x[io] === HUGE_VAL ) + // continue; + return { + x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF, + y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF, + z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF + }; + } + } // cs_geocentric_to_wgs84 + + /****************************************************************/ + // pj_geocentic_from_wgs84() + // coordinate system definition, + // point to transform in geocentric coordinates (x,y,z) + function geocentricFromWgs84(p, datum_type, datum_params) { + + if (datum_type === PJD_3PARAM) { + //if( x[io] === HUGE_VAL ) + // continue; + return { + x: p.x - datum_params[0], + y: p.y - datum_params[1], + z: p.z - datum_params[2], + }; + + } else if (datum_type === PJD_7PARAM) { + var Dx_BF = datum_params[0]; + var Dy_BF = datum_params[1]; + var Dz_BF = datum_params[2]; + var Rx_BF = datum_params[3]; + var Ry_BF = datum_params[4]; + var Rz_BF = datum_params[5]; + var M_BF = datum_params[6]; + var x_tmp = (p.x - Dx_BF) / M_BF; + var y_tmp = (p.y - Dy_BF) / M_BF; + var z_tmp = (p.z - Dz_BF) / M_BF; + //if( x[io] === HUGE_VAL ) + // continue; + + return { + x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp, + y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp, + z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp + }; + } //cs_geocentric_from_wgs84() + } + + function checkParams(type) { + return (type === PJD_3PARAM || type === PJD_7PARAM); + } + + var datum_transform = function(source, dest, point) { + // Short cut if the datums are identical. + if (compareDatums(source, dest)) { + return point; // in this case, zero is sucess, + // whereas cs_compare_datums returns 1 to indicate TRUE + // confusing, should fix this + } + + // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest + if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) { + return point; + } + + // If this datum requires grid shifts, then apply it to geodetic coordinates. + var source_a = source.a; + var source_es = source.es; + if (source.datum_type === PJD_GRIDSHIFT) { + var gridShiftCode = applyGridShift(source, false, point); + if (gridShiftCode !== 0) { + return undefined; + } + source_a = SRS_WGS84_SEMIMAJOR; + source_es = SRS_WGS84_ESQUARED; + } + + var dest_a = dest.a; + var dest_b = dest.b; + var dest_es = dest.es; + if (dest.datum_type === PJD_GRIDSHIFT) { + dest_a = SRS_WGS84_SEMIMAJOR; + dest_b = SRS_WGS84_SEMIMINOR; + dest_es = SRS_WGS84_ESQUARED; + } + + // Do we need to go through geocentric coordinates? + if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) { + return point; + } + + // Convert to geocentric coordinates. + point = geodeticToGeocentric(point, source_es, source_a); + // Convert between datums + if (checkParams(source.datum_type)) { + point = geocentricToWgs84(point, source.datum_type, source.datum_params); + } + if (checkParams(dest.datum_type)) { + point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params); + } + point = geocentricToGeodetic(point, dest_es, dest_a, dest_b); + + if (dest.datum_type === PJD_GRIDSHIFT) { + var destGridShiftResult = applyGridShift(dest, true, point); + if (destGridShiftResult !== 0) { + return undefined; + } + } + + return point; + }; + + function applyGridShift(source, inverse, point) { + if (source.grids === null || source.grids.length === 0) { + console.log('Grid shift grids not found'); + return -1; + } + var input = {x: -point.x, y: point.y}; + var output = {x: Number.NaN, y: Number.NaN}; + var attemptedGrids = []; + for (var i = 0; i < source.grids.length; i++) { + var grid = source.grids[i]; + attemptedGrids.push(grid.name); + if (grid.isNull) { + output = input; + break; + } + if (grid.grid === null) { + if (grid.mandatory) { + console.log("Unable to find mandatory grid '" + grid.name + "'"); + return -1; + } + continue; + } + var subgrid = grid.grid.subgrids[0]; + // skip tables that don't match our point at all + var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0; + var minX = subgrid.ll[0] - epsilon; + var minY = subgrid.ll[1] - epsilon; + var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon; + var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon; + if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x ) { + continue; + } + output = applySubgridShift(input, inverse, subgrid); + if (!isNaN(output.x)) { + break; + } + } + if (isNaN(output.x)) { + console.log("Failed to find a grid shift table for location '"+ + -input.x * R2D + " " + input.y * R2D + " tried: '" + attemptedGrids + "'"); + return -1; + } + point.x = -output.x; + point.y = output.y; + return 0; + } + + function applySubgridShift(pin, inverse, ct) { + var val = {x: Number.NaN, y: Number.NaN}; + if (isNaN(pin.x)) { return val; } + var tb = {x: pin.x, y: pin.y}; + tb.x -= ct.ll[0]; + tb.y -= ct.ll[1]; + tb.x = adjust_lon(tb.x - Math.PI) + Math.PI; + var t = nadInterpolate(tb, ct); + if (inverse) { + if (isNaN(t.x)) { + return val; + } + t.x = tb.x - t.x; + t.y = tb.y - t.y; + var i = 9, tol = 1e-12; + var dif, del; + do { + del = nadInterpolate(t, ct); + if (isNaN(del.x)) { + console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation."); + break; + } + dif = {x: tb.x - (del.x + t.x), y: tb.y - (del.y + t.y)}; + t.x += dif.x; + t.y += dif.y; + } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol); + if (i < 0) { + console.log("Inverse grid shift iterator failed to converge."); + return val; + } + val.x = adjust_lon(t.x + ct.ll[0]); + val.y = t.y + ct.ll[1]; + } else { + if (!isNaN(t.x)) { + val.x = pin.x + t.x; + val.y = pin.y + t.y; + } + } + return val; + } + + function nadInterpolate(pin, ct) { + var t = {x: pin.x / ct.del[0], y: pin.y / ct.del[1]}; + var indx = {x: Math.floor(t.x), y: Math.floor(t.y)}; + var frct = {x: t.x - 1.0 * indx.x, y: t.y - 1.0 * indx.y}; + var val= {x: Number.NaN, y: Number.NaN}; + var inx; + if (indx.x < 0 || indx.x >= ct.lim[0]) { + return val; + } + if (indx.y < 0 || indx.y >= ct.lim[1]) { + return val; + } + inx = (indx.y * ct.lim[0]) + indx.x; + var f00 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]}; + inx++; + var f10= {x: ct.cvs[inx][0], y: ct.cvs[inx][1]}; + inx += ct.lim[0]; + var f11 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]}; + inx--; + var f01 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]}; + var m11 = frct.x * frct.y, m10 = frct.x * (1.0 - frct.y), + m00 = (1.0 - frct.x) * (1.0 - frct.y), m01 = (1.0 - frct.x) * frct.y; + val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x); + val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y); + return val; + } + + var adjust_axis = function(crs, denorm, point) { + var xin = point.x, + yin = point.y, + zin = point.z || 0.0; + var v, t, i; + var out = {}; + for (i = 0; i < 3; i++) { + if (denorm && i === 2 && point.z === undefined) { + continue; + } + if (i === 0) { + v = xin; + if ("ew".indexOf(crs.axis[i]) !== -1) { + t = 'x'; + } else { + t = 'y'; + } + + } + else if (i === 1) { + v = yin; + if ("ns".indexOf(crs.axis[i]) !== -1) { + t = 'y'; + } else { + t = 'x'; + } + } + else { + v = zin; + t = 'z'; + } + switch (crs.axis[i]) { + case 'e': + out[t] = v; + break; + case 'w': + out[t] = -v; + break; + case 'n': + out[t] = v; + break; + case 's': + out[t] = -v; + break; + case 'u': + if (point[t] !== undefined) { + out.z = v; + } + break; + case 'd': + if (point[t] !== undefined) { + out.z = -v; + } + break; + default: + //console.log("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName); + return null; + } + } + return out; + }; + + var toPoint = function (array){ + var out = { + x: array[0], + y: array[1] + }; + if (array.length>2) { + out.z = array[2]; + } + if (array.length>3) { + out.m = array[3]; + } + return out; + }; + + var checkSanity = function (point) { + checkCoord(point.x); + checkCoord(point.y); + }; + function checkCoord(num) { + if (typeof Number.isFinite === 'function') { + if (Number.isFinite(num)) { + return; + } + throw new TypeError('coordinates must be finite numbers'); + } + if (typeof num !== 'number' || num !== num || !isFinite(num)) { + throw new TypeError('coordinates must be finite numbers'); + } + } + + function checkNotWGS(source, dest) { + return ((source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM) && dest.datumCode !== 'WGS84') || ((dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM) && source.datumCode !== 'WGS84'); + } + + function transform(source, dest, point, enforceAxis) { + var wgs84; + if (Array.isArray(point)) { + point = toPoint(point); + } + checkSanity(point); + // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84 + if (source.datum && dest.datum && checkNotWGS(source, dest)) { + wgs84 = new Projection('WGS84'); + point = transform(source, wgs84, point, enforceAxis); + source = wgs84; + } + // DGR, 2010/11/12 + if (enforceAxis && source.axis !== 'enu') { + point = adjust_axis(source, false, point); + } + // Transform source points to long/lat, if they aren't already. + if (source.projName === 'longlat') { + point = { + x: point.x * D2R, + y: point.y * D2R, + z: point.z || 0 + }; + } else { + if (source.to_meter) { + point = { + x: point.x * source.to_meter, + y: point.y * source.to_meter, + z: point.z || 0 + }; + } + point = source.inverse(point); // Convert Cartesian to longlat + if (!point) { + return; + } + } + // Adjust for the prime meridian if necessary + if (source.from_greenwich) { + point.x += source.from_greenwich; + } + + // Convert datums if needed, and if possible. + point = datum_transform(source.datum, dest.datum, point); + if (!point) { + return; + } + + // Adjust for the prime meridian if necessary + if (dest.from_greenwich) { + point = { + x: point.x - dest.from_greenwich, + y: point.y, + z: point.z || 0 + }; + } + + if (dest.projName === 'longlat') { + // convert radians to decimal degrees + point = { + x: point.x * R2D, + y: point.y * R2D, + z: point.z || 0 + }; + } else { // else project + point = dest.forward(point); + if (dest.to_meter) { + point = { + x: point.x / dest.to_meter, + y: point.y / dest.to_meter, + z: point.z || 0 + }; + } + } + + // DGR, 2010/11/12 + if (enforceAxis && dest.axis !== 'enu') { + return adjust_axis(dest, true, point); + } + + return point; + } + + var wgs84 = Projection('WGS84'); + + function transformer(from, to, coords, enforceAxis) { + var transformedArray, out, keys; + if (Array.isArray(coords)) { + transformedArray = transform(from, to, coords, enforceAxis) || {x: NaN, y: NaN}; + if (coords.length > 2) { + if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) { + if (typeof transformedArray.z === 'number') { + return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3)); + } else { + return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3)); + } + } else { + return [transformedArray.x, transformedArray.y].concat(coords.splice(2)); + } + } else { + return [transformedArray.x, transformedArray.y]; + } + } else { + out = transform(from, to, coords, enforceAxis); + keys = Object.keys(coords); + if (keys.length === 2) { + return out; + } + keys.forEach(function (key) { + if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) { + if (key === 'x' || key === 'y' || key === 'z') { + return; + } + } else { + if (key === 'x' || key === 'y') { + return; + } + } + out[key] = coords[key]; + }); + return out; + } + } + + function checkProj(item) { + if (item instanceof Projection) { + return item; + } + if (item.oProj) { + return item.oProj; + } + return Projection(item); + } + + function proj4$1(fromProj, toProj, coord) { + fromProj = checkProj(fromProj); + var single = false; + var obj; + if (typeof toProj === 'undefined') { + toProj = fromProj; + fromProj = wgs84; + single = true; + } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) { + coord = toProj; + toProj = fromProj; + fromProj = wgs84; + single = true; + } + toProj = checkProj(toProj); + if (coord) { + return transformer(fromProj, toProj, coord); + } else { + obj = { + forward: function (coords, enforceAxis) { + return transformer(fromProj, toProj, coords, enforceAxis); + }, + inverse: function (coords, enforceAxis) { + return transformer(toProj, fromProj, coords, enforceAxis); + } + }; + if (single) { + obj.oProj = toProj; + } + return obj; + } + } + + /** + * UTM zones are grouped, and assigned to one of a group of 6 + * sets. + * + * {int} @private + */ + var NUM_100K_SETS = 6; + + /** + * The column letters (for easting) of the lower left value, per + * set. + * + * {string} @private + */ + var SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS'; + + /** + * The row letters (for northing) of the lower left value, per + * set. + * + * {string} @private + */ + var SET_ORIGIN_ROW_LETTERS = 'AFAFAF'; + + var A = 65; // A + var I = 73; // I + var O = 79; // O + var V = 86; // V + var Z = 90; // Z + var mgrs = { + forward: forward$1, + inverse: inverse$1, + toPoint: toPoint$1 + }; + /** + * Conversion of lat/lon to MGRS. + * + * @param {object} ll Object literal with lat and lon properties on a + * WGS84 ellipsoid. + * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for + * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5. + * @return {string} the MGRS string for the given location and accuracy. + */ + function forward$1(ll, accuracy) { + accuracy = accuracy || 5; // default accuracy 1m + return encode(LLtoUTM({ + lat: ll[1], + lon: ll[0] + }), accuracy); + } + + /** + * Conversion of MGRS to lat/lon. + * + * @param {string} mgrs MGRS string. + * @return {array} An array with left (longitude), bottom (latitude), right + * (longitude) and top (latitude) values in WGS84, representing the + * bounding box for the provided MGRS reference. + */ + function inverse$1(mgrs) { + var bbox = UTMtoLL(decode(mgrs.toUpperCase())); + if (bbox.lat && bbox.lon) { + return [bbox.lon, bbox.lat, bbox.lon, bbox.lat]; + } + return [bbox.left, bbox.bottom, bbox.right, bbox.top]; + } + + function toPoint$1(mgrs) { + var bbox = UTMtoLL(decode(mgrs.toUpperCase())); + if (bbox.lat && bbox.lon) { + return [bbox.lon, bbox.lat]; + } + return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2]; + } + /** + * Conversion from degrees to radians. + * + * @private + * @param {number} deg the angle in degrees. + * @return {number} the angle in radians. + */ + function degToRad(deg) { + return (deg * (Math.PI / 180.0)); + } + + /** + * Conversion from radians to degrees. + * + * @private + * @param {number} rad the angle in radians. + * @return {number} the angle in degrees. + */ + function radToDeg(rad) { + return (180.0 * (rad / Math.PI)); + } + + /** + * Converts a set of Longitude and Latitude co-ordinates to UTM + * using the WGS84 ellipsoid. + * + * @private + * @param {object} ll Object literal with lat and lon properties + * representing the WGS84 coordinate to be converted. + * @return {object} Object literal containing the UTM value with easting, + * northing, zoneNumber and zoneLetter properties, and an optional + * accuracy property in digits. Returns null if the conversion failed. + */ + function LLtoUTM(ll) { + var Lat = ll.lat; + var Long = ll.lon; + var a = 6378137.0; //ellip.radius; + var eccSquared = 0.00669438; //ellip.eccsq; + var k0 = 0.9996; + var LongOrigin; + var eccPrimeSquared; + var N, T, C, A, M; + var LatRad = degToRad(Lat); + var LongRad = degToRad(Long); + var LongOriginRad; + var ZoneNumber; + // (int) + ZoneNumber = Math.floor((Long + 180) / 6) + 1; + + //Make sure the longitude 180.00 is in Zone 60 + if (Long === 180) { + ZoneNumber = 60; + } + + // Special zone for Norway + if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) { + ZoneNumber = 32; + } + + // Special zones for Svalbard + if (Lat >= 72.0 && Lat < 84.0) { + if (Long >= 0.0 && Long < 9.0) { + ZoneNumber = 31; + } + else if (Long >= 9.0 && Long < 21.0) { + ZoneNumber = 33; + } + else if (Long >= 21.0 && Long < 33.0) { + ZoneNumber = 35; + } + else if (Long >= 33.0 && Long < 42.0) { + ZoneNumber = 37; + } + } + + LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin + // in middle of + // zone + LongOriginRad = degToRad(LongOrigin); + + eccPrimeSquared = (eccSquared) / (1 - eccSquared); + + N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad)); + T = Math.tan(LatRad) * Math.tan(LatRad); + C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad); + A = Math.cos(LatRad) * (LongRad - LongOriginRad); + + M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - (35 * eccSquared * eccSquared * eccSquared / 3072) * Math.sin(6 * LatRad)); + + var UTMEasting = (k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0); + + var UTMNorthing = (k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0))); + if (Lat < 0.0) { + UTMNorthing += 10000000.0; //10000000 meter offset for + // southern hemisphere + } + + return { + northing: Math.round(UTMNorthing), + easting: Math.round(UTMEasting), + zoneNumber: ZoneNumber, + zoneLetter: getLetterDesignator(Lat) + }; + } + + /** + * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience + * class where the Zone can be specified as a single string eg."60N" which + * is then broken down into the ZoneNumber and ZoneLetter. + * + * @private + * @param {object} utm An object literal with northing, easting, zoneNumber + * and zoneLetter properties. If an optional accuracy property is + * provided (in meters), a bounding box will be returned instead of + * latitude and longitude. + * @return {object} An object literal containing either lat and lon values + * (if no accuracy was provided), or top, right, bottom and left values + * for the bounding box calculated according to the provided accuracy. + * Returns null if the conversion failed. + */ + function UTMtoLL(utm) { + + var UTMNorthing = utm.northing; + var UTMEasting = utm.easting; + var zoneLetter = utm.zoneLetter; + var zoneNumber = utm.zoneNumber; + // check the ZoneNummber is valid + if (zoneNumber < 0 || zoneNumber > 60) { + return null; + } + + var k0 = 0.9996; + var a = 6378137.0; //ellip.radius; + var eccSquared = 0.00669438; //ellip.eccsq; + var eccPrimeSquared; + var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared)); + var N1, T1, C1, R1, D, M; + var LongOrigin; + var mu, phi1Rad; + + // remove 500,000 meter offset for longitude + var x = UTMEasting - 500000.0; + var y = UTMNorthing; + + // We must know somehow if we are in the Northern or Southern + // hemisphere, this is the only time we use the letter So even + // if the Zone letter isn't exactly correct it should indicate + // the hemisphere correctly + if (zoneLetter < 'N') { + y -= 10000000.0; // remove 10,000,000 meter offset used + // for southern hemisphere + } + + // There are 60 zones with zone 1 being at West -180 to -174 + LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin + // in middle of + // zone + + eccPrimeSquared = (eccSquared) / (1 - eccSquared); + + M = y / k0; + mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256)); + + phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + (151 * e1 * e1 * e1 / 96) * Math.sin(6 * mu); + // double phi1 = ProjMath.radToDeg(phi1Rad); + + N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad)); + T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad); + C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad); + R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5); + D = x / (N1 * k0); + + var lat = phi1Rad - (N1 * Math.tan(phi1Rad) / R1) * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720); + lat = radToDeg(lat); + + var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad); + lon = LongOrigin + radToDeg(lon); + + var result; + if (utm.accuracy) { + var topRight = UTMtoLL({ + northing: utm.northing + utm.accuracy, + easting: utm.easting + utm.accuracy, + zoneLetter: utm.zoneLetter, + zoneNumber: utm.zoneNumber + }); + result = { + top: topRight.lat, + right: topRight.lon, + bottom: lat, + left: lon + }; + } + else { + result = { + lat: lat, + lon: lon + }; + } + return result; + } + + /** + * Calculates the MGRS letter designator for the given latitude. + * + * @private + * @param {number} lat The latitude in WGS84 to get the letter designator + * for. + * @return {char} The letter designator. + */ + function getLetterDesignator(lat) { + //This is here as an error flag to show that the Latitude is + //outside MGRS limits + var LetterDesignator = 'Z'; + + if ((84 >= lat) && (lat >= 72)) { + LetterDesignator = 'X'; + } + else if ((72 > lat) && (lat >= 64)) { + LetterDesignator = 'W'; + } + else if ((64 > lat) && (lat >= 56)) { + LetterDesignator = 'V'; + } + else if ((56 > lat) && (lat >= 48)) { + LetterDesignator = 'U'; + } + else if ((48 > lat) && (lat >= 40)) { + LetterDesignator = 'T'; + } + else if ((40 > lat) && (lat >= 32)) { + LetterDesignator = 'S'; + } + else if ((32 > lat) && (lat >= 24)) { + LetterDesignator = 'R'; + } + else if ((24 > lat) && (lat >= 16)) { + LetterDesignator = 'Q'; + } + else if ((16 > lat) && (lat >= 8)) { + LetterDesignator = 'P'; + } + else if ((8 > lat) && (lat >= 0)) { + LetterDesignator = 'N'; + } + else if ((0 > lat) && (lat >= -8)) { + LetterDesignator = 'M'; + } + else if ((-8 > lat) && (lat >= -16)) { + LetterDesignator = 'L'; + } + else if ((-16 > lat) && (lat >= -24)) { + LetterDesignator = 'K'; + } + else if ((-24 > lat) && (lat >= -32)) { + LetterDesignator = 'J'; + } + else if ((-32 > lat) && (lat >= -40)) { + LetterDesignator = 'H'; + } + else if ((-40 > lat) && (lat >= -48)) { + LetterDesignator = 'G'; + } + else if ((-48 > lat) && (lat >= -56)) { + LetterDesignator = 'F'; + } + else if ((-56 > lat) && (lat >= -64)) { + LetterDesignator = 'E'; + } + else if ((-64 > lat) && (lat >= -72)) { + LetterDesignator = 'D'; + } + else if ((-72 > lat) && (lat >= -80)) { + LetterDesignator = 'C'; + } + return LetterDesignator; + } + + /** + * Encodes a UTM location as MGRS string. + * + * @private + * @param {object} utm An object literal with easting, northing, + * zoneLetter, zoneNumber + * @param {number} accuracy Accuracy in digits (1-5). + * @return {string} MGRS string for the given UTM location. + */ + function encode(utm, accuracy) { + // prepend with leading zeroes + var seasting = "00000" + utm.easting, + snorthing = "00000" + utm.northing; + + return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy); + } + + /** + * Get the two letter 100k designator for a given UTM easting, + * northing and zone number value. + * + * @private + * @param {number} easting + * @param {number} northing + * @param {number} zoneNumber + * @return the two letter 100k designator for the given UTM location. + */ + function get100kID(easting, northing, zoneNumber) { + var setParm = get100kSetForZone(zoneNumber); + var setColumn = Math.floor(easting / 100000); + var setRow = Math.floor(northing / 100000) % 20; + return getLetter100kID(setColumn, setRow, setParm); + } + + /** + * Given a UTM zone number, figure out the MGRS 100K set it is in. + * + * @private + * @param {number} i An UTM zone number. + * @return {number} the 100k set the UTM zone is in. + */ + function get100kSetForZone(i) { + var setParm = i % NUM_100K_SETS; + if (setParm === 0) { + setParm = NUM_100K_SETS; + } + + return setParm; + } + + /** + * Get the two-letter MGRS 100k designator given information + * translated from the UTM northing, easting and zone number. + * + * @private + * @param {number} column the column index as it relates to the MGRS + * 100k set spreadsheet, created from the UTM easting. + * Values are 1-8. + * @param {number} row the row index as it relates to the MGRS 100k set + * spreadsheet, created from the UTM northing value. Values + * are from 0-19. + * @param {number} parm the set block, as it relates to the MGRS 100k set + * spreadsheet, created from the UTM zone. Values are from + * 1-60. + * @return two letter MGRS 100k code. + */ + function getLetter100kID(column, row, parm) { + // colOrigin and rowOrigin are the letters at the origin of the set + var index = parm - 1; + var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index); + var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index); + + // colInt and rowInt are the letters to build to return + var colInt = colOrigin + column - 1; + var rowInt = rowOrigin + row; + var rollover = false; + + if (colInt > Z) { + colInt = colInt - Z + A - 1; + rollover = true; + } + + if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) { + colInt++; + } + + if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) { + colInt++; + + if (colInt === I) { + colInt++; + } + } + + if (colInt > Z) { + colInt = colInt - Z + A - 1; + } + + if (rowInt > V) { + rowInt = rowInt - V + A - 1; + rollover = true; + } + else { + rollover = false; + } + + if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) { + rowInt++; + } + + if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) { + rowInt++; + + if (rowInt === I) { + rowInt++; + } + } + + if (rowInt > V) { + rowInt = rowInt - V + A - 1; + } + + var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt); + return twoLetter; + } + + /** + * Decode the UTM parameters from a MGRS string. + * + * @private + * @param {string} mgrsString an UPPERCASE coordinate string is expected. + * @return {object} An object literal with easting, northing, zoneLetter, + * zoneNumber and accuracy (in meters) properties. + */ + function decode(mgrsString) { + + if (mgrsString && mgrsString.length === 0) { + throw ("MGRSPoint coverting from nothing"); + } + + var length = mgrsString.length; + + var hunK = null; + var sb = ""; + var testChar; + var i = 0; + + // get Zone number + while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) { + if (i >= 2) { + throw ("MGRSPoint bad conversion from: " + mgrsString); + } + sb += testChar; + i++; + } + + var zoneNumber = parseInt(sb, 10); + + if (i === 0 || i + 3 > length) { + // A good MGRS string has to be 4-5 digits long, + // ##AAA/#AAA at least. + throw ("MGRSPoint bad conversion from: " + mgrsString); + } + + var zoneLetter = mgrsString.charAt(i++); + + // Should we check the zone letter here? Why not. + if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') { + throw ("MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString); + } + + hunK = mgrsString.substring(i, i += 2); + + var set = get100kSetForZone(zoneNumber); + + var east100k = getEastingFromChar(hunK.charAt(0), set); + var north100k = getNorthingFromChar(hunK.charAt(1), set); + + // We have a bug where the northing may be 2000000 too low. + // How + // do we know when to roll over? + + while (north100k < getMinNorthing(zoneLetter)) { + north100k += 2000000; + } + + // calculate the char index for easting/northing separator + var remainder = length - i; + + if (remainder % 2 !== 0) { + throw ("MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + mgrsString); + } + + var sep = remainder / 2; + + var sepEasting = 0.0; + var sepNorthing = 0.0; + var accuracyBonus, sepEastingString, sepNorthingString, easting, northing; + if (sep > 0) { + accuracyBonus = 100000.0 / Math.pow(10, sep); + sepEastingString = mgrsString.substring(i, i + sep); + sepEasting = parseFloat(sepEastingString) * accuracyBonus; + sepNorthingString = mgrsString.substring(i + sep); + sepNorthing = parseFloat(sepNorthingString) * accuracyBonus; + } + + easting = sepEasting + east100k; + northing = sepNorthing + north100k; + + return { + easting: easting, + northing: northing, + zoneLetter: zoneLetter, + zoneNumber: zoneNumber, + accuracy: accuracyBonus + }; + } + + /** + * Given the first letter from a two-letter MGRS 100k zone, and given the + * MGRS table set for the zone number, figure out the easting value that + * should be added to the other, secondary easting value. + * + * @private + * @param {char} e The first letter from a two-letter MGRS 100´k zone. + * @param {number} set The MGRS table set for the zone number. + * @return {number} The easting value for the given letter and set. + */ + function getEastingFromChar(e, set) { + // colOrigin is the letter at the origin of the set for the + // column + var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1); + var eastingValue = 100000.0; + var rewindMarker = false; + + while (curCol !== e.charCodeAt(0)) { + curCol++; + if (curCol === I) { + curCol++; + } + if (curCol === O) { + curCol++; + } + if (curCol > Z) { + if (rewindMarker) { + throw ("Bad character: " + e); + } + curCol = A; + rewindMarker = true; + } + eastingValue += 100000.0; + } + + return eastingValue; + } + + /** + * Given the second letter from a two-letter MGRS 100k zone, and given the + * MGRS table set for the zone number, figure out the northing value that + * should be added to the other, secondary northing value. You have to + * remember that Northings are determined from the equator, and the vertical + * cycle of letters mean a 2000000 additional northing meters. This happens + * approx. every 18 degrees of latitude. This method does *NOT* count any + * additional northings. You have to figure out how many 2000000 meters need + * to be added for the zone letter of the MGRS coordinate. + * + * @private + * @param {char} n Second letter of the MGRS 100k zone + * @param {number} set The MGRS table set number, which is dependent on the + * UTM zone number. + * @return {number} The northing value for the given letter and set. + */ + function getNorthingFromChar(n, set) { + + if (n > 'V') { + throw ("MGRSPoint given invalid Northing " + n); + } + + // rowOrigin is the letter at the origin of the set for the + // column + var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1); + var northingValue = 0.0; + var rewindMarker = false; + + while (curRow !== n.charCodeAt(0)) { + curRow++; + if (curRow === I) { + curRow++; + } + if (curRow === O) { + curRow++; + } + // fixing a bug making whole application hang in this loop + // when 'n' is a wrong character + if (curRow > V) { + if (rewindMarker) { // making sure that this loop ends + throw ("Bad character: " + n); + } + curRow = A; + rewindMarker = true; + } + northingValue += 100000.0; + } + + return northingValue; + } + + /** + * The function getMinNorthing returns the minimum northing value of a MGRS + * zone. + * + * Ported from Geotrans' c Lattitude_Band_Value structure table. + * + * @private + * @param {char} zoneLetter The MGRS zone to get the min northing for. + * @return {number} + */ + function getMinNorthing(zoneLetter) { + var northing; + switch (zoneLetter) { + case 'C': + northing = 1100000.0; + break; + case 'D': + northing = 2000000.0; + break; + case 'E': + northing = 2800000.0; + break; + case 'F': + northing = 3700000.0; + break; + case 'G': + northing = 4600000.0; + break; + case 'H': + northing = 5500000.0; + break; + case 'J': + northing = 6400000.0; + break; + case 'K': + northing = 7300000.0; + break; + case 'L': + northing = 8200000.0; + break; + case 'M': + northing = 9100000.0; + break; + case 'N': + northing = 0.0; + break; + case 'P': + northing = 800000.0; + break; + case 'Q': + northing = 1700000.0; + break; + case 'R': + northing = 2600000.0; + break; + case 'S': + northing = 3500000.0; + break; + case 'T': + northing = 4400000.0; + break; + case 'U': + northing = 5300000.0; + break; + case 'V': + northing = 6200000.0; + break; + case 'W': + northing = 7000000.0; + break; + case 'X': + northing = 7900000.0; + break; + default: + northing = -1.0; + } + if (northing >= 0.0) { + return northing; + } + else { + throw ("Invalid zone letter: " + zoneLetter); + } + + } + + function Point(x, y, z) { + if (!(this instanceof Point)) { + return new Point(x, y, z); + } + if (Array.isArray(x)) { + this.x = x[0]; + this.y = x[1]; + this.z = x[2] || 0.0; + } else if(typeof x === 'object') { + this.x = x.x; + this.y = x.y; + this.z = x.z || 0.0; + } else if (typeof x === 'string' && typeof y === 'undefined') { + var coords = x.split(','); + this.x = parseFloat(coords[0], 10); + this.y = parseFloat(coords[1], 10); + this.z = parseFloat(coords[2], 10) || 0.0; + } else { + this.x = x; + this.y = y; + this.z = z || 0.0; + } + console.warn('proj4.Point will be removed in version 3, use proj4.toPoint'); + } + + Point.fromMGRS = function(mgrsStr) { + return new Point(toPoint$1(mgrsStr)); + }; + Point.prototype.toMGRS = function(accuracy) { + return forward$1([this.x, this.y], accuracy); + }; + + var C00 = 1; + var C02 = 0.25; + var C04 = 0.046875; + var C06 = 0.01953125; + var C08 = 0.01068115234375; + var C22 = 0.75; + var C44 = 0.46875; + var C46 = 0.01302083333333333333; + var C48 = 0.00712076822916666666; + var C66 = 0.36458333333333333333; + var C68 = 0.00569661458333333333; + var C88 = 0.3076171875; + + var pj_enfn = function(es) { + var en = []; + en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08))); + en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08))); + var t = es * es; + en[2] = t * (C44 - es * (C46 + es * C48)); + t *= es; + en[3] = t * (C66 - es * C68); + en[4] = t * es * C88; + return en; + }; + + var pj_mlfn = function(phi, sphi, cphi, en) { + cphi *= sphi; + sphi *= sphi; + return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])))); + }; + + var MAX_ITER = 20; + + var pj_inv_mlfn = function(arg, es, en) { + var k = 1 / (1 - es); + var phi = arg; + for (var i = MAX_ITER; i; --i) { /* rarely goes over 2 iterations */ + var s = Math.sin(phi); + var t = 1 - es * s * s; + //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg; + //phi -= t * (t * Math.sqrt(t)) * k; + t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k; + phi -= t; + if (Math.abs(t) < EPSLN) { + return phi; + } + } + //..reportError("cass:pj_inv_mlfn: Convergence error"); + return phi; + }; + + // Heavily based on this tmerc projection implementation + // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js + + function init$2() { + this.x0 = this.x0 !== undefined ? this.x0 : 0; + this.y0 = this.y0 !== undefined ? this.y0 : 0; + this.long0 = this.long0 !== undefined ? this.long0 : 0; + this.lat0 = this.lat0 !== undefined ? this.lat0 : 0; + + if (this.es) { + this.en = pj_enfn(this.es); + this.ml0 = pj_mlfn(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en); + } + } + + /** + Transverse Mercator Forward - long/lat to x/y + long/lat in radians + */ + function forward$2(p) { + var lon = p.x; + var lat = p.y; + + var delta_lon = adjust_lon(lon - this.long0); + var con; + var x, y; + var sin_phi = Math.sin(lat); + var cos_phi = Math.cos(lat); + + if (!this.es) { + var b = cos_phi * Math.sin(delta_lon); + + if ((Math.abs(Math.abs(b) - 1)) < EPSLN) { + return (93); + } + else { + x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0; + y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2)); + b = Math.abs(y); + + if (b >= 1) { + if ((b - 1) > EPSLN) { + return (93); + } + else { + y = 0; + } + } + else { + y = Math.acos(y); + } + + if (lat < 0) { + y = -y; + } + + y = this.a * this.k0 * (y - this.lat0) + this.y0; + } + } + else { + var al = cos_phi * delta_lon; + var als = Math.pow(al, 2); + var c = this.ep2 * Math.pow(cos_phi, 2); + var cs = Math.pow(c, 2); + var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0; + var t = Math.pow(tq, 2); + var ts = Math.pow(t, 2); + con = 1 - this.es * Math.pow(sin_phi, 2); + al = al / Math.sqrt(con); + var ml = pj_mlfn(lat, sin_phi, cos_phi, this.en); + + x = this.a * (this.k0 * al * (1 + + als / 6 * (1 - t + c + + als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c + + als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) + + this.x0; + + y = this.a * (this.k0 * (ml - this.ml0 + + sin_phi * delta_lon * al / 2 * (1 + + als / 12 * (5 - t + 9 * c + 4 * cs + + als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c + + als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) + + this.y0; + } + + p.x = x; + p.y = y; + + return p; + } + + /** + Transverse Mercator Inverse - x/y to long/lat + */ + function inverse$2(p) { + var con, phi; + var lat, lon; + var x = (p.x - this.x0) * (1 / this.a); + var y = (p.y - this.y0) * (1 / this.a); + + if (!this.es) { + var f = Math.exp(x / this.k0); + var g = 0.5 * (f - 1 / f); + var temp = this.lat0 + y / this.k0; + var h = Math.cos(temp); + con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2))); + lat = Math.asin(con); + + if (y < 0) { + lat = -lat; + } + + if ((g === 0) && (h === 0)) { + lon = 0; + } + else { + lon = adjust_lon(Math.atan2(g, h) + this.long0); + } + } + else { // ellipsoidal form + con = this.ml0 + y / this.k0; + phi = pj_inv_mlfn(con, this.es, this.en); + + if (Math.abs(phi) < HALF_PI) { + var sin_phi = Math.sin(phi); + var cos_phi = Math.cos(phi); + var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0; + var c = this.ep2 * Math.pow(cos_phi, 2); + var cs = Math.pow(c, 2); + var t = Math.pow(tan_phi, 2); + var ts = Math.pow(t, 2); + con = 1 - this.es * Math.pow(sin_phi, 2); + var d = x * Math.sqrt(con) / this.k0; + var ds = Math.pow(d, 2); + con = con * tan_phi; + + lat = phi - (con * ds / (1 - this.es)) * 0.5 * (1 - + ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs - + ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c - + ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t)))); + + lon = adjust_lon(this.long0 + (d * (1 - + ds / 6 * (1 + 2 * t + c - + ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c - + ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi)); + } + else { + lat = HALF_PI * sign(y); + lon = 0; + } + } + + p.x = lon; + p.y = lat; + + return p; + } + + var names$3 = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"]; + var tmerc = { + init: init$2, + forward: forward$2, + inverse: inverse$2, + names: names$3 + }; + + var sinh = function(x) { + var r = Math.exp(x); + r = (r - 1 / r) / 2; + return r; + }; + + var hypot = function(x, y) { + x = Math.abs(x); + y = Math.abs(y); + var a = Math.max(x, y); + var b = Math.min(x, y) / (a ? a : 1); + + return a * Math.sqrt(1 + Math.pow(b, 2)); + }; + + var log1py = function(x) { + var y = 1 + x; + var z = y - 1; + + return z === 0 ? x : x * Math.log(y) / z; + }; + + var asinhy = function(x) { + var y = Math.abs(x); + y = log1py(y * (1 + y / (hypot(1, y) + 1))); + + return x < 0 ? -y : y; + }; + + var gatg = function(pp, B) { + var cos_2B = 2 * Math.cos(2 * B); + var i = pp.length - 1; + var h1 = pp[i]; + var h2 = 0; + var h; + + while (--i >= 0) { + h = -h2 + cos_2B * h1 + pp[i]; + h2 = h1; + h1 = h; + } + + return (B + h * Math.sin(2 * B)); + }; + + var clens = function(pp, arg_r) { + var r = 2 * Math.cos(arg_r); + var i = pp.length - 1; + var hr1 = pp[i]; + var hr2 = 0; + var hr; + + while (--i >= 0) { + hr = -hr2 + r * hr1 + pp[i]; + hr2 = hr1; + hr1 = hr; + } + + return Math.sin(arg_r) * hr; + }; + + var cosh = function(x) { + var r = Math.exp(x); + r = (r + 1 / r) / 2; + return r; + }; + + var clens_cmplx = function(pp, arg_r, arg_i) { + var sin_arg_r = Math.sin(arg_r); + var cos_arg_r = Math.cos(arg_r); + var sinh_arg_i = sinh(arg_i); + var cosh_arg_i = cosh(arg_i); + var r = 2 * cos_arg_r * cosh_arg_i; + var i = -2 * sin_arg_r * sinh_arg_i; + var j = pp.length - 1; + var hr = pp[j]; + var hi1 = 0; + var hr1 = 0; + var hi = 0; + var hr2; + var hi2; + + while (--j >= 0) { + hr2 = hr1; + hi2 = hi1; + hr1 = hr; + hi1 = hi; + hr = -hr2 + r * hr1 - i * hi1 + pp[j]; + hi = -hi2 + i * hr1 + r * hi1; + } + + r = sin_arg_r * cosh_arg_i; + i = cos_arg_r * sinh_arg_i; + + return [r * hr - i * hi, r * hi + i * hr]; + }; + + // Heavily based on this etmerc projection implementation + // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js + + function init$3() { + if (!this.approx && (isNaN(this.es) || this.es <= 0)) { + throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.'); + } + if (this.approx) { + // When '+approx' is set, use tmerc instead + tmerc.init.apply(this); + this.forward = tmerc.forward; + this.inverse = tmerc.inverse; + } + + this.x0 = this.x0 !== undefined ? this.x0 : 0; + this.y0 = this.y0 !== undefined ? this.y0 : 0; + this.long0 = this.long0 !== undefined ? this.long0 : 0; + this.lat0 = this.lat0 !== undefined ? this.lat0 : 0; + + this.cgb = []; + this.cbg = []; + this.utg = []; + this.gtu = []; + + var f = this.es / (1 + Math.sqrt(1 - this.es)); + var n = f / (2 - f); + var np = n; + + this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 )))))); + this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725)))))); + + np = np * n; + this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945))))); + this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945))))); + + np = np * n; + this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835)))); + this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835)))); + + np = np * n; + this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175))); + this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175))); + + np = np * n; + this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237)); + this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185)); + + np = np * n; + this.cgb[5] = np * (601676 / 22275); + this.cbg[5] = np * (444337 / 155925); + + np = Math.pow(n, 2); + this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256))); + + this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800)))))); + this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800)))))); + + this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720))))); + this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360))))); + + np = np * n; + this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 )))); + this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440)))); + + np = np * n; + this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600))); + this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600))); + + np = np * n; + this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680)); + this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840)); + + np = np * n; + this.utg[5] = np * (-20648693 / 638668800); + this.gtu[5] = np * (212378941 / 319334400); + + var Z = gatg(this.cbg, this.lat0); + this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z)); + } + + function forward$3(p) { + var Ce = adjust_lon(p.x - this.long0); + var Cn = p.y; + + Cn = gatg(this.cbg, Cn); + var sin_Cn = Math.sin(Cn); + var cos_Cn = Math.cos(Cn); + var sin_Ce = Math.sin(Ce); + var cos_Ce = Math.cos(Ce); + + Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn); + Ce = Math.atan2(sin_Ce * cos_Cn, hypot(sin_Cn, cos_Cn * cos_Ce)); + Ce = asinhy(Math.tan(Ce)); + + var tmp = clens_cmplx(this.gtu, 2 * Cn, 2 * Ce); + + Cn = Cn + tmp[0]; + Ce = Ce + tmp[1]; + + var x; + var y; + + if (Math.abs(Ce) <= 2.623395162778) { + x = this.a * (this.Qn * Ce) + this.x0; + y = this.a * (this.Qn * Cn + this.Zb) + this.y0; + } + else { + x = Infinity; + y = Infinity; + } + + p.x = x; + p.y = y; + + return p; + } + + function inverse$3(p) { + var Ce = (p.x - this.x0) * (1 / this.a); + var Cn = (p.y - this.y0) * (1 / this.a); + + Cn = (Cn - this.Zb) / this.Qn; + Ce = Ce / this.Qn; + + var lon; + var lat; + + if (Math.abs(Ce) <= 2.623395162778) { + var tmp = clens_cmplx(this.utg, 2 * Cn, 2 * Ce); + + Cn = Cn + tmp[0]; + Ce = Ce + tmp[1]; + Ce = Math.atan(sinh(Ce)); + + var sin_Cn = Math.sin(Cn); + var cos_Cn = Math.cos(Cn); + var sin_Ce = Math.sin(Ce); + var cos_Ce = Math.cos(Ce); + + Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn)); + Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn); + + lon = adjust_lon(Ce + this.long0); + lat = gatg(this.cgb, Cn); + } + else { + lon = Infinity; + lat = Infinity; + } + + p.x = lon; + p.y = lat; + + return p; + } + + var names$4 = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "tmerc"]; + var etmerc = { + init: init$3, + forward: forward$3, + inverse: inverse$3, + names: names$4 + }; + + var adjust_zone = function(zone, lon) { + if (zone === undefined) { + zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1; + + if (zone < 0) { + return 0; + } else if (zone > 60) { + return 60; + } + } + return zone; + }; + + var dependsOn = 'etmerc'; + function init$4() { + var zone = adjust_zone(this.zone, this.long0); + if (zone === undefined) { + throw new Error('unknown utm zone'); + } + this.lat0 = 0; + this.long0 = ((6 * Math.abs(zone)) - 183) * D2R; + this.x0 = 500000; + this.y0 = this.utmSouth ? 10000000 : 0; + this.k0 = 0.9996; + + etmerc.init.apply(this); + this.forward = etmerc.forward; + this.inverse = etmerc.inverse; + } + + var names$5 = ["Universal Transverse Mercator System", "utm"]; + var utm = { + init: init$4, + names: names$5, + dependsOn: dependsOn + }; + + var srat = function(esinp, exp) { + return (Math.pow((1 - esinp) / (1 + esinp), exp)); + }; + + var MAX_ITER$1 = 20; + function init$6() { + var sphi = Math.sin(this.lat0); + var cphi = Math.cos(this.lat0); + cphi *= cphi; + this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi); + this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es)); + this.phic0 = Math.asin(sphi / this.C); + this.ratexp = 0.5 * this.C * this.e; + this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat(this.e * sphi, this.ratexp)); + } + + function forward$5(p) { + var lon = p.x; + var lat = p.y; + + p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + FORTPI), this.C) * srat(this.e * Math.sin(lat), this.ratexp)) - HALF_PI; + p.x = this.C * lon; + return p; + } + + function inverse$5(p) { + var DEL_TOL = 1e-14; + var lon = p.x / this.C; + var lat = p.y; + var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C); + for (var i = MAX_ITER$1; i > 0; --i) { + lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - HALF_PI; + if (Math.abs(lat - p.y) < DEL_TOL) { + break; + } + p.y = lat; + } + /* convergence failed */ + if (!i) { + return null; + } + p.x = lon; + p.y = lat; + return p; + } + + var names$7 = ["gauss"]; + var gauss = { + init: init$6, + forward: forward$5, + inverse: inverse$5, + names: names$7 + }; + + function init$5() { + gauss.init.apply(this); + if (!this.rc) { + return; + } + this.sinc0 = Math.sin(this.phic0); + this.cosc0 = Math.cos(this.phic0); + this.R2 = 2 * this.rc; + if (!this.title) { + this.title = "Oblique Stereographic Alternative"; + } + } + + function forward$4(p) { + var sinc, cosc, cosl, k; + p.x = adjust_lon(p.x - this.long0); + gauss.forward.apply(this, [p]); + sinc = Math.sin(p.y); + cosc = Math.cos(p.y); + cosl = Math.cos(p.x); + k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl); + p.x = k * cosc * Math.sin(p.x); + p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl); + p.x = this.a * p.x + this.x0; + p.y = this.a * p.y + this.y0; + return p; + } + + function inverse$4(p) { + var sinc, cosc, lon, lat, rho; + p.x = (p.x - this.x0) / this.a; + p.y = (p.y - this.y0) / this.a; + + p.x /= this.k0; + p.y /= this.k0; + if ((rho = Math.sqrt(p.x * p.x + p.y * p.y))) { + var c = 2 * Math.atan2(rho, this.R2); + sinc = Math.sin(c); + cosc = Math.cos(c); + lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho); + lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc); + } + else { + lat = this.phic0; + lon = 0; + } + + p.x = lon; + p.y = lat; + gauss.inverse.apply(this, [p]); + p.x = adjust_lon(p.x + this.long0); + return p; + } + + var names$6 = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea","Oblique Stereographic Alternative","Double_Stereographic"]; + var sterea = { + init: init$5, + forward: forward$4, + inverse: inverse$4, + names: names$6 + }; + + function ssfn_(phit, sinphi, eccen) { + sinphi *= eccen; + return (Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen)); + } + + function init$7() { + this.coslat0 = Math.cos(this.lat0); + this.sinlat0 = Math.sin(this.lat0); + if (this.sphere) { + if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) { + this.k0 = 0.5 * (1 + sign(this.lat0) * Math.sin(this.lat_ts)); + } + } + else { + if (Math.abs(this.coslat0) <= EPSLN) { + if (this.lat0 > 0) { + //North pole + //trace('stere:north pole'); + this.con = 1; + } + else { + //South pole + //trace('stere:south pole'); + this.con = -1; + } + } + this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)); + if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) { + this.k0 = 0.5 * this.cons * msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / tsfnz(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts)); + } + this.ms1 = msfnz(this.e, this.sinlat0, this.coslat0); + this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI; + this.cosX0 = Math.cos(this.X0); + this.sinX0 = Math.sin(this.X0); + } + } + + // Stereographic forward equations--mapping lat,long to x,y + function forward$6(p) { + var lon = p.x; + var lat = p.y; + var sinlat = Math.sin(lat); + var coslat = Math.cos(lat); + var A, X, sinX, cosX, ts, rh; + var dlon = adjust_lon(lon - this.long0); + + if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) { + //case of the origine point + //trace('stere:this is the origin point'); + p.x = NaN; + p.y = NaN; + return p; + } + if (this.sphere) { + //trace('stere:sphere case'); + A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon)); + p.x = this.a * A * coslat * Math.sin(dlon) + this.x0; + p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0; + return p; + } + else { + X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI; + cosX = Math.cos(X); + sinX = Math.sin(X); + if (Math.abs(this.coslat0) <= EPSLN) { + ts = tsfnz(this.e, lat * this.con, this.con * sinlat); + rh = 2 * this.a * this.k0 * ts / this.cons; + p.x = this.x0 + rh * Math.sin(lon - this.long0); + p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0); + //trace(p.toString()); + return p; + } + else if (Math.abs(this.sinlat0) < EPSLN) { + //Eq + //trace('stere:equateur'); + A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon)); + p.y = A * sinX; + } + else { + //other case + //trace('stere:normal case'); + A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon))); + p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0; + } + p.x = A * cosX * Math.sin(dlon) + this.x0; + } + //trace(p.toString()); + return p; + } + + //* Stereographic inverse equations--mapping x,y to lat/long + function inverse$6(p) { + p.x -= this.x0; + p.y -= this.y0; + var lon, lat, ts, ce, Chi; + var rh = Math.sqrt(p.x * p.x + p.y * p.y); + if (this.sphere) { + var c = 2 * Math.atan(rh / (2 * this.a * this.k0)); + lon = this.long0; + lat = this.lat0; + if (rh <= EPSLN) { + p.x = lon; + p.y = lat; + return p; + } + lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh); + if (Math.abs(this.coslat0) < EPSLN) { + if (this.lat0 > 0) { + lon = adjust_lon(this.long0 + Math.atan2(p.x, - 1 * p.y)); + } + else { + lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y)); + } + } + else { + lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c))); + } + p.x = lon; + p.y = lat; + return p; + } + else { + if (Math.abs(this.coslat0) <= EPSLN) { + if (rh <= EPSLN) { + lat = this.lat0; + lon = this.long0; + p.x = lon; + p.y = lat; + //trace(p.toString()); + return p; + } + p.x *= this.con; + p.y *= this.con; + ts = rh * this.cons / (2 * this.a * this.k0); + lat = this.con * phi2z(this.e, ts); + lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y)); + } + else { + ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1)); + lon = this.long0; + if (rh <= EPSLN) { + Chi = this.X0; + } + else { + Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh); + lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce))); + } + lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi))); + } + } + p.x = lon; + p.y = lat; + + //trace(p.toString()); + return p; + + } + + var names$8 = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)"]; + var stere = { + init: init$7, + forward: forward$6, + inverse: inverse$6, + names: names$8, + ssfn_: ssfn_ + }; + + /* + references: + Formules et constantes pour le Calcul pour la + projection cylindrique conforme à axe oblique et pour la transformation entre + des systèmes de référence. + http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf + */ + + function init$8() { + var phy0 = this.lat0; + this.lambda0 = this.long0; + var sinPhy0 = Math.sin(phy0); + var semiMajorAxis = this.a; + var invF = this.rf; + var flattening = 1 / invF; + var e2 = 2 * flattening - Math.pow(flattening, 2); + var e = this.e = Math.sqrt(e2); + this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2)); + this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4)); + this.b0 = Math.asin(sinPhy0 / this.alpha); + var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2)); + var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2)); + var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0)); + this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3; + } + + function forward$7(p) { + var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2)); + var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y))); + var S = -this.alpha * (Sa1 + Sa2) + this.K; + + // spheric latitude + var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4); + + // spheric longitude + var I = this.alpha * (p.x - this.lambda0); + + // psoeudo equatorial rotation + var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I))); + + var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I)); + + p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0; + p.x = this.R * rotI + this.x0; + return p; + } + + function inverse$7(p) { + var Y = p.x - this.x0; + var X = p.y - this.y0; + + var rotI = Y / this.R; + var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4); + + var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI)); + var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB))); + + var lambda = this.lambda0 + I / this.alpha; + + var S = 0; + var phy = b; + var prevPhy = -1000; + var iteration = 0; + while (Math.abs(phy - prevPhy) > 0.0000001) { + if (++iteration > 20) { + //...reportError("omercFwdInfinity"); + return; + } + //S = Math.log(Math.tan(Math.PI / 4 + phy / 2)); + S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2)); + prevPhy = phy; + phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2; + } + + p.x = lambda; + p.y = phy; + return p; + } + + var names$9 = ["somerc"]; + var somerc = { + init: init$8, + forward: forward$7, + inverse: inverse$7, + names: names$9 + }; + + var TOL = 1e-7; + + function isTypeA(P) { + var typeAProjections = ['Hotine_Oblique_Mercator','Hotine_Oblique_Mercator_Azimuth_Natural_Origin']; + var projectionName = typeof P.PROJECTION === "object" ? Object.keys(P.PROJECTION)[0] : P.PROJECTION; + + return 'no_uoff' in P || 'no_off' in P || typeAProjections.indexOf(projectionName) !== -1; + } + + + /* Initialize the Oblique Mercator projection + ------------------------------------------*/ + function init$9() { + var con, com, cosph0, D, F, H, L, sinph0, p, J, gamma = 0, + gamma0, lamc = 0, lam1 = 0, lam2 = 0, phi1 = 0, phi2 = 0, alpha_c = 0; + + // only Type A uses the no_off or no_uoff property + // https://github.com/OSGeo/proj.4/issues/104 + this.no_off = isTypeA(this); + this.no_rot = 'no_rot' in this; + + var alp = false; + if ("alpha" in this) { + alp = true; + } + + var gam = false; + if ("rectified_grid_angle" in this) { + gam = true; + } + + if (alp) { + alpha_c = this.alpha; + } + + if (gam) { + gamma = (this.rectified_grid_angle * D2R); + } + + if (alp || gam) { + lamc = this.longc; + } else { + lam1 = this.long1; + phi1 = this.lat1; + lam2 = this.long2; + phi2 = this.lat2; + + if (Math.abs(phi1 - phi2) <= TOL || (con = Math.abs(phi1)) <= TOL || + Math.abs(con - HALF_PI) <= TOL || Math.abs(Math.abs(this.lat0) - HALF_PI) <= TOL || + Math.abs(Math.abs(phi2) - HALF_PI) <= TOL) { + throw new Error(); + } + } + + var one_es = 1.0 - this.es; + com = Math.sqrt(one_es); + + if (Math.abs(this.lat0) > EPSLN) { + sinph0 = Math.sin(this.lat0); + cosph0 = Math.cos(this.lat0); + con = 1 - this.es * sinph0 * sinph0; + this.B = cosph0 * cosph0; + this.B = Math.sqrt(1 + this.es * this.B * this.B / one_es); + this.A = this.B * this.k0 * com / con; + D = this.B * com / (cosph0 * Math.sqrt(con)); + F = D * D -1; + + if (F <= 0) { + F = 0; + } else { + F = Math.sqrt(F); + if (this.lat0 < 0) { + F = -F; + } + } + + this.E = F += D; + this.E *= Math.pow(tsfnz(this.e, this.lat0, sinph0), this.B); + } else { + this.B = 1 / com; + this.A = this.k0; + this.E = D = F = 1; + } + + if (alp || gam) { + if (alp) { + gamma0 = Math.asin(Math.sin(alpha_c) / D); + if (!gam) { + gamma = alpha_c; + } + } else { + gamma0 = gamma; + alpha_c = Math.asin(D * Math.sin(gamma0)); + } + this.lam0 = lamc - Math.asin(0.5 * (F - 1 / F) * Math.tan(gamma0)) / this.B; + } else { + H = Math.pow(tsfnz(this.e, phi1, Math.sin(phi1)), this.B); + L = Math.pow(tsfnz(this.e, phi2, Math.sin(phi2)), this.B); + F = this.E / H; + p = (L - H) / (L + H); + J = this.E * this.E; + J = (J - L * H) / (J + L * H); + con = lam1 - lam2; + + if (con < -Math.pi) { + lam2 -=TWO_PI; + } else if (con > Math.pi) { + lam2 += TWO_PI; + } + + this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B); + gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0)) / (F - 1 / F)); + gamma = alpha_c = Math.asin(D * Math.sin(gamma0)); + } + + this.singam = Math.sin(gamma0); + this.cosgam = Math.cos(gamma0); + this.sinrot = Math.sin(gamma); + this.cosrot = Math.cos(gamma); + + this.rB = 1 / this.B; + this.ArB = this.A * this.rB; + this.BrA = 1 / this.ArB; + if (this.no_off) { + this.u_0 = 0; + } else { + this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(D * D - 1) / Math.cos(alpha_c))); + + if (this.lat0 < 0) { + this.u_0 = - this.u_0; + } + } + + F = 0.5 * gamma0; + this.v_pole_n = this.ArB * Math.log(Math.tan(FORTPI - F)); + this.v_pole_s = this.ArB * Math.log(Math.tan(FORTPI + F)); + } + + + /* Oblique Mercator forward equations--mapping lat,long to x,y + ----------------------------------------------------------*/ + function forward$8(p) { + var coords = {}; + var S, T, U, V, W, temp, u, v; + p.x = p.x - this.lam0; + + if (Math.abs(Math.abs(p.y) - HALF_PI) > EPSLN) { + W = this.E / Math.pow(tsfnz(this.e, p.y, Math.sin(p.y)), this.B); + + temp = 1 / W; + S = 0.5 * (W - temp); + T = 0.5 * (W + temp); + V = Math.sin(this.B * p.x); + U = (S * this.singam - V * this.cosgam) / T; + + if (Math.abs(Math.abs(U) - 1.0) < EPSLN) { + throw new Error(); + } + + v = 0.5 * this.ArB * Math.log((1 - U)/(1 + U)); + temp = Math.cos(this.B * p.x); + + if (Math.abs(temp) < TOL) { + u = this.A * p.x; + } else { + u = this.ArB * Math.atan2((S * this.cosgam + V * this.singam), temp); + } + } else { + v = p.y > 0 ? this.v_pole_n : this.v_pole_s; + u = this.ArB * p.y; + } + + if (this.no_rot) { + coords.x = u; + coords.y = v; + } else { + u -= this.u_0; + coords.x = v * this.cosrot + u * this.sinrot; + coords.y = u * this.cosrot - v * this.sinrot; + } + + coords.x = (this.a * coords.x + this.x0); + coords.y = (this.a * coords.y + this.y0); + + return coords; + } + + function inverse$8(p) { + var u, v, Qp, Sp, Tp, Vp, Up; + var coords = {}; + + p.x = (p.x - this.x0) * (1.0 / this.a); + p.y = (p.y - this.y0) * (1.0 / this.a); + + if (this.no_rot) { + v = p.y; + u = p.x; + } else { + v = p.x * this.cosrot - p.y * this.sinrot; + u = p.y * this.cosrot + p.x * this.sinrot + this.u_0; + } + + Qp = Math.exp(-this.BrA * v); + Sp = 0.5 * (Qp - 1 / Qp); + Tp = 0.5 * (Qp + 1 / Qp); + Vp = Math.sin(this.BrA * u); + Up = (Vp * this.cosgam + Sp * this.singam) / Tp; + + if (Math.abs(Math.abs(Up) - 1) < EPSLN) { + coords.x = 0; + coords.y = Up < 0 ? -HALF_PI : HALF_PI; + } else { + coords.y = this.E / Math.sqrt((1 + Up) / (1 - Up)); + coords.y = phi2z(this.e, Math.pow(coords.y, 1 / this.B)); + + if (coords.y === Infinity) { + throw new Error(); + } + + coords.x = -this.rB * Math.atan2((Sp * this.cosgam - Vp * this.singam), Math.cos(this.BrA * u)); + } + + coords.x += this.lam0; + + return coords; + } + + var names$10 = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"]; + var omerc = { + init: init$9, + forward: forward$8, + inverse: inverse$8, + names: names$10 + }; + + function init$10() { + + //double lat0; /* the reference latitude */ + //double long0; /* the reference longitude */ + //double lat1; /* first standard parallel */ + //double lat2; /* second standard parallel */ + //double r_maj; /* major axis */ + //double r_min; /* minor axis */ + //double false_east; /* x offset in meters */ + //double false_north; /* y offset in meters */ + + //the above value can be set with proj4.defs + //example: proj4.defs("EPSG:2154","+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + + if (!this.lat2) { + this.lat2 = this.lat1; + } //if lat2 is not defined + if (!this.k0) { + this.k0 = 1; + } + this.x0 = this.x0 || 0; + this.y0 = this.y0 || 0; + // Standard Parallels cannot be equal and on opposite sides of the equator + if (Math.abs(this.lat1 + this.lat2) < EPSLN) { + return; + } + + var temp = this.b / this.a; + this.e = Math.sqrt(1 - temp * temp); + + var sin1 = Math.sin(this.lat1); + var cos1 = Math.cos(this.lat1); + var ms1 = msfnz(this.e, sin1, cos1); + var ts1 = tsfnz(this.e, this.lat1, sin1); + + var sin2 = Math.sin(this.lat2); + var cos2 = Math.cos(this.lat2); + var ms2 = msfnz(this.e, sin2, cos2); + var ts2 = tsfnz(this.e, this.lat2, sin2); + + var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0)); + + if (Math.abs(this.lat1 - this.lat2) > EPSLN) { + this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2); + } + else { + this.ns = sin1; + } + if (isNaN(this.ns)) { + this.ns = sin1; + } + this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns)); + this.rh = this.a * this.f0 * Math.pow(ts0, this.ns); + if (!this.title) { + this.title = "Lambert Conformal Conic"; + } + } + + // Lambert Conformal conic forward equations--mapping lat,long to x,y + // ----------------------------------------------------------------- + function forward$9(p) { + + var lon = p.x; + var lat = p.y; + + // singular cases : + if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) { + lat = sign(lat) * (HALF_PI - 2 * EPSLN); + } + + var con = Math.abs(Math.abs(lat) - HALF_PI); + var ts, rh1; + if (con > EPSLN) { + ts = tsfnz(this.e, lat, Math.sin(lat)); + rh1 = this.a * this.f0 * Math.pow(ts, this.ns); + } + else { + con = lat * this.ns; + if (con <= 0) { + return null; + } + rh1 = 0; + } + var theta = this.ns * adjust_lon(lon - this.long0); + p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0; + p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0; + + return p; + } + + // Lambert Conformal Conic inverse equations--mapping x,y to lat/long + // ----------------------------------------------------------------- + function inverse$9(p) { + + var rh1, con, ts; + var lat, lon; + var x = (p.x - this.x0) / this.k0; + var y = (this.rh - (p.y - this.y0) / this.k0); + if (this.ns > 0) { + rh1 = Math.sqrt(x * x + y * y); + con = 1; + } + else { + rh1 = -Math.sqrt(x * x + y * y); + con = -1; + } + var theta = 0; + if (rh1 !== 0) { + theta = Math.atan2((con * x), (con * y)); + } + if ((rh1 !== 0) || (this.ns > 0)) { + con = 1 / this.ns; + ts = Math.pow((rh1 / (this.a * this.f0)), con); + lat = phi2z(this.e, ts); + if (lat === -9999) { + return null; + } + } + else { + lat = -HALF_PI; + } + lon = adjust_lon(theta / this.ns + this.long0); + + p.x = lon; + p.y = lat; + return p; + } + + var names$11 = [ + "Lambert Tangential Conformal Conic Projection", + "Lambert_Conformal_Conic", + "Lambert_Conformal_Conic_1SP", + "Lambert_Conformal_Conic_2SP", + "lcc" + ]; + + var lcc = { + init: init$10, + forward: forward$9, + inverse: inverse$9, + names: names$11 + }; + + function init$11() { + this.a = 6377397.155; + this.es = 0.006674372230614; + this.e = Math.sqrt(this.es); + if (!this.lat0) { + this.lat0 = 0.863937979737193; + } + if (!this.long0) { + this.long0 = 0.7417649320975901 - 0.308341501185665; + } + /* if scale not set default to 0.9999 */ + if (!this.k0) { + this.k0 = 0.9999; + } + this.s45 = 0.785398163397448; /* 45 */ + this.s90 = 2 * this.s45; + this.fi0 = this.lat0; + this.e2 = this.es; + this.e = Math.sqrt(this.e2); + this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2)); + this.uq = 1.04216856380474; + this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa); + this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2); + this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g; + this.k1 = this.k0; + this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)); + this.s0 = 1.37008346281555; + this.n = Math.sin(this.s0); + this.ro0 = this.k1 * this.n0 / Math.tan(this.s0); + this.ad = this.s90 - this.uq; + } + + /* ellipsoid */ + /* calculate xy from lat/lon */ + /* Constants, identical to inverse transform function */ + function forward$10(p) { + var gfi, u, deltav, s, d, eps, ro; + var lon = p.x; + var lat = p.y; + var delta_lon = adjust_lon(lon - this.long0); + /* Transformation */ + gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2)); + u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45); + deltav = -delta_lon * this.alfa; + s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav)); + d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s)); + eps = this.n * d; + ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n); + p.y = ro * Math.cos(eps) / 1; + p.x = ro * Math.sin(eps) / 1; + + if (!this.czech) { + p.y *= -1; + p.x *= -1; + } + return (p); + } + + /* calculate lat/lon from xy */ + function inverse$10(p) { + var u, deltav, s, d, eps, ro, fi1; + var ok; + + /* Transformation */ + /* revert y, x*/ + var tmp = p.x; + p.x = p.y; + p.y = tmp; + if (!this.czech) { + p.y *= -1; + p.x *= -1; + } + ro = Math.sqrt(p.x * p.x + p.y * p.y); + eps = Math.atan2(p.y, p.x); + d = eps / Math.sin(this.s0); + s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45); + u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d)); + deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u)); + p.x = this.long0 - deltav / this.alfa; + fi1 = u; + ok = 0; + var iter = 0; + do { + p.y = 2 * (Math.atan(Math.pow(this.k, - 1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45); + if (Math.abs(fi1 - p.y) < 0.0000000001) { + ok = 1; + } + fi1 = p.y; + iter += 1; + } while (ok === 0 && iter < 15); + if (iter >= 15) { + return null; + } + + return (p); + } + + var names$12 = ["Krovak", "krovak"]; + var krovak = { + init: init$11, + forward: forward$10, + inverse: inverse$10, + names: names$12 + }; + + var mlfn = function(e0, e1, e2, e3, phi) { + return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi)); + }; + + var e0fn = function(x) { + return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x))); + }; + + var e1fn = function(x) { + return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x))); + }; + + var e2fn = function(x) { + return (0.05859375 * x * x * (1 + 0.75 * x)); + }; + + var e3fn = function(x) { + return (x * x * x * (35 / 3072)); + }; + + var gN = function(a, e, sinphi) { + var temp = e * sinphi; + return a / Math.sqrt(1 - temp * temp); + }; + + var adjust_lat = function(x) { + return (Math.abs(x) < HALF_PI) ? x : (x - (sign(x) * Math.PI)); + }; + + var imlfn = function(ml, e0, e1, e2, e3) { + var phi; + var dphi; + + phi = ml / e0; + for (var i = 0; i < 15; i++) { + dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi)); + phi += dphi; + if (Math.abs(dphi) <= 0.0000000001) { + return phi; + } + } + + //..reportError("IMLFN-CONV:Latitude failed to converge after 15 iterations"); + return NaN; + }; + + function init$12() { + if (!this.sphere) { + this.e0 = e0fn(this.es); + this.e1 = e1fn(this.es); + this.e2 = e2fn(this.es); + this.e3 = e3fn(this.es); + this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); + } + } + + /* Cassini forward equations--mapping lat,long to x,y + -----------------------------------------------------------------------*/ + function forward$11(p) { + + /* Forward equations + -----------------*/ + var x, y; + var lam = p.x; + var phi = p.y; + lam = adjust_lon(lam - this.long0); + + if (this.sphere) { + x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam)); + y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0); + } + else { + //ellipsoid + var sinphi = Math.sin(phi); + var cosphi = Math.cos(phi); + var nl = gN(this.a, this.e, sinphi); + var tl = Math.tan(phi) * Math.tan(phi); + var al = lam * Math.cos(phi); + var asq = al * al; + var cl = this.es * cosphi * cosphi / (1 - this.es); + var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi); + + x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120)); + y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24); + + + } + + p.x = x + this.x0; + p.y = y + this.y0; + return p; + } + + /* Inverse equations + -----------------*/ + function inverse$11(p) { + p.x -= this.x0; + p.y -= this.y0; + var x = p.x / this.a; + var y = p.y / this.a; + var phi, lam; + + if (this.sphere) { + var dd = y + this.lat0; + phi = Math.asin(Math.sin(dd) * Math.cos(x)); + lam = Math.atan2(Math.tan(x), Math.cos(dd)); + } + else { + /* ellipsoid */ + var ml1 = this.ml0 / this.a + y; + var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3); + if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) { + p.x = this.long0; + p.y = HALF_PI; + if (y < 0) { + p.y *= -1; + } + return p; + } + var nl1 = gN(this.a, this.e, Math.sin(phi1)); + + var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es); + var tl1 = Math.pow(Math.tan(phi1), 2); + var dl = x * this.a / nl1; + var dsq = dl * dl; + phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24); + lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1); + + } + + p.x = adjust_lon(lam + this.long0); + p.y = adjust_lat(phi); + return p; + + } + + var names$13 = ["Cassini", "Cassini_Soldner", "cass"]; + var cass = { + init: init$12, + forward: forward$11, + inverse: inverse$11, + names: names$13 + }; + + var qsfnz = function(eccent, sinphi) { + var con; + if (eccent > 1.0e-7) { + con = eccent * sinphi; + return ((1 - eccent * eccent) * (sinphi / (1 - con * con) - (0.5 / eccent) * Math.log((1 - con) / (1 + con)))); + } + else { + return (2 * sinphi); + } + }; + + /* + reference + "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder, + The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355. + */ + + var S_POLE = 1; + + var N_POLE = 2; + var EQUIT = 3; + var OBLIQ = 4; + + /* Initialize the Lambert Azimuthal Equal Area projection + ------------------------------------------------------*/ + function init$13() { + var t = Math.abs(this.lat0); + if (Math.abs(t - HALF_PI) < EPSLN) { + this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE; + } + else if (Math.abs(t) < EPSLN) { + this.mode = this.EQUIT; + } + else { + this.mode = this.OBLIQ; + } + if (this.es > 0) { + var sinphi; + + this.qp = qsfnz(this.e, 1); + this.mmf = 0.5 / (1 - this.es); + this.apa = authset(this.es); + switch (this.mode) { + case this.N_POLE: + this.dd = 1; + break; + case this.S_POLE: + this.dd = 1; + break; + case this.EQUIT: + this.rq = Math.sqrt(0.5 * this.qp); + this.dd = 1 / this.rq; + this.xmf = 1; + this.ymf = 0.5 * this.qp; + break; + case this.OBLIQ: + this.rq = Math.sqrt(0.5 * this.qp); + sinphi = Math.sin(this.lat0); + this.sinb1 = qsfnz(this.e, sinphi) / this.qp; + this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1); + this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1); + this.ymf = (this.xmf = this.rq) / this.dd; + this.xmf *= this.dd; + break; + } + } + else { + if (this.mode === this.OBLIQ) { + this.sinph0 = Math.sin(this.lat0); + this.cosph0 = Math.cos(this.lat0); + } + } + } + + /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y + -----------------------------------------------------------------------*/ + function forward$12(p) { + + /* Forward equations + -----------------*/ + var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi; + var lam = p.x; + var phi = p.y; + + lam = adjust_lon(lam - this.long0); + if (this.sphere) { + sinphi = Math.sin(phi); + cosphi = Math.cos(phi); + coslam = Math.cos(lam); + if (this.mode === this.OBLIQ || this.mode === this.EQUIT) { + y = (this.mode === this.EQUIT) ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam; + if (y <= EPSLN) { + return null; + } + y = Math.sqrt(2 / y); + x = y * cosphi * Math.sin(lam); + y *= (this.mode === this.EQUIT) ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam; + } + else if (this.mode === this.N_POLE || this.mode === this.S_POLE) { + if (this.mode === this.N_POLE) { + coslam = -coslam; + } + if (Math.abs(phi + this.lat0) < EPSLN) { + return null; + } + y = FORTPI - phi * 0.5; + y = 2 * ((this.mode === this.S_POLE) ? Math.cos(y) : Math.sin(y)); + x = y * Math.sin(lam); + y *= coslam; + } + } + else { + sinb = 0; + cosb = 0; + b = 0; + coslam = Math.cos(lam); + sinlam = Math.sin(lam); + sinphi = Math.sin(phi); + q = qsfnz(this.e, sinphi); + if (this.mode === this.OBLIQ || this.mode === this.EQUIT) { + sinb = q / this.qp; + cosb = Math.sqrt(1 - sinb * sinb); + } + switch (this.mode) { + case this.OBLIQ: + b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam; + break; + case this.EQUIT: + b = 1 + cosb * coslam; + break; + case this.N_POLE: + b = HALF_PI + phi; + q = this.qp - q; + break; + case this.S_POLE: + b = phi - HALF_PI; + q = this.qp + q; + break; + } + if (Math.abs(b) < EPSLN) { + return null; + } + switch (this.mode) { + case this.OBLIQ: + case this.EQUIT: + b = Math.sqrt(2 / b); + if (this.mode === this.OBLIQ) { + y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam); + } + else { + y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf; + } + x = this.xmf * b * cosb * sinlam; + break; + case this.N_POLE: + case this.S_POLE: + if (q >= 0) { + x = (b = Math.sqrt(q)) * sinlam; + y = coslam * ((this.mode === this.S_POLE) ? b : -b); + } + else { + x = y = 0; + } + break; + } + } + + p.x = this.a * x + this.x0; + p.y = this.a * y + this.y0; + return p; + } + + /* Inverse equations + -----------------*/ + function inverse$12(p) { + p.x -= this.x0; + p.y -= this.y0; + var x = p.x / this.a; + var y = p.y / this.a; + var lam, phi, cCe, sCe, q, rho, ab; + if (this.sphere) { + var cosz = 0, + rh, sinz = 0; + + rh = Math.sqrt(x * x + y * y); + phi = rh * 0.5; + if (phi > 1) { + return null; + } + phi = 2 * Math.asin(phi); + if (this.mode === this.OBLIQ || this.mode === this.EQUIT) { + sinz = Math.sin(phi); + cosz = Math.cos(phi); + } + switch (this.mode) { + case this.EQUIT: + phi = (Math.abs(rh) <= EPSLN) ? 0 : Math.asin(y * sinz / rh); + x *= sinz; + y = cosz * rh; + break; + case this.OBLIQ: + phi = (Math.abs(rh) <= EPSLN) ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh); + x *= sinz * this.cosph0; + y = (cosz - Math.sin(phi) * this.sinph0) * rh; + break; + case this.N_POLE: + y = -y; + phi = HALF_PI - phi; + break; + case this.S_POLE: + phi -= HALF_PI; + break; + } + lam = (y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ)) ? 0 : Math.atan2(x, y); + } + else { + ab = 0; + if (this.mode === this.OBLIQ || this.mode === this.EQUIT) { + x /= this.dd; + y *= this.dd; + rho = Math.sqrt(x * x + y * y); + if (rho < EPSLN) { + p.x = this.long0; + p.y = this.lat0; + return p; + } + sCe = 2 * Math.asin(0.5 * rho / this.rq); + cCe = Math.cos(sCe); + x *= (sCe = Math.sin(sCe)); + if (this.mode === this.OBLIQ) { + ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho; + q = this.qp * ab; + y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe; + } + else { + ab = y * sCe / rho; + q = this.qp * ab; + y = rho * cCe; + } + } + else if (this.mode === this.N_POLE || this.mode === this.S_POLE) { + if (this.mode === this.N_POLE) { + y = -y; + } + q = (x * x + y * y); + if (!q) { + p.x = this.long0; + p.y = this.lat0; + return p; + } + ab = 1 - q / this.qp; + if (this.mode === this.S_POLE) { + ab = -ab; + } + } + lam = Math.atan2(x, y); + phi = authlat(Math.asin(ab), this.apa); + } + + p.x = adjust_lon(this.long0 + lam); + p.y = phi; + return p; + } + + /* determine latitude from authalic latitude */ + var P00 = 0.33333333333333333333; + + var P01 = 0.17222222222222222222; + var P02 = 0.10257936507936507936; + var P10 = 0.06388888888888888888; + var P11 = 0.06640211640211640211; + var P20 = 0.01641501294219154443; + + function authset(es) { + var t; + var APA = []; + APA[0] = es * P00; + t = es * es; + APA[0] += t * P01; + APA[1] = t * P10; + t *= es; + APA[0] += t * P02; + APA[1] += t * P11; + APA[2] = t * P20; + return APA; + } + + function authlat(beta, APA) { + var t = beta + beta; + return (beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t)); + } + + var names$14 = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"]; + var laea = { + init: init$13, + forward: forward$12, + inverse: inverse$12, + names: names$14, + S_POLE: S_POLE, + N_POLE: N_POLE, + EQUIT: EQUIT, + OBLIQ: OBLIQ + }; + + var asinz = function(x) { + if (Math.abs(x) > 1) { + x = (x > 1) ? 1 : -1; + } + return Math.asin(x); + }; + + function init$14() { + + if (Math.abs(this.lat1 + this.lat2) < EPSLN) { + return; + } + this.temp = this.b / this.a; + this.es = 1 - Math.pow(this.temp, 2); + this.e3 = Math.sqrt(this.es); + + this.sin_po = Math.sin(this.lat1); + this.cos_po = Math.cos(this.lat1); + this.t1 = this.sin_po; + this.con = this.sin_po; + this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po); + this.qs1 = qsfnz(this.e3, this.sin_po, this.cos_po); + + this.sin_po = Math.sin(this.lat2); + this.cos_po = Math.cos(this.lat2); + this.t2 = this.sin_po; + this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po); + this.qs2 = qsfnz(this.e3, this.sin_po, this.cos_po); + + this.sin_po = Math.sin(this.lat0); + this.cos_po = Math.cos(this.lat0); + this.t3 = this.sin_po; + this.qs0 = qsfnz(this.e3, this.sin_po, this.cos_po); + + if (Math.abs(this.lat1 - this.lat2) > EPSLN) { + this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1); + } + else { + this.ns0 = this.con; + } + this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1; + this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0; + } + + /* Albers Conical Equal Area forward equations--mapping lat,long to x,y + -------------------------------------------------------------------*/ + function forward$13(p) { + + var lon = p.x; + var lat = p.y; + + this.sin_phi = Math.sin(lat); + this.cos_phi = Math.cos(lat); + + var qs = qsfnz(this.e3, this.sin_phi, this.cos_phi); + var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0; + var theta = this.ns0 * adjust_lon(lon - this.long0); + var x = rh1 * Math.sin(theta) + this.x0; + var y = this.rh - rh1 * Math.cos(theta) + this.y0; + + p.x = x; + p.y = y; + return p; + } + + function inverse$13(p) { + var rh1, qs, con, theta, lon, lat; + + p.x -= this.x0; + p.y = this.rh - p.y + this.y0; + if (this.ns0 >= 0) { + rh1 = Math.sqrt(p.x * p.x + p.y * p.y); + con = 1; + } + else { + rh1 = -Math.sqrt(p.x * p.x + p.y * p.y); + con = -1; + } + theta = 0; + if (rh1 !== 0) { + theta = Math.atan2(con * p.x, con * p.y); + } + con = rh1 * this.ns0 / this.a; + if (this.sphere) { + lat = Math.asin((this.c - con * con) / (2 * this.ns0)); + } + else { + qs = (this.c - con * con) / this.ns0; + lat = this.phi1z(this.e3, qs); + } + + lon = adjust_lon(theta / this.ns0 + this.long0); + p.x = lon; + p.y = lat; + return p; + } + + /* Function to compute phi1, the latitude for the inverse of the + Albers Conical Equal-Area projection. + -------------------------------------------*/ + function phi1z(eccent, qs) { + var sinphi, cosphi, con, com, dphi; + var phi = asinz(0.5 * qs); + if (eccent < EPSLN) { + return phi; + } + + var eccnts = eccent * eccent; + for (var i = 1; i <= 25; i++) { + sinphi = Math.sin(phi); + cosphi = Math.cos(phi); + con = eccent * sinphi; + com = 1 - con * con; + dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con))); + phi = phi + dphi; + if (Math.abs(dphi) <= 1e-7) { + return phi; + } + } + return null; + } + + var names$15 = ["Albers_Conic_Equal_Area", "Albers", "aea"]; + var aea = { + init: init$14, + forward: forward$13, + inverse: inverse$13, + names: names$15, + phi1z: phi1z + }; + + /* + reference: + Wolfram Mathworld "Gnomonic Projection" + http://mathworld.wolfram.com/GnomonicProjection.html + Accessed: 12th November 2009 + */ + function init$15() { + + /* Place parameters in static storage for common use + -------------------------------------------------*/ + this.sin_p14 = Math.sin(this.lat0); + this.cos_p14 = Math.cos(this.lat0); + // Approximation for projecting points to the horizon (infinity) + this.infinity_dist = 1000 * this.a; + this.rc = 1; + } + + /* Gnomonic forward equations--mapping lat,long to x,y + ---------------------------------------------------*/ + function forward$14(p) { + var sinphi, cosphi; /* sin and cos value */ + var dlon; /* delta longitude value */ + var coslon; /* cos of longitude */ + var ksp; /* scale factor */ + var g; + var x, y; + var lon = p.x; + var lat = p.y; + /* Forward equations + -----------------*/ + dlon = adjust_lon(lon - this.long0); + + sinphi = Math.sin(lat); + cosphi = Math.cos(lat); + + coslon = Math.cos(dlon); + g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon; + ksp = 1; + if ((g > 0) || (Math.abs(g) <= EPSLN)) { + x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g; + y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g; + } + else { + + // Point is in the opposing hemisphere and is unprojectable + // We still need to return a reasonable point, so we project + // to infinity, on a bearing + // equivalent to the northern hemisphere equivalent + // This is a reasonable approximation for short shapes and lines that + // straddle the horizon. + + x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon); + y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon); + + } + p.x = x; + p.y = y; + return p; + } + + function inverse$14(p) { + var rh; /* Rho */ + var sinc, cosc; + var c; + var lon, lat; + + /* Inverse equations + -----------------*/ + p.x = (p.x - this.x0) / this.a; + p.y = (p.y - this.y0) / this.a; + + p.x /= this.k0; + p.y /= this.k0; + + if ((rh = Math.sqrt(p.x * p.x + p.y * p.y))) { + c = Math.atan2(rh, this.rc); + sinc = Math.sin(c); + cosc = Math.cos(c); + + lat = asinz(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh); + lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc); + lon = adjust_lon(this.long0 + lon); + } + else { + lat = this.phic0; + lon = 0; + } + + p.x = lon; + p.y = lat; + return p; + } + + var names$16 = ["gnom"]; + var gnom = { + init: init$15, + forward: forward$14, + inverse: inverse$14, + names: names$16 + }; + + var iqsfnz = function(eccent, q) { + var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent)); + if (Math.abs(Math.abs(q) - temp) < 1.0E-6) { + if (q < 0) { + return (-1 * HALF_PI); + } + else { + return HALF_PI; + } + } + //var phi = 0.5* q/(1-eccent*eccent); + var phi = Math.asin(0.5 * q); + var dphi; + var sin_phi; + var cos_phi; + var con; + for (var i = 0; i < 30; i++) { + sin_phi = Math.sin(phi); + cos_phi = Math.cos(phi); + con = eccent * sin_phi; + dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con))); + phi += dphi; + if (Math.abs(dphi) <= 0.0000000001) { + return phi; + } + } + + //console.log("IQSFN-CONV:Latitude failed to converge after 30 iterations"); + return NaN; + }; + + /* + reference: + "Cartographic Projection Procedures for the UNIX Environment- + A User's Manual" by Gerald I. Evenden, + USGS Open File Report 90-284and Release 4 Interim Reports (2003) + */ + function init$16() { + //no-op + if (!this.sphere) { + this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)); + } + } + + /* Cylindrical Equal Area forward equations--mapping lat,long to x,y + ------------------------------------------------------------*/ + function forward$15(p) { + var lon = p.x; + var lat = p.y; + var x, y; + /* Forward equations + -----------------*/ + var dlon = adjust_lon(lon - this.long0); + if (this.sphere) { + x = this.x0 + this.a * dlon * Math.cos(this.lat_ts); + y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts); + } + else { + var qs = qsfnz(this.e, Math.sin(lat)); + x = this.x0 + this.a * this.k0 * dlon; + y = this.y0 + this.a * qs * 0.5 / this.k0; + } + + p.x = x; + p.y = y; + return p; + } + + /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long + ------------------------------------------------------------*/ + function inverse$15(p) { + p.x -= this.x0; + p.y -= this.y0; + var lon, lat; + + if (this.sphere) { + lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts)); + lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts)); + } + else { + lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a); + lon = adjust_lon(this.long0 + p.x / (this.a * this.k0)); + } + + p.x = lon; + p.y = lat; + return p; + } + + var names$17 = ["cea"]; + var cea = { + init: init$16, + forward: forward$15, + inverse: inverse$15, + names: names$17 + }; + + function init$17() { + + this.x0 = this.x0 || 0; + this.y0 = this.y0 || 0; + this.lat0 = this.lat0 || 0; + this.long0 = this.long0 || 0; + this.lat_ts = this.lat_ts || 0; + this.title = this.title || "Equidistant Cylindrical (Plate Carre)"; + + this.rc = Math.cos(this.lat_ts); + } + + // forward equations--mapping lat,long to x,y + // ----------------------------------------------------------------- + function forward$16(p) { + + var lon = p.x; + var lat = p.y; + + var dlon = adjust_lon(lon - this.long0); + var dlat = adjust_lat(lat - this.lat0); + p.x = this.x0 + (this.a * dlon * this.rc); + p.y = this.y0 + (this.a * dlat); + return p; + } + + // inverse equations--mapping x,y to lat/long + // ----------------------------------------------------------------- + function inverse$16(p) { + + var x = p.x; + var y = p.y; + + p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc))); + p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a))); + return p; + } + + var names$18 = ["Equirectangular", "Equidistant_Cylindrical", "eqc"]; + var eqc = { + init: init$17, + forward: forward$16, + inverse: inverse$16, + names: names$18 + }; + + var MAX_ITER$2 = 20; + + function init$18() { + /* Place parameters in static storage for common use + -------------------------------------------------*/ + this.temp = this.b / this.a; + this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles + this.e = Math.sqrt(this.es); + this.e0 = e0fn(this.es); + this.e1 = e1fn(this.es); + this.e2 = e2fn(this.es); + this.e3 = e3fn(this.es); + this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas + } + + /* Polyconic forward equations--mapping lat,long to x,y + ---------------------------------------------------*/ + function forward$17(p) { + var lon = p.x; + var lat = p.y; + var x, y, el; + var dlon = adjust_lon(lon - this.long0); + el = dlon * Math.sin(lat); + if (this.sphere) { + if (Math.abs(lat) <= EPSLN) { + x = this.a * dlon; + y = -1 * this.a * this.lat0; + } + else { + x = this.a * Math.sin(el) / Math.tan(lat); + y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat)); + } + } + else { + if (Math.abs(lat) <= EPSLN) { + x = this.a * dlon; + y = -1 * this.ml0; + } + else { + var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat); + x = nl * Math.sin(el); + y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el)); + } + + } + p.x = x + this.x0; + p.y = y + this.y0; + return p; + } + + /* Inverse equations + -----------------*/ + function inverse$17(p) { + var lon, lat, x, y, i; + var al, bl; + var phi, dphi; + x = p.x - this.x0; + y = p.y - this.y0; + + if (this.sphere) { + if (Math.abs(y + this.a * this.lat0) <= EPSLN) { + lon = adjust_lon(x / this.a + this.long0); + lat = 0; + } + else { + al = this.lat0 + y / this.a; + bl = x * x / this.a / this.a + al * al; + phi = al; + var tanphi; + for (i = MAX_ITER$2; i; --i) { + tanphi = Math.tan(phi); + dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1); + phi += dphi; + if (Math.abs(dphi) <= EPSLN) { + lat = phi; + break; + } + } + lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat)); + } + } + else { + if (Math.abs(y + this.ml0) <= EPSLN) { + lat = 0; + lon = adjust_lon(this.long0 + x / this.a); + } + else { + + al = (this.ml0 + y) / this.a; + bl = x * x / this.a / this.a + al * al; + phi = al; + var cl, mln, mlnp, ma; + var con; + for (i = MAX_ITER$2; i; --i) { + con = this.e * Math.sin(phi); + cl = Math.sqrt(1 - con * con) * Math.tan(phi); + mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi); + mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi); + ma = mln / this.a; + dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp); + phi -= dphi; + if (Math.abs(dphi) <= EPSLN) { + lat = phi; + break; + } + } + + //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0); + cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat); + lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat)); + } + } + + p.x = lon; + p.y = lat; + return p; + } + + var names$19 = ["Polyconic", "poly"]; + var poly = { + init: init$18, + forward: forward$17, + inverse: inverse$17, + names: names$19 + }; + + /* + reference + Department of Land and Survey Technical Circular 1973/32 + http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf + OSG Technical Report 4.1 + http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf + */ + + /** + * iterations: Number of iterations to refine inverse transform. + * 0 -> km accuracy + * 1 -> m accuracy -- suitable for most mapping applications + * 2 -> mm accuracy + */ + + + function init$19() { + this.A = []; + this.A[1] = 0.6399175073; + this.A[2] = -0.1358797613; + this.A[3] = 0.063294409; + this.A[4] = -0.02526853; + this.A[5] = 0.0117879; + this.A[6] = -0.0055161; + this.A[7] = 0.0026906; + this.A[8] = -0.001333; + this.A[9] = 0.00067; + this.A[10] = -0.00034; + + this.B_re = []; + this.B_im = []; + this.B_re[1] = 0.7557853228; + this.B_im[1] = 0; + this.B_re[2] = 0.249204646; + this.B_im[2] = 0.003371507; + this.B_re[3] = -0.001541739; + this.B_im[3] = 0.041058560; + this.B_re[4] = -0.10162907; + this.B_im[4] = 0.01727609; + this.B_re[5] = -0.26623489; + this.B_im[5] = -0.36249218; + this.B_re[6] = -0.6870983; + this.B_im[6] = -1.1651967; + + this.C_re = []; + this.C_im = []; + this.C_re[1] = 1.3231270439; + this.C_im[1] = 0; + this.C_re[2] = -0.577245789; + this.C_im[2] = -0.007809598; + this.C_re[3] = 0.508307513; + this.C_im[3] = -0.112208952; + this.C_re[4] = -0.15094762; + this.C_im[4] = 0.18200602; + this.C_re[5] = 1.01418179; + this.C_im[5] = 1.64497696; + this.C_re[6] = 1.9660549; + this.C_im[6] = 2.5127645; + + this.D = []; + this.D[1] = 1.5627014243; + this.D[2] = 0.5185406398; + this.D[3] = -0.03333098; + this.D[4] = -0.1052906; + this.D[5] = -0.0368594; + this.D[6] = 0.007317; + this.D[7] = 0.01220; + this.D[8] = 0.00394; + this.D[9] = -0.0013; + } + + /** + New Zealand Map Grid Forward - long/lat to x/y + long/lat in radians + */ + function forward$18(p) { + var n; + var lon = p.x; + var lat = p.y; + + var delta_lat = lat - this.lat0; + var delta_lon = lon - this.long0; + + // 1. Calculate d_phi and d_psi ... // and d_lambda + // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians. + var d_phi = delta_lat / SEC_TO_RAD * 1E-5; + var d_lambda = delta_lon; + var d_phi_n = 1; // d_phi^0 + + var d_psi = 0; + for (n = 1; n <= 10; n++) { + d_phi_n = d_phi_n * d_phi; + d_psi = d_psi + this.A[n] * d_phi_n; + } + + // 2. Calculate theta + var th_re = d_psi; + var th_im = d_lambda; + + // 3. Calculate z + var th_n_re = 1; + var th_n_im = 0; // theta^0 + var th_n_re1; + var th_n_im1; + + var z_re = 0; + var z_im = 0; + for (n = 1; n <= 6; n++) { + th_n_re1 = th_n_re * th_re - th_n_im * th_im; + th_n_im1 = th_n_im * th_re + th_n_re * th_im; + th_n_re = th_n_re1; + th_n_im = th_n_im1; + z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im; + z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im; + } + + // 4. Calculate easting and northing + p.x = (z_im * this.a) + this.x0; + p.y = (z_re * this.a) + this.y0; + + return p; + } + + /** + New Zealand Map Grid Inverse - x/y to long/lat + */ + function inverse$18(p) { + var n; + var x = p.x; + var y = p.y; + + var delta_x = x - this.x0; + var delta_y = y - this.y0; + + // 1. Calculate z + var z_re = delta_y / this.a; + var z_im = delta_x / this.a; + + // 2a. Calculate theta - first approximation gives km accuracy + var z_n_re = 1; + var z_n_im = 0; // z^0 + var z_n_re1; + var z_n_im1; + + var th_re = 0; + var th_im = 0; + for (n = 1; n <= 6; n++) { + z_n_re1 = z_n_re * z_re - z_n_im * z_im; + z_n_im1 = z_n_im * z_re + z_n_re * z_im; + z_n_re = z_n_re1; + z_n_im = z_n_im1; + th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im; + th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im; + } + + // 2b. Iterate to refine the accuracy of the calculation + // 0 iterations gives km accuracy + // 1 iteration gives m accuracy -- good enough for most mapping applications + // 2 iterations bives mm accuracy + for (var i = 0; i < this.iterations; i++) { + var th_n_re = th_re; + var th_n_im = th_im; + var th_n_re1; + var th_n_im1; + + var num_re = z_re; + var num_im = z_im; + for (n = 2; n <= 6; n++) { + th_n_re1 = th_n_re * th_re - th_n_im * th_im; + th_n_im1 = th_n_im * th_re + th_n_re * th_im; + th_n_re = th_n_re1; + th_n_im = th_n_im1; + num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im); + num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im); + } + + th_n_re = 1; + th_n_im = 0; + var den_re = this.B_re[1]; + var den_im = this.B_im[1]; + for (n = 2; n <= 6; n++) { + th_n_re1 = th_n_re * th_re - th_n_im * th_im; + th_n_im1 = th_n_im * th_re + th_n_re * th_im; + th_n_re = th_n_re1; + th_n_im = th_n_im1; + den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im); + den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im); + } + + // Complex division + var den2 = den_re * den_re + den_im * den_im; + th_re = (num_re * den_re + num_im * den_im) / den2; + th_im = (num_im * den_re - num_re * den_im) / den2; + } + + // 3. Calculate d_phi ... // and d_lambda + var d_psi = th_re; + var d_lambda = th_im; + var d_psi_n = 1; // d_psi^0 + + var d_phi = 0; + for (n = 1; n <= 9; n++) { + d_psi_n = d_psi_n * d_psi; + d_phi = d_phi + this.D[n] * d_psi_n; + } + + // 4. Calculate latitude and longitude + // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians. + var lat = this.lat0 + (d_phi * SEC_TO_RAD * 1E5); + var lon = this.long0 + d_lambda; + + p.x = lon; + p.y = lat; + + return p; + } + + var names$20 = ["New_Zealand_Map_Grid", "nzmg"]; + var nzmg = { + init: init$19, + forward: forward$18, + inverse: inverse$18, + names: names$20 + }; + + /* + reference + "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder, + The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355. + */ + + + /* Initialize the Miller Cylindrical projection + -------------------------------------------*/ + function init$20() { + //no-op + } + + /* Miller Cylindrical forward equations--mapping lat,long to x,y + ------------------------------------------------------------*/ + function forward$19(p) { + var lon = p.x; + var lat = p.y; + /* Forward equations + -----------------*/ + var dlon = adjust_lon(lon - this.long0); + var x = this.x0 + this.a * dlon; + var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25; + + p.x = x; + p.y = y; + return p; + } + + /* Miller Cylindrical inverse equations--mapping x,y to lat/long + ------------------------------------------------------------*/ + function inverse$19(p) { + p.x -= this.x0; + p.y -= this.y0; + + var lon = adjust_lon(this.long0 + p.x / this.a); + var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4); + + p.x = lon; + p.y = lat; + return p; + } + + var names$21 = ["Miller_Cylindrical", "mill"]; + var mill = { + init: init$20, + forward: forward$19, + inverse: inverse$19, + names: names$21 + }; + + var MAX_ITER$3 = 20; + function init$21() { + /* Place parameters in static storage for common use + -------------------------------------------------*/ + + + if (!this.sphere) { + this.en = pj_enfn(this.es); + } + else { + this.n = 1; + this.m = 0; + this.es = 0; + this.C_y = Math.sqrt((this.m + 1) / this.n); + this.C_x = this.C_y / (this.m + 1); + } + + } + + /* Sinusoidal forward equations--mapping lat,long to x,y + -----------------------------------------------------*/ + function forward$20(p) { + var x, y; + var lon = p.x; + var lat = p.y; + /* Forward equations + -----------------*/ + lon = adjust_lon(lon - this.long0); + + if (this.sphere) { + if (!this.m) { + lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat; + } + else { + var k = this.n * Math.sin(lat); + for (var i = MAX_ITER$3; i; --i) { + var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat)); + lat -= V; + if (Math.abs(V) < EPSLN) { + break; + } + } + } + x = this.a * this.C_x * lon * (this.m + Math.cos(lat)); + y = this.a * this.C_y * lat; + + } + else { + + var s = Math.sin(lat); + var c = Math.cos(lat); + y = this.a * pj_mlfn(lat, s, c, this.en); + x = this.a * lon * c / Math.sqrt(1 - this.es * s * s); + } + + p.x = x; + p.y = y; + return p; + } + + function inverse$20(p) { + var lat, temp, lon, s; + + p.x -= this.x0; + lon = p.x / this.a; + p.y -= this.y0; + lat = p.y / this.a; + + if (this.sphere) { + lat /= this.C_y; + lon = lon / (this.C_x * (this.m + Math.cos(lat))); + if (this.m) { + lat = asinz((this.m * lat + Math.sin(lat)) / this.n); + } + else if (this.n !== 1) { + lat = asinz(Math.sin(lat) / this.n); + } + lon = adjust_lon(lon + this.long0); + lat = adjust_lat(lat); + } + else { + lat = pj_inv_mlfn(p.y / this.a, this.es, this.en); + s = Math.abs(lat); + if (s < HALF_PI) { + s = Math.sin(lat); + temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat)); + //temp = this.long0 + p.x / (this.a * Math.cos(lat)); + lon = adjust_lon(temp); + } + else if ((s - EPSLN) < HALF_PI) { + lon = this.long0; + } + } + p.x = lon; + p.y = lat; + return p; + } + + var names$22 = ["Sinusoidal", "sinu"]; + var sinu = { + init: init$21, + forward: forward$20, + inverse: inverse$20, + names: names$22 + }; + + function init$22() {} + /* Mollweide forward equations--mapping lat,long to x,y + ----------------------------------------------------*/ + function forward$21(p) { + + /* Forward equations + -----------------*/ + var lon = p.x; + var lat = p.y; + + var delta_lon = adjust_lon(lon - this.long0); + var theta = lat; + var con = Math.PI * Math.sin(lat); + + /* Iterate using the Newton-Raphson method to find theta + -----------------------------------------------------*/ + while (true) { + var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta)); + theta += delta_theta; + if (Math.abs(delta_theta) < EPSLN) { + break; + } + } + theta /= 2; + + /* If the latitude is 90 deg, force the x coordinate to be "0 + false easting" + this is done here because of precision problems with "cos(theta)" + --------------------------------------------------------------------------*/ + if (Math.PI / 2 - Math.abs(lat) < EPSLN) { + delta_lon = 0; + } + var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0; + var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0; + + p.x = x; + p.y = y; + return p; + } + + function inverse$21(p) { + var theta; + var arg; + + /* Inverse equations + -----------------*/ + p.x -= this.x0; + p.y -= this.y0; + arg = p.y / (1.4142135623731 * this.a); + + /* Because of division by zero problems, 'arg' can not be 1. Therefore + a number very close to one is used instead. + -------------------------------------------------------------------*/ + if (Math.abs(arg) > 0.999999999999) { + arg = 0.999999999999; + } + theta = Math.asin(arg); + var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta)))); + if (lon < (-Math.PI)) { + lon = -Math.PI; + } + if (lon > Math.PI) { + lon = Math.PI; + } + arg = (2 * theta + Math.sin(2 * theta)) / Math.PI; + if (Math.abs(arg) > 1) { + arg = 1; + } + var lat = Math.asin(arg); + + p.x = lon; + p.y = lat; + return p; + } + + var names$23 = ["Mollweide", "moll"]; + var moll = { + init: init$22, + forward: forward$21, + inverse: inverse$21, + names: names$23 + }; + + function init$23() { + + /* Place parameters in static storage for common use + -------------------------------------------------*/ + // Standard Parallels cannot be equal and on opposite sides of the equator + if (Math.abs(this.lat1 + this.lat2) < EPSLN) { + return; + } + this.lat2 = this.lat2 || this.lat1; + this.temp = this.b / this.a; + this.es = 1 - Math.pow(this.temp, 2); + this.e = Math.sqrt(this.es); + this.e0 = e0fn(this.es); + this.e1 = e1fn(this.es); + this.e2 = e2fn(this.es); + this.e3 = e3fn(this.es); + + this.sinphi = Math.sin(this.lat1); + this.cosphi = Math.cos(this.lat1); + + this.ms1 = msfnz(this.e, this.sinphi, this.cosphi); + this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1); + + if (Math.abs(this.lat1 - this.lat2) < EPSLN) { + this.ns = this.sinphi; + } + else { + this.sinphi = Math.sin(this.lat2); + this.cosphi = Math.cos(this.lat2); + this.ms2 = msfnz(this.e, this.sinphi, this.cosphi); + this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2); + this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1); + } + this.g = this.ml1 + this.ms1 / this.ns; + this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); + this.rh = this.a * (this.g - this.ml0); + } + + /* Equidistant Conic forward equations--mapping lat,long to x,y + -----------------------------------------------------------*/ + function forward$22(p) { + var lon = p.x; + var lat = p.y; + var rh1; + + /* Forward equations + -----------------*/ + if (this.sphere) { + rh1 = this.a * (this.g - lat); + } + else { + var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat); + rh1 = this.a * (this.g - ml); + } + var theta = this.ns * adjust_lon(lon - this.long0); + var x = this.x0 + rh1 * Math.sin(theta); + var y = this.y0 + this.rh - rh1 * Math.cos(theta); + p.x = x; + p.y = y; + return p; + } + + /* Inverse equations + -----------------*/ + function inverse$22(p) { + p.x -= this.x0; + p.y = this.rh - p.y + this.y0; + var con, rh1, lat, lon; + if (this.ns >= 0) { + rh1 = Math.sqrt(p.x * p.x + p.y * p.y); + con = 1; + } + else { + rh1 = -Math.sqrt(p.x * p.x + p.y * p.y); + con = -1; + } + var theta = 0; + if (rh1 !== 0) { + theta = Math.atan2(con * p.x, con * p.y); + } + + if (this.sphere) { + lon = adjust_lon(this.long0 + theta / this.ns); + lat = adjust_lat(this.g - rh1 / this.a); + p.x = lon; + p.y = lat; + return p; + } + else { + var ml = this.g - rh1 / this.a; + lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3); + lon = adjust_lon(this.long0 + theta / this.ns); + p.x = lon; + p.y = lat; + return p; + } + + } + + var names$24 = ["Equidistant_Conic", "eqdc"]; + var eqdc = { + init: init$23, + forward: forward$22, + inverse: inverse$22, + names: names$24 + }; + + /* Initialize the Van Der Grinten projection + ----------------------------------------*/ + function init$24() { + //this.R = 6370997; //Radius of earth + this.R = this.a; + } + + function forward$23(p) { + + var lon = p.x; + var lat = p.y; + + /* Forward equations + -----------------*/ + var dlon = adjust_lon(lon - this.long0); + var x, y; + + if (Math.abs(lat) <= EPSLN) { + x = this.x0 + this.R * dlon; + y = this.y0; + } + var theta = asinz(2 * Math.abs(lat / Math.PI)); + if ((Math.abs(dlon) <= EPSLN) || (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN)) { + x = this.x0; + if (lat >= 0) { + y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta); + } + else { + y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta); + } + // return(OK); + } + var al = 0.5 * Math.abs((Math.PI / dlon) - (dlon / Math.PI)); + var asq = al * al; + var sinth = Math.sin(theta); + var costh = Math.cos(theta); + + var g = costh / (sinth + costh - 1); + var gsq = g * g; + var m = g * (2 / sinth - 1); + var msq = m * m; + var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq); + if (dlon < 0) { + con = -con; + } + x = this.x0 + con; + //con = Math.abs(con / (Math.PI * this.R)); + var q = asq + g; + con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq); + if (lat >= 0) { + //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con); + y = this.y0 + con; + } + else { + //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con); + y = this.y0 - con; + } + p.x = x; + p.y = y; + return p; + } + + /* Van Der Grinten inverse equations--mapping x,y to lat/long + ---------------------------------------------------------*/ + function inverse$23(p) { + var lon, lat; + var xx, yy, xys, c1, c2, c3; + var a1; + var m1; + var con; + var th1; + var d; + + /* inverse equations + -----------------*/ + p.x -= this.x0; + p.y -= this.y0; + con = Math.PI * this.R; + xx = p.x / con; + yy = p.y / con; + xys = xx * xx + yy * yy; + c1 = -Math.abs(yy) * (1 + xys); + c2 = c1 - 2 * yy * yy + xx * xx; + c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys; + d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27; + a1 = (c1 - c2 * c2 / 3 / c3) / c3; + m1 = 2 * Math.sqrt(-a1 / 3); + con = ((3 * d) / a1) / m1; + if (Math.abs(con) > 1) { + if (con >= 0) { + con = 1; + } + else { + con = -1; + } + } + th1 = Math.acos(con) / 3; + if (p.y >= 0) { + lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI; + } + else { + lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI; + } + + if (Math.abs(xx) < EPSLN) { + lon = this.long0; + } + else { + lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx); + } + + p.x = lon; + p.y = lat; + return p; + } + + var names$25 = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"]; + var vandg = { + init: init$24, + forward: forward$23, + inverse: inverse$23, + names: names$25 + }; + + function init$25() { + this.sin_p12 = Math.sin(this.lat0); + this.cos_p12 = Math.cos(this.lat0); + } + + function forward$24(p) { + var lon = p.x; + var lat = p.y; + var sinphi = Math.sin(p.y); + var cosphi = Math.cos(p.y); + var dlon = adjust_lon(lon - this.long0); + var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5; + if (this.sphere) { + if (Math.abs(this.sin_p12 - 1) <= EPSLN) { + //North Pole case + p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon); + p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon); + return p; + } + else if (Math.abs(this.sin_p12 + 1) <= EPSLN) { + //South Pole case + p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon); + p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon); + return p; + } + else { + //default case + cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon); + c = Math.acos(cos_c); + kp = c ? c / Math.sin(c) : 1; + p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon); + p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon)); + return p; + } + } + else { + e0 = e0fn(this.es); + e1 = e1fn(this.es); + e2 = e2fn(this.es); + e3 = e3fn(this.es); + if (Math.abs(this.sin_p12 - 1) <= EPSLN) { + //North Pole case + Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI); + Ml = this.a * mlfn(e0, e1, e2, e3, lat); + p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon); + p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon); + return p; + } + else if (Math.abs(this.sin_p12 + 1) <= EPSLN) { + //South Pole case + Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI); + Ml = this.a * mlfn(e0, e1, e2, e3, lat); + p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon); + p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon); + return p; + } + else { + //Default case + tanphi = sinphi / cosphi; + Nl1 = gN(this.a, this.e, this.sin_p12); + Nl = gN(this.a, this.e, sinphi); + psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi)); + Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon)); + if (Az === 0) { + s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi)); + } + else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) { + s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi)); + } + else { + s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az)); + } + G = this.e * this.sin_p12 / Math.sqrt(1 - this.es); + H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es); + GH = G * H; + Hs = H * H; + s2 = s * s; + s3 = s2 * s; + s4 = s3 * s; + s5 = s4 * s; + c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH); + p.x = this.x0 + c * Math.sin(Az); + p.y = this.y0 + c * Math.cos(Az); + return p; + } + } + + + } + + function inverse$24(p) { + p.x -= this.x0; + p.y -= this.y0; + var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi; + if (this.sphere) { + rh = Math.sqrt(p.x * p.x + p.y * p.y); + if (rh > (2 * HALF_PI * this.a)) { + return; + } + z = rh / this.a; + + sinz = Math.sin(z); + cosz = Math.cos(z); + + lon = this.long0; + if (Math.abs(rh) <= EPSLN) { + lat = this.lat0; + } + else { + lat = asinz(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh); + con = Math.abs(this.lat0) - HALF_PI; + if (Math.abs(con) <= EPSLN) { + if (this.lat0 >= 0) { + lon = adjust_lon(this.long0 + Math.atan2(p.x, - p.y)); + } + else { + lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y)); + } + } + else { + /*con = cosz - this.sin_p12 * Math.sin(lat); + if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) { + //no-op, just keep the lon value as is + } else { + var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh)); + lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh))); + }*/ + lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz)); + } + } + + p.x = lon; + p.y = lat; + return p; + } + else { + e0 = e0fn(this.es); + e1 = e1fn(this.es); + e2 = e2fn(this.es); + e3 = e3fn(this.es); + if (Math.abs(this.sin_p12 - 1) <= EPSLN) { + //North pole case + Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI); + rh = Math.sqrt(p.x * p.x + p.y * p.y); + M = Mlp - rh; + lat = imlfn(M / this.a, e0, e1, e2, e3); + lon = adjust_lon(this.long0 + Math.atan2(p.x, - 1 * p.y)); + p.x = lon; + p.y = lat; + return p; + } + else if (Math.abs(this.sin_p12 + 1) <= EPSLN) { + //South pole case + Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI); + rh = Math.sqrt(p.x * p.x + p.y * p.y); + M = rh - Mlp; + + lat = imlfn(M / this.a, e0, e1, e2, e3); + lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y)); + p.x = lon; + p.y = lat; + return p; + } + else { + //default case + rh = Math.sqrt(p.x * p.x + p.y * p.y); + Az = Math.atan2(p.x, p.y); + N1 = gN(this.a, this.e, this.sin_p12); + cosAz = Math.cos(Az); + tmp = this.e * this.cos_p12 * cosAz; + A = -tmp * tmp / (1 - this.es); + B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es); + D = rh / N1; + Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24; + F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6; + psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz); + lon = adjust_lon(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi))); + sinpsi = Math.sin(psi); + lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es)); + p.x = lon; + p.y = lat; + return p; + } + } + + } + + var names$26 = ["Azimuthal_Equidistant", "aeqd"]; + var aeqd = { + init: init$25, + forward: forward$24, + inverse: inverse$24, + names: names$26 + }; + + function init$26() { + //double temp; /* temporary variable */ + + /* Place parameters in static storage for common use + -------------------------------------------------*/ + this.sin_p14 = Math.sin(this.lat0); + this.cos_p14 = Math.cos(this.lat0); + } + + /* Orthographic forward equations--mapping lat,long to x,y + ---------------------------------------------------*/ + function forward$25(p) { + var sinphi, cosphi; /* sin and cos value */ + var dlon; /* delta longitude value */ + var coslon; /* cos of longitude */ + var ksp; /* scale factor */ + var g, x, y; + var lon = p.x; + var lat = p.y; + /* Forward equations + -----------------*/ + dlon = adjust_lon(lon - this.long0); + + sinphi = Math.sin(lat); + cosphi = Math.cos(lat); + + coslon = Math.cos(dlon); + g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon; + ksp = 1; + if ((g > 0) || (Math.abs(g) <= EPSLN)) { + x = this.a * ksp * cosphi * Math.sin(dlon); + y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon); + } + p.x = x; + p.y = y; + return p; + } + + function inverse$25(p) { + var rh; /* height above ellipsoid */ + var z; /* angle */ + var sinz, cosz; /* sin of z and cos of z */ + var con; + var lon, lat; + /* Inverse equations + -----------------*/ + p.x -= this.x0; + p.y -= this.y0; + rh = Math.sqrt(p.x * p.x + p.y * p.y); + z = asinz(rh / this.a); + + sinz = Math.sin(z); + cosz = Math.cos(z); + + lon = this.long0; + if (Math.abs(rh) <= EPSLN) { + lat = this.lat0; + p.x = lon; + p.y = lat; + return p; + } + lat = asinz(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh); + con = Math.abs(this.lat0) - HALF_PI; + if (Math.abs(con) <= EPSLN) { + if (this.lat0 >= 0) { + lon = adjust_lon(this.long0 + Math.atan2(p.x, - p.y)); + } + else { + lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y)); + } + p.x = lon; + p.y = lat; + return p; + } + lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz)); + p.x = lon; + p.y = lat; + return p; + } + + var names$27 = ["ortho"]; + var ortho = { + init: init$26, + forward: forward$25, + inverse: inverse$25, + names: names$27 + }; + + // QSC projection rewritten from the original PROJ4 + // https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c + + /* constants */ + var FACE_ENUM = { + FRONT: 1, + RIGHT: 2, + BACK: 3, + LEFT: 4, + TOP: 5, + BOTTOM: 6 + }; + + var AREA_ENUM = { + AREA_0: 1, + AREA_1: 2, + AREA_2: 3, + AREA_3: 4 + }; + + function init$27() { + + this.x0 = this.x0 || 0; + this.y0 = this.y0 || 0; + this.lat0 = this.lat0 || 0; + this.long0 = this.long0 || 0; + this.lat_ts = this.lat_ts || 0; + this.title = this.title || "Quadrilateralized Spherical Cube"; + + /* Determine the cube face from the center of projection. */ + if (this.lat0 >= HALF_PI - FORTPI / 2.0) { + this.face = FACE_ENUM.TOP; + } else if (this.lat0 <= -(HALF_PI - FORTPI / 2.0)) { + this.face = FACE_ENUM.BOTTOM; + } else if (Math.abs(this.long0) <= FORTPI) { + this.face = FACE_ENUM.FRONT; + } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) { + this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT; + } else { + this.face = FACE_ENUM.BACK; + } + + /* Fill in useful values for the ellipsoid <-> sphere shift + * described in [LK12]. */ + if (this.es !== 0) { + this.one_minus_f = 1 - (this.a - this.b) / this.a; + this.one_minus_f_squared = this.one_minus_f * this.one_minus_f; + } + } + + // QSC forward equations--mapping lat,long to x,y + // ----------------------------------------------------------------- + function forward$26(p) { + var xy = {x: 0, y: 0}; + var lat, lon; + var theta, phi; + var t, mu; + /* nu; */ + var area = {value: 0}; + + // move lon according to projection's lon + p.x -= this.long0; + + /* Convert the geodetic latitude to a geocentric latitude. + * This corresponds to the shift from the ellipsoid to the sphere + * described in [LK12]. */ + if (this.es !== 0) {//if (P->es != 0) { + lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y)); + } else { + lat = p.y; + } + + /* Convert the input lat, lon into theta, phi as used by QSC. + * This depends on the cube face and the area on it. + * For the top and bottom face, we can compute theta and phi + * directly from phi, lam. For the other faces, we must use + * unit sphere cartesian coordinates as an intermediate step. */ + lon = p.x; //lon = lp.lam; + if (this.face === FACE_ENUM.TOP) { + phi = HALF_PI - lat; + if (lon >= FORTPI && lon <= HALF_PI + FORTPI) { + area.value = AREA_ENUM.AREA_0; + theta = lon - HALF_PI; + } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) { + area.value = AREA_ENUM.AREA_1; + theta = (lon > 0.0 ? lon - SPI : lon + SPI); + } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) { + area.value = AREA_ENUM.AREA_2; + theta = lon + HALF_PI; + } else { + area.value = AREA_ENUM.AREA_3; + theta = lon; + } + } else if (this.face === FACE_ENUM.BOTTOM) { + phi = HALF_PI + lat; + if (lon >= FORTPI && lon <= HALF_PI + FORTPI) { + area.value = AREA_ENUM.AREA_0; + theta = -lon + HALF_PI; + } else if (lon < FORTPI && lon >= -FORTPI) { + area.value = AREA_ENUM.AREA_1; + theta = -lon; + } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) { + area.value = AREA_ENUM.AREA_2; + theta = -lon - HALF_PI; + } else { + area.value = AREA_ENUM.AREA_3; + theta = (lon > 0.0 ? -lon + SPI : -lon - SPI); + } + } else { + var q, r, s; + var sinlat, coslat; + var sinlon, coslon; + + if (this.face === FACE_ENUM.RIGHT) { + lon = qsc_shift_lon_origin(lon, +HALF_PI); + } else if (this.face === FACE_ENUM.BACK) { + lon = qsc_shift_lon_origin(lon, +SPI); + } else if (this.face === FACE_ENUM.LEFT) { + lon = qsc_shift_lon_origin(lon, -HALF_PI); + } + sinlat = Math.sin(lat); + coslat = Math.cos(lat); + sinlon = Math.sin(lon); + coslon = Math.cos(lon); + q = coslat * coslon; + r = coslat * sinlon; + s = sinlat; + + if (this.face === FACE_ENUM.FRONT) { + phi = Math.acos(q); + theta = qsc_fwd_equat_face_theta(phi, s, r, area); + } else if (this.face === FACE_ENUM.RIGHT) { + phi = Math.acos(r); + theta = qsc_fwd_equat_face_theta(phi, s, -q, area); + } else if (this.face === FACE_ENUM.BACK) { + phi = Math.acos(-q); + theta = qsc_fwd_equat_face_theta(phi, s, -r, area); + } else if (this.face === FACE_ENUM.LEFT) { + phi = Math.acos(-r); + theta = qsc_fwd_equat_face_theta(phi, s, q, area); + } else { + /* Impossible */ + phi = theta = 0; + area.value = AREA_ENUM.AREA_0; + } + } + + /* Compute mu and nu for the area of definition. + * For mu, see Eq. (3-21) in [OL76], but note the typos: + * compare with Eq. (3-14). For nu, see Eq. (3-38). */ + mu = Math.atan((12 / SPI) * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI)); + t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta))))); + + /* Apply the result to the real area. */ + if (area.value === AREA_ENUM.AREA_1) { + mu += HALF_PI; + } else if (area.value === AREA_ENUM.AREA_2) { + mu += SPI; + } else if (area.value === AREA_ENUM.AREA_3) { + mu += 1.5 * SPI; + } + + /* Now compute x, y from mu and nu */ + xy.x = t * Math.cos(mu); + xy.y = t * Math.sin(mu); + xy.x = xy.x * this.a + this.x0; + xy.y = xy.y * this.a + this.y0; + + p.x = xy.x; + p.y = xy.y; + return p; + } + + // QSC inverse equations--mapping x,y to lat/long + // ----------------------------------------------------------------- + function inverse$26(p) { + var lp = {lam: 0, phi: 0}; + var mu, nu, cosmu, tannu; + var tantheta, theta, cosphi, phi; + var t; + var area = {value: 0}; + + /* de-offset */ + p.x = (p.x - this.x0) / this.a; + p.y = (p.y - this.y0) / this.a; + + /* Convert the input x, y to the mu and nu angles as used by QSC. + * This depends on the area of the cube face. */ + nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y)); + mu = Math.atan2(p.y, p.x); + if (p.x >= 0.0 && p.x >= Math.abs(p.y)) { + area.value = AREA_ENUM.AREA_0; + } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) { + area.value = AREA_ENUM.AREA_1; + mu -= HALF_PI; + } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) { + area.value = AREA_ENUM.AREA_2; + mu = (mu < 0.0 ? mu + SPI : mu - SPI); + } else { + area.value = AREA_ENUM.AREA_3; + mu += HALF_PI; + } + + /* Compute phi and theta for the area of definition. + * The inverse projection is not described in the original paper, but some + * good hints can be found here (as of 2011-12-14): + * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302 + * (search for "Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>") */ + t = (SPI / 12) * Math.tan(mu); + tantheta = Math.sin(t) / (Math.cos(t) - (1 / Math.sqrt(2))); + theta = Math.atan(tantheta); + cosmu = Math.cos(mu); + tannu = Math.tan(nu); + cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta)))); + if (cosphi < -1) { + cosphi = -1; + } else if (cosphi > +1) { + cosphi = +1; + } + + /* Apply the result to the real area on the cube face. + * For the top and bottom face, we can compute phi and lam directly. + * For the other faces, we must use unit sphere cartesian coordinates + * as an intermediate step. */ + if (this.face === FACE_ENUM.TOP) { + phi = Math.acos(cosphi); + lp.phi = HALF_PI - phi; + if (area.value === AREA_ENUM.AREA_0) { + lp.lam = theta + HALF_PI; + } else if (area.value === AREA_ENUM.AREA_1) { + lp.lam = (theta < 0.0 ? theta + SPI : theta - SPI); + } else if (area.value === AREA_ENUM.AREA_2) { + lp.lam = theta - HALF_PI; + } else /* area.value == AREA_ENUM.AREA_3 */ { + lp.lam = theta; + } + } else if (this.face === FACE_ENUM.BOTTOM) { + phi = Math.acos(cosphi); + lp.phi = phi - HALF_PI; + if (area.value === AREA_ENUM.AREA_0) { + lp.lam = -theta + HALF_PI; + } else if (area.value === AREA_ENUM.AREA_1) { + lp.lam = -theta; + } else if (area.value === AREA_ENUM.AREA_2) { + lp.lam = -theta - HALF_PI; + } else /* area.value == AREA_ENUM.AREA_3 */ { + lp.lam = (theta < 0.0 ? -theta - SPI : -theta + SPI); + } + } else { + /* Compute phi and lam via cartesian unit sphere coordinates. */ + var q, r, s; + q = cosphi; + t = q * q; + if (t >= 1) { + s = 0; + } else { + s = Math.sqrt(1 - t) * Math.sin(theta); + } + t += s * s; + if (t >= 1) { + r = 0; + } else { + r = Math.sqrt(1 - t); + } + /* Rotate q,r,s into the correct area. */ + if (area.value === AREA_ENUM.AREA_1) { + t = r; + r = -s; + s = t; + } else if (area.value === AREA_ENUM.AREA_2) { + r = -r; + s = -s; + } else if (area.value === AREA_ENUM.AREA_3) { + t = r; + r = s; + s = -t; + } + /* Rotate q,r,s into the correct cube face. */ + if (this.face === FACE_ENUM.RIGHT) { + t = q; + q = -r; + r = t; + } else if (this.face === FACE_ENUM.BACK) { + q = -q; + r = -r; + } else if (this.face === FACE_ENUM.LEFT) { + t = q; + q = r; + r = -t; + } + /* Now compute phi and lam from the unit sphere coordinates. */ + lp.phi = Math.acos(-s) - HALF_PI; + lp.lam = Math.atan2(r, q); + if (this.face === FACE_ENUM.RIGHT) { + lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI); + } else if (this.face === FACE_ENUM.BACK) { + lp.lam = qsc_shift_lon_origin(lp.lam, -SPI); + } else if (this.face === FACE_ENUM.LEFT) { + lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI); + } + } + + /* Apply the shift from the sphere to the ellipsoid as described + * in [LK12]. */ + if (this.es !== 0) { + var invert_sign; + var tanphi, xa; + invert_sign = (lp.phi < 0 ? 1 : 0); + tanphi = Math.tan(lp.phi); + xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared); + lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa)); + if (invert_sign) { + lp.phi = -lp.phi; + } + } + + lp.lam += this.long0; + p.x = lp.lam; + p.y = lp.phi; + return p; + } + + /* Helper function for forward projection: compute the theta angle + * and determine the area number. */ + function qsc_fwd_equat_face_theta(phi, y, x, area) { + var theta; + if (phi < EPSLN) { + area.value = AREA_ENUM.AREA_0; + theta = 0.0; + } else { + theta = Math.atan2(y, x); + if (Math.abs(theta) <= FORTPI) { + area.value = AREA_ENUM.AREA_0; + } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) { + area.value = AREA_ENUM.AREA_1; + theta -= HALF_PI; + } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) { + area.value = AREA_ENUM.AREA_2; + theta = (theta >= 0.0 ? theta - SPI : theta + SPI); + } else { + area.value = AREA_ENUM.AREA_3; + theta += HALF_PI; + } + } + return theta; + } + + /* Helper function: shift the longitude. */ + function qsc_shift_lon_origin(lon, offset) { + var slon = lon + offset; + if (slon < -SPI) { + slon += TWO_PI; + } else if (slon > +SPI) { + slon -= TWO_PI; + } + return slon; + } + + var names$28 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"]; + var qsc = { + init: init$27, + forward: forward$26, + inverse: inverse$26, + names: names$28 + }; + + // Robinson projection + // Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c + // Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039 + + var COEFS_X = [ + [1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06], + [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06], + [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07], + [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06], + [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06], + [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08], + [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06], + [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06], + [0.9216, -0.00467746, -0.00010457, 4.81243e-06], + [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06], + [0.8679, -0.00609363, -0.000113898, 3.32484e-06], + [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07], + [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07], + [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06], + [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06], + [0.6732, -0.00986209, -0.000199569, 1.91974e-05], + [0.6213, -0.010418, 8.83923e-05, 6.24051e-06], + [0.5722, -0.00906601, 0.000182, 6.24051e-06], + [0.5322, -0.00677797, 0.000275608, 6.24051e-06] + ]; + + var COEFS_Y = [ + [-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11], + [0.0620, 0.0124, -1.26793e-09, 4.22642e-10], + [0.1240, 0.0124, 5.07171e-09, -1.60604e-09], + [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09], + [0.2480, 0.0124002, 7.10039e-08, -2.24e-08], + [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08], + [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07], + [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07], + [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07], + [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07], + [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07], + [0.6769, 0.011713, -3.20223e-05, -5.16405e-07], + [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07], + [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06], + [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09], + [0.8936, 0.00969686, -6.4636e-05, -8.547e-06], + [0.9394, 0.00840947, -0.000192841, -4.2106e-06], + [0.9761, 0.00616527, -0.000256, -4.2106e-06], + [1.0000, 0.00328947, -0.000319159, -4.2106e-06] + ]; + + var FXC = 0.8487; + var FYC = 1.3523; + var C1 = R2D/5; // rad to 5-degree interval + var RC1 = 1/C1; + var NODES = 18; + + var poly3_val = function(coefs, x) { + return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3])); + }; + + var poly3_der = function(coefs, x) { + return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]); + }; + + function newton_rapshon(f_df, start, max_err, iters) { + var x = start; + for (; iters; --iters) { + var upd = f_df(x); + x -= upd; + if (Math.abs(upd) < max_err) { + break; + } + } + return x; + } + + function init$28() { + this.x0 = this.x0 || 0; + this.y0 = this.y0 || 0; + this.long0 = this.long0 || 0; + this.es = 0; + this.title = this.title || "Robinson"; + } + + function forward$27(ll) { + var lon = adjust_lon(ll.x - this.long0); + + var dphi = Math.abs(ll.y); + var i = Math.floor(dphi * C1); + if (i < 0) { + i = 0; + } else if (i >= NODES) { + i = NODES - 1; + } + dphi = R2D * (dphi - RC1 * i); + var xy = { + x: poly3_val(COEFS_X[i], dphi) * lon, + y: poly3_val(COEFS_Y[i], dphi) + }; + if (ll.y < 0) { + xy.y = -xy.y; + } + + xy.x = xy.x * this.a * FXC + this.x0; + xy.y = xy.y * this.a * FYC + this.y0; + return xy; + } + + function inverse$27(xy) { + var ll = { + x: (xy.x - this.x0) / (this.a * FXC), + y: Math.abs(xy.y - this.y0) / (this.a * FYC) + }; + + if (ll.y >= 1) { // pathologic case + ll.x /= COEFS_X[NODES][0]; + ll.y = xy.y < 0 ? -HALF_PI : HALF_PI; + } else { + // find table interval + var i = Math.floor(ll.y * NODES); + if (i < 0) { + i = 0; + } else if (i >= NODES) { + i = NODES - 1; + } + for (;;) { + if (COEFS_Y[i][0] > ll.y) { + --i; + } else if (COEFS_Y[i+1][0] <= ll.y) { + ++i; + } else { + break; + } + } + // linear interpolation in 5 degree interval + var coefs = COEFS_Y[i]; + var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i+1][0] - coefs[0]); + // find t so that poly3_val(coefs, t) = ll.y + t = newton_rapshon(function(x) { + return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x); + }, t, EPSLN, 100); + + ll.x /= poly3_val(COEFS_X[i], t); + ll.y = (5 * i + t) * D2R; + if (xy.y < 0) { + ll.y = -ll.y; + } + } + + ll.x = adjust_lon(ll.x + this.long0); + return ll; + } + + var names$29 = ["Robinson", "robin"]; + var robin = { + init: init$28, + forward: forward$27, + inverse: inverse$27, + names: names$29 + }; + + function init$29() { + this.name = 'geocent'; + + } + + function forward$28(p) { + var point = geodeticToGeocentric(p, this.es, this.a); + return point; + } + + function inverse$28(p) { + var point = geocentricToGeodetic(p, this.es, this.a, this.b); + return point; + } + + var names$30 = ["Geocentric", 'geocentric', "geocent", "Geocent"]; + var geocent = { + init: init$29, + forward: forward$28, + inverse: inverse$28, + names: names$30 + }; + + var mode = { + N_POLE: 0, + S_POLE: 1, + EQUIT: 2, + OBLIQ: 3 + }; + + var params = { + h: { def: 100000, num: true }, // default is Karman line, no default in PROJ.7 + azi: { def: 0, num: true, degrees: true }, // default is North + tilt: { def: 0, num: true, degrees: true }, // default is Nadir + long0: { def: 0, num: true }, // default is Greenwich, conversion to rad is automatic + lat0: { def: 0, num: true } // default is Equator, conversion to rad is automatic + }; + + function init$30() { + Object.keys(params).forEach(function (p) { + if (typeof this[p] === "undefined") { + this[p] = params[p].def; + } else if (params[p].num && isNaN(this[p])) { + throw new Error("Invalid parameter value, must be numeric " + p + " = " + this[p]); + } else if (params[p].num) { + this[p] = parseFloat(this[p]); + } + if (params[p].degrees) { + this[p] = this[p] * D2R; + } + }.bind(this)); + + if (Math.abs((Math.abs(this.lat0) - HALF_PI)) < EPSLN) { + this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE; + } else if (Math.abs(this.lat0) < EPSLN) { + this.mode = mode.EQUIT; + } else { + this.mode = mode.OBLIQ; + this.sinph0 = Math.sin(this.lat0); + this.cosph0 = Math.cos(this.lat0); + } + + this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius + + if (this.pn1 <= 0 || this.pn1 > 1e10) { + throw new Error("Invalid height"); + } + + this.p = 1 + this.pn1; + this.rp = 1 / this.p; + this.h1 = 1 / this.pn1; + this.pfact = (this.p + 1) * this.h1; + this.es = 0; + + var omega = this.tilt; + var gamma = this.azi; + this.cg = Math.cos(gamma); + this.sg = Math.sin(gamma); + this.cw = Math.cos(omega); + this.sw = Math.sin(omega); + } + + function forward$29(p) { + p.x -= this.long0; + var sinphi = Math.sin(p.y); + var cosphi = Math.cos(p.y); + var coslam = Math.cos(p.x); + var x, y; + switch (this.mode) { + case mode.OBLIQ: + y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam; + break; + case mode.EQUIT: + y = cosphi * coslam; + break; + case mode.S_POLE: + y = -sinphi; + break; + case mode.N_POLE: + y = sinphi; + break; + } + y = this.pn1 / (this.p - y); + x = y * cosphi * Math.sin(p.x); + + switch (this.mode) { + case mode.OBLIQ: + y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam; + break; + case mode.EQUIT: + y *= sinphi; + break; + case mode.N_POLE: + y *= -(cosphi * coslam); + break; + case mode.S_POLE: + y *= cosphi * coslam; + break; + } + + // Tilt + var yt, ba; + yt = y * this.cg + x * this.sg; + ba = 1 / (yt * this.sw * this.h1 + this.cw); + x = (x * this.cg - y * this.sg) * this.cw * ba; + y = yt * ba; + + p.x = x * this.a; + p.y = y * this.a; + return p; + } + + function inverse$29(p) { + p.x /= this.a; + p.y /= this.a; + var r = { x: p.x, y: p.y }; + + // Un-Tilt + var bm, bq, yt; + yt = 1 / (this.pn1 - p.y * this.sw); + bm = this.pn1 * p.x * yt; + bq = this.pn1 * p.y * this.cw * yt; + p.x = bm * this.cg + bq * this.sg; + p.y = bq * this.cg - bm * this.sg; + + var rh = hypot(p.x, p.y); + if (Math.abs(rh) < EPSLN) { + r.x = 0; + r.y = p.y; + } else { + var cosz, sinz; + sinz = 1 - rh * rh * this.pfact; + sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1); + cosz = Math.sqrt(1 - sinz * sinz); + switch (this.mode) { + case mode.OBLIQ: + r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh); + p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh; + p.x *= sinz * this.cosph0; + break; + case mode.EQUIT: + r.y = Math.asin(p.y * sinz / rh); + p.y = cosz * rh; + p.x *= sinz; + break; + case mode.N_POLE: + r.y = Math.asin(cosz); + p.y = -p.y; + break; + case mode.S_POLE: + r.y = -Math.asin(cosz); + break; + } + r.x = Math.atan2(p.x, p.y); + } + + p.x = r.x + this.long0; + p.y = r.y; + return p; + } + + var names$31 = ["Tilted_Perspective", "tpers"]; + var tpers = { + init: init$30, + forward: forward$29, + inverse: inverse$29, + names: names$31 + }; + + var includedProjections = function(proj4){ + proj4.Proj.projections.add(tmerc); + proj4.Proj.projections.add(etmerc); + proj4.Proj.projections.add(utm); + proj4.Proj.projections.add(sterea); + proj4.Proj.projections.add(stere); + proj4.Proj.projections.add(somerc); + proj4.Proj.projections.add(omerc); + proj4.Proj.projections.add(lcc); + proj4.Proj.projections.add(krovak); + proj4.Proj.projections.add(cass); + proj4.Proj.projections.add(laea); + proj4.Proj.projections.add(aea); + proj4.Proj.projections.add(gnom); + proj4.Proj.projections.add(cea); + proj4.Proj.projections.add(eqc); + proj4.Proj.projections.add(poly); + proj4.Proj.projections.add(nzmg); + proj4.Proj.projections.add(mill); + proj4.Proj.projections.add(sinu); + proj4.Proj.projections.add(moll); + proj4.Proj.projections.add(eqdc); + proj4.Proj.projections.add(vandg); + proj4.Proj.projections.add(aeqd); + proj4.Proj.projections.add(ortho); + proj4.Proj.projections.add(qsc); + proj4.Proj.projections.add(robin); + proj4.Proj.projections.add(geocent); + proj4.Proj.projections.add(tpers); + }; + + proj4$1.defaultDatum = 'WGS84'; //default datum + proj4$1.Proj = Projection; + proj4$1.WGS84 = new proj4$1.Proj('WGS84'); + proj4$1.Point = Point; + proj4$1.toPoint = toPoint; + proj4$1.defs = defs; + proj4$1.nadgrid = nadgrid; + proj4$1.transform = transform; + proj4$1.mgrs = mgrs; + proj4$1.version = '2.7.5'; + includedProjections(proj4$1); + + return proj4$1; + +}))); + + +/***/ }), +/* 34 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35); +/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * @module LoggerByDefault + * @alias [private] LoggerByDefault + * @description + * ... + * + * @example + * getLogger(); + * disableAll(); + * enableAll(); + */ +var LoggerByDefault = { + /** + * creation d'un logger statique + * + * @function getLogger + * @param {String} [name="default"] - the logger name + * @returns {Object} logger + */ + getLogger: function getLogger(name) { + // INFO : + // à la compilation en mode production, on substitue false + // avec "true", ceci desactive les loggers ! + // + // à la compilation en mode developpement, on substitue false + // avec "false", ceci permet d'avoir les loggers actifs ! + // + // lors d'une utilisation en module es6, il n'y a pas de substitution de false, + // les loggers sont donc actifs par defaut ! + // + // > Substitute global constants configured at compile time + // cf. webpack.config.js + // on masque cette constante afin d'eviter "referenceerror not defined" + "false".match(/true/) ? loglevel__WEBPACK_IMPORTED_MODULE_0__["disableAll"]() : loglevel__WEBPACK_IMPORTED_MODULE_0__["enableAll"](); + var logname = name || "default"; + return loglevel__WEBPACK_IMPORTED_MODULE_0__["getLogger"](logname); + }, + /** + * desactive tous les loggers + * @function disableAll + */ + disableAll: function disableAll() { + var loggers = loglevel__WEBPACK_IMPORTED_MODULE_0__["getLoggers"](); + for (var key in loggers) { + if (Object.hasOwnProperty.call(loggers, key)) { + var logger = loggers[key]; + logger.disableAll(); + } + } + }, + /** + * active tous les loggers + * @function enableAll + */ + enableAll: function enableAll() { + var loggers = loglevel__WEBPACK_IMPORTED_MODULE_0__["getLoggers"](); + for (var key in loggers) { + if (Object.hasOwnProperty.call(loggers, key)) { + var logger = loggers[key]; + logger.enableAll(); + } + } + } +}; +/* harmony default export */ __webpack_exports__["default"] = (LoggerByDefault); + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* +* loglevel - https://github.com/pimterry/loglevel +* +* Copyright (c) 2013 Tim Perry +* Licensed under the MIT license. +*/ +(function (root, definition) { + "use strict"; + if (true) { + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(this, function () { + "use strict"; + + // Slightly dubious tricks to cut down minimized file size + var noop = function() {}; + var undefinedType = "undefined"; + var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && ( + /Trident\/|MSIE /.test(window.navigator.userAgent) + ); + + var logMethods = [ + "trace", + "debug", + "info", + "warn", + "error" + ]; + + // Cross-browser bind equivalent that works at least back to IE6 + function bindMethod(obj, methodName) { + var method = obj[methodName]; + if (typeof method.bind === 'function') { + return method.bind(obj); + } else { + try { + return Function.prototype.bind.call(method, obj); + } catch (e) { + // Missing bind shim or IE8 + Modernizr, fallback to wrapping + return function() { + return Function.prototype.apply.apply(method, [obj, arguments]); + }; + } + } + } + + // Trace() doesn't print the message in IE, so for that case we need to wrap it + function traceForIE() { + if (console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + // In old IE, native console methods themselves don't have apply(). + Function.prototype.apply.apply(console.log, [console, arguments]); + } + } + if (console.trace) console.trace(); + } + + // Build the best logging method possible for this env + // Wherever possible we want to bind, not wrap, to preserve stack traces + function realMethod(methodName) { + if (methodName === 'debug') { + methodName = 'log'; + } + + if (typeof console === undefinedType) { + return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives + } else if (methodName === 'trace' && isIE) { + return traceForIE; + } else if (console[methodName] !== undefined) { + return bindMethod(console, methodName); + } else if (console.log !== undefined) { + return bindMethod(console, 'log'); + } else { + return noop; + } + } + + // These private functions always need `this` to be set properly + + function replaceLoggingMethods(level, loggerName) { + /*jshint validthis:true */ + for (var i = 0; i < logMethods.length; i++) { + var methodName = logMethods[i]; + this[methodName] = (i < level) ? + noop : + this.methodFactory(methodName, level, loggerName); + } + + // Define log.log as an alias for log.debug + this.log = this.debug; + } + + // In old IE versions, the console isn't present until you first open it. + // We build realMethod() replacements here that regenerate logging methods + function enableLoggingWhenConsoleArrives(methodName, level, loggerName) { + return function () { + if (typeof console !== undefinedType) { + replaceLoggingMethods.call(this, level, loggerName); + this[methodName].apply(this, arguments); + } + }; + } + + // By default, we use closely bound real methods wherever possible, and + // otherwise we wait for a console to appear, and then try again. + function defaultMethodFactory(methodName, level, loggerName) { + /*jshint validthis:true */ + return realMethod(methodName) || + enableLoggingWhenConsoleArrives.apply(this, arguments); + } + + function Logger(name, defaultLevel, factory) { + var self = this; + var currentLevel; + defaultLevel = defaultLevel == null ? "WARN" : defaultLevel; + + var storageKey = "loglevel"; + if (typeof name === "string") { + storageKey += ":" + name; + } else if (typeof name === "symbol") { + storageKey = undefined; + } + + function persistLevelIfPossible(levelNum) { + var levelName = (logMethods[levelNum] || 'silent').toUpperCase(); + + if (typeof window === undefinedType || !storageKey) return; + + // Use localStorage if available + try { + window.localStorage[storageKey] = levelName; + return; + } catch (ignore) {} + + // Use session cookie as fallback + try { + window.document.cookie = + encodeURIComponent(storageKey) + "=" + levelName + ";"; + } catch (ignore) {} + } + + function getPersistedLevel() { + var storedLevel; + + if (typeof window === undefinedType || !storageKey) return; + + try { + storedLevel = window.localStorage[storageKey]; + } catch (ignore) {} + + // Fallback to cookies if local storage gives us nothing + if (typeof storedLevel === undefinedType) { + try { + var cookie = window.document.cookie; + var location = cookie.indexOf( + encodeURIComponent(storageKey) + "="); + if (location !== -1) { + storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1]; + } + } catch (ignore) {} + } + + // If the stored level is not valid, treat it as if nothing was stored. + if (self.levels[storedLevel] === undefined) { + storedLevel = undefined; + } + + return storedLevel; + } + + function clearPersistedLevel() { + if (typeof window === undefinedType || !storageKey) return; + + // Use localStorage if available + try { + window.localStorage.removeItem(storageKey); + return; + } catch (ignore) {} + + // Use session cookie as fallback + try { + window.document.cookie = + encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; + } catch (ignore) {} + } + + /* + * + * Public logger API - see https://github.com/pimterry/loglevel for details + * + */ + + self.name = name; + + self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3, + "ERROR": 4, "SILENT": 5}; + + self.methodFactory = factory || defaultMethodFactory; + + self.getLevel = function () { + return currentLevel; + }; + + self.setLevel = function (level, persist) { + if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) { + level = self.levels[level.toUpperCase()]; + } + if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) { + currentLevel = level; + if (persist !== false) { // defaults to true + persistLevelIfPossible(level); + } + replaceLoggingMethods.call(self, level, name); + if (typeof console === undefinedType && level < self.levels.SILENT) { + return "No console available for logging"; + } + } else { + throw "log.setLevel() called with invalid level: " + level; + } + }; + + self.setDefaultLevel = function (level) { + defaultLevel = level; + if (!getPersistedLevel()) { + self.setLevel(level, false); + } + }; + + self.resetLevel = function () { + self.setLevel(defaultLevel, false); + clearPersistedLevel(); + }; + + self.enableAll = function(persist) { + self.setLevel(self.levels.TRACE, persist); + }; + + self.disableAll = function(persist) { + self.setLevel(self.levels.SILENT, persist); + }; + + // Initialize with the right level + var initialLevel = getPersistedLevel(); + if (initialLevel == null) { + initialLevel = defaultLevel; + } + self.setLevel(initialLevel, false); + } + + /* + * + * Top-level API + * + */ + + var defaultLogger = new Logger(); + + var _loggersByName = {}; + defaultLogger.getLogger = function getLogger(name) { + if ((typeof name !== "symbol" && typeof name !== "string") || name === "") { + throw new TypeError("You must supply a name when creating a logger."); + } + + var logger = _loggersByName[name]; + if (!logger) { + logger = _loggersByName[name] = new Logger( + name, defaultLogger.getLevel(), defaultLogger.methodFactory); + } + return logger; + }; + + // Grab the current global log variable in case of overwrite + var _log = (typeof window !== undefinedType) ? window.log : undefined; + defaultLogger.noConflict = function() { + if (typeof window !== undefinedType && + window.log === defaultLogger) { + window.log = _log; + } + + return defaultLogger; + }; + + defaultLogger.getLoggers = function getLoggers() { + return _loggersByName; + }; + + // ES6 default export, for compatibility + defaultLogger['default'] = defaultLogger; + + return defaultLogger; +})); + + +/***/ }), +/* 36 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "servicesVersion", function() { return servicesVersion; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "servicesDate", function() { return servicesDate; }); +/* harmony import */ var _Services_Services__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37); +/* harmony import */ var _Services_DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); +/* harmony import */ var _Services_Alti_Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65); +/* harmony import */ var _Services_Alti_Response_model_Elevation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66); +/* harmony import */ var _Services_AutoComplete_Response_model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79); +/* harmony import */ var _Services_AutoComplete_Response_model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80); +/* harmony import */ var _Services_ProcessIsoCurve_Response_model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(92); +/* harmony import */ var _Services_Route_Response_model_RouteResponse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(86); +/* harmony import */ var _Services_Route_Response_model_RouteInstruction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(87); +/* harmony import */ var _Services_Config_Config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(38); +/* harmony import */ var _Protocols_XHR__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(44); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(50); +/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(42); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(52); +var _package_json__WEBPACK_IMPORTED_MODULE_13___namespace = /*#__PURE__*/__webpack_require__.t(52, 1); +/** +* Global variable Gp. +* +* @module Gp +* @alias Gp +* @description +* +* This is the global variable that is exposed in the browser environment. +* Content is composed of constructor, functions and properties... +* +* > {@link Gp.Error Error()} +* - .TYPE_SRVERR : "SERVICE_ERROR" +* - .TYPE_UNKERR : "UNKNOWN_ERROR" +* - .TYPE_USEERR : "USAGE_ERROR" +* +* > {@link module:Helper Helper} +* - .indent() +* - .normalyzeParameters() +* - .normalyzeUrl() +* +* > {@link module:XHR Protocols.XHR} +* - .call() +* +* > {@link module:Services Services (objects)} +* - .Alti +* - {@link Gp.Services.Alti.Elevation .Elevation()} +* - {@link Gp.Services.AltiResponse .AltiResponse()} +* - .AutoComplete +* - {@link Gp.Services.AutoComplete.SuggestedLocation .SuggestedLocation()} +* - {@link Gp.Services.AutoCompleteResponse .AutoCompleteResponse()} +* - {@link Gp.Services.Config .Config()} +* - {@link Gp.Services.DefaultUrl .DefaultUrl()} +* - {@link Gp.Services.GeocodeResponse .GeocodeResponse()} +* - {@link Gp.Services.GetConfigResponse .GetConfigResponse()} +* - {@link Gp.Services.IsoCurveResponse .IsoCurveResponse()} +* - .Route +* - {@link Gp.Services.Route.RouteInstruction .RouteInstruction()} +* - {@link Gp.Services.RouteResponse .RouteResponse()} +* +* > Services (factory) +* - {@link module:Services~autoComplete .autoComplete()} +* - {@link module:Services~geocode .geocode()} +* - {@link module:Services~getAltitude .getAltitude()} +* - {@link module:Services~getConfig .getConfig()} +* - {@link module:Services~isoCurve .isoCurve()} +* - {@link module:Services~reverseGeocode .reverseGeocode()} +* - {@link module:Services~route .route()} +* +* > servicesDate : "YYYY-MM-DD" +* +* > servicesVersion : "X.X.X" +* +*/ + + + + + + + + + + + + + + + + + +/** Version */ +const servicesVersion = _package_json__WEBPACK_IMPORTED_MODULE_13__.version; +/** Publication date */ +const servicesDate = _package_json__WEBPACK_IMPORTED_MODULE_13__.date; + +// on declare les ns dans root global +var Gp = {}; + +Gp.servicesVersion = servicesVersion; +Gp.servicesDate = servicesDate; + +// Export Protocols +Gp.Protocols = {}; +Gp.Protocols.XHR = _Protocols_XHR__WEBPACK_IMPORTED_MODULE_10__["default"]; +// Export services +Gp.Services = _Services_Services__WEBPACK_IMPORTED_MODULE_0__["default"]; +// Export DefaultUrls +Gp.Services.DefaultUrl = _Services_DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__["default"]; +// Export Alti +Gp.Services.AltiResponse = _Services_Alti_Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_2__["default"]; +Gp.Services.Alti = {}; +Gp.Services.Alti.Elevation = _Services_Alti_Response_model_Elevation__WEBPACK_IMPORTED_MODULE_3__["default"]; +// Export Autocomplete +Gp.Services.AutoCompleteResponse = _Services_AutoComplete_Response_model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_4__["default"]; +Gp.Services.AutoComplete = {}; +Gp.Services.AutoComplete.SuggestedLocation = _Services_AutoComplete_Response_model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_5__["default"]; +// Export Config +Gp.Services.Config = _Services_Config_Config__WEBPACK_IMPORTED_MODULE_9__["default"]; +// Export IsoCurve +Gp.Services.IsoCurveResponse = _Services_ProcessIsoCurve_Response_model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_6__["default"]; +// Export Route +Gp.Services.RouteResponse = _Services_Route_Response_model_RouteResponse__WEBPACK_IMPORTED_MODULE_7__["default"]; +Gp.Services.Route = {}; +Gp.Services.Route.RouteInstruction = _Services_Route_Response_model_RouteInstruction__WEBPACK_IMPORTED_MODULE_8__["default"]; +// Export Erreurs et Outils +Gp.Error = _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_11__["default"]; +Gp.Helper = _Utils_Helper__WEBPACK_IMPORTED_MODULE_12__["default"]; + +/* harmony default export */ __webpack_exports__["default"] = (Gp); + + +/***/ }), +/* 37 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Config_Config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38); +/* harmony import */ var _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54); +/* harmony import */ var _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68); +/* harmony import */ var _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76); +/* harmony import */ var _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(77); +/* harmony import */ var _Route_Route__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81); +/* harmony import */ var _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(88); +/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "point|circle|bbox" }] */ + +/** +* Geoportal web services invocation namespace. +* +* @module Services +* @alias Gp.Services +*/ + + + + + + + + +var Services = { + /** + * Access to Geoportal resources metadata availables with one ore several keys + * + * @method getConfig + * @param {Object} options - Options for function call. + * @param {String} [options.apiKey] - Access key(s) ("," as separator, no spaces) to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web} + * @param {String} [options.customConfigFile] - path to a local config file. Overload the apiKey parameter + * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GetConfigResponse} object as a parameter except if "rawResponse" parameter is set to true : a String will be returned. + * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter. + * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled. + */ + getConfig : function (options) { + var configService = new _Config_Config__WEBPACK_IMPORTED_MODULE_0__["default"](options); + configService.call(); + }, + /** + * Getting elevations in or along of one or several points on french territories using the [elevation services of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/alti.html}.
+ * Two use cases are availables :
+ * 1. getting elevations of the given points : don't use the options.sampling parameter ;
+ * 2. getting a regular set of elevations along the given points : use the options.sampling parameter. + * + * @method getAltitude + * @param {Object} options - Options for function call. + * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}. + * @param {Array.} options.positions - Array of positions ({lon:float, lat:float}) expressed in CRS:84 coordinates system, where to get elevations. 50 positions maximum may be given. 2 positions minimum are required if you use the options.sampling parameter. + * @param {Number} [options.sampling] - Number of points to use (between 2 and 5000) in order to compute an elevation path. The points given with the options.positions parameter are used to fix the planimetric path along which the elevations will be computed.
+ * If not used, only elevations of these positions will be returned. + * @param {Boolean} [options.zonly=false] - Set this parameter to true if you only want to have elevations returned without corresponding coordinates. + * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AltiResponse} object as a parameter, except if "rawResponse" is set to true. + * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter. + * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled. + * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/alti/rest/elevation.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing. + * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true). + * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing. + * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing. + * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing. + * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {String} [options.contentType="application/xml"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing. + * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing. + * @param {String} [options.api='REST'] - What API to use for interacting with underlying web service : 'REST'. Only use if you know what you are doing. + * @param {String} [options.outputFormat='xml'] - Output format for underlying web service response : 'xml' or 'json'. Only use if you know what you are doing. + */ + getAltitude : function (options) { + var altiService = new _Alti_Alti__WEBPACK_IMPORTED_MODULE_1__["default"](options); + altiService.call(); + }, + /** + * Getting positon of a geographic identifier (places names, address, cadastral parcel, other...) using the [geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage.html}. + * + * @example + * Gp.Services.geocode ({ + * apiKey : "carte", + * location : "73 avenue de Paris, Saint-Mandé", + * // traitement des resultats + * onSuccess : function (result) { + * console.log("found (x:"+result.position.x+", y:"+result.position.y+")") ; + * } + * }) ; + * + * + * @method geocode + * @param {Object} options - Options for function call. + * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}. + * @param {String} [options.index="StreetAddress"] - Geographical identifier type to search. Values currently availables are : "PositionOfInterest" for place names, "StreetAddress" for address search, "CadastralParcel" for Cadastral parcels search, "location" for a multi-index search on "StreetAddress" and "PositionOfInterest". Default is "StreetAddress". + * @param {String} options.query - Geographic identifier to locate. + * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given. + * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be "String". + *

+ * Properties availables for address search :
+ * "postalCode", "inseeCode" and "city". + *

+ * Properties availables for place names search :
+ * "postalCode", "inseeCode" and "type". + *

+ * Properties availables for cadastral parcels search :
+ * "codeDepartement", "codeCommune", "nomCommune", "codeCommuneAbs", "codeArrondissement", "section", "numero", "feuille". + * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided. + * @param {Boolean} [options.returnTrueGeometry=false] - Set this parameter to true if you wish to have the true geometrie returned. + * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if "rawResponse" is set to true. + * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter. + * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled. + * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing. + * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true). + * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing. + * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing. + * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing. + * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing. + */ + geocode : function (options) { + var geocodeService = new _Geocode_Geocode__WEBPACK_IMPORTED_MODULE_2__["default"](options); + geocodeService.call(); + }, + /** + * Retrieving geographical identifiers (place names, address, cadastral parcels, ...) near a given position, using the [reverse geocoding web service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/geocodage-inverse.html}. + * + * @method reverseGeocode + * @param {Object} options - Options for function call. + * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}. + * @param {String} [options.index="StreetAddress"] - Geographical identifier type to search. Values currently availables are : "PositionOfInterest" for place names, "StreetAddress" for address search, "CadastralParcel" for Cadastral parcels search, "location" for a multi-index search on "StreetAddress" and "PositionOfInterest". Default is "StreetAddress". + * @param {Object} options.position - Reference position where to search geographical identifiers. + * @param {Float} options.position.lon - Longitude + * @param {Float} options.position.lat - Latitude + * @param {Object} [options.filters] - Additional filters to apply to search. The following properties may be given. + * @param {String} [options.filters.[prop]] - Additionnal properties to filter search. Properties depends on options.index, and values type should be "String". + *

+ * Properties availables for address search :
+ * "postalCode", "inseeCode" and "city". + *

+ * Properties availables for place names search :
+ * "postalCode", "inseeCode" and "type". + *

+ * Properties availables for cadastral parcels search :
+ * "codeDepartement", "codeCommune", "nomCommune", "codeCommuneAbs", "codeArrondissement", "section", "numero", "feuille". + * @param {Object} [options.searchGeometry] - Location where to perform the search. + * @param {String} options.searchGeometry.type - Geometry type (Point|Circle|Linestring|Polygon) + * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordinates + * @param {Float} [options.searchGeometry.radius] - Radius (only for type 'Circle') + * @param {Number} [options.maximumResponses=20] - Maximum number of responses. Default underlying service value applies (20) if not provided. + * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.GeocodeResponse} object as a parameter except if "rawResponse" is set to true. + * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter. + * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled. + * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/geoportail/ols] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing. + * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true). + * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing. + * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing. + * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing. + * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing. + */ + reverseGeocode : function (options) { + var reverseGeocodeService = new _Geocode_ReverseGeocode__WEBPACK_IMPORTED_MODULE_3__["default"](options); + reverseGeocodeService.call(); + }, + /** + * Getting suggestions of probable places names or address based on uncomplete texts, using the [autocompletion service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/autocompletion.html} + * + * @method autoComplete + * @param {Object} options - Options for function call. + * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}. + * @param {String} options.text - Text input to complete. + * @param {Array.} [options.filterOptions.type = "StreetAddress"] - Suggestion types to provide : address ("StreetAddress") and/or place name ("PositionOfInterest"). + * @param {Array.} [options.filterOptions.territory] - Places where to limit the search of suggestions : "METROPOLE" (Corsica and metropolitan France), "DOMTOM" (French overseas departments and territories), or an INSEE code of a department. No limitation by default. For instance : ['METROPOLE', '31'] + * @param {Number} [options.maximumResponses = 10] - Maximum number of responses. + * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.AutoCompleteResponse} object as a parameter except if "rawResponse" is set to true. + * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter. + * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled. + * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/ols/apis/completion] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing. + * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true). + * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing. + * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing. + * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing. + * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {String} [options.contentType="application/xml"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing. + * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing. + */ + autoComplete : function (options) { + var autoCompleteService = new _AutoComplete_AutoComplete__WEBPACK_IMPORTED_MODULE_4__["default"](options); + autoCompleteService.call(); + }, + /** + * Getting a route from one point to another using the [route service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/itineraires.html}. + * + * @method route + * @param {Object} options - Options for function call. + * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities. + * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}. + * @param {String} [options.routePreference = "fastest"] - Indicates the way to compute the route : "fastest" (time optimisation) or "shortest" (distance optimisation). Available values are in the GetCapabilities. + * @param {Gp.Point} options.startPoint - Start point of the route. Expressed in CRS:84 coordinates system (startPoint.x corresponds to longitude, startPoint.y corresponds to latitude). Available bbox are in the GetCapabilities. + * @param {Gp.Point} options.endPoint - End point of the route. Expressed in CRS:84 coordinates system (endPoint.x corresponds to longitude, endPoint.y corresponds to latitude). Available bbox are in the GetCapabilities. + * @param {Array.} [options.viaPoints] - Ordered via Points of the route. Expressed in CRS:84 coordinates system (viaPoints[i].x corresponds to longitude, viaPoints[i].y corresponds to latitude). Available bbox are in the GetCapabilities. + * @param {String} [options.graph = "Voiture"] - User profile to use to compute the route : "Voiture" (using a vehicule) or "Pieton" (pedestrian). Has an influence on the kind of roads the route may use and the average speed. Available bbox are in the GetCapabilities. + * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features ("toll", "bridge" or "tunnel"). + * @param {Boolean} [options.geometryInInstructions = false] - Indicates if route geometry has to be also returned with route instructions. + * @param {Boolean} [options.provideBoundingBox = true] - Indicates if route instructions has to be localised with a BBOX in the response. + * @param {String} [options.distanceUnit = "m"] - The unit used to provide distances in the response ("meter" or "kilometer"). + * @param {String} [options.timeUnit = "second"] - The unit used to provide duration in the response ("standard", "second", "minute", "hour"). + * @param {Array.} [options.waysAttributes] - Way Attributes to add in the response. Available values are in the GetCapabilities. + * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities. + * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.RouteResponse} object as a parameter except if "rawResponse" is set to true. + * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter. + * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled. + * @param {String} [options.outputFormat='json'] - Output format ("json" or "xml") to use for underlying webService. Only use if you know what you are doing. + * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/itineraire/rest/route.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing. + * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true). + * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing. + * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing. + * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing. + * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {String} [options.contentType="application/xml"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing. + * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing. + */ + route : function (options) { + var routeService = new _Route_Route__WEBPACK_IMPORTED_MODULE_5__["default"](options); + routeService.call(); + }, + /** + * Computing a set of places (curve) reachable from a given point (or from where to start to reach a given point) within a time or distance constraint using the [isochrone service of the Geoportal Platform]{@link https://geoservices.ign.fr/documentation/geoservices/isochrones.html}. + * + * @method isoCurve + * @param {Object} options - Options for function call. + * @param {String} options.apiKey - Access key to Geoportal platform, obtained [here]{@link https://geoservices.ign.fr/services-web}. + * @param {String} options.resource - Resource used to compute the route. Available values are in the GetCapabilities. + * @param {Gp.Point} options.position - Start or Arrival (options.reverse===true) Point for the computing. Expressed in CRS:84 coordinates system (position.x corresponds to longitude, position.y corresponds to latitude). + * @param {String} [options.graph = "Voiture"] - User profile to use to compute the isoCurve : "Voiture" (using a vehicule) or "Pieton" (pedestrian). Has an influence on the kind of roads to use and the average speed. Available values are in the GetCapabilities. + * @param {Array.} [options.exclusions] - DEPRECATED: use options.constraints. Indicates if route has to avoid some features ("toll", "bridge" or "tunnel"). + * @param {Array.} [options.constraints] - Constraints used ({'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}). Available values are in the GetCapabilities. + * @param {String} [options.method = "time"] - Computing method to use : "time" (using a duration as a constraint) or "distance" (using a distance as a constraint). Available values are in the GetCapabilities. + * @param {Float} options.time - Maximum duration (expressed in seconds) to use when options.method is set to "time". + * @param {Float} options.distance - Maximum distance (expressed in meters) to use when options.method is set to "distance". + * @param {Boolean} [options.reverse = false] - Set this parameter to true if you want options.position to be the destination (instead of departure) for the computing. + * @param {String} [options.distanceUnit = "km"] - The unit used to provide distances in the response ("m" or "km"). + * @param {String} [options.timeUnit = "second"] - The unit used to provide duration in the response ("standard", "second", "minute", "hour"). + * @param {Boolean} [options.smoothing = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry to be smoothed. + * @param {Boolean} [options.holes = false] - DEPRECATED: Set this parameter to true if you want the resulting geometry (polygon) to have holes if pertinent. + * @param {Function} options.onSuccess - Callback function for getting successful service response. Takes a {@link Gp.Services.IsoCurveResponse} object as a parameter except if "rawResponse" is set to true. + * @param {Function} [options.onFailure] - Callback function for handling unsuccessful service responses (timeOut, missing rights, ...). Takes a {@link Gp.Error} object as parameter. + * @param {Number} [options.timeOut=0] - Number of milliseconds above which a timeOut response will be returned with onFailure callback (see above). Default value is 0 which means timeOut will not be handled. + * @param {String} [options.outputFormat='json'] - Output format ("json") to use for underlying webService. Only use if you know what you are doing. + * @param {String} [options.serverUrl=http (s)://wxs.ign.fr/APIKEY/isochrone/isochrone.json] - Web service URL. If used, options.apiKey parameter is ignored. Only use if you know what you're doing. + * @param {Boolean} [options.ssl = true] - Use of HTTPS or HTTP protocol to request the services. HTTPS by default (ssl=true). + * @param {String} [options.protocol=XHR] - Protocol used to handle dialog with web service. Possible values are 'JSONP' ({@link https://en.wikipedia.org/wiki/JSONP}) and 'XHR' ({@link https://en.wikipedia.org/wiki/XMLHttpRequest}). Only XHR protocol is supported in a NodeJS environment. Only use if you know what you're doing. + * @param {String} [options.proxyURL] - Proxy URL to use when requesting underlying web service. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you're doing. + * @param {String} [options.callbackSuffix] - Callback function name suffix to use in case of a JSONP protocol use (see above), to set your own suffix instead of auto-increment. Ignored when options.protocol is set to 'XHR' value. Only use if you know what you're doing. + * @param {String} [options.httpMethod=GET] - HTTP method to use when requesting underlying web service in case of a XHR protocol use (see above). Possible values are 'GET' and 'POST'. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {String} [options.contentType="application/xml"] - Content-Type to use when requesting underlying web service in case of a XHR protocol use (see above) and if method HTTP is POST. Ignored when options.protocol is set to 'JSONP' value. Only use if you know what you are doing. + * @param {Boolean} [options.rawResponse=false] - Setting this parameter to true implies you want to handle the service response by yourself : it will be returned as an unparsed String in onSuccess callback parameter. Only use if you know what you are doing. + * @param {Function} [options.onBeforeParse] - Callback function for handling service response before parsing (as an unparsed String). Takes a String as a parameter (the raw service response). Returns a String that will be parsed as the service response. Only use if you know what you are doing. + */ + isoCurve : function (options) { + var processIsoCurveService = new _ProcessIsoCurve_ProcessIsoCurve__WEBPACK_IMPORTED_MODULE_6__["default"](options); + processIsoCurveService.call(); + } +}; + +/** + * Point object. + * + * @namespace + * @alias Gp.Point + * + * @property {Float} x - Point abscissa + * @property {Float} y - Point ordinate + */ +var point = {}; + +/** + * Circle object. + * + * @namespace + * @alias Gp.Circle + * + * @property {Float} x - Circle center abscissa. + * @property {Float} y - Circle center ordinate. + * @property {Float} radius - Circle radius. + */ +var circle = {}; + +/** + * Bounding box object, expressed with four coordinates. + * + * @namespace + * @alias Gp.BBox + * + * @property {Float} left - minimum abscissa + * @property {Float} right - maximum abscissa + * @property {Float} bottom - minimum ordinate + * @property {Float} top - maximum ordinate + */ +var bbox = {}; + +/* harmony default export */ __webpack_exports__["default"] = (Services); + + +/***/ }), +/* 38 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51); +/* harmony import */ var _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53); + + + + + + +/** + * @classdesc + * + * Recupération de la configuration de clés Géoportail sous forme de JSON + * + * @constructor + * @extends {Gp.Services.CommonService} + * @alias Gp.Services.Config + * @param {Object} options - options spécifiques au service (+ les options heritées) + * @param {Sting} options.apiKey - clé(s) dont on veut obtenir la configuration. Si plusieurs clés, séparer chacune par une virgule + * @param {Boolean} [options.sync=false] - force le mode synchrone + * @param {String} options.customConfigFile - chemin vers un fichier de configuration personnalisé. Surcharge le paramètre apiKey. + * + * @example + * var options = { + * apiKey : "cartes,ortho", + * sync : false, + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * }; + * + */ +function Config (options) { + if (!(this instanceof Config)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("CLASS_CONSTRUCTOR", "Config")); + } + + /** + * Nom de la classe (heritage) + */ + this.CLASSNAME = "Config"; + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("Gp.Config"); + this.logger.trace("[Constructeur Config (options)]"); + + // ##################### + // analyse des options + // ##################### + + // gestion du callback onSuccess + var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === "function"); + if (!bOnSuccess) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "onSuccess()")); + } + if (!options.apiKey && !options.customConfigFile) { + // si pas de thème spécifié, on récupère toutes les ressources possibles dans l'objet Config + options.apiKey = "full"; + } + this.options = {}; + this.options.onSuccess = options.onSuccess; + this.options.onFailure = options.onFailure; + + // mode sync + this.options.sync = options.sync || false; + + // gestion d'un tableau d'url des fichiers de configuration + this.options.listConfigUrls = (options.customConfigFile) + ? [options.customConfigFile] + : !Array.isArray(options.apiKey) + ? _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__["default"].Config.url(options.apiKey.split(",")) + : _DefaultUrlService__WEBPACK_IMPORTED_MODULE_3__["default"].Config.url(options.apiKey); +} + +/** + * @lends module:Config# + */ +Config.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_2__["default"].prototype, { + // todo + // getter/setter +}); + +/** + * Constructeur (alias) + */ +Config.prototype.constructor = Config; + +/** + * Création de la requête + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + * @overload + */ +Config.prototype.buildRequest = function (error, success) { + // liste des urls des fichiers de configuration en JSON + this.listConfigUrls = this.options.listConfigUrls; + + if (!this.listConfigUrls) { + error.call(this, new Error("url by default not found !")); + return; + } + + // INFO : + // il n'y a pas de construction de requête, + // on passe directement à l'appel des requêtes + success.call(this, this.listConfigUrls); +}; + +/** + * Récupération des configuration + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + * @overload + */ +Config.prototype.callService = function (error, success) { + if (this.options.sync) { + __callServiceSync.call(this, error, success); + } else { + __callService.call(this, error, success); + } +}; + +/** + * Requêtes en mode asynchrone + * + * @param {*} error + * @param {*} success + * @private + */ +var __callService = function (error, success) { + // liste des resultats au format JSON + this.listConfigResults = []; + + // test on env. nodejs or browser + let Fetch = null; + if (typeof window === "undefined") { + var nodefetch = __webpack_require__(47); + Fetch = nodefetch; + } else { + Fetch = window.fetch; + } + + // the factory of fetch ! + var fetchFactory = (url) => { + return Fetch(url, { credentials : "same-origin" }) + .then((response) => { + if (response.ok) { + return response.json() + .then((json) => { + // TODO : + // tester le contenu ! + return json; + }) + .catch((error) => { + throw new Error("Exception Json : " + error); + }); + } else { + throw new Error("Exception HTTP : " + response.status + " (status code) !"); + } + }) + .catch((error) => { + return new Promise((resolve, reject) => { + // eslint-disable-line no-unused-vars + reject(error); + }); + }); + }; + + // construction des promises fetch + var promises = []; + for (let index = 0; index < this.listConfigUrls.length; index++) { + const url = this.listConfigUrls[index]; + promises.push(fetchFactory(url)); + } + + Promise.all(promises) + .then((results) => { + if (!results) { + throw new Error("results config empty !?"); + } + results.forEach((result) => { + // TODO : + // verification des resultats + this.listConfigResults.push(result); + }); + }) + .then(() => { + success.call(this, this.listConfigResults); + }) + .catch((e) => { + // TODO : + // construction d'un message + error.call(this, e); + }); +}; + +/** + * Requêtes en mode synchrone + * + * @param {*} error + * @param {*} success + * @private + */ +var __callServiceSync = function (error, success) { + // liste des resultats au format JSON + this.listConfigResults = []; + + // FIXME : + // boucle synchrone ! + for (var i = 0; i < this.listConfigUrls.length; i++) { + const url = this.listConfigUrls[i]; + // TODO : + // prévoir le CORS, headers, ... + const request = new XMLHttpRequest(); + request.open("GET", url, false); + request.send(null); + if (request.status === 200) { + // TODO : + // tester la reponse ! + var response = JSON.parse(request.responseText); + this.listConfigResults.push(response); + } + } + // callback + if (this.listConfigResults.length !== 0) { + success.call(this, this.listConfigResults); + } else { + error.call(this, new Error("...")); + } +}; + +/** + * Analyse et mise en forme de la réponse en fusionnant les configurations + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + * @overload + */ +Config.prototype.analyzeResponse = function (error, success) { + // fonction de merge des objects JSON + var mergeConfig = function (objects) { + // objet fusion des couches + var allLayersConfig = {}; + // objet fusion des clés + var allKeysConfig = {}; + // objet fusion des TMS + var allTMSConfig = {}; + + // on fusionne les résultat + for (var i = 0; i < objects.length; i++) { + if (!objects[i].generalOptions || !objects[i].layers) { + return; + } + allKeysConfig = { + ...allKeysConfig, + ...objects[i].generalOptions.apiKeys + }; + allLayersConfig = { + ...allLayersConfig, + ...objects[i].layers + }; + allTMSConfig = { + ...allTMSConfig, + ...objects[i].tileMatrixSets + }; + } + + var mergedConfig = { + generalOptions : { + apiKeys : allKeysConfig + }, + layers : allLayersConfig, + tileMatrixSets : allTMSConfig + }; + return mergedConfig; + }; + + // fusion des configurations JSON + var ConfigJSON = mergeConfig(this.listConfigResults); + if (!ConfigJSON) { + error.call(this, new Error("configuration structure not conforme !")); + return; + } + + // creation des interfaces + var IConfig = new _ConfigInterface__WEBPACK_IMPORTED_MODULE_4__["default"](); + // ajout des interfaces avec la configuration JSON + Object.assign(IConfig, ConfigJSON); + + // définition de la variable globale Gp.Config + var scope = typeof window !== "undefined" ? window : {}; + if (!scope.Gp) { + scope.Gp = {}; + } + + // enregistrement + if (scope.Gp.Config) { + Object.assign(scope.Gp.Config, IConfig); + // dans le doute..., ceinture et bretelles ! + for (var property in IConfig) { + scope.Gp.Config[property] = IConfig[property]; + } + } else { + scope.Gp.Config = IConfig; + } + + // INFO : + // il n'y a pas d'analyse des résultats, + // on passe directement à l'appel de la callback utilisateur + success.call(this, scope.Gp.Config); +}; + +/* harmony default export */ __webpack_exports__["default"] = (Config); + + +/***/ }), +/* 39 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35); +/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_0__); + + +var LoggerByDefault = { + /** + * logger statique + * + * @static + * @param {String} name - nom du logger + * @returns {Object} retourne un logger + */ + getLogger : function (name) { + // Substitute global constants configured at compile time + // cf. webpack.config.js + // FIXME howtodo !? DefineWebpackPlugin ? EnvironmentWebpackPlugin ? + ("false".match(/true/)) ? loglevel__WEBPACK_IMPORTED_MODULE_0__["disableAll"]() : loglevel__WEBPACK_IMPORTED_MODULE_0__["enableAll"](); + var logname = name || "default"; + return loglevel__WEBPACK_IMPORTED_MODULE_0__["getLogger"](logname); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (LoggerByDefault); + + +/***/ }), +/* 40 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * Classe de gestion des erreurs qui permer d'associer un message d'erreur à l'exception lancée. + * + * @example + * MessagesResources.getMessage("ERROR_PARAM_MISSING", "x", "y", "z"))); + * // --> output : Parameter(s) 'x - y - z' missing + * + * @module MessagesResources + * @alias Gp.Utils.MessagesResources + * @private + */ +var MessagesResources = { + + // Paramètres + PARAM_MISSING : "Parameter(s) '%var%' missing", + PARAM_EMPTY : "Parameter(s) '%var%' empty", + PARAM_TYPE : "Wrong type(s) for parameter(s) '%var%'", + PARAM_FORMAT : "Parameter(s) '%var%' not correctly formatted", + PARAM_NOT_SUPPORT : "Value(s) for parameter(s) '%var%' not supported", + PARAM_NOT_SUPPORT_NODEJS : "Value(s) for parameter(s) '%var%' not supported to NodeJS", + PARAM_UNKNOWN : "Value(s) for parameter(s) '%var%' unknown", + + // Services + // Requête + SERVICE_REQUEST_BUILD : "An error occurred during the request building of the service", + SERVICE_REQUEST_EMPTY : "The request sent to the service is empty", + + // Réponse + SERVICE_RESPONSE_EXCEPTION : "The service returned an exception : '%var%'", + SERVICE_RESPONSE_EXCEPTION_2 : "The service returned an exception", + SERVICE_RESPONSE_ANALYSE : "An error occurred while parsing the response '%var%' of the service", + SERVICE_RESPONSE_ANALYSE_2 : "An unknown error occurred while parsing the response", + SERVICE_RESPONSE_EMPTY : "The response of the service is empty", + SERVICE_RESPONSE_EMPTY_2 : "The response from the service could not be analyzed or is empty", + SERVICE_RESPONSE_FORMAT : "The format of the service response is not supported (handled format(s) : '%var%')", + SERVICE_RESPONSE_FORMAT_2 : "The format of the service response is not supported", + SERVICE_RESPONSE_FORMAT_3 : "No suggestion matching the search", + + // Classes + CLASS_CONSTRUCTOR : "'%var%' constructor cannot be called as a function.", + + /** + * Fonction qui va retourner le message d'erreur associé à la clé donnée + * + * @method getMessage + * @param {String} clef - Clef de l'erreur (ex : ERROR_PARAM) + * @param {String[]} parametres - Paramètres/variables concernés par le message d'erreur associé à la clef donnée + * @return {String} message - String contenant le message de l'exception + */ + getMessage : function (clef, parametres) { + // param de la fonction uniquement pour la documentation... + + if (Object.keys(arguments).length === 0) { + return "Message indefined !"; + } + + var params = Array.prototype.slice.call(arguments); + var key = params.shift(); + var args = params; + + var message = this[key]; + + try { + if (Array.isArray(args) && args.length > 0) { + message = message.replace("%var%", args.join(" - ")); + } else { + message = message.replace("%var%", "%var% (not specified)"); + } + } catch (e) { + // error de string.replace() + + } + + return message; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (MessagesResources); + + +/***/ }), +/* 41 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40); +/* harmony import */ var _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(52); +var _package_json__WEBPACK_IMPORTED_MODULE_6___namespace = /*#__PURE__*/__webpack_require__.t(52, 1); + + + + + + +// package.json (extract version) + + +/** + * @classdesc + * Composant Service + * + * @constructor + * @alias Gp.Services.CommonService + * @param {Object} options - options communes à tous les services + * + * @param {String} [options.serverUrl] - URL d'accès au service. Par défaut "https://wxs.ign.fr/calcul/geoportail/SERVICE/". + * Permet de forcer l'utilisation d'un service équivalent déployé derrière une éventuelle autre URL d'accès. + * Si ce paramètre est renseigné alors, le paramètre par défaut est ignoré. + * + * @param {String} [options.protocol] - Le protocole à utiliser pour récupérer les informations du service : + * peut valoir 'JSONP' ou 'XHR'. + * Par défaut, c'est le protocole XHR qui sera utilisé. + * Attention, le protocole JSONP n'est pas valide dans un environnement NodeJS (Utilisation du mode XHR). + * + * @param {Boolean} [options.ssl] - Indique si l'on souhaite intérroger les services en https. + * Ce paramètre ne fonctionne que pour une utilisation hors navigateur (ex. NodeJS). + * Sur un navigateur, le protocole est automatiquement extrait de l'url du site... + * Par défaut, on utilise le protocole http (ssl=false). + * + * @param {String} [options.proxyURL] - Le proxy à utiliser pour pallier au problème de cross-domain dans le cas d'une requête XHR. + * Utile si le paramètre 'protocol' vaut 'XHR', il ne sera pas pris en compte si protocol vaut JSONP. + * + * @param {String} [options.callbackSuffix] - Suffixe de la fonction de callback à utiliser, dans le cas du protocole JSONP. + * Par défaut, la fonction de callback portera un nom du type "callback"+ID, où ID est soit un identifiant unique généré à chaque requête, + * soit le paramètre callbackSuffix s'il est spécifié. Par exemple, si callbackSuffix="_2", la fonction sera "callback_2 ()". + * Utile pour utiliser une réponse déjà encapsulée dans une fonction de callback, dont le nom est connu + * Utile seulement si le paramètre 'protocol' vaut 'JSONP', il ne sera pas pris en compte si protocol vaut 'XHR'. + * + * @param {String} [options.httpMethod] - La méthode HTTP + * à utiliser dans le cas d'une requête XHR : peut valoir 'GET' ou 'POST'. + * Non pris en compte si 'protocol' vaut JSONP qui fonctionne obligatoirement en GET. + * Par défaut, c'est la méthode GET qui est utilisée. + * + * @param {String} [options.contentType] - Content-Type de la requete + * à utiliser dans le cas d'une requête XHR en mode POST. + * Non pris en compte si 'protocol' vaut JSONP et/ou la méthode HTTP vaut GET. + * Par défaut, c'est la méthode GET qui est utilisée donc on n'utilise pas de Content-Type. + * + * @param {Number} [options.timeOut] - Délai d'attente maximal (en ms) de la réponse du service (à partir de l'envoi de la requête). + * Par défaut, aucun timeOut n'est pris en compte (timeoutDelay= 0). + * + * @param {Boolean} [options.rawResponse] - Indique si l'on souhaite que la réponse du service ne soit pas parsée par l'API avant d'être restituée. + * (Cf. paramètre « onSuccess » pour plus de détails). + * + * @param {Function} [options.onSuccess] - Fonction appelée lorsque le service répond correctement à la requête + * (code HTTP 200, sans message d'erreur). + * Cette fonction prend en paramètre la réponse du service, + * soit sous la forme d'un Object Javascript formaté par le parseur dédié à la syntaxe du service (comportement par défaut) ; + * soit brute au format String non prétraité si le paramètre « rawResponse » a été précisé avec la valeur « true ». + * + * @param {Function} [options.onFailure] - Fonction appelée lorsque le service ne répond pas correctement + * (code HTTP de retour différent de 200 ou pas de réponse). + * + * @param {Function} [options.onBeforeParse] - Fonction appelée avant le parsing de la réponse + * Permet de modifier la réponse avant parsing et la fonction doit retourner une String. + * Cette fonction prend en paramètre la réponse telle que renvoyée par le service + * (cad au format json ou xml). + * Pour le JSONP, si le paramètre "rawResponse" a été précisé avec la valeur "true", + * la fonction prend en paramètre un Object JavaScript contenant la réponse XML. + * + * @example + * var options = { + * serverUrl : 'http://localhost/service/', + * protocol : 'JSONP', // JSONP|XHR + * ssl : false, + * proxyURL : null, + * callbackName : null, + * httpMethod : 'GET', // GET|POST + * timeOut : 10000, // ms + * rawResponse : false, // true|false + * scope : null, // this + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * onBeforeParse : function (rawResponse) {} + * }; + */ +function CommonService (options) { + if (!(this instanceof CommonService)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__["default"].getMessage("CLASS_CONSTRUCTOR")); + } + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("CommonService"); + this.logger.trace("[Constructeur CommonService (options)]"); + + // ##################### + // récupération des options par défaut pour les paramètres optionnels + // ##################### + + /** + * Options du service + * @type {Object} + */ + this.options = { + // protocol : "JSONP", + protocol : "XHR", + ssl : true, + proxyURL : "", + // callbackName : "", + callbackSuffix : null, + httpMethod : "GET", + timeOut : 0, + rawResponse : false, + scope : this, + /** + * callback par defaut pour la reponse + * @param {Object} response - response + * @private + */ + onSuccess : function (response) { + console.log("onSuccess - la reponse est la suivante : ", response); + }, + /** + * callback par defaut pour les erreurs + * @param {Object} error - error + * @private + */ + onFailure : function (error) { + if (error.status === 200 || !error.status) { + console.log("onFailure : ", error.message); + } else { + console.log("onFailure - Erreur (", error.status, ") : ", error.message); + } + } + }; + + // et on ajoute les options en paramètre aux options par défaut + for (var opt in options) { + if (options.hasOwnProperty(opt)) { + this.options[opt] = options[opt]; + } + } + + // ##################### + // analyse des options + // ##################### + + // modification de la fonction de callback onSuccess dans le cas où la réponse brute est demandée + if (this.options.rawResponse && !this.options.onSuccess) { + /** + * callback par defaut pour la reponse + * @param {Object} response - response + * @private + */ + this.options.onSuccess = function (response) { + console.log("onSuccess - la réponse brute du service est la suivante : ", response); + }; + } + + // gestion du callback onSuccess + var bOnSuccess = !!(this.options.onSuccess !== null && typeof this.options.onSuccess === "function"); + if (!bOnSuccess) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__["default"].getMessage("PARAM_MISSING", "onSuccess()")); + } + + /* FIXME traitement au niveau de chaque composant pour tester service WXS / GPF + // gestion de l'url du service par defaut + if (!this.options.serverUrl) { + // INFO + // gestion de l'url du service par defaut pour les services qui ne possèdent qu'une seul url par defaut + // les cas particuliers des services avec plusieurs urls (ex. Alti) devront être traité dans la classe du composant + // donc si l'url n'est pas renseignée, il faut utiliser les urls par defaut + DefaultUrlService.ssl = this.options.ssl; + var urlByDefault = DefaultUrlService[this.CLASSNAME].url("calcul"); + if (typeof urlByDefault === "string") { + this.options.serverUrl = urlByDefault; + } else { + this.logger.trace("URL par defaut à determiner au niveau du composant..."); + } + }*/ + + // FIXME nettoyage des KVP dans l'url du service + // if (this.options.serverUrl) { + // // INFO + // // si l'url est renseignée, il faut la nettoyer de tous ses KVP + // // ex. on ne veut pas de params. 'callback' ou 'output' car ceci declencherait + // // des opérations d'encapsulations des reponses légèrement farfelues ... + // var urlsource = this.options.serverUrl; + // var urlparts = urlsource.split("?"); + // this.options.serverUrl = urlparts[0]; + // } + + // gestion de la methode HTTP + this.options.httpMethod = (typeof options.httpMethod === "string") ? options.httpMethod.toUpperCase() : "GET"; + + switch (this.options.httpMethod) { + case "POST": + case "GET": + break; + case "PUT": + case "DELETE": + case "HEAD": + case "OPTIONS": + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__["default"].getMessage("PARAM_NOT_SUPPORT", "httpMethod")); + default: + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__["default"].getMessage("PARAM_UNKNOWN", "httpMethod")); + } + + // gestion du protocole + // this.options.protocol = (typeof options.protocol === "string" ) ? options.protocol.toUpperCase() : "JSONP"; + this.options.protocol = (typeof options.protocol === "string") ? options.protocol.toUpperCase() : "XHR"; + + switch (this.options.protocol) { + case "JSONP": + case "XHR": + break; + default: + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__["default"].getMessage("PARAM_UNKNOWN", "protocol")); + } + + // on determine l'environnement d'execution : browser ou non ? + // et on lance une exception sur l'utilisation du protocole JSONP pour nodeJS... + if (typeof window === "undefined" && this.options.protocol === "JSONP") { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_2__["default"].getMessage("PARAM_NOT_SUPPORT_NODEJS", "protocol=JSONP (instead use XHR)")); + } + + // le protocole JSONP ne fonctionne qu'en GET. + if (this.options.protocol === "JSONP") { + this.options.httpMethod = "GET"; + } + + // gestion du cache + this.options.nocache = options.nocache || false; + + // ##################### + // attributs d'instances + // ##################### + + /** + * Format de réponse du service + */ + this.options.outputFormat = null; + /** + * Requête envoyée au service + */ + this.request = null; + /** + * Reponse du service + */ + this.response = null; +} + +/** + * @lends module:CommonService + */ +CommonService.prototype = { + + /* + * Constructeur (alias) + */ + constructor : CommonService, + + /** + * Appel du service Géoportail + */ + call : function () { + /* jshint validthis : true */ + this.logger.trace("CommonService::call ()"); + + var context = this; + /** fonction d'execution */ + function run () { + this.logger.trace("CommonService::run ()"); + this.buildRequest.call(context, onError, onBuildRequest); + } + + run.call(context); + + // callback de fin de construction de la requête + function onBuildRequest (result) { + this.logger.trace("CommonService::onBuildRequest : ", result); + this.callService.call(context, onError, onCallService); + } + + // callback de fin d'appel au service + function onCallService (result) { + this.logger.trace("CommonService::onCallService : ", result); + this.analyzeResponse.call(context, onError, onAnalyzeResponse); + } + + // callback de fin de lecture de la reponse + function onAnalyzeResponse (result) { + this.logger.trace("CommonService::onAnalyzeResponse : ", result); + if (result) { + this.options.onSuccess.call(this, result); + } else { + return onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"]("Analyse de la reponse en échec !?")); + } + } + + // callback de gestion des erreurs : renvoit un objet de type ErrorService + function onError (error) { + this.logger.trace("CommonService::onError()"); + // error : l'objet est du type ErrorService ou Error + var e = error; + if (!(e instanceof _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"])) { + e = new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"](error.message); + } + this.options.onFailure.call(this, e); + } + }, + + /** + * Création de la requête + * @param {Function} error - callback + * @param {Function} success - callback + */ + buildRequest : function (error, success) { + // INFO + this.logger.error("overwritten method !"); + // retourne l'objet 'this.request' + if (error) { + error.call(this, "This method must be overwritten !"); + } + success.call(this, "This method must be overwritten !"); + }, + + /** + * Appel du service + * @param {Function} error - callback + * @param {Function} success - callback + */ + callService : function (error, success) { + // INFO + // retourne l'objet 'this.response' + + // NOTES + // Pour le mode XHR, on recupère une reponse sous forme d'un json ou xml (#document). + // Pour le mode JSONP, on a toujours un objet JSON mais sous 2 formes : + // - natif + // - XML encapsulé : + // {http : {status:200, error:null},xml :'réponse du service'} + // {http : {status:400, error:'reponse du service'},xml :null} + // En XHR, la reponse est directement sauvegardée dans 'this.response'. + // Par contre, en JSONP, on doit analyser la reponse (status ou non vide), + // et ne renvoyer que le contenu (xml ou l'objet) + + // gestion de la proxification du service + var strUrlProxified = null; + var strData = this.request; + + // a t on mis en place un proxy ? + // la proxyfication est valable uniquement en mode XHR ! + var bUrlProxified = !!(this.options.proxyURL && this.options.protocol === "XHR"); + + // rajout de l'option gpbibaccess + // INFO : acces au numero de version de package.conf aprés compilation ! + if (this.CLASSNAME !== "Geocode" && this.CLASSNAME !== "ReverseGeocode" && this.CLASSNAME !== "AutoComplete") { + this.options.serverUrl = _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__["default"].normalyzeUrl(this.options.serverUrl, { + "gp-access-lib" : _package_json__WEBPACK_IMPORTED_MODULE_6__.version, + apiKey : this.options.apiKey || "calcul" + }, false); + } + + // si le proxy est renseigné, on proxifie l'url du service + if (bUrlProxified) { + if (this.options.httpMethod === "GET") { + strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__["default"].normalyzeUrl(this.options.serverUrl, this.request, true); + strData = null; + } + + if (this.options.httpMethod === "POST") { + strUrlProxified = this.options.proxyURL + _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__["default"].normalyzeUrl(this.options.serverUrl, null, true); + strData = this.request; + } + } + + // contexte du composant spécifique ! + var self = this; + + var options = { + url : strUrlProxified || this.options.serverUrl, + method : this.options.httpMethod, + protocol : this.options.protocol, + timeOut : this.options.timeOut || 0, + format : this.options.outputFormat, // ceci declenche le parsing de la reponse du service, mais on souhaite toujours une reponse brute (string) ! + nocache : this.options.nocache || false, // ceci permet d'ajouter un timestamp dans la requête + wrap : this.options.protocol !== "XHR", // ceci declenche l'encapsulation de la reponse XML du service dans du JSON, mais pas en mode XHR ! + callbackSuffix : this.options.callbackSuffix, + // callbackName : this.options.callbackName || null, + data : strData, + headers : null, // TODO... + content : this.options.contentType || "application/xml", + scope : this.options.scope || this, + // callback de reponse + onResponse : function (response) { + self.logger.trace("callService::onResponse()"); + + // le contenu de la reponse à renvoyer ! + var content = null; + + // XHR : on renvoie toujours la reponse brute du service (json ou xml) + // au parser du composant... + if (self.options.protocol === "XHR") { + self.logger.trace("Response XHR", response); + content = response; // par defaut, la reponse du service ! + } + + // JSONP : on pre-analyse la reponse brute du service (encapsuler ou pas) + // avant de l'envoyer au parser du composant... + if (self.options.protocol === "JSONP") { + self.logger.trace("Response JSON", response); + if (response) { + if (response.http) { + // reponse encapsulée : + // ex. reponse du service en xml + // > {http : {status:200, error:null},xml :'réponse du service'} + if (response.http.status !== 200) { + error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"]({ + status : response.http.status, + message : response.http.error, + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"].TYPE_SRVERR + })); + return; + } else { + content = response.xml; // par defaut ! + if (self.options.rawResponse) { + content = response; + } + } + } else { + // reponse non encapsulée : + // ex. reponse du service en json ou xml + content = response; + } + } else { + error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"]("Le contenu de la reponse est vide !?")); + return; + } + } + + // si on souhaite parser la reponse du service + if (typeof self.options.onBeforeParse === "function") { + var newResponse = self.options.onBeforeParse(content); + if (typeof newResponse === "string") { + // la reponse parsée par l'utilisateur est retournée sous + // forme de string ! + content = newResponse; + } + } + // sauvegarde de la reponse dans l'objet parent (CommonService) + self.response = content; + // on renvoie la reponse... + success.call(self, content); + }, + // callback des erreurs + onFailure : function (e) { + self.logger.trace("callService::onFailure()"); + // on est forcement sur une erreur levée par un service ! + e.type = _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"].TYPE_SRVERR; + error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"](e)); + }, + // callback de timeOut + onTimeOut : function () { + self.logger.trace("callService::onTimeOut()"); + error.call(self, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_4__["default"]("TimeOut!")); + } + }; + + _Protocols_Protocol__WEBPACK_IMPORTED_MODULE_3__["default"].send(options); + }, + + /** + * Analyse de la réponse + * @param {Function} error - callback + * @param {Function} success - callback + */ + analyzeResponse : function (error, success) { + // INFO + this.logger.error("overwritten method !"); + // retourne l'objet spécifique au type de composant (json) + if (error) { + error.call(this, "This method must be overwritten !"); + } + success.call(this, "This method must be overwritten !"); + } + +}; + +/* harmony default export */ __webpack_exports__["default"] = (CommonService); + + +/***/ }), +/* 42 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * Classe utilitaire + * + * @module Helper + * @alias Gp.Helper + */ +var Helper = { + + /** + * concatenation des parametres key/value dans les urls + * + * @method normalyzeParameters + * @static + * @param {Object} params - tableau de clef/valeur + * + * @example + * Gp.Utils.Helper.normalyzeParameters ({ + * key1:value1, + * key2:value2, + * key3:value3 + * }); + * // out : "key1=value1&key2=value2&key3=value3" + * + * @returns {String} retourne les paramètres concaténés + */ + normalyzeParameters : function (params) { + var myParams = null; + + if (params) { + var tabParams = []; + for (var key in params) { + if (params.hasOwnProperty(key)) { + var value = params[key]; + if (!value) { + value = ""; + } + tabParams.push(key + "=" + value); + } + } + + myParams = tabParams.join("&"); + } + + return myParams; + }, + + /** + * Concaténation et encodage des urls. + * + * @method normalyzeUrl + * @static + * @param {String} url - url + * @param {Object|String} params - tableau de clef/valeur ou string + * @param {Boolean} encode - true|false, false par defaut + * + * @example + * Gp.Utils.Helper.normalyzeUrl (url, { + * key1:value1, + * key2=:value2, + * key3:value3 + * }); + * // out : "url?key1=value1&key2=value2&key3=value3" + * + * @returns {String} retourne une url normalisée + */ + normalyzeUrl : function (url, params, encode) { + var myUrl = url; + + if (url) { + var k = url.indexOf("?"); + if (k === -1) { // pas de ? et KVP + myUrl += "?"; + } + + if (k !== -1 && k !== url.length - 1) { // KVP + myUrl += "&"; + } + } + + if (params) { + if (typeof params === "string") { + myUrl += params; + } else { + myUrl += this.normalyzeParameters(params); + } + } + + if (encode) { + // FIXME bonne idée ? + myUrl = encodeURIComponent(myUrl); + } + + return myUrl; + }, + + /** + * Indentation d'une chaine + * + * @method indent + * @static + * @param {Number} n - nombre de tabulation + * @param {String} msg - chaine + * + * @example + * Gp.Utils.Helper.indent (2, "message à indenter") + * // out + * // ........message à indenter + * + * @returns {String} retourne une chaine indentée + */ + indent : function (n, msg) { + var num = n || 0; + return new Array(num + 1).join("\t") + msg; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (Helper); + + +/***/ }), +/* 43 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42); +/* harmony import */ var _XHR__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44); +/* harmony import */ var _JSONP__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49); +/** + * Interface de dialogue avec les webservices + * + * @module Protocols + * @private + * @alias Gp.Protocols + */ + + + + +var Protocol = { + + /** + * Interface unique d"envoi d"une requête. + * + * @method send + * @static + * @param {Object} options - options generales + * @param {String} options.url - url du service + * @param {String} options.method - GET, POST, PUT, DELETE + * @param {String} options.protocol - XHR | JSONP + * @param {String} options.format - format de la reponse du service : json, xml ou null (brute)... + * @param {String} options.wrap - encapsuler la reponse du service dans du JSON : true|false (true par defaut sur le protocole JSONP) + * @param {String} options.callbackSuffix - suffixe de la fonction de callback (JSONP uniquement) (ex: si callbackSuffix="", la fonction s'appellera "callback") + * @param {String} options.timeOut - 0 ms + * @param {Boolean} options.nocache - true|false + * @param {Object|String} options.data - content (post) ou param (get) + * @param {Object|String} options.headers - (post) ex. referer + * @param {Object|String} options.content - (post) ex. "application/json" + * @param {String} options.scope - this (TODO) + * @param {Function} options.onResponse - callback + * @param {Function} options.onFailure - callback + * @param {Function} options.onTimeOut - callback + * @param {String} options.proxyUrl - (TODO) + */ + send : function (options) { + // INFO + // "output" - param est interne à la classe "Protocol" (parametrable via "wrap"), et à ajouter à l"url + // ce param est independant du service car il est géré par le filtre LUA : + // ex. json|xml (json par defaut). + // Ce param. permet d"encapsuler du XML dans du JSON : + // {http : {status:200, error:null},xml :"réponse du service"} + // Utile pour les services qui ne repondent que du XML (ex. Geocodage) + // + // |-------------------------------------------------| + // | \service | | | | + // | output\ format| json | xml | remarques | + // |--------\------|------|-----|--------------------| + // | json | json | json| json/xml encapsulé | + // | xml | json | xml | param inactif | + // |-------------------------------------------------| + // ex. le service demande une reponse native au "format" json et avec un "output" json. + // on a donc une reponse json encapsulé dans un json : ce qu'on ne souhaite pas ! + // dans ce cas on ne renseigne pas output=json + + // INFO + // "wrap" - choix d"encapsuler ou non les reponses dans du JSON. + // Par defaut, on encapsule uniquement les reponses sur le protocole JSONP (et qui sont en xml) ! + + // INFO + // "callback" - param est interne à la classe "Protocol" (non parametrable), et à ajouter à l"url + // ce param est independant du service car il est géré aussi par le filtre LUA : + // ex. callback|null + // Ce param. permet de renvoyer une reponse javascript : + // callback ({http : {status:200, error:null},xml :"réponse du service"}) + // Ce param. est non renseigné par defaut car pour du JSONP, on utilise le + // le protocol JSONP, et ce dernier implemente déjà le callback ! + + // settings par defaut + var settings = options || { + method : "GET", + // protocol : "JSONP", + protocol : "XHR", + timeOut : 0, + format : null, + wrap : true, + nocache : true, + output : "json", + callback : null, + callbackSuffix : null + }; + + // on determine l'environnement d'execution : browser ou non ? + // et on stoppe pour nodeJS... sur un protocole JSONP ! + if (typeof window === "undefined" && options.protocol === "JSONP") { + console.log("Value (s) for parameter (s) 'protocol=JSONP (instead use XHR)' not supported to NodeJS"); + return; + } + + if (options.protocol === "XHR" || options.format === "json") { + settings.wrap = false; + } else if (options.protocol === "JSONP" && options.format === "xml") { + settings.wrap = true; + } + + settings.callback = null; // FIXME non géré !? + settings.output = settings.wrap ? "json" : null; + + // on encapsule les reponses dans un objet JSON + if (settings.wrap) { + var params = {}; + params.output = settings.output; + params.callback = settings.callback; + delete params.callback; // FIXME non géré !? + settings.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__["default"].normalyzeUrl(options.url, params); + } + + // choix de l"implementation : + // XHR ou JSONP + switch (settings.protocol) { + case "XHR": + // on normalise l'url (gestion du cache) + if (options.method === "GET" && options.nocache) { + settings.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__["default"].normalyzeUrl(settings.url, { + t : new Date().getTime() + }); + } + // appel du service en XHR + _XHR__WEBPACK_IMPORTED_MODULE_1__["default"].call(settings); + break; + case "JSONP": + + // on normalise l'url si les params. sont renseignés dans la string|object "data" + if (settings.data) { + settings.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_0__["default"].normalyzeUrl(settings.url, settings.data); + } + + // appel du service en JSONP + _JSONP__WEBPACK_IMPORTED_MODULE_2__["default"].call(settings); + break; + default: + throw new Error("protocol not supported (XHR|JSONP) !"); + } + } + +}; + +/* harmony default export */ __webpack_exports__["default"] = (Protocol); + + +/***/ }), +/* 44 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42); +/* harmony import */ var es6_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45); +/* harmony import */ var es6_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(es6_promise__WEBPACK_IMPORTED_MODULE_2__); +/* global Promise, require, XDomainRequest */ + + + + +// import __request from "request"; +// import __xmldom from "xmldom"; + +/** + * Ajax Request (use of Promises) + * + * @module XHR + * @alias Gp.Protocols.XHR + * @see dependance 'es6-promise' + */ + +// cf. https://xhr.spec.whatwg.org/ +// cf. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest + +var XHR = { + + /** + * Interface unique d'envoi d'une requête. + * + * @method call + * @static + * @param {Object} settings - options generales + * @param {String} settings.url - url du service + * @param {String} settings.method - GET, POST, PUT, DELETE + * @param {String} settings.format - format de la reponse du service : json, xml ou null (brute) + * @param {String} settings.data - content (post) ou param (get) + * @param {String} settings.proxy - proxy url + * @param {Object|String} settings.headers - (post) ex. referer + * @param {Object|String} settings.content - (post) ex. 'application/json' + * @param {String} settings.timeOut - timeout = 0 par defaut + * @param {String} settings.scope - this + * @param {Function} settings.onResponse - callback + * @param {Function} settings.onFailure - callback + */ + call : function (settings) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("XHR"); + logger.trace("[XHR::call()]"); + + // FIXME + // To polyfill the global environment + es6_promise__WEBPACK_IMPORTED_MODULE_2___default.a.polyfill(); + + // test sur les settings obligatoires + if (!settings.url) { + throw new Error("missing parameter : url is not defined !"); + } + + if (!settings.method) { + throw new Error("missing parameter : method is not defined !"); + } + + if (!settings.format) { + settings.format = "text"; // reponse brute ! + } + + var options = {}; + options.url = settings.url; + options.data = settings.data ? settings.data : null; + options.method = settings.method; + options.timeOut = settings.timeOut || 0; + options.scope = settings.scope || this; + options.proxy = settings.proxy || null; + options.content = settings.content || null; + options.headers = settings.headers || { + referer : "http://localhost" + }; + + // test sur les valeurs de 'settings.method' + switch (settings.method) { + case "DELETE": + case "GET": + break; + case "PUT": + case "POST": + // on force sur ces params spécifiques au mode POST + options.content = settings.content ? settings.content : "application/x-www-form-urlencoded"; // FIXME en attente des services : bascule en "application/xml" ou "application/json" + options.headers = settings.headers ? settings.headers : { referer : "http://localhost" }; // FIXME parametrable... + break; + case "HEAD": + case "OPTIONS": + throw new Error("HTTP method not yet supported !"); + default: + throw new Error("HTTP method unknown !"); + } + + // test sur les valeurs de 'settings.format' + switch (settings.format) { + case "text": + this.__call(options) + .then(function (response) { + logger.trace(response); + settings.onResponse.call(this, response); + }) + .catch(function (error) { + settings.onFailure.call(this, error); + }); + break; + case "json": + this.__callJSON(options) + .then(function (response) { + logger.trace(response); + settings.onResponse.call(this, response); + }) + .catch(function (error) { + settings.onFailure.call(this, error); + }); + break; + case "xml": + this.__callXML(options) + .then(function (response) { + logger.trace(response); + settings.onResponse.call(this, response); + }) + .catch(function (error) { + settings.onFailure.call(this, error); + }); + break; + default: + throw new Error("This output Format is not yet supported !"); + } + }, + + /** + * Requete + * + * @method __call + * @private + * @param {Object} options - options + * @return {Object} promise + */ + __call : function (options) { + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("XHR"); + logger.trace("[XHR::__call()]"); + + var promise = new Promise( + function (resolve, reject) { + // traitement du corps de la requête + var corps = (options.method === "POST" || options.method === "PUT") ? 1 : 0; + + // seulement si options.data n'est pas vide (peut être un objet ou une chaine de caractères) + if (options.data && ((typeof options.data === "object" && Object.keys(options.data).length) || (typeof options.data === "string" && options.data.length)) && !corps) { + if (options.scope.CLASSNAME === "Geocode" || options.scope.CLASSNAME === "ReverseGeocode") { + options.url = options.url + options.data; + } else { + options.url = _Utils_Helper__WEBPACK_IMPORTED_MODULE_1__["default"].normalyzeUrl(options.url, options.data); + } + } + + logger.trace("URL = ", options.url); + + var hXHR = null; + + // test on env. nodejs or browser + if (typeof window === "undefined") { + var nodefetch = __webpack_require__(47); + + var opts = { + headers : { + Referer : "https://localhost" + } + }; + + if (options.data && typeof options.data === "string" && corps) { + opts = { + method : options.method, + body : options.data, + headers : { + "Content-Type" : options.content, + Referer : "https://localhost" + } + }; + } + + return nodefetch(options.url, opts) + .then(function (response) { + if (response.ok) { // res.status >= 200 && res.status < 300 + resolve(response.text()); + } else { + var message = "Errors Occured on Http Request (status : '" + response.statusText + "' | url : '" + response.url + "')"; + var status = response.status; + reject({ + message : message, + status : status + }); + } + }) + .catch(function (e) { + reject({ + message : e, + status : -1 + }); + }); + } else { + if (window.XMLHttpRequest) { + logger.trace("XMLHttpRequest"); + + hXHR = new XMLHttpRequest(); + hXHR.open(options.method, options.url, true); // async + hXHR.overrideMimeType = options.content; + + // gestion du timeout + var onTimeOutTrigger = null; + if (options.timeOut > 0) { + // FIXME le timeout interne ne me permet pas de declencher le bon message... + // hXHR.timeout = options.timeOut; + logger.trace("XHR - TimeOut actif !"); + /** + * Description + * + * @method onTimeOutTrigger + * @private + */ + onTimeOutTrigger = window.setTimeout( + function () { + var message = "TimeOut Occured on Http Request with XMLHttpRequest !"; + reject({ + message : message, + status : -1 + }); + }, options.timeOut); + } + + if (corps) { + // headers, data, content of data + // cf. https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader + logger.trace("data = ", options.data); + hXHR.setRequestHeader("Content-type", options.content); + // FIXME refused to set unsafe header content-length javascript + // hXHR.setRequestHeader ("Content-length", options.data.length); + // hXHR.setRequestHeader ("Referer", options.headers.referer); + } + + /** + * On Error + * FIXME ne se declenche pas !? + * + * @param {Object} e - Event + * @method onerror + * @private + */ + hXHR.onerror = function (e) { + console.log(e); + reject(new Error("Errors Occured on Http Request with XMLHttpRequest !")); + }; + + /** + * On Timeout + * FIXME ne se declenche pas !? + * + * @param {Object} e - Event + * @method ontimeout + * @private + */ + hXHR.ontimeout = function (e) { + console.log(e); + reject(new Error("TimeOut Occured on Http Request with XMLHttpRequest !")); + }; + + /** + * Description + * + * @method onreadystatechange + * @private + */ + hXHR.onreadystatechange = function (e) { + if (hXHR.readyState === 4) { // DONE + if (hXHR.status === 200) { + window.clearTimeout(onTimeOutTrigger); + resolve(hXHR.response); + } else { + var message = "Errors Occured on Http Request (status : '" + e.target.statusText + "' | url : '" + e.target.responseURL + "' | response : '" + e.target.response + "')"; + var status = e.target.status; + reject({ + message : message, + status : status + }); + } + } + }; + + // gestion du content data + var data4xhr = (options.data && corps) ? options.data : null; + + hXHR.send(data4xhr); + } else if (window.XDomainRequest) { + // worked in Internet Explorer 8–10 only ! + logger.trace("XDomainRequest"); + + hXHR = new XDomainRequest(); + hXHR.open(options.method, options.url); + + hXHR.overrideMimeType = options.content; + + if (options.timeOut > 0) { + hXHR.timeout = options.timeout; + logger.trace("XHR - TimeOut actif !"); + } + + if (corps) { + // headers, data, content of data + // cf. https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader + hXHR.setRequestHeader("Content-type", options.content); + // FIXME refused to set unsafe header content-length javascript + // hXHR.setRequestHeader ("Content-length", options.data.length); + // hXHR.setRequestHeader ("Referer", options.headers.referer); + } + + /** + * Description + * + * @method onerror + * @private + */ + hXHR.onerror = function () { + reject(new Error("Errors Occured on Http Request with XMLHttpRequest !")); + }; + + /** + * Description + * + * @method ontimeout + * @private + */ + hXHR.ontimeout = function () { + reject(new Error("TimeOut Occured on Http Request with XMLHttpRequest !")); + }; + + /** + * On Load + * + * @method onload + * @private + */ + hXHR.onload = function (e) { + if (hXHR.status === 200) { + resolve(hXHR.responseText); + } else { + var message = "Errors Occured on Http Request (status : '" + e.target.statusText + "' | url : '" + e.target.responseURL + "')"; + var status = e.target.status; + reject({ + message : message, + status : status + }); + } + }; + + var data4xdr = (options.data && corps) ? options.data : null; + + hXHR.send(data4xdr); + } else { + throw new Error("CORS not supported"); + } + } + } + ); + + return promise; + }, + + /** + * Requete avec parser JSON + * + * @method __callJSON + * @private + * @param {Object} options - options + * @return {Object} promise + */ + __callJSON : function (options) { + return this.__call(options) + .then(JSON.parse) + .catch(function (error) { + console.log("_callJSON failed on : ", options.url, error); + // FIXME pas d'exception, laissons le fil se derouler... + // throw error; + }); + }, + + /** + * Requete avec parser XML + * + * @method __callXML + * @private + * @param {Object} options - options + * @return {Object} promise + */ + __callXML : function (options) { + return this.__call(options) + .then(function (response) { + var xmlDoc; + + // test on env. nodejs or browser + if (typeof window === "undefined") { + var DOMParser = __webpack_require__(48).DOMParser; // __xmldom.DOMParser + xmlDoc = new DOMParser().parseFromString(response, "text/xml"); + } else { + if (window.DOMParser) { + var parser = new window.DOMParser(); + xmlDoc = parser.parseFromString(response, "text/xml"); + } else { // IE + xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async = false; + xmlDoc.loadXML(response); + } + } + + return xmlDoc; + }) + .catch(function (error) { + console.log("__callXML failed on : ", options.url, error); + // FIXME pas d'exception, laissons le fil se derouler... + // throw error; + }); + } + +}; + +/* harmony default export */ __webpack_exports__["default"] = (XHR); + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process, global) {/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */ + +(function (global, factory) { + true ? module.exports = factory() : + undefined; +}(this, (function () { 'use strict'; + +function objectOrFunction(x) { + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} + +function isFunction(x) { + return typeof x === 'function'; +} + + + +var _isArray = void 0; +if (Array.isArray) { + _isArray = Array.isArray; +} else { + _isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; +} + +var isArray = _isArray; + +var len = 0; +var vertxNext = void 0; +var customSchedulerFn = void 0; + +var asap = function asap(callback, arg) { + queue[len] = callback; + queue[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (customSchedulerFn) { + customSchedulerFn(flush); + } else { + scheduleFlush(); + } + } +}; + +function setScheduler(scheduleFn) { + customSchedulerFn = scheduleFn; +} + +function setAsap(asapFn) { + asap = asapFn; +} + +var browserWindow = typeof window !== 'undefined' ? window : undefined; +var browserGlobal = browserWindow || {}; +var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; +var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + +// test for web worker but not in IE10 +var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; + +// node +function useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function () { + return process.nextTick(flush); + }; +} + +// vertx +function useVertxTimer() { + if (typeof vertxNext !== 'undefined') { + return function () { + vertxNext(flush); + }; + } + + return useSetTimeout(); +} + +function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); + + return function () { + node.data = iterations = ++iterations % 2; + }; +} + +// web worker +function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + return channel.port2.postMessage(0); + }; +} + +function useSetTimeout() { + // Store setTimeout reference so es6-promise will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var globalSetTimeout = setTimeout; + return function () { + return globalSetTimeout(flush, 1); + }; +} + +var queue = new Array(1000); +function flush() { + for (var i = 0; i < len; i += 2) { + var callback = queue[i]; + var arg = queue[i + 1]; + + callback(arg); + + queue[i] = undefined; + queue[i + 1] = undefined; + } + + len = 0; +} + +function attemptVertx() { + try { + var vertx = Function('return this')().require('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch (e) { + return useSetTimeout(); + } +} + +var scheduleFlush = void 0; +// Decide what async method to use to triggering processing of queued callbacks: +if (isNode) { + scheduleFlush = useNextTick(); +} else if (BrowserMutationObserver) { + scheduleFlush = useMutationObserver(); +} else if (isWorker) { + scheduleFlush = useMessageChannel(); +} else if (browserWindow === undefined && "function" === 'function') { + scheduleFlush = attemptVertx(); +} else { + scheduleFlush = useSetTimeout(); +} + +function then(onFulfillment, onRejection) { + var parent = this; + + var child = new this.constructor(noop); + + if (child[PROMISE_ID] === undefined) { + makePromise(child); + } + + var _state = parent._state; + + + if (_state) { + var callback = arguments[_state - 1]; + asap(function () { + return invokeCallback(_state, child, callback, parent._result); + }); + } else { + subscribe(parent, child, onFulfillment, onRejection); + } + + return child; +} + +/** + `Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + let promise = new Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @param {Any} value value that the returned promise will be resolved with + Useful for tooling. + @return {Promise} a promise that will become fulfilled with the given + `value` +*/ +function resolve$1(object) { + /*jshint validthis:true */ + var Constructor = this; + + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } + + var promise = new Constructor(noop); + resolve(promise, object); + return promise; +} + +var PROMISE_ID = Math.random().toString(36).substring(2); + +function noop() {} + +var PENDING = void 0; +var FULFILLED = 1; +var REJECTED = 2; + +function selfFulfillment() { + return new TypeError("You cannot resolve a promise with itself"); +} + +function cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); +} + +function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { + try { + then$$1.call(value, fulfillmentHandler, rejectionHandler); + } catch (e) { + return e; + } +} + +function handleForeignThenable(promise, thenable, then$$1) { + asap(function (promise) { + var sealed = false; + var error = tryThen(then$$1, thenable, function (value) { + if (sealed) { + return; + } + sealed = true; + if (thenable !== value) { + resolve(promise, value); + } else { + fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed = true; + + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + reject(promise, error); + } + }, promise); +} + +function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function (value) { + return resolve(promise, value); + }, function (reason) { + return reject(promise, reason); + }); + } +} + +function handleMaybeThenable(promise, maybeThenable, then$$1) { + if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$1 === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$1)) { + handleForeignThenable(promise, maybeThenable, then$$1); + } else { + fulfill(promise, maybeThenable); + } + } +} + +function resolve(promise, value) { + if (promise === value) { + reject(promise, selfFulfillment()); + } else if (objectOrFunction(value)) { + var then$$1 = void 0; + try { + then$$1 = value.then; + } catch (error) { + reject(promise, error); + return; + } + handleMaybeThenable(promise, value, then$$1); + } else { + fulfill(promise, value); + } +} + +function publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + + publish(promise); +} + +function fulfill(promise, value) { + if (promise._state !== PENDING) { + return; + } + + promise._result = value; + promise._state = FULFILLED; + + if (promise._subscribers.length !== 0) { + asap(publish, promise); + } +} + +function reject(promise, reason) { + if (promise._state !== PENDING) { + return; + } + promise._state = REJECTED; + promise._result = reason; + + asap(publishRejection, promise); +} + +function subscribe(parent, child, onFulfillment, onRejection) { + var _subscribers = parent._subscribers; + var length = _subscribers.length; + + + parent._onerror = null; + + _subscribers[length] = child; + _subscribers[length + FULFILLED] = onFulfillment; + _subscribers[length + REJECTED] = onRejection; + + if (length === 0 && parent._state) { + asap(publish, parent); + } +} + +function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (subscribers.length === 0) { + return; + } + + var child = void 0, + callback = void 0, + detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + + promise._subscribers.length = 0; +} + +function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value = void 0, + error = void 0, + succeeded = true; + + if (hasCallback) { + try { + value = callback(detail); + } catch (e) { + succeeded = false; + error = e; + } + + if (promise === value) { + reject(promise, cannotReturnOwn()); + return; + } + } else { + value = detail; + } + + if (promise._state !== PENDING) { + // noop + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (succeeded === false) { + reject(promise, error); + } else if (settled === FULFILLED) { + fulfill(promise, value); + } else if (settled === REJECTED) { + reject(promise, value); + } +} + +function initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value) { + resolve(promise, value); + }, function rejectPromise(reason) { + reject(promise, reason); + }); + } catch (e) { + reject(promise, e); + } +} + +var id = 0; +function nextId() { + return id++; +} + +function makePromise(promise) { + promise[PROMISE_ID] = id++; + promise._state = undefined; + promise._result = undefined; + promise._subscribers = []; +} + +function validationError() { + return new Error('Array Methods must be provided an Array'); +} + +var Enumerator = function () { + function Enumerator(Constructor, input) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop); + + if (!this.promise[PROMISE_ID]) { + makePromise(this.promise); + } + + if (isArray(input)) { + this.length = input.length; + this._remaining = input.length; + + this._result = new Array(this.length); + + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(input); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } + } else { + reject(this.promise, validationError()); + } + } + + Enumerator.prototype._enumerate = function _enumerate(input) { + for (var i = 0; this._state === PENDING && i < input.length; i++) { + this._eachEntry(input[i], i); + } + }; + + Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { + var c = this._instanceConstructor; + var resolve$$1 = c.resolve; + + + if (resolve$$1 === resolve$1) { + var _then = void 0; + var error = void 0; + var didError = false; + try { + _then = entry.then; + } catch (e) { + didError = true; + error = e; + } + + if (_then === then && entry._state !== PENDING) { + this._settledAt(entry._state, i, entry._result); + } else if (typeof _then !== 'function') { + this._remaining--; + this._result[i] = entry; + } else if (c === Promise$1) { + var promise = new c(noop); + if (didError) { + reject(promise, error); + } else { + handleMaybeThenable(promise, entry, _then); + } + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function (resolve$$1) { + return resolve$$1(entry); + }), i); + } + } else { + this._willSettleAt(resolve$$1(entry), i); + } + }; + + Enumerator.prototype._settledAt = function _settledAt(state, i, value) { + var promise = this.promise; + + + if (promise._state === PENDING) { + this._remaining--; + + if (state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = value; + } + } + + if (this._remaining === 0) { + fulfill(promise, this._result); + } + }; + + Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { + var enumerator = this; + + subscribe(promise, undefined, function (value) { + return enumerator._settledAt(FULFILLED, i, value); + }, function (reason) { + return enumerator._settledAt(REJECTED, i, reason); + }); + }; + + return Enumerator; +}(); + +/** + `Promise.all` accepts an array of promises, and returns a new promise which + is fulfilled with an array of fulfillment values for the passed promises, or + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + let promise1 = resolve(1); + let promise2 = resolve(2); + let promise3 = resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + let promise1 = resolve(1); + let promise2 = reject(new Error("2")); + let promise3 = reject(new Error("3")); + let promises = [ promise1, promise2, promise3 ]; + + Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static +*/ +function all(entries) { + return new Enumerator(this, entries).promise; +} + +/** + `Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + let promise1 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + let promise1 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @param {Array} promises array of promises to observe + Useful for tooling. + @return {Promise} a promise which settles in the same way as the first passed + promise to settle. +*/ +function race(entries) { + /*jshint validthis:true */ + var Constructor = this; + + if (!isArray(entries)) { + return new Constructor(function (_, reject) { + return reject(new TypeError('You must pass an array to race.')); + }); + } else { + return new Constructor(function (resolve, reject) { + var length = entries.length; + for (var i = 0; i < length; i++) { + Constructor.resolve(entries[i]).then(resolve, reject); + } + }); + } +} + +/** + `Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + let promise = new Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @param {Any} reason value that the returned promise will be rejected with. + Useful for tooling. + @return {Promise} a promise rejected with the given `reason`. +*/ +function reject$1(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop); + reject(promise, reason); + return promise; +} + +function needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); +} + +function needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); +} + +/** + Promise objects represent the eventual result of an asynchronous operation. The + primary way of interacting with a promise is through its `then` method, which + registers callbacks to receive either a promise's eventual value or the reason + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + let promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + let xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {Function} resolver + Useful for tooling. + @constructor +*/ + +var Promise$1 = function () { + function Promise(resolver) { + this[PROMISE_ID] = nextId(); + this._result = this._state = undefined; + this._subscribers = []; + + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } + } + + /** + The primary way of interacting with a promise is through its `then` method, + which registers callbacks to receive either a promise's eventual value or the + reason why the promise cannot be fulfilled. + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + Chaining + -------- + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + Assimilation + ------------ + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + If the assimliated promise rejects, then the downstream promise will also reject. + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + Simple Example + -------------- + Synchronous Example + ```javascript + let result; + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + Errback Example + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + Promise Example; + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + Advanced Example + -------------- + Synchronous Example + ```javascript + let author, books; + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + Errback Example + ```js + function foundBooks(books) { + } + function failure(reason) { + } + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + Promise Example; + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} + */ + + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} + */ + + + Promise.prototype.catch = function _catch(onRejection) { + return this.then(null, onRejection); + }; + + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @return {Promise} + */ + + + Promise.prototype.finally = function _finally(callback) { + var promise = this; + var constructor = promise.constructor; + + if (isFunction(callback)) { + return promise.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + throw reason; + }); + }); + } + + return promise.then(callback, callback); + }; + + return Promise; +}(); + +Promise$1.prototype.then = then; +Promise$1.all = all; +Promise$1.race = race; +Promise$1.resolve = resolve$1; +Promise$1.reject = reject$1; +Promise$1._setScheduler = setScheduler; +Promise$1._setAsap = setAsap; +Promise$1._asap = asap; + +/*global self*/ +function polyfill() { + var local = void 0; + + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + + var P = local.Promise; + + if (P) { + var promiseToString = null; + try { + promiseToString = Object.prototype.toString.call(P.resolve()); + } catch (e) { + // silently ignored + } + + if (promiseToString === '[object Promise]' && !P.cast) { + return; + } + } + + local.Promise = Promise$1; +} + +// Strange compat.. +Promise$1.polyfill = polyfill; +Promise$1.Promise = Promise$1; + +return Promise$1; + +}))); + + + +//# sourceMappingURL=es6-promise.map + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(46), __webpack_require__(32))) + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__47__; + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__48__; + +/***/ }), +/* 49 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/** + * JSONP : Implémentation du protocole JSONP de la plateforme Géoportail + * + * @module JSONP + * @private + * @alias Gp.Protocols.JSONP + */ + + +// cf. https://github.com/sobstel/jsonp.js +var JSONP = { + + /** + * Construction d'un identifiant statique basé sur le timestamp, + * et qui s'incremente de +1 à chaque appel + */ + uuid : (function () { + var id = Math.floor(Date.now()); + return function () { + return id++; + }; + })(), + + /** + * Cette fonction réalise l'appel du service fourni via le paramètre "options.url" + * en mettant en œuvre le protocole JSONP. + * + * @method call + * @static + * @param {Object} options - parametres d'invocation du service en JSONP + * @param {String} options.url - URL du service à invoquer (indépendamment du protocole JSONP). + * Cette URL contient déjà les paramètres du service. + * Si le paramètre dédié à la mise en oeuvre du protocole JSONP (callback=xxx) n'est pas présent, il est rajouté par la fonction ; + * sa valeur est déterminée en fonction du paramètre callbackName. + * @param {Number} [options.timeOut = 0] - Nombre de ms au bout duquel on considère que le service n'a pas répondu. + * Une valeur de 0 pour ce paramètre permet de désactiver la gestion du timeOut. + * @param {String} [options.callbackSuffix = null] - Suffixe de la fonction de callback à rajouter sur l'URL. + * Si aucun suffixe n'est spécifié (cas par défaut), on utilisera l'identifiant this.uuid () comme suffixe. Ex: "callback1458574396582 ()" + * @param {String} [options.callbackName = gp.protocol.jsonp] - Valeur du paramètre callback à rajouter sur l'URL. + * Si l'URL fournie contient déjà le paramètre callback, le paramètre callbackName ne sera pas pris en compte. + * La fonction de callback est créée dynamiquement par la fonction JSONP ; + * elle a deux fonctions : + * elle annule la condition de timeOut + * puis appelle la fonction fournie par l'utilisateur via le paramètre onResponse. + * @param {Function} options.onResponse - Nom de la fonction qui sera appelée lors de la réception des résultats du service. + * Ce paramètre sera ignoré si l'URL contient déjà le paramètre callback. + * La fonction de rappel appelée sera alors celle ayant pour nom la valeur de ce paramètre. + * @param {Function} [options.onTimeOut] - Nom de la fonction qui sera appelée en cas de non réponse du service. + * Le temps au bout duquel on considère que le service n'a pas répondu est déterminé par le paramètre timeOut. + * @example + * var options = { + * url : 'http://localhost/some/test.json&callback=myResults', + * timeOut : 100, + * callbackName : 'myResults', + * callbackSuffix : "", + * onResponse : function (response) { + * console.log('results : ', response); + * }, + * + * }; + * JSONP.call(options); + */ + call : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("JSONP"); + logger.trace("[JSONP::call ()]"); + + // analyse parametres + + if (!options) { + logger.error("missing parameter : options !"); + throw new Error("missing parameter : options !"); + } + + if (!options.url) { + logger.error("missing parameter : options.url !"); + throw new Error("missing parameter : options.url !"); + } + + if (!options.timeOut) { + logger.info("setting 'options.timeOut' default value"); + options.timeOut = 0; + } + + // FIXME si un callback coté client a été mis en place, + // cette condition sur cette methode n'a pas de sens !? + if (!options.onResponse) { + logger.error("missing parameter : options.onResponse !"); + throw new Error("missing parameter : options.onResponse !"); + // FIXME doit on definir un callback interne par defaut !? + // options.onResponse = function (data) { + // console.log("response callback (inner) : ", data); + // }; + } + + // ID du callback à utiliser : null ou string. + // si l'utilisateur a spécifié un suffixe pour le callback, on le récupère comme un ID (ex: options.callbackSuffix = "") + // sinon, on utilise un timestamp : this.uuid () + var callbackId = (typeof options.callbackSuffix === "string") ? options.callbackSuffix : this.uuid(); + + // on recherche le parametre callback et son nom de fonction dans l'url + var urlHasCallbackKey = false; + var urlHasCallbackName = false; + + var idx = options.url.indexOf("callback="); + + if (idx !== -1) { + urlHasCallbackKey = true; + // extraction callbackName de l'url : entre "callback=" et "&" ou fin de ligne + var j = options.url.indexOf("&", idx); + if (j === -1) { + j = options.url.length; + } + + // on ecrase le parametre options.callbackName s'il avait été défini + var callbackName = options.url.substring(idx + 9, j); + + if (callbackName) { + urlHasCallbackName = true; + options.callbackName = callbackName; + logger.info("setting 'options.callbackName' value (" + options.callbackName + ") from 'options.url' parameter"); + } + } + + // on ajoute le parametre callback dans l'URL s'il n'existe pas + if (!urlHasCallbackKey) { + // gestion des autres param. et "?" + var k = options.url.indexOf("?"); + if (k === -1) { + // aucun param., ni de '?' + options.url = options.url + "?" + "callback="; + } else if (k === options.url.length) { + // uniquement le '?' + options.url = options.url + "callback="; + } else { + // le '?' et les param. existent + options.url = options.url + "&" + "callback="; + } + logger.info("setting callback default key in 'options.url' : " + options.url); + } + + // utilisation de la fonction callback coté client ? + var HasCallbackName = options.callbackName ? true : urlHasCallbackName; + + // on ajoute le nom de la fonction callback dans l'URL si elle n'existe pas + if (!urlHasCallbackName) { + // fonction callback par defaut + if (!options.callbackName) { + logger.info("setting 'options.callbackName' default value"); + options.callbackName = "callback"; // ou "gp.protocol.jsonp" ? + // info : si on ne veut pas gerer d'ID dans le callback, + // options.callbackSuffix = "" + if (callbackId || callbackId === "") { + options.callbackName += callbackId; + } + } + options.url = options.url.replace("callback=", "callback=" + options.callbackName); + logger.info("setting callback function name in 'options.url' : " + options.url); + } + + // timeOut par defaut + if (!options.onTimeOut) { + logger.info("setting 'options.onTimeOut' default value"); + /** callback timeout par defaut */ + options.onTimeOut = function (/* error */) { + console.log("TimeOut while invoking url : " + options.url); + }; + } + + if (!HasCallbackName) { + var self = this; + + // event du timeout + var onTimeOutTrigger = null; + + // declenche le timeout si > à 0 ! + if (options.timeOut > 0) { + onTimeOutTrigger = window.setTimeout( + function () { + /** fonction de reponse du service */ + window[options.callbackName] = function () {}; + options.onTimeOut(); + self._deleteScript(callbackId); + }, options.timeOut); + } + + // FIXME le nom de la fonction n'accepte pas de namespace ! + // ex. Gp.Function.callback + /** + * fonction de reponse du service + * @param {Object} data - data + * @private + */ + window[options.callbackName] = function (data) { + window.clearTimeout(onTimeOutTrigger); + options.onResponse(data); + self._deleteScript(callbackId); + }; + } + + this._createScript(callbackId, options.url); + }, + + /** + * create Script + * @param {String} callbackId - callback Id + * @param {String} url - url + * @private + */ + _createScript : function (callbackId, url) { + var scriptu; + var scripto = document.getElementById("results" + callbackId); + + scriptu = document.createElement("script"); + scriptu.setAttribute("type", "text/javascript"); + scriptu.setAttribute("src", url); + scriptu.setAttribute("charset", "UTF-8"); + scriptu.setAttribute("id", "results" + callbackId); + scriptu.setAttribute("async", "true"); // FIXME async ? + // head ou body ou autres ? + var node = document.documentElement || document.getElementsByTagName("head")[0]; + if (scripto === null) { + node.appendChild(scriptu); + } else { + // s'il existe déjà, on le remplace ! + node.replaceChild(scriptu, scripto); + } + }, + + /** + * delete Script + * @param {String} callbackId - callback Id + * @private + */ + _deleteScript : function (callbackId) { + var script = document.getElementById("results" + callbackId); + if (script) { + var node = script.parentNode || document.documentElement; + if (!node) { + return; + } + node.removeChild(script); + } + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (JSONP); + + +/***/ }), +/* 50 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * Errors raised by API for one among three reasons : wrong API usage, underlying service error or unknown reason. + * + * @property {String} message - Error message + * @property {Number} status - Error status : when {@link Gp.Error.TYPE_SRVERR}, gives the [HTTP status of the underlying web service response]{@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes} ; -1 otherwise. + * @property {String} type - Error type ({@link Gp.Error.TYPE_SRVERR}, {@link Gp.Error.TYPE_USEERR} or {@link Gp.Error.TYPE_UNKERR}). + * + * @namespace + * @alias Gp.Error + * @param {Object|String} error - Options for creating error object. Can be a String (message) or an Object. + * @param {String} error.message - Error message to return to user. + * @param {enum} [error.type=TYPE_UNKERR] - Error type + * @param {status} [error.status=-1] - Error status : when {@link Gp.Error.TYPE_SRVERR}, gives the [HTTP status of the underlying web service response]{@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}. + * + */ +function ErrorService (error) { + if (!(this instanceof ErrorService)) { + throw new TypeError("ErrorService constructor cannot be called as a function."); + } + + var e = error; + if (typeof error === "string" || error instanceof String) { + this.message = error; + this.status = -1; + this.type = ErrorService.TYPE_UNKERR; + } else { + this.message = e.message || "undefined!?"; + this.type = e.type; + this.status = e.status || -1; + } + + this.name = "ErrorService"; + this.stack = (new Error()).stack; +} + +/** + * Error raised when underlying geoportal service answers on error. + * + * @type {String} + * @constant + * @static + */ +ErrorService.TYPE_SRVERR = "SERVICE_ERROR"; +/** + * Error raised when funcion use is inappropriate + * + * @type {String} + * @constant + * @static + */ +ErrorService.TYPE_USEERR = "USAGE_ERROR"; +/** + * Error raised when API can't perform the job for a reason other than the two other ones. + * + * @type {String} + * @constant + * @static + */ +ErrorService.TYPE_UNKERR = "UNKNOWN_ERROR"; + +/** + * @lends module:ErrorService + */ +ErrorService.prototype = Object.create(Error.prototype, { + constructor : { + value : ErrorService, + writable : true, + configurable : true + } +}); + +/* harmony default export */ __webpack_exports__["default"] = (ErrorService); + + +/***/ }), +/* 51 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// cette classe contient les URLs par defaut des services. +// DefaultUrlService.Alti.url(key)[elevation-json] +// DefaultUrlService.Alti.url(key)[elevation-xml] +// DefaultUrlService.Alti.url(key)[profil-json] +// DefaultUrlService.Alti.url(key)[profil-xml] +// DefaultUrlService.ProcessIsoCurve.url(key) +// DefaultUrlService.AutoComplete.url(key) +// DefaultUrlService.ReverseGeocode.url(key) +// DefaultUrlService.Geocode.url(key) +// DefaultUrlService.Route.url(key) + +// Example : +// +// DefaultUrlService.Alti.url('alti')[elevation-json] +// output {String} -> http://wxs.ign.fr/calcul/alti/rest/elevation.json +// +// DefaultUrlService.Alti.url('calcul') +// output {Object|String} +// -> http://wxs.ign.fr/calcul/alti/rest/elevation.json +// -> http://wxs.ign.fr/calcul/alti/rest/elevation.xml +// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.json +// -> http://wxs.ign.fr/calcul/alti/rest/elevationLine.xml +// +// ssl by default. +// +// Force to not do ssl : +// DefaultUrlService.ssl = false; +// +// DefaultUrlService.AutoComplete.url('calcul') +// output {Object|String} +// -> https://wxs.ign.fr/calcul/ols/apis/completion + +// constantes internes +var HOSTNAME = "wxs.ign.fr"; + +/** + * Default Geoportal web services URLs access. + * + * @namespace + * @alias Gp.Services.DefaultUrl + */ +var DefaultUrlService = { + + /** if set true, require the use of https protocol */ + ssl : true, + + /** + * base url of services (ssl protocol management) + * @param {String} path - path + * @returns {String} url + */ + url : function (path) { + // comportement par défaut => https + // sinon, il est fixé par l'option 'ssl' (false => http) + var _protocol; + if (DefaultUrlService.ssl === false) { + _protocol = "http://"; + } else { + _protocol = "https://"; + } + + return _protocol + HOSTNAME + path; + }, + + /** + * base new-url of services (ssl protocol management) + * @param {String} path - path + * @returns {String} url + */ + newUrl : function (path, hostname) { + // comportement par défaut => https + // sinon, il est fixé par l'option 'ssl' (false => http) + var _protocol; + if (DefaultUrlService.ssl === false) { + _protocol = "http://"; + } else { + _protocol = "https://"; + } + + return _protocol + hostname + path; + }, + + /** + * Elevation web service access + * + * @member {Object} + * @property {Function} url (key) - Returns elevation service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols ("elevation-json", "elevation-xml", "profil-json" or "profil-xml"). + */ + Alti : { + new_key : { + // rest + "elevation-json" : "/altimetrie/1.0/calcul/alti/rest/elevation.json", + "elevation-xml" : "/altimetrie/1.0/calcul/alti/rest/elevation.xml", + "profil-json" : "/altimetrie/1.0/calcul/alti/rest/elevationLine.json", + "profil-xml" : "/altimetrie/1.0/calcul/alti/rest/elevationLine.xml" + }, + _key : { + // rest + "elevation-json" : "/calcul/alti/rest/elevation.json", + "elevation-xml" : "/calcul/alti/rest/elevation.xml", + "profil-json" : "/calcul/alti/rest/elevationLine.json", + "profil-xml" : "/calcul/alti/rest/elevationLine.xml", + // other + wps : "/alti/wps" + }, + /** + * newurl from geoplateforme service + * @param {String} key - key + * @returns {String} url + */ + newUrl : function () { + return; + }, + /** + * url from wxs service + * @returns {String} url + */ + url : function () { + return { + // rest + "elevation-json" : DefaultUrlService.url(this._key["elevation-json"]), + "elevation-xml" : DefaultUrlService.url(this._key["elevation-xml"]), + "profil-json" : DefaultUrlService.url(this._key["profil-json"]), + "profil-xml" : DefaultUrlService.url(this._key["profil-xml"]) + }; + } + }, + /** + * IsoCurve web service access + * + * @member {Object} + * @property {Function} url (key) - Returns isocurve service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols ("iso-json" or "iso-xml"). + */ + ProcessIsoCurve : { + + new_key : "/itineraire/isochrone", + + _key : "/calcul/geoportail/isochrone/rest/1.0.0/isochrone", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + + /** + * url from wxs service + * @returns {String} url + */ + url : function () { + return DefaultUrlService.url(this._key); + } + }, + /** + * Config web service access + * + * @member {Object} + * @property {Function} url (key) - Returns config service default urls with or without geoportal access key given as a parameter. + */ + Config : { + _key : "https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/dist/", + /** + * url + * @param {String} key - key + * @returns {String} url + */ + url : function (key) { + // key must be an array of one or several keys + if (!Array.isArray(key)) { + key = key.split(","); + } + // not homogeneous with others geoportal services URLs + var url = []; + for (var i = 0; i < key.length; i++) { + url[i] = this._key + key[i] + "Config.json"; + } + return url; + } + }, + /** + * Autocompletion web service access + * + * @member {Object} + * @property {Function} url (key) - Returns autocomplete service default urls with or without geoportal access key given as a parameter. The result is a String. + */ + AutoComplete : { + new_key : "/completion", + + _key : "/calcul/geoportail/geocodage/rest/0.1/completion", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + + /** + * url + * @returns {String} url + */ + url : function (key) { + return DefaultUrlService.url(this._key); + } + }, + /** + * Reverse geocoding web service access + * + * @member {Object} + * @property {Function} url (key) - Returns reverse geocoding service default urls with or without geoportal access key given as a parameter. The result is a String. + */ + ReverseGeocode : { + new_key : "/reverse", + + _key : "/calcul/geoportail/geocodage/rest/0.1/reverse", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + + /** + * url + * @returns {String} url + */ + url : function () { + return DefaultUrlService.url(this._key); + } + }, + /** + * Geocoding web service access + * + * @member {Object} + * @property {Function} url (key) - Returns geocoding service default urls with or without geoportal access key given as a parameter. The result is a String. + */ + Geocode : { + new_key : "/search", + + _key : "/calcul/geoportail/geocodage/rest/0.1/search", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + + /** + * url + * @returns {String} url + */ + url : function () { + return DefaultUrlService.url(this._key); + } + }, + /** + * Routing web service access + * + * @member {Object} + * @property {Function} url (key) - Returns routing service default urls with or without geoportal access key given as a parameter. The result is a javascript object with different urls given used protocols. + */ + Route : { + new_key : "/itineraire/route", + + _key : "/calcul/geoportail/itineraire/rest/1.0.0/route", + + /** + * url from geoplateforme service + * @returns {String} url + */ + newUrl : function () { + return; + }, + + /** + * url from wxs service + * @returns {String} url + */ + url : function () { + return DefaultUrlService.url(this._key); + } + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (DefaultUrlService); + + +/***/ }), +/* 52 */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"_from\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"_id\":\"geoportal-access-lib@3.4.0-beta\",\"_inBundle\":false,\"_integrity\":\"sha512-gphFcmz76I5nDU8c5HS1X/afidc1hZMNKVESfzr212WyMpVCNbQhImVlLJakAlffXMCkNb40bVZnehKlKvD+9w==\",\"_location\":\"/geoportal-access-lib\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"remote\",\"raw\":\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"name\":\"geoportal-access-lib\",\"escapedName\":\"geoportal-access-lib\",\"rawSpec\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"saveSpec\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"fetchSpec\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\"},\"_requiredBy\":[\"/\"],\"_resolved\":\"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"_shasum\":\"4972f1314445354d85baad4d3b0e59f0be27ab82\",\"_spec\":\"geoportal-access-lib@https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz\",\"_where\":\"/home/runner/work/geoportal-extensions/geoportal-extensions\",\"author\":{\"name\":\"IGNF\"},\"bugs\":{\"url\":\"https://github.com/IGNF/geoportal-access-lib/issues\"},\"bundleDependencies\":[],\"date\":\"21/09/2023\",\"dependencies\":{\"es6-promise\":\"^4.2.4\",\"node-fetch\":\"^2.6.1\",\"xmldom\":\"^0.1.27\"},\"deprecated\":false,\"description\":\"French Geoportal resources access library\",\"devDependencies\":{\"@babel/core\":\"^7.12.10\",\"@babel/plugin-transform-template-literals\":\"^7.12.1\",\"@babel/preset-env\":\"^7.12.11\",\"babel-loader\":\"^8.2.2\",\"chai\":\"^4.1.2\",\"clean-webpack-plugin\":\"^3.0.0\",\"copy-webpack-plugin\":\"^5.1.2\",\"eslint\":\"^7.18.0\",\"eslint-config-standard\":\"^16.0.2\",\"eslint-loader\":\"^4.0.2\",\"eslint-plugin-import\":\"^2.22.1\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.2.1\",\"eslint-plugin-standard\":\"^5.0.0\",\"glob\":\"^7.1.2\",\"handlebars-layouts\":\"^3.1.4\",\"handlebars-webpack-plugin\":\"^1.4.1\",\"html-webpack-plugin\":\"^4.5.1\",\"istanbul-instrumenter-loader\":\"^3.0.1\",\"jsdoc-webpack-plugin\":\"^0.3.0\",\"loglevel\":\"^1.6.1\",\"mocha\":\"^7.2.0\",\"mocha-loader\":\"^5.1.5\",\"mocha-webpack\":\"^2.0.0-beta.0\",\"mochawesome\":\"^6.2.1\",\"nyc\":\"^15.1.0\",\"path\":\"^0.12.7\",\"replace-bundle-webpack-plugin\":\"^1.0.0\",\"sinon\":\"^9.2.4\",\"sinon-es6\":\"0.0.3\",\"speed-measure-webpack-plugin\":\"^1.4.2\",\"string-template\":\"^1.0.0\",\"terser-webpack-plugin\":\"^2.3.8\",\"webpack\":\"^4.46.0\",\"webpack-cli\":\"^3.3.12\",\"webpack-dev-server\":\"^3.11.2\",\"webpack-node-externals\":\"^2.5.2\",\"webpack-shell-plugin\":\"^0.5.0\"},\"homepage\":\"https://github.com/IGNF/geoportal-access-lib#readme\",\"keywords\":[\"geoportail\",\"webservice\",\"javascript\",\"es6\"],\"license\":\"CECILL-B\",\"main\":\"dist/GpServices-src.js\",\"module\":\"src/Gp.js\",\"name\":\"geoportal-access-lib\",\"nyc\":{\"include\":[\"src/**/*.js\"],\"instrument\":false,\"sourceMap\":false},\"optionalDependencies\":{},\"peerDependencies\":{},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/IGNF/geoportal-access-lib.git\"},\"scripts\":{\"build\":\"webpack --mode=none\",\"build:dev\":\"webpack --mode=development\",\"build:prod\":\"webpack --mode=production\",\"clean\":\"echo \\\"Warning: no yet implemented!\\\" && exit 0\",\"cover\":\"nyc --reporter=lcov --reporter=text npm run test\",\"doc\":\"npm run doc:serve\",\"doc:serve\":\"webpack-dev-server --content-base jsdoc --port 9001 --open\",\"eslint\":\"eslint src/\",\"sample\":\"npm run sample:serve\",\"sample:serve\":\"webpack-dev-server --mode=none --open-page samples/index-src.html --https --content-base . --output-public-path '/dist/' --port 9001 --open\",\"sample:serve:dev\":\"webpack-dev-server --mode=development --open-page samples/index-map.html --content-base . --output-public-path '/dist/' --port 9001 --open\",\"sample:serve:prod\":\"webpack-dev-server --mode=production --open-page samples/index-prod.html --content-base . --output-public-path '/dist/' --port 9001 --open\",\"setup\":\"npm install\",\"test\":\"mocha-webpack --reporter mochawesome --reporter-options reportDir=test-report,reportFilename=index --webpack-config ./test/webpack/webpack.test.js --glob \\\"test_*.js\\\" test/spec/\",\"test:end-to-end:serve\":\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.js\",\"test:end-to-end:serve:docker\":\"webpack-dev-server --hot --config ./test/webpack/webpack.end-to-end.serve.docker.js\",\"test:serve\":\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.js\",\"test:serve:docker\":\"webpack-dev-server --hot --config ./test/webpack/webpack.test.serve.docker.js\"},\"version\":\"3.4.0-beta\"}"); + +/***/ }), +/* 53 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Response object for {@link module:Services~getConfig Gp.Services.getConfig ()} invocation when successful. Received as the argument of onSuccess callback function. + * + * @property {Object} generalOptions - General properties for default map configuration resources. + * @property {Object} generalOptions.apiKeys - Object that associates apiKey (s) with an array of resources IDs availables with that key. + * @property {String} generalOptions.title - Underlying web service Title. + * @property {String} generalOptions.defaultGMLGFIStyle - XSL URL used by default to translate an XML GetFeatureInfo response into an HTML array. + * @property {String} generalOptions.theme - default theme (FIXME : for what ?) + * @property {Array.} generalOptions.wgs84Resolutions - geographical resolutions Array for each [zoom level of the Geoportal platform]{@link http://api.ign.fr/tech-docs-js/webmaster/layers.html#Geoportal_resolutions} from 0 to 21. Expressed in degrees/pixel. + * @property {Object} layers - Associative array mapping resources availables IDs (keys) with their properties (values given as {@link Gp.Services.Config.Layer}). + * @property {Object} tileMatrixSets - Associative Array mapping TileMatrixSets IDs (keys) availables with their properties (values given as {@link Gp.Services.Config.TileMatrixSet}). + * + * @namespace + * @alias Gp.Services.GetConfigInterface + */ +function ConfigInterface () { + if (!(this instanceof ConfigInterface)) { + throw new TypeError("ConfigInterface constructor cannot be called as a function."); + } + + this.generalOptions = { + apiKeys : {}, + title : null, + defaultGMLGFIStyle : null, + theme : null, + wgs84Resolutions : [] + }; + + this.layers = {}; + + this.tileMatrixSets = {}; +} + +ConfigInterface.prototype = { + + /* + * Constructor (alias) + */ + constructor : ConfigInterface, + + /** + * Check if config is loaded for a given key + * + * @param {String} apiKey - Access key to Geoportal platform + * @returns {Boolean} isKeyConfLoaded - true if config of the key is already loaded, false otherwise + */ + isKeyConfLoaded : function (apiKey) { + if (!apiKey) { + return; + } + if (this.generalOptions.apiKeys[apiKey]) { + return true; + } + return false; + }, + + /** + * Returns an array of Geoportal layers identifiers, corresponding to an API contract key. + * + * @param {String} apiKey - Access key to Geoportal platform + * @returns {Array} apiKeys - Array of geoportal layers identifiers + */ + getLayersId : function (apiKey) { + return this.generalOptions.apiKeys[apiKey]; + }, + + /** + * Returns the id of a Geoportal layer with its name and its service. + * + * @param {String} layerName - name of the layer (ex. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {String} service - name of the service (ex. "WMS" ou "WMTS") + * @returns {String} Id of the layer (ex. "ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS") + */ + getLayerId : function (layerName, service) { + if (!layerName || !service) { + return; + } + var layerId = null; + + // layer + // key : [layerName]$[contexte]:OGC:[service] + // ex : "ORTHOIMAGERY.ORTHOPHOTOS$GEOPORTAIL:OGC:WMTS" + + // service + // key : [layerName]$[contexte];[service] + // ex : PositionOfInterest$OGC:OPENLS;ReverseGeocode + + if (this.layers) { + var layers = this.layers; + for (var key in layers) { + if (layers.hasOwnProperty(key)) { + var parts = key.split("$"); + if (layerName === parts[0]) { + if (parts[1]) { + var servicePartsLayer = parts[1].split(":"); + var servicePartsService = parts[1].split(";"); + + if (servicePartsService[1] === service.toUpperCase()) { + layerId = key; + break; + } + if (servicePartsLayer[2] === service.toUpperCase()) { + layerId = key; + break; + } + } + } + } + } + } + if (!layerId) { + return; + } + return layerId; + }, + + /** + * Returns an associative array of Geoportal layers configurations, corresponding to an API contract key. + * If no key is specified, all layers from configuration are returned. + * + * @param {String} apiKey - Access key to Geoportal platform + * @returns {Object} layers - Object which properties are layers identifiers. + */ + getLayersConf : function (apiKey) { + var layers = {}; + var layersIdArray = this.getLayersId(apiKey); + if (layersIdArray) { + for (var i = 0; i < layersIdArray.length; i++) { + var lyrId = layersIdArray[i]; + layers[lyrId] = this.layers[lyrId]; + } + } + return layers; + }, + + /** + * Returns a geoportal layer configuration, given its identifier + * + * @param {String} layerId - Geoportal layer identifier (e.g. "GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS") + * @return {Object} layer - Layer configuration + */ + getLayerConf : function (layerId) { + if (!this.layers) { + return; + } + return this.layers[layerId]; + }, + + /** + * Get all parameters needed to display a WMS or WMTS layer given its name, its service and its key + * + * @param {String} layerName - name of the layer (ex. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {String} service - name of the service (ex. "WMS" ou "WMTS") + * @param {String} [apiKey] - Contract API key + * @returns {Object} params - params of the service (WMS or WMTS) for the given layer + * @returns {String} params.url - Url of the service to reach to display the layer + * @returns {String} params.version - Version of the service + * @returns {String} params.styles - Default style of the layer + * @returns {String} params.format - Default format of the layer + * @returns {String} params.projection - Default projection of the layer + * @returns {Number} params.minScale - Min scale denominator of the layer + * @returns {Number} params.maxScale - Max scale denominator of the layer + * @returns {Gp.BBox} params.extent - Extent of the layer, in the projection of the layer + * @returns {Array} params.legends - Array of legends associated to the layer + * @returns {Array} params.title - Name of the layer, readable by a human + * @returns {Array} params.description - Description of the layer + * @returns {String} params.[TMSLink] - Id of the Tile Matrix Set (TMS), in the case of WMTS layer + * @returns {Gp.Point} params.[matrixOrigin] - Originof the tile matrix (top left corner), in the case of WMTS layer + * @returns {Array} params.[nativeResolutions] - Array with the resolution of each level of the tile matrix set, in the case of WMTS layer + * @returns {Array} params.[matrixIds] - Array with the ID of each level of the tile matrix set, in the case of WMTS layer + */ + getLayerParams : function (layerName, service) { + var params = {}; + + if ((service === "WMS" || Object.keys(this.tileMatrixSets).length !== 0) && Object.keys(this.layers).length !== 0) { + // get the layerId of the layer + var layerId = this.getLayerId(layerName, service); + + if (layerId) { + // get the layer Conf Object + var layerConf = this.getLayerConf(layerId); + + var keys = this.getLayerKey(layerId); + if (keys.length === 0) { + return; + } + + // get services params + for (var i = 0; i < keys.length; i++) { + // only one serverUrl is saved in Gp.Config : with multiKeys, we have to retrieve the key used in the serverUrl property + if (layerConf.serviceParams.serverUrl[keys[i]]) { + params.url = layerConf.serviceParams.serverUrl[keys[i]]; + } + } + + const wmsTypeRegex = /\/v\//; + // WMS vector style always empty (not in getCap) + if (wmsTypeRegex.test(params.url)) { + params.styles = " "; + } else { + // WMS raster style is defined in getCap + params.styles = layerConf.styles[0].name; + } + + params.version = layerConf.serviceParams.version; + params.format = layerConf.formats[0].name; + params.projection = layerConf.defaultProjection; + + // get layer info and constraints + params.minScale = layerConf.globalConstraint.minScaleDenominator; + params.maxScale = layerConf.globalConstraint.maxScaleDenominator; + params.extent = layerConf.globalConstraint.bbox; + params.legends = layerConf.legends; + params.title = layerConf.title; + params.description = layerConf.description; + + if (service === "WMS") { + params.metadata = layerConf.metadata; + } + + // Informations non disponibles avec les getCap + // params.metadata = layerConf.getMetadata(); + // params.originators = layerConf.getOriginators(); + // params.quicklookUrl = layerConf.getQuicklookUrl(); + + // WMTS : get the tileMatrixSetLimits + if (layerConf.wmtsOptions) { + params.tileMatrixSetLimits = layerConf.wmtsOptions.tileMatrixSetLimits; + var TMSLink = layerConf.wmtsOptions.tileMatrixSetLink; + if (TMSLink) { + params.TMSLink = TMSLink; + var tmsConf = this.getTMSConf(TMSLink); + // Get matrix origin : Gp.Point = Object{x:Float, y:Float} + // params.matrixOrigin = tmsConf.getTopLeftCorner(); + params.matrixIds = Object.keys(tmsConf.tileMatrices); + params.tileMatrices = tmsConf.tileMatrices; + // by default, pseudo mercator resolutions + params.nativeResolutions = tmsConf.nativeResolutions || this.getTMSConf("PM").nativeResolutions; + } + } + } + } + return params; + }, + + /** + * Get the contract key(s) associated to a given layer. + * + * @param {String} layerId - Geoportal layer identifier (e.g. "GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS") + * @return {Array} layerKey - array of key(s) associated to the given layer + */ + getLayerKey : function (layerId) { + var layerKey = []; + if (this.generalOptions && this.generalOptions.apiKeys && Object.keys(this.generalOptions.apiKeys).length !== 0) { + var resourcesByKey = this.generalOptions.apiKeys; + for (var key in resourcesByKey) { + var resourcesArray = resourcesByKey[key]; + resourcesArray.forEach(function (arrayLayerId) { + if (arrayLayerId === layerId) { + layerKey.push(key); + } + }); + } + } + return layerKey; + }, + + /** + * Returns an associative array of Tile Matrix Sets configurations. + * + * @return {Object} tileMatrixSets - Object which properties are TMS identifiers + * + */ + getTileMatrixSets : function () { + return this.tileMatrixSets; + }, + + /** + * Returns a Tile Matrix Sets configuration, given its identifier. + * + * @param {String} tmsID - Tile Matrix Set identifier (e.g. : "PM") + * @return {Object} tileMatrixSet - Tile Matrix Set configuration + */ + getTMSConf : function (tmsID) { + if (!this.tileMatrixSets) { + return; + } + return this.tileMatrixSets[tmsID]; + }, + + /** + * Get global constraints for a given Layer : extent, minScale, maxScale, projection + * + * @param {String} layerId - Geoportal layer identifier (e.g. "GEOGRAPHICALGRIDSYSTEMS.MAPS$GEOPORTAIL:OGC:WMTS") + * @returns {Object} params - layer constraints + * @returns {String} params.projection - default layer projection + * @returns {Number} params.minScale - layer min scale denominator + * @returns {Number} params.maxScale - layer max scale denominator + * @returns {Gp.BBox} params.extent - layer extent expressed in the layer projection + */ + getGlobalConstraints : function (layerId) { + var params = {}; + + if (layerId) { + // get layer configuration object + var layerConf = this.getLayerConf(layerId); + params.projection = layerConf.defaultProjection; + params.minScale = layerConf.globalConstraint.minScaleDenominator; + params.maxScale = layerConf.globalConstraint.maxScaleDenominator; + params.extent = layerConf.globalConstraint.bbox; + } + + return params; + } + +}; + +/* harmony default export */ __webpack_exports__["default"] = (ConfigInterface); + + +/***/ }), +/* 54 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); +/* harmony import */ var _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(55); +/* harmony import */ var _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62); + + + + + + + + + +/** + * @classdesc + * + * Appel du service d'altimétrie du Géoportail + * + * @todo gestion du parma. output et callback + * @todo outputFormat (REST) et format (WPS) + * @todo La reponse JSON peut encapsuler un XML ! + * + * @constructor + * @extends {Gp.Services.CommonService} + * @alias Gp.Services.Alti + * @param {Object} options - options spécifiques au service (+ les options heritées) + * + * @param {Array.} options.positions - Tableau ({lon:float,lat:float}) contenant les coordonnées des points (CRS:84) + * dont on veut connaître les altitudes (ou à partir desquelles on va calculer le profil). + * Chaque élément du tableau est un objet JavaScript avec deux attributs : lon et lat, qui sont des flottants. + * Minimum 2 éléments si on souhaite calculer un profil altimétrique (ElevationLine). + * Maximum 50 éléments. + * + * @param {String} options.outputFormat - Le format de la réponse du service alti : 'xml' ou 'json'. + * Ce paramètre déterminera l'extension '.xml' ou '.json' du service dans le cas de l'API REST, + * ou la valeur du paramètre 'format' dans le cas de la norme WPS. + * Nécessaire si serverUrl est renseigné, et qu'on souhaite passer par l'API REST, + * pour connaître le format dans lequel sera fournie la réponse (pour son traitement). + * Non nécessaire pour la norme WPS. Par défaut, ce paramètre vaut 'json'. + * + * @param {Number} [options.sampling] - Nombre de points à utiliser pour déterminer le tracé d'un profil altimétrique, compris entre 2 et 5000. + * A spécifier lorsqu'on souhaite accéder à cette fonctionnalité. + * Dans ce cas, les points fournis en entrée (au minimum de deux) servent à déterminer l'axe planimétrique + * le long duquel le profil doit être calculé. + * Si le paramètre sampling n'est pas spécifié ou moins de deux points sont fournis, + * c'est le service Elevation qui sera interrogé (altitudes simples calculées pour les points fournis). + * Une valeur de sampling strictement inférieure à 2 déclenchera un échantillonnage avec la valeur par défaut du service (3 points). + * + * @param {String} [options.api] - Manière d'accéder au service : 'REST' (via l'API REST) ou 'WPS' (via la norme WPS). + * Par défaut, on utilise l'API REST. + * + * @param {Boolean} [options.zonly] - Permet de ne récupérer que les altitudes en sortie s'il vaut 'true'. + * Vaut 'false' par défaut. + * + * @param {String} [options.resource] - Resource utilisée pour réaliser le calcul. + * + * @example + * var options = { + * apiKey : null, + * serverUrl : 'http://localhost/service/', + * protocol : 'JSONP', // JSONP|XHR + * proxyURL : null, + * httpMethod : 'GET', // GET|POST + * timeOut : 10000, // ms + * rawResponse : false, // true|false + * scope : null, // this + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * // spécifique au service + * positions : [{lon:, lat:}, {lon:, lat:}], + * outputFormat : 'json' // json|xml + * sampling : 3, + * api : 'REST', // REST|WPS + * zonly : false // false|true, + * resource : "resource-par-defaut" + * }; + * + */ +function Alti (options) { + if (!(this instanceof Alti)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("CLASS_CONSTRUCTOR", "Alti")); + } + + /** + * Nom de la classe (heritage) + * FIXME instance ou classe ? + */ + this.CLASSNAME = "Alti"; + + // appel du constructeur par heritage + _CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this, arguments); + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("Gp.Services.Alti"); + this.logger.trace("[Constructeur Alti (options)]"); + + // ##################### + // analyse des options + // ##################### + + if (!options.positions) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "positions")); + } + + if (options.positions.length === 0) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "positions")); + } + + // ajout des options spécifiques au service + this.options.positions = options.positions; + + // format de réponse du service : "json" ou "xml" (valeur par défaut), en minuscule ! + this.options.outputFormat = (typeof options.outputFormat === "string") ? options.outputFormat.toLowerCase() : "xml"; + + // ressource utilisée pour le calcul altimétrique + this.options.resource = options.resource || "rge_alti_corse2a_float32_zip_lamb93"; + + // sampling + this.options.sampling = options.sampling || null; + + // type d'api utilisé pour requeter le service, en majuscule ! + this.options.api = (typeof options.api === "string") ? options.api.toUpperCase() : "REST"; + + // l'api ne peut être interrogée qu'en GET. + if (this.options.api === "REST") { + this.options.httpMethod = "GET"; + } + + // param. zonly + this.options.zonly = options.zonly || false; + + // param. measures + this.options.measures = options.measures || false; + + // gestion de l'url du service par defaut + // si l'url n'est pas renseignée, il faut utiliser les urls par defaut + // en fonction du type d'api, REST ou WPS, du format de reponse demandé (outputFormat) + // ainsi que sur le type de service (profil ou elevation) + if (!this.options.serverUrl) { + // Code commenté pour Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti + /* var lstUrlByDefault = DefaultUrlService.Alti.newUrl(); + if (this.options.oldAltiService) { + lstUrlByDefault = DefaultUrlService.Alti.url(); + }*/ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'alti + var lstUrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Alti.url(); + var urlFound = null; + switch (this.options.api) { + case "WPS": + urlFound = lstUrlByDefault.wps; + break; + case "REST": + var key = (options.sampling ? "profil" : "elevation") + "-" + this.options.outputFormat; + urlFound = lstUrlByDefault[key]; + break; + default: + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_UNKNOWN", "api")); + } + + if (!urlFound) { + throw new Error("Url by default not found !"); + } + this.options.serverUrl = urlFound; + this.logger.trace("Server URL by default : " + this.options.serverUrl); + } + + // gestion du type de service + // si l'extension de l'url est .json ou .xml, on surcharge le format de sortie (outputFormat) + var idx = this.options.serverUrl.lastIndexOf("."); + if (idx !== -1) { + var extension = this.options.serverUrl.substring(idx + 1); + if (extension && extension.length < 5) { // FIXME extension de moins de 4 car. ... + this.logger.trace("Server Extension URL : " + extension); + switch (extension.toLowerCase()) { + case "json": + case "xml": + this.options.outputFormat = extension.toLowerCase(); + break; + default: + throw new Error("type of service : unknown or unsupported (json or xml) !"); + } + } + } +} + +/** + * @lends module:Alti# + */ +Alti.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].prototype, { + // todo + // getter/setter +}); + +/** + * Constructeur (alias) + */ +Alti.prototype.constructor = Alti; + +/** + * Création de la requête (overwrite) + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +Alti.prototype.buildRequest = function (error, success) { + // utilisation en mode callback + var options = { + httpMethod : this.options.httpMethod, + // callback + onSuccess : function (result) { + // sauvegarde de la requete ! + this.request = result; + success.call(this, this.request); + }, + onError : error, + scope : this, + // spécifique au service : + resource : this.options.resource, + positions : this.options.positions, + outputFormat : this.options.outputFormat, + sampling : this.options.sampling, + api : this.options.api, + zonly : this.options.zonly, + measures : this.options.measures + }; + + _Request_AltiRequestFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); +}; + +/** + * Analyse de la reponse (overwrite) + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +Alti.prototype.analyzeResponse = function (error, success) { + // INFO + // Factory pour masquer la complexité du retour du service qui renvoie soit + // - une 'string' qui contient du XML ou JSON natif en mode XHR + // - un objet JSON qui est natif ou encapsulé + + if (this.response) { + var options = { + response : this.response, + outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML ! + rawResponse : this.options.rawResponse, + onError : error, + onSuccess : success, + scope : this + }; + + _Response_AltiResponseFactory__WEBPACK_IMPORTED_MODULE_6__["default"].build(options); + } else { + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (Alti); + + +/***/ }), +/* 55 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50); +/* harmony import */ var _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56); +/* harmony import */ var _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60); +/** + * Creation d'une requête en REST ou WPS + * (Factory) + * + * @module AltiRequestFactory + * @alias Gp.Services.Alti.Request.AltiRequestFactory + * @private + */ + + + + + +var AltiRequestFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant Alti + * + * @example + * var options = { + * httpMethod : 'GET', // GET|POST + * onSuccess : function (response) {}, + * onError : function (error) {}, + * scope : this, + * positions : [{lon:, lat:}, {lon:, lat:}], + * outputFormat : 'json' // json|xml + * sampling : 3, + * api : 'REST', // REST|WPS + * zonly : false // false|true + * }; + * + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("AltiRequestFactory"); + logger.trace(["AltiRequestFactory::build()"]); + + var request = null; + + // on factorise les options par groupe; + // - global, + // - param, les params pour les data inputs + // - wps, les param du service + // - callback + + var settings = { + // ajout des valeurs par defaut spécifiques au service + type : options.sampling ? "Profil" : "Elevation", + method : options.httpMethod, + param : { + positions : null, + delimiter : null, // FIXME par defaut, on ne le met pas en place car ça fait planter la requête !? + indent : null, // par defaut + crs : null, // par defaut + format : null, // (only to POST) + sampling : null, // (only use by Profil) + zonly : null, // (only use by Elevation) + measures : null // (only use by Elevation) + } + }; + + // surcharge des valeurs obligatoires + settings.param.positions = options.positions; + settings.param.format = options.outputFormat; + settings.param.sampling = options.sampling; + settings.param.zonly = options.zonly; + settings.param.measures = options.measures; + settings.param.resource = options.resource; + + // gestion des callback + var bOnError = !!(options.onError !== null && typeof options.onError === "function"); // cast variable to boolean + var bOnSuccess = !!(options.onSuccess !== null && typeof options.onSuccess === "function"); + + var message = null; + switch (options.api) { + case "REST": + // FIXME les exceptions ne sont pas 'catchées' sur le constructeur ! + var myReq = new _AltiRequestREST__WEBPACK_IMPORTED_MODULE_2__["default"](settings); + if (!myReq.processRequestString()) { + message = "Error in process request (rest) !"; + if (bOnError) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__["default"](message)); + return; + } + throw new Error(message); + } + request = myReq.requestString; + break; + case "WPS": + // ajout des valeurs par defaut spécifiques au service WPS + settings.wps = { + service : null, // par defaut + version : null, // par defaut + identifier : null, // par defaut + rawdataoutput : null, // par defaut + request : null // par defaut + }; + + request = _AltiRequestWPS__WEBPACK_IMPORTED_MODULE_3__["default"].build(settings); + if (!request) { + message = "Error in process request (wps) !"; + if (bOnError) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__["default"](message)); + return; + } + throw new Error(message); + } + break; + default: + message = "Type of API is not supported by service (REST or WPS) !"; + if (bOnError) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__["default"](message)); + return; + } + throw new Error(message); + } + + if (bOnSuccess) { + options.onSuccess.call(options.scope, request); + } + + return request; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiRequestFactory); + + +/***/ }), +/* 56 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57); +/* harmony import */ var _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59); +/* jshint multistr : true */ + + + + + + +/** + * @classdesc + * Classe de gestion des requêtes de type REST sur le service altimetrique. + * + * @todo Le service Alti n'implemente pas le POST !? + * @constructor + * @alias Gp.Services.Alti.Request.AltiRequestREST + * @param {Object} options - options + * @param {Object} options.param.positions - tableau de coordonnées lon/lat + * @param {String} options.param.delimiter - '|' + * @param {Boolean} options.param.indent - false|true + * @param {String} options.param.crs - 'CRS:84' + * @param {String} options.param.sampling - 3 + * @param {String} options.param.resource - 'rge_alti_corse2a_float32_zip_lamb93' + * @param {Boolean} options.param.zonly - false|true + * @param {Boolean} options.param.measures - false|true + * @param {String} options.param.format - "JSON|XML" + * @param {String} options.type - "Profil|Elevation" + * @param {String} options.method - GET|POST + * + * @example + * var options = { + * type : 'Profil', // Elevation + * method : 'GET', // par defaut + * param : { + * positions : [ + * {lon:'1.11', lat:'1.11'}, + * {lon:'1.10', lat:'1.10'}, + * {lon:'1.12', lat:'1.12'} + * ], + * delimiter : ";", // par defaut + * indent : true, // par defaut + * crs : 'EPSG:4326', // par defaut + * format : 'json', // par defaut (only to POST) + * sampling : 3 , // par defaut (only use by Profil) + * zonly : false // par defaut (only use by Elevation) + * measures : false // par defaut (only use by Elevation) + * } + * }; + * + * var result; + * try { + * var obj = new AltiRequestREST (options); + * if (! obj.processRequestString ()) { + * throw new Error("Request empty !?") + * } + * result = obj.requestString; + * } catch (e) { + * // exceptions... + * } + * @private + */ +function AltiRequestREST (options) { + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("AltiRequestREST"); + this.logger.trace("[Constructeur AltiRequestREST ()]"); + + if (!(this instanceof AltiRequestREST)) { + throw new TypeError("AltiRequestREST constructor cannot be called as a function."); + } + + this.options = options || {}; + + // existance des options + if (!this.options) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "options")); + } + + // type de requete : Altitude ou Profil + // (param. à determiner en fonction des parametres d'entrée) + if (!this.options.type) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "type (Elevation or Profil)")); + } + + // construction du modele de requête + // (test du type d'objet candidat) + this.DataObject = null; + switch (this.options.type) { + case "Elevation": + this.DataObject = new _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_2__["default"](this.options.param); + break; + case "Profil": + this.DataObject = new _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_3__["default"](this.options.param); + break; + default: + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_TYPE", "type (Elevation or Profil)")); + } + + /** + * methode. + * Par defaut, "GET". + */ + this.method = this.options.method || "GET"; +} + +AltiRequestREST.prototype = { + + /** + * request + * @type {String} + */ + requestString : null, + + /** + * Constructeur (alias) + */ + constructor : AltiRequestREST, + + /** + * Template de la requête. + */ + template : { + get : { + // FIXME on retire le param 'delimiter' : &delimiter='__DELIMITER__' + value : "lon=__LON__&lat=__LAT__&indent=__INDENT__&crs='__CRS__'&resource=__RESOURCE__&measures=__MEASURES__", + input : { + point : "&zonly=__ZONLY__", + profil : "&sampling=__SAMPLING__" + } + }, + post : { + // FIXME on retire le param 'delimiter' : delimiter='__DELIMITER__'\n\ + value : "lon=__LON__\n" + + "lat=__LAT__\n" + + "indent=__INDENT__\n" + + "crs='__CRS__'\n" + + "resource='__RESOURCE__'\n" + + "measures='__MEASURES__'\n", + input : { + point : "zonly=__ZONLY__\n", + profil : "sampling=__SAMPLING__" + } + } + }, + + /** + * Construction de la requête. + * + * @example + * // GET out : lon=0.2367,2.1570&lat=48.0551,46.6077&delimiter=,&indent=true&zonly=true&crs='CRS:84' + * // POST out : Not yet supported method POST ! + * @returns {String} + */ + processRequestString : function () { + this.logger.trace("AltiRequestREST::processRequestString ()"); + + var template = ""; + if (this.method === "POST") { + template = this.template.post.value; + } else if (this.method === "GET") { + template = this.template.get.value; + } + + template = template.replace(/__LON__/g, this.DataObject.getLon()); + template = template.replace(/__LAT__/g, this.DataObject.getLat()); + // FIXME on retire le param 'delimiter' + // template = template.replace(/__DELIMITER__/g, this.DataObject.delimiter); + template = template.replace(/__INDENT__/g, this.DataObject.indent); + template = template.replace(/__CRS__/g, this.DataObject.crs); + template = template.replace(/__RESOURCE__/g, this.DataObject.resource); + template = template.replace(/__MEASURES__/g, this.DataObject.measures); + + // ajout + + template = template + this.__addDataInputs(); + this.logger.trace("traduction tmpl", template); + + // sauvegarde + this.requestString = template; + + return this.requestString; + }, + + /** + * Ajout de parametres spécifiques (ex. zonly) + * + * @returns {String} + */ + __addDataInputs : function () { + this.logger.trace("AltiRequestREST::addDataInput ()"); + + var myTemplate; + if (this.method === "POST") { + myTemplate = this.template.post; + } else if (this.method === "GET") { + myTemplate = this.template.get; + } else { + throw new Error("No other HTTP method supported by the service !"); + } + + var tmpl = null; + if (this.DataObject.CLASSNAME === "AltiElevationRequest") { + tmpl = myTemplate.input.point; + return tmpl.replace(/__ZONLY__/g, this.DataObject.zonly.toString()); + } else if (this.DataObject.CLASSNAME === "AltiProfilRequest") { + tmpl = myTemplate.input.profil; + return tmpl.replace(/__SAMPLING__/g, this.DataObject.sampling); + } else { + throw new Error("No other object supported than elevation or profil !?"); + } + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiRequestREST); + + +/***/ }), +/* 57 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58); + + + + +/** + * @classdesc + * + * Classe de gestion des param. des requêtes de type POINT du service altimetrique. + * + * @constructor + * @alias Gp.Services.Alti.Request.AltiElevationRequest + * @param {Object} options - options + * @param {Boolean} options.zonly - false|true + * + * @private + */ +function AltiElevationRequest (options) { + if (!(this instanceof AltiElevationRequest)) { + throw new TypeError("AltiElevationRequest constructor cannot be called as a function."); + } + + /** + * Nom de la classe (heritage) + */ + this.CLASSNAME = "AltiElevationRequest"; + + // appel du constructeur par heritage + _AltiRequest__WEBPACK_IMPORTED_MODULE_1__["default"].apply(this, arguments); + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur AltiElevationRequest ()]"); + + /** + * Z uniquement. + * true|false + */ + this.zonly = this.options.zonly || false; // test des options héritées ! +} + +/** + * @lends module:AltiElevationRequest# + */ + +AltiElevationRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__["default"].prototype, { + + /** + * Setter/getter pour "zonly" + */ + zonly : { + /** getter */ + get : function () { + return this._zonly; + }, + /** setter */ + set : function (z) { + this._zonly = z; + } + } + +}); + +/** + * Constructeur (alias) + */ +AltiElevationRequest.prototype.constructor = AltiElevationRequest; + +/** + * Tableau de clefs/valeurs pour param. + * + * @returns {Array} + */ +AltiElevationRequest.prototype.getData = function () { + // par glop..., appel de AltiRequest::getData () ! + var map = []; + map.push({ + k : "lon", + v : this.getLon() + }); + map.push({ + k : "lat", + v : this.getLat() + }); + // map.push({k : "delimiter", v : this.delimiter}); // FIXME on retire le param "delimiter" + map.push({ + k : "indent", + v : this.indent + }); + map.push({ + k : "crs", + v : this.crs + }); + map.push({ + k : "zonly", + v : this.zonly + }); + map.push({ + k : "format", + v : this.format + }); + map.push({ + k : "resource", + v : this.resource + }); + + return map; +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiElevationRequest); + + +/***/ }), +/* 58 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); + + + +/** + * @classdesc + * Classe de gestion des param. des requêtes du service altimetrique. + * + * @constructor + * @alias Gp.Services.Alti.Request.AltiRequest + * @param {Object} options - options + * @param {Object} options.positions - tableau de coordonnées lon/lat + * @param {String} options.delimiter - "|" + * @param {Boolean} options.indent - false|true + * @param {String} options.crs - "CRS:84" + * @param {String} options.format - "JSON|XML" + * + * @private + */ +function AltiRequest (options) { + if (!(this instanceof AltiRequest)) { + throw new TypeError("AltiRequest constructor cannot be called as a function."); + } + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur AltiRequest ()]"); + + /** + * Options en paramêtres du constructeur. + */ + this.options = options || {}; + + /** + * Liste des coordonnées. + * @example + * var c = [{lon : "", lat : ""}, {lon : "", lat : ""}]; + */ + this.positions = this.options.positions || []; + + /** + * Caractère de séparation. + * Par defaut, "|". + */ + this.delimiter = this.options.delimiter || "|"; + + /** + * Indentation. + * true|false + */ + this.indent = this.options.indent || false; + + /** + * Projection. + * Par defaut, CRS:84. + */ + this.crs = this.options.crs || "CRS:84"; + + /** + * format de sortie. + * Par defaut, "json". + */ + this.format = this.options.format || "json"; + + /* + * Ressource utilisée + */ + this.resource = this.options.resource; + + /** + * Réponse détaillée (source & accuracy) + * true|false + */ + this.measures = this.options.measures || false; +} + +/** + * CLASSNAME + */ +AltiRequest.CLASSNAME = "AltiRequest"; + +AltiRequest.prototype = { + + /** + * @lends module:AltiRequest# + */ + + /** + * Constructeur (alias) + */ + constructor : AltiRequest, + + /** + * Ajout d"une liste de coordonnées. + * + * @param {Object[]} lstPosition - liste de positions + * @example + * obj.setPositions ([{lon : "0.15", lat : "0.15"}, {lon : "1.15", lat : "1.15"}]); + */ + setPositions : function (lstPosition) { + var positions = []; + for (var i = 0; i < lstPosition.length; i++) { + var o = lstPosition[i]; + if (o.lon && o.lat) { + positions.push(o); + } + } + + this.positions = positions; + }, + + /** + * Liste des coordonnées. + * + * @param {Int} pos - position + * @returns {positions} + * @example + * obj.getPositions (); // [{lon : "", lat : ""}, {lon : "", lat : ""}] + * obj.getPositions (0); // [{lon : "", lat : ""}] + */ + getPositions : function (pos) { + // FIXME test if not a number !? + if (!pos) { + return this.positions; + } + + var index = this.positions.length - 1; + if (pos > index || pos < index) { + this.logger.warn("index out of range !"); + return this.positions; + } + + return this.positions[pos]; + }, + + /** + * Ajout d"une liste de coordonnées. + * + * @param {Object[]} lstPosition - liste de positions + * @example + * obj.addPositions ([{lon : "0.15", lat : "0.15"}, {lon : "1.15", lat : "1.15"}]); + */ + addPositions : function (lstPosition) { + for (var i = 0; i < lstPosition.length; i++) { + var o = lstPosition[i]; + if (o.lon && o.lat) { + this.positions.push(lstPosition[i]); + } + } + }, + + /** + * Retourne la liste des longitudes avec un caractère de séparation. + * + * @returns {String} - une liste de longitudes + * @example + * // out : 0.2367|2.1570|43.789|... + */ + getLon : function () { + var lstLon = []; + for (var i = 0; i < this.positions.length; i++) { + lstLon.push(this.positions[i].lon); + } + this.logger.trace(lstLon); + return lstLon.join(this.delimiter); + }, + + /** + * Retourne la liste des lattitudes avec un caractère de séparation. + * + * @returns {String} - une liste de lattitudes + * @example + * // out : 0.2367|2.1570|43.789|... + */ + getLat : function () { + var lstLat = []; + for (var i = 0; i < this.positions.length; i++) { + lstLat.push(this.positions[i].lat); + } + this.logger.trace(lstLat); + return lstLat.join(this.delimiter); + } + +}; + +/** + * Tableau de clefs/valeurs pour param. + * + * @returns {Object[]} + */ +AltiRequest.prototype.getData = function () { + var map = []; + + map.push({ + k : "lon", + v : this.getLon() + }); + map.push({ + k : "lat", + v : this.getLat() + }); + map.push({ + k : "delimiter", + v : this.delimiter + }); + map.push({ + k : "indent", + v : this.indent + }); + map.push({ + k : "crs", + v : this.crs + }); + map.push({ + k : "format", + v : this.format + }); + + return map; +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiRequest); + + +/***/ }), +/* 59 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _AltiRequest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58); + + + + +/** + * @classdesc + * Classe de gestion des param. des requêtes de type PROFIL du service altimetrique. + * + * @constructor + * @alias Gp.Services.Alti.Request.AltiProfilRequest + * @param {Object} options - options + * @param {String} options.sampling - 3 + * + * @private + */ +function AltiProfilRequest (options) { + if (!(this instanceof AltiProfilRequest)) { + throw new TypeError("AltiProfilRequest constructor cannot be called as a function."); + } + + /** + * Nom de la classe (heritage) + */ + this.CLASSNAME = "AltiProfilRequest"; + + // appel du constructeur par heritage + _AltiRequest__WEBPACK_IMPORTED_MODULE_1__["default"].apply(this, arguments); + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur AltiProfilRequest ()]"); + + /** + * Sampling + * Par defaut, 3 + */ + this.sampling = this.options.sampling || 3; // test des options héritées ! +} + +/** + * @lends module:AltiProfilRequest# + */ + +AltiProfilRequest.prototype = Object.create(_AltiRequest__WEBPACK_IMPORTED_MODULE_1__["default"].prototype, { + + /** + * Setter/getter pour "sampling" + */ + sampling : { + /** getter */ + get : function () { + return this._sampling; + }, + /** setter */ + set : function (value) { + this._sampling = value; + } + } +}); + +/** + * Constructeur (alias) + */ +AltiProfilRequest.prototype.constructor = AltiProfilRequest; + +/** + * Tableau de clefs/valeurs pour param. + * + * @returns {Object[]} + */ +AltiProfilRequest.prototype.getData = function () { + // par glop..., appel de AltiRequest::getData () ! + var map = []; + map.push({ + k : "lon", + v : this.getLon() + }); + map.push({ + k : "lat", + v : this.getLat() + }); + // map.push({k : "delimiter", v : this.delimiter}); // FIXME on retire le param "delimiter" + map.push({ + k : "indent", + v : this.indent + }); + map.push({ + k : "crs", + v : this.crs + }); + map.push({ + k : "sampling", + v : this.sampling + }); + map.push({ + k : "format", + v : this.format + }); + map.push({ + k : "resource", + v : this.resource + }); + + return map; +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiProfilRequest); + + +/***/ }), +/* 60 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Formats_WPS__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61); +/* harmony import */ var _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57); +/* harmony import */ var _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59); +/** + * Classe d'interface des requêtes de type WPS sur le service altimetrique. + * (Factory) + * + * @module Gp.Services.Alti.Request.AltiRequestWPS + * @alias Gp.Services.Alti.Request.AltiRequestWPS + * @private + */ + + + + + + +var AltiRequestWPS = { + + /** + * Interface unique de construction de la requête. + * + * @method build + * @param {Object} options - options + * @param {Object} options.param.positions - tableau de coordonnées lon/lat + * @param {String} options.param.delimiter - '|' + * @param {Boolean} options.param.indent - false|true + * @param {String} options.param.crs - 'CRS:84' + * @param {String} options.param.sampling - 3 + * @param {Boolean} options.param.zonly - false|true + * @param {String} options.param.format - "JSON|XML" (only to POST) + * @param {String} options.wps.service - "WPS" + * @param {String} options.wps.version - "1.0.0" + * @param {String} options.wps.identifier - "gs:WPSElevation|gs:WPSLineElevation" + * @param {String} options.wps.rawdataoutput - "result" + * @param {String} options.wps.request - "Execute" + * @param {String} options.type - "Profil|Elevation" + * @param {String} options.method - GET|POST + * @example + * var options = { + * type : 'Profil', // Elevation + * method : 'GET', // par defaut + * param : { + * positions : [ + * {lon:'1.11', lat:'1.11'}, + * {lon:'1.10', lat:'1.10'}, + * {lon:'1.12', lat:'1.12'} + * ], + * delimiter : ";", // par defaut + * indent : true, // par defaut + * crs : 'EPSG:4326', // par defaut + * format : 'json', // par defaut (only to POST) + * sampling : 3 , // par defaut (only use by Profil) + * zonly : false, // par defaut (only use by Elevation) + * }, + * wps : { + * service : 'WPS', // par defaut + * version : '1.0.0', // par defaut + * identifier : 'gs:WPS', // par defaut, Elevation = gs:WPSElevation, Profil = gs:WPSLineElevation + * rawdataoutput : 'result',// par defaut + * request : 'Execute' // par defaut + * } + * }; + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("AltiRequestWPS"); + logger.trace(["AltiRequestWPS::build()"]); + + // existance des options + if (!options) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "options")); + } + + // type de requete : Altitude ou Profil + // (param. à determiner en fonction des parametres d'entrée) + if (!options.type) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "type (Elevation or Profil)")); + } + + // construction du modele de requête + // (test du type d'objet candidat) + var DataObject = null; + switch (options.type) { + case "Elevation": + // surcharge + options.wps.identifier = "gs:WPSElevation"; + DataObject = new _model_AltiElevationRequest__WEBPACK_IMPORTED_MODULE_3__["default"](options.param); + break; + case "Profil": + // surcharge + options.wps.identifier = "gs:WPSLineElevation"; + DataObject = new _model_AltiProfilRequest__WEBPACK_IMPORTED_MODULE_4__["default"](options.param); + break; + default: + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_TYPE", "type (Elevation or Profil)")); + } + + // construction de la requête WPS + var settings = { + data : DataObject, + method : options.method, + param : options.wps + }; + + var rqstWPS = new _Formats_WPS__WEBPACK_IMPORTED_MODULE_2__["default"](settings); + + if (!rqstWPS.processRequestString()) { + throw new Error("Enable to process request !"); + } + + return rqstWPS.requestString; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiRequestWPS); + + +/***/ }), +/* 61 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); + + +/** + * @classdesc + * Standard WPS + * + * @constructor + * @alias Gp.Formats.WPS + * @param {Object} options - options + * @param {Object} options.data - objet + * @param {String} options.method - POST|GET + * @param {String} options.param.service - "WPS" + * @param {String} options.param.version - "1.0.0" + * @param {String} options.param.identifier - "gs:WPSElevation|gs:WPSLineElevation" + * @param {String} options.param.rawdataoutput - "result" + * @param {String} options.param.request - "Execute" + * @param {Function} options.onsuccess - function callback success (TODO) + * @param {Function} options.onerror - function callback error (TODO) + * @private + */ +function WPS (options) { + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur WPS()]"); + + if (!(this instanceof WPS)) { + throw new TypeError("WPS constructor cannot be called as a function."); + } + + this.options = options || {}; + + /** + * Objet DATA + */ + this.DataObject = this.options.data; + + if (!this.DataObject) { + throw new TypeError("This data object is not defined !"); + } + + /** + * param service. + * Par defaut, "WPS". + */ + this.paramservice = this.options.param.service || "WPS"; + + /** + * param version. + * Par defaut, "1.0.0". + */ + this.paramversion = this.options.param.version || "1.0.0"; + + /** + * param identifier + * Par defaut, "gs:WPS" + */ + this.paramidentifier = this.options.param.identifier || "gs:WPS"; + + /** + * param rawdataoutput + * Par defaut, "result". + */ + this.paramrawdataoutput = this.options.param.rawdataoutput || "result"; + + /** + * param request + * Par defaut, "Execute". + */ + this.paramrequest = this.options.param.request || "Execute"; + + /** + * methode. + * Par defaut, "GET". + */ + this.method = this.options.method || "GET"; +} + +WPS.prototype = { + + /** + * @lends module:WPS# + */ + + /** + * request + * @type {String} + */ + requestString : null, + + /** + * Constructeur (alias) + */ + constructor : WPS, + + /** + * Template de la requête. + */ + template : { + get : { + value : "service=__SERVICE__" + + "&version=__VERSION__" + + "&rawdataoutput=__RAWDATAOUTPUT__" + + "&identifier=__IDENTIFIER__" + + "&request=__REQUEST__" + + "&datainputs=", + + input : "__KEY__=__DATA__" + + }, + post : { + + value : "" + + "" + + "__IDENTIFIER__" + + "" + + "" + + "" + + "" + + "" + + "__RAWDATAOUTPUT__" + + "" + + "" + + "", + + input : "" + + "__KEY__" + + "" + + "__DATA__" + + "" + + "" + } + }, + + /** + * Namespace par defaut de la requete POST. + * + * @returns {String} namespace + */ + namespaceByDefault : function () { + var ns = [ + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"", + "xmlns=\"http://www.opengis.net/wps/1.0.0\"", + "xmlns:wfs=\"http://www.opengis.net/wfs\"", + "xmlns:wps=\"http://www.opengis.net/wps/1.0.0\"", + "xmlns:ows=\"http://www.opengis.net/ows/1.1\"", + "xmlns:gml=\"http://www.opengis.net/gml\"", + "xmlns:ogc=\"http://www.opengis.net/ogc\"", + "xmlns:wcs=\"http://www.opengis.net/wcs/1.1.1\"", + "xmlns:xlink=\"http://www.w3.org/1999/xlink\"" + ]; + + return ns.join(" "); + }, + + /** + * Schemalocation par defaut. + * + * @returns {String} schemaLocation + */ + schemaLocationByDefault : function () { + return "xsi:schemaLocation=\"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd\""; + }, + + /** + * Construction de la requête. + * + * @example + * // GET out : + * // service=__SERVICE__ + * // &version=__VERSION__ + * // &rawdataoutput=__RAWDATAOUTPUT__ + * // &identifier=__IDENTIFIER__ + * // &request=__REQUEST__ + * // &datainputs="__DATAINPUTS__" + * // avec __DATAINPUTS__ = __KEY__=__DATA__;... + * + * // POST out : + * // + * // + * // __IDENTIFIER__ + * // + * // + * // + * // + * // + * // __RAWDATAOUTPUT__ + * // + * // + * // ", + * // avec __DATAINPUTS__ + * // + * // __KEY__ + * // + * // __DATA__ + * // + * // + * + * @returns {Boolean} validation de la construction de la requete + */ + processRequestString : function () { + this.logger.trace("WPS::processRequestString ()"); + + var template = ""; + if (this.method === "POST") { + template = this.template.post.value; + } else if (this.method === "GET") { + template = this.template.get.value; + } else { + this.logger.error("No other method supported by the service !"); + return false; + } + + template = template.replace(/__SERVICE__/g, this.paramservice); + template = template.replace(/__VERSION__/g, this.paramversion); + template = template.replace(/__RAWDATAOUTPUT__/g, this.paramrawdataoutput); + template = template.replace(/__IDENTIFIER__/g, this.paramidentifier); + template = template.replace(/__REQUEST__/g, this.paramrequest); + + // ajout + + if (this.method === "POST") { + template = template.replace(/__NAMESPACE__/g, this.namespaceByDefault); + template = template.replace(/__SCHEMALOCATION__/g, this.schemaLocationByDefault); + } + + // ajout des datainputs + template = template.replace(//g, this.__addDataInputs()); + + if (!template) { + this.logger.warn("traduction tmpl : empty request !?"); + return false; + } + + this.requestString = template; + this.logger.trace("traduction tmpl", template); + + return true; + }, + + /** + * Ajout des données + * + * @returns {String} Données concaténées dans une chaine + */ + __addDataInputs : function () { + this.logger.trace("WPS::__addDataInputs ()"); + + // c'est un peu grossier... + var tmpl = this.method === "GET" ? this.template.get.input : this.template.post.input; + var sep = this.method === "GET" ? ";" : ""; + + var result = ""; + var that = this; + var map = this.DataObject.getData(); + for (var i = 0; i < map.length; i++) { + // FIXME closure ? + (function (j) { + if (sep) { + sep = (j === map.length - 1) ? "" : ";"; + } + result = result.concat(that.__addDataInput(tmpl, map[j].k, map[j].v), sep); + })(i); + } + + return result; + }, + + /** + * Ajout d'une donnée. + * + * @param {String} tmpl - template + * @param {String} key - clef + * @param {String} data - valeur + * @returns {String} chaine avec les substitutions clef/valeur + */ + __addDataInput : function (tmpl, key, data) { + var tmp = tmpl; + tmp = tmp.replace(/__KEY__/g, key); + tmp = tmp.replace(/__DATA__/g, data); + return tmp; + }, + + /** + * Definir le mode de requête + * + * @param {String} method - GET|POST + */ + setMethod : function (method) { + if (method === "GET" || method === "POST") { + this.method = method; + } else { + this.logger.warn("support only GET and POST method !"); + } + }, + + /** + * Retourne le mode de requete (GET|POST). + * + * @returns {AltiRequest.options.mode|String} methode (GET|POST) + */ + getMethod : function () { + return this.method; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (WPS); + + +/***/ }), +/* 62 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _Formats_XML__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(63); +/* harmony import */ var _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(64); +/* harmony import */ var _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65); +/* harmony import */ var _model_Elevation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(66); +/** + * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON + * (Factory) + * + * @module AltiResponseFactory + * @private + * @alias Gp.Services.Alti.Response.AltiResponseFactory + */ + + + + + + + + +var AltiResponseFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant Alti + * + * @example + * var options = { + * response : + * outputFormat : + * rawResponse : + * scope : + * onSuccess : + * onError : + * }; + * + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("AltiResponseFactory"); + logger.trace(["AltiResponseFactory::build()"]); + + var data = null; + + if (options.response) { + if (options.rawResponse) { + logger.trace("analyze response : raw"); + data = options.response; + } else { + switch (options.outputFormat) { + case "xml": + logger.trace("analyze response : xml"); + + try { + var p = new _Formats_XML__WEBPACK_IMPORTED_MODULE_3__["default"]({ + reader : _Formats_AltiResponseReader__WEBPACK_IMPORTED_MODULE_4__["default"] + }); + + if (typeof options.response === "string") { + p.setXMLString(options.response); + } else { + p.setXMLDoc(options.response); + } + + data = p.parse(); + + if (!data) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION_2")); + } + } catch (e) { + var message = e.message; + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", message), + status : 200, + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_SRVERR + })); + return; + } + + break; + + case "json": + logger.trace("analyze response : json"); + logger.trace("analyze response : ", typeof options.response); + + var JSONResponse = null; + if (typeof options.response === "string") { + JSONResponse = JSON.parse(options.response); + } else { + JSONResponse = options.response; + } + + // le service renvoie t il une erreur ? + if (JSONResponse && JSONResponse.error) { + // ex. {"error": {"code": "BAD_PARAMETER","description": "The values () cannot be parsed as a valid longitude (double value such as -180 < lat < 180)."}} + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", JSONResponse.error.description), + status : 200, + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_SRVERR + })); + return; + } + + // analyse de la reponse + if (JSONResponse) { + var elevations = JSONResponse.elevations; + var altiResponse = new _model_AltiResponse__WEBPACK_IMPORTED_MODULE_5__["default"](); + var elevation; + if (Array.isArray(elevations) && elevations.length) { + for (var i = 0; i < elevations.length; i++) { + elevation = new _model_Elevation__WEBPACK_IMPORTED_MODULE_6__["default"](); + + if (typeof elevations[i] === "object") { + // elevations[i] est un objet elevation + if (elevations[i].lon) { + elevation.lon = elevations[i].lon; + } + if (elevations[i].lat) { + elevation.lat = elevations[i].lat; + } + if (elevations[i].z) { + elevation.z = elevations[i].z; + } + if (elevations[i].acc) { + elevation.acc = elevations[i].acc; + } + if (elevations[i].measures) { + elevation.measures = elevations[i].measures; + } + } else if (typeof elevations[i] === "number") { + // elevations[i] est un nombre, dans le cas de zonly=true notamment + elevation.z = elevations[i]; + } + + if (Array.isArray(altiResponse.elevations)) { + altiResponse.elevations.push(elevation); + } + } + } + data = altiResponse; + } + + if (!data) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_ANALYSE_2"), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_UNKERR, + status : -1 + })); + return; + } + break; + + default: + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_FORMAT_2"), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_UNKERR, + status : -1 + })); + return; + } + + // Si la réponse contenait une exception renvoyée par le service + if (data.exceptionReport) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", data.exceptionReport), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_SRVERR, + status : 200 + })); + return; + } else if (data.error) { + var errorMess = data.error.description; + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", errorMess), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_SRVERR, + status : 200 + })); + return; + } + } + } else { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + return; + } + + options.onSuccess.call(options.scope, data); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiResponseFactory); + + +/***/ }), +/* 63 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* global require */ + + +// import __xmldom from "xmldom"; + +/** + * @classdesc + * + * Classe permettant d'écrire ou de lire du XML, sous forme de document DOM, + * éventuellement selon des clés de lecture (readers) ou d'écriture (writers) spécifiques. + * + * @constructor + * @alias Gp.Formats.XML + * + * @param {Object} [options] - options du format XML + * + * @param {Object} [options.reader] - Instance d'un Reader de service (AltiResponseReader, GeocodeRequestReader, etc.) + * utile pour interpréter le XML lorsque sa structure est connue. + * Ce reader doit comporter au moins une fonction statique read (root) permettant d'initialiser la lecture. + * + * @param {Object} [options.writers] - writers + * + * @param {String} [options.xmlString] - chaîne de caractère contenant du XML à interpréter. + * + * @private + */ +function XML (options) { + if (!(this instanceof XML)) { + throw new TypeError("XML constructor cannot be called as a function."); + } + + // FIXME : notion de singleton + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur XML ()]"); + + /** + * Chaîne de caractères contenant le texte XML + * @type {String} + */ + this.xmlString = null; + + /** + * DOM Element correspondant à la structure du XML. + * @type {DOMElement} + */ + this.xmlDoc = null; + + /** + * Objet contenant des fonctions de lecture des différentes balises XML. + * @type {Object} + */ + this.reader = null; + + // traitement des paramètres d'options s'il y en a + if (options) { + if (options.xmlString && typeof options.xmlString === "string") { + this.xmlString = options.xmlString; + // Si une chaine de caractère a été passée en entrée : on la transforme aussi en XML document + this.xmlDoc = __getXMLDOC(options.xmlString); + } + if (options.reader) { + this.setReader(options.reader); + } + } +} + +XML.prototype = { + + /** + * @lends module:XML + */ + + /* + * Constructeur (alias) + */ + constructor : XML, + + /** + * Méthode permettant de récupérer la chaîne de caractères associée au format XML + * + * @returns {String} xmlString - la chaîne de caractères correspondant au format XML + */ + getXMLString : function () { + return this.xmlString; + }, + + /** + * Méthode permettant d'attribuer une chaîne de caractères au format XML (attribut xmlString). + * La méthode va aussi transformer cette chaîne de caractères en document XML, + * afin de remplir l'attribut xmlDoc. + * + * @param {String} xmlString - la chaîne de caractères correspondant au format XML + */ + setXMLString : function (xmlString) { + if (xmlString && typeof xmlString === "string") { + this.xmlString = xmlString; + this.xmlDoc = __getXMLDOC(xmlString); + } + }, + + /** + * Méthode permettant de récupérer les readers associés au format XML, s'ils ont été définis + * + * @return {Object} readers - les readers associés au format XML, s'ils existent, + * sous forme d'une collection de fonctions + */ + getReader : function () { + return this.reader; + }, + + /** + * Méthode permettant d'attribuer des readers, sous la forme d'un objet de fonctions (node, data), + * lorsqu'ils n'ont pas été définis lors de l'instanciation par exemple (new XML (options)). + * + * @param {Object} reader - Instance d'un Reader de service (AltiResponseReader, GeocodeRequestReader, etc.) + * utile pour interpréter le XML lorsque sa structure est connue. + * Ce reader doit comporter au moins une fonction statique read (root) permettant d'initialiser la lecture. + */ + setReader : function (reader) { + if (reader && reader.read && typeof reader.read === "function") { + this.reader = reader; + } + }, + + /** + * Méthode permettant de récupérer le document XML associé au format, s'il existe. + * + * @return {DOMElement} xmlDoc - le document XML (DOM document node) s'il existe + */ + getXMLDoc : function () { + return this.xmlDoc; + }, + + /** + * Setter + */ + setXMLDoc : function (doc) { + this.xmlDoc = doc; + }, + /** + * Méthode initialisant la lecture du XML, à partir d'un XML Document : + * création d'un objet JavaScript contenant les informations du XML, + * sauf dans le cas où il n'existe pas de XML Document à interpréter (retourne un objet vide). + * + * @return {Object} [parserOutput] - un objet JavaScript contenant les informations du XML : + * - soit toutes les informations si aucun reader n'a été spécifié à la création du format + * - soit les informations spécifiées dans le reader. + */ + parse : function () { + // build xml document from xmlString + if (!this.xmlDoc && this.xmlString) { + this.xmlDoc = __getXMLDOC(this.xmlString); + } + if (this.xmlDoc) { + var root = __getRootNode(this.xmlDoc); + if (root) { + var parserOutput; + // call reader if exists + if (this.reader && this.reader.read) { + parserOutput = this.reader.read(root); + } else { + parserOutput = {}; + parserOutput[root.nodeName] = __readDefault(root); + } + return parserOutput; + } else { + return {}; + } + } + } + +}; + +/** + * Méthode de la classe (privée) permettant de créer un XML Document à partir d'une chaîne de caractères XML, + * en utilisant DOMParser () lorsque c'est possible. + * For more information, see: https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#the-domparser-interface + * + * @private + * @memberof XML + * @method __getXMLDOC + * @param {String} xmlString - xml string to be converted into DOM element + * @return {DOMElement} - the corresponding XML Document + */ +function __getXMLDOC (xmlString) { + if (typeof window === "undefined") { + // env. nodejs + var DOMParser = __webpack_require__(48).DOMParser; // __xmldom.DOMParser; + return new DOMParser().parseFromString(xmlString, "text/xml"); + } else { + // env. browser + + var parser; + var xmlDoc; + var errorMsg = "Erreur lors du parsing de la réponse du service : XML non conforme"; + + if (window.ActiveXObject) { + // Internet Explorer < 9 + xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async = false; + xmlDoc.loadXML(xmlString); + var parseError = xmlDoc.parseError; + if (parseError.errorCode) { + if (parseError.line && parseError.linepos) { + errorMsg += "( ligne " + parseError.line + ", colonne " + parseError.linepos; + } + if (parseError.reason) { + errorMsg += ": " + parseError.reason + ")"; + } + throw new Error(errorMsg); + } + return xmlDoc; + } else if (window.DOMParser) { + // les autres (Chrome, Mozilla, IE >= 9) + parser = new window.DOMParser(); + try { + xmlDoc = parser.parseFromString(xmlString, "text/xml"); + } catch (e) { + // Internet Explorer browser raises exception if xmlString is not valid XML + if (e.message === "SyntaxError") { + throw new Error(errorMsg); + } else { + throw new Error("Erreur lors du parsing de la réponse du service : " + e.message); + } + } + // look for parsing error in case no exception was raised + if (xmlDoc.getElementsByTagName("parsererror").length > 0) { + var parsererror = xmlDoc.getElementsByTagName("parsererror"); + for (var i = 0; i < parsererror.length; i++) { + var content = parsererror[i].innerHTML; + // except in case parsererror is just because of huge xml, but parsing is done. + if (content.indexOf("Huge input lookup") === -1) { + errorMsg += "(" + content + ")"; + throw new Error(errorMsg); + } + } + } else if (!xmlDoc.documentElement) { // may happen in chrome browser + throw new Error(errorMsg); + } + return xmlDoc; + } else { + // FIXME + throw new Error("Incompatible DOM Parser pour ce navigateur !"); + } + } +} + +/** + * Méthode de la classe (privée) permettant de récupérer le noeud racine du document, + * à partir d'un document node (nodeType=9), puis lecture de ce noeud (readNode) + * + * @private + * @memberof XML + * @method __getRootNode + * @param {DOMElement} [xmlDoc] - a Document Node + * @return {DOMElement} root - the document root node + */ +function __getRootNode (xmlDoc) { + var root; + if (xmlDoc.nodeType === 9) { + // INFO : nodeType 9 represents the entire document (the root-node of the DOM tree) + root = xmlDoc.documentElement; + } else if (xmlDoc.nodeType === 1) { + root = xmlDoc; + } + return root; +} + +/** + * Méthode de la classe (privée) permettant de lire automatiquement un noeud XML, + * lorsqu'aucun reader spécifique n'a été spécifié (parser brut) + * + * @private + * @memberof XML + * @method readDefault + * @param {DOMElement} node - a DOM element node + * @example final data object looks like : + * data = { + * attributeName: attributeValue, + * childName: { + * attributeName: attributeValue, + * attributeName: attributeValue, + * childName: { + * "textContent": textContent + * }, + * childName: { + * childName: { + * attributeName:attributeValue + * } + * } + * } + * } + */ +function __readDefault (node) { + var data = {}; + + // if element node has attributes, set their values to data + if (node.attributes.length > 0) { + var dataAttributes = __getAttributes(node); + data["attributes"] = dataAttributes; + } + + // if element node has childNodes, read them and set them to data + if (node.hasChildNodes()) { + var childData = {}; + var child; + var children = node.childNodes; + + for (var i = 0; i < children.length; i++) { + child = children[i]; + + if (child.nodeType === 3) { // TEXT_NODE + data["textContent"] = child.nodeValue; + } else if (child.nodeType === 1) { + childData = __readDefault(child); + + if (!data[child.nodeName]) { + // store childData in an object + data[child.nodeName] = childData; + } else { + // in case several childNodes has the same name : store them in an array. + // if data[nodeName] already exists but is not an array + if (!Array.isArray(data[child.nodeName])) { + var old = data[child.nodeName]; + data[child.nodeName] = []; + data[child.nodeName].push(old); + } + data[child.nodeName].push(childData); + } + } + // TODO : manage other node types (4=CDATA, etc) + } + } + + return data; +} + +/** + * Méthode de la classe (privée) permettant de récupérer les attributs d'un noeud élément + * + * @private + * @memberof XML + * @method __getAttributes + * @param {DOMElement} node - noeud contenant l'attribut recherché + * @return {Object} nodeAttributes - objet contenant les noms et valeurs des différents attributs + */ +function __getAttributes (node) { + if (node.attributes.length > 0) { + var nodeAttributes = {}; + var attributes = node.attributes; + for (var i = 0; i < attributes.length; i++) { + var attribute = attributes[i]; + nodeAttributes[attribute.nodeName] = attribute.nodeValue; + } + return nodeAttributes; + } +} + +/* harmony default export */ __webpack_exports__["default"] = (XML); + + +/***/ }), +/* 64 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65); +/* harmony import */ var _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66); +/* harmony import */ var _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67); + +/** + * Fonction retournant un objet contenant des clés de lecture (readers) + * qui permettent de parser des réponses XML du service Altimétrique du Géoportail + * (calcul altimétrique simple ou profil altimétrique d'une courbe), + * lorsque le paramètre output = xml, + * afin de récupérer les élévations retournées. + * + * @module AltiResponseReader + * @alias Gp.Services.Alti.Formats.AltiResponseReader + * @private + */ + +// import Logger from "../../../Utils/LoggerByDefault"; + + + + +/** + * + * Objet AltiResponseReader + * + * @member {Object} AltiResponseReader + * + * @property {Object} AltiResponseReader.READERS - Objet contenant des fonctions de lecture, appelées "readers" + * dont chaque clé correspond au nom d'un tag du XML que l'on souhaite lire + * et la valeur associée est une fonction (node, data) + * où node est un noeud du document DOM + * et data est un objet où l'on stocke les informations lues dans le XML. + * + * @property {Method} AltiResponseReader.READERS.elevations - Lecture d'un noeud "elevations" de la réponse XML + * du service alti, correspondant logiquement à la racine du document + * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée) + * + * @property {Method} AltiResponseReader.READERS.elevation - Lecture d'un noeud "elevation" de la réponse xml du service alti. + * (contient un ou 4 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, et acc) + * + * @property {Method} AltiResponseReader.READERS.lat - Lecture d'un noeud "lat" de la réponse xml du service alti. + * (contient une valeur de latitude, qui est un flottant) + * + * @property {Method} AltiResponseReader.READERS.lon - Lecture d'un noeud "lon" de la réponse xml du service alti. + * (contient une valeur de longitude, qui est un flottant) + * + * @property {Method} AltiResponseReader.READERS.z - Lecture d'un noeud "z" de la réponse xml du service alti. + * (contient une valeur d'altitude, qui est un flottant) + * + * @property {Method} AltiResponseReader.READERS.acc - Lecture d'un noeud "acc" de la réponse xml du service alti. + * (contient une valeur de précision, qui est un flottant) + * + * @property {Method} AltiResponseReader.READERS.measures - Lecture d'un noeud "measures" de la réponse xml du service alti. + * (contient une valeur de précision, qui est un flottant) + * + * @property {Method} AltiResponseReader.READERS.source_name - Lecture d'un noeud "source_name" de la réponse xml du service alti. + * (pour remplir l'éventuel objet measure) + * + * @property {Method} AltiResponseReader.READERS.source_mesure - Lecture d'un noeud "source_mesure" de la réponse xml du service alti. + * (pour remplir l'éventuel objet measure) + * + * @property {Method} AltiResponseReader.READERS.exceptionreport - Lecture d'un noeud "ExceptionReport" de la réponse xml du service alti. + * + * @property {Method} AltiResponseReader.READERS.exception - Lecture d'un noeud "Exception" de la réponse xml du service alti. + * + * @property {Method} AltiResponseReader.read - Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique, + * à l'aide des readers de la classe. + * + */ +var AltiResponseReader = {}; + +AltiResponseReader.READERS = { + + /** + * Lecture d'un noeud "elevations" de la réponse XML du service alti, correspondant logiquement à la racine du document + * (contient un ou plusieurs childNodes correspondant chacun à une élévation retournée) + * + * @param {DOMElement} root - racine de la réponse XML + * @static + * @memberof AltiResponseReader + * @returns {Object} Retourne un objet de type AltiResponse + */ + elevations : function (root) { + // INFO : on passe en paramètre l'objet en entrée elevations, vide, à remplir. + var altiResponse = new _Response_model_AltiResponse__WEBPACK_IMPORTED_MODULE_0__["default"](); + + if (root.hasChildNodes()) { + var children = root.childNodes; + var child; + var elevation; + + for (var i = 0; i < children.length; i++) { + child = children[i]; + + if (AltiResponseReader.READERS[child.nodeName]) { + elevation = AltiResponseReader.READERS[child.nodeName](child); + altiResponse.elevations.push(elevation); + } + } + } + + return altiResponse; + }, + + /** + * Lecture d'un noeud "elevation" de la réponse xml du service alti. + * (contient un ou 5 childNode (s) correspondant à l'altitude (z) et éventuellement lat, lon, acc et measures) + * + * @param {DOMElement} node - noeud elevation à lire pour récupérer les informations de l'élévation retournée (z [, lon, lat, acc, measures]) + * @return {Array} elevationResponse - format de la réponse en sortie, instance de AltiResponse + * @static + * @memberof AltiResponseReader + */ + elevation : function (node) { + var elevation = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__["default"](); + + if (node.hasChildNodes()) { + var children = node.childNodes; + var child; + for (var i = 0; i < children.length; i++) { + child = children[i]; + if (AltiResponseReader.READERS[child.nodeName]) { + // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir. + AltiResponseReader.READERS[child.nodeName](child, elevation); + } + } + } + return elevation; + }, + + /** + * Lecture d'un noeud "lat" de la réponse xml du service alti. + * (contient une valeur de latitude, qui est un flottant) + * + * @param {DOMElement} node - noeud à lire pour récupérer la latitude + * @param {Object} elevation - objet dans lequel stocker la latitude retournée + * @static + * @memberof AltiResponseReader + */ + lat : function (node, elevation) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + elevation.lat = parseFloat(textNode.nodeValue); + } else { + throw new Error("Erreur dans la lecture de la réponse du service : latitude attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "lon" de la réponse xml du service alti. + * (contient une valeur de longitude, qui est un flottant) + * + * @param {DOMElement} node - noeud à lire pour récupérer la longitude + * @param {Object} elevation - objet dans lequel stocker la longitude retournée + * @static + * @memberof AltiResponseReader + */ + lon : function (node, elevation) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + elevation.lon = parseFloat(textNode.nodeValue); + } else { + throw new Error("Erreur dans la lecture de la réponse du service : longitude attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "z" de la réponse xml du service alti. + * (contient une valeur d'altitude, qui est un flottant) + * + * @param {DOMElement} node - noeud à lire pour récupérer l'altitude + * @param {Object} elevationObject - objet dans lequel stocker l'altitude retournée : elevation ou measure + * @static + * @memberof AltiResponseReader + */ + z : function (node, elevationObject) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + if (elevationObject) { + elevationObject.z = parseFloat(textNode.nodeValue); + } else { + elevationObject = new _Response_model_Elevation__WEBPACK_IMPORTED_MODULE_1__["default"](); + elevationObject.z = parseFloat(textNode.nodeValue); + return elevationObject; + } + } else { + throw new Error("Erreur dans la lecture de la réponse du service : altitude attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "acc" de la réponse xml du service alti. + * (contient une valeur de précision, qui est un flottant) + * + * @param {DOMElement} node - noeud à lire pour récupérer la précision + * @param {Object} elevationObject - objet dans lequel stocker la précision retournée : elevation ou measure + * @static + * @memberof AltiResponseReader + */ + acc : function (node, elevationObject) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + elevationObject.acc = parseFloat(textNode.nodeValue); + } else { + throw new Error("Erreur dans la lecture de la réponse du service : précision (acc) attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "source_name" de la réponse xml du service alti. + * (contient le nom de la source, qui est un string) + * + * @param {DOMElement} node - noeud à lire pour récupérer la précision + * @param {Object} measure - objet dans lequel stocker le nom de la source retourné + * @static + * @memberof AltiResponseReader + */ + source_name : function (node, measure) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + measure.source_name = textNode.nodeValue; + } else { + throw new Error("Erreur dans la lecture de la réponse du service : source_name attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "source_measure" de la réponse xml du service alti. + * (contient le nom de la mesure, qui est un string) + * + * @param {DOMElement} node - noeud à lire pour récupérer la précision + * @param {Object} measure - objet dans lequel stocker le nom de la source retourné + * @static + * @memberof AltiResponseReader + */ + source_measure : function (node, measure) { + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + measure.source_measure = textNode.nodeValue; + } else { + throw new Error("Erreur dans la lecture de la réponse du service : source_measure attendue mais absente"); + } + }, + + /** + * Lecture d'un noeud "measures" et de ses enfants "measure" de la réponse xml du service alti. + * (contient une valeur de précision, qui est un flottant) + * + * @param {DOMElement} node - noeud à lire pour récupérer la précision + * @param {Object} elevation - objet dans lequel stocker la précision retournée + * @static + * @memberof AltiResponseReader + */ + measures : function (node, elevation) { + elevation.measures = []; + var measure; + if (node.hasChildNodes()) { + var children = node.childNodes; + var measureNode; + var measureChildren; + for (var i = 0; i < children.length; i++) { + measure = new _Response_model_Measure__WEBPACK_IMPORTED_MODULE_2__["default"](); + measureNode = children[i]; + measureChildren = measureNode.childNodes; + for (var j = 0; j < measureChildren.length; j++) { + if (AltiResponseReader.READERS[measureChildren[j].nodeName]) { + // INFO : on passe en paramètre l'objet en entrée elevation, vide, à remplir. + AltiResponseReader.READERS[measureChildren[j].nodeName](measureChildren[j], measure); + } else { + throw new Error("Erreur dans la lecture de la réponse du service : measures attendues mais absentes"); + } + } + elevation.measures.push(measure); + } + } + }, + + /** + * Lecture d'un noeud "ExceptionReport" de la réponse xml du service alti. + * + * @param {DOMElement} node - noeud à lire pour récupérer l'exception + * @return {Object} exceptionReport - objet contenant l'exception + * @static + * @memberof AltiResponseReader + */ + exceptionreport : function (node) { + var response = {}; + + if (node.hasChildNodes()) { + var children = node.childNodes; + var child; + for (var i = 0; i < children.length; i++) { + child = children[i]; + if (child.nodeName === "Exception") { + response.exceptionReport = AltiResponseReader.READERS.exception(child); + } + } + } + + return response; + }, + + /** + * Lecture d'un noeud "Exception" de la réponse xml du service alti. + * + * @param {DOMElement} node - noeud à lire pour récupérer l'exception + * @return {Object} exceptionReport - objet contenant l'exception, avec deux attributs : + * {String} exceptionReport.exceptionCode - qui contient l'identifiant du code de l'exception + * {String} exceptionReport.exception - qui contient le message de l'exception + * @static + * @memberof AltiResponseReader + */ + exception : function (node) { + var exceptionReport = {}; + + // get exception code + var exceptionCode = node.getAttribute("exceptionCode"); + if (exceptionCode) { + exceptionReport.exceptionCode = exceptionCode; + } + + // get exception message + var textNode = node.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + exceptionReport.exception = textNode.nodeValue; + } + + return exceptionReport; + }, + + /** + * Lecture d'un noeud "Error" de la réponse xml du service alti. + * + * @param {DOMElement} node - noeud à lire pour récupérer l'exception + * @return {Object} error - objet contenant l'exception + * @static + */ + error : function (node) { + var response = { + error : {} + }; + // get error code and description + if (node.hasChildNodes()) { + var children = node.childNodes; + var child; + for (var i = 0; i < children.length; i++) { + child = children[i]; + var textNode; + // get error code + if (child.nodeType === 1 && child.nodeName === "code") { // 1 === node.ELEMENT_NODE + textNode = child.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + response.error.code = textNode.nodeValue; + } + } + // get error description + if (child.nodeType === 1 && child.nodeName === "description") { // 1 === node.ELEMENT_NODE + textNode = child.firstChild; + if (textNode && textNode.nodeType === 3) { // 3 === node.TEXT_NODE + response.error.description = textNode.nodeValue; + } + } + } + } + return response; + } + +}; + +/** + * Méthode permettant de lancer la lecture d'une réponse XML du service altimétrique, + * à l'aide des readers de la classe. + * + * @method AltiResponseReader.read + * @param {DOMElement} root - racine de la réponse XML à lire + * @static + * @memberof AltiResponseReader + */ +AltiResponseReader.read = function (root) { + if (root.nodeName === "elevations") { + var altiResponse = AltiResponseReader.READERS.elevations(root); + return altiResponse; + } else if (root.nodeName === "ExceptionReport") { + var exceptionReport = AltiResponseReader.READERS.exceptionreport(root); + return exceptionReport; + } else if (root.nodeName === "error") { + var error = AltiResponseReader.READERS.error(root); + return error; + } else { + throw new Error("Erreur lors de la lecture de la réponse : elle n'est pas au format attendu."); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiResponseReader); + + +/***/ }), +/* 65 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * Response object for {@link module:Services~getAltitude Gp.Services.getAltitude ()} invocation when successful. Received as the argument of onSuccess callback function. + * + * @property {Array.} elevations - Elevations array. + * + * @namespace + * @alias Gp.Services.AltiResponse + */ +function AltiResponse () { + if (!(this instanceof AltiResponse)) { + throw new TypeError("AltiResponse constructor cannot be called as a function."); + } + + this.elevations = []; +} + +AltiResponse.prototype = { + + constructor : AltiResponse + +}; + +/* harmony default export */ __webpack_exports__["default"] = (AltiResponse); + + +/***/ }), +/* 66 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Single elevation object returned by underlying web service. Contains at least, one elevation (z). May also contain point coordinates and elevation accuracy if "zonly" parameter wasn't set to true. + * + * @property {Float} lat - Point latitude. (only if zonly=false) + * @property {Float} lon - Point longitude. (only if zonly=false) + * @property {Float} z - Point elevation. + * @property {Float} acc - Accuracy of elevation for this point. (only if zonly=false) + * + * @namespace + * @alias Gp.Services.Alti.Elevation + */ +function Elevation () { + if (!(this instanceof Elevation)) { + throw new TypeError("Elevation constructor cannot be called as a function."); + } + + this.z = null; +} + +Elevation.prototype = { + + constructor : Elevation + +}; + +/* harmony default export */ __webpack_exports__["default"] = (Elevation); + + +/***/ }), +/* 67 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Single measure object returned by underlying web service if measures = true and zonly = false + * + * @property {String} source_name - Name of the source + * @property {String} source_measure - Name of the measure + * @property {Float} z - Point elevation. + * @property {Float} acc - Accuracy of elevation for this point. (only if zonly=false) + * + * @namespace + * @alias Gp.Services.Alti.Measure + */ +function Measure () { + if (!(this instanceof Measure)) { + throw new TypeError("Measure constructor cannot be called as a function."); + } + + this.source_name = null; + this.source_measure = null; + this.z = null; + this.acc = null; +} + +Measure.prototype = { + + constructor : Measure + +}; + +/* harmony default export */ __webpack_exports__["default"] = (Measure); + + +/***/ }), +/* 68 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); +/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69); +/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(72); + + + + + + + + +/** + * @classdesc + * Appel du service de géocodage direct du Géoportail : + * envoi de la requête construite selon les paramètres en options, + * éventuellement parsing et analyse de la réponse, + * retour d'une réponse en paramètre de la fonction onSuccess. + * + * + * @constructor + * @extends {Gp.Services.CommonService} + * @alias Gp.Services.Geocode + * + * @param {Object} options - options spécifiques au service (+ les options heritées) + * + * @param {String|Object} options.query - Nom de l'adresse, du toponyme, de l'unité administrative ou de la parcelle cadastrale recherchée. + * + * @param {Object} [options.filters] - Les propriétés possibles de cet objet sont décrites ci-après. + * @param {String} [options.filters.[prop]] - Critère supplémentaire pour filtrer la recherche sous la forme + * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête. + * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés : + * "postalCode", "inseeCode", "city". + * Il permet également de filtrer les toponymes avec les propriétés : + * "postalCode", "inseeCode", "type". + * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés : + * "codeDepartement", "codeCommune", "nomCommune", "codeCommuneAbs", "codeArrondissement", "section", "numero", "feuille". + * + * @param {String} [options.index = "StreetAddress"] - Type de l'objet recherché. + * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress' + * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales. + * L'index 'location' regroupe les indexes 'StreetAddress' et 'PositionOfInterest'. + * D'autres types pourront être rajoutés selon l'évolution du service. + * Par défaut, index = 'StreetAddress'. + * + * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs. + * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité. + * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité. + * + * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir. + * Pas de valeur par défaut. + * Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20. + * + * @param {Boolean} [options.returnTrueGeometry = false] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés. + * false par défaut. + * + * + * @example + * var options = { + * apiKey : null, + * serverUrl : 'http://localhost/service/', + * proxyURL : null, + * timeOut : 10000, // ms + * rawResponse : false, // true|false + * scope : null, // this + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * // spécifique au service + * position : {lon:, lat:}, + * index : 'StreetAddress', + * query : '10 rue du pont Machin-ville' + * (...) + * }; + */ +function Geocode (options_) { + if (!(this instanceof Geocode)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("CLASS_CONSTRUCTOR", "Geocode")); + } + + /** + * Nom de la classe (heritage) + * FIXME instance ou classe ? + */ + this.CLASSNAME = "Geocode"; + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("Gp.Services.Geocode"); + this.logger.trace("[Constructeur Geocode (options)]"); + + var options = this.patchOptionConvertor(options_); + if (!options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage + /* options.serverUrl = DefaultUrlService.Geocode.newUrl(); + if (options.oldGeocodeService) { + options.serverUrl = DefaultUrlService.Geocode.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage + options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Geocode.url(); + } + + // appel du constructeur par heritage + _CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this, [options]); + + if (!options.hasOwnProperty("query")) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "query")); + } + + // ajout des options spécifiques au service + this.options.query = options.query; + + // on definit l'index par defaut + if (!options.index) { + this.options.index = options.index = "StreetAddress"; + } + + if (options.filters) { + var filter = Object.keys(options.filters); + for (var i = 0; i < filter.length; i++) { + var key = filter[i]; + // on supprime les filtres vides + if (typeof options.filters[key] === "undefined" || + (typeof options.filters[key] === "object" && Object.keys(options.filters[key]).length === 0) || + (typeof options.filters[key] === "string" && options.filters[key].length === 0) || + (Array.isArray(options.filters[key]) && options.filters[key].length === 0) + ) { + delete this.options.filters[key]; + } + } + } + + this.options.index = options.index || "StreetAddress"; + this.options.maximumResponses = options.maximumResponses || 20; +} + +/** + * @lends module:Geocode# + */ +Geocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].prototype, { + // todo + // getter/setter +}); + +/* + * Constructeur (alias) + */ +Geocode.prototype.constructor = Geocode; + +/** + * Patch pour la convertion des options vers le nouveau formalisme. + * + * @param {Object} options_ - options du service + * @return {Object} - options + */ +Geocode.prototype.patchOptionConvertor = function (options_) { + const options = options_; + + if (options.hasOwnProperty("location")) { + this.logger.warn("The parameter 'location' is deprecated"); + + if (!options.query) { + options.query = options.location; + } + delete options.location; + } + + if (options.filterOptions) { + this.logger.warn("The parameter 'filterOptions' is deprecated"); + + if (!options.filters) { + options.filters = options.filterOptions; + + if (options.filters.type) { + this.logger.warn("The parameter 'filterOptions.type' is deprecated"); + if (!options.index) { + if (Array.isArray(options.filters.type) && options.filters.type.length > 0) { + options.index = options.filters.type[0]; + } else { + options.index = options.filters.type; + } + } + delete options.filters.type; + } + + if (options.filters.bbox) { + this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"); + delete options.filters.bbox; + } + } + delete options.filterOptions; + } + + if (options.position) { + if (options.position.x) { + this.logger.warn("The parameter 'position.x' is deprecated"); + + if (!options.position.lon) { + options.position.lon = options.position.x; + } + delete options.position.x; + } + + if (options.position.y) { + this.logger.warn("The parameter 'position.y' is deprecated"); + + if (!options.position.lat) { + options.position.lat = options.position.y; + } + delete options.position.y; + } + } + + if (options.returnFreeForm) { + this.logger.warn("The parameter 'returnFreeForm' is deprecated"); + delete options.returnFreeForm; + } + + if (options.srs) { + this.logger.warn("The parameter 'srs' is deprecated"); + delete options.srs; + } + + return options; +}; + +/** + * Création de la requête (overwrite) + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +Geocode.prototype.buildRequest = function (error, success) { + var options = { + httpMethod : this.options.httpMethod, + // options specifiques du service + geocodeMethod : "search", + query : this.options.query, + index : this.options.index, + returnTrueGeometry : this.options.returnTrueGeometry, + position : this.options.position, + maxResp : this.options.maximumResponses, + filters : this.options.filters + }; + + this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); + + // on teste si la requete a bien été construite ! + (!this.request) + ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_REQUEST_BUILD"))) + : success.call(this, this.request); +}; + +/** + * Analyse de la reponse (overwrite) + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +Geocode.prototype.analyzeResponse = function (error, success) { + /* INFO : + Etape 1 : Création de la requête (URL) + -> stockage de la requête dans this.request + Etape 2 : Envoi de la requête + -> appel du protocol XHR, et envoi (par ex send ()) + -> récupération de la réponse JSON dans la fonction onSuccess () (this.response) + -> si code HTTP 200 et pas de message d'erreur : etape 3 + -> si code HTTP != 200 : lancement de la fonction de callback onFailure avec le message d'erreur + Etape 3 : Analyse de la réponse JSON (si rawResponse === false ) + -> appel du parser pour récupérer le document + Etape 4 : Lancement de la fonction de callback onSuccess avec la réponse : + -> JSON (si rawResponse === true) + -> ou geocodedLocations + */ + + if (this.response) { + var options = { + response : this.response, + rawResponse : this.options.rawResponse, + onError : error, + onSuccess : success, + scope : this + }; + + _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__["default"].build(options); + } else { + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (Geocode); + + +/***/ }), +/* 69 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _GeocodeRequestREST__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70); + + + +/** + * Creation d'une requête + * (Factory) + * + * @module GeocodeRequestFactory + * @alias Gp.Services.Geocode.Request.GeocodeRequestFactory + * @private + */ +var GeocodeRequestFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant Geocode + * + * @example + * var options = { + * // options specifiques du service + * geocodeMethod: + * query: + * filters: + * maximumResponses: + * }; + * var result = GeocodeRequestFactory.build(options); + * if (!result) { + * // error... + * } + * @returns {String} request + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("GeocodeRequestFactory"); + logger.trace(["GeocodeRequestFactory::build()"]); + + var settings = options || {}; + + var myReq = new _GeocodeRequestREST__WEBPACK_IMPORTED_MODULE_1__["default"](settings); + if (!myReq.processRequestString()) { + throw new Error("Error process request (rest) !"); + } + var request = myReq.requestString; + + logger.trace(request); + + return request; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (GeocodeRequestFactory); + + +/***/ }), +/* 70 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _model_GeocodeParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71); + + + + + +/** + * @classdesc + * Classe de gestion des requêtes de type REST sur le service de calcul d'itineraire + * (uniquement en GET) + * + * @constructor + * @alias Gp.Services.Geocode.Request.GeocodeRequestREST + * @param {Object} options - options definies dans le composant Route + * + * @example + * var options = { + * (...) + * }; + * + * @private + */ +function GeocodeRequestREST (options) { + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("GeocodeRequestREST"); + this.logger.trace("[Constructeur GeocodeRequestREST ()]"); + + if (!(this instanceof GeocodeRequestREST)) { + throw new TypeError("GeocodeRequestREST constructor cannot be called as a function."); + } + + // existance des options + if (!options) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "options")); + } + + /** liste des options */ + this.settings = options; +} + +GeocodeRequestREST.prototype = { + + /** + * @lends module:GeocodeRequestREST# + */ + + /** + * request + * @type {String} + */ + requestString : null, + + /** + * Constructeur (alias) + */ + constructor : GeocodeRequestREST, + + /** + * Construction de la requête. + * + * @returns {String} request + */ + processRequestString : function () { + var request = ""; + + // Mapping des options avec le service de l'API REST + const oParams = new _model_GeocodeParamREST__WEBPACK_IMPORTED_MODULE_2__["default"](this.settings); + + const params = oParams.getParams(); + for (var i = 0; i < params.length; i++) { + var o = params[i]; + if (request) { + request += "&"; + } + request += o.k + "=" + o.v; + } + + if (!this.settings.geocodeMethod || (this.settings.geocodeMethod !== "search" && this.settings.geocodeMethod !== "reverse")) { + throw new Error("Error geocodeMethod not valid"); + } + + this.requestString = "?" + request; + this.logger.trace(this.requestString); + + return this.requestString; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (GeocodeRequestREST); + + +/***/ }), +/* 71 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); + + + +/** + * @classdesc + * Classe de gestion des param. des requêtes du service de calcul d'itineraire (REST). + * Permet le mapping avec les options du service. + * @constructor + * @alias Gp.Services.Route.Request.RouteParamREST + * @param {Object} options - options + * + * @private + */ +function GeocodeParamREST (options) { + if (!(this instanceof GeocodeParamREST)) { + throw new TypeError("GeocodeParamREST constructor cannot be called as a function."); + } + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur GeocodeParamREST ()]"); + + /** + * Options en paramêtres du constructeur. + */ + this.options = options || {}; + + // methode de geocodage + if (!this.options.geocodeMethod || (this.options.geocodeMethod !== "search" && this.options.geocodeMethod !== "reverse")) { + throw new Error("Error geocodeMethod not valid"); + } + this.geocodeMethod = this.options.geocodeMethod; + + // mapping des options avec l'API REST + this.query = (typeof this.options !== "undefined") ? this.options.query : null; + + this.searchGeometry = this.options.searchGeometry || null; + + this.index = this.options.index || null; + + this.lon = this.options.position && this.options.position.lon ? this.options.position.lon : null; + + this.lat = this.options.position && this.options.position.lat ? this.options.position.lat : null; + + this.maxResp = this.options.maxResp || null; + + this.returnTrueGeometry = this.options.returnTrueGeometry || null; + + this.filters = this.options.filters || {}; +} + +/** + * CLASSNAME + */ +GeocodeParamREST.CLASSNAME = "GeocodeParamREST"; + +GeocodeParamREST.prototype = { + + /** + * @lends module:GeocodeParamREST# + */ + + /** + * Constructeur (alias) + */ + constructor : GeocodeParamREST, + + /** + * Retourne les filtres + * @returns {String} les filtres + */ + getFilters : function () { + var filters = {}; + for (var prop in this.filters) { + if (this.filters.hasOwnProperty(prop)) { + filters[prop] = this.filters[prop]; + } + } + return filters; + }, + + /** + * Retourne l'index + * @returns {String} l'index + */ + getIndex : function () { + if (this.index === undefined) { + return null; + } + if (this.index === "StreetAddress") { + return "address"; + } else if (this.index === "CadastralParcel") { + return "parcel"; + } else if (this.index === "PositionOfInterest") { + return "poi"; + } else if (this.index === "location") { + return "location"; + } + return this.index; + }, + + /** + * Retourne la géométrie de recherche + * @returns {String} la géométrie de recherche au format json + */ + getSearchGeometry : function () { + return JSON.stringify(this.searchGeometry); + } +}; + +/** + * Tableau de clefs/valeurs pour param. + * + * @returns {Array} liste de paramêtres + */ +GeocodeParamREST.prototype.getParams = function () { + var map = []; + + if (this.geocodeMethod === "search") { + map.push({ + k : "q", + v : this.query + }); + } + + if (this.index) { + map.push({ + k : "index", + v : this.getIndex() + }); + } + + if (this.geocodeMethod === "reverse" && this.searchGeometry) { + map.push({ + k : "searchgeom", + v : this.getSearchGeometry() + }); + } + + if (this.lon && this.lat) { + map.push({ + k : "lon", + v : this.lon + }); + map.push({ + k : "lat", + v : this.lat + }); + } + + if (this.maxResp) { + map.push({ + k : "limit", + v : this.maxResp + }); + } + + if (this.returnTrueGeometry) { + map.push({ + k : "returntruegeometry", + v : this.returnTrueGeometry + }); + } + + const filters = this.getFilters(); + for (var key in filters) { + map.push({ + k : key, + v : filters[key] + }); + } + + return map; +}; + +/* harmony default export */ __webpack_exports__["default"] = (GeocodeParamREST); + + +/***/ }), +/* 72 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Formats_GeocodeResponseParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73); +/** + * Factory pour générer une reponse JSON à partir d'un XML + * (Factory) + * + * @module GeocodeResponseFactory + * @alias Gp.Services.Geocode.Response.GeocodeResponseFactory + * @private + */ +// import Logger from "../../../Utils/LoggerByDefault"; + + + + +var GeocodeReponseFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant Geocode + * + * @example + * var options = { + * response : + * rawResponse : + * scope : + * onSuccess : + * onError : + * }; + * + */ + build : function (options) { + // data de type GeocodeResponse + var data = null; + + if (options.response) { + if (options.rawResponse) { + data = options.response; + } else { + try { + const parser = new _Formats_GeocodeResponseParser__WEBPACK_IMPORTED_MODULE_2__["default"](); + data = parser.parse(options.response); + + if (!data) { + throw new Error("L'analyse de la réponse du service !?"); + } + } catch (e) { + var message = e.message; + if (typeof options.response === "string") { + message += "('" + options.response + "')"; + } else { + message += "('" + options.response.documentElement.innerHTML + "')"; + } + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_ANALYSE", message), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__["default"].TYPE_UNKERR, + status : -1 + })); + return; + } + + // Si la réponse contenait une exception renvoyée par le service + if (data.exceptionReport) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", data.exceptionReport), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__["default"].TYPE_SRVERR, + status : 200 // FIXME : 200 ? + })); + return; + } + } + } else { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_0__["default"].TYPE_SRVERR, + status : -1 // FIXME : status response + })); + return; + } + + options.onSuccess.call(options.scope, data); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (GeocodeReponseFactory); + + +/***/ }), +/* 73 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50); +/* harmony import */ var _Response_model_GeocodeResponse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74); +/* harmony import */ var _Response_model_GeocodedLocation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75); +// import Logger from "../../../Utils/LoggerByDefault"; + + + + + +/** + * Fonction retournant un objet contenant des clés de lecture (readers) + * qui permettent de parser des réponses XML du service de géocodage direct du Géoportail + * afin de récupérer les résultats retournés. + * @module GeocodeResponseParser + * @alias Gp.Services.Geocode.Formats.GeocodeResponseParser + * @private + */ + +/** + * @classdesc + * + * Classe permettant de parser une réponse GeoJSON + * + * @constructor + * @alias Gp.Formats.GeocodeResponseParser + * + * @private + */ +function GeocodeResponseParser () { + if (!(this instanceof GeocodeResponseParser)) { + throw new TypeError("GeocodeResponseParser constructor cannot be called as a function."); + } +} + +GeocodeResponseParser.prototype = { + + /** + * @lends module:GeocodeResponseParser + */ + + /* + * Constructeur (alias) + */ + constructor : GeocodeResponseParser, + + /** + * Méthode permettant de lancer la lecture d'une réponse GeoJSON, + * + * @param {String} json - réponse au format GeoJSON + * @return {Object} geocodeResponse|exceptionReport : l'objet contenant les informations de la réponse GeoJSON, + * sous la forme d'un objet GeocodeResponse, ou un objet littéral exceptionReport si le service a renvoyé une exception. + */ + parse : function (json) { + var geocodeResponse = new _Response_model_GeocodeResponse__WEBPACK_IMPORTED_MODULE_2__["default"](); + + const obj = JSON.parse(json); + + if (obj.type === "FeatureCollection") { + for (var i = 0; i < obj.features.length; ++i) { + _parseFeature(obj.features[i], geocodeResponse); + } + } else if (obj.type === "Feature") { + _parseFeature(obj, geocodeResponse); + } else if (obj.type === "SERVICE_ERROR") { + return _parseError(obj); + } else { + var mess = _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_0__["default"].getMessage("SERVICE_RESPONSE_ANALYSE", obj.type); + throw new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__["default"]({ + message : mess, + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__["default"].TYPE_UNKERR, + status : 200 + }); + } + + return geocodeResponse; + } +}; + +/** + * Méthode permettant de parser un feature + * + * @private + * + * @param {Object} feature + * @param {Object} geocodeResponse + * + * @memberof GeocodeResponseParser + * @return {Object} objet GeocodedLocation + */ +function _parseFeature (feature, geocodeResponse) { + var location = new _Response_model_GeocodedLocation__WEBPACK_IMPORTED_MODULE_3__["default"](); + if (feature.geometry && feature.geometry.type === "Point") { + location.position = { + lon : feature.geometry.coordinates[0], + lat : feature.geometry.coordinates[1] + }; + } + if (feature.properties) { + for (var prop in feature.properties) { + if (prop === "_score") { + location.accuracy = feature.properties[prop]; + } else if (prop === "_type") { + if (feature.properties[prop] === "address") { + location.type = "StreetAddress"; + } else if (feature.properties[prop] === "poi") { + location.type = "PositionOfInterest"; + } else if (feature.properties[prop] === "parcel") { + location.type = "CadastralParcel"; + } + } else { + location.placeAttributes[prop] = feature.properties[prop]; + } + } + if (feature.properties._type === "address") { + location.matchType = feature.properties.number !== undefined && feature.properties.number !== null ? "street number" : "street"; + } + } + geocodeResponse.locations.push(location); +} + +/** + * Méthode permettant de parser une erreur + * + * @private + * + * @param {Object} error + * + * @memberof GeocodeResponseParser + * @return {Object} + */ +function _parseError (error) { + return { + exceptionReport : error + }; +} + +/* harmony default export */ __webpack_exports__["default"] = (GeocodeResponseParser); + + +/***/ }), +/* 74 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Response object for {@link module:Services~geocode Gp.Services.geocode ()} or {@link module:Services~reverseGeocode Gp.Services.reverseGeocode ()} invocation when successful. Received as the argument of onSuccess callback function. + * + * @property {Array.} locations - locations array. + * + * @namespace + * @alias Gp.Services.GeocodeResponse + */ +function GeocodeResponse () { + if (!(this instanceof GeocodeResponse)) { + throw new TypeError("GeocodeResponse constructor cannot be called as a function."); + } + + this.locations = []; +} + +GeocodeResponse.prototype = { + + constructor : GeocodeResponse + +}; + +/* harmony default export */ __webpack_exports__["default"] = (GeocodeResponse); + + +/***/ }), +/* 75 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Single location object returned by the underlying geocoding web service. + * + * @property {Gp.Point} position - Position of the location given in the requested coordinates system. + * @property {String} type - location type "StreetAddress" (for an address), "PositionOfInterest" (for a place name) or "CadastralParcel" (for cadastral parcel). + * @property {String} matchType - how geocoding is performed : "street number" (exact address), "street enhanced" (street number calculated by interpolation), "street" (only the street), "city" (only the city). + * @property {Float} accuracy - Accuracy of the response towards the requested location between 0 (unaccurate) and 1 (exact match). + * @property {Object} placeAttributes - Associative array matching the following attributes with their values given by the underlying web service : + * + * *Common attributes : * + * + * - **trueGeometry** - the 'real life' geometry if different from 'Point' type. + * + * *if type === "StreetAddress" :* + * + * - **number** - Street number. + * - **postalCode** - PostCode + * - **street** - Street name + * - **city** - City + * - **houseNumberInfos** - additional street number information + * - **inseeCode** - INSEE Code + * + * + * *if type === "PositionOfInterest" :* + * + * - **type** - Place name type + * - **postalCode** - PostCode + * - **toponyme** - Toponyme + * - **extraFields** - additional place name properties + * - **inseeCode** - INSEE Code + * + * + * *si type = "CadastralParcel" :* + * + * - **codeCommuneAbs** - when a parcel comes from a city that was absorbed by another, code of that old city. "000" otherwise. + * - **codeArrondissement** - arrondissement + * - **identifiant** - cadastral parcel code + * - **feuille** - Parcel Sheet (eg. "1"). + * - **numero** - Parcel Number (eg. "0041") + * - **section** - Parcel Section (eg. "0D"). + * - **nomCommune** - Parcel municipality name. + * - **codeCommune** - Parcel municipality. + * - **codeDepartement** - Parcel Department. + * + * @namespace + * @alias Gp.Services.Geocode.GeocodedLocation + */ +function GeocodedLocation () { + if (!(this instanceof GeocodedLocation)) { + throw new TypeError("GeocodedLocation constructor cannot be called as a function."); + } + + this.position = null; + + this.matchType = null; + + this.placeAttributes = {}; + + this.type = null; + + this.accuracy = null; + + /** + * Nom de la classe : "GeocodedLocation" + * @type {String} + */ + this.CLASSNAME = "GeocodedLocation"; +} + +GeocodedLocation.prototype = { + + constructor : GeocodedLocation + +}; + +/* harmony default export */ __webpack_exports__["default"] = (GeocodedLocation); + + +/***/ }), +/* 76 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); +/* harmony import */ var _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69); +/* harmony import */ var _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(72); + + + + + + + + +/** + * @classdesc + * Appel du service de géocodage inverse du Géoportail : + * envoi de la requête construite selon les paramètres en options, + * éventuellement parsing et analyse de la réponse, + * retour d'une réponse en paramètre de la fonction onSuccess. + * @constructor + * @extends {Gp.Services.CommonService} + * @alias Gp.Services.ReverseGeocode + * + * @param {Object} options - options spécifiques au service (+ les options heritées) + * + * @param {Object} options.position - Position du point de référence pour le calcul de proximité exprimée dans le système de référence spécifié par le srs. + * @param {Float} options.position.lon - Longitude du point de référence pour le calcul de proximité. + * @param {Float} options.position.lat - Latitude du point de référence pour le calcul de proximité. + * + * @param {Object} [options.filters] - Les propriétés possibles de cet objet. + * @param {String} [options.filters.[proprietes du filtre]] - Critère supplémentaire pour filtrer la recherche sous la forme + * d'un couple clé/valeur à définir selon les possibilités du serveur ajouté à la requête. + * Le service de géocodage du Géoportail permet de filtrer les adresses postales avec les propriétés : + * "postalCode", "inseeCode", "city". + * Il permet également de filtrer les toponymes avec les propriétés : + * "postalCode", "inseeCode", "type". + * Enfin, il permet de filtrer les parcelles cadastrales avec les propriétés : + * "codeDepartement", "codeCommune", "nomCommune", "codeCommuneAbs", "codeArrondissement", "section", "numero", "feuille". + * + * @param {Object} [options.searchGeometry] - Emprise dans laquelle on souhaite effectuer la recherche. + * Les propriétés possibles de cet objet sont décrites ci-après. + * @param {String} options.searchGeometry.type - Type de géometrie (Point|Circle|Linestring|Polygon) + * @param {Array.|Array.Array.} options.searchGeometry.coordinates - Coordonnées des points constituant la géométrie. + * @param {Float} options.searchGeometry.radius - Rayon. Paramètre applicable uniquement pour le type 'Circle'. + * + * @param {String} [options.index = "StreetAddress"] - Type de l'objet recherché. + * Le service de géocodage du Géoportail permet de rechercher des 'PositionOfInterest' pour des toponymes, des 'StreetAddress' + * pour des adresses postales ou des 'CadastralParcel' pour des parcelles cadastrales. L'index 'location' permet une recherche + * multi-indexes en regroupant les indexes 'PositionOfInterest' et 'StreetAddress'. + * D'autres types pourront être rajoutés selon l'évolution du service. + * Par défaut, index = 'StreetAddress'. + * + * @param {Number} [options.maximumResponses] - Nombre de réponses maximal que l'on souhaite recevoir. + * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 20s. + * + * @param {Boolean} [options.returnTrueGeometry] - Booléen indiquant si l'on souhaite récupérer la géométrie vraie des objects géolocalisés. + * false par défaut. + * + * @example + * var options = { + * apiKey : null, + * serverUrl : 'http://localhost/service/', + * proxyURL : null, + * timeOut : 10000, // ms + * rawResponse : false, // true|false + * scope : null, // this + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * // spécifique au service + * index : 'StreetAddress', + * searchGeometry : { + * type : Circle, + * coordinates : [48, 2], + * radius : 100 + * }, + * position : {lon:2 , lat:48.5}, + * maximumResponses : 25, + * }; + * + */ +function ReverseGeocode (options_) { + if (!(this instanceof ReverseGeocode)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("CLASS_CONSTRUCTOR", "ReverseGeocode")); + } + + /** + * Nom de la classe (heritage) + * FIXME instance ou classe ? + */ + this.CLASSNAME = "ReverseGeocode"; + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("Gp.Services.ReverseGeocode"); + this.logger.trace("[Constructeur ReverseGeocode (options)]"); + + var options = this.patchOptionConvertor(options_); + if (!options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse + /* options.serverUrl = DefaultUrlService.ReverseGeocode.newUrl(); + if (options.oldReverseService) { + options.serverUrl = DefaultUrlService.ReverseGeocode.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service de geocodage inverse + options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].ReverseGeocode.url(); + } + + // appel du constructeur par heritage + _CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this, [options]); + + if (!options.searchGeometry) { + if (!options.position) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "searchGeometry")); + } + } else { + this.options.searchGeometry = options.searchGeometry; + } + + // on definit l'index par defaut + if (!options.index) { + this.options.index = options.index = "StreetAddress"; + } + + if (options.filters) { + var filter = Object.keys(options.filters); + for (var i = 0; i < filter.length; i++) { + var key = filter[i]; + // on supprime les filtres vides + if (typeof options.filters[key] === "undefined" || + (typeof options.filters[key] === "object" && Object.keys(options.filters[key]).length === 0) || + (typeof options.filters[key] === "string" && options.filters[key].length === 0) || + (Array.isArray(options.filters[key]) && options.filters[key].length === 0) + ) { + delete this.options.filters[key]; + } + } + } + + this.options.position = options.position; + this.options.index = options.index || "StreetAddress"; + this.options.maximumResponses = options.maximumResponses || 20; +} + +/** + * @lends module:ReverseGeocode# + */ +ReverseGeocode.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].prototype, { + // todo + // getter/setter +}); + +/* + * Constructeur (alias) + */ +ReverseGeocode.prototype.constructor = ReverseGeocode; + +/** + * Patch pour la convertion des options vers le nouveau formalisme. + * + * @param {Object} options_ - options du service + * @return {Object} - options + */ +ReverseGeocode.prototype.patchOptionConvertor = function (options_) { + var options = options_; + + if (options.filterOptions) { + this.logger.warn("The parameter 'filterOptions' is deprecated"); + + if (options.filterOptions.type) { + this.logger.warn("The parameter 'filterOptions.type' is deprecated"); + if (!options.index) { + if (Array.isArray(options.filterOptions.type) && options.filterOptions.type.length > 0) { + options.index = options.filterOptions.type[0]; + } else { + options.index = options.filterOptions.type; + } + } + delete options.filterOptions.type; + } + + if (options.filterOptions.bbox) { + this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"); + if (!options.searchGeometry) { + // convertir la geometrie + options.searchGeometry = this.bbox2Json(options.filterOptions.bbox); + } + delete options.filterOptions.bbox; + } + + if (options.filterOptions.circle) { + this.logger.warn("The parameter 'filterOptions.circle' is deprecated"); + if (!options.searchGeometry) { + // convertir la geometrie + options.searchGeometry = this.circle2Json(options.filterOptions.circle); + } + delete options.filterOptions.circle; + } + + if (options.filterOptions.polygon) { + this.logger.warn("The parameter 'filterOptions.polygon' is deprecated"); + if (!options.searchGeometry) { + // convertir la geometrie + options.searchGeometry = this.polygon2Json(options.filterOptions.polygon); + } + delete options.filterOptions.polygon; + } + + if (!options.filters && Object.keys(options.filterOptions).length > 0) { + options.filters = options.filterOptions; + } + + delete options.filterOptions; + } + + if (options.position) { + if (options.position.x) { + this.logger.warn("The parameter 'position.x' is deprecated"); + + if (!options.position.lon) { + options.position.lon = options.position.x; + } + delete options.position.x; + } + + if (options.position.y) { + this.logger.warn("The parameter 'position.y' is deprecated"); + + if (!options.position.lat) { + options.position.lat = options.position.y; + } + delete options.position.y; + } + } + + if (options.srs) { + this.logger.warn("The parameter 'srs' is deprecated"); + delete options.srs; + } + + return options; +}; + +/** + * (overwrite) + * Création de la requête + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +ReverseGeocode.prototype.buildRequest = function (error, success) { + var options = { + httpMethod : this.options.httpMethod, + // options specifiques du service + geocodeMethod : "reverse", + searchGeometry : this.options.searchGeometry, + index : this.options.index, + position : this.options.position, + returnTrueGeometry : this.options.returnTrueGeometry, + maxResp : this.options.maximumResponses, + filters : this.options.filters + }; + + this.request = _Request_GeocodeRequestFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); + + // on teste si la requete a bien été construite ! + (!this.request) + ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_REQUEST_BUILD"))) + : success.call(this, this.request); +}; + +/** + * (overwrite) + * Analyse de la reponse + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +ReverseGeocode.prototype.analyzeResponse = function (error, success) { + if (this.response) { + var options = { + response : this.response, + rawResponse : this.options.rawResponse, + onError : error, + onSuccess : success, + scope : this + }; + + _Response_GeocodeResponseFactory__WEBPACK_IMPORTED_MODULE_6__["default"].build(options); + } else { + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + } +}; + +/** + * Patch pour la convertion des options vers le nouveau formalisme. + * + * @param {Array} bbox - bbox + * @return {Object} - geometrie au format json + */ +ReverseGeocode.prototype.bbox2Json = function (bbox) { + return { + type : "Polygon", + coordinates : [[ + [bbox.left, bbox.top], + [bbox.right, bbox.top], + [bbox.right, bbox.bottom], + [bbox.left, bbox.bottom], + [bbox.left, bbox.top] + ]] + }; +}; + +/** + * Patch pour la convertion des options vers le nouveau formalisme. + * + * @param {Object} circle - circle + * @return {Object} - geometrie au format json + */ +ReverseGeocode.prototype.circle2Json = function (circle) { + return { + type : "Circle", + radius : circle.radius, + coordinates : [circle.x, circle.y] + }; +}; + +/** + * Patch pour la convertion des options vers le nouveau formalisme. + * + * @param {Array} polygon - polygon + * @return {Object} - geometrie au format json + */ +ReverseGeocode.prototype.polygon2Json = function (polygon) { + var jsonGeom = { + type : "Polygon", + coordinates : [[]] + }; + + for (var i = 0; i < polygon.length; ++i) { + jsonGeom.coordinates[0].push([polygon[i].x, polygon[i].y]); + } + + return jsonGeom; +}; + +/** + * Codes EPSG géographiques (lat/lon). Utiles car les coordonnées doivent être inversées. + */ +ReverseGeocode.geoEPSG = ["EPSG:4326"]; + +/* harmony default export */ __webpack_exports__["default"] = (ReverseGeocode); + + +/***/ }), +/* 77 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); +/* harmony import */ var _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(40); +/* harmony import */ var _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50); + + + + + + + + +/** + * @classdesc + * Appel du service d'autocomplétion du Géoportail : + * envoi de la requête construite selon les paramètres en options, + * éventuellement parsing et analyse de la réponse, + * retour d'une réponse en paramètre de la fonction onSuccess. + * @constructor + * @extends {Gp.Services.CommonService} + * @alias Gp.Services.AutoComplete + * + * @param {Object} options - options spécifiques au service (+ les options heritées) + * + * @param {String} options.text - La chaîne de caractère à compléter. + * Cette chaîne n'est pas "URL encodée". + * C'est l'API qui s'occupe de l'encoder pour l'inclure dans la requête. + * + * @param {Array.} [options.type = ["StreetAddress"]] - Type de l'objet recherché. + * Le service d'autocomplétion du Géoportail permet de rechercher des toponymes 'PositionOfInterest' et/ou des adresses postales 'StreetAddress'. + * D'autres types pourront être rajoutés selon l'évolution du service. + * Par défaut, type = ['StreetAddress']. + * + * @param {String} [options.territory] - Limitation de la zone de recherche de localisants. + * Le service d'autocomplétion du Géoportail permet de limiter la recherche à la métropole et la Corse : options.territory = 'METROPOLE', + * DOMS TOMS : options.territory = 'DOMTOM', ou à un département : options.territory = '31' + * Pas de valeur par défaut. + * La valeur par défaut est donc celle du service. + * Le service d'autocomplétion du Géoportail renvoie toutes les informations quand aucun territoire n'est spécifié. + * + * @param {Number} [options.maximumResponses = 10] - Nombre de réponses maximal que l'on souhaite recevoir. + * Pas de valeur par défaut. + * La valeur par défaut sera donc celle du service : 10. + * + * @example + * var options = { + * // options communes aux services + * apiKey : null, + * serverUrl : 'http://localhost/service/', + * protocol : 'JSONP', // JSONP|XHR + * proxyURL : null, + * httpMethod : 'GET', // GET|POST + * timeOut : 10000, // ms + * rawResponse : false, // true|false + * scope : null, // this + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * // spécifique au service + * text : "", + * type : "StreetAddress", + * territory : 'METROPOLE', + * maximumResponses : 10 + * }; + */ +function AutoComplete (options_) { + if (!(this instanceof AutoComplete)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("CLASS_CONSTRUCTOR", "AutoComplete")); + } + + /** + * Nom de la classe (heritage) + * FIXME instance ou classe ? + */ + this.CLASSNAME = "AutoComplete"; + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__["default"].getLogger("Gp.Services.AutoComplete"); + this.logger.trace("[Constructeur AutoComplete (options)]"); + + var options = this.patchOptionConvertor(options_); + + if (!options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocomplétion + /* options.serverUrl = DefaultUrlService.AutoComplete.newUrl(); + if (options.oldAutocompleteService) { + options.serverUrl = DefaultUrlService.AutoComplete.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'autocompletion + options.serverUrl = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_1__["default"].AutoComplete.url(); + } + + // appel du constructeur par heritage + _CommonService__WEBPACK_IMPORTED_MODULE_0__["default"].apply(this, arguments); + + if (!options.text) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("PARAM_MISSING", "text")); + } + + // ajout des options spécifiques au service + this.options.text = options.text; + + // on definit des parametres par defaut + if (!options.type) { + options.type = ["StreetAddress,PositionOfInterest"]; + } + + this.options.type = options.type; + this.options.territory = options.territory || ""; + this.options.maximumResponses = options.maximumResponses || 10; + + // INFO + // le service ne repond pas en mode POST (405 Method Not Allowed) + if (this.options.protocol === "XHR" && this.options.httpMethod === "POST") { + this.logger.warn("Le service ne gére pas le mode d'interrogation en POST, on bascule sur du GET !"); + this.options.httpMethod = "GET"; // on surcharge ! + } + + // attributs d'instances + + /** + * Format forcé de la réponse du service : "json" + * sauf si l'on souhaite une reponse brute (options.rawResponse) + */ + this.options.outputFormat = (this.options.rawResponse) ? "" : "json"; +} + +/** + * @lends module:AutoComplete# + */ + +AutoComplete.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, { + // todo + // getter/setter +}); + +/* + * Constructeur (alias) + */ +AutoComplete.prototype.constructor = AutoComplete; + +/** + * Patch pour la convertion des options vers le nouveau formalisme. + * + * @param {Object} options_ - options du service + * @return {Object} - options + */ +AutoComplete.prototype.patchOptionConvertor = function (options_) { + const options = options_; + + if (options.filterOptions) { + this.logger.warn("The parameter 'filterOptions' is deprecated"); + + if (options.filterOptions.type) { + this.logger.warn("The parameter 'filterOptions.type' is deprecated"); + if (!options.type) { + options.type = options.filterOptions.type; + } + } + + if (options.filterOptions.territory) { + this.logger.warn("The parameter 'filterOptions.territory' is deprecated"); + if (!options.terr) { + options.terr = options.filterOptions.territory; + } + } + + delete options.filterOptions; + } + + return options; +}; + +/** + * (overwrite) + * Création de la requête + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +AutoComplete.prototype.buildRequest = function (error, success) { + // ex. + // http://wxs.ign.fr/CLEF/ols/apis/completion? + // text=Brie-Comt& + // type=StreetAddress,PositionOfInterest& + // territory=METROPOLE& + // maximumResponses=10 + + // traitement des param KPV sous forme de tableau + var territory = ""; + if (this.options.territory) { + territory = this.options.territory; + } + + var type = ""; + if (this.options.type) { + type = this.options.type.join(","); + } + + // normalisation de la requete avec param KPV + this.request = _Utils_Helper__WEBPACK_IMPORTED_MODULE_5__["default"].normalyzeParameters({ + text : encodeURIComponent(this.options.text), + type : type, + terr : territory, + maximumResponses : this.options.maximumResponses + }); + + (!this.request) + ? error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("SERVICE_REQUEST_BUILD"))) + : success.call(this, this.request); +}; + +/** + * (overwrite) + * Analyse de la reponse + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback de succès de l'analyse de la réponse + */ +AutoComplete.prototype.analyzeResponse = function (error, success) { + if (this.response) { + var options = { + response : this.response, + rawResponse : this.options.rawResponse, + onSuccess : success, + onError : error, + scope : this + }; + + _Response_AutoCompleteResponseFactory__WEBPACK_IMPORTED_MODULE_2__["default"].build(options); + } else { + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_6__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_4__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (AutoComplete); + + +/***/ }), +/* 78 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79); +/* harmony import */ var _model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80); +/** + * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON + * (Factory) + * + * @module AutoCompleteResponseFactory + * @private + * @alias Gp.Services.AutoComplete.Response.AutoCompleteResponseFactory + */ + + + + + + +var AutoCompleteResponseFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant Alti + * + * @example + * var options = { + * response : + * outputFormat : + * rawResponse : + * scope : + * onSuccess : + * onError : + * }; + * + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("AutoCompleteResponseFactory"); + logger.trace(["AutoCompleteResponseFactory::build()"]); + + var data = null; + + if (options.response) { + if (options.rawResponse) { + logger.trace("analyze response : raw"); + data = options.response; + } else { + var JSONResponse = null; + if (typeof options.response === "string") { + JSONResponse = JSON.parse(options.response); + } else { + JSONResponse = options.response; + } + + // analyse de la réponse + if (JSONResponse) { + // le service renvoie t il une erreur ? + if (JSONResponse.error) { + // ex. ? + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", JSONResponse.error.description), + status : JSONResponse.error.code, + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_SRVERR + })); + return; + } + + // création de l'objet réponse + data = new _model_AutoCompleteResponse__WEBPACK_IMPORTED_MODULE_3__["default"](); + + // boucle sur les résultats de l'autocomplétion + if (JSONResponse.results && Array.isArray(JSONResponse.results)) { + var suggestedLocation = null; + + for (var i = 0; i < JSONResponse.results.length; i++) { + var result = JSONResponse.results[i]; + suggestedLocation = new _model_SuggestedLocation__WEBPACK_IMPORTED_MODULE_4__["default"](); + + if (result) { + if (result.country === "StreetAddress") { + suggestedLocation.street = result.street; + suggestedLocation.type = "StreetAddress"; + } else if (result.country === "PositionOfInterest") { + suggestedLocation.poi = result.street; + suggestedLocation.kind = result.kind; + suggestedLocation.type = "PositionOfInterest"; + } + + if (suggestedLocation.position) { + suggestedLocation.position.x = result.x; + suggestedLocation.position.y = result.y; + } + + suggestedLocation.commune = result.city; + suggestedLocation.fullText = result.fulltext; + suggestedLocation.postalCode = result.zipcode; + suggestedLocation.classification = result.classification; + } + // Ajout du résultat au tableau reverseGeocodedLocations de geocodedLocation + data.suggestedLocations.push(suggestedLocation); + } + } else { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_FORMAT_3"))); + return; + } + + if (!data.suggestedLocations.length) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_FORMAT_3"))); + return; + } + } + + if (!data) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_ANALYSE_2"), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_UNKERR, + status : -1 + })); + return; + } + + // Si la réponse contenait une exception renvoyée par le service + if (data.exceptionReport) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", data.exceptionReport), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_SRVERR, + status : 200 + })); + return; + } + } + } else { + // si la réponse (xmlString) est vide, on appelle le callback d'erreur + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + return; + } + + // si tout s'est bien passé, on appelle le callback de succès + options.onSuccess.call(options.scope, data); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (AutoCompleteResponseFactory); + + +/***/ }), +/* 79 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * Response object for {@link module:Services~autoComplete Gp.Services.autoComplete ()} invocation when successful. Received as the argument of onSuccess callback function. + * + * @property {Array.} suggestedLocations - SuggestedLocations array. + * + * @namespace + * @alias Gp.Services.AutoCompleteResponse + */ +function AutoCompleteResponse () { + if (!(this instanceof AutoCompleteResponse)) { + throw new TypeError("AutoCompleteResponse constructor cannot be called as a function."); + } + + this.suggestedLocations = []; +} + +AutoCompleteResponse.prototype = { + + constructor : AutoCompleteResponse + +}; + +/* harmony default export */ __webpack_exports__["default"] = (AutoCompleteResponse); + + +/***/ }), +/* 80 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Single SuggestedLocation Object returned by underlying web service. + * Each suggested location represents a street address ("StreetAddress") or a place name ("PositionOfInterest"). + * + * @property {String} type - Suggested location type : "StreetAddress" ou "PositionOfInterest" + * @property {Gp.Point} position - Position of the suggested location given in requested coordinates system. + * @property {String} commune - Suggested municipality + * @property {String} fullText - Full text representation of the suggested location. + * @property {String} postalCode - Suggested location postcode + * @property {Integer} classification - Number used to classify the importance of the place where is the suggested location from 1 (most important) to 7 (less important). + * @property {String} street - Street name of the suggested location ("StreetAddress" only). + * @property {String} kind - Nature of the suggested location : "prefecture", "monument", "commune", ... for instance ("PositionOfInterest" only). + * + * @namespace + * @alias Gp.Services.AutoComplete.SuggestedLocation + */ +function SuggestedLocation () { + if (!(this instanceof SuggestedLocation)) { + throw new TypeError("SuggestedLocation constructor cannot be called as a function."); + } + + /* REPONSE : + { + "status" : "OK", + "results" : [ + { + "country":"PositionOfInterest", + "x":-1.559185, + "y":47.952603, + "city":"Brie", + "zipcode":"35150", + "street":"corbe", + "kind":"Lieu-dit habité", + "fulltext":"corbe, 35150 Brie", + "classification":6 + }, + { + "country":"StreetAddress", + "x":1.538295, + "y":43.19646, + "city":"Brie", + "zipcode":"09700", + "street":"courreste", + "kind":"", + "fulltext":"courreste, 09700 Brie", + "classification":7 + } + ] + } + */ + + /* REPONSE EN ERREUR + { + status : "ERROR", + results : [ ] + } + */ + + /** + * Suggested location type : "StreetAddress" ou "PositionOfInterest" + * @type {String} + */ + this.type = null; + + /** + * Position of the suggested location given in requested coordinates system. + * @type {Gp.Point} + */ + this.position = { + x : null, + y : null + }; + + /** + * Suggested municipality + * @type {String} + */ + this.commune = null; + + /** + * Full text representation of the suggested location. + * @type {String} + */ + this.fullText = null; + + /** + * Suggested location postcode + * @type {Number} + */ + this.postalCode = null; + + /** + * Number used to classify the importance of the place where is the suggested location from 1 (most important) to 7 (less important). + * @type {Integer} + */ + this.classification = null; + + /** + * Street name of the suggested location ("StreetAddress" only). + * @type {String} + */ + this.street = null; + + /** + * Place name of the suggested location ("PositionOfInterest" only). + * @type {String} + */ + this.poi = null; + + /** + * Nature of the suggested location : "prefecture", "monument", "commune", ... for instance ("PositionOfInterest" only). + * @type {String} + */ + this.kind = null; +} + +SuggestedLocation.prototype = { + + constructor : SuggestedLocation +}; + +/* harmony default export */ __webpack_exports__["default"] = (SuggestedLocation); + + +/***/ }), +/* 81 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); +/* harmony import */ var _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82); +/* harmony import */ var _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85); + + + + + + + + + +/** + * @classdesc + * Appel du service d'itinéraire du Géoportail : + * envoi de la requête construite selon les paramètres en options, + * éventuellement parsing et analyse de la réponse, + * retour d'une réponse en paramètre de la fonction onSuccess. + * + * @alias Gp.Services.Route + * @constructor + * @extends {Gp.Services.CommonService} + * @param {Object} options - options spécifiques au service (+ les options heritées) + * + * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité. + * + * @param {String} options.outputFormat - Le format de la réponse du service itineraire : 'json' uniquement et par défaut. + * + * @param {String} [options.routePreference = "fastest"] - Mode de calcul à utiliser : + * - le plus rapide « fastest » + * - le plus court « shortest » + * Par défaut : « fastest ». + * + * @param {Object} options.startPoint - Point de départ du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326) + * @param {Float} options.startPoint.x - Abcisse du point de départ du calcul d'itinéraire. + * @param {Float} options.startPoint.y - Ordonnée du point de départ du calcul d'itinéraire. + * + * @param {Object} options.endPoint - Point d'arrivée du calcul. Coordonnées exprimées en longitudes, latitudes (EPSG:4326) + * @param {Float} options.endPoint.x - Abcisse du point d'arrivée du calcul d'itinéraire. + * @param {Float} options.endPoint.y - Ordonnée du point d'arrivée du calcul d'itinéraire. + * + * @param {Object[]} [options.viaPoints] - Liste de point ({x:Float,y:Float}) intermédaires que l'itinéraire doit emprunter dans l'ordre du tableau. + * Coordonnées exprimées en longitudes, latitudes (EPSG:4326) :{x:float, y:float} + * + * @param {String} [options.graph = "voiture"] - Type de graphe utilisé : "Voiture" ou "Pieton". + * Détermine le profil de vitesses utilisé pour le calcul ainsi que les tronçons autorisés ou non. + * Par défaut, c'est la valeur "Voiture" qui sera utilisée. + * + * @param {String[]} [options.exclusions] - DEPRECATED: Critères d'exclusions à appliquer pour le calcul. (correspond au paramètre "avoidFeature" d'OpenLS) + * On précise ici le type de tronçons que l'on ne veut pas que l'itinéraire emprunte + * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »). + * Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints + * + * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities. + * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement "banned". + * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement "wayType". + * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement "=". + * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement "autoroute". + * + * @param {Boolean} [options.geometryInInstructions = false] - Indique si la géométrie de l'itinéraire doit être reprise morceau par morceau dans les instructions. + * (correspond au paramètre "provideGeometry" d'OpenLS) Par défaut : false. + * + * @param {Boolean} [options.provideBbox = true] - Indique si les instructions doivent être localisées par une bbox dans la réponse. + * Par défaut : true. + * + * @param {String} [options.distanceUnit = "m"] - Indique si la distance doit être exprimée en km ou m dans la réponse. + * Par défaut : m. + * @param {String} [options.timeUnit = "second"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse. Il peut-être formatté hh:mm::ss avec la valeur standard. + * Les valeurs possibles sont "standard", "second", "minute" ou "hour". + * Par défaut : "standard". + * + * @param {String} [options.srs] - Système de coordonnées dans lequel les paramètres géographiques en entrée et la réponse du service sont exprimés. + * Pas de valeur par défaut. Si le serveur consulté est celui du Géoportail, la valeur par défaut sera donc celle du service : 'EPSG:4326'. + * + * @param {String[]} [options.waysAttributes] - Nom des attributs des voies. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities. + * + * @example + * var options = { + * // options communes aux services + * apiKey : null, + * serverUrl : 'http://localhost/service/', + * protocol : 'XHR', + * proxyURL : null, + * httpMethod : 'GET', // GET|POST + * timeOut : 10000, // ms + * rawResponse : false, // true|false + * scope : null, // this + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * // spécifique au service + * resource : 'bdtopo' + * outputFormat : 'json', + * startPoint : { + * x : 42.1121, + * y : 1.5557 + * }, + * endPoint : { + * x : 42.1121, + * y : 1.5557 + * }, + * provideBbox : true, + * exclusions : ["Bridge", "Tunnel", "Toll"], + * distanceUnit : "km", + * graph : "Voiture", + * geometryInInstructions : true, + * routePreference : "fastest" + * }; + * + */ +function Route (options) { + if (!(this instanceof Route)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("CLASS_CONSTRUCTOR", "Route")); + } + + /** + * Nom de la classe (heritage) + */ + this.CLASSNAME = "Route"; + + // appel du constructeur par heritage + _CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this, arguments); + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("Gp.Services.Route"); + this.logger.trace("[Constructeur Route (options)]"); + + if (!options.startPoint) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "startPoint")); + } + + // on lance une exception afin d'eviter au service de le faire... + if (options.startPoint.x === null) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "startPoint.x")); + } + + if (options.startPoint.y === null) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "startPoint.y")); + } + + if (!options.endPoint) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "endPoint")); + } + + // on lance une exception afin d'eviter au service de le faire... + if (options.endPoint.x === null) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "endPoint.x")); + } + + if (options.endPoint.y === null) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "endPoint.y")); + } + + // options par defaut + + // on passe l'option outputFormat en minuscules afin d'éviter des exceptions. + if (options.outputFormat && options.outputFormat !== "json") { + this.logger.warn("options.outputFormat could only be json"); + } + this.options.outputFormat = "json"; + + this.options.resource = options.resource || "bdtopo-osrm"; + this.options.startPoint = options.startPoint; + this.options.endPoint = options.endPoint; + this.options.viaPoints = options.viaPoints || []; + this.options.routePreference = options.routePreference || "fastest"; + /** Gestion des anciennes valeurs de graph */ + if (options.graph) { + if (options.graph === "Voiture") { + this.options.graph = "car"; + } + if (options.graph === "Pieton") { + this.options.graph = "pedestrian"; + } + } else { + this.options.graph = "car"; + } + this.options.constraints = []; + if (options.constraints) { + if (Array.isArray(options.constraints)) { + for (var k = 0; k < options.constraints.length; k++) { + this.options.constraints.push(options.constraints[k]); + } + } else { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_TYPE", "constraints")); + } + } + + /** Gestion de l'ancien paramètre exclusion */ + var constraintTunnel = {}; + var constraintPont = {}; + var constraintAutoroute = {}; + if (options.exclusions) { + if (options.exclusions.length !== 0) { + this.logger.warn("options.exclusions is DEPRECATED !!"); + for (var c = 0; c < options.exclusions.length; c++) { + if (typeof options.exclusions[c] === "string") { + options.exclusions[c] = options.exclusions[c].toLowerCase(); + } else { + // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions + continue; + } + if (options.exclusions[c] === "toll") { + constraintAutoroute.constraintType = "banned"; + constraintAutoroute.key = "wayType"; + constraintAutoroute.operator = "="; + constraintAutoroute.value = "autoroute"; + this.options.constraints.push(constraintAutoroute); + } + if (options.exclusions[c] === "tunnel") { + constraintTunnel.constraintType = "banned"; + constraintTunnel.key = "wayType"; + constraintTunnel.operator = "="; + constraintTunnel.value = "tunnel"; + this.options.constraints.push(constraintTunnel); + } + if (options.exclusions[c] === "bridge") { + constraintPont.constraintType = "banned"; + constraintPont.key = "wayType"; + constraintPont.operator = "="; + constraintPont.value = "pont"; + this.options.constraints.push(constraintPont); + } + } + } + } + + this.options.geometryInInstructions = options.geometryInInstructions || false; + this.options.provideBbox = options.provideBbox || true; + this.options.distanceUnit = options.distanceUnit || "m"; + this.options.timeUnit = options.timeUnit || "second"; + this.options.expectedStartTime = null; // FIXME not yet implemented ! + this.options.srs = options.srs || "EPSG:4326"; + this.options.waysAttributes = options.waysAttributes || []; + + // gestion de l'url du service par defaut + // si l'url n'est pas renseignée, il faut utiliser les urls par defaut + if (!this.options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire + /* var UrlByDefault = DefaultUrlService.Route.newUrl(); + if (this.options.oldRouteService) { + UrlByDefault = DefaultUrlService.Route.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'itinéraire + var UrlByDefault = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].Route.url(); + + if (!UrlByDefault) { + throw new Error("Url by default not found !"); + } + this.options.serverUrl = UrlByDefault; + this.logger.trace("Serveur URL par defaut : " + this.options.serverUrl); + } +} + +/** + * @lends module:Route# + */ +Route.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].prototype, { + // todo + // getter/setter +}); + +/* + * Constructeur (alias) + */ +Route.prototype.constructor = Route; + +/** + * (overwrite) + * Création de la requête + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +Route.prototype.buildRequest = function (error, success) { + var options = { + // spécifique au service + resource : this.options.resource, + startPoint : this.options.startPoint, + endPoint : this.options.endPoint, + viaPoints : this.options.viaPoints, + provideBbox : this.options.provideBbox, + constraints : this.options.constraints, + distanceUnit : this.options.distanceUnit, + timeUnit : this.options.timeUnit, + graph : this.options.graph, + geometryInInstructions : this.options.geometryInInstructions, + routePreference : this.options.routePreference, + srs : this.options.srs, + waysAttributes : this.options.waysAttributes + }; + + this.request = _Request_RouteRequestFactory__WEBPACK_IMPORTED_MODULE_5__["default"].build(options); + + // on teste si la requete a bien été construite ! + if (!this.request) { + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_REQUEST_BUILD"))); + } else { + success.call(this, this.request); + } +}; + +/** + * (overwrite) + * Analyse de la reponse + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +Route.prototype.analyzeResponse = function (error, success) { + // INFO + // Factory pour masquer la complexité du retour du service + + if (this.response) { + var options = { + distanceUnit : this.options.distanceUnit, + timeUnit : this.options.timeUnit, + response : this.response, + outputFormat : this.options.outputFormat, // utile pour parser la string en mode XHR : JSON ou XML ! + rawResponse : this.options.rawResponse, + onError : error, + onSuccess : success, + scope : this, + geometryInInstructions : this.options.geometryInInstructions + }; + + _Response_RouteResponseFactory__WEBPACK_IMPORTED_MODULE_6__["default"].build(options); + } else { + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (Route); + + +/***/ }), +/* 82 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50); +/* harmony import */ var _RouteRequestREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83); + + + + +/** + * Creation d'une requête REST en mode POST ou GET + * (Factory) + * + * @module RouteRequestFactory + * @alias Gp.Services.Route.Request.RouteRequestFactory + * @private + */ +var RouteRequestFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant Route + * + * @example + * // utilisation avec les callback + * var options = { + * (...) + * onSuccess : function (response) {}, + * onError : function (error) {}, + * // spécifique au service + * startPoint : { + * x : 42.1121, + * y : 1.5557 + * }, + * endPoint : { + * x : 42.1121, + * y : 1.5557 + * }, + * provideBbox : false, + * exclusions : ["bridge", "tunnel", "toll"], + * distanceUnit : "km", + * graph : "Voiture", + * geometryInInstructions : false, + * routePreference : "fastest" + * }; + * RouteRequestFactory.build(options); + * + * // utilisation sans callback + * var options = {...}; + * try { + * var result = RouteRequestFactory.build(options); + * if (! result) { throw new Error("..."):} + * } catch (e) { + * // todo + * } + * @returns {String} request + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("RouteRequestFactory"); + logger.trace(["RouteRequestFactory::build()"]); + + var request = null; + + var settings = options || {}; + + // gestion des callback + var bOnError = !!(options.onError !== null && typeof options.onError === "function"); + + var message = null; + + // FIXME les exceptions ne sont pas 'catchées' sur le constructeur ! + var myReq = new _RouteRequestREST__WEBPACK_IMPORTED_MODULE_2__["default"](settings); + if (!myReq.processRequestString()) { + message = "Error process request (rest) !"; + if (bOnError) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_1__["default"](message)); + return; + } + throw new Error(message); + } + request = myReq.requestString; + + return request; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (RouteRequestFactory); + + +/***/ }), +/* 83 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _model_RouteParamREST__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84); + + + + + +/** + * @classdesc + * Classe de gestion des requêtes de type REST sur le service de calcul d'itineraire + * (uniquement en GET) + * + * @constructor + * @alias Gp.Services.Route.Request.RouteRequestREST + * @param {Object} options - options definies dans le composant Route + * + * @example + * var options = { + * (...) + * }; + * + * @private + */ +function RouteRequestREST (options) { + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("RouteRequestREST"); + this.logger.trace("[Constructeur RouteRequestREST ()]"); + + if (!(this instanceof RouteRequestREST)) { + throw new TypeError("RouteRequestREST constructor cannot be called as a function."); + } + + // existance des options + if (!options) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "options")); + } + + /** liste des options */ + this.settings = options; +} + +RouteRequestREST.prototype = { + + /** + * @lends module:RouteRequestREST# + */ + + /** + * request + * @type {String} + */ + requestString : null, + + /** + * Constructeur (alias) + */ + constructor : RouteRequestREST, + + /** + * Construction de la requête. + * + * @example + * // GET out : origin=2.416907353809513,48.8465772142297&destination=2.4248037771493673,48.84591353161838 + * // POST out : Not yet supported method POST ! + * @returns {String} request + */ + processRequestString : function () { + // INFO + // construction simple sans template..., + // mais en attendant que les services soient fixés, on taggue ce composant en mode PROTOTYPE ! + this.logger.warn(" PROTOTYPE !"); + + // Mapping des options avec le service de l'API REST + var oParams = new _model_RouteParamREST__WEBPACK_IMPORTED_MODULE_2__["default"](this.settings); + var params = oParams.getParams(); + + var request = ""; + for (var i = 0; i < params.length; i++) { + var o = params[i]; + if (request) { + request += "&"; + } + request += o.k + "=" + o.v; + } + + // Exemple : + // http://wxs.ign.fr/KEY/itineraire/rest/route.json? + // origin=& + // destination=& + // waypoints=& + // method=DISTANCE& + // graph=Pieton& + // graphName=Pieton& + // exclusions=& + // tolerance=10& + // srs= + + this.logger.trace(request); + this.requestString = request; + + return this.requestString; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (RouteRequestREST); + + +/***/ }), +/* 84 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); + + + +/** + * @classdesc + * Classe de gestion des param. des requêtes du service de calcul d'itineraire (REST). + * Permet le mapping avec les options du service. + * @constructor + * @alias Gp.Services.Route.Request.RouteParamREST + * @param {Object} options - options + * + * @private + */ +function RouteParamREST (options) { + if (!(this instanceof RouteParamREST)) { + throw new TypeError("RouteParamREST constructor cannot be called as a function."); + } + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur RouteParamREST ()]"); + /** + * Options en paramêtres du constructeur. + */ + this.options = options || {}; + + // mapping des options avec l'API REST + + /** Ressource utilisée */ + this.resource = this.options.resource; + + /** Coordonnées du point de départ. */ + this.start = this.options.startPoint.x + "," + this.options.startPoint.y; + + /** Coordonnées du point d’arrivée. */ + this.end = this.options.endPoint.x + "," + this.options.endPoint.y; + + /** Coordonnées des étapes point de départ. */ + this.intermediates = this.options.viaPoints; + + /** Nom du profile à utiliser */ + this.profile = this.options.graph; + + /** projection (code EPSG comme epsg:4326 ou wgs84) */ + this.crs = this.options.srs; + + /** Liste des contraintes */ + this.constraints = this.options.constraints; + + /** Nom de l'optimisation à utiliser */ + this.optimization = this.options.routePreference; + + /** Format de sortie (résumé de l’itinéraire) */ + this.getSteps = (this.options.geometryInInstructions) ? "true" : "false"; + + /** Unité des distances */ + this.distanceUnit = this.options.distanceUnit; + + /** Unité des durées */ + this.timeUnit = this.options.timeUnit; + + /** Attributs des voies */ + this.waysAttributes = this.options.waysAttributes; +} + +/** + * CLASSNAME + */ +RouteParamREST.CLASSNAME = "RouteParamREST"; + +RouteParamREST.prototype = { + + /** + * @lends module:RouteParamREST# + */ + + /** + * Constructeur (alias) + */ + constructor : RouteParamREST, + + /** + * Retourne une liste de points + * @returns {String} une liste de points (sep '|') + */ + getIntermediates : function () { + var array = []; + if (this.intermediates.length !== 0) { + for (var i = 0; i < this.intermediates.length; i++) { + var obj = this.intermediates[i]; + array.push(obj.x + "," + obj.y); + } + } + + return array.join("|"); + }, + + /** + * Retourne une liste d'attributs + * @returns {String} une liste d'attributs (sep '|') + */ + getWaysAttributes : function () { + return this.waysAttributes.join("|"); + }, + + /** + * Retourne un profile + * @returns {String} profile + */ + getProfile : function () { + return this.profile; + }, + + /** + * Retourne un distanceUnit + * @returns {String} distanceUnit + */ + getDistanceUnit : function () { + if (this.distanceUnit === "m") { + return "meter"; + } + if (this.distanceUnit === "km") { + return "kilometer"; + } + return ""; + }, + + /** + * Retourne une optimisation + * @returns {String} optimization + */ + getOptimization : function () { + if (this.optimization) { + return this.optimization; + } else { + return ""; + } + }, + + /** + * Retourne la liste des constraints + * @returns {String} une liste des constraints (sep '|') + */ + getConstraints : function () { + var constraintArray = []; + + if (this.constraints.length !== 0) { + for (var k = 0; k < this.constraints.length; k++) { + constraintArray.push(JSON.stringify(this.constraints[k])); + } + } + return constraintArray.join("|"); + } +}; + +/** + * Tableau de clefs/valeurs pour param. + * + * @returns {Array} liste de paramêtres + */ +RouteParamREST.prototype.getParams = function () { + var map = []; + + map.push({ + k : "resource", + v : this.resource + }); + + map.push({ + k : "start", + v : this.start + }); + + map.push({ + k : "end", + v : this.end + }); + + map.push({ + k : "geometryFormat", + v : "geojson" + }); + + if (this.optimization) { + map.push({ + k : "optimization", + v : this.getOptimization() + }); + } + + if (this.intermediates) { + map.push({ + k : "intermediates", + v : this.getIntermediates() + }); + } + + if (this.profile) { + map.push({ + k : "profile", + v : this.getProfile() + }); + } + + if (this.constraints) { + map.push({ + k : "constraints", + v : this.getConstraints() + }); + } + + if (this.crs) { + map.push({ + k : "crs", + v : this.crs + }); + } + + if (this.distanceUnit) { + map.push({ + k : "distanceUnit", + v : this.getDistanceUnit() + }); + } + + if (this.timeUnit) { + map.push({ + k : "timeUnit", + v : this.timeUnit + }); + } + + if (this.waysAttributes) { + map.push({ + k : "waysAttributes", + v : this.getWaysAttributes() + }); + } + + return map; +}; + +/* harmony default export */ __webpack_exports__["default"] = (RouteParamREST); + + +/***/ }), +/* 85 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _model_RouteResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86); +/* harmony import */ var _model_RouteInstruction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(87); + + + + + + +/** + * Factory pour générer une reponse JSON à partir d'un XML ou d'un JSON + * (Factory) + * + * @module RouteResponseFactory + * @alias Gp.Services.Route.Response.RouteResponseFactory + * @private + */ +var RouteResponseFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant Route + * + * @example + * var options = { + * response : + * outputFormat : + * rawResponse : + * scope : + * onSuccess : + * onError : + * }; + * + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("RouteResponseFactory"); + logger.trace("RouteResponseFactory::build()"); + + var data = null; + + if (options.response) { + if (options.rawResponse) { + logger.trace("analyze response : raw"); + data = options.response; + } else { + logger.trace("analyze response : json"); + + var JSONResponse; + if (typeof options.response === "string") { + JSONResponse = JSON.parse(options.response); + } else { + JSONResponse = options.response; + } + + // construction de l'objet réponse JSON + if (JSONResponse) { + // le service renvoie t il une erreur ? + if (JSONResponse.message) { + // ex. {"message":"message not null", "status":"ERROR"} + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", JSONResponse.message))); + return; + } + var legs = []; + var legSteps = []; + var steps = []; + + data = new _model_RouteResponse__WEBPACK_IMPORTED_MODULE_3__["default"](); + + if (data.hasOwnProperty("totalTime")) { + data.totalTime = parseFloat(JSONResponse.duration); + } + if (data.hasOwnProperty("totalDistance")) { + data.totalDistance = parseFloat(JSONResponse.distance); + } + + if (data.hasOwnProperty("bbox")) { + data.bbox.left = parseFloat(JSONResponse.bbox[0]); + data.bbox.bottom = parseFloat(JSONResponse.bbox[1]); + data.bbox.right = parseFloat(JSONResponse.bbox[2]); + data.bbox.top = parseFloat(JSONResponse.bbox[3]); + } + + if (data.hasOwnProperty("routeGeometry") && !options.geometryInInstructions) { + data.routeGeometry = JSONResponse.geometry; + } + + if (data.hasOwnProperty("routeInstructions") && options.geometryInInstructions) { + var legList = JSONResponse.portions; + var i; + if (Array.isArray(legList) && legList.length) { + for (i = 0; i < legList.length; i++) { + legs.push(legList[i]); + } + } + if (legs.length) { + for (i = 0; i < legs.length; i++) { + legSteps.push(legs[i].steps); + } + } + if (legSteps.length) { + for (i = 0; i < legSteps.length; i++) { + steps = steps.concat(legSteps[i]); + } + } + + steps.forEach(function (step) { + data.routeInstructions.push(new _model_RouteInstruction__WEBPACK_IMPORTED_MODULE_4__["default"]()); + data.routeInstructions[data.routeInstructions.length - 1].duration = step.duration; + data.routeInstructions[data.routeInstructions.length - 1].distance = step.distance; + data.routeInstructions[data.routeInstructions.length - 1].code = ""; + data.routeInstructions[data.routeInstructions.length - 1].instruction = ""; + data.routeInstructions[data.routeInstructions.length - 1].geometry = step.geometry; + + // on ne souhaite pas de ce type de valeur... + if (step.name === "Valeur non renseignée") { + step.name = ""; + } + + switch (step.instruction.type) { + case "turn": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Tourner"; + break; + case "new name": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Continuer tout droit"; + break; + case "depart": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Départ"; + break; + case "arrive": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Arrivée"; + break; + case "merge": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Rejoindre"; + break; + case "ramp": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Prendre la bretelle"; + break; + case "on ramp": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Prendre la bretelle"; + break; + case "off ramp": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Prendre la sortie"; + break; + case "fork": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Sur la bifurcation, prendre"; + break; + case "end of road": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "À la fin de la route, prendre"; + break; + case "use lane": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Utiliser la file"; + break; + case "continue": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Continuer"; + break; + case "roundabout": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Au rond-point"; + break; + case "rotary": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Au rond-point"; + break; + case "roundabout turn": + data.routeInstructions[data.routeInstructions.length - 1].instruction += "Au rond point, tourner"; + break; + case "notification": + data.routeInstructions[data.routeInstructions.length - 1].instruction += ""; + break; + default: + data.routeInstructions[data.routeInstructions.length - 1].instruction += "?" + step.instruction.type + "?"; + break; + } + + if (step.instruction.modifier) { + switch (step.instruction.modifier) { + case "uturn": + data.routeInstructions[data.routeInstructions.length - 1].instruction = "Faire demi-tour"; + break; + case "sharp right": + data.routeInstructions[data.routeInstructions.length - 1].instruction += " complètement à droite"; + break; + case "right": + data.routeInstructions[data.routeInstructions.length - 1].instruction += " à droite"; + break; + case "slight right": + data.routeInstructions[data.routeInstructions.length - 1].instruction += " légèrement à droite"; + break; + case "straight": + data.routeInstructions[data.routeInstructions.length - 1].instruction = "Continuer tout droit"; + break; + case "slight left": + data.routeInstructions[data.routeInstructions.length - 1].instruction += " lègèrement à gauche"; + break; + case "left": + data.routeInstructions[data.routeInstructions.length - 1].instruction += " à gauche"; + break; + case "sharp left": + data.routeInstructions[data.routeInstructions.length - 1].instruction += " complètement à gauche"; + break; + default: + data.routeInstructions[data.routeInstructions.length - 1].instruction += " ?" + step.instruction.modifier + "?"; + break; + } + } + + if (step.instruction.exit) { + data.routeInstructions[data.routeInstructions.length - 1].instruction += `${step.instruction.exit}e sortie`; + } + + if (step.attributes.name) { + if (step.attributes.name.nom_1_droite || step.attributes.name.toponyme) { + data.routeInstructions[data.routeInstructions.length - 1].instruction += " sur"; + } + + if (step.attributes.name.nom_1_droite) { + data.routeInstructions[data.routeInstructions.length - 1].instruction += ` ${step.attributes.name.nom_1_droite}`; + } + + if (step.attributes.name.toponyme) { + data.routeInstructions[data.routeInstructions.length - 1].instruction += ` ${step.attributes.name.toponyme}`; + } + } + }); + } + } + + if (!data) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_ANALYSE", "json"))); + return; + } + + // Si la réponse contenait une exception renvoyée par le service + if (data.exceptionReport) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION_2"))); + return; + } + } + } else { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + return; + } + + options.onSuccess.call(options.scope, data); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (RouteResponseFactory); + + +/***/ }), +/* 86 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * Response object for {@link module:Services~route Gp.Services.route ()} invocation when successful. Received as the argument of onSuccess callback function. + * + * @property {Gp.BBox} bbox - Bounding Box of the route. Given when provideBBox parameter is used in function call. + * @property {Object} routeGeometry - Geometry (expressed in [GeoJSON]{@link http://geojson.org/}) of the route. + * @property {Array.} routeInstructions - Instructions of the route. + * @property {String} totalDistance - Length of the route. If distanceUnit parameter was set to "km" (default), totalDistance is a string containing the total distance expressed in kilometers, followed by " Km" (e.g. : "19.6 Km"). If distanceUnit parameter was set to "m", totalDistance is a string containing the total distance expressed in meters (e.g. : "19599.14"). + * @property {Float} totalTime - Route duration in seconds. + * + * @namespace + * @alias Gp.Services.RouteResponse + */ +function RouteResponse () { + if (!(this instanceof RouteResponse)) { + throw new TypeError("RouteResponse constructor cannot be called as a function."); + } + + this.totalTime = null; + + this.totalDistance = null; + + this.bbox = { + left : null, + right : null, + top : null, + bottom : null + }; + + this.routeGeometry = null; // FIXME can be null if option 'geometryInInstructions' is true ! + + this.routeInstructions = []; +} + +RouteResponse.prototype = { + + constructor : RouteResponse + +}; + +/* harmony default export */ __webpack_exports__["default"] = (RouteResponse); + + +/***/ }), +/* 87 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Single Route Instruction object. + * + * @property {String} code - Instruction code : + * + * - "F" : Straight forward + * - "B" : U-turn + * - "L" : turn left + * - "R" : turn right + * - "BL" : turn left strongly + * - "BR" : turn right strongly + * - "FL" : turn lightly to the left + * - "FR" : turn lightly to the right + * - "round_about_entry" : round about entry + * - "round_about_exit" : round about exit + * + * @property {String} instruction - Instruction text : translated code + street name + * @property {Object} geometry - Geometry (expressed in [GeoJSON]{@link http://geojson.org/}) of the street. + * @property {Float} distance - Length of the instruction. Expressed in km or m, depending on distanceUnit parameter. + * @property {Float} duration - Instruction duration in seconds. + * + * @namespace + * @alias Gp.Services.Route.RouteInstruction + */ +function RouteInstruction () { + if (!(this instanceof RouteInstruction)) { + throw new TypeError("RouteInstruction constructor cannot be called as a function."); + } + + this.duration = null; + + this.distance = null; + + this.code = null; + + this.instruction = null; + + this.geometry = null; // FIXME can be null if option 'geometryInInstructions' is false ! +} + +RouteInstruction.prototype = { + + constructor : RouteInstruction + +}; + +/* harmony default export */ __webpack_exports__["default"] = (RouteInstruction); + + +/***/ }), +/* 88 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _CommonService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41); +/* harmony import */ var _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51); +/* harmony import */ var _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89); +/* harmony import */ var _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91); + + + + + + + + + +/** + * @classdesc + * Appel du service d'isochrone/distance du Géoportail : + * envoi de la requête construite selon les paramètres en options, + * éventuellement parsing et analyse de la réponse, + * retour d'une réponse en paramètre de la fonction onSuccess. + * @constructor + * @extends {Gp.Services.CommonService} + * @alias Gp.Services.ProcessIsoCurve + * @param {Object} options - options spécifiques au service (+ les options heritées) + * + * @param {String} options.resource - La ressource utilisée pour le calcul. Ce paramètre devrait être obligatoire car il l'est dans l'appel au service. Mais il ne l'est pas pour des raisons de rétrocompatibilité. + * + * @param {String} options.outputFormat - Le format de la réponse du service iso : 'json' uniquement et par défaut. + * + * @param {Object} options.position - Point de départ du calcul. + * Coordonnées exprimées en longitudes, latitudes (EPSG:4326) + * @param {Float} options.position.x - Abcisse du point de départ du calcul d'isochrone/distance. + * @param {Float} options.position.y - Ordonnée du point de départ du calcul d'isochrone/distance. + * + * @param {String} options.srs - Projection. + * Système de coordonnées dans lequel les coordonnées du point « location » sont exprimées et + * dans lequel la géométrie de la courbe résultante sera exprimée. + * Par défaut, le système de coordonnées utilisé sera « EPSG:4326 ». + * + * @param {String} [options.graph = "voiture"] - Nom du graphe à utiliser pour le calcul (« Pieton » ou « Voiture »). + * La valeur par défaut est : «voiture» + * + * @param {Array.} [options.exclusions] - DEPRECATED: Ce paramètre est conservé pour une rétrocompatibilité de l'api. Le nouveau paramètre à utiliser est options.constraints. + * Critères d'exclusions à appliquer pour le calcul. + * On précise ici le type de tronçons que l'on ne veut pas que l'isochrone/distance emprunte + * (valeurs possibles : « toll » (éviter les péages), « bridge », « tunnel »). + * + * @param {Object[]} [options.constraints] - Critères de contraintes à appliquer sur un itinéraire. Les valeurs disponibles dépendent de la ressource utilisée. Il est donc utile de regarder le getCapabilities. + * @param {String} [options.constraints.constraintType] - Type de la contrainte. Généralement "banned". + * @param {String} [options.constraints.key] - Clé de la contrainte. Généralement "wayType". + * @param {String} [options.constraints.operator] - Opérateur de la contrainte. Généralement "=". + * @param {String} [options.constraints.value] - Valeur de la contrainte. Généralement "autoroute". + * + * @param {String} [options.method = "time"] - Méthode utilisée pour le calcul de la courbe iso. + * Les valeurs possible sont "time" pour un calcul d'isochrone, "distance" pour un calcul d'isodistance. + * Pas de valeur spécifié équivaut à un calcul d'isochrone. + * + * @param {String} [options.distanceUnit = "m"] - Indique si la distance doit être exprimée en km ou m dans la réponse ("m" or "km"). + * + * @param {String} [options.timeUnit = "second"] - Indique si la durée doit être exprimée en seconde, minute ou heure dans la réponse ("standard", "second", "minute", "hour"). Il peut-être formatté hh:mm::ss avec la valeur standard. + * + * @param {Float} options.time - Durée maximum (exprimée en secondes) à utiliser pour le calcul de la courbe à partir du ou jusqu'au point « location ». + * Ce paramètre doit être renseigné si l'option "méthod" a la valeur "time". + * Si l'option method n'est pas renseignée, ce paramètre doit être renseigné. + * + * @param {Float} options.distance - Distance maximum (exprimée en metres) à utiliser pour le calcul de la courbe à partir du ou j'usqu'au point « location ». + * Ce paramètre doit être renseigné si l'option "méthod" a la valeur "DISTANCE". + * Si l'option "method" n'est pas renseignée, ce paramètre sera ignoré. + * + * @param {Boolean} [options.reverse = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier. + * Par défaut, la valeur « false » est appliquée. + * + * @param {Boolean} [options.smoothing = false] - Indique si la géométrie résultante doit être lissée (« true ») pour ne pas avoir d'effet d'escalier. + * Par défaut, la valeur « false » est appliquée. + * + * @param {Boolean} [options.holes = false] - Indique si la géométrie résultante (surface) doit être retournée avec des trous (« true »). + * Par défaut, la valeur « false » est appliquée. + * + * @example + * var options = { + * // options communes aux services + * apiKey : null, + * serverUrl : 'http://localhost/service/', + * protocol : 'JSONP', // JSONP|XHR + * proxyURL : null, + * httpMethod : 'GET', // GET|POST + * timeOut : 10000, // ms + * rawResponse : false, // true|false + * scope : null, // this + * onSuccess : function (response) {}, + * onFailure : function (error) {}, + * // spécifique au service + * position : { + * x : 2.3242664298058053, + * y : 48.86118017324745 + * }, + * distance : 200, + * [time : ] + * method : "distance", + * graph : "voiture", + * reverse : false + * }; + */ + +function ProcessIsoCurve (options) { + if (!(this instanceof ProcessIsoCurve)) { + throw new TypeError(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("CLASS_CONSTRUCTOR", "ProcessIsoCurve")); + } + + /** + * Nom de la classe (heritage) + * FIXME instance ou classe ? + */ + this.CLASSNAME = "ProcessIsoCurve"; + + // appel du constructeur par heritage + _CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this, arguments); + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("Gp.Services.ProcessIsoCurve"); + this.logger.trace("[Constructeur ProcessIsoCurve (options)]"); + + if (!options.position) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "position")); + } + + // on lance une exception afin d'eviter au service de le faire... + if (options.position.x === null) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "position.x")); + } + + if (options.position.y === null) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_MISSING", "position.y")); + } + + if (!options.time && !options.distance) { + throw new Error("Parameter (s) 'distance' missing. Parameter time to calculate an isochrone, parameter distance for an isodistance"); + } + + // si on a que le paramètre "distance" en entrée, on calcule une isodistance. + // Le paramètre "méthode" doit pour avoir une réponse du service, être passé à "distance" + if (!options.time && options.distance) { + this.options.method = "distance"; + // on supprime l'éventuel attribut time, résidu d'un appel antérieur + if (this.options.time) { + delete this.options.time; + } + } + + // si on a que le paramètre "time" en entrée, on calcule une isochrone. + // Le paramètre "méthode" doit pour avoir une réponse du service, être passé à "time" + if (options.time && !options.distance) { + this.options.method = "time"; + // on supprime l'éventuel attribut time, résidu d'un appel antérieur + if (this.options.distance) { + delete this.options.distance; + } + } + + // au cas où on a ni l'un, ni l'autre... + this.options.method = this.options.method || "time"; + + // options par defaut du service + // TODO: modifier la ressource lors de la mise en production du service + this.options.resource = options.resource || "bdtopo-iso"; + this.options.exclusions = options.exclusions || []; + this.options.reverse = options.reverse || false; + this.options.srs = options.srs || "EPSG:4326"; + this.options.distanceUnit = options.distanceUnit || "m"; + this.options.timeUnit = options.timeUnit || "second"; + + // options depreciees + if (options.smoothing) { + this.logger.warn("options.smoothing is DEPRECATED"); + } + this.options.smoothing = false; + if (options.holes) { + this.logger.warn("options.holes is DEPRECATED"); + } + this.options.holes = false; + + // Gestion du graphe + if (options.graph) { + if (options.graph === "Voiture") { + this.options.graph = "car"; + } + if (options.graph === "Pieton") { + this.options.graph = "pedestrian"; + } + } else { + this.options.graph = "car"; + } + + // Gestions des contraintes + this.options.constraints = []; + if (options.constraints) { + if (Array.isArray(options.constraints)) { + for (var k = 0; k < options.constraints.length; k++) { + this.options.constraints.push(options.constraints[k]); + } + } else { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_TYPE", "constraints")); + } + } + + // Gestion de l'ancien paramètre exclusions + var constraintTunnel = {}; + var constraintPont = {}; + var constraintAutoroute = {}; + if (options.exclusions) { + if (options.exclusions.length !== 0) { + this.logger.warn("options.exclusions is DEPRECATED !!"); + for (var c = 0; c < options.exclusions.length; c++) { + if (typeof options.exclusions[c] === "string") { + options.exclusions[c] = options.exclusions[c].toLowerCase(); + } else { + // on ne crée pas une erreur pour rétro-compatibilité avec les anciennes versions + continue; + } + if (options.exclusions[c] === "toll") { + constraintAutoroute.constraintType = "banned"; + constraintAutoroute.key = "wayType"; + constraintAutoroute.operator = "="; + constraintAutoroute.value = "autoroute"; + this.options.constraints.push(constraintAutoroute); + } + if (options.exclusions[c] === "tunnel") { + constraintTunnel.constraintType = "banned"; + constraintTunnel.key = "wayType"; + constraintTunnel.operator = "="; + constraintTunnel.value = "tunnel"; + this.options.constraints.push(constraintTunnel); + } + if (options.exclusions[c] === "bridge") { + constraintPont.constraintType = "banned"; + constraintPont.key = "wayType"; + constraintPont.operator = "="; + constraintPont.value = "pont"; + this.options.constraints.push(constraintPont); + } + } + } + } + + // on passe l'option outputFormat en minuscules afin d'éviter des exceptions. + this.options.outputFormat = (typeof options.outputFormat === "string") ? options.outputFormat.toLowerCase() : "json"; + if (options.outputFormat && options.outputFormat !== "json") { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_NOT_SUPPORT", "outputFormat")); + } + this.options.outputFormat = "json"; + + // gestion de l'url du service par defaut + // si l'url n'est pas renseignée, il faut utiliser les urls par defaut + if (!this.options.serverUrl) { + // Code commenté : Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone + /* var urlFound = DefaultUrlService.ProcessIsoCurve.newUrl(); + if (this.options.oldIsoService) { + urlFound = DefaultUrlService.ProcessIsoCurve.url(); + } */ + // Release beta services DIFFUSION uniquement : on tape sur l'anvcien service d'isochrone + var urlFound = _DefaultUrlService__WEBPACK_IMPORTED_MODULE_4__["default"].ProcessIsoCurve.url(); + if (!urlFound) { + throw new Error("Url by default not found !"); + } + this.options.serverUrl = urlFound; + this.logger.trace("Serveur URL par defaut : " + this.options.serverUrl); + } +} + +/** + * @lends module:ProcessIsoCurve# + */ +ProcessIsoCurve.prototype = Object.create(_CommonService__WEBPACK_IMPORTED_MODULE_3__["default"].prototype, { + // todo + // getter/setter +}); + +/* + * Constructeur (alias) + */ +ProcessIsoCurve.prototype.constructor = ProcessIsoCurve; + +/** + * Création de la requête (overwrite) + * + * @param {Function} error - callback des erreurs + * @param {Function} success - callback + */ +ProcessIsoCurve.prototype.buildRequest = function (error, success) { + try { + var oIsoCurve = new _Request_ProcessIsoCurveRequest__WEBPACK_IMPORTED_MODULE_5__["default"](this.options); + if (!oIsoCurve.processRequestString()) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_REQUEST_BUILD")); + } + + this.request = oIsoCurve.requestString; + } catch (e) { + error.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](e.message)); + return; + } + + success.call(this, this.request); +}; + +/** + * (overwrite) + * Analyse de la reponse + * + * @param {Function} onError - callback des erreurs + * @param {Function} onSuccess - callback de succès de l'analyse de la réponse + */ +ProcessIsoCurve.prototype.analyzeResponse = function (onError, onSuccess) { + if (this.response) { + var options = { + response : this.response, + outputFormat : this.options.outputFormat, + rawResponse : this.options.rawResponse, + onSuccess : onSuccess, + onError : onError, + scope : this + }; + + _Response_ProcessIsoCurveResponseFactory__WEBPACK_IMPORTED_MODULE_6__["default"].build(options); + } else { + onError.call(this, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (ProcessIsoCurve); + + +/***/ }), +/* 89 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _model_ProcessIsoCurveParam__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90); + + + + + +/** + * @classdesc + * Classe de gestion des requêtes sur le service de calcul d'isoschrone/isodistance. + * Les requêtes peuvent être en mode GET ou POST, + * et le format de sorti est en JSON. + * + * @constructor + * @alias Gp.Services.ProcessIsoCurve.Request.ProcessIsoCurveRequest + * @param {Object} options - options + * + * @example + * var options = { + * httpMethod : 'GET', // GET|POST + * // spécifique au service + * position : { + * x : 2.3242664298058053, + * y : 48.86118017324745 + * }, + * graph : "car", + * method : 'time', + * time : 1000, //distance : 200 + * reverse : false, + * srs : 'EPSG:4326' + * }; + * + * try { + * + * var oIsoCurve = new ProcessIsoCurveRequest (options); + * if (!oIsoCurve.processRequestString ()) { + * // error + * } + * + * var request = oIsoCurve.requestString; + * + * } catch (e) { + * // error + * } + * @private + */ +function ProcessIsoCurveRequest (options) { + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("ProcessIsoCurveRequest"); + this.logger.trace("[Constructeur ProcessIsoCurveRequest ()]"); + + if (!(this instanceof ProcessIsoCurveRequest)) { + throw new TypeError("ProcessIsoCurveRequest constructor cannot be called as a function."); + } + + // existance des options + if (!options) { + throw new Error(_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("PARAM_EMPTY", "options")); + } + + /** + * Liste des options + */ + this.settings = options; + + /** + * Mode HTPP. + * Par defaut, "GET". + * @type {String} + */ + this.mode = this.settings.httpMethod || "GET"; +} + +ProcessIsoCurveRequest.prototype = { + + /** + * @lends module:ProcessIsoCurveRequest# + */ + + /** + * Requête + * @type {String} + */ + requestString : null, + + /** + * Constructeur (alias) + */ + constructor : ProcessIsoCurveRequest, + + /** + * Construction de la requête. + * + * @example + * // GET out : + * // (http://wxs.ign.fr/KEY/isochrone?) + * // resource=& + * // point=& + * // costValue=& + * // costType=& + * // profile=& + * // constraints=& + * // direction=& + * // crs= + * + * // POST out : + * { + * resource: "bduni-idf-pgr", + * point: "2.337306,48.849319", + * costValue: 100, + * costType: "time", + * profile: "car", + * constraints: [{ + * constraintType: "banned", + * key: "ways_type", + * operator: "=", + * value: "autoroute" + * }] + * } + * + * @returns {String} request + */ + processRequestString : function () { + var request = ""; + var i = 0; + + switch (this.mode) { + case "GET": + this.logger.trace("Process GET Request"); + + // Mapping des options avec le service de l'API REST + var oParams = new _model_ProcessIsoCurveParam__WEBPACK_IMPORTED_MODULE_2__["default"](this.settings); + var params = oParams.getParams(); + + for (i = 0; i < params.length; i++) { + var o = params[i]; + if (request) { + request += "&"; + } + request += o.k + "=" + o.v; + } + + break; + + case "POST": + this.logger.trace("Process POST Request"); + // creation du JSON + var postRequest = {}; + + postRequest.resource = this.settings.resource; + + postRequest.point = this.settings.position.x + "," + this.settings.position.y; + + if (this.settings.method === "distance") { + postRequest.costType = "distance"; + postRequest.costValue = this.settings.distance; + } else { + postRequest.costType = "time"; + postRequest.costValue = this.settings.time; + } + + postRequest.profile = this.settings.graph; + + if (this.settings.reverse) { + postRequest.direction = "arrival"; + } else { + postRequest.direction = "departure"; + } + + postRequest.constraints = this.settings.constraints; + + postRequest.distanceUnit = this.settings.distanceUnit; + + postRequest.timeUnit = this.settings.timeUnit; + + postRequest.crs = this.settings.srs; + + // conversion en chaîne de caractères + request = JSON.stringify(postRequest); + break; + + default: + this.logger.error("No other HTTP method supported by the service !"); + } + + this.logger.trace(request); + this.requestString = request; + + return this.requestString; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (ProcessIsoCurveRequest); + + +/***/ }), +/* 90 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); + + + +/** + * @classdesc + * + * Classe de gestion des param. des requêtes du service de calcul des iso. + * Permet le mapping avec les options du service. + * + * @constructor + * @alias Gp.Services.ProcessIsoCurve.Request.ProcessIsoCurveParam + * @param {Object} options - options + * @private + * + */ +function ProcessIsoCurveParam (options) { + if (!(this instanceof ProcessIsoCurveParam)) { + throw new TypeError("ProcessIsoCurveParam constructor cannot be called as a function."); + } + + this.logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger(); + this.logger.trace("[Constructeur ProcessIsoCurveParam ()]"); + + /** + * Options en paramêtres du constructeur. + */ + this.options = options || {}; + + // mapping des options avec l'API REST + + /** Identifiant de l’isochrone */ + this.id = this.options.id; + + /** Resource */ + this.resource = this.options.resource; + + /** Coordonnées de départ (ou arrivée si le reverse est à true). */ + this.point = this.options.position; + + /** projection (code EPSG comme epsg:4326 ou wgs84) */ + this.crs = this.options.srs; + + /** + * Profil de véhicule à utiliser pour le calcul. + * Voiture ou Pieton + */ + this.profile = this.options.graph; + + /** Liste des règles de restrictions à utiliser */ + this.constraints = this.options.constraints; + + this.reverse = this.options.reverse; + + this.timeUnit = this.options.timeUnit; + + this.distanceUnit = this.options.distanceUnit; + + /** + * "time" pour isochrone ou "distance" for isodistance. + * Par defaut, time... + */ + if (this.options.method === "distance") { + this.costType = "distance"; + this.costValue = this.options.distance; + } else { + this.costType = "time"; + this.costValue = this.options.time; + } +} + +/** + * CLASSNAME + */ +ProcessIsoCurveParam.CLASSNAME = "ProcessIsoCurveParam"; + +ProcessIsoCurveParam.prototype = { + + /** + * @lends module:ProcessIsoCurveParam# + */ + + /** + * Constructeur (alias) + */ + constructor : ProcessIsoCurveParam, + + /** + * Retourne le point + * @returns {String} x,y + */ + getLocation : function () { + return this.point.x + "," + this.point.y; + }, + + /** + * Retourne l'unité de la distance + * @returns {String} + */ + getDistanceUnit : function () { + if (this.distanceUnit === "m") { + return "meter"; + } + if (this.distanceUnit === "km") { + return "kilometer"; + } + return ""; + }, + + /** + * Retourne la liste des contraintes + * @returns {String} + */ + getConstraints : function () { + var constraintArray = []; + + if (this.constraints.length !== 0) { + for (var k = 0; k < this.constraints.length; k++) { + constraintArray.push(JSON.stringify(this.constraints[k])); + } + } + return constraintArray.join("|"); + }, + + /** + * Retourne la direction + * @returns {String} + */ + getDirection : function () { + if (this.reverse) { + return "arrival"; + } else { + return "departure"; + } + } +}; + +/** + * Tableau de clefs/valeurs pour param. + * + * @returns {Object[]} KVP + */ +ProcessIsoCurveParam.prototype.getParams = function () { + var map = []; + + map.push({ + k : "resource", + v : this.resource + }); + + map.push({ + k : "point", + v : this.getLocation() + }); + + map.push({ + k : "direction", + v : this.getDirection() + }); + + map.push({ + k : "costType", + v : this.costType + }); + + map.push({ + k : "costValue", + v : this.costValue + }); + + map.push({ + k : "profile", + v : this.profile + }); + + map.push({ + k : "timeUnit", + v : this.timeUnit + }); + + map.push({ + k : "distanceUnit", + v : this.getDistanceUnit() + }); + + if (this.crs) { + map.push({ + k : "crs", + v : this.crs + }); + } + + if (this.constraints) { + map.push({ + k : "constraints", + v : this.getConstraints() + }); + } + + return map; +}; + +/* harmony default export */ __webpack_exports__["default"] = (ProcessIsoCurveParam); + + +/***/ }), +/* 91 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39); +/* harmony import */ var _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40); +/* harmony import */ var _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); +/* harmony import */ var _model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92); + + + + + +/** + * Factory pour générer une reponse JSON à partir d'un JSON + * (Factory) + * + * @module ProcessIsoCurveResponseFactory + * @alias Gp.Services.ProcessIsoCurve.Response.ProcessIsoCurveResponseFactory + * @private + */ +var ProcessIsoCurveResponseFactory = { + + /** + * interface unique + * + * @method build + * @static + * @param {Object} options - options definies dans le composant ProcessIsoCurve + * + * @example + * var options = { + * response : + * outputFormat : + * rawResponse : + * scope : + * onSuccess : + * onError : + * }; + * + */ + build : function (options) { + // logger + var logger = _Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("ProcessIsoCurveResponseFactory"); + logger.trace(["ProcessIsoCurveResponseFactory::build()"]); + + var data = null; + + if (options.response) { + if (options.rawResponse) { + logger.trace("analyze response : raw"); + data = options.response; + } else { + logger.trace("analyze response : json"); + + var JSONResponse; + if (typeof options.response === "string") { + JSONResponse = JSON.parse(options.response); + } else { + JSONResponse = options.response; + } + + // analyse de la reponse + // création de l'objet de réponse + data = new _model_ProcessIsoCurveResponse__WEBPACK_IMPORTED_MODULE_3__["default"](); + + // remplissage de l'objet créé avec les attribtuts de la réponse du service + if (JSONResponse) { + if (JSONResponse.costType === "distance") { + data.time = ""; + data.distance = JSONResponse.costValue; + } else { + data.time = JSONResponse.costValue; + data.distance = ""; + } + + data.message = ""; + data.id = ""; + data.srs = JSONResponse.crs; + data.geometry = JSONResponse.geometry; + var coords = JSONResponse.point.split(","); + if (data.location) { + data.location.x = coords[0]; + data.location.y = coords[1]; + } + } else { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_ANALYSE", options.response))); + return; + } + + // info : en cas de problèmes de droits (clé invalide ou autre), la réponse est au format XML !! + // ex. Key does not exist or has expired + // mais le statut est 403, l'erreur est donc remontée plus tôt. + if (data.exceptionReport) { + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"]({ + message : _Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EXCEPTION", data.exceptionReport), + type : _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"].TYPE_SRVERR, + status : 200 + })); + return; + } + } + } else { + // si la réponse est vide, on appelle le callback d'erreur + options.onError.call(options.scope, new _Exceptions_ErrorService__WEBPACK_IMPORTED_MODULE_2__["default"](_Utils_MessagesResources__WEBPACK_IMPORTED_MODULE_1__["default"].getMessage("SERVICE_RESPONSE_EMPTY"))); + return; + } + + // si tout s'est bien passé, on appelle le callback de succès + options.onSuccess.call(options.scope, data); + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (ProcessIsoCurveResponseFactory); + + +/***/ }), +/* 92 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + +/** + * Response object for {@link module:Services~isoCurve Gp.Services.isoCurve ()} invocation when successful. Received as the argument of onSuccess callback function. + * + * @property {Float} distance - distance (expressed in meters) used for the request. + * @property {Float} time - time (expressed in seconds) used for the request. + * @property {Object} geometry - Geometry (expressed in [GeoJSON]{@link http://geojson.org/}) of the isocurve. + * @property {String} id - request id (used by underlying webservice). + * @property {Gp.Point} location - Position of the start or end point used for the request (expressed in "srs" coordinates system). + * @property {String} message - message + * @property {String} srs - Identifier of the coordinates system used for the isocurve. + * + * @namespace + * @alias Gp.Services.IsoCurveResponse + * + */ +function ProcessIsoCurveResponse () { + if (!(this instanceof ProcessIsoCurveResponse)) { + throw new TypeError("ProcessIsoCurveResponse constructor cannot be called as a function."); + } + + this.message = null; + + this.id = null; + + this.location = {}; + this.location.x = null; + this.location.y = null; + + this.srs = null; + + this.geometry = null; + + this.time = null; + + this.distance = null; +} + +ProcessIsoCurveResponse.prototype = { + + constructor : ProcessIsoCurveResponse + +}; + +/* harmony default export */ __webpack_exports__["default"] = (ProcessIsoCurveResponse); + + +/***/ }), +/* 93 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_1__); + + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("GlobeViewExtended"); + +/** + * @classdesc + * + * Extended itowns.GlobeView. + * + * @constructor + * @extends {itowns.GlobeView} + * @param {HTMLElement} viewerDiv - Where to instanciate the Three.js scene in the DOM + * @param {Object} coordCarto - longitude, latitude, altitude + * @param {Object} [options] - Optional properties which includes Itowns GlobeView optional properties (see Itowns documentation). + * @param {Boolean} [options.renderer.isWebGL2=True] - is an Itowns GlobeView optional property to enable webgl 2.0 for THREE.js. + * @param {String} [options.position="relative"] - "absolute" or "relative" + */ +function GlobeViewExtended(viewerDiv, coordCarto, options) { + if (!viewerDiv.style.position || options && options.position) { + viewerDiv.style.position = !options || !options.position ? "relative" : options.position; + } + + // stockage de l'élément html porteur du globe + var globeViewDiv = document.createElement("div"); + globeViewDiv.style.width = "100%"; + globeViewDiv.style.height = "100%"; + viewerDiv.appendChild(globeViewDiv); + this._viewerDiv = viewerDiv; + + // widget container + this._widgets = []; + + // mapping des evenements + this._initEventMap(); + + // pour savoir si le globe est initialise + this._isInitialized = false; + + // call constructor + this._globeView = new itowns__WEBPACK_IMPORTED_MODULE_1__["GlobeView"](globeViewDiv, coordCarto, options); + var self = this; + this.listen(GlobeViewExtended.EVENTS.GLOBE_INITIALIZED, function () { + self._isInitialized = true; + }); + this._globeView.addFrameRequester(itowns__WEBPACK_IMPORTED_MODULE_1__["MAIN_LOOP_EVENTS"].BEFORE_RENDER, function () { + clearTimeout(this._preRenderTimer); + self._preRenderTimer = setTimeout(function () { + var visibleColorLayersIds = []; + var visibleElevationLayersIds = []; + for (var i = 0; i < self.getGlobeView().tileLayer.info.displayed.layers.length; ++i) { + if (self.getGlobeView().tileLayer.info.displayed.layers[i].isColorLayer) { + visibleColorLayersIds.push(self.getGlobeView().tileLayer.info.displayed.layers[i].id); + } + if (self.getGlobeView().tileLayer.info.displayed.layers[i].isElevationLayer) { + visibleElevationLayersIds.push(self.getGlobeView().tileLayer.info.displayed.layers[i].id); + } + } + var currentExtent = self.getGlobeView().tileLayer.info.displayed.extent; + self._globeView.dispatchEvent({ + type: GlobeViewExtended.EVENTS.PRE_RENDER, + colorLayersId: visibleColorLayersIds, + elevationLayersId: visibleElevationLayersIds, + extent: currentExtent + }); + }, 100); + }.bind(this)); + if (this._globeView.controls) { + this.freezeControl(); + } +} + +/** + * intializes the evenements map + */ +GlobeViewExtended.prototype._initEventMap = function () { + if (!GlobeViewExtended.EVENTS) { + GlobeViewExtended.EVENTS = { + RANGE_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__["CONTROL_EVENTS"].RANGE_CHANGED, + CENTER_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__["CONTROL_EVENTS"].CAMERA_TARGET_CHANGED, + ORIENTATION_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__["CONTROL_EVENTS"].ORIENTATION_CHANGED, + LAYER_ADDED: itowns__WEBPACK_IMPORTED_MODULE_1__["GLOBE_VIEW_EVENTS"].LAYER_ADDED, + LAYER_REMOVED: itowns__WEBPACK_IMPORTED_MODULE_1__["GLOBE_VIEW_EVENTS"].LAYER_REMOVED, + LAYERS_ORDER_CHANGED: itowns__WEBPACK_IMPORTED_MODULE_1__["GLOBE_VIEW_EVENTS"].COLOR_LAYERS_ORDER_CHANGED, + GLOBE_INITIALIZED: itowns__WEBPACK_IMPORTED_MODULE_1__["GLOBE_VIEW_EVENTS"].GLOBE_INITIALIZED, + LAYERS_INITIALIZED: itowns__WEBPACK_IMPORTED_MODULE_1__["VIEW_EVENTS"].LAYERS_INITIALIZED, + VIEW_INITIALIZED: "viewinitialized", + PRE_RENDER: "prerender", + MOUSE_MOVE: "mousemove", + AFTER_RENDER: itowns__WEBPACK_IMPORTED_MODULE_1__["MAIN_LOOP_EVENTS"].AFTER_RENDER, + OPACITY_PROPERTY_CHANGED: "opacity-property-changed", + VISIBLE_PROPERTY_CHANGED: "visible-property-changed", + SEQUENCE_PROPERTY_CHANGED: "sequence-property-changed" + }; + } +}; + +/** + * Constructor (alias) + */ +GlobeViewExtended.prototype.constructor = GlobeViewExtended; + +/** + * Get GlobeViex Object (parent) + * @returns {Object} itowns GlobeView object + */ +GlobeViewExtended.prototype.getGlobeView = function () { + return this._globeView; +}; + +/** + * Indicates if the globe is initialized or not + * + * @return {Boolean} isInitialized + * + */ +GlobeViewExtended.prototype.isInitialized = function () { + return this._isInitialized; +}; + +/** + * Detects when the camera movement stops, then launch the callback given as parameter + * + * @param {Function} cb - The function to execute when the event occures. + * + */ +GlobeViewExtended.prototype.onCameraMoveStop = function (cb) { + var self = this; + function afterRenderHandler() { + self._globeView.removeFrameRequester(itowns__WEBPACK_IMPORTED_MODULE_1__["MAIN_LOOP_EVENTS"].AFTER_CAMERA_UPDATE, afterRenderHandler); + cb(); + } + ; + this._globeView.addFrameRequester(itowns__WEBPACK_IMPORTED_MODULE_1__["MAIN_LOOP_EVENTS"].AFTER_CAMERA_UPDATE, afterRenderHandler); +}; + +/** + * Disables globe controls until the globe rendering is completed + */ +GlobeViewExtended.prototype.freezeControl = function () { + // disable navigation + this._globeView.controls.enabled = false; + this.onCameraMoveStop(function () { + this._globeView.controls.enabled = true; + }.bind(this)); +}; + +/** + * Associates a function to trigger when an event is received. + * + * @param {String} type - the event type. Can be any of {@link EVENTS} + * @param {Function} callback - The function to execute when the event occures. + * @return {Object} key - The event key + * + */ +GlobeViewExtended.prototype.listen = function (type, callback) { + if (typeof callback !== "function") { + logger.warn("no callback provided for event : " + type); + return null; + } + var target = this._getEventTarget(type); + if (!target) { + return null; + } + if (type === GlobeViewExtended.EVENTS.AFTER_RENDER) { + target.addFrameRequester(type, callback); + } else { + target.addEventListener(type, callback); + } + return { + target: target, + callback: callback, + type: type + }; +}; + +/** + * Associates a function to trigger when a layer event is received. + * + * @param {Object} layer - The itowns layer. + * @param {String} type - the event type. Can be any of {@link EVENTS}. + * @param {Function} callback - The function to execute when the event occures. + * @return {Object} key - The event key + * + */ +GlobeViewExtended.prototype.addLayerListener = function (layer, type, callback) { + if (typeof callback !== "function") { + logger.warn("no callback provided for event : " + type); + return null; + } + layer.addEventListener(type, callback); + return { + target: layer, + callback: callback, + type: type + }; +}; + +/** + * Returns the target of a given event type + * + * @param {String} type - the event type. Can be any of {@link EVENTS} + * @return {Object} target - The event target. + * + */ +GlobeViewExtended.prototype._getEventTarget = function (type) { + switch (type) { + case GlobeViewExtended.EVENTS.RANGE_CHANGED: + case GlobeViewExtended.EVENTS.CENTER_CHANGED: + case GlobeViewExtended.EVENTS.ORIENTATION_CHANGED: + return this.getGlobeView().controls; + case GlobeViewExtended.EVENTS.LAYER_ADDED: + case GlobeViewExtended.EVENTS.LAYER_REMOVED: + case GlobeViewExtended.EVENTS.LAYERS_ORDER_CHANGED: + case GlobeViewExtended.EVENTS.LAYERS_INITIALIZED: + case GlobeViewExtended.EVENTS.GLOBE_INITIALIZED: + case GlobeViewExtended.EVENTS.PRE_RENDER: + case GlobeViewExtended.EVENTS.AFTER_RENDER: + case GlobeViewExtended.EVENTS.VIEW_INITIALIZED: + return this.getGlobeView(); + case GlobeViewExtended.EVENTS.MOUSE_MOVE: + return this._viewerDiv; + default: + logger.warn("unhandled event : " + type); + return null; + } +}; + +/** + * Cancels an event listening + * + * @param {Object} key - The event key + * + */ +GlobeViewExtended.prototype.forgetByKey = function (key) { + if (key.type === GlobeViewExtended.EVENTS.AFTER_RENDER) { + key.target.removeFrameRequester(key.type, key.callback); + } else { + key.target.removeEventListener(key.type, key.callback); + } +}; + +/** + * Cancels an layer event listening + * + * @param {Object} layer - The itowns layer + * @param {String} type - the event type + * @param {Function} callback - The function to execute when the event occures + * + */ +GlobeViewExtended.prototype.removeLayerListener = function (layer, type, callback) { + this.forgetByKey({ + target: layer, + callback: callback, + type: type + }); +}; + +/** + * Cancels an event listening + * + * @param {Object} type - The event type + * @param {Function} callback - The event handler + */ +GlobeViewExtended.prototype.forget = function (type, callback) { + var target = this._getEventTarget(type); + if (!target) return; + this.forgetByKey({ + target: target, + callback: callback, + type: type + }); +}; + +/** + * Overload itowns.GlobeView addLayer method + * + * @param {Object} layer - The itowns layer + * @return {Promise} promise + */ +GlobeViewExtended.prototype.addLayer = function (layer) { + // FIXME : to delete when itowns commit 2e9ed61eb4aa2a4bbe0e17c8e2650953844b099e + // is integrated into an iTowns release + try { + var promise = this.getGlobeView().addLayer(layer); + } catch (error) { + return Promise.reject(error); + } + return promise; +}; + +/** + * Overload itowns.GlobeView removeLayer method + * + * @param {String} layerId - The layer id + */ +GlobeViewExtended.prototype.removeLayer = function (layerId) { + this.getGlobeView().removeLayer(layerId); +}; + +/** + * Set layer opacity + * + * @param {String} layerId - Layer id + * @param {Number} opacityValue - opacity value in [0 1] + */ +GlobeViewExtended.prototype.setLayerOpacity = function (layerId, opacityValue) { + var layer = this.getColorLayerById(layerId); + layer.opacity = opacityValue; + this.getGlobeView().notifyChange(layer); +}; + +/** + * Set layer visibility + * + * @param {String} layerId - Layer id + * @param {Boolean} visible - New visibility of the layer + */ +GlobeViewExtended.prototype.setLayerVisibility = function (layerId, visible) { + var layer = this.getLayerById(layerId); + layer.visible = visible; + this.getGlobeView().notifyChange(layer); +}; + +/** + * Move layer to the specified index + * + * @param {String} layerId - Layer id + * @param {Boolean} index - new index of the layer + */ +GlobeViewExtended.prototype.moveLayerToIndex = function (layerId, index) { + itowns__WEBPACK_IMPORTED_MODULE_1__["ColorLayersOrdering"].moveLayerToIndex(this.getGlobeView(), layerId, index); +}; + +/** + * Remove event listener from the globe + * + * @param {String} type - event type + * @param {Function} callback - event handler + */ +GlobeViewExtended.prototype.removeEventListener = function (type, callback) { + switch (type) { + case "mousemove": + this._viewerDiv.removeEventListener(type, callback); + break; + case "centerchanged": + this.getGlobeView().controls.removeEventListener(type, callback); + break; + default: + this.getGlobeView().removeEventListener(type, callback); + break; + } +}; + +/** + * Defines if the current view extent have to be computed on pre-render event + * + * @param {Boolean} b - tells if the view extent info should be fetched by the event PRE_RENDER + */ +GlobeViewExtended.prototype.preRenderEventFetchViewExtent = function (b) { + if (typeof b === "undefined") { + b = true; + } + this._fetchExtent = b; +}; + +/** + * Defines if the list of the color layers displayed have to be computed on pre-render event + * + * @param {Boolean} b - tells if the displayed color layers info should be fetched by the event PRE_RENDER + */ +GlobeViewExtended.prototype.preRenderEventFetchColorLayersDisplayed = function (b) { + if (typeof b === "undefined") { + b = true; + } + this._fetchVisibleColorLayers = b; +}; + +/** + * Defines if the list of the elevation layers displayed have to be computed on pre-render event + * + * @param {Boolean} b - tells if the displayed elevation layers info should be fetched by the event PRE_RENDER + */ +GlobeViewExtended.prototype.preRenderEventFetchElevationLayersDisplayed = function (b) { + if (typeof b === "undefined") { + b = true; + } + this._fetchVisibleElevationLayers = b; +}; + +/** + * Defines if the list of the layers of all types displayed have to be computed on pre-render event + * + * @param {Boolean} b - tells if both displayed color layers and displayed elevation layers infos should be fetched by the event PRE_RENDER + */ +GlobeViewExtended.prototype.preRenderEventFetchLayersDisplayed = function (b) { + if (typeof b === "undefined") { + b = true; + } + this._fetchVisibleColorLayers = b; + this._fetchVisibleElevationLayers = b; +}; + +/** + * Get layer by its id + * + * @param {String} layerId - Layer id + * @return {Object} layer Object + */ +GlobeViewExtended.prototype.getLayerById = function (layerId) { + var layer = this.getGlobeView().getLayers(function (l) { + if (l.id === layerId) { + return l; + } + })[0]; + if (!layer) { + logger.trace("[GlobeViewExtended] : no Layer found for the id '" + layerId + "'"); + return; + } + return layer; +}; + +/** + * Get color layer by its id + * + * @param {String} layerId - Color layer id + * @return {Object} layer Object + */ +GlobeViewExtended.prototype.getColorLayerById = function (layerId) { + var layer = this.getGlobeView().getLayers(function (l) { + if (l.id === layerId && l.isColorLayer) { + return l; + } + })[0]; + if (!layer) { + logger.trace("[GlobeViewExtended] : no colorLayer found for the id '" + layerId + "'"); + return; + } + return layer; +}; + +/** + * Get imagery layers + * + * @return {Array} imagery layers + */ +GlobeViewExtended.prototype.getColorLayers = function () { + return this.getGlobeView().getLayers(function (layer) { + if (layer.isColorLayer) { + return layer; + } + }); +}; + +/** + * Get vector layers + * + * @return {Array} vector layers + */ +GlobeViewExtended.prototype.getVectorLayers = function () { + return this.getGlobeView().getLayers(function (layer) { + if (layer.source && layer.source.isFileSource) { + return layer; + } + }); +}; + +/** + * Get featureGeometry layers + * + * @return {Array} imagery layers + */ +GlobeViewExtended.prototype.getFeatureGeometryLayers = function () { + return this.getGlobeView().getLayers(function (layer) { + if (layer.isFeatureGeometryLayer) { + return layer; + } + }); +}; + +/** + * Get elevation layers + * + * @return {Array} elevation layers + */ +GlobeViewExtended.prototype.getElevationLayers = function () { + return this.getGlobeView().getLayers(function (layer) { + if (layer.isElevationLayer) { + return layer; + } + }); +}; + +/** + * Get the current view extent + * + * @returns {Array} current view extent + */ +GlobeViewExtended.prototype.getExtent = function () { + return this.getGlobeView().tileLayer.info.displayed.extent; +}; + +/** + * Add a widget to the globe + * + * @param {Object} widget - The Widget object to add + */ +GlobeViewExtended.prototype.addWidget = function (widget) { + if (!widget.getTarget()) { + // default position value is 'absolute' if the target div is the viewer div + widget.setTarget(this._viewerDiv, widget.getPosition() ? widget.getPosition() : "absolute"); + } + widget.setGlobe(this); + + // calls the widget code that is needed to be used after the globe is associated to the control (ex. Buildings wdget) + if (typeof widget.onWidgetAdded === "function") { + widget.onWidgetAdded(widget); + } + this._widgets.push(widget); +}; + +/** + * Returns all widgets. + * + * @return {Array} widgets - The array of widgets. + */ +GlobeViewExtended.prototype.getWidgets = function () { + return this._widgets; +}; + +/** + * Removes a widget. + * + * @param {Object} widget - The Widget object to remove + */ +GlobeViewExtended.prototype.removeWidget = function (widget) { + widget.setGlobe(); + for (var idx = 0; idx < this._widgets.length; idx++) { + if (this._widgets[idx] === widget) { + this._widgets.splice(idx, 1); + } + } +}; + +/** + * Get html target element + * + * @return {HTMLElement} Globe container element + */ +GlobeViewExtended.prototype.getTargetElement = function () { + return this._viewerDiv; +}; + +/** + * Returns current view scale + * + * @return {Number} Scale + */ +GlobeViewExtended.prototype.getScale = function () { + return this.getGlobeView().getScale(); +}; + +/** + * Sets tilt + * + * @param {Number} tilt - Tilt value + * @return {Promise} - Promise when setTilt is done + */ +GlobeViewExtended.prototype.setTilt = function (tilt) { + return this.getGlobeView().controls.setTilt(tilt, false); +}; + +/** + * Returns tilt + * + * @return {Number} - Tilt + */ +GlobeViewExtended.prototype.getTilt = function () { + return this.getGlobeView().controls.getTilt(); +}; + +/** + * Sets azimuth + * + * @param {Number} azimuth - Azimuth value + * @return {Promise} - Promise when setAzimuth is done + */ +GlobeViewExtended.prototype.setAzimuth = function (azimuth) { + return this.getGlobeView().controls.setHeading(azimuth, false); +}; + +/** + * Returns azimuth + * + * @return {Number} azimuth + */ +GlobeViewExtended.prototype.getAzimuth = function () { + return this.getGlobeView().controls.getHeading(); +}; + +/** + * Gets the coordinate in lat,lon for a given pixel. + * + * @param {Number} x - The pixel x-position inside the Globe element. + * @param {Number} y - The pixel y-position inside the Globe element. + * @return {Coordinates} position + */ +GlobeViewExtended.prototype.getCoordinateFromPixel = function (x, y) { + return this.getGlobeView().controls.pickGeoPosition({ + x: x, + y: y + }); +}; + +/** + * Gets the coordinate in lat,lon for a given mouse position. + * + * @param {MouseEvent} mouseEvent - A mouse event. + * @return {Coordinates} position + */ +GlobeViewExtended.prototype.getCoordinateFromMouseEvent = function (mouseEvent) { + var coords = this.getGlobeView().eventToViewCoords(mouseEvent); + return this.getGlobeView().controls.pickGeoPosition(coords); +}; + +/** + * Get all visible features that intersect a pixel + * + * @param {MouseEvent} mouseEvent - A mouse event. + * @return {Promise} promise + */ +GlobeViewExtended.prototype.getFeaturesAtMousePosition = function (mouseEvent) { + var vectorLayers = this.getVectorLayers(); + if (!vectorLayers) { + return Promise.resolve([]); + } + // array of the visible features on the clicker coord + var geoCoord = this.getCoordinateFromMouseEvent(mouseEvent); + if (!geoCoord) { + return Promise.resolve([]); + } + // buffer around the click inside we retrieve the features + var precisionInMeters = this.getGlobeView().getPixelsToMeters(5); + var precision = this.getGlobeView().getMetersToDegrees(precisionInMeters); + var promises = []; + for (var i = 0; i < vectorLayers.length; i++) { + if (!vectorLayers[i].visible) { + continue; + } + if (vectorLayers[i].isColorLayer) { + promises.push(vectorLayers[i].source.loadData({}, { + crs: "EPSG:4326" + })); + } + } + return Promise.all(promises).then(function (result) { + var visibleFeatures = []; + for (var _i = 0; _i < result.length; _i++) { + visibleFeatures = visibleFeatures.concat(itowns__WEBPACK_IMPORTED_MODULE_1__["FeaturesUtils"].filterFeaturesUnderCoordinate(geoCoord, result[_i], precision)); + } + return visibleFeatures; + }); +}; + +/** + * Changes the center of the scene on screen to the specified in lat, lon. + * + * @param {Object} center - Center object + * @param {Number} center.longitude - Coordinate longitude WGS84 in degree + * @param {Number} center.latitude - Coordinate latitude WGS84 in degree + * @return {Promise} A promise that resolves when the next 'globe initilazed' event fires. + */ +GlobeViewExtended.prototype.setCameraTargetGeoPosition = function (center) { + var itownsCoord = this._transformCoords(center); + return this.getGlobeView().controls.lookAtCoordinate(itownsCoord, false); +}; + +/** + * Retuns the coordinates of the central point on screen in lat,lon and alt + * + * @return {Object} center + */ +GlobeViewExtended.prototype.getCenter = function () { + var cameraCenter = this.getGlobeView().controls.getLookAtCoordinate(); + return this._fromItownsCoords(cameraCenter); +}; + +/** + * Returns the actual zoom. + * + * @return {Number} zoom + */ +GlobeViewExtended.prototype.getZoom = function () { + return this.getGlobeView().controls.getZoom(); +}; + +/** + * Sets the current zoom. + * + * @param {Number} zoom - The zoom + * @return {Promise} promise + */ +GlobeViewExtended.prototype.setZoom = function (zoom) { + return this.getGlobeView().controls.setZoom(zoom, false); +}; + +/** + * To convert the projection in meters on the globe of a number of pixels of screen + * @param {Number} pixels - count pixels to project + * @return {Number} projection in meters on globe + */ +GlobeViewExtended.prototype.pixelsToMeters = function (pixels) { + return this.getGlobeView().getPixelsToMeters(pixels); +}; + +/** + * Projection on screen in pixels of length in meter on globe + * @param {Number} value - Length in meter on globe + * @return {Number} projection in pixels on screen + */ +GlobeViewExtended.prototype.metersToPixels = function (value) { + return this.getGlobeView().getMetersToPixels(value); +}; + +/** + * Returns the "range": the distance in meters between the camera and the current central point on the screen. + * @return {Number} number + */ +GlobeViewExtended.prototype.getRange = function () { + return this.getGlobeView().controls.getRange(); +}; + +/** + * @return {THREE.Vector3} position + */ +GlobeViewExtended.prototype.getCameraTargetPosition = function () { + return this.getGlobeView().controls.getCameraTargetPosition(); +}; + +/** + * To get the layer event infos + * + * @param {Object} evt - event + * @returns {Object} object with event properties + */ +GlobeViewExtended.prototype.getLayerEventInfos = function (evt) { + var propertyName = evt.type.replace("-property-changed", ""); + return { + propertyName: propertyName, + previousValue: evt.previous[propertyName], + newValue: evt["new"][propertyName] + }; +}; + +/** + * Sets background (specific to miniglobe) + */ +GlobeViewExtended.prototype.setBackground = function () { + // Set a 0 alpha clear value (instead of the default '1') + // because we want a transparent background for the miniglobe view to be able + // to see the main view "behind" + this.getGlobeView().mainLoop.gfxEngine.renderer.setClearColor(0x000000, 0); +}; + +/** + * Sets camera position + * @param {THREE.Vector3} target - Target position + * @param {Number} distance - Distance from target + */ +GlobeViewExtended.prototype.setCameraPosition = function (target, distance) { + this.getGlobeView().camera.camera3D.position.copy(target).setLength(distance); +}; + +/** + * Sets camera orientation to look at specified target + * @param {THREE.Vector3} target - Target position + */ +GlobeViewExtended.prototype.lookAt = function (target) { + this.getGlobeView().camera.camera3D.lookAt(target); +}; + +/** + * Notifies the scene it needs to be updated + * @param {String} styleUrl - style url + * @returns {Object} json object + */ +GlobeViewExtended.prototype.parseMapboxStyle = function (styleUrl) { + return itowns__WEBPACK_IMPORTED_MODULE_1__["Fetcher"].json(styleUrl); +}; + +/** + * Notifies the scene it needs to be updated + */ +GlobeViewExtended.prototype.notifyChange = function () { + this.getGlobeView().notifyChange(this.getGlobeView().camera.camera3D); +}; + +/** +* Resizes itowns +* +* @param {Integer} width - canvas width in pixels +* @param {Integer} height - canvas height in pixels +*/ +GlobeViewExtended.prototype.resize = function (width, height) { + this.getGlobeView().mainLoop.gfxEngine.onWindowResize(width, height); + this.notifyChange(); +}; + +/** +* Transform to itowns coordinates +* +* @param {Object} coordCarto - longitude, latitude, altitude +* @returns {Object} itowns coordinates +*/ +GlobeViewExtended.prototype._transformCoords = function (coordCarto) { + if (coordCarto === undefined) return; + var itownsCoord = {}; + if (coordCarto.zoom !== undefined) itownsCoord.zoom = coordCarto.zoom; + if (coordCarto.tilt !== undefined) itownsCoord.tilt = coordCarto.tilt; + if (coordCarto.heading !== undefined) itownsCoord.heading = coordCarto.heading; + if (coordCarto.longitude !== undefined && coordCarto.latitude !== undefined) { + var altitude = coordCarto.altitude || 0; + itownsCoord.coord = new itowns__WEBPACK_IMPORTED_MODULE_1__["Coordinates"]("EPSG:4326", parseFloat(coordCarto.longitude), parseFloat(coordCarto.latitude), parseFloat(altitude)); + } + return itownsCoord; +}; + +/** +* Transform from itowns coordinates +* +* @param {Object} itownsCoord - itowns coordinates +* @returns {Object} coordinates +*/ +GlobeViewExtended.prototype._fromItownsCoords = function (itownsCoord) { + return { + lon: itownsCoord.x, + lat: itownsCoord.y, + alt: itownsCoord.z + }; +}; +/* harmony default export */ __webpack_exports__["default"] = (GlobeViewExtended); + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__94__; + +/***/ }), +/* 95 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +/** +* @module Utils +* @alias Gp.olUtils +* @description +* ... +* +* @example +* detectSupport(); +* assign(); +* mergeParams(); +*/ +var Utils = { + /** + * this method is called by the constructor. + * this information is useful to switch to touch mode. + * Detection : test for desktop or tactile + * + * @function detectSupport + * @returns {Boolean} isDesktop - true for desktop userAgent, false for mobile + */ + detectSupport: function detectSupport() { + var isDesktop = true; + var userAgent = window.navigator.userAgent.toLowerCase(); + if (userAgent.indexOf("iphone") !== -1 || userAgent.indexOf("ipod") !== -1 || userAgent.indexOf("ipad") !== -1 || userAgent.indexOf("android") !== -1 || userAgent.indexOf("mobile") !== -1 || userAgent.indexOf("blackberry") !== -1 || userAgent.indexOf("tablet") !== -1 || userAgent.indexOf("phone") !== -1 || userAgent.indexOf("touch") !== -1) { + isDesktop = false; + } + if (userAgent.indexOf("msie") !== -1 || userAgent.indexOf("trident") !== -1) { + isDesktop = true; + } + return isDesktop; + }, + /** + * Copies all source object members to dest + * + * @function assign + * @param {Object} dest - destination object where properties and method will be copied + * @param {Object} source - source object from which properties and method will be copied + * @returns {Object} dest + */ + assign: function assign(dest, source) { + dest = dest || {}; + for (var prop in source) { + if (source.hasOwnProperty(prop)) { + dest[prop] = source[prop]; + } + } + return dest; + }, + /** + * Merge two objects parameters (deeper than assign) + * + * @function mergeParams + * @param {Object} dest - destination object where properties and method will be merge + * @param {Object} source - source object from which properties and method will be merge + * @param {Boolean} replace - replace destination value by source if exists or not (true by default) + */ + mergeParams: function mergeParams(dest, source, replace) { + if (!dest || !source) { + return; + } + if (typeof replace === "undefined") { + replace = true; + } + for (var param in source) { + if (source.hasOwnProperty(param)) { + if (_typeof(source[param]) === "object") { + if (dest.hasOwnProperty(param)) { + this.mergeParams(dest[param], source[param], replace); + } else { + dest[param] = source[param]; + } + } else { + if (dest.hasOwnProperty(param)) { + if (replace) { + dest[param] = source[param]; + } + } else { + dest[param] = source[param]; + } + } + } + } + } +}; +/* harmony default export */ __webpack_exports__["default"] = (Utils); + +/***/ }), +/* 96 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * @module SelectorID + * @alias [private] SelectorID + * @description + * formalisme d'un tag ID : + * -> NAME(_ORDER)-1460636385836 + * + * @example + * Ex. + * GProutePoints-1460636385836 + * GProutePoint_10-1460636385836 + */ +var SelectorID = { + /** + * Construction d'un identifiant statique basé sur le timestamp, + * et qui s'incremente de +1 à chaque appel + * @function generate + */ + generate: function () { + var timestamp = Math.floor(Date.now()); + return function () { + return timestamp++; + }; + }(), + /** + * nom du tag + * @function name + * @param {String} id - the id + * @returns {String} index + */ + name: function name(id) { + var name = null; + var i = id.lastIndexOf("-"); + if (i === -1) { + name = id; + } else { + name = id.substring(0, i); + } + return name; + }, + /** + * numero d'identifiant du tag + * + * @function index + * @param {String} id - the id + * @returns {String} index + */ + index: function index(id) { + var index = null; + var name = this.name(id); + // if (name !== id) { + var i = name.lastIndexOf("_"); + if (i !== -1) { + index = name.substring(i + 1); + } + // } + + return index; + }, + /** + * uuid du tag + * + * @function uuid + * @param {String} id - the id + * @returns {String} uuid + */ + uuid: function uuid(id) { + var uuid = null; + var i = id.lastIndexOf("-"); + if (i !== -1) { + uuid = parseInt(id.substring(i + 1), 10); + } + return uuid; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (SelectorID); + +/***/ }), +/* 97 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +var MousePositionDOM = { + /** + * Add uuid to the tag ID + * @param {String} id - id selector + * @returns {String} uid - id selector with an unique id + */ + _addUID: function _addUID(id) { + var uid = this._uid ? id + "-" + this._uid : id; + return uid; + }, + /** + * Main container (DOM) + * + * @returns {DOMElement} DOM element + */ + _createMainContainerElement: function _createMainContainerElement() { + var container = document.createElement("div"); + container.id = this._addUID("GPmousePosition"); + container.className = "GPwidget"; + return container; + }, + // ################################################################### // + // ################### Methods of main container ##################### // + // ################################################################### // + + /** + * Hidden checkbox for minimizing/maximizing + * + * @returns {DOMElement} DOM element + */ + _createShowMousePositionElement: function _createShowMousePositionElement() { + var input = document.createElement("input"); + input.id = this._addUID("GPshowMousePosition"); + input.type = "checkbox"; + return input; + }, + /** + * Show mouse position control + * @param {Boolean} isDesktop - specifies if the support is desktop or tactile + * + * @returns {DOMElement} DOM element + */ + _createShowMousePositionPictoElement: function _createShowMousePositionPictoElement(isDesktop) { + // contexte d'execution + var self = this; + var label = document.createElement("label"); + label.id = this._addUID("GPshowMousePositionPicto"); + label.className = "GPshowAdvancedToolPicto"; + label.htmlFor = this._addUID("GPshowMousePosition"); + label.title = "Afficher les coordonnées du curseur"; + + // FIXME detection disponible dans le JS ! + // Detection : test for desktop or tactile + // var isDesktop = true; + // var userAgent = window.navigator.userAgent.toLowerCase(); + // if (userAgent.indexOf("iphone") !== -1 || + // userAgent.indexOf("ipod") !== -1 || + // userAgent.indexOf("ipad") !== -1 || + // userAgent.indexOf("android") !== -1 || + // userAgent.indexOf("mobile") !== -1 || + // userAgent.indexOf("blackberry") !== -1 || + // userAgent.indexOf("tablet") !== -1 || + // userAgent.indexOf("phone") !== -1 || + // userAgent.indexOf("touch") !== -1 ) { + // isDesktop = false; + // } + // if (userAgent.indexOf("msie") !== -1 || + // userAgent.indexOf("trident") !== -1) { + // isDesktop = true; + // } + + // Show map center localisation if panel opened and tactile support + label.addEventListener("click", function (e) { + var mapCenterClass = ""; + if (!document.getElementById(self._addUID("GPshowMousePosition")).checked && !isDesktop) { + mapCenterClass = "GPmapCenterVisible"; + } + document.getElementById("GPmapCenter").className = mapCenterClass; + self.onShowMousePositionClick(e); + }); + var spanOpen = document.createElement("span"); + spanOpen.id = this._addUID("GPshowMousePositionOpen"); + spanOpen.className = "GPshowAdvancedToolOpen"; + label.appendChild(spanOpen); + return label; + }, + /** + * mouse position panel + * + * @returns {DOMElement} DOM element + */ + _createMousePositionPanelElement: function _createMousePositionPanelElement() { + var panel = document.createElement("div"); + panel.id = this._addUID("GPmousePositionPanel"); + panel.className = "GPpanel"; + + // FIXME on decompose la fonction pour les besoins du controle, + // on ajoutera ces childs à la main... + // div.appendChild(this._createMousePositionPanelHeaderElement()); + // div.appendChild(this._createMousePositionPanelBasicElement()); + // div.appendChild(this._createShowMousePositionSettingsElement()); + // div.appendChild(this._createMousePositionSettingsElement()); + + return panel; + }, + /** + * Map center localisation (tactile use) + * + * @returns {DOMElement} container + */ + _createMapCenter: function _createMapCenter() { + var div = document.createElement("div"); + div.id = "GPmapCenter"; + div.className = ""; + return div; + }, + // ################################################################### // + // ####################### Panel container ########################### // + // ################################################################### // + + /** + * @returns {DOMElement} container + */ + _createMousePositionPanelHeaderElement: function _createMousePositionPanelHeaderElement() { + var container = document.createElement("div"); + container.className = "GPpanelHeader"; + var divTitle = document.createElement("div"); + divTitle.className = "GPpanelTitle"; + divTitle.innerHTML = "Coordonnées"; + container.appendChild(divTitle); + var divClose = document.createElement("div"); + divClose.id = "GPmousePositionPanelClose"; + divClose.className = "GPpanelClose"; + divClose.title = "Fermer le panneau"; + + // Link panel close / visibility checkbox + var self = this; + if (divClose.addEventListener) { + divClose.addEventListener("click", function () { + document.getElementById(self._addUID("GPshowMousePositionPicto")).click(); + }, false); + } else if (divClose.attachEvent) { + divClose.attachEvent("onclick", function () { + document.getElementById(self._addUID("GPshowMousePositionPicto")).click(); + }); + } + container.appendChild(divClose); + return container; + }, + /** + * coordinate panel + * @param {Boolean} [displayAltitude] - specifies if the altitude panel must be displayed + * @param {Boolean} [displayCoordinates] - specifies if the coordinates panel must be displayed + * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed + * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units + * + * FIXME + * call this._createMousePositionPanelBasicCoordinateElement + * call this._createMousePositionPanelBasicAltitudeElement + * + * @returns {DOMElement} DOM element + */ + _createMousePositionPanelBasicElement: function _createMousePositionPanelBasicElement(displayAltitude, displayCoordinates, editCoordinates, currentProjectionUnits) { + // default Values + displayAltitude = typeof displayAltitude === "undefined" ? true : displayAltitude; + displayCoordinates = typeof displayCoordinates === "undefined" ? true : displayCoordinates; + editCoordinates = typeof editCoordinates === "undefined" ? false : editCoordinates; + var container = document.createElement("div"); + container.id = this._addUID("GPmousePositionBasicPanel"); + + // FIXME on devrait decomposer la fonction pour les besoins du controle, + // on ajoutera ces childs à la main... + container.appendChild(this._createMousePositionPanelBasicCoordinateElement(displayCoordinates, editCoordinates, currentProjectionUnits)); + container.appendChild(this._createMousePositionPanelEditToolsElement(editCoordinates)); + container.appendChild(this._createMousePositionPanelBasicAltitudeElement(displayAltitude)); + return container; + }, + /** + * create coordinate elements + * + * @param {String} coordType - ("Lon" ou "Lat") + * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed + * + * @returns {Array} list of DOM elements + */ + _createCoordinateElement: function _createCoordinateElement(coordType, editCoordinates) { + var context = this; + if (["Lon", "Lat"].indexOf(coordType) === -1) { + return []; + } + var list = []; + var input = document.createElement("input"); + input.id = this._addUID("GPmousePosition" + coordType); + input.title = editCoordinates === true ? "Cliquer pour saisir des coordonnées" : ""; + input.readOnly = true; + if (editCoordinates) { + input.addEventListener("click", function () { + context.onMousePositionEditModeClick(true); + }); + input.addEventListener("change", function (e) { + this.classList.remove("error"); + var valid = context.validateExtentCoordinate(coordType, this.value, e); + valid ? this.classList.remove("error") : this.classList.add("error"); + }); + } + list.push(input); + var span = document.createElement("span"); + span.className = "GPmousePositionUnits"; + list.push(span); + return list; + }, + /** + * + * @param {String} coordType - ("Lon" ou "Lat") + * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed + * + * @returns {Array} list of DOM elements + */ + _createDMSCoordinateElement: function _createDMSCoordinateElement(coordType, editCoordinates) { + if (["Lon", "Lat"].indexOf(coordType) === -1) { + return []; + } + var context = this; + var list = []; + var input = document.createElement("input"); + input.id = this._addUID("GPmousePosition" + coordType + "Degrees"); + input.className = "GPSexagesimal"; + input.setAttribute("name", "degrees"); + input.title = editCoordinates === true ? "Cliquer pour saisir des coordonnées" : ""; + input.readOnly = true; + input.dataset.min = 0; + input.dataset.max = coordType === "Lon" ? 180 : 90; + if (editCoordinates) { + input.addEventListener("click", function () { + context.onMousePositionEditModeClick(true); + }); + input.addEventListener("change", function () { + this.classList.remove("error"); + var valid = context._checkDMSDegrees(coordType, this); + valid ? this.classList.remove("error") : this.classList.add("error"); + }); + } + list.push(input); + var span = document.createElement("span"); + span.className = "GPmousePositionSexagesimalLabel"; + span.innerHTML = "°"; + list.push(span); + var input1 = document.createElement("input"); + input1.id = this._addUID("GPmousePosition" + coordType + "Minutes"); + input1.className = "GPSexagesimal"; + input1.setAttribute("name", "minutes"); + input1.title = editCoordinates === true ? "Cliquer pour saisir des coordonnées" : ""; + input1.readOnly = true; + input1.dataset.min = 0; + input1.dataset.max = 59; + if (editCoordinates) { + input1.addEventListener("click", function () { + context.onMousePositionEditModeClick(true); + }); + input1.addEventListener("change", function () { + this.classList.remove("error"); + var valid = context._checkDMSElement(this); + valid ? this.classList.remove("error") : this.classList.add("error"); + }); + } + list.push(input1); + var span1 = document.createElement("span"); + span1.className = "GPmousePositionSexagesimalLabel"; + span1.innerHTML = "'"; + list.push(span1); + var input2 = document.createElement("input"); + input2.id = this._addUID("GPmousePosition" + coordType + "Seconds"); + input2.className = "GPSexagesimalsec"; + input2.setAttribute("name", "seconds"); + input2.title = editCoordinates === true ? "Cliquer pour saisir des coordonnées" : ""; + input2.readOnly = true; + input2.dataset.min = 0; + input2.dataset.max = 59; + if (editCoordinates) { + input2.addEventListener("click", function () { + context.onMousePositionEditModeClick(true); + }); + input2.addEventListener("change", function () { + this.classList.remove("error"); + var valid = context._checkDMSElement(this, true); + valid ? this.classList.remove("error") : this.classList.add("error"); + }); + } + list.push(input2); + var span2 = document.createElement("span"); + span2.className = "GPmousePositionSexagesimalLabel"; + span2.innerHTML = "''"; + list.push(span2); + var select = document.createElement("select"); + select.id = this._addUID("GPmousePosition" + coordType + "Direction"); + select.className = "GPmousePositionDirection"; + select.setAttribute("name", "direction"); + select.disabled = true; + var option = document.createElement("option"); + option.value = coordType === "Lon" ? "E" : "N"; + option.innerHTML = coordType === "Lon" ? "E" : "N"; + select.appendChild(option); + var option1 = document.createElement("option"); + option1.value = coordType === "Lon" ? "O" : "S"; + option1.innerHTML = coordType === "Lon" ? "O" : "S"; + select.appendChild(option1); + list.push(select); + return list; + }, + /** + * @param {Boolean} [display=false] - specifies if the coordinates panel must be displayed + * @param {Boolean} [editCoordinates] - specifies if the coordinates edition is allowed + * @param {Boolean} [currentProjectionUnits] - specifies if the current projection units + * + * @returns {DOMElement} container + */ + _createMousePositionPanelBasicCoordinateElement: function _createMousePositionPanelBasicCoordinateElement(display, editCoordinates, currentProjectionUnits) { + var div = document.createElement("div"); + div.id = this._addUID("GPmousePositionCoordinate"); + div.style.display = display ? "block" : "none"; + + // latitude + var divLat = document.createElement("div"); + var spanLat = document.createElement("span"); + spanLat.className = "GPmousePositionLabel"; + spanLat.id = this._addUID("GPmousePositionLatLabel"); + spanLat.innerHTML = "Latitude : "; + divLat.appendChild(spanLat); + var span = document.createElement("span"); + span.id = this._addUID("GPmousePositionLatCoordinate"); + var arrayCoords; + if (currentProjectionUnits === "DMS") { + arrayCoords = this._createDMSCoordinateElement("Lat", editCoordinates); + } else { + arrayCoords = this._createCoordinateElement("Lat", editCoordinates); + } + for (var i = 0; i < arrayCoords.length; i++) { + span.appendChild(arrayCoords[i]); + } + divLat.appendChild(span); + div.appendChild(divLat); + + // longitude + var divLon = document.createElement("div"); + var spanLon = document.createElement("span"); + spanLon.className = "GPmousePositionLabel"; + spanLon.id = this._addUID("GPmousePositionLonLabel"); + spanLon.innerHTML = "Longitude : "; + divLon.appendChild(spanLon); + var span1 = document.createElement("span"); + span1.id = this._addUID("GPmousePositionLonCoordinate"); + var arrayCoords1; + if (currentProjectionUnits === "DMS") { + arrayCoords1 = this._createDMSCoordinateElement("Lon", editCoordinates); + } else { + arrayCoords1 = this._createCoordinateElement("Lon", editCoordinates); + } + for (var j = 0; j < arrayCoords1.length; j++) { + span1.appendChild(arrayCoords1[j]); + } + divLon.appendChild(span1); + div.appendChild(divLon); + return div; + }, + /** + * @param {Boolean} [display=false] - specifies if the altitude panel must be displayed + * + * @returns {DOMElement} container + */ + _createMousePositionPanelBasicAltitudeElement: function _createMousePositionPanelBasicAltitudeElement(display) { + var div = document.createElement("div"); + div.id = this._addUID("GPmousePositionAltitude"); + div.style.display = display ? "block" : "none"; + var spanLabel = document.createElement("span"); + spanLabel.className = "GPmousePositionLabel"; + spanLabel.innerHTML = "Altitude : "; + div.appendChild(spanLabel); + var spanAlt = document.createElement("span"); + spanAlt.className = "GPmousePositionCoords"; + spanAlt.id = this._addUID("GPmousePositionAlt"); + spanAlt.innerHTML = "..."; + div.appendChild(spanAlt); + var spanUnits = document.createElement("span"); + spanUnits.className = "GPmousePositionAltitudeUnits"; + spanUnits.innerHTML = "m"; + div.appendChild(spanUnits); + return div; + }, + /** + * @param {Boolean} [editCoordinates=false] - specifies if the coordinates edition is allowed + * + * @returns {DOMElement} container + */ + _createMousePositionPanelEditToolsElement: function _createMousePositionPanelEditToolsElement(editCoordinates) { + var context = this; + var div = document.createElement("div"); + div.className = "GPmousePositionPanelEditTools"; + div.id = this._addUID("GPmousePositionPanelEditTools"); + if (!editCoordinates) { + div.style.display = "none"; + } + var span1 = document.createElement("span"); + span1.className = "GPmousePositionEditTool"; + span1.id = this._addUID("GPmousePositionLocate"); + span1.title = editCoordinates === true ? "Cliquer pour saisir des coordonnées" : ""; + if (editCoordinates) { + span1.addEventListener("click", function () { + context.onMousePositionEditModeLocateClick(); + }); + } + div.appendChild(span1); + var span2 = document.createElement("span"); + span2.className = "GPmousePositionEditTool"; + span2.id = this._addUID("GPmousePositionCloseEdit"); + span2.title = "Quitter la saisie des coordonnées"; + span2.style.display = "none"; + if (editCoordinates) { + span2.addEventListener("click", function () { + context.onMousePositionEditModeClick(false); + }); + } + div.appendChild(span2); + return div; + }, + // ################################################################### // + // #################### Settings container ########################### // + // ################################################################### // + + /** + * @param {Boolean} [display=false] - specifies if the settings panel must be displayed + * + * @returns {DOMElement[]} array containing input and label elements + */ + _createShowMousePositionSettingsElement: function _createShowMousePositionSettingsElement(display) { + var list = []; + var context = this; + var input = document.createElement("input"); + input.type = "checkbox"; + input.id = this._addUID("GPshowMousePositionSettings"); + var label = document.createElement("label"); + label.id = this._addUID("GPshowMousePositionSettingsPicto"); + label.htmlFor = this._addUID("GPshowMousePositionSettings"); + label.title = "Réglages"; + label.className = "GPshowMoreOptionsImage GPshowMoreOptions GPshowMousePositionSettingsPicto"; // FIXME classname and id ? + label.style.display = display ? "block" : "none"; + if (label.addEventListener) { + label.addEventListener("click", function (e) { + if (typeof context.onShowMousePositionSettingsClick === "function") { + context.onShowMousePositionSettingsClick(e); + } + }, false); + } else if (label.attachEvent) { + label.attachEvent("onclick", function (e) { + if (typeof context.onShowMousePositionSettingsClick === "function") { + context.onShowMousePositionSettingsClick(e); + } + }); + } + list.push(input); + list.push(label); + return list; + }, + /** + * settings panel + * @param {Boolean} [display=true] - specifies if the settings panel must be displayed + * + * FIXME + * don't call this._createMousePositionSettingsSystemsElement + * don't call this._createMousePositionSettingsUnitsElement + * + * @returns {DOMElement} DOM element + */ + _createMousePositionSettingsElement: function _createMousePositionSettingsElement(display) { + var container = document.createElement("div"); + container.id = this._addUID("GPmousePositionSettings"); + container.style.display = display === undefined || display ? "block" : "none"; + var span = document.createElement("span"); + span.className = "GPmousePositionSettingsLabel"; + span.innerHTML = "Système de référence"; + container.appendChild(span); + + // FIXME on decompose la fonction pour les besoins du controle, + // on ajoutera ces childs à la main... + // FIXME tableau statique ! + // var systems = [ + // { + // code : "GEOGRAPHIC", + // label : "Géographique" + // }, + // { + // code : "MERCATOR", + // label : "Mercator" + // }, + // { + // code : "LAMB93", + // label : "Lambert 93" + // }, + // { + // code : "LAMB2E", + // label : "Lambert II étendu" + // } + // ]; + // + // var selectSystem = this._createMousePositionSettingsSystemsElement(systems); + // + // container.appendChild(selectSystem); + + // FIXME on decompose la fonction pour les besoins du controle, + // on ajoutera ces childs à la main... + // FIXME tableau statique ! + // var units = [ + // { + // code : "DEC", + // label : "degrés décimaux", + // }, + // { + // code : "DMS", + // label : "degrés sexagésimaux", + // }, + // { + // code : "RAD", + // label : "radians", + // }, + // { + // code : "GON", + // label : "grades" + // } + // ]; + // + // var selectUnits = this._createMousePositionSettingsUnitsElement(units); + // + // container.appendChild(selectUnits); + + return container; + }, + /** + * @param {Object[]} systems - list of systems + * + * @returns {DOMElement} DOM element select + */ + _createMousePositionSettingsSystemsElement: function _createMousePositionSettingsSystemsElement(systems) { + // contexte d'execution + var context = this; + var selectSystem = document.createElement("select"); + selectSystem.id = this._addUID("GPmousePositionProjectionSystem"); + selectSystem.className = "GPinputSelect GPmousePositionSettingsSelect"; + selectSystem.addEventListener("change", function (e) { + context.onMousePositionProjectionSystemChange(e); + }); + selectSystem.addEventListener("mouseover", function (e) { + // FIXME mettre une condition si target === option + if (e.target.nodeName !== "OPTION") { + context.onMousePositionProjectionSystemMouseOver(e); + } + }); + for (var i = 0; i < systems.length; i++) { + var obj = systems[i]; + var option = document.createElement("option"); + option.value = obj.code; + option.text = obj.label || i; + // option.label = obj.label; + selectSystem.appendChild(option); + } + return selectSystem; + }, + /** + * @param {Object[]} units - list of units + * + * @returns {DOMElement} DOM element select + */ + _createMousePositionSettingsUnitsElement: function _createMousePositionSettingsUnitsElement(units) { + // contexte d'execution + var context = this; + var selectUnits = document.createElement("select"); + selectUnits.id = this._addUID("GPmousePositionProjectionUnits"); + selectUnits.className = "GPinputSelect GPmousePositionSettingsSelect"; + selectUnits.addEventListener("change", function (e) { + context.onMousePositionProjectionUnitsChange(e); + }); + for (var j = 0; j < units.length; j++) { + var obj = units[j]; + var option = document.createElement("option"); + option.value = obj.code ? obj.code : j; + option.text = obj.label || j; + // option.label = obj.label; + selectUnits.appendChild(option); + } + return selectUnits; + }, + /** + * @param {String} [currentProjectionType="Metric"] - "Geographical" or "Metric" + */ + _resetLabelElements: function _resetLabelElements(currentProjectionType) { + // Changement des labels dans le formulaire de saisie + var spanLat = document.getElementById(this._addUID("GPmousePositionLatLabel")); + spanLat.innerHTML = currentProjectionType === "Geographical" ? "Latitude :" : "X :"; + var spanLon = document.getElementById(this._addUID("GPmousePositionLonLabel")); + spanLon.innerHTML = currentProjectionType === "Geographical" ? "Longitude :" : "Y :"; + }, + /** + * @param {String} currentProjectionUnits - projection units + */ + _resetUnitElements: function _resetUnitElements(currentProjectionUnits) { + var value = ""; + if (currentProjectionUnits === "M" || currentProjectionUnits === "KM") { + value = currentProjectionUnits.toLowerCase(); + } + var elts = document.getElementsByClassName("GPmousePositionUnits"); + for (var e = 0; e < elts.length; e++) { + elts[e].innerHTML = value; + } + }, + /** + * @param {Boolean} editCoordinates - edit coordinates option + * @param {String} currentProjectionType - current projection type + * @param {String} currentProjectionUnits - current projection unit + */ + _resetCoordinateElements: function _resetCoordinateElements(editCoordinates, currentProjectionType, currentProjectionUnits) { + // Suppression de tous les enfants de GPmousePositionLatCoordinate + var latElt = document.getElementById(this._addUID("GPmousePositionLatCoordinate")); + while (latElt.firstChild) { + latElt.removeChild(latElt.firstChild); + } + var arrayCoords; + if (currentProjectionUnits === "DMS") { + arrayCoords = this._createDMSCoordinateElement("Lat", editCoordinates); + } else { + arrayCoords = this._createCoordinateElement("Lat", editCoordinates); + } + for (var i = 0; i < arrayCoords.length; i++) { + latElt.appendChild(arrayCoords[i]); + } + + // Suppression de tous les enfants de GPmousePositionLonCoordinate + var lonElt = document.getElementById(this._addUID("GPmousePositionLonCoordinate")); + while (lonElt.firstChild) { + lonElt.removeChild(lonElt.firstChild); + } + var arrayCoords1; + if (currentProjectionUnits === "DMS") { + arrayCoords1 = this._createDMSCoordinateElement("Lon", editCoordinates); + } else { + arrayCoords1 = this._createCoordinateElement("Lon", editCoordinates); + } + for (var j = 0; j < arrayCoords1.length; j++) { + lonElt.appendChild(arrayCoords1[j]); + } + + // FIXME on simule un deplacement ? + // this.onMapMove(); + }, + + /** + * Set/unset editing mode + * + * @param {Boolean} editing - active edit coordinates mode + */ + _setEditMode: function _setEditMode(editing) { + var locateElt = document.getElementById(this._addUID("GPmousePositionLocate")); + locateElt.title = editing ? "Aller à la position ..." : "Cliquer pour saisir des coordonnées"; + var closeEditElt = document.getElementById(this._addUID("GPmousePositionCloseEdit")); + closeEditElt.style.display = editing ? "inline-block" : "none"; + var selector = "div[id^=" + this._addUID("GPmousePositionCoordinate") + "]"; + var inputs = document.querySelectorAll(selector + " input"); + for (var i = 0; i < inputs.length; i++) { + inputs[i].readOnly = !editing; + if (editing) { + inputs[i].value = ""; + inputs[i].classList.remove("error"); + } + } + var selects = document.querySelectorAll(selector + " select"); + for (var j = 0; j < selects.length; j++) { + selects[j].disabled = !editing; + } + }, + /** + * + * @param {DOMElement} input - input element + * @param {Boolean} isFloat - check for float value + * + * @returns {Boolean} true if input value is within bounds + */ + _checkDMSElement: function _checkDMSElement(input, isFloat) { + var b = isFloat !== undefined; + var value = input.value; + if (b) { + value = value.replace(",", "."); + } + if (isNaN(value)) { + return false; + } + var v = parseFloat(value); + if (!b && (v | 0) !== v) { + // is it an integer + return false; + } + var min = Number(input.dataset.min); + var max = Number(input.dataset.max); + return v >= min && v <= max; + }, + /** + * @param {String} coordType - "Lon" or "Lat" + * @param {DOMElement} input - input element + * + * @returns {Boolean} true if input value is within bounds + */ + _checkDMSDegrees: function _checkDMSDegrees(coordType, input) { + if (isNaN(input.value)) { + return false; + } + var v = parseFloat(input.value); + if ((v | 0) !== v) { + // is it an integer + return false; + } + var min = Number(input.dataset.min); + var max = Number(input.dataset.max); + if (v < min || v > max) { + return false; + } + var inputMinutes = document.getElementById(this._addUID("GPmousePosition" + coordType + "Minutes")); + var inputSeconds = document.getElementById(this._addUID("GPmousePosition" + coordType + "Seconds")); + if (v >= max) { + inputMinutes.dataset.max = 0; + inputSeconds.dataset.max = 0; + } else { + inputMinutes.dataset.max = 59; + inputSeconds.dataset.max = 59.9999; + } + return true; + }, + // ################################################################### // + // ####################### handlers Event ############################ // + // ################################################################### // + + /** + * Function displaying coordinates from cursor position (desktop) + * or map center (tactile) + * @param {Object} coordinate - coordinates + */ + GPdisplayCoords: function GPdisplayCoords(coordinate) { + // Compute coords in case of cursor position (desktop) + if (coordinate) { + var labelLon = document.getElementById(this._addUID("GPmousePositionLonLabel")); + var labelLat = document.getElementById(this._addUID("GPmousePositionLatLabel")); + if (coordinate.x || coordinate.y) { + labelLat.innerHTML = "X : "; + labelLon.innerHTML = "Y : "; + } else if (coordinate.e || coordinate.n) { + labelLat.innerHTML = "E : "; + labelLon.innerHTML = "N : "; + } else { + labelLat.innerHTML = "Latitude : "; + labelLon.innerHTML = "Longitude : "; + } + if (_typeof(coordinate.lat) === "object" && _typeof(coordinate.lng) === "object") { + var parts = { + lng: "Lon", + lat: "Lat" + }; + var units = ["Degrees", "Minutes", "Seconds"]; + for (var p in parts) { + for (var u = 0; u < units.length; ++u) { + var selector = "GPmousePosition" + parts[p] + units[u]; + var elt = document.getElementById(this._addUID(selector)); + var key = units[u].charAt(0).toLowerCase(); + elt.value = coordinate[p][key]; + } + } + // directions + document.getElementById(this._addUID("GPmousePositionLonDirection")).value = coordinate.lng.direction; + document.getElementById(this._addUID("GPmousePositionLatDirection")).value = coordinate.lat.direction; + } else { + var elLat = document.getElementById(this._addUID("GPmousePositionLat")); + var elLon = document.getElementById(this._addUID("GPmousePositionLon")); + elLat.value = coordinate.x || coordinate.lat || coordinate.e || "0"; + elLon.value = coordinate.y || coordinate.lng || coordinate.lon || coordinate.n || "0"; + + // les unites + var unit = coordinate.unit === undefined ? "" : coordinate.unit; + var elements = document.getElementsByClassName("GPmousePositionUnits"); + for (var n = 0; n < elements.length; ++n) { + elements[n].innerHTML = unit; + } + } + } + }, + /** + * Function displaying altitude from cursor position (desktop) + * or map center (tactile) + * @param {Object} coordinate - coordinates + * @param {Number} altitudeTimeoutDelay - when the mouse stop moving, delay before the altitude request is launched + * @param {Number} noDataValue - the no data value + * @param {Number} noDataValueTolerance - the no data value tolerance + */ + GPdisplayElevation: function GPdisplayElevation(coordinate, altitudeTimeoutDelay, noDataValue, noDataValueTolerance) { + // contexte d'execution + var self = this; + + // Latency for altitude request + var altitudeTimeout; + if (!altitudeTimeoutDelay) { + altitudeTimeoutDelay = 500; + } + clearTimeout(altitudeTimeout); + document.getElementById(this._addUID("GPmousePositionAlt")).innerHTML = "..."; + if (noDataValue == null) { + noDataValue = -99999; + } + if (noDataValueTolerance == null) { + noDataValueTolerance = 99980; + } + var maxThreshold = noDataValue + noDataValueTolerance; + var minThreshold = noDataValue - noDataValueTolerance; + + // Compute coords in case of cursor position (desktop) + if (coordinate) { + // If no altitude panel, don't call altitude request + if (document.getElementById(this._addUID("GPmousePositionAltitude"))) { + altitudeTimeout = setTimeout(function () { + self.onRequestAltitude(coordinate, function (z) { + if (minThreshold < z && z < maxThreshold) { + self.GPresetElevation(); + } else { + document.getElementById(self._addUID("GPmousePositionAlt")).innerHTML = z; + } + }); + }, altitudeTimeoutDelay); + } + } + }, + /** + * Function reseting altitude value + */ + GPresetElevation: function GPresetElevation() { + if (document.getElementById(this._addUID("GPmousePositionAltitude"))) { + document.getElementById(this._addUID("GPmousePositionAlt")).innerHTML = "---"; + } + } +}; +/* harmony default export */ __webpack_exports__["default"] = (MousePositionDOM); + +/***/ }), +/* 98 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); +// import { THREE } from "itowns"; + + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__["default"].getLogger("Widget"); + +/** +* @classdesc +* iTowns Widget class. +* Every geoportal control inherits of this class. +* +* @constructor +* @alias itowns.control.Widget +* @param {Object} options - options for function call. +* @param {String} options.name - Name of the widget. +* @param {Object} options.element - HTML element of the widget +* @param {Object|String} options.target - HTML element or HTML element id where to put the widget +* @param {String} options.position - "absolute" or "relative" +* @example +* var myWidget = new itowns.control.Widget({ +* name : "myWidget", +* element : myWidgetDiv, +* target : myWidgetTargetDiv, +* position: "absolute" +* }); +*/ +function Widget(options) { + this._name = options.name !== undefined ? options.name : null; + this._element = options.element !== undefined ? options.element : null; + this._position = options.position !== undefined ? options.position : null; + this._target = null; + this._globe = null; + if (options.target) { + this.setTarget(options.target, this._position); + } +} + +/* + * @lends module:Attributions + */ +Widget.prototype = Object.create( /* THREE */three__WEBPACK_IMPORTED_MODULE_0__["EventDispatcher"].prototype, {}); + +/** + * Constructor (alias) + */ +Widget.prototype.constructor = Widget; + +/** + * Return the widget's container element. + * + * @method + * @return {HTMLElement} widget's container element. + */ +Widget.prototype.getElement = function getElement() { + return this._element; +}; + +/** + * Associates the widget to a specified target div. + * + * @method + * @param {HTMLElement|String} target - widget target div html element or target div id. + * @param {String} position - html position attribute. + */ +Widget.prototype.setTarget = function setTarget(target, position) { + this._target = typeof target === "string" ? document.getElementById(target) : target; + if (!this._element) { + logger.error("Widget:setTarget - widget element not created"); + return; + } + this._element.style.position = position || "relative"; + this._target.appendChild(this._element); +}; + +/** + * Return the widget's target div. + * + * @method + * @return {HTMLElement} widget's target div. + */ +Widget.prototype.getTarget = function getTarget() { + return this._target; +}; + +/** + * Return the widget's element div. + * + * @method + * @return {HTMLElement} widget's element div. + */ +Widget.prototype.getElement = function getElement() { + return this._element; +}; + +/** + * Return the widget's element position. + * + * @method + * @return {String} widget's element position. + */ +Widget.prototype.getPosition = function getPosition() { + return this._position; +}; + +/** + * Get the globe associated with the widget. Undefined if the widget is not added to a globe. + * + * @method + * @return {Object} globe + */ +Widget.prototype.getGlobe = function getGlobe() { + return this._globe; +}; + +/** + * Associate a globe to the widget. + * + * @method + * @param {Object} globe - Globe to associate to the widget. + */ +Widget.prototype.setGlobe = function setGlobe(globe) { + this._globe = globe; +}; + +/** + * Get the options associated with the widget. + * + * @method + * @return {Object} options + */ +Widget.prototype.getOptions = function getOptions() { + return this._options; +}; + +/** + * Set the options of the control + * + * @method + * @param {Object} options - Options to associate to the widget. + */ +Widget.prototype.setOptions = function setOptions(options) { + this._options = options; +}; +/* harmony default export */ __webpack_exports__["default"] = (Widget); + +/***/ }), +/* 99 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ACESFilmicToneMapping", function() { return ACESFilmicToneMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddEquation", function() { return AddEquation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddOperation", function() { return AddOperation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdditiveAnimationBlendMode", function() { return AdditiveAnimationBlendMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdditiveBlending", function() { return AdditiveBlending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlphaFormat", function() { return AlphaFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlwaysDepth", function() { return AlwaysDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlwaysStencilFunc", function() { return AlwaysStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AmbientLight", function() { return AmbientLight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AmbientLightProbe", function() { return AmbientLightProbe; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationClip", function() { return AnimationClip; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationLoader", function() { return AnimationLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationMixer", function() { return AnimationMixer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationObjectGroup", function() { return AnimationObjectGroup; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationUtils", function() { return AnimationUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArcCurve", function() { return ArcCurve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayCamera", function() { return ArrayCamera; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrowHelper", function() { return ArrowHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Audio", function() { return Audio; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AudioAnalyser", function() { return AudioAnalyser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AudioContext", function() { return AudioContext; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AudioListener", function() { return AudioListener; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AudioLoader", function() { return AudioLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AxesHelper", function() { return AxesHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AxisHelper", function() { return AxisHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BackSide", function() { return BackSide; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicDepthPacking", function() { return BasicDepthPacking; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicShadowMap", function() { return BasicShadowMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BinaryTextureLoader", function() { return BinaryTextureLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bone", function() { return Bone; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BooleanKeyframeTrack", function() { return BooleanKeyframeTrack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundingBoxHelper", function() { return BoundingBoxHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box2", function() { return Box2; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box3", function() { return Box3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box3Helper", function() { return Box3Helper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoxBufferGeometry", function() { return BoxGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoxGeometry", function() { return BoxGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoxHelper", function() { return BoxHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BufferAttribute", function() { return BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BufferGeometry", function() { return BufferGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BufferGeometryLoader", function() { return BufferGeometryLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByteType", function() { return ByteType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cache", function() { return Cache; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Camera", function() { return Camera; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CameraHelper", function() { return CameraHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CanvasRenderer", function() { return CanvasRenderer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CanvasTexture", function() { return CanvasTexture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CatmullRomCurve3", function() { return CatmullRomCurve3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CineonToneMapping", function() { return CineonToneMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CircleBufferGeometry", function() { return CircleGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CircleGeometry", function() { return CircleGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClampToEdgeWrapping", function() { return ClampToEdgeWrapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Clock", function() { return Clock; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorKeyframeTrack", function() { return ColorKeyframeTrack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressedTexture", function() { return CompressedTexture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressedTextureLoader", function() { return CompressedTextureLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConeBufferGeometry", function() { return ConeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConeGeometry", function() { return ConeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubeCamera", function() { return CubeCamera; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubeReflectionMapping", function() { return CubeReflectionMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubeRefractionMapping", function() { return CubeRefractionMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubeTexture", function() { return CubeTexture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubeTextureLoader", function() { return CubeTextureLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubeUVReflectionMapping", function() { return CubeUVReflectionMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubeUVRefractionMapping", function() { return CubeUVRefractionMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubicBezierCurve", function() { return CubicBezierCurve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubicBezierCurve3", function() { return CubicBezierCurve3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CubicInterpolant", function() { return CubicInterpolant; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CullFaceBack", function() { return CullFaceBack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CullFaceFront", function() { return CullFaceFront; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CullFaceFrontBack", function() { return CullFaceFrontBack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CullFaceNone", function() { return CullFaceNone; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Curve", function() { return Curve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CurvePath", function() { return CurvePath; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomBlending", function() { return CustomBlending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomToneMapping", function() { return CustomToneMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CylinderBufferGeometry", function() { return CylinderGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CylinderGeometry", function() { return CylinderGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cylindrical", function() { return Cylindrical; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataTexture", function() { return DataTexture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataTexture2DArray", function() { return DataTexture2DArray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataTexture3D", function() { return DataTexture3D; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataTextureLoader", function() { return DataTextureLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataUtils", function() { return DataUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecrementStencilOp", function() { return DecrementStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecrementWrapStencilOp", function() { return DecrementWrapStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultLoadingManager", function() { return DefaultLoadingManager; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DepthFormat", function() { return DepthFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DepthStencilFormat", function() { return DepthStencilFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DepthTexture", function() { return DepthTexture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DirectionalLight", function() { return DirectionalLight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DirectionalLightHelper", function() { return DirectionalLightHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiscreteInterpolant", function() { return DiscreteInterpolant; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DodecahedronBufferGeometry", function() { return DodecahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DodecahedronGeometry", function() { return DodecahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoubleSide", function() { return DoubleSide; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DstAlphaFactor", function() { return DstAlphaFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DstColorFactor", function() { return DstColorFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DynamicBufferAttribute", function() { return DynamicBufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DynamicCopyUsage", function() { return DynamicCopyUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DynamicDrawUsage", function() { return DynamicDrawUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DynamicReadUsage", function() { return DynamicReadUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EdgesGeometry", function() { return EdgesGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EdgesHelper", function() { return EdgesHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EllipseCurve", function() { return EllipseCurve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EqualDepth", function() { return EqualDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EqualStencilFunc", function() { return EqualStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EquirectangularReflectionMapping", function() { return EquirectangularReflectionMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EquirectangularRefractionMapping", function() { return EquirectangularRefractionMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Euler", function() { return Euler; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventDispatcher", function() { return EventDispatcher; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExtrudeBufferGeometry", function() { return ExtrudeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExtrudeGeometry", function() { return ExtrudeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FaceColors", function() { return FaceColors; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileLoader", function() { return FileLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlatShading", function() { return FlatShading; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Float16BufferAttribute", function() { return Float16BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Float32Attribute", function() { return Float32Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Float32BufferAttribute", function() { return Float32BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Float64Attribute", function() { return Float64Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Float64BufferAttribute", function() { return Float64BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FloatType", function() { return FloatType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Fog", function() { return Fog; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FogExp2", function() { return FogExp2; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Font", function() { return Font; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontLoader", function() { return FontLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FramebufferTexture", function() { return FramebufferTexture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FrontSide", function() { return FrontSide; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Frustum", function() { return Frustum; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLBufferAttribute", function() { return GLBufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLSL1", function() { return GLSL1; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLSL3", function() { return GLSL3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GreaterDepth", function() { return GreaterDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GreaterEqualDepth", function() { return GreaterEqualDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GreaterEqualStencilFunc", function() { return GreaterEqualStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GreaterStencilFunc", function() { return GreaterStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridHelper", function() { return GridHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Group", function() { return Group; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HalfFloatType", function() { return HalfFloatType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HemisphereLight", function() { return HemisphereLight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HemisphereLightHelper", function() { return HemisphereLightHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HemisphereLightProbe", function() { return HemisphereLightProbe; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IcosahedronBufferGeometry", function() { return IcosahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IcosahedronGeometry", function() { return IcosahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImageBitmapLoader", function() { return ImageBitmapLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImageLoader", function() { return ImageLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImageUtils", function() { return ImageUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmediateRenderObject", function() { return ImmediateRenderObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IncrementStencilOp", function() { return IncrementStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IncrementWrapStencilOp", function() { return IncrementWrapStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InstancedBufferAttribute", function() { return InstancedBufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InstancedBufferGeometry", function() { return InstancedBufferGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InstancedInterleavedBuffer", function() { return InstancedInterleavedBuffer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InstancedMesh", function() { return InstancedMesh; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Int16Attribute", function() { return Int16Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Int16BufferAttribute", function() { return Int16BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Int32Attribute", function() { return Int32Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Int32BufferAttribute", function() { return Int32BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Int8Attribute", function() { return Int8Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Int8BufferAttribute", function() { return Int8BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntType", function() { return IntType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterleavedBuffer", function() { return InterleavedBuffer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterleavedBufferAttribute", function() { return InterleavedBufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interpolant", function() { return Interpolant; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterpolateDiscrete", function() { return InterpolateDiscrete; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterpolateLinear", function() { return InterpolateLinear; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterpolateSmooth", function() { return InterpolateSmooth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InvertStencilOp", function() { return InvertStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONLoader", function() { return JSONLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeepStencilOp", function() { return KeepStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyframeTrack", function() { return KeyframeTrack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOD", function() { return LOD; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LatheBufferGeometry", function() { return LatheGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LatheGeometry", function() { return LatheGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Layers", function() { return Layers; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LensFlare", function() { return LensFlare; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LessDepth", function() { return LessDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LessEqualDepth", function() { return LessEqualDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LessEqualStencilFunc", function() { return LessEqualStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LessStencilFunc", function() { return LessStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Light", function() { return Light; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LightProbe", function() { return LightProbe; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Line", function() { return Line; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Line3", function() { return Line3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineBasicMaterial", function() { return LineBasicMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineCurve", function() { return LineCurve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineCurve3", function() { return LineCurve3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineDashedMaterial", function() { return LineDashedMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineLoop", function() { return LineLoop; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinePieces", function() { return LinePieces; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineSegments", function() { return LineSegments; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineStrip", function() { return LineStrip; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearEncoding", function() { return LinearEncoding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearFilter", function() { return LinearFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearInterpolant", function() { return LinearInterpolant; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearMipMapLinearFilter", function() { return LinearMipMapLinearFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearMipMapNearestFilter", function() { return LinearMipMapNearestFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearMipmapLinearFilter", function() { return LinearMipmapLinearFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearMipmapNearestFilter", function() { return LinearMipmapNearestFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearToneMapping", function() { return LinearToneMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Loader", function() { return Loader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoaderUtils", function() { return LoaderUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoadingManager", function() { return LoadingManager; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoopOnce", function() { return LoopOnce; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoopPingPong", function() { return LoopPingPong; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoopRepeat", function() { return LoopRepeat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LuminanceAlphaFormat", function() { return LuminanceAlphaFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LuminanceFormat", function() { return LuminanceFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MOUSE", function() { return MOUSE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Material", function() { return Material; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaterialLoader", function() { return MaterialLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Math", function() { return MathUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MathUtils", function() { return MathUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix3", function() { return Matrix3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix4", function() { return Matrix4; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaxEquation", function() { return MaxEquation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mesh", function() { return Mesh; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshBasicMaterial", function() { return MeshBasicMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshDepthMaterial", function() { return MeshDepthMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshDistanceMaterial", function() { return MeshDistanceMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshFaceMaterial", function() { return MeshFaceMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshLambertMaterial", function() { return MeshLambertMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshMatcapMaterial", function() { return MeshMatcapMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshNormalMaterial", function() { return MeshNormalMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshPhongMaterial", function() { return MeshPhongMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshPhysicalMaterial", function() { return MeshPhysicalMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshStandardMaterial", function() { return MeshStandardMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshToonMaterial", function() { return MeshToonMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinEquation", function() { return MinEquation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirroredRepeatWrapping", function() { return MirroredRepeatWrapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MixOperation", function() { return MixOperation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiMaterial", function() { return MultiMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiplyBlending", function() { return MultiplyBlending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiplyOperation", function() { return MultiplyOperation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NearestFilter", function() { return NearestFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NearestMipMapLinearFilter", function() { return NearestMipMapLinearFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NearestMipMapNearestFilter", function() { return NearestMipMapNearestFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NearestMipmapLinearFilter", function() { return NearestMipmapLinearFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NearestMipmapNearestFilter", function() { return NearestMipmapNearestFilter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NeverDepth", function() { return NeverDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NeverStencilFunc", function() { return NeverStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoBlending", function() { return NoBlending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoColors", function() { return NoColors; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoToneMapping", function() { return NoToneMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NormalAnimationBlendMode", function() { return NormalAnimationBlendMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NormalBlending", function() { return NormalBlending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotEqualDepth", function() { return NotEqualDepth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotEqualStencilFunc", function() { return NotEqualStencilFunc; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberKeyframeTrack", function() { return NumberKeyframeTrack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Object3D", function() { return Object3D; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectLoader", function() { return ObjectLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectSpaceNormalMap", function() { return ObjectSpaceNormalMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OctahedronBufferGeometry", function() { return OctahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OctahedronGeometry", function() { return OctahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneFactor", function() { return OneFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneMinusDstAlphaFactor", function() { return OneMinusDstAlphaFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneMinusDstColorFactor", function() { return OneMinusDstColorFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneMinusSrcAlphaFactor", function() { return OneMinusSrcAlphaFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneMinusSrcColorFactor", function() { return OneMinusSrcColorFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OrthographicCamera", function() { return OrthographicCamera; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PCFShadowMap", function() { return PCFShadowMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PCFSoftShadowMap", function() { return PCFSoftShadowMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PMREMGenerator", function() { return PMREMGenerator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParametricGeometry", function() { return ParametricGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Particle", function() { return Particle; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParticleBasicMaterial", function() { return ParticleBasicMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParticleSystem", function() { return ParticleSystem; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParticleSystemMaterial", function() { return ParticleSystemMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Path", function() { return Path; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PerspectiveCamera", function() { return PerspectiveCamera; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plane", function() { return Plane; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlaneBufferGeometry", function() { return PlaneGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlaneGeometry", function() { return PlaneGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlaneHelper", function() { return PlaneHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointCloud", function() { return PointCloud; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointCloudMaterial", function() { return PointCloudMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointLight", function() { return PointLight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointLightHelper", function() { return PointLightHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Points", function() { return Points; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointsMaterial", function() { return PointsMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolarGridHelper", function() { return PolarGridHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolyhedronBufferGeometry", function() { return PolyhedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolyhedronGeometry", function() { return PolyhedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PositionalAudio", function() { return PositionalAudio; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyBinding", function() { return PropertyBinding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyMixer", function() { return PropertyMixer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuadraticBezierCurve", function() { return QuadraticBezierCurve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuadraticBezierCurve3", function() { return QuadraticBezierCurve3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Quaternion", function() { return Quaternion; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuaternionKeyframeTrack", function() { return QuaternionKeyframeTrack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuaternionLinearInterpolant", function() { return QuaternionLinearInterpolant; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REVISION", function() { return REVISION; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBADepthPacking", function() { return RGBADepthPacking; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBAFormat", function() { return RGBAFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBAIntegerFormat", function() { return RGBAIntegerFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_10x10_Format", function() { return RGBA_ASTC_10x10_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_10x5_Format", function() { return RGBA_ASTC_10x5_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_10x6_Format", function() { return RGBA_ASTC_10x6_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_10x8_Format", function() { return RGBA_ASTC_10x8_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_12x10_Format", function() { return RGBA_ASTC_12x10_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_12x12_Format", function() { return RGBA_ASTC_12x12_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_4x4_Format", function() { return RGBA_ASTC_4x4_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_5x4_Format", function() { return RGBA_ASTC_5x4_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_5x5_Format", function() { return RGBA_ASTC_5x5_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_6x5_Format", function() { return RGBA_ASTC_6x5_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_6x6_Format", function() { return RGBA_ASTC_6x6_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_8x5_Format", function() { return RGBA_ASTC_8x5_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_8x6_Format", function() { return RGBA_ASTC_8x6_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ASTC_8x8_Format", function() { return RGBA_ASTC_8x8_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_BPTC_Format", function() { return RGBA_BPTC_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_ETC2_EAC_Format", function() { return RGBA_ETC2_EAC_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_PVRTC_2BPPV1_Format", function() { return RGBA_PVRTC_2BPPV1_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_PVRTC_4BPPV1_Format", function() { return RGBA_PVRTC_4BPPV1_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_S3TC_DXT1_Format", function() { return RGBA_S3TC_DXT1_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_S3TC_DXT3_Format", function() { return RGBA_S3TC_DXT3_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA_S3TC_DXT5_Format", function() { return RGBA_S3TC_DXT5_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBFormat", function() { return RGBFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGB_ETC1_Format", function() { return RGB_ETC1_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGB_ETC2_Format", function() { return RGB_ETC2_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGB_PVRTC_2BPPV1_Format", function() { return RGB_PVRTC_2BPPV1_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGB_PVRTC_4BPPV1_Format", function() { return RGB_PVRTC_4BPPV1_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGB_S3TC_DXT1_Format", function() { return RGB_S3TC_DXT1_Format; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGFormat", function() { return RGFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGIntegerFormat", function() { return RGIntegerFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RawShaderMaterial", function() { return RawShaderMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ray", function() { return Ray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Raycaster", function() { return Raycaster; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RectAreaLight", function() { return RectAreaLight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RedFormat", function() { return RedFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RedIntegerFormat", function() { return RedIntegerFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReinhardToneMapping", function() { return ReinhardToneMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatWrapping", function() { return RepeatWrapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceStencilOp", function() { return ReplaceStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReverseSubtractEquation", function() { return ReverseSubtractEquation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RingBufferGeometry", function() { return RingGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RingGeometry", function() { return RingGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scene", function() { return Scene; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SceneUtils", function() { return SceneUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderChunk", function() { return ShaderChunk; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderLib", function() { return ShaderLib; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderMaterial", function() { return ShaderMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShadowMaterial", function() { return ShadowMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Shape", function() { return Shape; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShapeBufferGeometry", function() { return ShapeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShapeGeometry", function() { return ShapeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShapePath", function() { return ShapePath; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShapeUtils", function() { return ShapeUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShortType", function() { return ShortType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Skeleton", function() { return Skeleton; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkeletonHelper", function() { return SkeletonHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkinnedMesh", function() { return SkinnedMesh; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothShading", function() { return SmoothShading; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sphere", function() { return Sphere; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SphereBufferGeometry", function() { return SphereGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SphereGeometry", function() { return SphereGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Spherical", function() { return Spherical; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SphericalHarmonics3", function() { return SphericalHarmonics3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplineCurve", function() { return SplineCurve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpotLight", function() { return SpotLight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpotLightHelper", function() { return SpotLightHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sprite", function() { return Sprite; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpriteMaterial", function() { return SpriteMaterial; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SrcAlphaFactor", function() { return SrcAlphaFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SrcAlphaSaturateFactor", function() { return SrcAlphaSaturateFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SrcColorFactor", function() { return SrcColorFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticCopyUsage", function() { return StaticCopyUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticDrawUsage", function() { return StaticDrawUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticReadUsage", function() { return StaticReadUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StereoCamera", function() { return StereoCamera; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StreamCopyUsage", function() { return StreamCopyUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StreamDrawUsage", function() { return StreamDrawUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StreamReadUsage", function() { return StreamReadUsage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringKeyframeTrack", function() { return StringKeyframeTrack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubtractEquation", function() { return SubtractEquation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubtractiveBlending", function() { return SubtractiveBlending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TOUCH", function() { return TOUCH; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TangentSpaceNormalMap", function() { return TangentSpaceNormalMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TetrahedronBufferGeometry", function() { return TetrahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TetrahedronGeometry", function() { return TetrahedronGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextGeometry", function() { return TextGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Texture", function() { return Texture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextureLoader", function() { return TextureLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TorusBufferGeometry", function() { return TorusGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TorusGeometry", function() { return TorusGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TorusKnotBufferGeometry", function() { return TorusKnotGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TorusKnotGeometry", function() { return TorusKnotGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Triangle", function() { return Triangle; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriangleFanDrawMode", function() { return TriangleFanDrawMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriangleStripDrawMode", function() { return TriangleStripDrawMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrianglesDrawMode", function() { return TrianglesDrawMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TubeBufferGeometry", function() { return TubeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TubeGeometry", function() { return TubeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UVMapping", function() { return UVMapping; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint16Attribute", function() { return Uint16Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint16BufferAttribute", function() { return Uint16BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint32Attribute", function() { return Uint32Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint32BufferAttribute", function() { return Uint32BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Attribute", function() { return Uint8Attribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8BufferAttribute", function() { return Uint8BufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8ClampedAttribute", function() { return Uint8ClampedAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8ClampedBufferAttribute", function() { return Uint8ClampedBufferAttribute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uniform", function() { return Uniform; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UniformsLib", function() { return UniformsLib; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UniformsUtils", function() { return UniformsUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsignedByteType", function() { return UnsignedByteType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsignedInt248Type", function() { return UnsignedInt248Type; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsignedIntType", function() { return UnsignedIntType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsignedShort4444Type", function() { return UnsignedShort4444Type; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsignedShort5551Type", function() { return UnsignedShort5551Type; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsignedShortType", function() { return UnsignedShortType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSMShadowMap", function() { return VSMShadowMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vector2", function() { return Vector2; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vector3", function() { return Vector3; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vector4", function() { return Vector4; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VectorKeyframeTrack", function() { return VectorKeyframeTrack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vertex", function() { return Vertex; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VertexColors", function() { return VertexColors; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VideoTexture", function() { return VideoTexture; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGL1Renderer", function() { return WebGL1Renderer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGLCubeRenderTarget", function() { return WebGLCubeRenderTarget; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGLMultipleRenderTargets", function() { return WebGLMultipleRenderTargets; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGLMultisampleRenderTarget", function() { return WebGLMultisampleRenderTarget; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGLRenderTarget", function() { return WebGLRenderTarget; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGLRenderTargetCube", function() { return WebGLRenderTargetCube; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGLRenderer", function() { return WebGLRenderer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebGLUtils", function() { return WebGLUtils; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WireframeGeometry", function() { return WireframeGeometry; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WireframeHelper", function() { return WireframeHelper; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrapAroundEnding", function() { return WrapAroundEnding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XHRLoader", function() { return XHRLoader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZeroCurvatureEnding", function() { return ZeroCurvatureEnding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZeroFactor", function() { return ZeroFactor; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZeroSlopeEnding", function() { return ZeroSlopeEnding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZeroStencilOp", function() { return ZeroStencilOp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_SRGBAFormat", function() { return _SRGBAFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sRGBEncoding", function() { return sRGBEncoding; }); +/** + * @license + * Copyright 2010-2022 Three.js Authors + * SPDX-License-Identifier: MIT + */ +const REVISION = '137'; +const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; +const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; +const CullFaceNone = 0; +const CullFaceBack = 1; +const CullFaceFront = 2; +const CullFaceFrontBack = 3; +const BasicShadowMap = 0; +const PCFShadowMap = 1; +const PCFSoftShadowMap = 2; +const VSMShadowMap = 3; +const FrontSide = 0; +const BackSide = 1; +const DoubleSide = 2; +const FlatShading = 1; +const SmoothShading = 2; +const NoBlending = 0; +const NormalBlending = 1; +const AdditiveBlending = 2; +const SubtractiveBlending = 3; +const MultiplyBlending = 4; +const CustomBlending = 5; +const AddEquation = 100; +const SubtractEquation = 101; +const ReverseSubtractEquation = 102; +const MinEquation = 103; +const MaxEquation = 104; +const ZeroFactor = 200; +const OneFactor = 201; +const SrcColorFactor = 202; +const OneMinusSrcColorFactor = 203; +const SrcAlphaFactor = 204; +const OneMinusSrcAlphaFactor = 205; +const DstAlphaFactor = 206; +const OneMinusDstAlphaFactor = 207; +const DstColorFactor = 208; +const OneMinusDstColorFactor = 209; +const SrcAlphaSaturateFactor = 210; +const NeverDepth = 0; +const AlwaysDepth = 1; +const LessDepth = 2; +const LessEqualDepth = 3; +const EqualDepth = 4; +const GreaterEqualDepth = 5; +const GreaterDepth = 6; +const NotEqualDepth = 7; +const MultiplyOperation = 0; +const MixOperation = 1; +const AddOperation = 2; +const NoToneMapping = 0; +const LinearToneMapping = 1; +const ReinhardToneMapping = 2; +const CineonToneMapping = 3; +const ACESFilmicToneMapping = 4; +const CustomToneMapping = 5; + +const UVMapping = 300; +const CubeReflectionMapping = 301; +const CubeRefractionMapping = 302; +const EquirectangularReflectionMapping = 303; +const EquirectangularRefractionMapping = 304; +const CubeUVReflectionMapping = 306; +const CubeUVRefractionMapping = 307; +const RepeatWrapping = 1000; +const ClampToEdgeWrapping = 1001; +const MirroredRepeatWrapping = 1002; +const NearestFilter = 1003; +const NearestMipmapNearestFilter = 1004; +const NearestMipMapNearestFilter = 1004; +const NearestMipmapLinearFilter = 1005; +const NearestMipMapLinearFilter = 1005; +const LinearFilter = 1006; +const LinearMipmapNearestFilter = 1007; +const LinearMipMapNearestFilter = 1007; +const LinearMipmapLinearFilter = 1008; +const LinearMipMapLinearFilter = 1008; +const UnsignedByteType = 1009; +const ByteType = 1010; +const ShortType = 1011; +const UnsignedShortType = 1012; +const IntType = 1013; +const UnsignedIntType = 1014; +const FloatType = 1015; +const HalfFloatType = 1016; +const UnsignedShort4444Type = 1017; +const UnsignedShort5551Type = 1018; +const UnsignedInt248Type = 1020; +const AlphaFormat = 1021; +const RGBFormat = 1022; +const RGBAFormat = 1023; +const LuminanceFormat = 1024; +const LuminanceAlphaFormat = 1025; +const DepthFormat = 1026; +const DepthStencilFormat = 1027; +const RedFormat = 1028; +const RedIntegerFormat = 1029; +const RGFormat = 1030; +const RGIntegerFormat = 1031; +const RGBAIntegerFormat = 1033; + +const RGB_S3TC_DXT1_Format = 33776; +const RGBA_S3TC_DXT1_Format = 33777; +const RGBA_S3TC_DXT3_Format = 33778; +const RGBA_S3TC_DXT5_Format = 33779; +const RGB_PVRTC_4BPPV1_Format = 35840; +const RGB_PVRTC_2BPPV1_Format = 35841; +const RGBA_PVRTC_4BPPV1_Format = 35842; +const RGBA_PVRTC_2BPPV1_Format = 35843; +const RGB_ETC1_Format = 36196; +const RGB_ETC2_Format = 37492; +const RGBA_ETC2_EAC_Format = 37496; +const RGBA_ASTC_4x4_Format = 37808; +const RGBA_ASTC_5x4_Format = 37809; +const RGBA_ASTC_5x5_Format = 37810; +const RGBA_ASTC_6x5_Format = 37811; +const RGBA_ASTC_6x6_Format = 37812; +const RGBA_ASTC_8x5_Format = 37813; +const RGBA_ASTC_8x6_Format = 37814; +const RGBA_ASTC_8x8_Format = 37815; +const RGBA_ASTC_10x5_Format = 37816; +const RGBA_ASTC_10x6_Format = 37817; +const RGBA_ASTC_10x8_Format = 37818; +const RGBA_ASTC_10x10_Format = 37819; +const RGBA_ASTC_12x10_Format = 37820; +const RGBA_ASTC_12x12_Format = 37821; +const RGBA_BPTC_Format = 36492; +const LoopOnce = 2200; +const LoopRepeat = 2201; +const LoopPingPong = 2202; +const InterpolateDiscrete = 2300; +const InterpolateLinear = 2301; +const InterpolateSmooth = 2302; +const ZeroCurvatureEnding = 2400; +const ZeroSlopeEnding = 2401; +const WrapAroundEnding = 2402; +const NormalAnimationBlendMode = 2500; +const AdditiveAnimationBlendMode = 2501; +const TrianglesDrawMode = 0; +const TriangleStripDrawMode = 1; +const TriangleFanDrawMode = 2; +const LinearEncoding = 3000; +const sRGBEncoding = 3001; +const BasicDepthPacking = 3200; +const RGBADepthPacking = 3201; +const TangentSpaceNormalMap = 0; +const ObjectSpaceNormalMap = 1; + +const ZeroStencilOp = 0; +const KeepStencilOp = 7680; +const ReplaceStencilOp = 7681; +const IncrementStencilOp = 7682; +const DecrementStencilOp = 7683; +const IncrementWrapStencilOp = 34055; +const DecrementWrapStencilOp = 34056; +const InvertStencilOp = 5386; + +const NeverStencilFunc = 512; +const LessStencilFunc = 513; +const EqualStencilFunc = 514; +const LessEqualStencilFunc = 515; +const GreaterStencilFunc = 516; +const NotEqualStencilFunc = 517; +const GreaterEqualStencilFunc = 518; +const AlwaysStencilFunc = 519; + +const StaticDrawUsage = 35044; +const DynamicDrawUsage = 35048; +const StreamDrawUsage = 35040; +const StaticReadUsage = 35045; +const DynamicReadUsage = 35049; +const StreamReadUsage = 35041; +const StaticCopyUsage = 35046; +const DynamicCopyUsage = 35050; +const StreamCopyUsage = 35042; + +const GLSL1 = '100'; +const GLSL3 = '300 es'; + +const _SRGBAFormat = 1035; // fallback for WebGL 1 + +/** + * https://github.com/mrdoob/eventdispatcher.js/ + */ + +class EventDispatcher { + + addEventListener( type, listener ) { + + if ( this._listeners === undefined ) this._listeners = {}; + + const listeners = this._listeners; + + if ( listeners[ type ] === undefined ) { + + listeners[ type ] = []; + + } + + if ( listeners[ type ].indexOf( listener ) === - 1 ) { + + listeners[ type ].push( listener ); + + } + + } + + hasEventListener( type, listener ) { + + if ( this._listeners === undefined ) return false; + + const listeners = this._listeners; + + return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1; + + } + + removeEventListener( type, listener ) { + + if ( this._listeners === undefined ) return; + + const listeners = this._listeners; + const listenerArray = listeners[ type ]; + + if ( listenerArray !== undefined ) { + + const index = listenerArray.indexOf( listener ); + + if ( index !== - 1 ) { + + listenerArray.splice( index, 1 ); + + } + + } + + } + + dispatchEvent( event ) { + + if ( this._listeners === undefined ) return; + + const listeners = this._listeners; + const listenerArray = listeners[ event.type ]; + + if ( listenerArray !== undefined ) { + + event.target = this; + + // Make a copy, in case listeners are removed while iterating. + const array = listenerArray.slice( 0 ); + + for ( let i = 0, l = array.length; i < l; i ++ ) { + + array[ i ].call( this, event ); + + } + + event.target = null; + + } + + } + +} + +const _lut = []; + +for ( let i = 0; i < 256; i ++ ) { + + _lut[ i ] = ( i < 16 ? '0' : '' ) + ( i ).toString( 16 ); + +} + +let _seed = 1234567; + + +const DEG2RAD = Math.PI / 180; +const RAD2DEG = 180 / Math.PI; + +// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136 +function generateUUID() { + + const d0 = Math.random() * 0xffffffff | 0; + const d1 = Math.random() * 0xffffffff | 0; + const d2 = Math.random() * 0xffffffff | 0; + const d3 = Math.random() * 0xffffffff | 0; + const uuid = _lut[ d0 & 0xff ] + _lut[ d0 >> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' + + _lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' + + _lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] + + _lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ]; + + // .toUpperCase() here flattens concatenated strings to save heap memory space. + return uuid.toUpperCase(); + +} + +function clamp( value, min, max ) { + + return Math.max( min, Math.min( max, value ) ); + +} + +// compute euclidian modulo of m % n +// https://en.wikipedia.org/wiki/Modulo_operation +function euclideanModulo( n, m ) { + + return ( ( n % m ) + m ) % m; + +} + +// Linear mapping from range to range +function mapLinear( x, a1, a2, b1, b2 ) { + + return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); + +} + +// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/ +function inverseLerp( x, y, value ) { + + if ( x !== y ) { + + return ( value - x ) / ( y - x ); + + } else { + + return 0; + + } + +} + +// https://en.wikipedia.org/wiki/Linear_interpolation +function lerp( x, y, t ) { + + return ( 1 - t ) * x + t * y; + +} + +// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/ +function damp( x, y, lambda, dt ) { + + return lerp( x, y, 1 - Math.exp( - lambda * dt ) ); + +} + +// https://www.desmos.com/calculator/vcsjnyz7x4 +function pingpong( x, length = 1 ) { + + return length - Math.abs( euclideanModulo( x, length * 2 ) - length ); + +} + +// http://en.wikipedia.org/wiki/Smoothstep +function smoothstep( x, min, max ) { + + if ( x <= min ) return 0; + if ( x >= max ) return 1; + + x = ( x - min ) / ( max - min ); + + return x * x * ( 3 - 2 * x ); + +} + +function smootherstep( x, min, max ) { + + if ( x <= min ) return 0; + if ( x >= max ) return 1; + + x = ( x - min ) / ( max - min ); + + return x * x * x * ( x * ( x * 6 - 15 ) + 10 ); + +} + +// Random integer from interval +function randInt( low, high ) { + + return low + Math.floor( Math.random() * ( high - low + 1 ) ); + +} + +// Random float from interval +function randFloat( low, high ) { + + return low + Math.random() * ( high - low ); + +} + +// Random float from <-range/2, range/2> interval +function randFloatSpread( range ) { + + return range * ( 0.5 - Math.random() ); + +} + +// Deterministic pseudo-random float in the interval [ 0, 1 ] +function seededRandom( s ) { + + if ( s !== undefined ) _seed = s % 2147483647; + + // Park-Miller algorithm + + _seed = _seed * 16807 % 2147483647; + + return ( _seed - 1 ) / 2147483646; + +} + +function degToRad( degrees ) { + + return degrees * DEG2RAD; + +} + +function radToDeg( radians ) { + + return radians * RAD2DEG; + +} + +function isPowerOfTwo( value ) { + + return ( value & ( value - 1 ) ) === 0 && value !== 0; + +} + +function ceilPowerOfTwo( value ) { + + return Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) ); + +} + +function floorPowerOfTwo( value ) { + + return Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) ); + +} + +function setQuaternionFromProperEuler( q, a, b, c, order ) { + + // Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles + + // rotations are applied to the axes in the order specified by 'order' + // rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c' + // angles are in radians + + const cos = Math.cos; + const sin = Math.sin; + + const c2 = cos( b / 2 ); + const s2 = sin( b / 2 ); + + const c13 = cos( ( a + c ) / 2 ); + const s13 = sin( ( a + c ) / 2 ); + + const c1_3 = cos( ( a - c ) / 2 ); + const s1_3 = sin( ( a - c ) / 2 ); + + const c3_1 = cos( ( c - a ) / 2 ); + const s3_1 = sin( ( c - a ) / 2 ); + + switch ( order ) { + + case 'XYX': + q.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 ); + break; + + case 'YZY': + q.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 ); + break; + + case 'ZXZ': + q.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 ); + break; + + case 'XZX': + q.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 ); + break; + + case 'YXY': + q.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 ); + break; + + case 'ZYZ': + q.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 ); + break; + + default: + console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order ); + + } + +} + +var MathUtils = /*#__PURE__*/Object.freeze({ + __proto__: null, + DEG2RAD: DEG2RAD, + RAD2DEG: RAD2DEG, + generateUUID: generateUUID, + clamp: clamp, + euclideanModulo: euclideanModulo, + mapLinear: mapLinear, + inverseLerp: inverseLerp, + lerp: lerp, + damp: damp, + pingpong: pingpong, + smoothstep: smoothstep, + smootherstep: smootherstep, + randInt: randInt, + randFloat: randFloat, + randFloatSpread: randFloatSpread, + seededRandom: seededRandom, + degToRad: degToRad, + radToDeg: radToDeg, + isPowerOfTwo: isPowerOfTwo, + ceilPowerOfTwo: ceilPowerOfTwo, + floorPowerOfTwo: floorPowerOfTwo, + setQuaternionFromProperEuler: setQuaternionFromProperEuler +}); + +class Vector2 { + + constructor( x = 0, y = 0 ) { + + this.x = x; + this.y = y; + + } + + get width() { + + return this.x; + + } + + set width( value ) { + + this.x = value; + + } + + get height() { + + return this.y; + + } + + set height( value ) { + + this.y = value; + + } + + set( x, y ) { + + this.x = x; + this.y = y; + + return this; + + } + + setScalar( scalar ) { + + this.x = scalar; + this.y = scalar; + + return this; + + } + + setX( x ) { + + this.x = x; + + return this; + + } + + setY( y ) { + + this.y = y; + + return this; + + } + + setComponent( index, value ) { + + switch ( index ) { + + case 0: this.x = value; break; + case 1: this.y = value; break; + default: throw new Error( 'index is out of range: ' + index ); + + } + + return this; + + } + + getComponent( index ) { + + switch ( index ) { + + case 0: return this.x; + case 1: return this.y; + default: throw new Error( 'index is out of range: ' + index ); + + } + + } + + clone() { + + return new this.constructor( this.x, this.y ); + + } + + copy( v ) { + + this.x = v.x; + this.y = v.y; + + return this; + + } + + add( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); + + } + + this.x += v.x; + this.y += v.y; + + return this; + + } + + addScalar( s ) { + + this.x += s; + this.y += s; + + return this; + + } + + addVectors( a, b ) { + + this.x = a.x + b.x; + this.y = a.y + b.y; + + return this; + + } + + addScaledVector( v, s ) { + + this.x += v.x * s; + this.y += v.y * s; + + return this; + + } + + sub( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); + + } + + this.x -= v.x; + this.y -= v.y; + + return this; + + } + + subScalar( s ) { + + this.x -= s; + this.y -= s; + + return this; + + } + + subVectors( a, b ) { + + this.x = a.x - b.x; + this.y = a.y - b.y; + + return this; + + } + + multiply( v ) { + + this.x *= v.x; + this.y *= v.y; + + return this; + + } + + multiplyScalar( scalar ) { + + this.x *= scalar; + this.y *= scalar; + + return this; + + } + + divide( v ) { + + this.x /= v.x; + this.y /= v.y; + + return this; + + } + + divideScalar( scalar ) { + + return this.multiplyScalar( 1 / scalar ); + + } + + applyMatrix3( m ) { + + const x = this.x, y = this.y; + const e = m.elements; + + this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ]; + this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ]; + + return this; + + } + + min( v ) { + + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + + return this; + + } + + max( v ) { + + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + + return this; + + } + + clamp( min, max ) { + + // assumes min < max, componentwise + + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + + return this; + + } + + clampScalar( minVal, maxVal ) { + + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + + return this; + + } + + clampLength( min, max ) { + + const length = this.length(); + + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + + } + + floor() { + + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + + return this; + + } + + ceil() { + + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + + return this; + + } + + round() { + + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + + return this; + + } + + roundToZero() { + + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + + return this; + + } + + negate() { + + this.x = - this.x; + this.y = - this.y; + + return this; + + } + + dot( v ) { + + return this.x * v.x + this.y * v.y; + + } + + cross( v ) { + + return this.x * v.y - this.y * v.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() { + + // computes the angle in radians with respect to the positive x-axis + + const angle = Math.atan2( - this.y, - this.x ) + Math.PI; + + return angle; + + } + + distanceTo( v ) { + + return Math.sqrt( this.distanceToSquared( v ) ); + + } + + distanceToSquared( v ) { + + const dx = this.x - v.x, dy = this.y - v.y; + return dx * dx + dy * dy; + + } + + manhattanDistanceTo( v ) { + + return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ); + + } + + setLength( length ) { + + return this.normalize().multiplyScalar( length ); + + } + + lerp( v, alpha ) { + + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + + return this; + + } + + lerpVectors( v1, v2, alpha ) { + + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; + + return this; + + } + + equals( v ) { + + return ( ( v.x === this.x ) && ( v.y === this.y ) ); + + } + + fromArray( array, offset = 0 ) { + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + + return this; + + } + + toArray( array = [], offset = 0 ) { + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + + return array; + + } + + fromBufferAttribute( attribute, index, offset ) { + + if ( offset !== undefined ) { + + console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' ); + + } + + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); + + return this; + + } + + rotateAround( center, angle ) { + + const c = Math.cos( angle ), s = Math.sin( angle ); + + const x = this.x - center.x; + const y = this.y - center.y; + + this.x = x * c - y * s + center.x; + this.y = x * s + y * c + center.y; + + return this; + + } + + random() { + + this.x = Math.random(); + this.y = Math.random(); + + return this; + + } + + *[ Symbol.iterator ]() { + + yield this.x; + yield this.y; + + } + +} + +Vector2.prototype.isVector2 = true; + +class Matrix3 { + + constructor() { + + this.elements = [ + + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + + ]; + + if ( arguments.length > 0 ) { + + console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); + + } + + } + + set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { + + const te = this.elements; + + te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31; + te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32; + te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33; + + return this; + + } + + identity() { + + this.set( + + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + + ); + + return this; + + } + + copy( m ) { + + const te = this.elements; + const me = m.elements; + + te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; + te[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; + te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ]; + + return this; + + } + + extractBasis( xAxis, yAxis, zAxis ) { + + xAxis.setFromMatrix3Column( this, 0 ); + yAxis.setFromMatrix3Column( this, 1 ); + zAxis.setFromMatrix3Column( this, 2 ); + + return this; + + } + + setFromMatrix4( m ) { + + const me = m.elements; + + this.set( + + me[ 0 ], me[ 4 ], me[ 8 ], + me[ 1 ], me[ 5 ], me[ 9 ], + me[ 2 ], me[ 6 ], me[ 10 ] + + ); + + return this; + + } + + multiply( m ) { + + return this.multiplyMatrices( this, m ); + + } + + premultiply( m ) { + + return this.multiplyMatrices( m, this ); + + } + + multiplyMatrices( a, b ) { + + const ae = a.elements; + const be = b.elements; + const te = this.elements; + + const a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ]; + const a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ]; + const a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ]; + + const b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ]; + const b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ]; + const b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ]; + + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31; + te[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32; + te[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33; + + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31; + te[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32; + te[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33; + + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31; + te[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32; + te[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33; + + return this; + + } + + multiplyScalar( s ) { + + const te = this.elements; + + te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s; + te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s; + te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s; + + return this; + + } + + determinant() { + + const te = this.elements; + + const a = te[ 0 ], b = te[ 1 ], c = te[ 2 ], + d = te[ 3 ], e = te[ 4 ], f = te[ 5 ], + g = te[ 6 ], h = te[ 7 ], i = te[ 8 ]; + + return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; + + } + + invert() { + + const te = this.elements, + + n11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], + n12 = te[ 3 ], n22 = te[ 4 ], n32 = te[ 5 ], + n13 = te[ 6 ], n23 = te[ 7 ], n33 = te[ 8 ], + + t11 = n33 * n22 - n32 * n23, + t12 = n32 * n13 - n33 * n12, + t13 = n23 * n12 - n22 * n13, + + det = n11 * t11 + n21 * t12 + n31 * t13; + + if ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 ); + + const detInv = 1 / det; + + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv; + te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv; + + te[ 3 ] = t12 * detInv; + te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv; + te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv; + + te[ 6 ] = t13 * detInv; + te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv; + te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv; + + return this; + + } + + transpose() { + + let tmp; + const m = this.elements; + + tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp; + tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp; + tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp; + + return this; + + } + + getNormalMatrix( matrix4 ) { + + return this.setFromMatrix4( matrix4 ).invert().transpose(); + + } + + transposeIntoArray( r ) { + + const m = this.elements; + + r[ 0 ] = m[ 0 ]; + r[ 1 ] = m[ 3 ]; + r[ 2 ] = m[ 6 ]; + r[ 3 ] = m[ 1 ]; + r[ 4 ] = m[ 4 ]; + r[ 5 ] = m[ 7 ]; + r[ 6 ] = m[ 2 ]; + r[ 7 ] = m[ 5 ]; + r[ 8 ] = m[ 8 ]; + + return this; + + } + + setUvTransform( tx, ty, sx, sy, rotation, cx, cy ) { + + const c = Math.cos( rotation ); + const s = Math.sin( rotation ); + + this.set( + sx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx, + - sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty, + 0, 0, 1 + ); + + return this; + + } + + scale( sx, sy ) { + + const te = this.elements; + + te[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx; + te[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy; + + return this; + + } + + rotate( theta ) { + + const c = Math.cos( theta ); + const s = Math.sin( theta ); + + const te = this.elements; + + const a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ]; + const a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ]; + + te[ 0 ] = c * a11 + s * a21; + te[ 3 ] = c * a12 + s * a22; + te[ 6 ] = c * a13 + s * a23; + + te[ 1 ] = - s * a11 + c * a21; + te[ 4 ] = - s * a12 + c * a22; + te[ 7 ] = - s * a13 + c * a23; + + return this; + + } + + translate( tx, ty ) { + + const te = this.elements; + + te[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ]; + te[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ]; + + return this; + + } + + equals( matrix ) { + + const te = this.elements; + const me = matrix.elements; + + for ( let i = 0; i < 9; i ++ ) { + + if ( te[ i ] !== me[ i ] ) return false; + + } + + return true; + + } + + fromArray( array, offset = 0 ) { + + for ( let i = 0; i < 9; i ++ ) { + + this.elements[ i ] = array[ i + offset ]; + + } + + return this; + + } + + toArray( array = [], offset = 0 ) { + + const te = this.elements; + + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; + + array[ offset + 3 ] = te[ 3 ]; + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; + + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; + array[ offset + 8 ] = te[ 8 ]; + + return array; + + } + + clone() { + + return new this.constructor().fromArray( this.elements ); + + } + +} + +Matrix3.prototype.isMatrix3 = true; + +function arrayNeedsUint32( array ) { + + // assumes larger values usually on last + + for ( let i = array.length - 1; i >= 0; -- i ) { + + if ( array[ i ] > 65535 ) return true; + + } + + return false; + +} + +const TYPED_ARRAYS = { + Int8Array: Int8Array, + Uint8Array: Uint8Array, + Uint8ClampedArray: Uint8ClampedArray, + Int16Array: Int16Array, + Uint16Array: Uint16Array, + Int32Array: Int32Array, + Uint32Array: Uint32Array, + Float32Array: Float32Array, + Float64Array: Float64Array +}; + +function getTypedArray( type, buffer ) { + + return new TYPED_ARRAYS[ type ]( buffer ); + +} + +function createElementNS( name ) { + + return document.createElementNS( 'http://www.w3.org/1999/xhtml', name ); + +} + +const _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF, + 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2, + 'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50, + 'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B, + 'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B, + 'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F, + 'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3, + 'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222, + 'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700, + 'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4, + 'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00, + 'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3, + 'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA, + 'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32, + 'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3, + 'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC, + 'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD, + 'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6, + 'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9, + 'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F, + 'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE, + 'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA, + 'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0, + 'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 }; + +const _hslA = { h: 0, s: 0, l: 0 }; +const _hslB = { h: 0, s: 0, l: 0 }; + +function hue2rgb( p, q, t ) { + + if ( t < 0 ) t += 1; + if ( t > 1 ) t -= 1; + if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t; + if ( t < 1 / 2 ) return q; + if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t ); + return p; + +} + +function SRGBToLinear( c ) { + + return ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 ); + +} + +function LinearToSRGB( c ) { + + return ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055; + +} + +class Color { + + constructor( r, g, b ) { + + if ( g === undefined && b === undefined ) { + + // r is THREE.Color, hex or string + return this.set( r ); + + } + + return this.setRGB( r, g, b ); + + } + + set( value ) { + + if ( value && value.isColor ) { + + this.copy( value ); + + } else if ( typeof value === 'number' ) { + + this.setHex( value ); + + } else if ( typeof value === 'string' ) { + + this.setStyle( value ); + + } + + return this; + + } + + setScalar( scalar ) { + + this.r = scalar; + this.g = scalar; + this.b = scalar; + + return this; + + } + + setHex( hex ) { + + hex = Math.floor( hex ); + + this.r = ( hex >> 16 & 255 ) / 255; + this.g = ( hex >> 8 & 255 ) / 255; + this.b = ( hex & 255 ) / 255; + + return this; + + } + + setRGB( r, g, b ) { + + this.r = r; + this.g = g; + this.b = b; + + return this; + + } + + setHSL( h, s, l ) { + + // h,s,l ranges are in 0.0 - 1.0 + h = euclideanModulo( h, 1 ); + s = clamp( s, 0, 1 ); + l = clamp( l, 0, 1 ); + + if ( s === 0 ) { + + this.r = this.g = this.b = l; + + } else { + + const p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s ); + const q = ( 2 * l ) - p; + + this.r = hue2rgb( q, p, h + 1 / 3 ); + this.g = hue2rgb( q, p, h ); + this.b = hue2rgb( q, p, h - 1 / 3 ); + + } + + return this; + + } + + setStyle( style ) { + + function handleAlpha( string ) { + + if ( string === undefined ) return; + + if ( parseFloat( string ) < 1 ) { + + console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' ); + + } + + } + + + let m; + + if ( m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec( style ) ) { + + // rgb / hsl + + let color; + const name = m[ 1 ]; + const components = m[ 2 ]; + + switch ( name ) { + + case 'rgb': + case 'rgba': + + if ( color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { + + // rgb(255,0,0) rgba(255,0,0,0.5) + this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255; + this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255; + this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255; + + handleAlpha( color[ 4 ] ); + + return this; + + } + + if ( color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { + + // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) + this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100; + this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100; + this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100; + + handleAlpha( color[ 4 ] ); + + return this; + + } + + break; + + case 'hsl': + case 'hsla': + + if ( color = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { + + // hsl(120,50%,50%) hsla(120,50%,50%,0.5) + const h = parseFloat( color[ 1 ] ) / 360; + const s = parseInt( color[ 2 ], 10 ) / 100; + const l = parseInt( color[ 3 ], 10 ) / 100; + + handleAlpha( color[ 4 ] ); + + return this.setHSL( h, s, l ); + + } + + break; + + } + + } else if ( m = /^\#([A-Fa-f\d]+)$/.exec( style ) ) { + + // hex color + + const hex = m[ 1 ]; + const size = hex.length; + + if ( size === 3 ) { + + // #ff0 + this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255; + this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255; + this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255; + + return this; + + } else if ( size === 6 ) { + + // #ff0000 + this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255; + this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255; + this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255; + + return this; + + } + + } + + if ( style && style.length > 0 ) { + + return this.setColorName( style ); + + } + + return this; + + } + + setColorName( style ) { + + // color keywords + const hex = _colorKeywords[ style.toLowerCase() ]; + + if ( hex !== undefined ) { + + // red + this.setHex( hex ); + + } else { + + // unknown color + console.warn( 'THREE.Color: Unknown color ' + style ); + + } + + return this; + + } + + clone() { + + return new this.constructor( this.r, this.g, this.b ); + + } + + copy( color ) { + + this.r = color.r; + this.g = color.g; + this.b = color.b; + + return this; + + } + + copySRGBToLinear( color ) { + + this.r = SRGBToLinear( color.r ); + this.g = SRGBToLinear( color.g ); + this.b = SRGBToLinear( color.b ); + + return this; + + } + + copyLinearToSRGB( color ) { + + this.r = LinearToSRGB( color.r ); + this.g = LinearToSRGB( color.g ); + this.b = LinearToSRGB( color.b ); + + return this; + + } + + convertSRGBToLinear() { + + this.copySRGBToLinear( this ); + + return this; + + } + + convertLinearToSRGB() { + + this.copyLinearToSRGB( this ); + + return this; + + } + + getHex() { + + return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0; + + } + + getHexString() { + + return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 ); + + } + + getHSL( target ) { + + // h,s,l ranges are in 0.0 - 1.0 + + const r = this.r, g = this.g, b = this.b; + + const max = Math.max( r, g, b ); + const min = Math.min( r, g, b ); + + let hue, saturation; + const lightness = ( min + max ) / 2.0; + + if ( min === max ) { + + hue = 0; + saturation = 0; + + } else { + + const delta = max - min; + + saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min ); + + switch ( max ) { + + case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break; + case g: hue = ( b - r ) / delta + 2; break; + case b: hue = ( r - g ) / delta + 4; break; + + } + + hue /= 6; + + } + + target.h = hue; + target.s = saturation; + target.l = lightness; + + return target; + + } + + getStyle() { + + return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')'; + + } + + offsetHSL( h, s, l ) { + + this.getHSL( _hslA ); + + _hslA.h += h; _hslA.s += s; _hslA.l += l; + + this.setHSL( _hslA.h, _hslA.s, _hslA.l ); + + return this; + + } + + add( color ) { + + this.r += color.r; + this.g += color.g; + this.b += color.b; + + return this; + + } + + addColors( color1, color2 ) { + + this.r = color1.r + color2.r; + this.g = color1.g + color2.g; + this.b = color1.b + color2.b; + + return this; + + } + + addScalar( s ) { + + this.r += s; + this.g += s; + this.b += s; + + return this; + + } + + sub( color ) { + + this.r = Math.max( 0, this.r - color.r ); + this.g = Math.max( 0, this.g - color.g ); + this.b = Math.max( 0, this.b - color.b ); + + return this; + + } + + multiply( color ) { + + this.r *= color.r; + this.g *= color.g; + this.b *= color.b; + + return this; + + } + + multiplyScalar( s ) { + + this.r *= s; + this.g *= s; + this.b *= s; + + return this; + + } + + lerp( color, alpha ) { + + this.r += ( color.r - this.r ) * alpha; + this.g += ( color.g - this.g ) * alpha; + this.b += ( color.b - this.b ) * alpha; + + return this; + + } + + lerpColors( color1, color2, alpha ) { + + this.r = color1.r + ( color2.r - color1.r ) * alpha; + this.g = color1.g + ( color2.g - color1.g ) * alpha; + this.b = color1.b + ( color2.b - color1.b ) * alpha; + + return this; + + } + + lerpHSL( color, alpha ) { + + this.getHSL( _hslA ); + color.getHSL( _hslB ); + + const h = lerp( _hslA.h, _hslB.h, alpha ); + const s = lerp( _hslA.s, _hslB.s, alpha ); + const l = lerp( _hslA.l, _hslB.l, alpha ); + + this.setHSL( h, s, l ); + + return this; + + } + + equals( c ) { + + return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); + + } + + fromArray( array, offset = 0 ) { + + this.r = array[ offset ]; + this.g = array[ offset + 1 ]; + this.b = array[ offset + 2 ]; + + return this; + + } + + toArray( array = [], offset = 0 ) { + + array[ offset ] = this.r; + array[ offset + 1 ] = this.g; + array[ offset + 2 ] = this.b; + + return array; + + } + + fromBufferAttribute( attribute, index ) { + + this.r = attribute.getX( index ); + this.g = attribute.getY( index ); + this.b = attribute.getZ( index ); + + if ( attribute.normalized === true ) { + + // assuming Uint8Array + + this.r /= 255; + this.g /= 255; + this.b /= 255; + + } + + return this; + + } + + toJSON() { + + return this.getHex(); + + } + +} + +Color.NAMES = _colorKeywords; + +Color.prototype.isColor = true; +Color.prototype.r = 1; +Color.prototype.g = 1; +Color.prototype.b = 1; + +let _canvas; + +class ImageUtils { + + static getDataURL( image ) { + + if ( /^data:/i.test( image.src ) ) { + + return image.src; + + } + + if ( typeof HTMLCanvasElement == 'undefined' ) { + + return image.src; + + } + + let canvas; + + if ( image instanceof HTMLCanvasElement ) { + + canvas = image; + + } else { + + if ( _canvas === undefined ) _canvas = createElementNS( 'canvas' ); + + _canvas.width = image.width; + _canvas.height = image.height; + + const context = _canvas.getContext( '2d' ); + + if ( image instanceof ImageData ) { + + context.putImageData( image, 0, 0 ); + + } else { + + context.drawImage( image, 0, 0, image.width, image.height ); + + } + + canvas = _canvas; + + } + + if ( canvas.width > 2048 || canvas.height > 2048 ) { + + console.warn( 'THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image ); + + return canvas.toDataURL( 'image/jpeg', 0.6 ); + + } else { + + return canvas.toDataURL( 'image/png' ); + + } + + } + + static sRGBToLinear( image ) { + + if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || + ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) || + ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) { + + const canvas = createElementNS( 'canvas' ); + + canvas.width = image.width; + canvas.height = image.height; + + const context = canvas.getContext( '2d' ); + context.drawImage( image, 0, 0, image.width, image.height ); + + const imageData = context.getImageData( 0, 0, image.width, image.height ); + const data = imageData.data; + + for ( let i = 0; i < data.length; i ++ ) { + + data[ i ] = SRGBToLinear( data[ i ] / 255 ) * 255; + + } + + context.putImageData( imageData, 0, 0 ); + + return canvas; + + } else if ( image.data ) { + + const data = image.data.slice( 0 ); + + for ( let i = 0; i < data.length; i ++ ) { + + if ( data instanceof Uint8Array || data instanceof Uint8ClampedArray ) { + + data[ i ] = Math.floor( SRGBToLinear( data[ i ] / 255 ) * 255 ); + + } else { + + // assuming float + + data[ i ] = SRGBToLinear( data[ i ] ); + + } + + } + + return { + data: data, + width: image.width, + height: image.height + }; + + } else { + + console.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' ); + return image; + + } + + } + +} + +let textureId = 0; + +class Texture extends EventDispatcher { + + constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) { + + super(); + + Object.defineProperty( this, 'id', { value: textureId ++ } ); + + this.uuid = generateUUID(); + + this.name = ''; + + this.image = image; + this.mipmaps = []; + + this.mapping = mapping; + + this.wrapS = wrapS; + this.wrapT = wrapT; + + this.magFilter = magFilter; + this.minFilter = minFilter; + + this.anisotropy = anisotropy; + + this.format = format; + this.internalFormat = null; + this.type = type; + + this.offset = new Vector2( 0, 0 ); + this.repeat = new Vector2( 1, 1 ); + this.center = new Vector2( 0, 0 ); + this.rotation = 0; + + this.matrixAutoUpdate = true; + this.matrix = new Matrix3(); + + this.generateMipmaps = true; + this.premultiplyAlpha = false; + this.flipY = true; + this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml) + + // Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap. + // + // Also changing the encoding after already used by a Material will not automatically make the Material + // update. You need to explicitly call Material.needsUpdate to trigger it to recompile. + this.encoding = encoding; + + this.userData = {}; + + this.version = 0; + this.onUpdate = null; + + this.isRenderTargetTexture = false; // indicates whether a texture belongs to a render target or not + this.needsPMREMUpdate = false; // indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target textures) + + } + + 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( source ) { + + this.name = source.name; + + this.image = source.image; + this.mipmaps = source.mipmaps.slice( 0 ); + + this.mapping = source.mapping; + + this.wrapS = source.wrapS; + this.wrapT = source.wrapT; + + this.magFilter = source.magFilter; + this.minFilter = source.minFilter; + + this.anisotropy = source.anisotropy; + + this.format = source.format; + this.internalFormat = source.internalFormat; + this.type = source.type; + + this.offset.copy( source.offset ); + this.repeat.copy( source.repeat ); + this.center.copy( source.center ); + this.rotation = source.rotation; + + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrix.copy( source.matrix ); + + this.generateMipmaps = source.generateMipmaps; + this.premultiplyAlpha = source.premultiplyAlpha; + this.flipY = source.flipY; + this.unpackAlignment = source.unpackAlignment; + this.encoding = source.encoding; + + this.userData = JSON.parse( JSON.stringify( source.userData ) ); + + return this; + + } + + toJSON( meta ) { + + const isRootObject = ( meta === undefined || typeof meta === 'string' ); + + if ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) { + + return meta.textures[ this.uuid ]; + + } + + const output = { + + metadata: { + version: 4.5, + type: 'Texture', + generator: 'Texture.toJSON' + }, + + uuid: this.uuid, + name: this.name, + + mapping: this.mapping, + + repeat: [ this.repeat.x, this.repeat.y ], + offset: [ this.offset.x, this.offset.y ], + center: [ this.center.x, this.center.y ], + rotation: this.rotation, + + wrap: [ this.wrapS, this.wrapT ], + + format: this.format, + type: this.type, + encoding: this.encoding, + + minFilter: this.minFilter, + magFilter: this.magFilter, + anisotropy: this.anisotropy, + + flipY: this.flipY, + + premultiplyAlpha: this.premultiplyAlpha, + unpackAlignment: this.unpackAlignment + + }; + + if ( this.image !== undefined ) { + + // TODO: Move to THREE.Image + + const image = this.image; + + if ( image.uuid === undefined ) { + + image.uuid = generateUUID(); // UGH + + } + + if ( ! isRootObject && meta.images[ image.uuid ] === undefined ) { + + let url; + + if ( Array.isArray( image ) ) { + + // process array of images e.g. CubeTexture + + url = []; + + for ( let i = 0, l = image.length; i < l; i ++ ) { + + // check cube texture with data textures + + if ( image[ i ].isDataTexture ) { + + url.push( serializeImage( image[ i ].image ) ); + + } else { + + url.push( serializeImage( image[ i ] ) ); + + } + + } + + } else { + + // process single image + + url = serializeImage( image ); + + } + + meta.images[ image.uuid ] = { + uuid: image.uuid, + url: url + }; + + } + + output.image = image.uuid; + + } + + if ( JSON.stringify( this.userData ) !== '{}' ) output.userData = this.userData; + + if ( ! isRootObject ) { + + meta.textures[ this.uuid ] = output; + + } + + return output; + + } + + dispose() { + + this.dispatchEvent( { type: 'dispose' } ); + + } + + transformUv( uv ) { + + if ( this.mapping !== UVMapping ) return uv; + + uv.applyMatrix3( this.matrix ); + + if ( uv.x < 0 || uv.x > 1 ) { + + switch ( this.wrapS ) { + + case RepeatWrapping: + + uv.x = uv.x - Math.floor( uv.x ); + break; + + case ClampToEdgeWrapping: + + uv.x = uv.x < 0 ? 0 : 1; + break; + + case MirroredRepeatWrapping: + + if ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) { + + uv.x = Math.ceil( uv.x ) - uv.x; + + } else { + + uv.x = uv.x - Math.floor( uv.x ); + + } + + break; + + } + + } + + if ( uv.y < 0 || uv.y > 1 ) { + + switch ( this.wrapT ) { + + case RepeatWrapping: + + uv.y = uv.y - Math.floor( uv.y ); + break; + + case ClampToEdgeWrapping: + + uv.y = uv.y < 0 ? 0 : 1; + break; + + case MirroredRepeatWrapping: + + if ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) { + + uv.y = Math.ceil( uv.y ) - uv.y; + + } else { + + uv.y = uv.y - Math.floor( uv.y ); + + } + + break; + + } + + } + + if ( this.flipY ) { + + uv.y = 1 - uv.y; + + } + + return uv; + + } + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + } + +} + +Texture.DEFAULT_IMAGE = undefined; +Texture.DEFAULT_MAPPING = UVMapping; + +Texture.prototype.isTexture = true; + +function serializeImage( image ) { + + if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || + ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) || + ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) { + + // default images + + return ImageUtils.getDataURL( image ); + + } else { + + if ( image.data ) { + + // images of DataTexture + + return { + data: Array.prototype.slice.call( image.data ), + width: image.width, + height: image.height, + type: image.data.constructor.name + }; + + } else { + + console.warn( 'THREE.Texture: Unable to serialize Texture.' ); + return {}; + + } + + } + +} + +class Vector4 { + + constructor( x = 0, y = 0, z = 0, w = 1 ) { + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + } + + get width() { + + return this.z; + + } + + set width( value ) { + + this.z = value; + + } + + get height() { + + return this.w; + + } + + set height( value ) { + + this.w = value; + + } + + set( x, y, z, w ) { + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + + } + + setScalar( scalar ) { + + this.x = scalar; + this.y = scalar; + this.z = scalar; + this.w = scalar; + + return this; + + } + + setX( x ) { + + this.x = x; + + return this; + + } + + setY( y ) { + + this.y = y; + + return this; + + } + + setZ( z ) { + + this.z = z; + + return this; + + } + + setW( w ) { + + this.w = w; + + return this; + + } + + setComponent( index, value ) { + + switch ( index ) { + + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + case 3: this.w = value; break; + default: throw new Error( 'index is out of range: ' + index ); + + } + + return this; + + } + + getComponent( index ) { + + switch ( index ) { + + 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: ' + index ); + + } + + } + + clone() { + + return new this.constructor( this.x, this.y, this.z, this.w ); + + } + + copy( v ) { + + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = ( v.w !== undefined ) ? v.w : 1; + + return this; + + } + + add( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); + + } + + this.x += v.x; + this.y += v.y; + this.z += v.z; + this.w += v.w; + + return this; + + } + + addScalar( s ) { + + this.x += s; + this.y += s; + this.z += s; + this.w += s; + + return this; + + } + + addVectors( a, b ) { + + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + this.w = a.w + b.w; + + return this; + + } + + addScaledVector( v, s ) { + + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + this.w += v.w * s; + + return this; + + } + + sub( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); + + } + + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + this.w -= v.w; + + return this; + + } + + subScalar( s ) { + + this.x -= s; + this.y -= s; + this.z -= s; + this.w -= s; + + return this; + + } + + subVectors( a, b ) { + + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; + this.w = a.w - b.w; + + return this; + + } + + multiply( v ) { + + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; + this.w *= v.w; + + return this; + + } + + multiplyScalar( scalar ) { + + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + this.w *= scalar; + + return this; + + } + + applyMatrix4( m ) { + + const x = this.x, y = this.y, z = this.z, w = this.w; + const e = m.elements; + + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w; + this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w; + + return this; + + } + + divideScalar( scalar ) { + + return this.multiplyScalar( 1 / scalar ); + + } + + setAxisAngleFromQuaternion( q ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm + + // q is assumed to be normalized + + this.w = 2 * Math.acos( q.w ); + + const s = Math.sqrt( 1 - q.w * q.w ); + + if ( s < 0.0001 ) { + + this.x = 1; + this.y = 0; + this.z = 0; + + } else { + + this.x = q.x / s; + this.y = q.y / s; + this.z = q.z / s; + + } + + return this; + + } + + setAxisAngleFromRotationMatrix( m ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + let angle, x, y, z; // variables for result + const epsilon = 0.01, // margin to allow for rounding errors + epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees + + te = m.elements, + + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + + if ( ( Math.abs( m12 - m21 ) < epsilon ) && + ( Math.abs( m13 - m31 ) < epsilon ) && + ( Math.abs( m23 - m32 ) < epsilon ) ) { + + // singularity found + // first check for identity matrix which must have +1 for all terms + // in leading diagonal and zero in other terms + + if ( ( Math.abs( m12 + m21 ) < epsilon2 ) && + ( Math.abs( m13 + m31 ) < epsilon2 ) && + ( Math.abs( m23 + m32 ) < epsilon2 ) && + ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) { + + // this singularity is identity matrix so angle = 0 + + this.set( 1, 0, 0, 0 ); + + return this; // zero angle, arbitrary axis + + } + + // otherwise this singularity is angle = 180 + + angle = Math.PI; + + const xx = ( m11 + 1 ) / 2; + const yy = ( m22 + 1 ) / 2; + const zz = ( m33 + 1 ) / 2; + const xy = ( m12 + m21 ) / 4; + const xz = ( m13 + m31 ) / 4; + const yz = ( m23 + m32 ) / 4; + + if ( ( xx > yy ) && ( xx > zz ) ) { + + // m11 is the largest diagonal term + + if ( xx < epsilon ) { + + x = 0; + y = 0.707106781; + z = 0.707106781; + + } else { + + x = Math.sqrt( xx ); + y = xy / x; + z = xz / x; + + } + + } else if ( yy > zz ) { + + // m22 is the largest diagonal term + + if ( yy < epsilon ) { + + x = 0.707106781; + y = 0; + z = 0.707106781; + + } else { + + y = Math.sqrt( yy ); + x = xy / y; + z = yz / y; + + } + + } else { + + // m33 is the largest diagonal term so base result on this + + if ( zz < epsilon ) { + + x = 0.707106781; + y = 0.707106781; + z = 0; + + } else { + + z = Math.sqrt( zz ); + x = xz / z; + y = yz / z; + + } + + } + + this.set( x, y, z, angle ); + + return this; // return 180 deg rotation + + } + + // as we have reached here there are no singularities so we can handle normally + + let s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) + + ( m13 - m31 ) * ( m13 - m31 ) + + ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize + + if ( Math.abs( s ) < 0.001 ) s = 1; + + // prevent divide by zero, should not happen if matrix is orthogonal and should be + // caught by singularity test above, but I've left it in just in case + + this.x = ( m32 - m23 ) / s; + this.y = ( m13 - m31 ) / s; + this.z = ( m21 - m12 ) / s; + this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 ); + + return this; + + } + + min( v ) { + + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); + this.w = Math.min( this.w, v.w ); + + return this; + + } + + max( v ) { + + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); + this.w = Math.max( this.w, v.w ); + + return this; + + } + + clamp( min, max ) { + + // assumes min < max, componentwise + + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + this.w = Math.max( min.w, Math.min( max.w, this.w ) ); + + return this; + + } + + clampScalar( minVal, maxVal ) { + + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); + this.w = Math.max( minVal, Math.min( maxVal, this.w ) ); + + return this; + + } + + clampLength( min, max ) { + + const length = this.length(); + + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + + } + + floor() { + + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); + this.w = Math.floor( this.w ); + + return this; + + } + + ceil() { + + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); + this.w = Math.ceil( this.w ); + + return this; + + } + + round() { + + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); + this.w = Math.round( this.w ); + + return this; + + } + + roundToZero() { + + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); + + return this; + + } + + negate() { + + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; + this.w = - this.w; + + return this; + + } + + dot( v ) { + + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.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( length ) { + + return this.normalize().multiplyScalar( length ); + + } + + lerp( v, alpha ) { + + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; + this.w += ( v.w - this.w ) * alpha; + + return this; + + } + + lerpVectors( v1, v2, alpha ) { + + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; + this.z = v1.z + ( v2.z - v1.z ) * alpha; + this.w = v1.w + ( v2.w - v1.w ) * alpha; + + return this; + + } + + equals( v ) { + + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); + + } + + fromArray( array, offset = 0 ) { + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; + this.w = array[ offset + 3 ]; + + return this; + + } + + toArray( array = [], offset = 0 ) { + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + array[ offset + 3 ] = this.w; + + return array; + + } + + fromBufferAttribute( attribute, index, offset ) { + + if ( offset !== undefined ) { + + console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' ); + + } + + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); + this.z = attribute.getZ( index ); + this.w = attribute.getW( index ); + + return this; + + } + + random() { + + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); + this.w = Math.random(); + + return this; + + } + + *[ Symbol.iterator ]() { + + yield this.x; + yield this.y; + yield this.z; + yield this.w; + + } + +} + +Vector4.prototype.isVector4 = true; + +/* + In options, we can specify: + * Texture parameters for an auto-generated target texture + * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers +*/ +class WebGLRenderTarget extends EventDispatcher { + + constructor( width, height, options = {} ) { + + super(); + + this.width = width; + this.height = height; + this.depth = 1; + + this.scissor = new Vector4( 0, 0, width, height ); + this.scissorTest = false; + + this.viewport = new Vector4( 0, 0, width, height ); + + this.texture = new Texture( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding ); + this.texture.isRenderTargetTexture = true; + + this.texture.image = { width: width, height: height, depth: 1 }; + + this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false; + this.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null; + this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; + + this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; + this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false; + this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; + + } + + setTexture( texture ) { + + texture.image = { + width: this.width, + height: this.height, + depth: this.depth + }; + + this.texture = texture; + + } + + setSize( width, height, depth = 1 ) { + + if ( this.width !== width || this.height !== height || this.depth !== depth ) { + + this.width = width; + this.height = height; + this.depth = depth; + + this.texture.image.width = width; + this.texture.image.height = height; + this.texture.image.depth = depth; + + this.dispose(); + + } + + this.viewport.set( 0, 0, width, height ); + this.scissor.set( 0, 0, width, height ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( source ) { + + this.width = source.width; + this.height = source.height; + this.depth = source.depth; + + this.viewport.copy( source.viewport ); + + this.texture = source.texture.clone(); + + // ensure image object is not shared, see #20328 + + this.texture.image = Object.assign( {}, source.texture.image ); + + this.depthBuffer = source.depthBuffer; + this.stencilBuffer = source.stencilBuffer; + this.depthTexture = source.depthTexture; + + return this; + + } + + dispose() { + + this.dispatchEvent( { type: 'dispose' } ); + + } + +} + +WebGLRenderTarget.prototype.isWebGLRenderTarget = true; + +class WebGLMultipleRenderTargets extends WebGLRenderTarget { + + constructor( width, height, count ) { + + super( width, height ); + + const texture = this.texture; + + this.texture = []; + + for ( let i = 0; i < count; i ++ ) { + + this.texture[ i ] = texture.clone(); + + } + + } + + setSize( width, height, depth = 1 ) { + + if ( this.width !== width || this.height !== height || this.depth !== depth ) { + + this.width = width; + this.height = height; + this.depth = depth; + + for ( let i = 0, il = this.texture.length; i < il; i ++ ) { + + this.texture[ i ].image.width = width; + this.texture[ i ].image.height = height; + this.texture[ i ].image.depth = depth; + + } + + this.dispose(); + + } + + this.viewport.set( 0, 0, width, height ); + this.scissor.set( 0, 0, width, height ); + + return this; + + } + + copy( source ) { + + this.dispose(); + + this.width = source.width; + this.height = source.height; + this.depth = source.depth; + + this.viewport.set( 0, 0, this.width, this.height ); + this.scissor.set( 0, 0, this.width, this.height ); + + this.depthBuffer = source.depthBuffer; + this.stencilBuffer = source.stencilBuffer; + this.depthTexture = source.depthTexture; + + this.texture.length = 0; + + for ( let i = 0, il = source.texture.length; i < il; i ++ ) { + + this.texture[ i ] = source.texture[ i ].clone(); + + } + + return this; + + } + +} + +WebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true; + +class WebGLMultisampleRenderTarget extends WebGLRenderTarget { + + constructor( width, height, options = {} ) { + + super( width, height, options ); + + this.samples = 4; + + this.ignoreDepthForMultisampleCopy = options.ignoreDepth !== undefined ? options.ignoreDepth : true; + this.useRenderToTexture = ( options.useRenderToTexture !== undefined ) ? options.useRenderToTexture : false; + this.useRenderbuffer = this.useRenderToTexture === false; + + } + + copy( source ) { + + super.copy.call( this, source ); + + this.samples = source.samples; + this.useRenderToTexture = source.useRenderToTexture; + this.useRenderbuffer = source.useRenderbuffer; + + return this; + + } + +} + +WebGLMultisampleRenderTarget.prototype.isWebGLMultisampleRenderTarget = true; + +class Quaternion { + + constructor( x = 0, y = 0, z = 0, w = 1 ) { + + this._x = x; + this._y = y; + this._z = z; + this._w = w; + + } + + static slerp( qa, qb, qm, t ) { + + console.warn( 'THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.' ); + return qm.slerpQuaternions( qa, qb, t ); + + } + + static slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { + + // fuzz-free, array-based Quaternion SLERP operation + + let x0 = src0[ srcOffset0 + 0 ], + y0 = src0[ srcOffset0 + 1 ], + z0 = src0[ srcOffset0 + 2 ], + w0 = src0[ srcOffset0 + 3 ]; + + const x1 = src1[ srcOffset1 + 0 ], + y1 = src1[ srcOffset1 + 1 ], + z1 = src1[ srcOffset1 + 2 ], + w1 = src1[ srcOffset1 + 3 ]; + + if ( t === 0 ) { + + dst[ dstOffset + 0 ] = x0; + dst[ dstOffset + 1 ] = y0; + dst[ dstOffset + 2 ] = z0; + dst[ dstOffset + 3 ] = w0; + return; + + } + + if ( t === 1 ) { + + dst[ dstOffset + 0 ] = x1; + dst[ dstOffset + 1 ] = y1; + dst[ dstOffset + 2 ] = z1; + dst[ dstOffset + 3 ] = w1; + return; + + } + + if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) { + + let s = 1 - t; + const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, + dir = ( cos >= 0 ? 1 : - 1 ), + sqrSin = 1 - cos * cos; + + // Skip the Slerp for tiny steps to avoid numeric problems: + if ( sqrSin > Number.EPSILON ) { + + const sin = Math.sqrt( sqrSin ), + len = Math.atan2( sin, cos * dir ); + + s = Math.sin( s * len ) / sin; + t = Math.sin( t * len ) / sin; + + } + + const tDir = t * dir; + + x0 = x0 * s + x1 * tDir; + y0 = y0 * s + y1 * tDir; + z0 = z0 * s + z1 * tDir; + w0 = w0 * s + w1 * tDir; + + // Normalize in case we just did a lerp: + if ( s === 1 - t ) { + + const f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 ); + + x0 *= f; + y0 *= f; + z0 *= f; + w0 *= f; + + } + + } + + dst[ dstOffset ] = x0; + dst[ dstOffset + 1 ] = y0; + dst[ dstOffset + 2 ] = z0; + dst[ dstOffset + 3 ] = w0; + + } + + static multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) { + + const x0 = src0[ srcOffset0 ]; + const y0 = src0[ srcOffset0 + 1 ]; + const z0 = src0[ srcOffset0 + 2 ]; + const w0 = src0[ srcOffset0 + 3 ]; + + const x1 = src1[ srcOffset1 ]; + const y1 = src1[ srcOffset1 + 1 ]; + const z1 = src1[ srcOffset1 + 2 ]; + const w1 = src1[ srcOffset1 + 3 ]; + + dst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1; + dst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1; + dst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1; + dst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1; + + return dst; + + } + + get x() { + + return this._x; + + } + + set x( value ) { + + this._x = value; + this._onChangeCallback(); + + } + + get y() { + + return this._y; + + } + + set y( value ) { + + this._y = value; + this._onChangeCallback(); + + } + + get z() { + + return this._z; + + } + + set z( value ) { + + this._z = value; + this._onChangeCallback(); + + } + + get w() { + + return this._w; + + } + + set w( value ) { + + this._w = value; + this._onChangeCallback(); + + } + + set( x, y, z, w ) { + + this._x = x; + this._y = y; + this._z = z; + this._w = w; + + this._onChangeCallback(); + + return this; + + } + + clone() { + + return new this.constructor( this._x, this._y, this._z, this._w ); + + } + + copy( quaternion ) { + + this._x = quaternion.x; + this._y = quaternion.y; + this._z = quaternion.z; + this._w = quaternion.w; + + this._onChangeCallback(); + + return this; + + } + + setFromEuler( euler, update ) { + + if ( ! ( euler && euler.isEuler ) ) { + + throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + + } + + const x = euler._x, y = euler._y, z = euler._z, order = euler._order; + + // http://www.mathworks.com/matlabcentral/fileexchange/ + // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ + // content/SpinCalc.m + + const cos = Math.cos; + const sin = Math.sin; + + const c1 = cos( x / 2 ); + const c2 = cos( y / 2 ); + const c3 = cos( z / 2 ); + + const s1 = sin( x / 2 ); + const s2 = sin( y / 2 ); + const s3 = sin( z / 2 ); + + switch ( order ) { + + case 'XYZ': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; + + case 'YXZ': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; + + case 'ZXY': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; + + case 'ZYX': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; + + case 'YZX': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; + + case 'XZY': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; + + default: + console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order ); + + } + + if ( update !== false ) this._onChangeCallback(); + + return this; + + } + + setFromAxisAngle( axis, angle ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm + + // assumes axis is normalized + + const halfAngle = angle / 2, s = Math.sin( halfAngle ); + + this._x = axis.x * s; + this._y = axis.y * s; + this._z = axis.z * s; + this._w = Math.cos( halfAngle ); + + this._onChangeCallback(); + + return this; + + } + + setFromRotationMatrix( m ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + const te = m.elements, + + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ], + + trace = m11 + m22 + m33; + + if ( trace > 0 ) { + + const s = 0.5 / Math.sqrt( trace + 1.0 ); + + this._w = 0.25 / s; + this._x = ( m32 - m23 ) * s; + this._y = ( m13 - m31 ) * s; + this._z = ( m21 - m12 ) * s; + + } else if ( m11 > m22 && m11 > m33 ) { + + const s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 ); + + this._w = ( m32 - m23 ) / s; + this._x = 0.25 * s; + this._y = ( m12 + m21 ) / s; + this._z = ( m13 + m31 ) / s; + + } else if ( m22 > m33 ) { + + const s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 ); + + this._w = ( m13 - m31 ) / s; + this._x = ( m12 + m21 ) / s; + this._y = 0.25 * s; + this._z = ( m23 + m32 ) / s; + + } else { + + const s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 ); + + this._w = ( m21 - m12 ) / s; + this._x = ( m13 + m31 ) / s; + this._y = ( m23 + m32 ) / s; + this._z = 0.25 * s; + + } + + this._onChangeCallback(); + + return this; + + } + + setFromUnitVectors( vFrom, vTo ) { + + // assumes direction vectors vFrom and vTo are normalized + + let r = vFrom.dot( vTo ) + 1; + + if ( r < Number.EPSILON ) { + + // vFrom and vTo point in opposite directions + + r = 0; + + if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) { + + this._x = - vFrom.y; + this._y = vFrom.x; + this._z = 0; + this._w = r; + + } else { + + this._x = 0; + this._y = - vFrom.z; + this._z = vFrom.y; + this._w = r; + + } + + } else { + + // crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3 + + this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; + this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; + this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; + this._w = r; + + } + + return this.normalize(); + + } + + angleTo( q ) { + + return 2 * Math.acos( Math.abs( clamp( this.dot( q ), - 1, 1 ) ) ); + + } + + rotateTowards( q, step ) { + + const angle = this.angleTo( q ); + + if ( angle === 0 ) return this; + + const t = Math.min( 1, step / angle ); + + this.slerp( q, t ); + + return this; + + } + + identity() { + + return this.set( 0, 0, 0, 1 ); + + } + + invert() { + + // quaternion is assumed to have unit length + + return this.conjugate(); + + } + + conjugate() { + + this._x *= - 1; + this._y *= - 1; + this._z *= - 1; + + this._onChangeCallback(); + + return this; + + } + + dot( v ) { + + return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._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 l = this.length(); + + if ( l === 0 ) { + + this._x = 0; + this._y = 0; + this._z = 0; + this._w = 1; + + } else { + + l = 1 / l; + + this._x = this._x * l; + this._y = this._y * l; + this._z = this._z * l; + this._w = this._w * l; + + } + + this._onChangeCallback(); + + return this; + + } + + multiply( q, p ) { + + if ( p !== undefined ) { + + console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' ); + return this.multiplyQuaternions( q, p ); + + } + + return this.multiplyQuaternions( this, q ); + + } + + premultiply( q ) { + + return this.multiplyQuaternions( q, this ); + + } + + multiplyQuaternions( a, b ) { + + // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm + + const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; + const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; + + this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; + this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; + this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; + this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; + + this._onChangeCallback(); + + return this; + + } + + slerp( qb, t ) { + + if ( t === 0 ) return this; + if ( t === 1 ) return this.copy( qb ); + + const x = this._x, y = this._y, z = this._z, w = this._w; + + // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ + + let cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; + + if ( cosHalfTheta < 0 ) { + + this._w = - qb._w; + this._x = - qb._x; + this._y = - qb._y; + this._z = - qb._z; + + cosHalfTheta = - cosHalfTheta; + + } else { + + this.copy( qb ); + + } + + if ( cosHalfTheta >= 1.0 ) { + + this._w = w; + this._x = x; + this._y = y; + this._z = z; + + return this; + + } + + const sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta; + + if ( sqrSinHalfTheta <= Number.EPSILON ) { + + const s = 1 - t; + this._w = s * w + t * this._w; + this._x = s * x + t * this._x; + this._y = s * y + t * this._y; + this._z = s * z + t * this._z; + + this.normalize(); + this._onChangeCallback(); + + return this; + + } + + const sinHalfTheta = Math.sqrt( sqrSinHalfTheta ); + const halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); + const ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, + ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; + + this._w = ( w * ratioA + this._w * ratioB ); + this._x = ( x * ratioA + this._x * ratioB ); + this._y = ( y * ratioA + this._y * ratioB ); + this._z = ( z * ratioA + this._z * ratioB ); + + this._onChangeCallback(); + + return this; + + } + + slerpQuaternions( qa, qb, t ) { + + return this.copy( qa ).slerp( qb, t ); + + } + + random() { + + // Derived from http://planning.cs.uiuc.edu/node198.html + // Note, this source uses w, x, y, z ordering, + // so we swap the order below. + + const u1 = Math.random(); + const sqrt1u1 = Math.sqrt( 1 - u1 ); + const sqrtu1 = Math.sqrt( u1 ); + + const u2 = 2 * Math.PI * Math.random(); + + const u3 = 2 * Math.PI * Math.random(); + + return this.set( + sqrt1u1 * Math.cos( u2 ), + sqrtu1 * Math.sin( u3 ), + sqrtu1 * Math.cos( u3 ), + sqrt1u1 * Math.sin( u2 ), + ); + + } + + equals( quaternion ) { + + return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); + + } + + fromArray( array, offset = 0 ) { + + this._x = array[ offset ]; + this._y = array[ offset + 1 ]; + this._z = array[ offset + 2 ]; + this._w = array[ offset + 3 ]; + + this._onChangeCallback(); + + return this; + + } + + toArray( array = [], offset = 0 ) { + + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._w; + + return array; + + } + + fromBufferAttribute( attribute, index ) { + + this._x = attribute.getX( index ); + this._y = attribute.getY( index ); + this._z = attribute.getZ( index ); + this._w = attribute.getW( index ); + + return this; + + } + + _onChange( callback ) { + + this._onChangeCallback = callback; + + return this; + + } + + _onChangeCallback() {} + +} + +Quaternion.prototype.isQuaternion = true; + +class Vector3 { + + constructor( x = 0, y = 0, z = 0 ) { + + this.x = x; + this.y = y; + this.z = z; + + } + + set( x, y, z ) { + + if ( z === undefined ) z = this.z; // sprite.scale.set(x,y) + + this.x = x; + this.y = y; + this.z = z; + + return this; + + } + + setScalar( scalar ) { + + this.x = scalar; + this.y = scalar; + this.z = scalar; + + return this; + + } + + setX( x ) { + + this.x = x; + + return this; + + } + + setY( y ) { + + this.y = y; + + return this; + + } + + setZ( z ) { + + this.z = z; + + return this; + + } + + setComponent( index, value ) { + + switch ( index ) { + + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + default: throw new Error( 'index is out of range: ' + index ); + + } + + return this; + + } + + getComponent( index ) { + + switch ( index ) { + + case 0: return this.x; + case 1: return this.y; + case 2: return this.z; + default: throw new Error( 'index is out of range: ' + index ); + + } + + } + + clone() { + + return new this.constructor( this.x, this.y, this.z ); + + } + + copy( v ) { + + this.x = v.x; + this.y = v.y; + this.z = v.z; + + return this; + + } + + add( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); + + } + + this.x += v.x; + this.y += v.y; + this.z += v.z; + + return this; + + } + + addScalar( s ) { + + this.x += s; + this.y += s; + this.z += s; + + return this; + + } + + addVectors( a, b ) { + + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + + } + + addScaledVector( v, s ) { + + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + + return this; + + } + + sub( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); + + } + + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + + return this; + + } + + subScalar( s ) { + + this.x -= s; + this.y -= s; + this.z -= s; + + return this; + + } + + subVectors( a, b ) { + + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; + + return this; + + } + + multiply( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' ); + return this.multiplyVectors( v, w ); + + } + + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; + + return this; + + } + + multiplyScalar( scalar ) { + + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + + return this; + + } + + multiplyVectors( a, b ) { + + this.x = a.x * b.x; + this.y = a.y * b.y; + this.z = a.z * b.z; + + return this; + + } + + applyEuler( euler ) { + + if ( ! ( euler && euler.isEuler ) ) { + + console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + + } + + return this.applyQuaternion( _quaternion$4.setFromEuler( euler ) ); + + } + + applyAxisAngle( axis, angle ) { + + return this.applyQuaternion( _quaternion$4.setFromAxisAngle( axis, angle ) ); + + } + + applyMatrix3( m ) { + + const x = this.x, y = this.y, z = this.z; + const e = m.elements; + + this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z; + this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z; + this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z; + + return this; + + } + + applyNormalMatrix( m ) { + + return this.applyMatrix3( m ).normalize(); + + } + + applyMatrix4( m ) { + + const x = this.x, y = this.y, z = this.z; + const e = m.elements; + + const w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); + + this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w; + this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w; + this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w; + + return this; + + } + + applyQuaternion( q ) { + + const x = this.x, y = this.y, z = this.z; + const qx = q.x, qy = q.y, qz = q.z, qw = q.w; + + // calculate quat * vector + + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = - qx * x - qy * y - qz * z; + + // calculate result * inverse quat + + this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy; + this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz; + this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx; + + return this; + + } + + project( camera ) { + + return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix ); + + } + + unproject( camera ) { + + return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld ); + + } + + transformDirection( m ) { + + // input: THREE.Matrix4 affine matrix + // vector interpreted as a direction + + const x = this.x, y = this.y, z = this.z; + const e = m.elements; + + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z; + + return this.normalize(); + + } + + divide( v ) { + + this.x /= v.x; + this.y /= v.y; + this.z /= v.z; + + return this; + + } + + divideScalar( scalar ) { + + return this.multiplyScalar( 1 / scalar ); + + } + + min( v ) { + + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); + + return this; + + } + + max( v ) { + + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); + + return this; + + } + + clamp( min, max ) { + + // assumes min < max, componentwise + + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + + return this; + + } + + clampScalar( minVal, maxVal ) { + + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); + + return this; + + } + + clampLength( min, max ) { + + const length = this.length(); + + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + + } + + floor() { + + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); + + return this; + + } + + ceil() { + + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); + + return this; + + } + + round() { + + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); + + return this; + + } + + roundToZero() { + + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + + return this; + + } + + negate() { + + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; + + return this; + + } + + dot( v ) { + + return this.x * v.x + this.y * v.y + this.z * v.z; + + } + + // TODO lengthSquared? + + 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( length ) { + + return this.normalize().multiplyScalar( length ); + + } + + lerp( v, alpha ) { + + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; + + return this; + + } + + lerpVectors( v1, v2, alpha ) { + + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; + this.z = v1.z + ( v2.z - v1.z ) * alpha; + + return this; + + } + + cross( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' ); + return this.crossVectors( v, w ); + + } + + return this.crossVectors( this, v ); + + } + + crossVectors( a, b ) { + + const ax = a.x, ay = a.y, az = a.z; + const bx = b.x, by = b.y, bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + + } + + projectOnVector( v ) { + + const denominator = v.lengthSq(); + + if ( denominator === 0 ) return this.set( 0, 0, 0 ); + + const scalar = v.dot( this ) / denominator; + + return this.copy( v ).multiplyScalar( scalar ); + + } + + projectOnPlane( planeNormal ) { + + _vector$c.copy( this ).projectOnVector( planeNormal ); + + return this.sub( _vector$c ); + + } + + reflect( normal ) { + + // reflect incident vector off plane orthogonal to normal + // normal is assumed to have unit length + + return this.sub( _vector$c.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); + + } + + angleTo( v ) { + + const denominator = Math.sqrt( this.lengthSq() * v.lengthSq() ); + + if ( denominator === 0 ) return Math.PI / 2; + + const theta = this.dot( v ) / denominator; + + // clamp, to handle numerical problems + + return Math.acos( clamp( theta, - 1, 1 ) ); + + } + + distanceTo( v ) { + + return Math.sqrt( this.distanceToSquared( v ) ); + + } + + distanceToSquared( v ) { + + const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; + + return dx * dx + dy * dy + dz * dz; + + } + + manhattanDistanceTo( v ) { + + return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); + + } + + setFromSpherical( s ) { + + return this.setFromSphericalCoords( s.radius, s.phi, s.theta ); + + } + + setFromSphericalCoords( radius, phi, theta ) { + + const sinPhiRadius = Math.sin( phi ) * radius; + + this.x = sinPhiRadius * Math.sin( theta ); + this.y = Math.cos( phi ) * radius; + this.z = sinPhiRadius * Math.cos( theta ); + + return this; + + } + + setFromCylindrical( c ) { + + return this.setFromCylindricalCoords( c.radius, c.theta, c.y ); + + } + + setFromCylindricalCoords( radius, theta, y ) { + + this.x = radius * Math.sin( theta ); + this.y = y; + this.z = radius * Math.cos( theta ); + + return this; + + } + + setFromMatrixPosition( m ) { + + const e = m.elements; + + this.x = e[ 12 ]; + this.y = e[ 13 ]; + this.z = e[ 14 ]; + + return this; + + } + + setFromMatrixScale( m ) { + + const sx = this.setFromMatrixColumn( m, 0 ).length(); + const sy = this.setFromMatrixColumn( m, 1 ).length(); + const sz = this.setFromMatrixColumn( m, 2 ).length(); + + this.x = sx; + this.y = sy; + this.z = sz; + + return this; + + } + + setFromMatrixColumn( m, index ) { + + return this.fromArray( m.elements, index * 4 ); + + } + + setFromMatrix3Column( m, index ) { + + return this.fromArray( m.elements, index * 3 ); + + } + + equals( v ) { + + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); + + } + + fromArray( array, offset = 0 ) { + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; + + return this; + + } + + toArray( array = [], offset = 0 ) { + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + + return array; + + } + + fromBufferAttribute( attribute, index, offset ) { + + if ( offset !== undefined ) { + + console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' ); + + } + + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); + this.z = attribute.getZ( index ); + + return this; + + } + + random() { + + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); + + return this; + + } + + randomDirection() { + + // Derived from https://mathworld.wolfram.com/SpherePointPicking.html + + const u = ( Math.random() - 0.5 ) * 2; + const t = Math.random() * Math.PI * 2; + const f = Math.sqrt( 1 - u ** 2 ); + + this.x = f * Math.cos( t ); + this.y = f * Math.sin( t ); + this.z = u; + + return this; + + } + + *[ Symbol.iterator ]() { + + yield this.x; + yield this.y; + yield this.z; + + } + +} + +Vector3.prototype.isVector3 = true; + +const _vector$c = /*@__PURE__*/ new Vector3(); +const _quaternion$4 = /*@__PURE__*/ new Quaternion(); + +class Box3 { + + constructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) { + + this.min = min; + this.max = max; + + } + + set( min, max ) { + + this.min.copy( min ); + this.max.copy( max ); + + return this; + + } + + setFromArray( array ) { + + let minX = + Infinity; + let minY = + Infinity; + let minZ = + Infinity; + + let maxX = - Infinity; + let maxY = - Infinity; + let maxZ = - Infinity; + + for ( let i = 0, l = array.length; i < l; i += 3 ) { + + const x = array[ i ]; + const y = array[ i + 1 ]; + const z = array[ i + 2 ]; + + if ( x < minX ) minX = x; + if ( y < minY ) minY = y; + if ( z < minZ ) minZ = z; + + if ( x > maxX ) maxX = x; + if ( y > maxY ) maxY = y; + if ( z > maxZ ) maxZ = z; + + } + + this.min.set( minX, minY, minZ ); + this.max.set( maxX, maxY, maxZ ); + + return this; + + } + + setFromBufferAttribute( attribute ) { + + let minX = + Infinity; + let minY = + Infinity; + let minZ = + Infinity; + + let maxX = - Infinity; + let maxY = - Infinity; + let maxZ = - Infinity; + + for ( let i = 0, l = attribute.count; i < l; i ++ ) { + + const x = attribute.getX( i ); + const y = attribute.getY( i ); + const z = attribute.getZ( i ); + + if ( x < minX ) minX = x; + if ( y < minY ) minY = y; + if ( z < minZ ) minZ = z; + + if ( x > maxX ) maxX = x; + if ( y > maxY ) maxY = y; + if ( z > maxZ ) maxZ = z; + + } + + this.min.set( minX, minY, minZ ); + this.max.set( maxX, maxY, maxZ ); + + return this; + + } + + setFromPoints( points ) { + + this.makeEmpty(); + + for ( let i = 0, il = points.length; i < il; i ++ ) { + + this.expandByPoint( points[ i ] ); + + } + + return this; + + } + + setFromCenterAndSize( center, size ) { + + const halfSize = _vector$b.copy( size ).multiplyScalar( 0.5 ); + + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); + + return this; + + } + + setFromObject( object, precise = false ) { + + this.makeEmpty(); + + return this.expandByObject( object, precise ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( box ) { + + this.min.copy( box.min ); + this.max.copy( box.max ); + + return this; + + } + + makeEmpty() { + + this.min.x = this.min.y = this.min.z = + Infinity; + this.max.x = this.max.y = this.max.z = - Infinity; + + return this; + + } + + isEmpty() { + + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); + + } + + getCenter( target ) { + + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + + } + + getSize( target ) { + + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min ); + + } + + expandByPoint( point ) { + + this.min.min( point ); + this.max.max( point ); + + return this; + + } + + expandByVector( vector ) { + + this.min.sub( vector ); + this.max.add( vector ); + + return this; + + } + + expandByScalar( scalar ) { + + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); + + return this; + + } + + expandByObject( object, precise = false ) { + + // Computes the world-axis-aligned bounding box of an object (including its children), + // accounting for both the object's, and children's, world transforms + + object.updateWorldMatrix( false, false ); + + const geometry = object.geometry; + + if ( geometry !== undefined ) { + + if ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) { + + const position = geometry.attributes.position; + for ( let i = 0, l = position.count; i < l; i ++ ) { + + _vector$b.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld ); + this.expandByPoint( _vector$b ); + + } + + } else { + + if ( geometry.boundingBox === null ) { + + geometry.computeBoundingBox(); + + } + + _box$3.copy( geometry.boundingBox ); + _box$3.applyMatrix4( object.matrixWorld ); + + this.union( _box$3 ); + + } + + } + + const children = object.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + this.expandByObject( children[ i ], precise ); + + } + + return this; + + } + + containsPoint( point ) { + + return point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y || + point.z < this.min.z || point.z > this.max.z ? false : true; + + } + + containsBox( box ) { + + return this.min.x <= box.min.x && box.max.x <= this.max.x && + this.min.y <= box.min.y && box.max.y <= this.max.y && + this.min.z <= box.min.z && box.max.z <= this.max.z; + + } + + getParameter( point, target ) { + + // This can potentially have a divide by zero if the box + // has a size dimension of 0. + + return target.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ), + ( point.z - this.min.z ) / ( this.max.z - this.min.z ) + ); + + } + + intersectsBox( box ) { + + // using 6 splitting planes to rule out intersections. + return box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y || + box.max.z < this.min.z || box.min.z > this.max.z ? false : true; + + } + + intersectsSphere( sphere ) { + + // Find the point on the AABB closest to the sphere center. + this.clampPoint( sphere.center, _vector$b ); + + // If that point is inside the sphere, the AABB and sphere intersect. + return _vector$b.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); + + } + + intersectsPlane( plane ) { + + // We compute the minimum and maximum dot product values. If those values + // are on the same side (back or front) of the plane, then there is no intersection. + + let min, max; + + if ( plane.normal.x > 0 ) { + + min = plane.normal.x * this.min.x; + max = plane.normal.x * this.max.x; + + } else { + + min = plane.normal.x * this.max.x; + max = plane.normal.x * this.min.x; + + } + + if ( plane.normal.y > 0 ) { + + min += plane.normal.y * this.min.y; + max += plane.normal.y * this.max.y; + + } else { + + min += plane.normal.y * this.max.y; + max += plane.normal.y * this.min.y; + + } + + if ( plane.normal.z > 0 ) { + + min += plane.normal.z * this.min.z; + max += plane.normal.z * this.max.z; + + } else { + + min += plane.normal.z * this.max.z; + max += plane.normal.z * this.min.z; + + } + + return ( min <= - plane.constant && max >= - plane.constant ); + + } + + intersectsTriangle( triangle ) { + + if ( this.isEmpty() ) { + + return false; + + } + + // compute box center and extents + this.getCenter( _center ); + _extents.subVectors( this.max, _center ); + + // translate triangle to aabb origin + _v0$2.subVectors( triangle.a, _center ); + _v1$7.subVectors( triangle.b, _center ); + _v2$3.subVectors( triangle.c, _center ); + + // compute edge vectors for triangle + _f0.subVectors( _v1$7, _v0$2 ); + _f1.subVectors( _v2$3, _v1$7 ); + _f2.subVectors( _v0$2, _v2$3 ); + + // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb + // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation + // axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned) + let axes = [ + 0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y, + _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, + - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 + ]; + if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents ) ) { + + return false; + + } + + // test 3 face normals from the aabb + axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; + if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents ) ) { + + return false; + + } + + // finally testing the face normal of the triangle + // use already existing triangle edge vectors here + _triangleNormal.crossVectors( _f0, _f1 ); + axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; + + return satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents ); + + } + + clampPoint( point, target ) { + + return target.copy( point ).clamp( this.min, this.max ); + + } + + distanceToPoint( point ) { + + const clampedPoint = _vector$b.copy( point ).clamp( this.min, this.max ); + + return clampedPoint.sub( point ).length(); + + } + + getBoundingSphere( target ) { + + this.getCenter( target.center ); + + target.radius = this.getSize( _vector$b ).length() * 0.5; + + return target; + + } + + intersect( box ) { + + this.min.max( box.min ); + this.max.min( box.max ); + + // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. + if ( this.isEmpty() ) this.makeEmpty(); + + return this; + + } + + union( box ) { + + this.min.min( box.min ); + this.max.max( box.max ); + + return this; + + } + + applyMatrix4( matrix ) { + + // transform of empty box is an empty box. + if ( this.isEmpty() ) return this; + + // NOTE: I am using a binary pattern to specify all 2^3 combinations below + _points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 + _points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 + _points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 + _points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 + _points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 + _points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 + _points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 + _points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 + + this.setFromPoints( _points ); + + return this; + + } + + translate( offset ) { + + this.min.add( offset ); + this.max.add( offset ); + + return this; + + } + + equals( box ) { + + return box.min.equals( this.min ) && box.max.equals( this.max ); + + } + +} + +Box3.prototype.isBox3 = true; + +const _points = [ + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3() +]; + +const _vector$b = /*@__PURE__*/ new Vector3(); + +const _box$3 = /*@__PURE__*/ new Box3(); + +// triangle centered vertices + +const _v0$2 = /*@__PURE__*/ new Vector3(); +const _v1$7 = /*@__PURE__*/ new Vector3(); +const _v2$3 = /*@__PURE__*/ new Vector3(); + +// triangle edge vectors + +const _f0 = /*@__PURE__*/ new Vector3(); +const _f1 = /*@__PURE__*/ new Vector3(); +const _f2 = /*@__PURE__*/ new Vector3(); + +const _center = /*@__PURE__*/ new Vector3(); +const _extents = /*@__PURE__*/ new Vector3(); +const _triangleNormal = /*@__PURE__*/ new Vector3(); +const _testAxis = /*@__PURE__*/ new Vector3(); + +function satForAxes( axes, v0, v1, v2, extents ) { + + for ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) { + + _testAxis.fromArray( axes, i ); + // project the aabb onto the seperating axis + const r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z ); + // project all 3 vertices of the triangle onto the seperating axis + const p0 = v0.dot( _testAxis ); + const p1 = v1.dot( _testAxis ); + const p2 = v2.dot( _testAxis ); + // actual test, basically see if either of the most extreme of the triangle points intersects r + if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) { + + // points of the projected triangle are outside the projected half-length of the aabb + // the axis is seperating and we can exit + return false; + + } + + } + + return true; + +} + +const _box$2 = /*@__PURE__*/ new Box3(); +const _v1$6 = /*@__PURE__*/ new Vector3(); +const _toFarthestPoint = /*@__PURE__*/ new Vector3(); +const _toPoint = /*@__PURE__*/ new Vector3(); + +class Sphere { + + constructor( center = new Vector3(), radius = - 1 ) { + + this.center = center; + this.radius = radius; + + } + + set( center, radius ) { + + this.center.copy( center ); + this.radius = radius; + + return this; + + } + + setFromPoints( points, optionalCenter ) { + + const center = this.center; + + if ( optionalCenter !== undefined ) { + + center.copy( optionalCenter ); + + } else { + + _box$2.setFromPoints( points ).getCenter( center ); + + } + + let maxRadiusSq = 0; + + for ( let i = 0, il = points.length; i < il; i ++ ) { + + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); + + } + + this.radius = Math.sqrt( maxRadiusSq ); + + return this; + + } + + copy( sphere ) { + + this.center.copy( sphere.center ); + this.radius = sphere.radius; + + return this; + + } + + isEmpty() { + + return ( this.radius < 0 ); + + } + + makeEmpty() { + + this.center.set( 0, 0, 0 ); + this.radius = - 1; + + return this; + + } + + containsPoint( point ) { + + return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); + + } + + distanceToPoint( point ) { + + return ( point.distanceTo( this.center ) - this.radius ); + + } + + intersectsSphere( sphere ) { + + const radiusSum = this.radius + sphere.radius; + + return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); + + } + + intersectsBox( box ) { + + return box.intersectsSphere( this ); + + } + + intersectsPlane( plane ) { + + return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius; + + } + + clampPoint( point, target ) { + + const deltaLengthSq = this.center.distanceToSquared( point ); + + target.copy( point ); + + if ( deltaLengthSq > ( this.radius * this.radius ) ) { + + target.sub( this.center ).normalize(); + target.multiplyScalar( this.radius ).add( this.center ); + + } + + return target; + + } + + getBoundingBox( target ) { + + if ( this.isEmpty() ) { + + // Empty sphere produces empty bounding box + target.makeEmpty(); + return target; + + } + + target.set( this.center, this.center ); + target.expandByScalar( this.radius ); + + return target; + + } + + applyMatrix4( matrix ) { + + this.center.applyMatrix4( matrix ); + this.radius = this.radius * matrix.getMaxScaleOnAxis(); + + return this; + + } + + translate( offset ) { + + this.center.add( offset ); + + return this; + + } + + expandByPoint( point ) { + + // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671 + + _toPoint.subVectors( point, this.center ); + + const lengthSq = _toPoint.lengthSq(); + + if ( lengthSq > ( this.radius * this.radius ) ) { + + const length = Math.sqrt( lengthSq ); + const missingRadiusHalf = ( length - this.radius ) * 0.5; + + // Nudge this sphere towards the target point. Add half the missing distance to radius, + // and the other half to position. This gives a tighter enclosure, instead of if + // the whole missing distance were just added to radius. + + this.center.add( _toPoint.multiplyScalar( missingRadiusHalf / length ) ); + this.radius += missingRadiusHalf; + + } + + return this; + + } + + union( sphere ) { + + // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769 + + // To enclose another sphere into this sphere, we only need to enclose two points: + // 1) Enclose the farthest point on the other sphere into this sphere. + // 2) Enclose the opposite point of the farthest point into this sphere. + + if ( this.center.equals( sphere.center ) === true ) { + + _toFarthestPoint.set( 0, 0, 1 ).multiplyScalar( sphere.radius ); + + + } else { + + _toFarthestPoint.subVectors( sphere.center, this.center ).normalize().multiplyScalar( sphere.radius ); + + } + + this.expandByPoint( _v1$6.copy( sphere.center ).add( _toFarthestPoint ) ); + this.expandByPoint( _v1$6.copy( sphere.center ).sub( _toFarthestPoint ) ); + + return this; + + } + + equals( sphere ) { + + return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +const _vector$a = /*@__PURE__*/ new Vector3(); +const _segCenter = /*@__PURE__*/ new Vector3(); +const _segDir = /*@__PURE__*/ new Vector3(); +const _diff = /*@__PURE__*/ new Vector3(); + +const _edge1 = /*@__PURE__*/ new Vector3(); +const _edge2 = /*@__PURE__*/ new Vector3(); +const _normal$1 = /*@__PURE__*/ new Vector3(); + +class Ray { + + constructor( origin = new Vector3(), direction = new Vector3( 0, 0, - 1 ) ) { + + this.origin = origin; + this.direction = direction; + + } + + set( origin, direction ) { + + this.origin.copy( origin ); + this.direction.copy( direction ); + + return this; + + } + + copy( ray ) { + + this.origin.copy( ray.origin ); + this.direction.copy( ray.direction ); + + return this; + + } + + at( t, target ) { + + return target.copy( this.direction ).multiplyScalar( t ).add( this.origin ); + + } + + lookAt( v ) { + + this.direction.copy( v ).sub( this.origin ).normalize(); + + return this; + + } + + recast( t ) { + + this.origin.copy( this.at( t, _vector$a ) ); + + return this; + + } + + closestPointToPoint( point, target ) { + + target.subVectors( point, this.origin ); + + const directionDistance = target.dot( this.direction ); + + if ( directionDistance < 0 ) { + + return target.copy( this.origin ); + + } + + return target.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + + } + + distanceToPoint( point ) { + + return Math.sqrt( this.distanceSqToPoint( point ) ); + + } + + distanceSqToPoint( point ) { + + const directionDistance = _vector$a.subVectors( point, this.origin ).dot( this.direction ); + + // point behind the ray + + if ( directionDistance < 0 ) { + + return this.origin.distanceToSquared( point ); + + } + + _vector$a.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + + return _vector$a.distanceToSquared( point ); + + } + + distanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { + + // from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h + // It returns the min distance between the ray and the segment + // defined by v0 and v1 + // It can also set two optional targets : + // - The closest point on the ray + // - The closest point on the segment + + _segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); + _segDir.copy( v1 ).sub( v0 ).normalize(); + _diff.copy( this.origin ).sub( _segCenter ); + + const segExtent = v0.distanceTo( v1 ) * 0.5; + const a01 = - this.direction.dot( _segDir ); + const b0 = _diff.dot( this.direction ); + const b1 = - _diff.dot( _segDir ); + const c = _diff.lengthSq(); + const det = Math.abs( 1 - a01 * a01 ); + let s0, s1, sqrDist, extDet; + + if ( det > 0 ) { + + // The ray and segment are not parallel. + + s0 = a01 * b1 - b0; + s1 = a01 * b0 - b1; + extDet = segExtent * det; + + if ( s0 >= 0 ) { + + if ( s1 >= - extDet ) { + + if ( s1 <= extDet ) { + + // region 0 + // Minimum at interior points of ray and segment. + + const invDet = 1 / det; + s0 *= invDet; + s1 *= invDet; + sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; + + } else { + + // region 1 + + s1 = segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } else { + + // region 5 + + s1 = - segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } else { + + if ( s1 <= - extDet ) { + + // region 4 + + s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } else if ( s1 <= extDet ) { + + // region 3 + + s0 = 0; + s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = s1 * ( s1 + 2 * b1 ) + c; + + } else { + + // region 2 + + s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } + + } else { + + // Ray and segment are parallel. + + s1 = ( a01 > 0 ) ? - segExtent : segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + if ( optionalPointOnRay ) { + + optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); + + } + + if ( optionalPointOnSegment ) { + + optionalPointOnSegment.copy( _segDir ).multiplyScalar( s1 ).add( _segCenter ); + + } + + return sqrDist; + + } + + intersectSphere( sphere, target ) { + + _vector$a.subVectors( sphere.center, this.origin ); + const tca = _vector$a.dot( this.direction ); + const d2 = _vector$a.dot( _vector$a ) - tca * tca; + const radius2 = sphere.radius * sphere.radius; + + if ( d2 > radius2 ) return null; + + const thc = Math.sqrt( radius2 - d2 ); + + // t0 = first intersect point - entrance on front of sphere + const t0 = tca - thc; + + // t1 = second intersect point - exit point on back of sphere + const t1 = tca + thc; + + // test to see if both t0 and t1 are behind the ray - if so, return null + if ( t0 < 0 && t1 < 0 ) return null; + + // test to see if t0 is behind the ray: + // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, + // in order to always return an intersect point that is in front of the ray. + if ( t0 < 0 ) return this.at( t1, target ); + + // else t0 is in front of the ray, so return the first collision point scaled by t0 + return this.at( t0, target ); + + } + + intersectsSphere( sphere ) { + + return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius ); + + } + + distanceToPlane( plane ) { + + const denominator = plane.normal.dot( this.direction ); + + if ( denominator === 0 ) { + + // line is coplanar, return origin + if ( plane.distanceToPoint( this.origin ) === 0 ) { + + return 0; + + } + + // Null is preferable to undefined since undefined means.... it is undefined + + return null; + + } + + const t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; + + // Return if the ray never intersects the plane + + return t >= 0 ? t : null; + + } + + intersectPlane( plane, target ) { + + const t = this.distanceToPlane( plane ); + + if ( t === null ) { + + return null; + + } + + return this.at( t, target ); + + } + + intersectsPlane( plane ) { + + // check if the ray lies on the plane first + + const distToPoint = plane.distanceToPoint( this.origin ); + + if ( distToPoint === 0 ) { + + return true; + + } + + const denominator = plane.normal.dot( this.direction ); + + if ( denominator * distToPoint < 0 ) { + + return true; + + } + + // ray origin is behind the plane (and is pointing behind it) + + return false; + + } + + intersectBox( box, target ) { + + let tmin, tmax, tymin, tymax, tzmin, tzmax; + + const invdirx = 1 / this.direction.x, + invdiry = 1 / this.direction.y, + invdirz = 1 / this.direction.z; + + const origin = this.origin; + + if ( invdirx >= 0 ) { + + tmin = ( box.min.x - origin.x ) * invdirx; + tmax = ( box.max.x - origin.x ) * invdirx; + + } else { + + tmin = ( box.max.x - origin.x ) * invdirx; + tmax = ( box.min.x - origin.x ) * invdirx; + + } + + if ( invdiry >= 0 ) { + + tymin = ( box.min.y - origin.y ) * invdiry; + tymax = ( box.max.y - origin.y ) * invdiry; + + } else { + + tymin = ( box.max.y - origin.y ) * invdiry; + tymax = ( box.min.y - origin.y ) * invdiry; + + } + + if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null; + + // These lines also handle the case where tmin or tmax is NaN + // (result of 0 * Infinity). x !== x returns true if x is NaN + + if ( tymin > tmin || tmin !== tmin ) tmin = tymin; + + if ( tymax < tmax || tmax !== tmax ) tmax = tymax; + + if ( invdirz >= 0 ) { + + tzmin = ( box.min.z - origin.z ) * invdirz; + tzmax = ( box.max.z - origin.z ) * invdirz; + + } else { + + tzmin = ( box.max.z - origin.z ) * invdirz; + tzmax = ( box.min.z - origin.z ) * invdirz; + + } + + if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null; + + if ( tzmin > tmin || tmin !== tmin ) tmin = tzmin; + + if ( tzmax < tmax || tmax !== tmax ) tmax = tzmax; + + //return point closest to the ray (positive side) + + if ( tmax < 0 ) return null; + + return this.at( tmin >= 0 ? tmin : tmax, target ); + + } + + intersectsBox( box ) { + + return this.intersectBox( box, _vector$a ) !== null; + + } + + intersectTriangle( a, b, c, backfaceCulling, target ) { + + // Compute the offset origin, edges, and normal. + + // from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h + + _edge1.subVectors( b, a ); + _edge2.subVectors( c, a ); + _normal$1.crossVectors( _edge1, _edge2 ); + + // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, + // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by + // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) + // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) + // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) + let DdN = this.direction.dot( _normal$1 ); + let sign; + + if ( DdN > 0 ) { + + if ( backfaceCulling ) return null; + sign = 1; + + } else if ( DdN < 0 ) { + + sign = - 1; + DdN = - DdN; + + } else { + + return null; + + } + + _diff.subVectors( this.origin, a ); + const DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) ); + + // b1 < 0, no intersection + if ( DdQxE2 < 0 ) { + + return null; + + } + + const DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) ); + + // b2 < 0, no intersection + if ( DdE1xQ < 0 ) { + + return null; + + } + + // b1+b2 > 1, no intersection + if ( DdQxE2 + DdE1xQ > DdN ) { + + return null; + + } + + // Line intersects triangle, check if ray does. + const QdN = - sign * _diff.dot( _normal$1 ); + + // t < 0, no intersection + if ( QdN < 0 ) { + + return null; + + } + + // Ray intersects triangle. + return this.at( QdN / DdN, target ); + + } + + applyMatrix4( matrix4 ) { + + this.origin.applyMatrix4( matrix4 ); + this.direction.transformDirection( matrix4 ); + + return this; + + } + + equals( ray ) { + + return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +class Matrix4 { + + constructor() { + + this.elements = [ + + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + + ]; + + if ( arguments.length > 0 ) { + + console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); + + } + + } + + set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { + + const te = this.elements; + + te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; + te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; + te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; + te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; + + return this; + + } + + identity() { + + this.set( + + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + clone() { + + return new Matrix4().fromArray( this.elements ); + + } + + copy( m ) { + + const te = this.elements; + const me = m.elements; + + te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; + te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; + te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; + te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; + + return this; + + } + + copyPosition( m ) { + + const te = this.elements, me = m.elements; + + te[ 12 ] = me[ 12 ]; + te[ 13 ] = me[ 13 ]; + te[ 14 ] = me[ 14 ]; + + return this; + + } + + setFromMatrix3( m ) { + + const me = m.elements; + + this.set( + + me[ 0 ], me[ 3 ], me[ 6 ], 0, + me[ 1 ], me[ 4 ], me[ 7 ], 0, + me[ 2 ], me[ 5 ], me[ 8 ], 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + extractBasis( xAxis, yAxis, zAxis ) { + + xAxis.setFromMatrixColumn( this, 0 ); + yAxis.setFromMatrixColumn( this, 1 ); + zAxis.setFromMatrixColumn( this, 2 ); + + return this; + + } + + makeBasis( xAxis, yAxis, zAxis ) { + + this.set( + xAxis.x, yAxis.x, zAxis.x, 0, + xAxis.y, yAxis.y, zAxis.y, 0, + xAxis.z, yAxis.z, zAxis.z, 0, + 0, 0, 0, 1 + ); + + return this; + + } + + extractRotation( m ) { + + // this method does not support reflection matrices + + const te = this.elements; + const me = m.elements; + + const scaleX = 1 / _v1$5.setFromMatrixColumn( m, 0 ).length(); + const scaleY = 1 / _v1$5.setFromMatrixColumn( m, 1 ).length(); + const scaleZ = 1 / _v1$5.setFromMatrixColumn( m, 2 ).length(); + + te[ 0 ] = me[ 0 ] * scaleX; + te[ 1 ] = me[ 1 ] * scaleX; + te[ 2 ] = me[ 2 ] * scaleX; + te[ 3 ] = 0; + + te[ 4 ] = me[ 4 ] * scaleY; + te[ 5 ] = me[ 5 ] * scaleY; + te[ 6 ] = me[ 6 ] * scaleY; + te[ 7 ] = 0; + + te[ 8 ] = me[ 8 ] * scaleZ; + te[ 9 ] = me[ 9 ] * scaleZ; + te[ 10 ] = me[ 10 ] * scaleZ; + te[ 11 ] = 0; + + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; + + return this; + + } + + makeRotationFromEuler( euler ) { + + if ( ! ( euler && euler.isEuler ) ) { + + console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); + + } + + const te = this.elements; + + const x = euler.x, y = euler.y, z = euler.z; + const a = Math.cos( x ), b = Math.sin( x ); + const c = Math.cos( y ), d = Math.sin( y ); + const e = Math.cos( z ), f = Math.sin( z ); + + if ( euler.order === 'XYZ' ) { + + const ae = a * e, af = a * f, be = b * e, bf = b * f; + + te[ 0 ] = c * e; + te[ 4 ] = - c * f; + te[ 8 ] = d; + + te[ 1 ] = af + be * d; + te[ 5 ] = ae - bf * d; + te[ 9 ] = - b * c; + + te[ 2 ] = bf - ae * d; + te[ 6 ] = be + af * d; + te[ 10 ] = a * c; + + } else if ( euler.order === 'YXZ' ) { + + const ce = c * e, cf = c * f, de = d * e, df = d * f; + + te[ 0 ] = ce + df * b; + te[ 4 ] = de * b - cf; + te[ 8 ] = a * d; + + te[ 1 ] = a * f; + te[ 5 ] = a * e; + te[ 9 ] = - b; + + te[ 2 ] = cf * b - de; + te[ 6 ] = df + ce * b; + te[ 10 ] = a * c; + + } else if ( euler.order === 'ZXY' ) { + + const ce = c * e, cf = c * f, de = d * e, df = d * f; + + te[ 0 ] = ce - df * b; + te[ 4 ] = - a * f; + te[ 8 ] = de + cf * b; + + te[ 1 ] = cf + de * b; + te[ 5 ] = a * e; + te[ 9 ] = df - ce * b; + + te[ 2 ] = - a * d; + te[ 6 ] = b; + te[ 10 ] = a * c; + + } else if ( euler.order === 'ZYX' ) { + + const ae = a * e, af = a * f, be = b * e, bf = b * f; + + te[ 0 ] = c * e; + te[ 4 ] = be * d - af; + te[ 8 ] = ae * d + bf; + + te[ 1 ] = c * f; + te[ 5 ] = bf * d + ae; + te[ 9 ] = af * d - be; + + te[ 2 ] = - d; + te[ 6 ] = b * c; + te[ 10 ] = a * c; + + } else if ( euler.order === 'YZX' ) { + + const ac = a * c, ad = a * d, bc = b * c, bd = b * d; + + te[ 0 ] = c * e; + te[ 4 ] = bd - ac * f; + te[ 8 ] = bc * f + ad; + + te[ 1 ] = f; + te[ 5 ] = a * e; + te[ 9 ] = - b * e; + + te[ 2 ] = - d * e; + te[ 6 ] = ad * f + bc; + te[ 10 ] = ac - bd * f; + + } else if ( euler.order === 'XZY' ) { + + const ac = a * c, ad = a * d, bc = b * c, bd = b * d; + + te[ 0 ] = c * e; + te[ 4 ] = - f; + te[ 8 ] = d * e; + + te[ 1 ] = ac * f + bd; + te[ 5 ] = a * e; + te[ 9 ] = ad * f - bc; + + te[ 2 ] = bc * f - ad; + te[ 6 ] = b * e; + te[ 10 ] = bd * f + ac; + + } + + // bottom row + te[ 3 ] = 0; + te[ 7 ] = 0; + te[ 11 ] = 0; + + // last column + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; + + return this; + + } + + makeRotationFromQuaternion( q ) { + + return this.compose( _zero, q, _one ); + + } + + lookAt( eye, target, up ) { + + const te = this.elements; + + _z.subVectors( eye, target ); + + if ( _z.lengthSq() === 0 ) { + + // eye and target are in the same position + + _z.z = 1; + + } + + _z.normalize(); + _x.crossVectors( up, _z ); + + if ( _x.lengthSq() === 0 ) { + + // up and z are parallel + + if ( Math.abs( up.z ) === 1 ) { + + _z.x += 0.0001; + + } else { + + _z.z += 0.0001; + + } + + _z.normalize(); + _x.crossVectors( up, _z ); + + } + + _x.normalize(); + _y.crossVectors( _z, _x ); + + te[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x; + te[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y; + te[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z; + + return this; + + } + + multiply( m, n ) { + + if ( n !== undefined ) { + + console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); + return this.multiplyMatrices( m, n ); + + } + + return this.multiplyMatrices( this, m ); + + } + + premultiply( m ) { + + return this.multiplyMatrices( m, this ); + + } + + multiplyMatrices( a, b ) { + + const ae = a.elements; + const be = b.elements; + const te = this.elements; + + const a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; + const a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; + const a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; + const a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; + + const b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; + const b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; + const b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; + const b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; + + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + + te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + + return this; + + } + + multiplyScalar( s ) { + + const te = this.elements; + + te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; + te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; + te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; + te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; + + return this; + + } + + determinant() { + + const te = this.elements; + + const n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; + const n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; + const n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; + const n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; + + //TODO: make this more efficient + //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) + + return ( + n41 * ( + + n14 * n23 * n32 + - n13 * n24 * n32 + - n14 * n22 * n33 + + n12 * n24 * n33 + + n13 * n22 * n34 + - n12 * n23 * n34 + ) + + n42 * ( + + n11 * n23 * n34 + - n11 * n24 * n33 + + n14 * n21 * n33 + - n13 * n21 * n34 + + n13 * n24 * n31 + - n14 * n23 * n31 + ) + + n43 * ( + + n11 * n24 * n32 + - n11 * n22 * n34 + - n14 * n21 * n32 + + n12 * n21 * n34 + + n14 * n22 * n31 + - n12 * n24 * n31 + ) + + n44 * ( + - n13 * n22 * n31 + - n11 * n23 * n32 + + n11 * n22 * n33 + + n13 * n21 * n32 + - n12 * n21 * n33 + + n12 * n23 * n31 + ) + + ); + + } + + transpose() { + + const te = this.elements; + let tmp; + + tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; + tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; + tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; + + tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; + tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; + tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; + + return this; + + } + + setPosition( x, y, z ) { + + const te = this.elements; + + if ( x.isVector3 ) { + + te[ 12 ] = x.x; + te[ 13 ] = x.y; + te[ 14 ] = x.z; + + } else { + + te[ 12 ] = x; + te[ 13 ] = y; + te[ 14 ] = z; + + } + + return this; + + } + + invert() { + + // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm + const te = this.elements, + + n11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], n41 = te[ 3 ], + n12 = te[ 4 ], n22 = te[ 5 ], n32 = te[ 6 ], n42 = te[ 7 ], + n13 = te[ 8 ], n23 = te[ 9 ], n33 = te[ 10 ], n43 = te[ 11 ], + n14 = te[ 12 ], n24 = te[ 13 ], n34 = te[ 14 ], n44 = te[ 15 ], + + t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, + t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, + t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, + t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + + const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; + + if ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); + + const detInv = 1 / det; + + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; + te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; + te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; + + te[ 4 ] = t12 * detInv; + te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; + te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; + te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; + + te[ 8 ] = t13 * detInv; + te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; + te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; + te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; + + te[ 12 ] = t14 * detInv; + te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; + te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; + te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; + + return this; + + } + + scale( v ) { + + const te = this.elements; + const x = v.x, y = v.y, z = v.z; + + te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; + te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; + te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; + te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; + + return this; + + } + + getMaxScaleOnAxis() { + + const te = this.elements; + + const scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; + const scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; + const scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; + + return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); + + } + + makeTranslation( x, y, z ) { + + this.set( + + 1, 0, 0, x, + 0, 1, 0, y, + 0, 0, 1, z, + 0, 0, 0, 1 + + ); + + return this; + + } + + makeRotationX( theta ) { + + const c = Math.cos( theta ), s = Math.sin( theta ); + + this.set( + + 1, 0, 0, 0, + 0, c, - s, 0, + 0, s, c, 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + makeRotationY( theta ) { + + const c = Math.cos( theta ), s = Math.sin( theta ); + + this.set( + + c, 0, s, 0, + 0, 1, 0, 0, + - s, 0, c, 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + makeRotationZ( theta ) { + + const c = Math.cos( theta ), s = Math.sin( theta ); + + this.set( + + c, - s, 0, 0, + s, c, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + makeRotationAxis( axis, angle ) { + + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + const c = Math.cos( angle ); + const s = Math.sin( angle ); + const t = 1 - c; + const x = axis.x, y = axis.y, z = axis.z; + const tx = t * x, ty = t * y; + + this.set( + + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + makeScale( x, y, z ) { + + this.set( + + x, 0, 0, 0, + 0, y, 0, 0, + 0, 0, z, 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + makeShear( xy, xz, yx, yz, zx, zy ) { + + this.set( + + 1, yx, zx, 0, + xy, 1, zy, 0, + xz, yz, 1, 0, + 0, 0, 0, 1 + + ); + + return this; + + } + + compose( position, quaternion, scale ) { + + const te = this.elements; + + const x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; + const x2 = x + x, y2 = y + y, z2 = z + z; + const xx = x * x2, xy = x * y2, xz = x * z2; + const yy = y * y2, yz = y * z2, zz = z * z2; + const wx = w * x2, wy = w * y2, wz = w * z2; + + const sx = scale.x, sy = scale.y, sz = scale.z; + + te[ 0 ] = ( 1 - ( yy + zz ) ) * sx; + te[ 1 ] = ( xy + wz ) * sx; + te[ 2 ] = ( xz - wy ) * sx; + te[ 3 ] = 0; + + te[ 4 ] = ( xy - wz ) * sy; + te[ 5 ] = ( 1 - ( xx + zz ) ) * sy; + te[ 6 ] = ( yz + wx ) * sy; + te[ 7 ] = 0; + + te[ 8 ] = ( xz + wy ) * sz; + te[ 9 ] = ( yz - wx ) * sz; + te[ 10 ] = ( 1 - ( xx + yy ) ) * sz; + te[ 11 ] = 0; + + te[ 12 ] = position.x; + te[ 13 ] = position.y; + te[ 14 ] = position.z; + te[ 15 ] = 1; + + return this; + + } + + decompose( position, quaternion, scale ) { + + const te = this.elements; + + let sx = _v1$5.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); + const sy = _v1$5.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); + const sz = _v1$5.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); + + // if determine is negative, we need to invert one scale + const det = this.determinant(); + if ( det < 0 ) sx = - sx; + + position.x = te[ 12 ]; + position.y = te[ 13 ]; + position.z = te[ 14 ]; + + // scale the rotation part + _m1$2.copy( this ); + + const invSX = 1 / sx; + const invSY = 1 / sy; + const invSZ = 1 / sz; + + _m1$2.elements[ 0 ] *= invSX; + _m1$2.elements[ 1 ] *= invSX; + _m1$2.elements[ 2 ] *= invSX; + + _m1$2.elements[ 4 ] *= invSY; + _m1$2.elements[ 5 ] *= invSY; + _m1$2.elements[ 6 ] *= invSY; + + _m1$2.elements[ 8 ] *= invSZ; + _m1$2.elements[ 9 ] *= invSZ; + _m1$2.elements[ 10 ] *= invSZ; + + quaternion.setFromRotationMatrix( _m1$2 ); + + scale.x = sx; + scale.y = sy; + scale.z = sz; + + return this; + + } + + makePerspective( left, right, top, bottom, near, far ) { + + if ( far === undefined ) { + + console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' ); + + } + + const te = this.elements; + const x = 2 * near / ( right - left ); + const y = 2 * near / ( top - bottom ); + + const a = ( right + left ) / ( right - left ); + const b = ( top + bottom ) / ( top - bottom ); + const c = - ( far + near ) / ( far - near ); + const d = - 2 * far * near / ( far - near ); + + te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; + te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; + + return this; + + } + + makeOrthographic( left, right, top, bottom, near, far ) { + + const te = this.elements; + const w = 1.0 / ( right - left ); + const h = 1.0 / ( top - bottom ); + const p = 1.0 / ( far - near ); + + const x = ( right + left ) * w; + const y = ( top + bottom ) * h; + const z = ( far + near ) * p; + + te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; + te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; + + return this; + + } + + equals( matrix ) { + + const te = this.elements; + const me = matrix.elements; + + for ( let i = 0; i < 16; i ++ ) { + + if ( te[ i ] !== me[ i ] ) return false; + + } + + return true; + + } + + fromArray( array, offset = 0 ) { + + for ( let i = 0; i < 16; i ++ ) { + + this.elements[ i ] = array[ i + offset ]; + + } + + return this; + + } + + toArray( array = [], offset = 0 ) { + + const te = this.elements; + + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; + array[ offset + 3 ] = te[ 3 ]; + + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; + + array[ offset + 8 ] = te[ 8 ]; + array[ offset + 9 ] = te[ 9 ]; + array[ offset + 10 ] = te[ 10 ]; + array[ offset + 11 ] = te[ 11 ]; + + array[ offset + 12 ] = te[ 12 ]; + array[ offset + 13 ] = te[ 13 ]; + array[ offset + 14 ] = te[ 14 ]; + array[ offset + 15 ] = te[ 15 ]; + + return array; + + } + +} + +Matrix4.prototype.isMatrix4 = true; + +const _v1$5 = /*@__PURE__*/ new Vector3(); +const _m1$2 = /*@__PURE__*/ new Matrix4(); +const _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 ); +const _one = /*@__PURE__*/ new Vector3( 1, 1, 1 ); +const _x = /*@__PURE__*/ new Vector3(); +const _y = /*@__PURE__*/ new Vector3(); +const _z = /*@__PURE__*/ new Vector3(); + +const _matrix$1 = /*@__PURE__*/ new Matrix4(); +const _quaternion$3 = /*@__PURE__*/ new Quaternion(); + +class Euler { + + constructor( x = 0, y = 0, z = 0, order = Euler.DefaultOrder ) { + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + } + + get x() { + + return this._x; + + } + + set x( value ) { + + this._x = value; + this._onChangeCallback(); + + } + + get y() { + + return this._y; + + } + + set y( value ) { + + this._y = value; + this._onChangeCallback(); + + } + + get z() { + + return this._z; + + } + + set z( value ) { + + this._z = value; + this._onChangeCallback(); + + } + + get order() { + + return this._order; + + } + + set order( value ) { + + this._order = value; + this._onChangeCallback(); + + } + + set( x, y, z, order = this._order ) { + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this._onChangeCallback(); + + return this; + + } + + clone() { + + return new this.constructor( this._x, this._y, this._z, this._order ); + + } + + copy( euler ) { + + this._x = euler._x; + this._y = euler._y; + this._z = euler._z; + this._order = euler._order; + + this._onChangeCallback(); + + return this; + + } + + setFromRotationMatrix( m, order = this._order, update = true ) { + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + const te = m.elements; + const m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; + const m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; + const m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + + switch ( order ) { + + case 'XYZ': + + this._y = Math.asin( clamp( m13, - 1, 1 ) ); + + if ( Math.abs( m13 ) < 0.9999999 ) { + + this._x = Math.atan2( - m23, m33 ); + this._z = Math.atan2( - m12, m11 ); + + } else { + + this._x = Math.atan2( m32, m22 ); + this._z = 0; + + } + + break; + + case 'YXZ': + + this._x = Math.asin( - clamp( m23, - 1, 1 ) ); + + if ( Math.abs( m23 ) < 0.9999999 ) { + + this._y = Math.atan2( m13, m33 ); + this._z = Math.atan2( m21, m22 ); + + } else { + + this._y = Math.atan2( - m31, m11 ); + this._z = 0; + + } + + break; + + case 'ZXY': + + this._x = Math.asin( clamp( m32, - 1, 1 ) ); + + if ( Math.abs( m32 ) < 0.9999999 ) { + + this._y = Math.atan2( - m31, m33 ); + this._z = Math.atan2( - m12, m22 ); + + } else { + + this._y = 0; + this._z = Math.atan2( m21, m11 ); + + } + + break; + + case 'ZYX': + + this._y = Math.asin( - clamp( m31, - 1, 1 ) ); + + if ( Math.abs( m31 ) < 0.9999999 ) { + + this._x = Math.atan2( m32, m33 ); + this._z = Math.atan2( m21, m11 ); + + } else { + + this._x = 0; + this._z = Math.atan2( - m12, m22 ); + + } + + break; + + case 'YZX': + + this._z = Math.asin( clamp( m21, - 1, 1 ) ); + + if ( Math.abs( m21 ) < 0.9999999 ) { + + this._x = Math.atan2( - m23, m22 ); + this._y = Math.atan2( - m31, m11 ); + + } else { + + this._x = 0; + this._y = Math.atan2( m13, m33 ); + + } + + break; + + case 'XZY': + + this._z = Math.asin( - clamp( m12, - 1, 1 ) ); + + if ( Math.abs( m12 ) < 0.9999999 ) { + + this._x = Math.atan2( m32, m22 ); + this._y = Math.atan2( m13, m11 ); + + } else { + + this._x = Math.atan2( - m23, m33 ); + this._y = 0; + + } + + break; + + default: + + console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order ); + + } + + this._order = order; + + if ( update === true ) this._onChangeCallback(); + + return this; + + } + + setFromQuaternion( q, order, update ) { + + _matrix$1.makeRotationFromQuaternion( q ); + + return this.setFromRotationMatrix( _matrix$1, order, update ); + + } + + setFromVector3( v, order = this._order ) { + + return this.set( v.x, v.y, v.z, order ); + + } + + reorder( newOrder ) { + + // WARNING: this discards revolution information -bhouston + + _quaternion$3.setFromEuler( this ); + + return this.setFromQuaternion( _quaternion$3, newOrder ); + + } + + equals( euler ) { + + return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); + + } + + fromArray( array ) { + + this._x = array[ 0 ]; + this._y = array[ 1 ]; + this._z = array[ 2 ]; + if ( array[ 3 ] !== undefined ) this._order = array[ 3 ]; + + this._onChangeCallback(); + + return this; + + } + + toArray( array = [], offset = 0 ) { + + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._order; + + return array; + + } + + toVector3( optionalResult ) { + + if ( optionalResult ) { + + return optionalResult.set( this._x, this._y, this._z ); + + } else { + + return new Vector3( this._x, this._y, this._z ); + + } + + } + + _onChange( callback ) { + + this._onChangeCallback = callback; + + return this; + + } + + _onChangeCallback() {} + +} + +Euler.prototype.isEuler = true; + +Euler.DefaultOrder = 'XYZ'; +Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; + +class Layers { + + constructor() { + + this.mask = 1 | 0; + + } + + set( channel ) { + + this.mask = ( 1 << channel | 0 ) >>> 0; + + } + + enable( channel ) { + + this.mask |= 1 << channel | 0; + + } + + enableAll() { + + this.mask = 0xffffffff | 0; + + } + + toggle( channel ) { + + this.mask ^= 1 << channel | 0; + + } + + disable( channel ) { + + this.mask &= ~ ( 1 << channel | 0 ); + + } + + disableAll() { + + this.mask = 0; + + } + + test( layers ) { + + return ( this.mask & layers.mask ) !== 0; + + } + + isEnabled( channel ) { + + return ( this.mask & ( 1 << channel | 0 ) ) !== 0; + + } + +} + +let _object3DId = 0; + +const _v1$4 = /*@__PURE__*/ new Vector3(); +const _q1 = /*@__PURE__*/ new Quaternion(); +const _m1$1 = /*@__PURE__*/ new Matrix4(); +const _target = /*@__PURE__*/ new Vector3(); + +const _position$3 = /*@__PURE__*/ new Vector3(); +const _scale$2 = /*@__PURE__*/ new Vector3(); +const _quaternion$2 = /*@__PURE__*/ new Quaternion(); + +const _xAxis = /*@__PURE__*/ new Vector3( 1, 0, 0 ); +const _yAxis = /*@__PURE__*/ new Vector3( 0, 1, 0 ); +const _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 ); + +const _addedEvent = { type: 'added' }; +const _removedEvent = { type: 'removed' }; + +class Object3D extends EventDispatcher { + + constructor() { + + super(); + + Object.defineProperty( this, 'id', { value: _object3DId ++ } ); + + this.uuid = generateUUID(); + + this.name = ''; + this.type = 'Object3D'; + + this.parent = null; + this.children = []; + + this.up = Object3D.DefaultUp.clone(); + + const position = new Vector3(); + const rotation = new Euler(); + const quaternion = new Quaternion(); + const scale = new Vector3( 1, 1, 1 ); + + function onRotationChange() { + + quaternion.setFromEuler( rotation, false ); + + } + + function onQuaternionChange() { + + rotation.setFromQuaternion( quaternion, undefined, false ); + + } + + rotation._onChange( onRotationChange ); + quaternion._onChange( onQuaternionChange ); + + Object.defineProperties( this, { + position: { + configurable: true, + enumerable: true, + value: position + }, + rotation: { + configurable: true, + enumerable: true, + value: rotation + }, + quaternion: { + configurable: true, + enumerable: true, + value: quaternion + }, + scale: { + configurable: true, + enumerable: true, + value: scale + }, + modelViewMatrix: { + value: new Matrix4() + }, + normalMatrix: { + value: new Matrix3() + } + } ); + + this.matrix = new Matrix4(); + this.matrixWorld = new Matrix4(); + + this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; + this.matrixWorldNeedsUpdate = false; + + this.layers = new Layers(); + this.visible = true; + + this.castShadow = false; + this.receiveShadow = false; + + this.frustumCulled = true; + this.renderOrder = 0; + + this.animations = []; + + this.userData = {}; + + } + + onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {} + + onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {} + + applyMatrix4( matrix ) { + + if ( this.matrixAutoUpdate ) this.updateMatrix(); + + this.matrix.premultiply( matrix ); + + this.matrix.decompose( this.position, this.quaternion, this.scale ); + + } + + applyQuaternion( q ) { + + this.quaternion.premultiply( q ); + + return this; + + } + + setRotationFromAxisAngle( axis, angle ) { + + // assumes axis is normalized + + this.quaternion.setFromAxisAngle( axis, angle ); + + } + + setRotationFromEuler( euler ) { + + this.quaternion.setFromEuler( euler, true ); + + } + + setRotationFromMatrix( m ) { + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + this.quaternion.setFromRotationMatrix( m ); + + } + + setRotationFromQuaternion( q ) { + + // assumes q is normalized + + this.quaternion.copy( q ); + + } + + rotateOnAxis( axis, angle ) { + + // rotate object on axis in object space + // axis is assumed to be normalized + + _q1.setFromAxisAngle( axis, angle ); + + this.quaternion.multiply( _q1 ); + + return this; + + } + + rotateOnWorldAxis( axis, angle ) { + + // rotate object on axis in world space + // axis is assumed to be normalized + // method assumes no rotated parent + + _q1.setFromAxisAngle( axis, angle ); + + this.quaternion.premultiply( _q1 ); + + return this; + + } + + rotateX( angle ) { + + return this.rotateOnAxis( _xAxis, angle ); + + } + + rotateY( angle ) { + + return this.rotateOnAxis( _yAxis, angle ); + + } + + rotateZ( angle ) { + + return this.rotateOnAxis( _zAxis, angle ); + + } + + translateOnAxis( axis, distance ) { + + // translate object by distance along axis in object space + // axis is assumed to be normalized + + _v1$4.copy( axis ).applyQuaternion( this.quaternion ); + + this.position.add( _v1$4.multiplyScalar( distance ) ); + + return this; + + } + + translateX( distance ) { + + return this.translateOnAxis( _xAxis, distance ); + + } + + translateY( distance ) { + + return this.translateOnAxis( _yAxis, distance ); + + } + + translateZ( distance ) { + + return this.translateOnAxis( _zAxis, distance ); + + } + + localToWorld( vector ) { + + return vector.applyMatrix4( this.matrixWorld ); + + } + + worldToLocal( vector ) { + + return vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() ); + + } + + lookAt( x, y, z ) { + + // This method does not support objects having non-uniformly-scaled parent(s) + + if ( x.isVector3 ) { + + _target.copy( x ); + + } else { + + _target.set( x, y, z ); + + } + + const parent = this.parent; + + this.updateWorldMatrix( true, false ); + + _position$3.setFromMatrixPosition( this.matrixWorld ); + + if ( this.isCamera || this.isLight ) { + + _m1$1.lookAt( _position$3, _target, this.up ); + + } else { + + _m1$1.lookAt( _target, _position$3, this.up ); + + } + + this.quaternion.setFromRotationMatrix( _m1$1 ); + + if ( parent ) { + + _m1$1.extractRotation( parent.matrixWorld ); + _q1.setFromRotationMatrix( _m1$1 ); + this.quaternion.premultiply( _q1.invert() ); + + } + + } + + add( object ) { + + if ( arguments.length > 1 ) { + + for ( let i = 0; i < arguments.length; i ++ ) { + + this.add( arguments[ i ] ); + + } + + return this; + + } + + if ( object === this ) { + + console.error( 'THREE.Object3D.add: object can\'t be added as a child of itself.', object ); + return this; + + } + + if ( object && object.isObject3D ) { + + if ( object.parent !== null ) { + + object.parent.remove( object ); + + } + + object.parent = this; + this.children.push( object ); + + object.dispatchEvent( _addedEvent ); + + } else { + + console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object ); + + } + + return this; + + } + + remove( object ) { + + if ( arguments.length > 1 ) { + + for ( let i = 0; i < arguments.length; i ++ ) { + + this.remove( arguments[ i ] ); + + } + + return this; + + } + + const index = this.children.indexOf( object ); + + if ( index !== - 1 ) { + + object.parent = null; + this.children.splice( index, 1 ); + + object.dispatchEvent( _removedEvent ); + + } + + return this; + + } + + removeFromParent() { + + const parent = this.parent; + + if ( parent !== null ) { + + parent.remove( this ); + + } + + return this; + + } + + clear() { + + for ( let i = 0; i < this.children.length; i ++ ) { + + const object = this.children[ i ]; + + object.parent = null; + + object.dispatchEvent( _removedEvent ); + + } + + this.children.length = 0; + + return this; + + + } + + attach( object ) { + + // adds object as a child of this, while maintaining the object's world transform + + // Note: This method does not support scene graphs having non-uniformly-scaled nodes(s) + + this.updateWorldMatrix( true, false ); + + _m1$1.copy( this.matrixWorld ).invert(); + + if ( object.parent !== null ) { + + object.parent.updateWorldMatrix( true, false ); + + _m1$1.multiply( object.parent.matrixWorld ); + + } + + object.applyMatrix4( _m1$1 ); + + this.add( object ); + + object.updateWorldMatrix( false, true ); + + return this; + + } + + getObjectById( id ) { + + return this.getObjectByProperty( 'id', id ); + + } + + getObjectByName( name ) { + + return this.getObjectByProperty( 'name', name ); + + } + + getObjectByProperty( name, value ) { + + if ( this[ name ] === value ) return this; + + for ( let i = 0, l = this.children.length; i < l; i ++ ) { + + const child = this.children[ i ]; + const object = child.getObjectByProperty( name, value ); + + if ( object !== undefined ) { + + return object; + + } + + } + + return undefined; + + } + + getWorldPosition( target ) { + + this.updateWorldMatrix( true, false ); + + return target.setFromMatrixPosition( this.matrixWorld ); + + } + + getWorldQuaternion( target ) { + + this.updateWorldMatrix( true, false ); + + this.matrixWorld.decompose( _position$3, target, _scale$2 ); + + return target; + + } + + getWorldScale( target ) { + + this.updateWorldMatrix( true, false ); + + this.matrixWorld.decompose( _position$3, _quaternion$2, target ); + + return target; + + } + + getWorldDirection( target ) { + + this.updateWorldMatrix( true, false ); + + const e = this.matrixWorld.elements; + + return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize(); + + } + + raycast( /* raycaster, intersects */ ) {} + + traverse( callback ) { + + callback( this ); + + const children = this.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].traverse( callback ); + + } + + } + + traverseVisible( callback ) { + + if ( this.visible === false ) return; + + callback( this ); + + const children = this.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].traverseVisible( callback ); + + } + + } + + traverseAncestors( callback ) { + + const parent = this.parent; + + if ( parent !== null ) { + + callback( parent ); + + parent.traverseAncestors( callback ); + + } + + } + + updateMatrix() { + + this.matrix.compose( this.position, this.quaternion, this.scale ); + + this.matrixWorldNeedsUpdate = true; + + } + + updateMatrixWorld( force ) { + + if ( this.matrixAutoUpdate ) this.updateMatrix(); + + if ( this.matrixWorldNeedsUpdate || force ) { + + if ( this.parent === null ) { + + this.matrixWorld.copy( this.matrix ); + + } else { + + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + + } + + this.matrixWorldNeedsUpdate = false; + + force = true; + + } + + // update children + + const children = this.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].updateMatrixWorld( force ); + + } + + } + + updateWorldMatrix( updateParents, updateChildren ) { + + const parent = this.parent; + + if ( updateParents === true && parent !== null ) { + + parent.updateWorldMatrix( true, false ); + + } + + if ( this.matrixAutoUpdate ) this.updateMatrix(); + + if ( this.parent === null ) { + + this.matrixWorld.copy( this.matrix ); + + } else { + + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + + } + + // update children + + if ( updateChildren === true ) { + + const children = this.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].updateWorldMatrix( false, true ); + + } + + } + + } + + toJSON( meta ) { + + // meta is a string when called from JSON.stringify + const isRootObject = ( meta === undefined || typeof meta === 'string' ); + + const output = {}; + + // meta is a hash used to collect geometries, materials. + // not providing it implies that this is the root object + // being serialized. + if ( isRootObject ) { + + // initialize meta obj + meta = { + geometries: {}, + materials: {}, + textures: {}, + images: {}, + shapes: {}, + skeletons: {}, + animations: {} + }; + + output.metadata = { + version: 4.5, + type: 'Object', + generator: 'Object3D.toJSON' + }; + + } + + // standard Object3D serialization + + const object = {}; + + object.uuid = this.uuid; + object.type = this.type; + + if ( this.name !== '' ) object.name = this.name; + if ( this.castShadow === true ) object.castShadow = true; + if ( this.receiveShadow === true ) object.receiveShadow = true; + if ( this.visible === false ) object.visible = false; + if ( this.frustumCulled === false ) object.frustumCulled = false; + if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder; + if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData; + + object.layers = this.layers.mask; + object.matrix = this.matrix.toArray(); + + if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false; + + // object specific properties + + if ( this.isInstancedMesh ) { + + object.type = 'InstancedMesh'; + object.count = this.count; + object.instanceMatrix = this.instanceMatrix.toJSON(); + if ( this.instanceColor !== null ) object.instanceColor = this.instanceColor.toJSON(); + + } + + // + + function serialize( library, element ) { + + if ( library[ element.uuid ] === undefined ) { + + library[ element.uuid ] = element.toJSON( meta ); + + } + + return element.uuid; + + } + + if ( this.isScene ) { + + if ( this.background ) { + + if ( this.background.isColor ) { + + object.background = this.background.toJSON(); + + } else if ( this.background.isTexture ) { + + object.background = this.background.toJSON( meta ).uuid; + + } + + } + + if ( this.environment && this.environment.isTexture ) { + + object.environment = this.environment.toJSON( meta ).uuid; + + } + + } else if ( this.isMesh || this.isLine || this.isPoints ) { + + object.geometry = serialize( meta.geometries, this.geometry ); + + const parameters = this.geometry.parameters; + + if ( parameters !== undefined && parameters.shapes !== undefined ) { + + const shapes = parameters.shapes; + + if ( Array.isArray( shapes ) ) { + + for ( let i = 0, l = shapes.length; i < l; i ++ ) { + + const shape = shapes[ i ]; + + serialize( meta.shapes, shape ); + + } + + } else { + + serialize( meta.shapes, shapes ); + + } + + } + + } + + if ( this.isSkinnedMesh ) { + + object.bindMode = this.bindMode; + object.bindMatrix = this.bindMatrix.toArray(); + + if ( this.skeleton !== undefined ) { + + serialize( meta.skeletons, this.skeleton ); + + object.skeleton = this.skeleton.uuid; + + } + + } + + if ( this.material !== undefined ) { + + if ( Array.isArray( this.material ) ) { + + const uuids = []; + + for ( let i = 0, l = this.material.length; i < l; i ++ ) { + + uuids.push( serialize( meta.materials, this.material[ i ] ) ); + + } + + object.material = uuids; + + } else { + + object.material = serialize( meta.materials, this.material ); + + } + + } + + // + + if ( this.children.length > 0 ) { + + object.children = []; + + for ( let i = 0; i < this.children.length; i ++ ) { + + object.children.push( this.children[ i ].toJSON( meta ).object ); + + } + + } + + // + + if ( this.animations.length > 0 ) { + + object.animations = []; + + for ( let i = 0; i < this.animations.length; i ++ ) { + + const animation = this.animations[ i ]; + + object.animations.push( serialize( meta.animations, animation ) ); + + } + + } + + if ( isRootObject ) { + + const geometries = extractFromCache( meta.geometries ); + const materials = extractFromCache( meta.materials ); + const textures = extractFromCache( meta.textures ); + const images = extractFromCache( meta.images ); + const shapes = extractFromCache( meta.shapes ); + const skeletons = extractFromCache( meta.skeletons ); + const animations = extractFromCache( meta.animations ); + + if ( geometries.length > 0 ) output.geometries = geometries; + if ( materials.length > 0 ) output.materials = materials; + if ( textures.length > 0 ) output.textures = textures; + if ( images.length > 0 ) output.images = images; + if ( shapes.length > 0 ) output.shapes = shapes; + if ( skeletons.length > 0 ) output.skeletons = skeletons; + if ( animations.length > 0 ) output.animations = animations; + + } + + output.object = object; + + return output; + + // extract data from the cache hash + // remove metadata on each item + // and return as array + function extractFromCache( cache ) { + + const values = []; + for ( const key in cache ) { + + const data = cache[ key ]; + delete data.metadata; + values.push( data ); + + } + + return values; + + } + + } + + clone( recursive ) { + + return new this.constructor().copy( this, recursive ); + + } + + copy( source, recursive = true ) { + + this.name = source.name; + + this.up.copy( source.up ); + + this.position.copy( source.position ); + this.rotation.order = source.rotation.order; + this.quaternion.copy( source.quaternion ); + this.scale.copy( source.scale ); + + this.matrix.copy( source.matrix ); + this.matrixWorld.copy( source.matrixWorld ); + + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; + + this.layers.mask = source.layers.mask; + this.visible = source.visible; + + this.castShadow = source.castShadow; + this.receiveShadow = source.receiveShadow; + + this.frustumCulled = source.frustumCulled; + this.renderOrder = source.renderOrder; + + this.userData = JSON.parse( JSON.stringify( source.userData ) ); + + if ( recursive === true ) { + + for ( let i = 0; i < source.children.length; i ++ ) { + + const child = source.children[ i ]; + this.add( child.clone() ); + + } + + } + + return this; + + } + +} + +Object3D.DefaultUp = new Vector3( 0, 1, 0 ); +Object3D.DefaultMatrixAutoUpdate = true; + +Object3D.prototype.isObject3D = true; + +const _v0$1 = /*@__PURE__*/ new Vector3(); +const _v1$3 = /*@__PURE__*/ new Vector3(); +const _v2$2 = /*@__PURE__*/ new Vector3(); +const _v3$1 = /*@__PURE__*/ new Vector3(); + +const _vab = /*@__PURE__*/ new Vector3(); +const _vac = /*@__PURE__*/ new Vector3(); +const _vbc = /*@__PURE__*/ new Vector3(); +const _vap = /*@__PURE__*/ new Vector3(); +const _vbp = /*@__PURE__*/ new Vector3(); +const _vcp = /*@__PURE__*/ new Vector3(); + +class Triangle { + + constructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) { + + this.a = a; + this.b = b; + this.c = c; + + } + + static getNormal( a, b, c, target ) { + + target.subVectors( c, b ); + _v0$1.subVectors( a, b ); + target.cross( _v0$1 ); + + const targetLengthSq = target.lengthSq(); + if ( targetLengthSq > 0 ) { + + return target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) ); + + } + + return target.set( 0, 0, 0 ); + + } + + // static/instance method to calculate barycentric coordinates + // based on: http://www.blackpawn.com/texts/pointinpoly/default.html + static getBarycoord( point, a, b, c, target ) { + + _v0$1.subVectors( c, a ); + _v1$3.subVectors( b, a ); + _v2$2.subVectors( point, a ); + + const dot00 = _v0$1.dot( _v0$1 ); + const dot01 = _v0$1.dot( _v1$3 ); + const dot02 = _v0$1.dot( _v2$2 ); + const dot11 = _v1$3.dot( _v1$3 ); + const dot12 = _v1$3.dot( _v2$2 ); + + const denom = ( dot00 * dot11 - dot01 * dot01 ); + + // collinear or singular triangle + if ( denom === 0 ) { + + // arbitrary location outside of triangle? + // not sure if this is the best idea, maybe should be returning undefined + return target.set( - 2, - 1, - 1 ); + + } + + const invDenom = 1 / denom; + const u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; + const v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; + + // barycentric coordinates must always sum to 1 + return target.set( 1 - u - v, v, u ); + + } + + static containsPoint( point, a, b, c ) { + + this.getBarycoord( point, a, b, c, _v3$1 ); + + return ( _v3$1.x >= 0 ) && ( _v3$1.y >= 0 ) && ( ( _v3$1.x + _v3$1.y ) <= 1 ); + + } + + static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) { + + this.getBarycoord( point, p1, p2, p3, _v3$1 ); + + target.set( 0, 0 ); + target.addScaledVector( uv1, _v3$1.x ); + target.addScaledVector( uv2, _v3$1.y ); + target.addScaledVector( uv3, _v3$1.z ); + + return target; + + } + + static isFrontFacing( a, b, c, direction ) { + + _v0$1.subVectors( c, b ); + _v1$3.subVectors( a, b ); + + // strictly front facing + return ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false; + + } + + set( a, b, c ) { + + this.a.copy( a ); + this.b.copy( b ); + this.c.copy( c ); + + return this; + + } + + setFromPointsAndIndices( points, i0, i1, i2 ) { + + this.a.copy( points[ i0 ] ); + this.b.copy( points[ i1 ] ); + this.c.copy( points[ i2 ] ); + + return this; + + } + + setFromAttributeAndIndices( attribute, i0, i1, i2 ) { + + this.a.fromBufferAttribute( attribute, i0 ); + this.b.fromBufferAttribute( attribute, i1 ); + this.c.fromBufferAttribute( attribute, i2 ); + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( triangle ) { + + this.a.copy( triangle.a ); + this.b.copy( triangle.b ); + this.c.copy( triangle.c ); + + return this; + + } + + getArea() { + + _v0$1.subVectors( this.c, this.b ); + _v1$3.subVectors( this.a, this.b ); + + return _v0$1.cross( _v1$3 ).length() * 0.5; + + } + + getMidpoint( target ) { + + return target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); + + } + + getNormal( target ) { + + return Triangle.getNormal( this.a, this.b, this.c, target ); + + } + + getPlane( target ) { + + return target.setFromCoplanarPoints( this.a, this.b, this.c ); + + } + + getBarycoord( point, target ) { + + return Triangle.getBarycoord( point, this.a, this.b, this.c, target ); + + } + + getUV( point, uv1, uv2, uv3, target ) { + + return Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, target ); + + } + + containsPoint( point ) { + + return Triangle.containsPoint( point, this.a, this.b, this.c ); + + } + + isFrontFacing( direction ) { + + return Triangle.isFrontFacing( this.a, this.b, this.c, direction ); + + } + + intersectsBox( box ) { + + return box.intersectsTriangle( this ); + + } + + closestPointToPoint( p, target ) { + + const a = this.a, b = this.b, c = this.c; + let v, w; + + // algorithm thanks to Real-Time Collision Detection by Christer Ericson, + // published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc., + // under the accompanying license; see chapter 5.1.5 for detailed explanation. + // basically, we're distinguishing which of the voronoi regions of the triangle + // the point lies in with the minimum amount of redundant computation. + + _vab.subVectors( b, a ); + _vac.subVectors( c, a ); + _vap.subVectors( p, a ); + const d1 = _vab.dot( _vap ); + const d2 = _vac.dot( _vap ); + if ( d1 <= 0 && d2 <= 0 ) { + + // vertex region of A; barycentric coords (1, 0, 0) + return target.copy( a ); + + } + + _vbp.subVectors( p, b ); + const d3 = _vab.dot( _vbp ); + const d4 = _vac.dot( _vbp ); + if ( d3 >= 0 && d4 <= d3 ) { + + // vertex region of B; barycentric coords (0, 1, 0) + return target.copy( b ); + + } + + const vc = d1 * d4 - d3 * d2; + if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) { + + v = d1 / ( d1 - d3 ); + // edge region of AB; barycentric coords (1-v, v, 0) + return target.copy( a ).addScaledVector( _vab, v ); + + } + + _vcp.subVectors( p, c ); + const d5 = _vab.dot( _vcp ); + const d6 = _vac.dot( _vcp ); + if ( d6 >= 0 && d5 <= d6 ) { + + // vertex region of C; barycentric coords (0, 0, 1) + return target.copy( c ); + + } + + const vb = d5 * d2 - d1 * d6; + if ( vb <= 0 && d2 >= 0 && d6 <= 0 ) { + + w = d2 / ( d2 - d6 ); + // edge region of AC; barycentric coords (1-w, 0, w) + return target.copy( a ).addScaledVector( _vac, w ); + + } + + const va = d3 * d6 - d5 * d4; + if ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) { + + _vbc.subVectors( c, b ); + w = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) ); + // edge region of BC; barycentric coords (0, 1-w, w) + return target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC + + } + + // face region + const denom = 1 / ( va + vb + vc ); + // u = va * denom + v = vb * denom; + w = vc * denom; + + return target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w ); + + } + + equals( triangle ) { + + return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); + + } + +} + +let materialId = 0; + +class Material extends EventDispatcher { + + constructor() { + + super(); + + Object.defineProperty( this, 'id', { value: materialId ++ } ); + + this.uuid = generateUUID(); + + this.name = ''; + this.type = 'Material'; + + this.fog = true; + + this.blending = NormalBlending; + this.side = FrontSide; + this.vertexColors = false; + + this.opacity = 1; + this.transparent = false; + + this.blendSrc = SrcAlphaFactor; + this.blendDst = OneMinusSrcAlphaFactor; + this.blendEquation = AddEquation; + this.blendSrcAlpha = null; + this.blendDstAlpha = null; + this.blendEquationAlpha = null; + + this.depthFunc = LessEqualDepth; + this.depthTest = true; + this.depthWrite = true; + + this.stencilWriteMask = 0xff; + this.stencilFunc = AlwaysStencilFunc; + this.stencilRef = 0; + this.stencilFuncMask = 0xff; + this.stencilFail = KeepStencilOp; + this.stencilZFail = KeepStencilOp; + this.stencilZPass = KeepStencilOp; + this.stencilWrite = false; + + this.clippingPlanes = null; + this.clipIntersection = false; + this.clipShadows = false; + + this.shadowSide = null; + + this.colorWrite = true; + + this.precision = null; // override the renderer's default precision for this material + + this.polygonOffset = false; + this.polygonOffsetFactor = 0; + this.polygonOffsetUnits = 0; + + this.dithering = false; + + this.alphaToCoverage = false; + this.premultipliedAlpha = false; + + this.visible = true; + + this.toneMapped = true; + + this.userData = {}; + + this.version = 0; + + this._alphaTest = 0; + + } + + get alphaTest() { + + return this._alphaTest; + + } + + set alphaTest( value ) { + + if ( this._alphaTest > 0 !== value > 0 ) { + + this.version ++; + + } + + this._alphaTest = value; + + } + + onBuild( /* shaderobject, renderer */ ) {} + + onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {} + + onBeforeCompile( /* shaderobject, renderer */ ) {} + + customProgramCacheKey() { + + return this.onBeforeCompile.toString(); + + } + + setValues( values ) { + + if ( values === undefined ) return; + + for ( const key in values ) { + + const newValue = values[ key ]; + + if ( newValue === undefined ) { + + console.warn( 'THREE.Material: \'' + key + '\' parameter is undefined.' ); + continue; + + } + + // for backward compatability if shading is set in the constructor + if ( key === 'shading' ) { + + console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); + this.flatShading = ( newValue === FlatShading ) ? true : false; + continue; + + } + + const currentValue = this[ key ]; + + if ( currentValue === undefined ) { + + console.warn( 'THREE.' + this.type + ': \'' + key + '\' is not a property of this material.' ); + continue; + + } + + if ( currentValue && currentValue.isColor ) { + + currentValue.set( newValue ); + + } else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) { + + currentValue.copy( newValue ); + + } else { + + this[ key ] = newValue; + + } + + } + + } + + toJSON( meta ) { + + const isRoot = ( meta === undefined || typeof meta === 'string' ); + + if ( isRoot ) { + + meta = { + textures: {}, + images: {} + }; + + } + + const data = { + metadata: { + version: 4.5, + type: 'Material', + generator: 'Material.toJSON' + } + }; + + // standard Material serialization + data.uuid = this.uuid; + data.type = this.type; + + if ( this.name !== '' ) data.name = this.name; + + if ( this.color && this.color.isColor ) data.color = this.color.getHex(); + + if ( this.roughness !== undefined ) data.roughness = this.roughness; + if ( this.metalness !== undefined ) data.metalness = this.metalness; + + if ( this.sheen !== undefined ) data.sheen = this.sheen; + if ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex(); + if ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness; + if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex(); + if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity; + + if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex(); + if ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity; + if ( this.specularColor && this.specularColor.isColor ) data.specularColor = this.specularColor.getHex(); + if ( this.shininess !== undefined ) data.shininess = this.shininess; + if ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat; + if ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness; + + if ( this.clearcoatMap && this.clearcoatMap.isTexture ) { + + data.clearcoatMap = this.clearcoatMap.toJSON( meta ).uuid; + + } + + if ( this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture ) { + + data.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON( meta ).uuid; + + } + + if ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) { + + data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid; + data.clearcoatNormalScale = this.clearcoatNormalScale.toArray(); + + } + + if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid; + if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid; + if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid; + + if ( this.lightMap && this.lightMap.isTexture ) { + + data.lightMap = this.lightMap.toJSON( meta ).uuid; + data.lightMapIntensity = this.lightMapIntensity; + + } + + if ( this.aoMap && this.aoMap.isTexture ) { + + data.aoMap = this.aoMap.toJSON( meta ).uuid; + data.aoMapIntensity = this.aoMapIntensity; + + } + + if ( this.bumpMap && this.bumpMap.isTexture ) { + + data.bumpMap = this.bumpMap.toJSON( meta ).uuid; + data.bumpScale = this.bumpScale; + + } + + if ( this.normalMap && this.normalMap.isTexture ) { + + data.normalMap = this.normalMap.toJSON( meta ).uuid; + data.normalMapType = this.normalMapType; + data.normalScale = this.normalScale.toArray(); + + } + + if ( this.displacementMap && this.displacementMap.isTexture ) { + + data.displacementMap = this.displacementMap.toJSON( meta ).uuid; + data.displacementScale = this.displacementScale; + data.displacementBias = this.displacementBias; + + } + + if ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid; + if ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid; + + if ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid; + if ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid; + if ( this.specularIntensityMap && this.specularIntensityMap.isTexture ) data.specularIntensityMap = this.specularIntensityMap.toJSON( meta ).uuid; + if ( this.specularColorMap && this.specularColorMap.isTexture ) data.specularColorMap = this.specularColorMap.toJSON( meta ).uuid; + + if ( this.envMap && this.envMap.isTexture ) { + + data.envMap = this.envMap.toJSON( meta ).uuid; + + if ( this.combine !== undefined ) data.combine = this.combine; + + } + + if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity; + if ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity; + if ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio; + + if ( this.gradientMap && this.gradientMap.isTexture ) { + + data.gradientMap = this.gradientMap.toJSON( meta ).uuid; + + } + + if ( this.transmission !== undefined ) data.transmission = this.transmission; + if ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid; + if ( this.thickness !== undefined ) data.thickness = this.thickness; + if ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid; + if ( this.attenuationDistance !== undefined ) data.attenuationDistance = this.attenuationDistance; + if ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex(); + + if ( this.size !== undefined ) data.size = this.size; + if ( this.shadowSide !== null ) data.shadowSide = this.shadowSide; + if ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation; + + if ( this.blending !== NormalBlending ) data.blending = this.blending; + if ( this.side !== FrontSide ) data.side = this.side; + if ( this.vertexColors ) data.vertexColors = true; + + if ( this.opacity < 1 ) data.opacity = this.opacity; + if ( this.transparent === true ) data.transparent = this.transparent; + + data.depthFunc = this.depthFunc; + data.depthTest = this.depthTest; + data.depthWrite = this.depthWrite; + data.colorWrite = this.colorWrite; + + data.stencilWrite = this.stencilWrite; + data.stencilWriteMask = this.stencilWriteMask; + data.stencilFunc = this.stencilFunc; + data.stencilRef = this.stencilRef; + data.stencilFuncMask = this.stencilFuncMask; + data.stencilFail = this.stencilFail; + data.stencilZFail = this.stencilZFail; + data.stencilZPass = this.stencilZPass; + + // rotation (SpriteMaterial) + if ( this.rotation && this.rotation !== 0 ) data.rotation = this.rotation; + + if ( this.polygonOffset === true ) data.polygonOffset = true; + if ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor; + if ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits; + + if ( this.linewidth && this.linewidth !== 1 ) data.linewidth = this.linewidth; + if ( this.dashSize !== undefined ) data.dashSize = this.dashSize; + if ( this.gapSize !== undefined ) data.gapSize = this.gapSize; + if ( this.scale !== undefined ) data.scale = this.scale; + + if ( this.dithering === true ) data.dithering = true; + + if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest; + if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage; + if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; + + if ( this.wireframe === true ) data.wireframe = this.wireframe; + if ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth; + if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap; + if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin; + + if ( this.flatShading === true ) data.flatShading = this.flatShading; + + if ( this.visible === false ) data.visible = false; + + if ( this.toneMapped === false ) data.toneMapped = false; + + if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData; + + // TODO: Copied from Object3D.toJSON + + function extractFromCache( cache ) { + + const values = []; + + for ( const key in cache ) { + + const data = cache[ key ]; + delete data.metadata; + values.push( data ); + + } + + return values; + + } + + if ( isRoot ) { + + const textures = extractFromCache( meta.textures ); + const images = extractFromCache( meta.images ); + + if ( textures.length > 0 ) data.textures = textures; + if ( images.length > 0 ) data.images = images; + + } + + return data; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( source ) { + + this.name = source.name; + + this.fog = source.fog; + + this.blending = source.blending; + this.side = source.side; + this.vertexColors = source.vertexColors; + + this.opacity = source.opacity; + this.transparent = source.transparent; + + this.blendSrc = source.blendSrc; + this.blendDst = source.blendDst; + this.blendEquation = source.blendEquation; + this.blendSrcAlpha = source.blendSrcAlpha; + this.blendDstAlpha = source.blendDstAlpha; + this.blendEquationAlpha = source.blendEquationAlpha; + + this.depthFunc = source.depthFunc; + this.depthTest = source.depthTest; + this.depthWrite = source.depthWrite; + + this.stencilWriteMask = source.stencilWriteMask; + this.stencilFunc = source.stencilFunc; + this.stencilRef = source.stencilRef; + this.stencilFuncMask = source.stencilFuncMask; + this.stencilFail = source.stencilFail; + this.stencilZFail = source.stencilZFail; + this.stencilZPass = source.stencilZPass; + this.stencilWrite = source.stencilWrite; + + const srcPlanes = source.clippingPlanes; + let dstPlanes = null; + + if ( srcPlanes !== null ) { + + const n = srcPlanes.length; + dstPlanes = new Array( n ); + + for ( let i = 0; i !== n; ++ i ) { + + dstPlanes[ i ] = srcPlanes[ i ].clone(); + + } + + } + + this.clippingPlanes = dstPlanes; + this.clipIntersection = source.clipIntersection; + this.clipShadows = source.clipShadows; + + this.shadowSide = source.shadowSide; + + this.colorWrite = source.colorWrite; + + this.precision = source.precision; + + this.polygonOffset = source.polygonOffset; + this.polygonOffsetFactor = source.polygonOffsetFactor; + this.polygonOffsetUnits = source.polygonOffsetUnits; + + this.dithering = source.dithering; + + this.alphaTest = source.alphaTest; + this.alphaToCoverage = source.alphaToCoverage; + this.premultipliedAlpha = source.premultipliedAlpha; + + this.visible = source.visible; + + this.toneMapped = source.toneMapped; + + this.userData = JSON.parse( JSON.stringify( source.userData ) ); + + return this; + + } + + dispose() { + + this.dispatchEvent( { type: 'dispose' } ); + + } + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + } + +} + +Material.prototype.isMaterial = true; + +/** + * parameters = { + * color: , + * opacity: , + * map: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * specularMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), + * combine: THREE.Multiply, + * reflectivity: , + * refractionRatio: , + * + * depthTest: , + * depthWrite: , + * + * wireframe: , + * wireframeLinewidth: , + * } + */ + +class MeshBasicMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'MeshBasicMaterial'; + + this.color = new Color( 0xffffff ); // emissive + + this.map = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.specularMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + + this.map = source.map; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.specularMap = source.specularMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + return this; + + } + +} + +MeshBasicMaterial.prototype.isMeshBasicMaterial = true; + +const _vector$9 = /*@__PURE__*/ new Vector3(); +const _vector2$1 = /*@__PURE__*/ new Vector2(); + +class BufferAttribute { + + constructor( array, itemSize, normalized ) { + + if ( Array.isArray( array ) ) { + + throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); + + } + + this.name = ''; + + this.array = array; + this.itemSize = itemSize; + this.count = array !== undefined ? array.length / itemSize : 0; + this.normalized = normalized === true; + + this.usage = StaticDrawUsage; + this.updateRange = { offset: 0, count: - 1 }; + + this.version = 0; + + } + + onUploadCallback() {} + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + } + + setUsage( value ) { + + this.usage = value; + + return this; + + } + + copy( source ) { + + this.name = source.name; + this.array = new source.array.constructor( source.array ); + this.itemSize = source.itemSize; + this.count = source.count; + this.normalized = source.normalized; + + this.usage = source.usage; + + return this; + + } + + copyAt( index1, attribute, index2 ) { + + index1 *= this.itemSize; + index2 *= attribute.itemSize; + + for ( let i = 0, l = this.itemSize; i < l; i ++ ) { + + this.array[ index1 + i ] = attribute.array[ index2 + i ]; + + } + + return this; + + } + + copyArray( array ) { + + this.array.set( array ); + + return this; + + } + + copyColorsArray( colors ) { + + const array = this.array; + let offset = 0; + + for ( let i = 0, l = colors.length; i < l; i ++ ) { + + let color = colors[ i ]; + + if ( color === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', i ); + color = new Color(); + + } + + array[ offset ++ ] = color.r; + array[ offset ++ ] = color.g; + array[ offset ++ ] = color.b; + + } + + return this; + + } + + copyVector2sArray( vectors ) { + + const array = this.array; + let offset = 0; + + for ( let i = 0, l = vectors.length; i < l; i ++ ) { + + let vector = vectors[ i ]; + + if ( vector === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i ); + vector = new Vector2(); + + } + + array[ offset ++ ] = vector.x; + array[ offset ++ ] = vector.y; + + } + + return this; + + } + + copyVector3sArray( vectors ) { + + const array = this.array; + let offset = 0; + + for ( let i = 0, l = vectors.length; i < l; i ++ ) { + + let vector = vectors[ i ]; + + if ( vector === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i ); + vector = new Vector3(); + + } + + array[ offset ++ ] = vector.x; + array[ offset ++ ] = vector.y; + array[ offset ++ ] = vector.z; + + } + + return this; + + } + + copyVector4sArray( vectors ) { + + const array = this.array; + let offset = 0; + + for ( let i = 0, l = vectors.length; i < l; i ++ ) { + + let vector = vectors[ i ]; + + if ( vector === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i ); + vector = new Vector4(); + + } + + array[ offset ++ ] = vector.x; + array[ offset ++ ] = vector.y; + array[ offset ++ ] = vector.z; + array[ offset ++ ] = vector.w; + + } + + return this; + + } + + applyMatrix3( m ) { + + if ( this.itemSize === 2 ) { + + for ( let i = 0, l = this.count; i < l; i ++ ) { + + _vector2$1.fromBufferAttribute( this, i ); + _vector2$1.applyMatrix3( m ); + + this.setXY( i, _vector2$1.x, _vector2$1.y ); + + } + + } else if ( this.itemSize === 3 ) { + + for ( let i = 0, l = this.count; i < l; i ++ ) { + + _vector$9.fromBufferAttribute( this, i ); + _vector$9.applyMatrix3( m ); + + this.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z ); + + } + + } + + return this; + + } + + applyMatrix4( m ) { + + for ( let i = 0, l = this.count; i < l; i ++ ) { + + _vector$9.x = this.getX( i ); + _vector$9.y = this.getY( i ); + _vector$9.z = this.getZ( i ); + + _vector$9.applyMatrix4( m ); + + this.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z ); + + } + + return this; + + } + + applyNormalMatrix( m ) { + + for ( let i = 0, l = this.count; i < l; i ++ ) { + + _vector$9.x = this.getX( i ); + _vector$9.y = this.getY( i ); + _vector$9.z = this.getZ( i ); + + _vector$9.applyNormalMatrix( m ); + + this.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z ); + + } + + return this; + + } + + transformDirection( m ) { + + for ( let i = 0, l = this.count; i < l; i ++ ) { + + _vector$9.x = this.getX( i ); + _vector$9.y = this.getY( i ); + _vector$9.z = this.getZ( i ); + + _vector$9.transformDirection( m ); + + this.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z ); + + } + + return this; + + } + + set( value, offset = 0 ) { + + this.array.set( value, offset ); + + return this; + + } + + getX( index ) { + + return this.array[ index * this.itemSize ]; + + } + + setX( index, x ) { + + this.array[ index * this.itemSize ] = x; + + return this; + + } + + getY( index ) { + + return this.array[ index * this.itemSize + 1 ]; + + } + + setY( index, y ) { + + this.array[ index * this.itemSize + 1 ] = y; + + return this; + + } + + getZ( index ) { + + return this.array[ index * this.itemSize + 2 ]; + + } + + setZ( index, z ) { + + this.array[ index * this.itemSize + 2 ] = z; + + return this; + + } + + getW( index ) { + + return this.array[ index * this.itemSize + 3 ]; + + } + + setW( index, w ) { + + this.array[ index * this.itemSize + 3 ] = w; + + return this; + + } + + setXY( index, x, y ) { + + index *= this.itemSize; + + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + + return this; + + } + + setXYZ( index, x, y, z ) { + + index *= this.itemSize; + + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + this.array[ index + 2 ] = z; + + return this; + + } + + setXYZW( index, x, y, z, w ) { + + index *= this.itemSize; + + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + this.array[ index + 2 ] = z; + this.array[ index + 3 ] = w; + + return this; + + } + + onUpload( callback ) { + + this.onUploadCallback = callback; + + return this; + + } + + clone() { + + return new this.constructor( this.array, this.itemSize ).copy( this ); + + } + + toJSON() { + + const data = { + itemSize: this.itemSize, + type: this.array.constructor.name, + array: Array.prototype.slice.call( this.array ), + normalized: this.normalized + }; + + if ( this.name !== '' ) data.name = this.name; + if ( this.usage !== StaticDrawUsage ) data.usage = this.usage; + if ( this.updateRange.offset !== 0 || this.updateRange.count !== - 1 ) data.updateRange = this.updateRange; + + return data; + + } + +} + +BufferAttribute.prototype.isBufferAttribute = true; + +// + +class Int8BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Int8Array( array ), itemSize, normalized ); + + } + +} + +class Uint8BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Uint8Array( array ), itemSize, normalized ); + + } + +} + +class Uint8ClampedBufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Uint8ClampedArray( array ), itemSize, normalized ); + + } + +} + +class Int16BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Int16Array( array ), itemSize, normalized ); + + } + +} + +class Uint16BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Uint16Array( array ), itemSize, normalized ); + + } + +} + +class Int32BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Int32Array( array ), itemSize, normalized ); + + } + +} + +class Uint32BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Uint32Array( array ), itemSize, normalized ); + + } + +} + +class Float16BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Uint16Array( array ), itemSize, normalized ); + + } + +} + +Float16BufferAttribute.prototype.isFloat16BufferAttribute = true; + +class Float32BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Float32Array( array ), itemSize, normalized ); + + } + +} + +class Float64BufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized ) { + + super( new Float64Array( array ), itemSize, normalized ); + + } + +} + +let _id$1 = 0; + +const _m1 = /*@__PURE__*/ new Matrix4(); +const _obj = /*@__PURE__*/ new Object3D(); +const _offset = /*@__PURE__*/ new Vector3(); +const _box$1 = /*@__PURE__*/ new Box3(); +const _boxMorphTargets = /*@__PURE__*/ new Box3(); +const _vector$8 = /*@__PURE__*/ new Vector3(); + +class BufferGeometry extends EventDispatcher { + + constructor() { + + super(); + + Object.defineProperty( this, 'id', { value: _id$1 ++ } ); + + this.uuid = generateUUID(); + + this.name = ''; + this.type = 'BufferGeometry'; + + this.index = null; + this.attributes = {}; + + this.morphAttributes = {}; + this.morphTargetsRelative = false; + + this.groups = []; + + this.boundingBox = null; + this.boundingSphere = null; + + this.drawRange = { start: 0, count: Infinity }; + + this.userData = {}; + + } + + getIndex() { + + return this.index; + + } + + setIndex( index ) { + + if ( Array.isArray( index ) ) { + + this.index = new ( arrayNeedsUint32( index ) ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 ); + + } else { + + this.index = index; + + } + + return this; + + } + + getAttribute( name ) { + + return this.attributes[ name ]; + + } + + setAttribute( name, attribute ) { + + this.attributes[ name ] = attribute; + + return this; + + } + + deleteAttribute( name ) { + + delete this.attributes[ name ]; + + return this; + + } + + hasAttribute( name ) { + + return this.attributes[ name ] !== undefined; + + } + + addGroup( start, count, materialIndex = 0 ) { + + this.groups.push( { + + start: start, + count: count, + materialIndex: materialIndex + + } ); + + } + + clearGroups() { + + this.groups = []; + + } + + setDrawRange( start, count ) { + + this.drawRange.start = start; + this.drawRange.count = count; + + } + + applyMatrix4( matrix ) { + + const position = this.attributes.position; + + if ( position !== undefined ) { + + position.applyMatrix4( matrix ); + + position.needsUpdate = true; + + } + + const normal = this.attributes.normal; + + if ( normal !== undefined ) { + + const normalMatrix = new Matrix3().getNormalMatrix( matrix ); + + normal.applyNormalMatrix( normalMatrix ); + + normal.needsUpdate = true; + + } + + const tangent = this.attributes.tangent; + + if ( tangent !== undefined ) { + + tangent.transformDirection( matrix ); + + tangent.needsUpdate = true; + + } + + if ( this.boundingBox !== null ) { + + this.computeBoundingBox(); + + } + + if ( this.boundingSphere !== null ) { + + this.computeBoundingSphere(); + + } + + return this; + + } + + applyQuaternion( q ) { + + _m1.makeRotationFromQuaternion( q ); + + this.applyMatrix4( _m1 ); + + return this; + + } + + rotateX( angle ) { + + // rotate geometry around world x-axis + + _m1.makeRotationX( angle ); + + this.applyMatrix4( _m1 ); + + return this; + + } + + rotateY( angle ) { + + // rotate geometry around world y-axis + + _m1.makeRotationY( angle ); + + this.applyMatrix4( _m1 ); + + return this; + + } + + rotateZ( angle ) { + + // rotate geometry around world z-axis + + _m1.makeRotationZ( angle ); + + this.applyMatrix4( _m1 ); + + return this; + + } + + translate( x, y, z ) { + + // translate geometry + + _m1.makeTranslation( x, y, z ); + + this.applyMatrix4( _m1 ); + + return this; + + } + + scale( x, y, z ) { + + // scale geometry + + _m1.makeScale( x, y, z ); + + this.applyMatrix4( _m1 ); + + return this; + + } + + lookAt( vector ) { + + _obj.lookAt( vector ); + + _obj.updateMatrix(); + + this.applyMatrix4( _obj.matrix ); + + return this; + + } + + center() { + + this.computeBoundingBox(); + + this.boundingBox.getCenter( _offset ).negate(); + + this.translate( _offset.x, _offset.y, _offset.z ); + + return this; + + } + + setFromPoints( points ) { + + const position = []; + + for ( let i = 0, l = points.length; i < l; i ++ ) { + + const point = points[ i ]; + position.push( point.x, point.y, point.z || 0 ); + + } + + this.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) ); + + return this; + + } + + computeBoundingBox() { + + if ( this.boundingBox === null ) { + + this.boundingBox = new Box3(); + + } + + const position = this.attributes.position; + const morphAttributesPosition = this.morphAttributes.position; + + if ( position && position.isGLBufferAttribute ) { + + console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this ); + + this.boundingBox.set( + new Vector3( - Infinity, - Infinity, - Infinity ), + new Vector3( + Infinity, + Infinity, + Infinity ) + ); + + return; + + } + + if ( position !== undefined ) { + + this.boundingBox.setFromBufferAttribute( position ); + + // process morph attributes if present + + if ( morphAttributesPosition ) { + + for ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { + + const morphAttribute = morphAttributesPosition[ i ]; + _box$1.setFromBufferAttribute( morphAttribute ); + + if ( this.morphTargetsRelative ) { + + _vector$8.addVectors( this.boundingBox.min, _box$1.min ); + this.boundingBox.expandByPoint( _vector$8 ); + + _vector$8.addVectors( this.boundingBox.max, _box$1.max ); + this.boundingBox.expandByPoint( _vector$8 ); + + } else { + + this.boundingBox.expandByPoint( _box$1.min ); + this.boundingBox.expandByPoint( _box$1.max ); + + } + + } + + } + + } else { + + this.boundingBox.makeEmpty(); + + } + + if ( 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() { + + if ( this.boundingSphere === null ) { + + this.boundingSphere = new Sphere(); + + } + + const position = this.attributes.position; + const morphAttributesPosition = this.morphAttributes.position; + + if ( position && position.isGLBufferAttribute ) { + + console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this ); + + this.boundingSphere.set( new Vector3(), Infinity ); + + return; + + } + + if ( position ) { + + // first, find the center of the bounding sphere + + const center = this.boundingSphere.center; + + _box$1.setFromBufferAttribute( position ); + + // process morph attributes if present + + if ( morphAttributesPosition ) { + + for ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { + + const morphAttribute = morphAttributesPosition[ i ]; + _boxMorphTargets.setFromBufferAttribute( morphAttribute ); + + if ( this.morphTargetsRelative ) { + + _vector$8.addVectors( _box$1.min, _boxMorphTargets.min ); + _box$1.expandByPoint( _vector$8 ); + + _vector$8.addVectors( _box$1.max, _boxMorphTargets.max ); + _box$1.expandByPoint( _vector$8 ); + + } else { + + _box$1.expandByPoint( _boxMorphTargets.min ); + _box$1.expandByPoint( _boxMorphTargets.max ); + + } + + } + + } + + _box$1.getCenter( center ); + + // second, try to find a boundingSphere with a radius smaller than the + // boundingSphere of the boundingBox: sqrt(3) smaller in the best case + + let maxRadiusSq = 0; + + for ( let i = 0, il = position.count; i < il; i ++ ) { + + _vector$8.fromBufferAttribute( position, i ); + + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) ); + + } + + // process morph attributes if present + + if ( morphAttributesPosition ) { + + for ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { + + const morphAttribute = morphAttributesPosition[ i ]; + const morphTargetsRelative = this.morphTargetsRelative; + + for ( let j = 0, jl = morphAttribute.count; j < jl; j ++ ) { + + _vector$8.fromBufferAttribute( morphAttribute, j ); + + if ( morphTargetsRelative ) { + + _offset.fromBufferAttribute( position, j ); + _vector$8.add( _offset ); + + } + + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) ); + + } + + } + + } + + this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); + + if ( 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 index = this.index; + const attributes = this.attributes; + + // based on http://www.terathon.com/code/tangent.html + // (per vertex tangents) + + if ( index === null || + attributes.position === undefined || + attributes.normal === undefined || + attributes.uv === undefined ) { + + console.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' ); + return; + + } + + const indices = index.array; + const positions = attributes.position.array; + const normals = attributes.normal.array; + const uvs = attributes.uv.array; + + const nVertices = positions.length / 3; + + if ( attributes.tangent === undefined ) { + + this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) ); + + } + + const tangents = attributes.tangent.array; + + const tan1 = [], tan2 = []; + + for ( let i = 0; i < nVertices; i ++ ) { + + tan1[ i ] = new Vector3(); + tan2[ i ] = new Vector3(); + + } + + const vA = new Vector3(), + vB = new Vector3(), + vC = new Vector3(), + + uvA = new Vector2(), + uvB = new Vector2(), + uvC = new Vector2(), + + sdir = new Vector3(), + tdir = new Vector3(); + + function handleTriangle( a, b, c ) { + + vA.fromArray( positions, a * 3 ); + vB.fromArray( positions, b * 3 ); + vC.fromArray( positions, c * 3 ); + + uvA.fromArray( uvs, a * 2 ); + uvB.fromArray( uvs, b * 2 ); + uvC.fromArray( uvs, c * 2 ); + + vB.sub( vA ); + vC.sub( vA ); + + uvB.sub( uvA ); + uvC.sub( uvA ); + + const r = 1.0 / ( uvB.x * uvC.y - uvC.x * uvB.y ); + + // silently ignore degenerate uv triangles having coincident or colinear vertices + + if ( ! isFinite( r ) ) return; + + sdir.copy( vB ).multiplyScalar( uvC.y ).addScaledVector( vC, - uvB.y ).multiplyScalar( r ); + tdir.copy( vC ).multiplyScalar( uvB.x ).addScaledVector( vB, - uvC.x ).multiplyScalar( r ); + + tan1[ a ].add( sdir ); + tan1[ b ].add( sdir ); + tan1[ c ].add( sdir ); + + tan2[ a ].add( tdir ); + tan2[ b ].add( tdir ); + tan2[ c ].add( tdir ); + + } + + let groups = this.groups; + + if ( groups.length === 0 ) { + + groups = [ { + start: 0, + count: indices.length + } ]; + + } + + for ( let i = 0, il = groups.length; i < il; ++ i ) { + + const group = groups[ i ]; + + const start = group.start; + const count = group.count; + + for ( let j = start, jl = start + count; j < jl; j += 3 ) { + + handleTriangle( + indices[ j + 0 ], + indices[ j + 1 ], + indices[ j + 2 ] + ); + + } + + } + + const tmp = new Vector3(), tmp2 = new Vector3(); + const n = new Vector3(), n2 = new Vector3(); + + function handleVertex( v ) { + + n.fromArray( normals, v * 3 ); + n2.copy( n ); + + const t = tan1[ v ]; + + // Gram-Schmidt orthogonalize + + tmp.copy( t ); + tmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize(); + + // Calculate handedness + + tmp2.crossVectors( n2, t ); + const test = tmp2.dot( tan2[ v ] ); + const w = ( test < 0.0 ) ? - 1.0 : 1.0; + + tangents[ v * 4 ] = tmp.x; + tangents[ v * 4 + 1 ] = tmp.y; + tangents[ v * 4 + 2 ] = tmp.z; + tangents[ v * 4 + 3 ] = w; + + } + + for ( let i = 0, il = groups.length; i < il; ++ i ) { + + const group = groups[ i ]; + + const start = group.start; + const count = group.count; + + for ( let j = start, jl = start + count; j < jl; j += 3 ) { + + handleVertex( indices[ j + 0 ] ); + handleVertex( indices[ j + 1 ] ); + handleVertex( indices[ j + 2 ] ); + + } + + } + + } + + computeVertexNormals() { + + const index = this.index; + const positionAttribute = this.getAttribute( 'position' ); + + if ( positionAttribute !== undefined ) { + + let normalAttribute = this.getAttribute( 'normal' ); + + if ( normalAttribute === undefined ) { + + normalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 ); + this.setAttribute( 'normal', normalAttribute ); + + } else { + + // reset existing normals to zero + + for ( let i = 0, il = normalAttribute.count; i < il; i ++ ) { + + normalAttribute.setXYZ( i, 0, 0, 0 ); + + } + + } + + const pA = new Vector3(), pB = new Vector3(), pC = new Vector3(); + const nA = new Vector3(), nB = new Vector3(), nC = new Vector3(); + const cb = new Vector3(), ab = new Vector3(); + + // indexed elements + + if ( index ) { + + for ( let i = 0, il = index.count; i < il; i += 3 ) { + + const vA = index.getX( i + 0 ); + const vB = index.getX( i + 1 ); + const vC = index.getX( i + 2 ); + + pA.fromBufferAttribute( positionAttribute, vA ); + pB.fromBufferAttribute( positionAttribute, vB ); + pC.fromBufferAttribute( positionAttribute, vC ); + + cb.subVectors( pC, pB ); + ab.subVectors( pA, pB ); + cb.cross( ab ); + + nA.fromBufferAttribute( normalAttribute, vA ); + nB.fromBufferAttribute( normalAttribute, vB ); + nC.fromBufferAttribute( normalAttribute, vC ); + + nA.add( cb ); + nB.add( cb ); + nC.add( cb ); + + normalAttribute.setXYZ( vA, nA.x, nA.y, nA.z ); + normalAttribute.setXYZ( vB, nB.x, nB.y, nB.z ); + normalAttribute.setXYZ( vC, nC.x, nC.y, nC.z ); + + } + + } else { + + // non-indexed elements (unconnected triangle soup) + + for ( let i = 0, il = positionAttribute.count; i < il; i += 3 ) { + + pA.fromBufferAttribute( positionAttribute, i + 0 ); + pB.fromBufferAttribute( positionAttribute, i + 1 ); + pC.fromBufferAttribute( positionAttribute, i + 2 ); + + cb.subVectors( pC, pB ); + ab.subVectors( pA, pB ); + cb.cross( ab ); + + normalAttribute.setXYZ( i + 0, cb.x, cb.y, cb.z ); + normalAttribute.setXYZ( i + 1, cb.x, cb.y, cb.z ); + normalAttribute.setXYZ( i + 2, cb.x, cb.y, cb.z ); + + } + + } + + this.normalizeNormals(); + + normalAttribute.needsUpdate = true; + + } + + } + + merge( geometry, offset ) { + + if ( ! ( geometry && geometry.isBufferGeometry ) ) { + + console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry ); + return; + + } + + if ( offset === undefined ) { + + offset = 0; + + console.warn( + 'THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. ' + + 'Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.' + ); + + } + + const attributes = this.attributes; + + for ( const key in attributes ) { + + if ( geometry.attributes[ key ] === undefined ) continue; + + const attribute1 = attributes[ key ]; + const attributeArray1 = attribute1.array; + + const attribute2 = geometry.attributes[ key ]; + const attributeArray2 = attribute2.array; + + const attributeOffset = attribute2.itemSize * offset; + const length = Math.min( attributeArray2.length, attributeArray1.length - attributeOffset ); + + for ( let i = 0, j = attributeOffset; i < length; i ++, j ++ ) { + + attributeArray1[ j ] = attributeArray2[ i ]; + + } + + } + + return this; + + } + + normalizeNormals() { + + const normals = this.attributes.normal; + + for ( let i = 0, il = normals.count; i < il; i ++ ) { + + _vector$8.fromBufferAttribute( normals, i ); + + _vector$8.normalize(); + + normals.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z ); + + } + + } + + toNonIndexed() { + + function convertBufferAttribute( attribute, indices ) { + + const array = attribute.array; + const itemSize = attribute.itemSize; + const normalized = attribute.normalized; + + const array2 = new array.constructor( indices.length * itemSize ); + + let index = 0, index2 = 0; + + for ( let i = 0, l = indices.length; i < l; i ++ ) { + + if ( attribute.isInterleavedBufferAttribute ) { + + index = indices[ i ] * attribute.data.stride + attribute.offset; + + } else { + + index = indices[ i ] * itemSize; + + } + + for ( let j = 0; j < itemSize; j ++ ) { + + array2[ index2 ++ ] = array[ index ++ ]; + + } + + } + + return new BufferAttribute( array2, itemSize, normalized ); + + } + + // + + if ( this.index === null ) { + + console.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' ); + return this; + + } + + const geometry2 = new BufferGeometry(); + + const indices = this.index.array; + const attributes = this.attributes; + + // attributes + + for ( const name in attributes ) { + + const attribute = attributes[ name ]; + + const newAttribute = convertBufferAttribute( attribute, indices ); + + geometry2.setAttribute( name, newAttribute ); + + } + + // morph attributes + + const morphAttributes = this.morphAttributes; + + for ( const name in morphAttributes ) { + + const morphArray = []; + const morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes + + for ( let i = 0, il = morphAttribute.length; i < il; i ++ ) { + + const attribute = morphAttribute[ i ]; + + const newAttribute = convertBufferAttribute( attribute, indices ); + + morphArray.push( newAttribute ); + + } + + geometry2.morphAttributes[ name ] = morphArray; + + } + + geometry2.morphTargetsRelative = this.morphTargetsRelative; + + // groups + + const groups = this.groups; + + for ( let i = 0, l = groups.length; i < l; i ++ ) { + + const group = groups[ i ]; + geometry2.addGroup( group.start, group.count, group.materialIndex ); + + } + + return geometry2; + + } + + toJSON() { + + const data = { + metadata: { + version: 4.5, + type: 'BufferGeometry', + generator: 'BufferGeometry.toJSON' + } + }; + + // standard BufferGeometry serialization + + data.uuid = this.uuid; + data.type = this.type; + if ( this.name !== '' ) data.name = this.name; + if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData; + + if ( this.parameters !== undefined ) { + + const parameters = this.parameters; + + for ( const key in parameters ) { + + if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; + + } + + return data; + + } + + // for simplicity the code assumes attributes are not shared across geometries, see #15811 + + data.data = { attributes: {} }; + + const index = this.index; + + if ( index !== null ) { + + data.data.index = { + type: index.array.constructor.name, + array: Array.prototype.slice.call( index.array ) + }; + + } + + const attributes = this.attributes; + + for ( const key in attributes ) { + + const attribute = attributes[ key ]; + + data.data.attributes[ key ] = attribute.toJSON( data.data ); + + } + + const morphAttributes = {}; + let hasMorphAttributes = false; + + for ( const key in this.morphAttributes ) { + + const attributeArray = this.morphAttributes[ key ]; + + const array = []; + + for ( let i = 0, il = attributeArray.length; i < il; i ++ ) { + + const attribute = attributeArray[ i ]; + + array.push( attribute.toJSON( data.data ) ); + + } + + if ( array.length > 0 ) { + + morphAttributes[ key ] = array; + + hasMorphAttributes = true; + + } + + } + + if ( hasMorphAttributes ) { + + data.data.morphAttributes = morphAttributes; + data.data.morphTargetsRelative = this.morphTargetsRelative; + + } + + const groups = this.groups; + + if ( groups.length > 0 ) { + + data.data.groups = JSON.parse( JSON.stringify( groups ) ); + + } + + const boundingSphere = this.boundingSphere; + + if ( boundingSphere !== null ) { + + data.data.boundingSphere = { + center: boundingSphere.center.toArray(), + radius: boundingSphere.radius + }; + + } + + return data; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( source ) { + + // reset + + this.index = null; + this.attributes = {}; + this.morphAttributes = {}; + this.groups = []; + this.boundingBox = null; + this.boundingSphere = null; + + // used for storing cloned, shared data + + const data = {}; + + // name + + this.name = source.name; + + // index + + const index = source.index; + + if ( index !== null ) { + + this.setIndex( index.clone( data ) ); + + } + + // attributes + + const attributes = source.attributes; + + for ( const name in attributes ) { + + const attribute = attributes[ name ]; + this.setAttribute( name, attribute.clone( data ) ); + + } + + // morph attributes + + const morphAttributes = source.morphAttributes; + + for ( const name in morphAttributes ) { + + const array = []; + const morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes + + for ( let i = 0, l = morphAttribute.length; i < l; i ++ ) { + + array.push( morphAttribute[ i ].clone( data ) ); + + } + + this.morphAttributes[ name ] = array; + + } + + this.morphTargetsRelative = source.morphTargetsRelative; + + // groups + + const groups = source.groups; + + for ( let i = 0, l = groups.length; i < l; i ++ ) { + + const group = groups[ i ]; + this.addGroup( group.start, group.count, group.materialIndex ); + + } + + // bounding box + + const boundingBox = source.boundingBox; + + if ( boundingBox !== null ) { + + this.boundingBox = boundingBox.clone(); + + } + + // bounding sphere + + const boundingSphere = source.boundingSphere; + + if ( boundingSphere !== null ) { + + this.boundingSphere = boundingSphere.clone(); + + } + + // draw range + + this.drawRange.start = source.drawRange.start; + this.drawRange.count = source.drawRange.count; + + // user data + + this.userData = source.userData; + + // geometry generator parameters + + if ( source.parameters !== undefined ) this.parameters = Object.assign( {}, source.parameters ); + + return this; + + } + + dispose() { + + this.dispatchEvent( { type: 'dispose' } ); + + } + +} + +BufferGeometry.prototype.isBufferGeometry = true; + +const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4(); +const _ray$2 = /*@__PURE__*/ new Ray(); +const _sphere$3 = /*@__PURE__*/ new Sphere(); + +const _vA$1 = /*@__PURE__*/ new Vector3(); +const _vB$1 = /*@__PURE__*/ new Vector3(); +const _vC$1 = /*@__PURE__*/ new Vector3(); + +const _tempA = /*@__PURE__*/ new Vector3(); +const _tempB = /*@__PURE__*/ new Vector3(); +const _tempC = /*@__PURE__*/ new Vector3(); + +const _morphA = /*@__PURE__*/ new Vector3(); +const _morphB = /*@__PURE__*/ new Vector3(); +const _morphC = /*@__PURE__*/ new Vector3(); + +const _uvA$1 = /*@__PURE__*/ new Vector2(); +const _uvB$1 = /*@__PURE__*/ new Vector2(); +const _uvC$1 = /*@__PURE__*/ new Vector2(); + +const _intersectionPoint = /*@__PURE__*/ new Vector3(); +const _intersectionPointWorld = /*@__PURE__*/ new Vector3(); + +class Mesh extends Object3D { + + constructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) { + + super(); + + this.type = 'Mesh'; + + this.geometry = geometry; + this.material = material; + + this.updateMorphTargets(); + + } + + copy( source ) { + + super.copy( source ); + + if ( source.morphTargetInfluences !== undefined ) { + + this.morphTargetInfluences = source.morphTargetInfluences.slice(); + + } + + if ( source.morphTargetDictionary !== undefined ) { + + this.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary ); + + } + + this.material = source.material; + this.geometry = source.geometry; + + return this; + + } + + updateMorphTargets() { + + const geometry = this.geometry; + + if ( geometry.isBufferGeometry ) { + + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys( morphAttributes ); + + if ( keys.length > 0 ) { + + const morphAttribute = morphAttributes[ keys[ 0 ] ]; + + if ( morphAttribute !== undefined ) { + + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; + + for ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) { + + const name = morphAttribute[ m ].name || String( m ); + + this.morphTargetInfluences.push( 0 ); + this.morphTargetDictionary[ name ] = m; + + } + + } + + } + + } else { + + const morphTargets = geometry.morphTargets; + + if ( morphTargets !== undefined && morphTargets.length > 0 ) { + + console.error( 'THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + } + + } + + raycast( raycaster, intersects ) { + + const geometry = this.geometry; + const material = this.material; + const matrixWorld = this.matrixWorld; + + if ( material === undefined ) return; + + // Checking boundingSphere distance to ray + + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + + _sphere$3.copy( geometry.boundingSphere ); + _sphere$3.applyMatrix4( matrixWorld ); + + if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return; + + // + + _inverseMatrix$2.copy( matrixWorld ).invert(); + _ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 ); + + // Check boundingBox before continuing + + if ( geometry.boundingBox !== null ) { + + if ( _ray$2.intersectsBox( geometry.boundingBox ) === false ) return; + + } + + let intersection; + + if ( geometry.isBufferGeometry ) { + + const index = geometry.index; + const position = geometry.attributes.position; + const morphPosition = geometry.morphAttributes.position; + const morphTargetsRelative = geometry.morphTargetsRelative; + const uv = geometry.attributes.uv; + const uv2 = geometry.attributes.uv2; + const groups = geometry.groups; + const drawRange = geometry.drawRange; + + if ( index !== null ) { + + // indexed buffer geometry + + if ( Array.isArray( material ) ) { + + for ( let i = 0, il = groups.length; i < il; i ++ ) { + + const group = groups[ i ]; + const groupMaterial = material[ group.materialIndex ]; + + const start = Math.max( group.start, drawRange.start ); + const end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) ); + + for ( let j = start, jl = end; j < jl; j += 3 ) { + + const a = index.getX( j ); + const b = index.getX( j + 1 ); + const c = index.getX( j + 2 ); + + intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c ); + + if ( intersection ) { + + intersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics + intersection.face.materialIndex = group.materialIndex; + intersects.push( intersection ); + + } + + } + + } + + } else { + + const start = Math.max( 0, drawRange.start ); + const end = Math.min( index.count, ( drawRange.start + drawRange.count ) ); + + for ( let i = start, il = end; i < il; i += 3 ) { + + const a = index.getX( i ); + const b = index.getX( i + 1 ); + const c = index.getX( i + 2 ); + + intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c ); + + if ( intersection ) { + + intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics + intersects.push( intersection ); + + } + + } + + } + + } else if ( position !== undefined ) { + + // non-indexed buffer geometry + + if ( Array.isArray( material ) ) { + + for ( let i = 0, il = groups.length; i < il; i ++ ) { + + const group = groups[ i ]; + const groupMaterial = material[ group.materialIndex ]; + + const start = Math.max( group.start, drawRange.start ); + const end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) ); + + for ( let j = start, jl = end; j < jl; j += 3 ) { + + const a = j; + const b = j + 1; + const c = j + 2; + + intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c ); + + if ( intersection ) { + + intersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics + intersection.face.materialIndex = group.materialIndex; + intersects.push( intersection ); + + } + + } + + } + + } else { + + const start = Math.max( 0, drawRange.start ); + const end = Math.min( position.count, ( drawRange.start + drawRange.count ) ); + + for ( let i = start, il = end; i < il; i += 3 ) { + + const a = i; + const b = i + 1; + const c = i + 2; + + intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c ); + + if ( intersection ) { + + intersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics + intersects.push( intersection ); + + } + + } + + } + + } + + } else if ( geometry.isGeometry ) { + + console.error( 'THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + } + +} + +Mesh.prototype.isMesh = true; + +function checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) { + + let intersect; + + if ( material.side === BackSide ) { + + intersect = ray.intersectTriangle( pC, pB, pA, true, point ); + + } else { + + intersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point ); + + } + + if ( intersect === null ) return null; + + _intersectionPointWorld.copy( point ); + _intersectionPointWorld.applyMatrix4( object.matrixWorld ); + + const distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld ); + + if ( distance < raycaster.near || distance > raycaster.far ) return null; + + return { + distance: distance, + point: _intersectionPointWorld.clone(), + object: object + }; + +} + +function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c ) { + + _vA$1.fromBufferAttribute( position, a ); + _vB$1.fromBufferAttribute( position, b ); + _vC$1.fromBufferAttribute( position, c ); + + const morphInfluences = object.morphTargetInfluences; + + if ( morphPosition && morphInfluences ) { + + _morphA.set( 0, 0, 0 ); + _morphB.set( 0, 0, 0 ); + _morphC.set( 0, 0, 0 ); + + for ( let i = 0, il = morphPosition.length; i < il; i ++ ) { + + const influence = morphInfluences[ i ]; + const morphAttribute = morphPosition[ i ]; + + if ( influence === 0 ) continue; + + _tempA.fromBufferAttribute( morphAttribute, a ); + _tempB.fromBufferAttribute( morphAttribute, b ); + _tempC.fromBufferAttribute( morphAttribute, c ); + + if ( morphTargetsRelative ) { + + _morphA.addScaledVector( _tempA, influence ); + _morphB.addScaledVector( _tempB, influence ); + _morphC.addScaledVector( _tempC, influence ); + + } else { + + _morphA.addScaledVector( _tempA.sub( _vA$1 ), influence ); + _morphB.addScaledVector( _tempB.sub( _vB$1 ), influence ); + _morphC.addScaledVector( _tempC.sub( _vC$1 ), influence ); + + } + + } + + _vA$1.add( _morphA ); + _vB$1.add( _morphB ); + _vC$1.add( _morphC ); + + } + + if ( object.isSkinnedMesh ) { + + object.boneTransform( a, _vA$1 ); + object.boneTransform( b, _vB$1 ); + object.boneTransform( c, _vC$1 ); + + } + + const intersection = checkIntersection( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint ); + + if ( intersection ) { + + if ( uv ) { + + _uvA$1.fromBufferAttribute( uv, a ); + _uvB$1.fromBufferAttribute( uv, b ); + _uvC$1.fromBufferAttribute( uv, c ); + + intersection.uv = Triangle.getUV( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() ); + + } + + if ( uv2 ) { + + _uvA$1.fromBufferAttribute( uv2, a ); + _uvB$1.fromBufferAttribute( uv2, b ); + _uvC$1.fromBufferAttribute( uv2, c ); + + intersection.uv2 = Triangle.getUV( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() ); + + } + + const face = { + a: a, + b: b, + c: c, + normal: new Vector3(), + materialIndex: 0 + }; + + Triangle.getNormal( _vA$1, _vB$1, _vC$1, face.normal ); + + intersection.face = face; + + } + + return intersection; + +} + +class BoxGeometry extends BufferGeometry { + + constructor( width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1 ) { + + super(); + + this.type = 'BoxGeometry'; + + this.parameters = { + width: width, + height: height, + depth: depth, + widthSegments: widthSegments, + heightSegments: heightSegments, + depthSegments: depthSegments + }; + + const scope = this; + + // segments + + widthSegments = Math.floor( widthSegments ); + heightSegments = Math.floor( heightSegments ); + depthSegments = Math.floor( depthSegments ); + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // helper variables + + let numberOfVertices = 0; + let groupStart = 0; + + // build each side of the box geometry + + buildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px + buildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx + buildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py + buildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny + buildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz + buildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) { + + const segmentWidth = width / gridX; + const segmentHeight = height / gridY; + + const widthHalf = width / 2; + const heightHalf = height / 2; + const depthHalf = depth / 2; + + const gridX1 = gridX + 1; + const gridY1 = gridY + 1; + + let vertexCounter = 0; + let groupCount = 0; + + const vector = new Vector3(); + + // generate vertices, normals and uvs + + for ( let iy = 0; iy < gridY1; iy ++ ) { + + const y = iy * segmentHeight - heightHalf; + + for ( let ix = 0; ix < gridX1; ix ++ ) { + + const x = ix * segmentWidth - widthHalf; + + // set values to correct vector component + + vector[ u ] = x * udir; + vector[ v ] = y * vdir; + vector[ w ] = depthHalf; + + // now apply vector to vertex buffer + + vertices.push( vector.x, vector.y, vector.z ); + + // set values to correct vector component + + vector[ u ] = 0; + vector[ v ] = 0; + vector[ w ] = depth > 0 ? 1 : - 1; + + // now apply vector to normal buffer + + normals.push( vector.x, vector.y, vector.z ); + + // uvs + + uvs.push( ix / gridX ); + uvs.push( 1 - ( iy / gridY ) ); + + // counters + + vertexCounter += 1; + + } + + } + + // indices + + // 1. you need three indices to draw a single face + // 2. a single segment consists of two faces + // 3. so we need to generate six (2*3) indices per segment + + for ( let iy = 0; iy < gridY; iy ++ ) { + + for ( let ix = 0; ix < gridX; ix ++ ) { + + const a = numberOfVertices + ix + gridX1 * iy; + const b = numberOfVertices + ix + gridX1 * ( iy + 1 ); + const c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 ); + const d = numberOfVertices + ( ix + 1 ) + gridX1 * iy; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + // increase counter + + groupCount += 6; + + } + + } + + // add a group to the geometry. this will ensure multi material support + + scope.addGroup( groupStart, groupCount, materialIndex ); + + // calculate new start value for groups + + groupStart += groupCount; + + // update total number of vertices + + numberOfVertices += vertexCounter; + + } + + } + + static fromJSON( data ) { + + return new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments ); + + } + +} + +/** + * Uniform Utilities + */ + +function cloneUniforms( src ) { + + const dst = {}; + + for ( const u in src ) { + + dst[ u ] = {}; + + for ( const p in src[ u ] ) { + + const property = src[ u ][ p ]; + + if ( property && ( property.isColor || + property.isMatrix3 || property.isMatrix4 || + property.isVector2 || property.isVector3 || property.isVector4 || + property.isTexture || property.isQuaternion ) ) { + + dst[ u ][ p ] = property.clone(); + + } else if ( Array.isArray( property ) ) { + + dst[ u ][ p ] = property.slice(); + + } else { + + dst[ u ][ p ] = property; + + } + + } + + } + + return dst; + +} + +function mergeUniforms( uniforms ) { + + const merged = {}; + + for ( let u = 0; u < uniforms.length; u ++ ) { + + const tmp = cloneUniforms( uniforms[ u ] ); + + for ( const p in tmp ) { + + merged[ p ] = tmp[ p ]; + + } + + } + + return merged; + +} + +// Legacy + +const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms }; + +var default_vertex = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"; + +var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"; + +/** + * parameters = { + * defines: { "label" : "value" }, + * uniforms: { "parameter1": { value: 1.0 }, "parameter2": { value2: 2 } }, + * + * fragmentShader: , + * vertexShader: , + * + * wireframe: , + * wireframeLinewidth: , + * + * lights: + * } + */ + +class ShaderMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'ShaderMaterial'; + + this.defines = {}; + this.uniforms = {}; + + this.vertexShader = default_vertex; + this.fragmentShader = default_fragment; + + this.linewidth = 1; + + this.wireframe = false; + this.wireframeLinewidth = 1; + + this.fog = false; // set to use scene fog + this.lights = false; // set to use scene lights + this.clipping = false; // set to use user-defined clipping planes + + this.extensions = { + derivatives: false, // set to use derivatives + fragDepth: false, // set to use fragment depth values + drawBuffers: false, // set to use draw buffers + shaderTextureLOD: false // set to use shader texture LOD + }; + + // When rendered geometry doesn't include these attributes but the material does, + // use these default values in WebGL. This avoids errors when buffer data is missing. + this.defaultAttributeValues = { + 'color': [ 1, 1, 1 ], + 'uv': [ 0, 0 ], + 'uv2': [ 0, 0 ] + }; + + this.index0AttributeName = undefined; + this.uniformsNeedUpdate = false; + + this.glslVersion = null; + + if ( parameters !== undefined ) { + + if ( parameters.attributes !== undefined ) { + + console.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' ); + + } + + this.setValues( parameters ); + + } + + } + + copy( source ) { + + super.copy( source ); + + this.fragmentShader = source.fragmentShader; + this.vertexShader = source.vertexShader; + + this.uniforms = cloneUniforms( source.uniforms ); + + this.defines = Object.assign( {}, source.defines ); + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + + this.lights = source.lights; + this.clipping = source.clipping; + + this.extensions = Object.assign( {}, source.extensions ); + + this.glslVersion = source.glslVersion; + + return this; + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + data.glslVersion = this.glslVersion; + data.uniforms = {}; + + for ( const name in this.uniforms ) { + + const uniform = this.uniforms[ name ]; + const value = uniform.value; + + if ( value && value.isTexture ) { + + data.uniforms[ name ] = { + type: 't', + value: value.toJSON( meta ).uuid + }; + + } else if ( value && value.isColor ) { + + data.uniforms[ name ] = { + type: 'c', + value: value.getHex() + }; + + } else if ( value && value.isVector2 ) { + + data.uniforms[ name ] = { + type: 'v2', + value: value.toArray() + }; + + } else if ( value && value.isVector3 ) { + + data.uniforms[ name ] = { + type: 'v3', + value: value.toArray() + }; + + } else if ( value && value.isVector4 ) { + + data.uniforms[ name ] = { + type: 'v4', + value: value.toArray() + }; + + } else if ( value && value.isMatrix3 ) { + + data.uniforms[ name ] = { + type: 'm3', + value: value.toArray() + }; + + } else if ( value && value.isMatrix4 ) { + + data.uniforms[ name ] = { + type: 'm4', + value: value.toArray() + }; + + } else { + + data.uniforms[ name ] = { + value: value + }; + + // note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far + + } + + } + + if ( Object.keys( this.defines ).length > 0 ) data.defines = this.defines; + + data.vertexShader = this.vertexShader; + data.fragmentShader = this.fragmentShader; + + const extensions = {}; + + for ( const key in this.extensions ) { + + if ( this.extensions[ key ] === true ) extensions[ key ] = true; + + } + + if ( Object.keys( extensions ).length > 0 ) data.extensions = extensions; + + return data; + + } + +} + +ShaderMaterial.prototype.isShaderMaterial = true; + +class Camera extends Object3D { + + constructor() { + + super(); + + this.type = 'Camera'; + + this.matrixWorldInverse = new Matrix4(); + + this.projectionMatrix = new Matrix4(); + this.projectionMatrixInverse = new Matrix4(); + + } + + copy( source, recursive ) { + + super.copy( source, recursive ); + + this.matrixWorldInverse.copy( source.matrixWorldInverse ); + + this.projectionMatrix.copy( source.projectionMatrix ); + this.projectionMatrixInverse.copy( source.projectionMatrixInverse ); + + return this; + + } + + getWorldDirection( target ) { + + this.updateWorldMatrix( true, false ); + + const e = this.matrixWorld.elements; + + return target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize(); + + } + + updateMatrixWorld( force ) { + + super.updateMatrixWorld( force ); + + this.matrixWorldInverse.copy( this.matrixWorld ).invert(); + + } + + updateWorldMatrix( updateParents, updateChildren ) { + + super.updateWorldMatrix( updateParents, updateChildren ); + + this.matrixWorldInverse.copy( this.matrixWorld ).invert(); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +Camera.prototype.isCamera = true; + +class PerspectiveCamera extends Camera { + + constructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) { + + super(); + + this.type = 'PerspectiveCamera'; + + this.fov = fov; + this.zoom = 1; + + this.near = near; + this.far = far; + this.focus = 10; + + this.aspect = aspect; + this.view = null; + + this.filmGauge = 35; // width of the film (default in millimeters) + this.filmOffset = 0; // horizontal film offset (same unit as gauge) + + this.updateProjectionMatrix(); + + } + + copy( source, recursive ) { + + super.copy( source, recursive ); + + this.fov = source.fov; + this.zoom = source.zoom; + + this.near = source.near; + this.far = source.far; + this.focus = source.focus; + + this.aspect = source.aspect; + this.view = source.view === null ? null : Object.assign( {}, source.view ); + + this.filmGauge = source.filmGauge; + this.filmOffset = source.filmOffset; + + return this; + + } + + /** + * Sets the FOV by focal length in respect to the current .filmGauge. + * + * The default film gauge is 35, so that the focal length can be specified for + * a 35mm (full frame) camera. + * + * Values for focal length and film gauge must have the same unit. + */ + setFocalLength( focalLength ) { + + /** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */ + const vExtentSlope = 0.5 * this.getFilmHeight() / focalLength; + + this.fov = RAD2DEG * 2 * Math.atan( vExtentSlope ); + this.updateProjectionMatrix(); + + } + + /** + * Calculates the focal length from the current .fov and .filmGauge. + */ + getFocalLength() { + + const vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov ); + + return 0.5 * this.getFilmHeight() / vExtentSlope; + + } + + getEffectiveFOV() { + + return RAD2DEG * 2 * Math.atan( + Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom ); + + } + + getFilmWidth() { + + // film not completely covered in portrait format (aspect < 1) + return this.filmGauge * Math.min( this.aspect, 1 ); + + } + + getFilmHeight() { + + // film not completely covered in landscape format (aspect > 1) + return this.filmGauge / Math.max( this.aspect, 1 ); + + } + + /** + * Sets an offset in a larger frustum. This is useful for multi-window or + * multi-monitor/multi-machine setups. + * + * For example, if you have 3x2 monitors and each monitor is 1920x1080 and + * the monitors are in grid like this + * + * +---+---+---+ + * | A | B | C | + * +---+---+---+ + * | D | E | F | + * +---+---+---+ + * + * then for each monitor you would call it like this + * + * const w = 1920; + * const h = 1080; + * const fullWidth = w * 3; + * const fullHeight = h * 2; + * + * --A-- + * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); + * --B-- + * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); + * --C-- + * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); + * --D-- + * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); + * --E-- + * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); + * --F-- + * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); + * + * Note there is no reason monitors have to be the same size or in a grid. + */ + setViewOffset( fullWidth, fullHeight, x, y, width, height ) { + + this.aspect = fullWidth / fullHeight; + + if ( this.view === null ) { + + this.view = { + enabled: true, + fullWidth: 1, + fullHeight: 1, + offsetX: 0, + offsetY: 0, + width: 1, + height: 1 + }; + + } + + this.view.enabled = true; + this.view.fullWidth = fullWidth; + this.view.fullHeight = fullHeight; + this.view.offsetX = x; + this.view.offsetY = y; + this.view.width = width; + this.view.height = height; + + this.updateProjectionMatrix(); + + } + + clearViewOffset() { + + if ( this.view !== null ) { + + this.view.enabled = false; + + } + + this.updateProjectionMatrix(); + + } + + updateProjectionMatrix() { + + const near = this.near; + let top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom; + let height = 2 * top; + let width = this.aspect * height; + let left = - 0.5 * width; + const view = this.view; + + if ( this.view !== null && this.view.enabled ) { + + const fullWidth = view.fullWidth, + fullHeight = view.fullHeight; + + left += view.offsetX * width / fullWidth; + top -= view.offsetY * height / fullHeight; + width *= view.width / fullWidth; + height *= view.height / fullHeight; + + } + + const skew = this.filmOffset; + if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); + + this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far ); + + this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + data.object.fov = this.fov; + data.object.zoom = this.zoom; + + data.object.near = this.near; + data.object.far = this.far; + data.object.focus = this.focus; + + data.object.aspect = this.aspect; + + if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); + + data.object.filmGauge = this.filmGauge; + data.object.filmOffset = this.filmOffset; + + return data; + + } + +} + +PerspectiveCamera.prototype.isPerspectiveCamera = true; + +const fov = 90, aspect = 1; + +class CubeCamera extends Object3D { + + constructor( near, far, renderTarget ) { + + super(); + + this.type = 'CubeCamera'; + + if ( renderTarget.isWebGLCubeRenderTarget !== true ) { + + console.error( 'THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.' ); + return; + + } + + this.renderTarget = renderTarget; + + const cameraPX = new PerspectiveCamera( fov, aspect, near, far ); + cameraPX.layers = this.layers; + cameraPX.up.set( 0, - 1, 0 ); + cameraPX.lookAt( new Vector3( 1, 0, 0 ) ); + this.add( cameraPX ); + + const cameraNX = new PerspectiveCamera( fov, aspect, near, far ); + cameraNX.layers = this.layers; + cameraNX.up.set( 0, - 1, 0 ); + cameraNX.lookAt( new Vector3( - 1, 0, 0 ) ); + this.add( cameraNX ); + + const cameraPY = new PerspectiveCamera( fov, aspect, near, far ); + cameraPY.layers = this.layers; + cameraPY.up.set( 0, 0, 1 ); + cameraPY.lookAt( new Vector3( 0, 1, 0 ) ); + this.add( cameraPY ); + + const cameraNY = new PerspectiveCamera( fov, aspect, near, far ); + cameraNY.layers = this.layers; + cameraNY.up.set( 0, 0, - 1 ); + cameraNY.lookAt( new Vector3( 0, - 1, 0 ) ); + this.add( cameraNY ); + + const cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); + cameraPZ.layers = this.layers; + cameraPZ.up.set( 0, - 1, 0 ); + cameraPZ.lookAt( new Vector3( 0, 0, 1 ) ); + this.add( cameraPZ ); + + const cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); + cameraNZ.layers = this.layers; + cameraNZ.up.set( 0, - 1, 0 ); + cameraNZ.lookAt( new Vector3( 0, 0, - 1 ) ); + this.add( cameraNZ ); + + } + + update( renderer, scene ) { + + if ( this.parent === null ) this.updateMatrixWorld(); + + const renderTarget = this.renderTarget; + + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children; + + const currentXrEnabled = renderer.xr.enabled; + const currentRenderTarget = renderer.getRenderTarget(); + + renderer.xr.enabled = false; + + const generateMipmaps = renderTarget.texture.generateMipmaps; + + renderTarget.texture.generateMipmaps = false; + + renderer.setRenderTarget( renderTarget, 0 ); + renderer.render( scene, cameraPX ); + + renderer.setRenderTarget( renderTarget, 1 ); + renderer.render( scene, cameraNX ); + + renderer.setRenderTarget( renderTarget, 2 ); + renderer.render( scene, cameraPY ); + + renderer.setRenderTarget( renderTarget, 3 ); + renderer.render( scene, cameraNY ); + + renderer.setRenderTarget( renderTarget, 4 ); + renderer.render( scene, cameraPZ ); + + renderTarget.texture.generateMipmaps = generateMipmaps; + + renderer.setRenderTarget( renderTarget, 5 ); + renderer.render( scene, cameraNZ ); + + renderer.setRenderTarget( currentRenderTarget ); + + renderer.xr.enabled = currentXrEnabled; + + renderTarget.texture.needsPMREMUpdate = true; + + } + +} + +class CubeTexture extends Texture { + + constructor( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) { + + images = images !== undefined ? images : []; + mapping = mapping !== undefined ? mapping : CubeReflectionMapping; + + super( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + + this.flipY = false; + + } + + get images() { + + return this.image; + + } + + set images( value ) { + + this.image = value; + + } + +} + +CubeTexture.prototype.isCubeTexture = true; + +class WebGLCubeRenderTarget extends WebGLRenderTarget { + + constructor( size, options, dummy ) { + + if ( Number.isInteger( options ) ) { + + console.warn( 'THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )' ); + + options = dummy; + + } + + super( size, size, options ); + + options = options || {}; + + // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js) + // in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words, + // in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly. + + // three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped + // and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture + // as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures). + + this.texture = new CubeTexture( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding ); + this.texture.isRenderTargetTexture = true; + + this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false; + this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; + + } + + fromEquirectangularTexture( renderer, texture ) { + + this.texture.type = texture.type; + this.texture.format = RGBAFormat; // see #18859 + this.texture.encoding = texture.encoding; + + this.texture.generateMipmaps = texture.generateMipmaps; + this.texture.minFilter = texture.minFilter; + this.texture.magFilter = texture.magFilter; + + const shader = { + + uniforms: { + tEquirect: { value: null }, + }, + + vertexShader: /* glsl */` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `, + + fragmentShader: /* glsl */` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + ` + }; + + const geometry = new BoxGeometry( 5, 5, 5 ); + + const material = new ShaderMaterial( { + + name: 'CubemapFromEquirect', + + uniforms: cloneUniforms( shader.uniforms ), + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader, + side: BackSide, + blending: NoBlending + + } ); + + material.uniforms.tEquirect.value = texture; + + const mesh = new Mesh( geometry, material ); + + const currentMinFilter = texture.minFilter; + + // Avoid blurred poles + if ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter; + + const camera = new CubeCamera( 1, 10, this ); + camera.update( renderer, mesh ); + + texture.minFilter = currentMinFilter; + + mesh.geometry.dispose(); + mesh.material.dispose(); + + return this; + + } + + clear( renderer, color, depth, stencil ) { + + const currentRenderTarget = renderer.getRenderTarget(); + + for ( let i = 0; i < 6; i ++ ) { + + renderer.setRenderTarget( this, i ); + + renderer.clear( color, depth, stencil ); + + } + + renderer.setRenderTarget( currentRenderTarget ); + + } + +} + +WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true; + +const _vector1 = /*@__PURE__*/ new Vector3(); +const _vector2 = /*@__PURE__*/ new Vector3(); +const _normalMatrix = /*@__PURE__*/ new Matrix3(); + +class Plane { + + constructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) { + + // normal is assumed to be normalized + + this.normal = normal; + this.constant = constant; + + } + + set( normal, constant ) { + + this.normal.copy( normal ); + this.constant = constant; + + return this; + + } + + setComponents( x, y, z, w ) { + + this.normal.set( x, y, z ); + this.constant = w; + + return this; + + } + + setFromNormalAndCoplanarPoint( normal, point ) { + + this.normal.copy( normal ); + this.constant = - point.dot( this.normal ); + + return this; + + } + + setFromCoplanarPoints( a, b, c ) { + + const normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize(); + + // Q: should an error be thrown if normal is zero (e.g. degenerate plane)? + + this.setFromNormalAndCoplanarPoint( normal, a ); + + return this; + + } + + copy( plane ) { + + this.normal.copy( plane.normal ); + this.constant = plane.constant; + + return this; + + } + + normalize() { + + // Note: will lead to a divide by zero if the plane is invalid. + + const inverseNormalLength = 1.0 / this.normal.length(); + this.normal.multiplyScalar( inverseNormalLength ); + this.constant *= inverseNormalLength; + + return this; + + } + + negate() { + + this.constant *= - 1; + this.normal.negate(); + + return this; + + } + + distanceToPoint( point ) { + + return this.normal.dot( point ) + this.constant; + + } + + distanceToSphere( sphere ) { + + return this.distanceToPoint( sphere.center ) - sphere.radius; + + } + + projectPoint( point, target ) { + + return target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point ); + + } + + intersectLine( line, target ) { + + const direction = line.delta( _vector1 ); + + const denominator = this.normal.dot( direction ); + + if ( denominator === 0 ) { + + // line is coplanar, return origin + if ( this.distanceToPoint( line.start ) === 0 ) { + + return target.copy( line.start ); + + } + + // Unsure if this is the correct method to handle this case. + return null; + + } + + const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator; + + if ( t < 0 || t > 1 ) { + + return null; + + } + + return target.copy( direction ).multiplyScalar( t ).add( line.start ); + + } + + intersectsLine( line ) { + + // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. + + const startSign = this.distanceToPoint( line.start ); + const endSign = this.distanceToPoint( line.end ); + + return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); + + } + + intersectsBox( box ) { + + return box.intersectsPlane( this ); + + } + + intersectsSphere( sphere ) { + + return sphere.intersectsPlane( this ); + + } + + coplanarPoint( target ) { + + return target.copy( this.normal ).multiplyScalar( - this.constant ); + + } + + applyMatrix4( matrix, optionalNormalMatrix ) { + + const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix ); + + const referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix ); + + const normal = this.normal.applyMatrix3( normalMatrix ).normalize(); + + this.constant = - referencePoint.dot( normal ); + + return this; + + } + + translate( offset ) { + + this.constant -= offset.dot( this.normal ); + + return this; + + } + + equals( plane ) { + + return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +Plane.prototype.isPlane = true; + +const _sphere$2 = /*@__PURE__*/ new Sphere(); +const _vector$7 = /*@__PURE__*/ new Vector3(); + +class Frustum { + + constructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) { + + this.planes = [ p0, p1, p2, p3, p4, p5 ]; + + } + + set( p0, p1, p2, p3, p4, p5 ) { + + const planes = this.planes; + + planes[ 0 ].copy( p0 ); + planes[ 1 ].copy( p1 ); + planes[ 2 ].copy( p2 ); + planes[ 3 ].copy( p3 ); + planes[ 4 ].copy( p4 ); + planes[ 5 ].copy( p5 ); + + return this; + + } + + copy( frustum ) { + + const planes = this.planes; + + for ( let i = 0; i < 6; i ++ ) { + + planes[ i ].copy( frustum.planes[ i ] ); + + } + + return this; + + } + + setFromProjectionMatrix( m ) { + + const planes = this.planes; + const me = m.elements; + const me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ]; + const me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ]; + const me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ]; + const me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ]; + + planes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize(); + planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize(); + planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); + planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); + planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); + planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + return this; + + } + + intersectsObject( object ) { + + const geometry = object.geometry; + + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + + _sphere$2.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld ); + + return this.intersectsSphere( _sphere$2 ); + + } + + intersectsSprite( sprite ) { + + _sphere$2.center.set( 0, 0, 0 ); + _sphere$2.radius = 0.7071067811865476; + _sphere$2.applyMatrix4( sprite.matrixWorld ); + + return this.intersectsSphere( _sphere$2 ); + + } + + intersectsSphere( sphere ) { + + const planes = this.planes; + const center = sphere.center; + const negRadius = - sphere.radius; + + for ( let i = 0; i < 6; i ++ ) { + + const distance = planes[ i ].distanceToPoint( center ); + + if ( distance < negRadius ) { + + return false; + + } + + } + + return true; + + } + + intersectsBox( box ) { + + const planes = this.planes; + + for ( let i = 0; i < 6; i ++ ) { + + const plane = planes[ i ]; + + // corner at max distance + + _vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x; + _vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y; + _vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z; + + if ( plane.distanceToPoint( _vector$7 ) < 0 ) { + + return false; + + } + + } + + return true; + + } + + containsPoint( point ) { + + const planes = this.planes; + + for ( let i = 0; i < 6; i ++ ) { + + if ( planes[ i ].distanceToPoint( point ) < 0 ) { + + return false; + + } + + } + + return true; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +function WebGLAnimation() { + + let context = null; + let isAnimating = false; + let animationLoop = null; + let requestId = null; + + function onAnimationFrame( time, frame ) { + + animationLoop( time, frame ); + + requestId = context.requestAnimationFrame( onAnimationFrame ); + + } + + return { + + start: function () { + + if ( isAnimating === true ) return; + if ( animationLoop === null ) return; + + requestId = context.requestAnimationFrame( onAnimationFrame ); + + isAnimating = true; + + }, + + stop: function () { + + context.cancelAnimationFrame( requestId ); + + isAnimating = false; + + }, + + setAnimationLoop: function ( callback ) { + + animationLoop = callback; + + }, + + setContext: function ( value ) { + + context = value; + + } + + }; + +} + +function WebGLAttributes( gl, capabilities ) { + + const isWebGL2 = capabilities.isWebGL2; + + const buffers = new WeakMap(); + + function createBuffer( attribute, bufferType ) { + + const array = attribute.array; + const usage = attribute.usage; + + const buffer = gl.createBuffer(); + + gl.bindBuffer( bufferType, buffer ); + gl.bufferData( bufferType, array, usage ); + + attribute.onUploadCallback(); + + let type = 5126; + + if ( array instanceof Float32Array ) { + + type = 5126; + + } else if ( array instanceof Float64Array ) { + + console.warn( 'THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.' ); + + } else if ( array instanceof Uint16Array ) { + + if ( attribute.isFloat16BufferAttribute ) { + + if ( isWebGL2 ) { + + type = 5131; + + } else { + + console.warn( 'THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.' ); + + } + + } else { + + type = 5123; + + } + + } else if ( array instanceof Int16Array ) { + + type = 5122; + + } else if ( array instanceof Uint32Array ) { + + type = 5125; + + } else if ( array instanceof Int32Array ) { + + type = 5124; + + } else if ( array instanceof Int8Array ) { + + type = 5120; + + } else if ( array instanceof Uint8Array ) { + + type = 5121; + + } else if ( array instanceof Uint8ClampedArray ) { + + type = 5121; + + } + + return { + buffer: buffer, + type: type, + bytesPerElement: array.BYTES_PER_ELEMENT, + version: attribute.version + }; + + } + + function updateBuffer( buffer, attribute, bufferType ) { + + const array = attribute.array; + const updateRange = attribute.updateRange; + + gl.bindBuffer( bufferType, buffer ); + + if ( updateRange.count === - 1 ) { + + // Not using update ranges + + gl.bufferSubData( bufferType, 0, array ); + + } else { + + if ( isWebGL2 ) { + + gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, + array, updateRange.offset, updateRange.count ); + + } else { + + gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, + array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) ); + + } + + updateRange.count = - 1; // reset range + + } + + } + + // + + function get( attribute ) { + + if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; + + return buffers.get( attribute ); + + } + + function remove( attribute ) { + + if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; + + const data = buffers.get( attribute ); + + if ( data ) { + + gl.deleteBuffer( data.buffer ); + + buffers.delete( attribute ); + + } + + } + + function update( attribute, bufferType ) { + + if ( attribute.isGLBufferAttribute ) { + + const cached = buffers.get( attribute ); + + if ( ! cached || cached.version < attribute.version ) { + + buffers.set( attribute, { + buffer: attribute.buffer, + type: attribute.type, + bytesPerElement: attribute.elementSize, + version: attribute.version + } ); + + } + + return; + + } + + if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; + + const data = buffers.get( attribute ); + + if ( data === undefined ) { + + buffers.set( attribute, createBuffer( attribute, bufferType ) ); + + } else if ( data.version < attribute.version ) { + + updateBuffer( data.buffer, attribute, bufferType ); + + data.version = attribute.version; + + } + + } + + return { + + get: get, + remove: remove, + update: update + + }; + +} + +class PlaneGeometry extends BufferGeometry { + + constructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) { + + super(); + this.type = 'PlaneGeometry'; + + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; + + const width_half = width / 2; + const height_half = height / 2; + + const gridX = Math.floor( widthSegments ); + const gridY = Math.floor( heightSegments ); + + const gridX1 = gridX + 1; + const gridY1 = gridY + 1; + + const segment_width = width / gridX; + const segment_height = height / gridY; + + // + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + for ( let iy = 0; iy < gridY1; iy ++ ) { + + const y = iy * segment_height - height_half; + + for ( let ix = 0; ix < gridX1; ix ++ ) { + + const x = ix * segment_width - width_half; + + vertices.push( x, - y, 0 ); + + normals.push( 0, 0, 1 ); + + uvs.push( ix / gridX ); + uvs.push( 1 - ( iy / gridY ) ); + + } + + } + + for ( let iy = 0; iy < gridY; iy ++ ) { + + for ( let ix = 0; ix < gridX; ix ++ ) { + + const a = ix + gridX1 * iy; + const b = ix + gridX1 * ( iy + 1 ); + const c = ( ix + 1 ) + gridX1 * ( iy + 1 ); + const d = ( ix + 1 ) + gridX1 * iy; + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } + + } + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + } + + static fromJSON( data ) { + + return new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments ); + + } + +} + +var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif"; + +var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; + +var alphatest_fragment = "#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif"; + +var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif"; + +var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif"; + +var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"; + +var begin_vertex = "vec3 transformed = vec3( position );"; + +var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif"; + +var bsdfs = "vec3 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 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}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float 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\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\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}\nfloat 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}\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"; + +var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + 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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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"; + +var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif"; + +var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif"; + +var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif"; + +var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif"; + +var color_fragment = "#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif"; + +var color_pars_fragment = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif"; + +var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif"; + +var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_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"; + +var 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; }\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 color ) { return dot( color, vec3( 0.3333 ) ); }\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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\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}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\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}"; + +var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.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\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\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\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\treturn texture2D( envMap, uv ).rgb;\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + 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 ), m0, cubeUV_maxMipLevel );\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"; + +var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif"; + +var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif"; + +var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif"; + +var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif"; + +var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif"; + +var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; + +var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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}"; + +var 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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"; + +var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\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"; + +var envmap_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\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"; + +var envmap_pars_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\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"; + +var 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"; + +var fog_vertex = "#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif"; + +var fog_pars_vertex = "#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif"; + +var 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"; + +var 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"; + +var 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\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}"; + +var lightmap_fragment = "#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif"; + +var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif"; + +var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif"; + +var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\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\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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"; + +var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#endif"; + +var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;"; + +var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)"; + +var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;"; + +var 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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)"; + +var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\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( ( ior - 1.0 ) / ( 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, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif"; + +var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\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}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\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}"; + +var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\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"; + +var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif"; + +var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif"; + +var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif"; + +var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif"; + +var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif"; + +var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif"; + +var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\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#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif"; + +var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif"; + +var map_particle_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\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"; + +var map_particle_pars_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; + +var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif"; + +var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif"; + +var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif"; + +var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif"; + +var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif"; + +var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; + +var normal_fragment_maps = "#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).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( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif"; + +var 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"; + +var 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"; + +var 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"; + +var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif"; + +var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif"; + +var clearcoat_normal_fragment_maps = "#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif"; + +var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif"; + +var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; + +var 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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( 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( 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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}"; + +var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif"; + +var project_vertex = "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;"; + +var dithering_fragment = "#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; + +var 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"; + +var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif"; + +var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif"; + +var shadowmap_pars_fragment = "#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 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\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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 shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\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 shadow;\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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif"; + +var shadowmap_pars_vertex = "#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 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 mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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"; + +var shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif"; + +var 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.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.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ 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.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}"; + +var 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"; + +var skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif"; + +var 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"; + +var 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"; + +var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif"; + +var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif"; + +var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif"; + +var 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 toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( 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}\nvec3 CustomToneMapping( vec3 color ) { return color; }"; + +var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif"; + +var 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\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 framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\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 ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif"; + +var uv_pars_fragment = "#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif"; + +var uv_pars_vertex = "#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif"; + +var uv_vertex = "#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif"; + +var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif"; + +var uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif"; + +var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif"; + +var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif"; + +const vertex$g = "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}"; + +const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include \n\t#include \n}"; + +const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; + +const fragment$f = "#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; + +const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}"; + +const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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#endif\n}"; + +const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}"; + +const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; + +const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}"; + +const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; + +const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$9 = "#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const fragment$9 = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}"; + +const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}"; + +const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}"; + +const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}"; + +const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define 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 SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}"; + +const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$3 = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}"; + +const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const vertex$2 = "#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; + +const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}"; + +const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; + +const ShaderChunk = { + alphamap_fragment: alphamap_fragment, + alphamap_pars_fragment: alphamap_pars_fragment, + alphatest_fragment: alphatest_fragment, + alphatest_pars_fragment: alphatest_pars_fragment, + aomap_fragment: aomap_fragment, + aomap_pars_fragment: aomap_pars_fragment, + begin_vertex: begin_vertex, + beginnormal_vertex: beginnormal_vertex, + bsdfs: bsdfs, + bumpmap_pars_fragment: bumpmap_pars_fragment, + clipping_planes_fragment: clipping_planes_fragment, + clipping_planes_pars_fragment: clipping_planes_pars_fragment, + clipping_planes_pars_vertex: clipping_planes_pars_vertex, + clipping_planes_vertex: clipping_planes_vertex, + color_fragment: color_fragment, + color_pars_fragment: color_pars_fragment, + color_pars_vertex: color_pars_vertex, + color_vertex: color_vertex, + common: common, + cube_uv_reflection_fragment: cube_uv_reflection_fragment, + defaultnormal_vertex: defaultnormal_vertex, + displacementmap_pars_vertex: displacementmap_pars_vertex, + displacementmap_vertex: displacementmap_vertex, + emissivemap_fragment: emissivemap_fragment, + emissivemap_pars_fragment: emissivemap_pars_fragment, + encodings_fragment: encodings_fragment, + encodings_pars_fragment: encodings_pars_fragment, + envmap_fragment: envmap_fragment, + envmap_common_pars_fragment: envmap_common_pars_fragment, + envmap_pars_fragment: envmap_pars_fragment, + envmap_pars_vertex: envmap_pars_vertex, + envmap_physical_pars_fragment: envmap_physical_pars_fragment, + envmap_vertex: envmap_vertex, + fog_vertex: fog_vertex, + fog_pars_vertex: fog_pars_vertex, + fog_fragment: fog_fragment, + fog_pars_fragment: fog_pars_fragment, + gradientmap_pars_fragment: gradientmap_pars_fragment, + lightmap_fragment: lightmap_fragment, + lightmap_pars_fragment: lightmap_pars_fragment, + lights_lambert_vertex: lights_lambert_vertex, + lights_pars_begin: lights_pars_begin, + lights_toon_fragment: lights_toon_fragment, + lights_toon_pars_fragment: lights_toon_pars_fragment, + lights_phong_fragment: lights_phong_fragment, + lights_phong_pars_fragment: lights_phong_pars_fragment, + lights_physical_fragment: lights_physical_fragment, + lights_physical_pars_fragment: lights_physical_pars_fragment, + lights_fragment_begin: lights_fragment_begin, + lights_fragment_maps: lights_fragment_maps, + lights_fragment_end: lights_fragment_end, + logdepthbuf_fragment: logdepthbuf_fragment, + logdepthbuf_pars_fragment: logdepthbuf_pars_fragment, + logdepthbuf_pars_vertex: logdepthbuf_pars_vertex, + logdepthbuf_vertex: logdepthbuf_vertex, + map_fragment: map_fragment, + map_pars_fragment: map_pars_fragment, + map_particle_fragment: map_particle_fragment, + map_particle_pars_fragment: map_particle_pars_fragment, + metalnessmap_fragment: metalnessmap_fragment, + metalnessmap_pars_fragment: metalnessmap_pars_fragment, + morphnormal_vertex: morphnormal_vertex, + morphtarget_pars_vertex: morphtarget_pars_vertex, + morphtarget_vertex: morphtarget_vertex, + normal_fragment_begin: normal_fragment_begin, + normal_fragment_maps: normal_fragment_maps, + normal_pars_fragment: normal_pars_fragment, + normal_pars_vertex: normal_pars_vertex, + normal_vertex: normal_vertex, + normalmap_pars_fragment: normalmap_pars_fragment, + clearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin, + clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps, + clearcoat_pars_fragment: clearcoat_pars_fragment, + output_fragment: output_fragment, + packing: packing, + premultiplied_alpha_fragment: premultiplied_alpha_fragment, + project_vertex: project_vertex, + dithering_fragment: dithering_fragment, + dithering_pars_fragment: dithering_pars_fragment, + roughnessmap_fragment: roughnessmap_fragment, + roughnessmap_pars_fragment: roughnessmap_pars_fragment, + shadowmap_pars_fragment: shadowmap_pars_fragment, + shadowmap_pars_vertex: shadowmap_pars_vertex, + shadowmap_vertex: shadowmap_vertex, + shadowmask_pars_fragment: shadowmask_pars_fragment, + skinbase_vertex: skinbase_vertex, + skinning_pars_vertex: skinning_pars_vertex, + skinning_vertex: skinning_vertex, + skinnormal_vertex: skinnormal_vertex, + specularmap_fragment: specularmap_fragment, + specularmap_pars_fragment: specularmap_pars_fragment, + tonemapping_fragment: tonemapping_fragment, + tonemapping_pars_fragment: tonemapping_pars_fragment, + transmission_fragment: transmission_fragment, + transmission_pars_fragment: transmission_pars_fragment, + uv_pars_fragment: uv_pars_fragment, + uv_pars_vertex: uv_pars_vertex, + uv_vertex: uv_vertex, + uv2_pars_fragment: uv2_pars_fragment, + uv2_pars_vertex: uv2_pars_vertex, + uv2_vertex: uv2_vertex, + worldpos_vertex: worldpos_vertex, + + background_vert: vertex$g, + background_frag: fragment$g, + cube_vert: vertex$f, + cube_frag: fragment$f, + depth_vert: vertex$e, + depth_frag: fragment$e, + distanceRGBA_vert: vertex$d, + distanceRGBA_frag: fragment$d, + equirect_vert: vertex$c, + equirect_frag: fragment$c, + linedashed_vert: vertex$b, + linedashed_frag: fragment$b, + meshbasic_vert: vertex$a, + meshbasic_frag: fragment$a, + meshlambert_vert: vertex$9, + meshlambert_frag: fragment$9, + meshmatcap_vert: vertex$8, + meshmatcap_frag: fragment$8, + meshnormal_vert: vertex$7, + meshnormal_frag: fragment$7, + meshphong_vert: vertex$6, + meshphong_frag: fragment$6, + meshphysical_vert: vertex$5, + meshphysical_frag: fragment$5, + meshtoon_vert: vertex$4, + meshtoon_frag: fragment$4, + points_vert: vertex$3, + points_frag: fragment$3, + shadow_vert: vertex$2, + shadow_frag: fragment$2, + sprite_vert: vertex$1, + sprite_frag: fragment$1 +}; + +/** + * Uniforms library for shared webgl shaders + */ + +const UniformsLib = { + + common: { + + diffuse: { value: new Color( 0xffffff ) }, + opacity: { value: 1.0 }, + + map: { value: null }, + uvTransform: { value: new Matrix3() }, + uv2Transform: { value: new Matrix3() }, + + alphaMap: { value: null }, + alphaTest: { value: 0 } + + }, + + specularmap: { + + specularMap: { value: null }, + + }, + + envmap: { + + envMap: { value: null }, + flipEnvMap: { value: - 1 }, + reflectivity: { value: 1.0 }, // basic, lambert, phong + ior: { value: 1.5 }, // standard, physical + refractionRatio: { value: 0.98 } + + }, + + aomap: { + + aoMap: { value: null }, + aoMapIntensity: { value: 1 } + + }, + + lightmap: { + + lightMap: { value: null }, + lightMapIntensity: { value: 1 } + + }, + + emissivemap: { + + emissiveMap: { value: null } + + }, + + bumpmap: { + + bumpMap: { value: null }, + bumpScale: { value: 1 } + + }, + + normalmap: { + + normalMap: { value: null }, + normalScale: { value: new Vector2( 1, 1 ) } + + }, + + displacementmap: { + + displacementMap: { value: null }, + displacementScale: { value: 1 }, + displacementBias: { value: 0 } + + }, + + roughnessmap: { + + roughnessMap: { value: null } + + }, + + metalnessmap: { + + metalnessMap: { value: null } + + }, + + gradientmap: { + + gradientMap: { value: null } + + }, + + fog: { + + fogDensity: { value: 0.00025 }, + fogNear: { value: 1 }, + fogFar: { value: 2000 }, + fogColor: { value: new Color( 0xffffff ) } + + }, + + lights: { + + ambientLightColor: { value: [] }, + + lightProbe: { value: [] }, + + directionalLights: { value: [], properties: { + direction: {}, + color: {} + } }, + + directionalLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + directionalShadowMap: { value: [] }, + directionalShadowMatrix: { value: [] }, + + spotLights: { value: [], properties: { + color: {}, + position: {}, + direction: {}, + distance: {}, + coneCos: {}, + penumbraCos: {}, + decay: {} + } }, + + spotLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + spotShadowMap: { value: [] }, + spotShadowMatrix: { value: [] }, + + pointLights: { value: [], properties: { + color: {}, + position: {}, + decay: {}, + distance: {} + } }, + + pointLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {}, + shadowCameraNear: {}, + shadowCameraFar: {} + } }, + + pointShadowMap: { value: [] }, + pointShadowMatrix: { value: [] }, + + hemisphereLights: { value: [], properties: { + direction: {}, + skyColor: {}, + groundColor: {} + } }, + + // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src + rectAreaLights: { value: [], properties: { + color: {}, + position: {}, + width: {}, + height: {} + } }, + + ltc_1: { value: null }, + ltc_2: { value: null } + + }, + + points: { + + diffuse: { value: new Color( 0xffffff ) }, + opacity: { value: 1.0 }, + size: { value: 1.0 }, + scale: { value: 1.0 }, + map: { value: null }, + alphaMap: { value: null }, + alphaTest: { value: 0 }, + uvTransform: { value: new Matrix3() } + + }, + + sprite: { + + diffuse: { value: new Color( 0xffffff ) }, + opacity: { value: 1.0 }, + center: { value: new Vector2( 0.5, 0.5 ) }, + rotation: { value: 0.0 }, + map: { value: null }, + alphaMap: { value: null }, + alphaTest: { value: 0 }, + uvTransform: { value: new Matrix3() } + + } + +}; + +const ShaderLib = { + + basic: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.fog + ] ), + + vertexShader: ShaderChunk.meshbasic_vert, + fragmentShader: ShaderChunk.meshbasic_frag + + }, + + lambert: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: new Color( 0x000000 ) } + } + ] ), + + vertexShader: ShaderChunk.meshlambert_vert, + fragmentShader: ShaderChunk.meshlambert_frag + + }, + + phong: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: new Color( 0x000000 ) }, + specular: { value: new Color( 0x111111 ) }, + shininess: { value: 30 } + } + ] ), + + vertexShader: ShaderChunk.meshphong_vert, + fragmentShader: ShaderChunk.meshphong_frag + + }, + + standard: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.roughnessmap, + UniformsLib.metalnessmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: new Color( 0x000000 ) }, + roughness: { value: 1.0 }, + metalness: { value: 0.0 }, + envMapIntensity: { value: 1 } // temporary + } + ] ), + + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag + + }, + + toon: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.gradientmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: new Color( 0x000000 ) } + } + ] ), + + vertexShader: ShaderChunk.meshtoon_vert, + fragmentShader: ShaderChunk.meshtoon_frag + + }, + + matcap: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + { + matcap: { value: null } + } + ] ), + + vertexShader: ShaderChunk.meshmatcap_vert, + fragmentShader: ShaderChunk.meshmatcap_frag + + }, + + points: { + + uniforms: mergeUniforms( [ + UniformsLib.points, + UniformsLib.fog + ] ), + + vertexShader: ShaderChunk.points_vert, + fragmentShader: ShaderChunk.points_frag + + }, + + dashed: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.fog, + { + scale: { value: 1 }, + dashSize: { value: 1 }, + totalSize: { value: 2 } + } + ] ), + + vertexShader: ShaderChunk.linedashed_vert, + fragmentShader: ShaderChunk.linedashed_frag + + }, + + depth: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.displacementmap + ] ), + + vertexShader: ShaderChunk.depth_vert, + fragmentShader: ShaderChunk.depth_frag + + }, + + normal: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + { + opacity: { value: 1.0 } + } + ] ), + + vertexShader: ShaderChunk.meshnormal_vert, + fragmentShader: ShaderChunk.meshnormal_frag + + }, + + sprite: { + + uniforms: mergeUniforms( [ + UniformsLib.sprite, + UniformsLib.fog + ] ), + + vertexShader: ShaderChunk.sprite_vert, + fragmentShader: ShaderChunk.sprite_frag + + }, + + background: { + + uniforms: { + uvTransform: { value: new Matrix3() }, + t2D: { value: null }, + }, + + vertexShader: ShaderChunk.background_vert, + fragmentShader: ShaderChunk.background_frag + + }, + /* ------------------------------------------------------------------------- + // Cube map shader + ------------------------------------------------------------------------- */ + + cube: { + + uniforms: mergeUniforms( [ + UniformsLib.envmap, + { + opacity: { value: 1.0 } + } + ] ), + + vertexShader: ShaderChunk.cube_vert, + fragmentShader: ShaderChunk.cube_frag + + }, + + equirect: { + + uniforms: { + tEquirect: { value: null }, + }, + + vertexShader: ShaderChunk.equirect_vert, + fragmentShader: ShaderChunk.equirect_frag + + }, + + distanceRGBA: { + + uniforms: mergeUniforms( [ + UniformsLib.common, + UniformsLib.displacementmap, + { + referencePosition: { value: new Vector3() }, + nearDistance: { value: 1 }, + farDistance: { value: 1000 } + } + ] ), + + vertexShader: ShaderChunk.distanceRGBA_vert, + fragmentShader: ShaderChunk.distanceRGBA_frag + + }, + + shadow: { + + uniforms: mergeUniforms( [ + UniformsLib.lights, + UniformsLib.fog, + { + color: { value: new Color( 0x00000 ) }, + opacity: { value: 1.0 } + }, + ] ), + + vertexShader: ShaderChunk.shadow_vert, + fragmentShader: ShaderChunk.shadow_frag + + } + +}; + +ShaderLib.physical = { + + uniforms: mergeUniforms( [ + ShaderLib.standard.uniforms, + { + clearcoat: { value: 0 }, + clearcoatMap: { value: null }, + clearcoatRoughness: { value: 0 }, + clearcoatRoughnessMap: { value: null }, + clearcoatNormalScale: { value: new Vector2( 1, 1 ) }, + clearcoatNormalMap: { value: null }, + sheen: { value: 0 }, + sheenColor: { value: new Color( 0x000000 ) }, + sheenColorMap: { value: null }, + sheenRoughness: { value: 1 }, + sheenRoughnessMap: { value: null }, + transmission: { value: 0 }, + transmissionMap: { value: null }, + transmissionSamplerSize: { value: new Vector2() }, + transmissionSamplerMap: { value: null }, + thickness: { value: 0 }, + thicknessMap: { value: null }, + attenuationDistance: { value: 0 }, + attenuationColor: { value: new Color( 0x000000 ) }, + specularIntensity: { value: 1 }, + specularIntensityMap: { value: null }, + specularColor: { value: new Color( 1, 1, 1 ) }, + specularColorMap: { value: null }, + } + ] ), + + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag + +}; + +function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipliedAlpha ) { + + const clearColor = new Color( 0x000000 ); + let clearAlpha = alpha === true ? 0 : 1; + + let planeMesh; + let boxMesh; + + let currentBackground = null; + let currentBackgroundVersion = 0; + let currentTonemapping = null; + + function render( renderList, scene ) { + + let forceClear = false; + let background = scene.isScene === true ? scene.background : null; + + if ( background && background.isTexture ) { + + background = cubemaps.get( background ); + + } + + // Ignore background in AR + // TODO: Reconsider this. + + const xr = renderer.xr; + const session = xr.getSession && xr.getSession(); + + if ( session && session.environmentBlendMode === 'additive' ) { + + background = null; + + } + + if ( background === null ) { + + setClear( clearColor, clearAlpha ); + + } else if ( background && background.isColor ) { + + setClear( background, 1 ); + forceClear = true; + + } + + if ( renderer.autoClear || forceClear ) { + + renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); + + } + + if ( background && ( background.isCubeTexture || background.mapping === CubeUVReflectionMapping ) ) { + + if ( boxMesh === undefined ) { + + boxMesh = new Mesh( + new BoxGeometry( 1, 1, 1 ), + new ShaderMaterial( { + name: 'BackgroundCubeMaterial', + uniforms: cloneUniforms( ShaderLib.cube.uniforms ), + vertexShader: ShaderLib.cube.vertexShader, + fragmentShader: ShaderLib.cube.fragmentShader, + side: BackSide, + depthTest: false, + depthWrite: false, + fog: false + } ) + ); + + boxMesh.geometry.deleteAttribute( 'normal' ); + boxMesh.geometry.deleteAttribute( 'uv' ); + + boxMesh.onBeforeRender = function ( renderer, scene, camera ) { + + this.matrixWorld.copyPosition( camera.matrixWorld ); + + }; + + // enable code injection for non-built-in material + Object.defineProperty( boxMesh.material, 'envMap', { + + get: function () { + + return this.uniforms.envMap.value; + + } + + } ); + + objects.update( boxMesh ); + + } + + boxMesh.material.uniforms.envMap.value = background; + boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1; + + if ( currentBackground !== background || + currentBackgroundVersion !== background.version || + currentTonemapping !== renderer.toneMapping ) { + + boxMesh.material.needsUpdate = true; + + currentBackground = background; + currentBackgroundVersion = background.version; + currentTonemapping = renderer.toneMapping; + + } + + // push to the pre-sorted opaque render list + renderList.unshift( boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null ); + + } else if ( background && background.isTexture ) { + + if ( planeMesh === undefined ) { + + planeMesh = new Mesh( + new PlaneGeometry( 2, 2 ), + new ShaderMaterial( { + name: 'BackgroundMaterial', + uniforms: cloneUniforms( ShaderLib.background.uniforms ), + vertexShader: ShaderLib.background.vertexShader, + fragmentShader: ShaderLib.background.fragmentShader, + side: FrontSide, + depthTest: false, + depthWrite: false, + fog: false + } ) + ); + + planeMesh.geometry.deleteAttribute( 'normal' ); + + // enable code injection for non-built-in material + Object.defineProperty( planeMesh.material, 'map', { + + get: function () { + + return this.uniforms.t2D.value; + + } + + } ); + + objects.update( planeMesh ); + + } + + planeMesh.material.uniforms.t2D.value = background; + + if ( background.matrixAutoUpdate === true ) { + + background.updateMatrix(); + + } + + planeMesh.material.uniforms.uvTransform.value.copy( background.matrix ); + + if ( currentBackground !== background || + currentBackgroundVersion !== background.version || + currentTonemapping !== renderer.toneMapping ) { + + planeMesh.material.needsUpdate = true; + + currentBackground = background; + currentBackgroundVersion = background.version; + currentTonemapping = renderer.toneMapping; + + } + + + // push to the pre-sorted opaque render list + renderList.unshift( planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null ); + + } + + } + + function setClear( color, alpha ) { + + state.buffers.color.setClear( color.r, color.g, color.b, alpha, premultipliedAlpha ); + + } + + return { + + getClearColor: function () { + + return clearColor; + + }, + setClearColor: function ( color, alpha = 1 ) { + + clearColor.set( color ); + clearAlpha = alpha; + setClear( clearColor, clearAlpha ); + + }, + getClearAlpha: function () { + + return clearAlpha; + + }, + setClearAlpha: function ( alpha ) { + + clearAlpha = alpha; + setClear( clearColor, clearAlpha ); + + }, + render: render + + }; + +} + +function WebGLBindingStates( gl, extensions, attributes, capabilities ) { + + const maxVertexAttributes = gl.getParameter( 34921 ); + + const extension = capabilities.isWebGL2 ? null : extensions.get( 'OES_vertex_array_object' ); + const vaoAvailable = capabilities.isWebGL2 || extension !== null; + + const bindingStates = {}; + + const defaultState = createBindingState( null ); + let currentState = defaultState; + + function setup( object, material, program, geometry, index ) { + + let updateBuffers = false; + + if ( vaoAvailable ) { + + const state = getBindingState( geometry, program, material ); + + if ( currentState !== state ) { + + currentState = state; + bindVertexArrayObject( currentState.object ); + + } + + updateBuffers = needsUpdate( geometry, index ); + + if ( updateBuffers ) saveCache( geometry, index ); + + } else { + + const wireframe = ( material.wireframe === true ); + + if ( currentState.geometry !== geometry.id || + currentState.program !== program.id || + currentState.wireframe !== wireframe ) { + + currentState.geometry = geometry.id; + currentState.program = program.id; + currentState.wireframe = wireframe; + + updateBuffers = true; + + } + + } + + if ( object.isInstancedMesh === true ) { + + updateBuffers = true; + + } + + if ( index !== null ) { + + attributes.update( index, 34963 ); + + } + + if ( updateBuffers ) { + + setupVertexAttributes( object, material, program, geometry ); + + if ( index !== null ) { + + gl.bindBuffer( 34963, attributes.get( index ).buffer ); + + } + + } + + } + + function createVertexArrayObject() { + + if ( capabilities.isWebGL2 ) return gl.createVertexArray(); + + return extension.createVertexArrayOES(); + + } + + function bindVertexArrayObject( vao ) { + + if ( capabilities.isWebGL2 ) return gl.bindVertexArray( vao ); + + return extension.bindVertexArrayOES( vao ); + + } + + function deleteVertexArrayObject( vao ) { + + if ( capabilities.isWebGL2 ) return gl.deleteVertexArray( vao ); + + return extension.deleteVertexArrayOES( vao ); + + } + + function getBindingState( geometry, program, material ) { + + const wireframe = ( material.wireframe === true ); + + let programMap = bindingStates[ geometry.id ]; + + if ( programMap === undefined ) { + + programMap = {}; + bindingStates[ geometry.id ] = programMap; + + } + + let stateMap = programMap[ program.id ]; + + if ( stateMap === undefined ) { + + stateMap = {}; + programMap[ program.id ] = stateMap; + + } + + let state = stateMap[ wireframe ]; + + if ( state === undefined ) { + + state = createBindingState( createVertexArrayObject() ); + stateMap[ wireframe ] = state; + + } + + return state; + + } + + function createBindingState( vao ) { + + const newAttributes = []; + const enabledAttributes = []; + const attributeDivisors = []; + + for ( let i = 0; i < maxVertexAttributes; i ++ ) { + + newAttributes[ i ] = 0; + enabledAttributes[ i ] = 0; + attributeDivisors[ i ] = 0; + + } + + return { + + // for backward compatibility on non-VAO support browser + geometry: null, + program: null, + wireframe: false, + + newAttributes: newAttributes, + enabledAttributes: enabledAttributes, + attributeDivisors: attributeDivisors, + object: vao, + attributes: {}, + index: null + + }; + + } + + function needsUpdate( geometry, index ) { + + const cachedAttributes = currentState.attributes; + const geometryAttributes = geometry.attributes; + + let attributesNum = 0; + + for ( const key in geometryAttributes ) { + + const cachedAttribute = cachedAttributes[ key ]; + const geometryAttribute = geometryAttributes[ key ]; + + if ( cachedAttribute === undefined ) return true; + + if ( cachedAttribute.attribute !== geometryAttribute ) return true; + + if ( cachedAttribute.data !== geometryAttribute.data ) return true; + + attributesNum ++; + + } + + if ( currentState.attributesNum !== attributesNum ) return true; + + if ( currentState.index !== index ) return true; + + return false; + + } + + function saveCache( geometry, index ) { + + const cache = {}; + const attributes = geometry.attributes; + let attributesNum = 0; + + for ( const key in attributes ) { + + const attribute = attributes[ key ]; + + const data = {}; + data.attribute = attribute; + + if ( attribute.data ) { + + data.data = attribute.data; + + } + + cache[ key ] = data; + + attributesNum ++; + + } + + currentState.attributes = cache; + currentState.attributesNum = attributesNum; + + currentState.index = index; + + } + + function initAttributes() { + + const newAttributes = currentState.newAttributes; + + for ( let i = 0, il = newAttributes.length; i < il; i ++ ) { + + newAttributes[ i ] = 0; + + } + + } + + function enableAttribute( attribute ) { + + enableAttributeAndDivisor( attribute, 0 ); + + } + + function enableAttributeAndDivisor( attribute, meshPerAttribute ) { + + const newAttributes = currentState.newAttributes; + const enabledAttributes = currentState.enabledAttributes; + const attributeDivisors = currentState.attributeDivisors; + + newAttributes[ attribute ] = 1; + + if ( enabledAttributes[ attribute ] === 0 ) { + + gl.enableVertexAttribArray( attribute ); + enabledAttributes[ attribute ] = 1; + + } + + if ( attributeDivisors[ attribute ] !== meshPerAttribute ) { + + const extension = capabilities.isWebGL2 ? gl : extensions.get( 'ANGLE_instanced_arrays' ); + + extension[ capabilities.isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE' ]( attribute, meshPerAttribute ); + attributeDivisors[ attribute ] = meshPerAttribute; + + } + + } + + function disableUnusedAttributes() { + + const newAttributes = currentState.newAttributes; + const enabledAttributes = currentState.enabledAttributes; + + for ( let i = 0, il = enabledAttributes.length; i < il; i ++ ) { + + if ( enabledAttributes[ i ] !== newAttributes[ i ] ) { + + gl.disableVertexAttribArray( i ); + enabledAttributes[ i ] = 0; + + } + + } + + } + + function vertexAttribPointer( index, size, type, normalized, stride, offset ) { + + if ( capabilities.isWebGL2 === true && ( type === 5124 || type === 5125 ) ) { + + gl.vertexAttribIPointer( index, size, type, stride, offset ); + + } else { + + gl.vertexAttribPointer( index, size, type, normalized, stride, offset ); + + } + + } + + function setupVertexAttributes( object, material, program, geometry ) { + + if ( capabilities.isWebGL2 === false && ( object.isInstancedMesh || geometry.isInstancedBufferGeometry ) ) { + + if ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) return; + + } + + initAttributes(); + + const geometryAttributes = geometry.attributes; + + const programAttributes = program.getAttributes(); + + const materialDefaultAttributeValues = material.defaultAttributeValues; + + for ( const name in programAttributes ) { + + const programAttribute = programAttributes[ name ]; + + if ( programAttribute.location >= 0 ) { + + let geometryAttribute = geometryAttributes[ name ]; + + if ( geometryAttribute === undefined ) { + + if ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix; + if ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor; + + } + + if ( geometryAttribute !== undefined ) { + + const normalized = geometryAttribute.normalized; + const size = geometryAttribute.itemSize; + + const attribute = attributes.get( geometryAttribute ); + + // TODO Attribute may not be available on context restore + + if ( attribute === undefined ) continue; + + const buffer = attribute.buffer; + const type = attribute.type; + const bytesPerElement = attribute.bytesPerElement; + + if ( geometryAttribute.isInterleavedBufferAttribute ) { + + const data = geometryAttribute.data; + const stride = data.stride; + const offset = geometryAttribute.offset; + + if ( data && data.isInstancedInterleavedBuffer ) { + + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { + + enableAttributeAndDivisor( programAttribute.location + i, data.meshPerAttribute ); + + } + + if ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) { + + geometry._maxInstanceCount = data.meshPerAttribute * data.count; + + } + + } else { + + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { + + enableAttribute( programAttribute.location + i ); + + } + + } + + gl.bindBuffer( 34962, buffer ); + + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { + + vertexAttribPointer( + programAttribute.location + i, + size / programAttribute.locationSize, + type, + normalized, + stride * bytesPerElement, + ( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement + ); + + } + + } else { + + if ( geometryAttribute.isInstancedBufferAttribute ) { + + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { + + enableAttributeAndDivisor( programAttribute.location + i, geometryAttribute.meshPerAttribute ); + + } + + if ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) { + + geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count; + + } + + } else { + + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { + + enableAttribute( programAttribute.location + i ); + + } + + } + + gl.bindBuffer( 34962, buffer ); + + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { + + vertexAttribPointer( + programAttribute.location + i, + size / programAttribute.locationSize, + type, + normalized, + size * bytesPerElement, + ( size / programAttribute.locationSize ) * i * bytesPerElement + ); + + } + + } + + } else if ( materialDefaultAttributeValues !== undefined ) { + + const value = materialDefaultAttributeValues[ name ]; + + if ( value !== undefined ) { + + switch ( value.length ) { + + case 2: + gl.vertexAttrib2fv( programAttribute.location, value ); + break; + + case 3: + gl.vertexAttrib3fv( programAttribute.location, value ); + break; + + case 4: + gl.vertexAttrib4fv( programAttribute.location, value ); + break; + + default: + gl.vertexAttrib1fv( programAttribute.location, value ); + + } + + } + + } + + } + + } + + disableUnusedAttributes(); + + } + + function dispose() { + + reset(); + + for ( const geometryId in bindingStates ) { + + const programMap = bindingStates[ geometryId ]; + + for ( const programId in programMap ) { + + const stateMap = programMap[ programId ]; + + for ( const wireframe in stateMap ) { + + deleteVertexArrayObject( stateMap[ wireframe ].object ); + + delete stateMap[ wireframe ]; + + } + + delete programMap[ programId ]; + + } + + delete bindingStates[ geometryId ]; + + } + + } + + function releaseStatesOfGeometry( geometry ) { + + if ( bindingStates[ geometry.id ] === undefined ) return; + + const programMap = bindingStates[ geometry.id ]; + + for ( const programId in programMap ) { + + const stateMap = programMap[ programId ]; + + for ( const wireframe in stateMap ) { + + deleteVertexArrayObject( stateMap[ wireframe ].object ); + + delete stateMap[ wireframe ]; + + } + + delete programMap[ programId ]; + + } + + delete bindingStates[ geometry.id ]; + + } + + function releaseStatesOfProgram( program ) { + + for ( const geometryId in bindingStates ) { + + const programMap = bindingStates[ geometryId ]; + + if ( programMap[ program.id ] === undefined ) continue; + + const stateMap = programMap[ program.id ]; + + for ( const wireframe in stateMap ) { + + deleteVertexArrayObject( stateMap[ wireframe ].object ); + + delete stateMap[ wireframe ]; + + } + + delete programMap[ program.id ]; + + } + + } + + function reset() { + + resetDefaultState(); + + if ( currentState === defaultState ) return; + + currentState = defaultState; + bindVertexArrayObject( currentState.object ); + + } + + // for backward-compatilibity + + function resetDefaultState() { + + defaultState.geometry = null; + defaultState.program = null; + defaultState.wireframe = false; + + } + + return { + + setup: setup, + reset: reset, + resetDefaultState: resetDefaultState, + dispose: dispose, + releaseStatesOfGeometry: releaseStatesOfGeometry, + releaseStatesOfProgram: releaseStatesOfProgram, + + initAttributes: initAttributes, + enableAttribute: enableAttribute, + disableUnusedAttributes: disableUnusedAttributes + + }; + +} + +function WebGLBufferRenderer( gl, extensions, info, capabilities ) { + + const isWebGL2 = capabilities.isWebGL2; + + let mode; + + function setMode( value ) { + + mode = value; + + } + + function render( start, count ) { + + gl.drawArrays( mode, start, count ); + + info.update( count, mode, 1 ); + + } + + function renderInstances( start, count, primcount ) { + + if ( primcount === 0 ) return; + + let extension, methodName; + + if ( isWebGL2 ) { + + extension = gl; + methodName = 'drawArraysInstanced'; + + } else { + + extension = extensions.get( 'ANGLE_instanced_arrays' ); + methodName = 'drawArraysInstancedANGLE'; + + if ( extension === null ) { + + console.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); + return; + + } + + } + + extension[ methodName ]( mode, start, count, primcount ); + + info.update( count, mode, primcount ); + + } + + // + + this.setMode = setMode; + this.render = render; + this.renderInstances = renderInstances; + +} + +function WebGLCapabilities( gl, extensions, parameters ) { + + let maxAnisotropy; + + function getMaxAnisotropy() { + + if ( maxAnisotropy !== undefined ) return maxAnisotropy; + + if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) { + + const extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + + maxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT ); + + } else { + + maxAnisotropy = 0; + + } + + return maxAnisotropy; + + } + + function getMaxPrecision( precision ) { + + if ( precision === 'highp' ) { + + if ( gl.getShaderPrecisionFormat( 35633, 36338 ).precision > 0 && + gl.getShaderPrecisionFormat( 35632, 36338 ).precision > 0 ) { + + return 'highp'; + + } + + precision = 'mediump'; + + } + + if ( precision === 'mediump' ) { + + if ( gl.getShaderPrecisionFormat( 35633, 36337 ).precision > 0 && + gl.getShaderPrecisionFormat( 35632, 36337 ).precision > 0 ) { + + return 'mediump'; + + } + + } + + return 'lowp'; + + } + + const isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext ) || + ( typeof WebGL2ComputeRenderingContext !== 'undefined' && gl instanceof WebGL2ComputeRenderingContext ); + + let precision = parameters.precision !== undefined ? parameters.precision : 'highp'; + const maxPrecision = getMaxPrecision( precision ); + + if ( maxPrecision !== precision ) { + + console.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' ); + precision = maxPrecision; + + } + + const drawBuffers = isWebGL2 || extensions.has( 'WEBGL_draw_buffers' ); + + const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true; + + const maxTextures = gl.getParameter( 34930 ); + const maxVertexTextures = gl.getParameter( 35660 ); + const maxTextureSize = gl.getParameter( 3379 ); + const maxCubemapSize = gl.getParameter( 34076 ); + + const maxAttributes = gl.getParameter( 34921 ); + const maxVertexUniforms = gl.getParameter( 36347 ); + const maxVaryings = gl.getParameter( 36348 ); + const maxFragmentUniforms = gl.getParameter( 36349 ); + + const vertexTextures = maxVertexTextures > 0; + const floatFragmentTextures = isWebGL2 || extensions.has( 'OES_texture_float' ); + const floatVertexTextures = vertexTextures && floatFragmentTextures; + + const maxSamples = isWebGL2 ? gl.getParameter( 36183 ) : 0; + + return { + + isWebGL2: isWebGL2, + + drawBuffers: drawBuffers, + + getMaxAnisotropy: getMaxAnisotropy, + getMaxPrecision: getMaxPrecision, + + precision: precision, + logarithmicDepthBuffer: logarithmicDepthBuffer, + + maxTextures: maxTextures, + maxVertexTextures: maxVertexTextures, + maxTextureSize: maxTextureSize, + maxCubemapSize: maxCubemapSize, + + maxAttributes: maxAttributes, + maxVertexUniforms: maxVertexUniforms, + maxVaryings: maxVaryings, + maxFragmentUniforms: maxFragmentUniforms, + + vertexTextures: vertexTextures, + floatFragmentTextures: floatFragmentTextures, + floatVertexTextures: floatVertexTextures, + + maxSamples: maxSamples + + }; + +} + +function WebGLClipping( properties ) { + + const scope = this; + + let globalState = null, + numGlobalPlanes = 0, + localClippingEnabled = false, + renderingShadows = false; + + const plane = new Plane(), + viewNormalMatrix = new Matrix3(), + + uniform = { value: null, needsUpdate: false }; + + this.uniform = uniform; + this.numPlanes = 0; + this.numIntersection = 0; + + this.init = function ( planes, enableLocalClipping, camera ) { + + const enabled = + planes.length !== 0 || + enableLocalClipping || + // enable state of previous frame - the clipping code has to + // run another frame in order to reset the state: + numGlobalPlanes !== 0 || + localClippingEnabled; + + localClippingEnabled = enableLocalClipping; + + globalState = projectPlanes( planes, camera, 0 ); + numGlobalPlanes = planes.length; + + return enabled; + + }; + + this.beginShadows = function () { + + renderingShadows = true; + projectPlanes( null ); + + }; + + this.endShadows = function () { + + renderingShadows = false; + resetGlobalState(); + + }; + + this.setState = function ( material, camera, useCache ) { + + const planes = material.clippingPlanes, + clipIntersection = material.clipIntersection, + clipShadows = material.clipShadows; + + const materialProperties = properties.get( material ); + + if ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) { + + // there's no local clipping + + if ( renderingShadows ) { + + // there's no global clipping + + projectPlanes( null ); + + } else { + + resetGlobalState(); + + } + + } else { + + const nGlobal = renderingShadows ? 0 : numGlobalPlanes, + lGlobal = nGlobal * 4; + + let dstArray = materialProperties.clippingState || null; + + uniform.value = dstArray; // ensure unique state + + dstArray = projectPlanes( planes, camera, lGlobal, useCache ); + + for ( let i = 0; i !== lGlobal; ++ i ) { + + dstArray[ i ] = globalState[ i ]; + + } + + materialProperties.clippingState = dstArray; + this.numIntersection = clipIntersection ? this.numPlanes : 0; + this.numPlanes += nGlobal; + + } + + + }; + + function resetGlobalState() { + + if ( uniform.value !== globalState ) { + + uniform.value = globalState; + uniform.needsUpdate = numGlobalPlanes > 0; + + } + + scope.numPlanes = numGlobalPlanes; + scope.numIntersection = 0; + + } + + function projectPlanes( planes, camera, dstOffset, skipTransform ) { + + const nPlanes = planes !== null ? planes.length : 0; + let dstArray = null; + + if ( nPlanes !== 0 ) { + + dstArray = uniform.value; + + if ( skipTransform !== true || dstArray === null ) { + + const flatSize = dstOffset + nPlanes * 4, + viewMatrix = camera.matrixWorldInverse; + + viewNormalMatrix.getNormalMatrix( viewMatrix ); + + if ( dstArray === null || dstArray.length < flatSize ) { + + dstArray = new Float32Array( flatSize ); + + } + + for ( let i = 0, i4 = dstOffset; i !== nPlanes; ++ i, i4 += 4 ) { + + plane.copy( planes[ i ] ).applyMatrix4( viewMatrix, viewNormalMatrix ); + + plane.normal.toArray( dstArray, i4 ); + dstArray[ i4 + 3 ] = plane.constant; + + } + + } + + uniform.value = dstArray; + uniform.needsUpdate = true; + + } + + scope.numPlanes = nPlanes; + scope.numIntersection = 0; + + return dstArray; + + } + +} + +function WebGLCubeMaps( renderer ) { + + let cubemaps = new WeakMap(); + + function mapTextureMapping( texture, mapping ) { + + if ( mapping === EquirectangularReflectionMapping ) { + + texture.mapping = CubeReflectionMapping; + + } else if ( mapping === EquirectangularRefractionMapping ) { + + texture.mapping = CubeRefractionMapping; + + } + + return texture; + + } + + function get( texture ) { + + if ( texture && texture.isTexture && texture.isRenderTargetTexture === false ) { + + const mapping = texture.mapping; + + if ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) { + + if ( cubemaps.has( texture ) ) { + + const cubemap = cubemaps.get( texture ).texture; + return mapTextureMapping( cubemap, texture.mapping ); + + } else { + + const image = texture.image; + + if ( image && image.height > 0 ) { + + const renderTarget = new WebGLCubeRenderTarget( image.height / 2 ); + renderTarget.fromEquirectangularTexture( renderer, texture ); + cubemaps.set( texture, renderTarget ); + + texture.addEventListener( 'dispose', onTextureDispose ); + + return mapTextureMapping( renderTarget.texture, texture.mapping ); + + } else { + + // image not yet ready. try the conversion next frame + + return null; + + } + + } + + } + + } + + return texture; + + } + + function onTextureDispose( event ) { + + const texture = event.target; + + texture.removeEventListener( 'dispose', onTextureDispose ); + + const cubemap = cubemaps.get( texture ); + + if ( cubemap !== undefined ) { + + cubemaps.delete( texture ); + cubemap.dispose(); + + } + + } + + function dispose() { + + cubemaps = new WeakMap(); + + } + + return { + get: get, + dispose: dispose + }; + +} + +class OrthographicCamera extends Camera { + + constructor( left = - 1, right = 1, top = 1, bottom = - 1, near = 0.1, far = 2000 ) { + + super(); + + this.type = 'OrthographicCamera'; + + this.zoom = 1; + this.view = null; + + this.left = left; + this.right = right; + this.top = top; + this.bottom = bottom; + + this.near = near; + this.far = far; + + this.updateProjectionMatrix(); + + } + + copy( source, recursive ) { + + super.copy( source, recursive ); + + this.left = source.left; + this.right = source.right; + this.top = source.top; + this.bottom = source.bottom; + this.near = source.near; + this.far = source.far; + + this.zoom = source.zoom; + this.view = source.view === null ? null : Object.assign( {}, source.view ); + + return this; + + } + + setViewOffset( fullWidth, fullHeight, x, y, width, height ) { + + if ( this.view === null ) { + + this.view = { + enabled: true, + fullWidth: 1, + fullHeight: 1, + offsetX: 0, + offsetY: 0, + width: 1, + height: 1 + }; + + } + + this.view.enabled = true; + this.view.fullWidth = fullWidth; + this.view.fullHeight = fullHeight; + this.view.offsetX = x; + this.view.offsetY = y; + this.view.width = width; + this.view.height = height; + + this.updateProjectionMatrix(); + + } + + clearViewOffset() { + + if ( this.view !== null ) { + + this.view.enabled = false; + + } + + this.updateProjectionMatrix(); + + } + + updateProjectionMatrix() { + + const dx = ( this.right - this.left ) / ( 2 * this.zoom ); + const dy = ( this.top - this.bottom ) / ( 2 * this.zoom ); + const cx = ( this.right + this.left ) / 2; + const cy = ( this.top + this.bottom ) / 2; + + let left = cx - dx; + let right = cx + dx; + let top = cy + dy; + let bottom = cy - dy; + + if ( this.view !== null && this.view.enabled ) { + + const scaleW = ( this.right - this.left ) / this.view.fullWidth / this.zoom; + const scaleH = ( this.top - this.bottom ) / this.view.fullHeight / this.zoom; + + left += scaleW * this.view.offsetX; + right = left + scaleW * this.view.width; + top -= scaleH * this.view.offsetY; + bottom = top - scaleH * this.view.height; + + } + + this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far ); + + this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + data.object.zoom = this.zoom; + data.object.left = this.left; + data.object.right = this.right; + data.object.top = this.top; + data.object.bottom = this.bottom; + data.object.near = this.near; + data.object.far = this.far; + + if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); + + return data; + + } + +} + +OrthographicCamera.prototype.isOrthographicCamera = true; + +class RawShaderMaterial extends ShaderMaterial { + + constructor( parameters ) { + + super( parameters ); + + this.type = 'RawShaderMaterial'; + + } + +} + +RawShaderMaterial.prototype.isRawShaderMaterial = true; + +const LOD_MIN = 4; +const LOD_MAX = 8; +const SIZE_MAX = Math.pow( 2, LOD_MAX ); + +// The standard deviations (radians) associated with the extra mips. These are +// chosen to approximate a Trowbridge-Reitz distribution function times the +// geometric shadowing function. These sigma values squared must match the +// variance #defines in cube_uv_reflection_fragment.glsl.js. +const EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ]; + +const TOTAL_LODS = LOD_MAX - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length; + +// The maximum length of the blur for loop. Smaller sigmas will use fewer +// samples and exit early, but not recompile the shader. +const MAX_SAMPLES = 20; + +const _flatCamera = /*@__PURE__*/ new OrthographicCamera(); +const { _lodPlanes, _sizeLods, _sigmas } = /*@__PURE__*/ _createPlanes(); +const _clearColor = /*@__PURE__*/ new Color(); +let _oldTarget = null; + +// Golden Ratio +const PHI = ( 1 + Math.sqrt( 5 ) ) / 2; +const INV_PHI = 1 / PHI; + +// Vertices of a dodecahedron (except the opposites, which represent the +// same axis), used as axis directions evenly spread on a sphere. +const _axisDirections = [ + /*@__PURE__*/ new Vector3( 1, 1, 1 ), + /*@__PURE__*/ new Vector3( - 1, 1, 1 ), + /*@__PURE__*/ new Vector3( 1, 1, - 1 ), + /*@__PURE__*/ new Vector3( - 1, 1, - 1 ), + /*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ), + /*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ), + /*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ), + /*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ), + /*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ), + /*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ) ]; + +/** + * This class generates a Prefiltered, Mipmapped Radiance Environment Map + * (PMREM) from a cubeMap environment texture. This allows different levels of + * blur to be quickly accessed based on material roughness. It is packed into a + * special CubeUV format that allows us to perform custom interpolation so that + * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap + * chain, it only goes down to the LOD_MIN level (above), and then creates extra + * even more filtered 'mips' at the same LOD_MIN resolution, associated with + * higher roughness levels. In this way we maintain resolution to smoothly + * interpolate diffuse lighting while limiting sampling computation. + * + * Paper: Fast, Accurate Image-Based Lighting + * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view +*/ + +class PMREMGenerator { + + constructor( renderer ) { + + this._renderer = renderer; + this._pingPongRenderTarget = null; + + this._blurMaterial = _getBlurShader( MAX_SAMPLES ); + this._equirectShader = null; + this._cubemapShader = null; + + this._compileMaterial( this._blurMaterial ); + + } + + /** + * Generates a PMREM from a supplied Scene, which can be faster than using an + * image if networking bandwidth is low. Optional sigma specifies a blur radius + * in radians to be applied to the scene before PMREM generation. Optional near + * and far planes ensure the scene is rendered in its entirety (the cubeCamera + * is placed at the origin). + */ + fromScene( scene, sigma = 0, near = 0.1, far = 100 ) { + + _oldTarget = this._renderer.getRenderTarget(); + const cubeUVRenderTarget = this._allocateTargets(); + + this._sceneToCubeUV( scene, near, far, cubeUVRenderTarget ); + if ( sigma > 0 ) { + + this._blur( cubeUVRenderTarget, 0, 0, sigma ); + + } + + this._applyPMREM( cubeUVRenderTarget ); + this._cleanup( cubeUVRenderTarget ); + + return cubeUVRenderTarget; + + } + + /** + * Generates a PMREM from an equirectangular texture, which can be either LDR + * or HDR. The ideal input image size is 1k (1024 x 512), + * as this matches best with the 256 x 256 cubemap output. + */ + fromEquirectangular( equirectangular, renderTarget = null ) { + + return this._fromTexture( equirectangular, renderTarget ); + + } + + /** + * Generates a PMREM from an cubemap texture, which can be either LDR + * or HDR. The ideal input cube size is 256 x 256, + * as this matches best with the 256 x 256 cubemap output. + */ + fromCubemap( cubemap, renderTarget = null ) { + + return this._fromTexture( cubemap, renderTarget ); + + } + + /** + * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during + * your texture's network fetch for increased concurrency. + */ + compileCubemapShader() { + + if ( this._cubemapShader === null ) { + + this._cubemapShader = _getCubemapShader(); + this._compileMaterial( this._cubemapShader ); + + } + + } + + /** + * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during + * your texture's network fetch for increased concurrency. + */ + compileEquirectangularShader() { + + if ( this._equirectShader === null ) { + + this._equirectShader = _getEquirectShader(); + this._compileMaterial( this._equirectShader ); + + } + + } + + /** + * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, + * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on + * one of them will cause any others to also become unusable. + */ + dispose() { + + this._blurMaterial.dispose(); + + if ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose(); + + if ( this._cubemapShader !== null ) this._cubemapShader.dispose(); + if ( this._equirectShader !== null ) this._equirectShader.dispose(); + + for ( let i = 0; i < _lodPlanes.length; i ++ ) { + + _lodPlanes[ i ].dispose(); + + } + + } + + // private interface + + _cleanup( outputTarget ) { + + this._renderer.setRenderTarget( _oldTarget ); + outputTarget.scissorTest = false; + _setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height ); + + } + + _fromTexture( texture, renderTarget ) { + + _oldTarget = this._renderer.getRenderTarget(); + const cubeUVRenderTarget = renderTarget || this._allocateTargets( texture ); + this._textureToCubeUV( texture, cubeUVRenderTarget ); + this._applyPMREM( cubeUVRenderTarget ); + this._cleanup( cubeUVRenderTarget ); + + return cubeUVRenderTarget; + + } + + _allocateTargets( texture ) { // warning: null texture is valid + + const params = { + magFilter: LinearFilter, + minFilter: LinearFilter, + generateMipmaps: false, + type: HalfFloatType, + format: RGBAFormat, + encoding: LinearEncoding, + depthBuffer: false + }; + + const cubeUVRenderTarget = _createRenderTarget( params ); + cubeUVRenderTarget.depthBuffer = texture ? false : true; + + if ( this._pingPongRenderTarget === null ) { + + this._pingPongRenderTarget = _createRenderTarget( params ); + + } + + return cubeUVRenderTarget; + + } + + _compileMaterial( material ) { + + const tmpMesh = new Mesh( _lodPlanes[ 0 ], material ); + this._renderer.compile( tmpMesh, _flatCamera ); + + } + + _sceneToCubeUV( scene, near, far, cubeUVRenderTarget ) { + + const fov = 90; + const aspect = 1; + const cubeCamera = new PerspectiveCamera( fov, aspect, near, far ); + const upSign = [ 1, - 1, 1, 1, 1, 1 ]; + const forwardSign = [ 1, 1, 1, - 1, - 1, - 1 ]; + const renderer = this._renderer; + + const originalAutoClear = renderer.autoClear; + const toneMapping = renderer.toneMapping; + renderer.getClearColor( _clearColor ); + + renderer.toneMapping = NoToneMapping; + renderer.autoClear = false; + + const backgroundMaterial = new MeshBasicMaterial( { + name: 'PMREM.Background', + side: BackSide, + depthWrite: false, + depthTest: false, + } ); + + const backgroundBox = new Mesh( new BoxGeometry(), backgroundMaterial ); + + let useSolidColor = false; + const background = scene.background; + + if ( background ) { + + if ( background.isColor ) { + + backgroundMaterial.color.copy( background ); + scene.background = null; + useSolidColor = true; + + } + + } else { + + backgroundMaterial.color.copy( _clearColor ); + useSolidColor = true; + + } + + for ( let i = 0; i < 6; i ++ ) { + + const col = i % 3; + if ( col === 0 ) { + + cubeCamera.up.set( 0, upSign[ i ], 0 ); + cubeCamera.lookAt( forwardSign[ i ], 0, 0 ); + + } else if ( col === 1 ) { + + cubeCamera.up.set( 0, 0, upSign[ i ] ); + cubeCamera.lookAt( 0, forwardSign[ i ], 0 ); + + } else { + + cubeCamera.up.set( 0, upSign[ i ], 0 ); + cubeCamera.lookAt( 0, 0, forwardSign[ i ] ); + + } + + _setViewport( cubeUVRenderTarget, + col * SIZE_MAX, i > 2 ? SIZE_MAX : 0, SIZE_MAX, SIZE_MAX ); + renderer.setRenderTarget( cubeUVRenderTarget ); + + if ( useSolidColor ) { + + renderer.render( backgroundBox, cubeCamera ); + + } + + renderer.render( scene, cubeCamera ); + + } + + backgroundBox.geometry.dispose(); + backgroundBox.material.dispose(); + + renderer.toneMapping = toneMapping; + renderer.autoClear = originalAutoClear; + scene.background = background; + + } + + _textureToCubeUV( texture, cubeUVRenderTarget ) { + + const renderer = this._renderer; + + const isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping ); + + if ( isCubeTexture ) { + + if ( this._cubemapShader === null ) { + + this._cubemapShader = _getCubemapShader(); + + } + + this._cubemapShader.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? - 1 : 1; + + } else { + + if ( this._equirectShader === null ) { + + this._equirectShader = _getEquirectShader(); + + } + + } + + const material = isCubeTexture ? this._cubemapShader : this._equirectShader; + const mesh = new Mesh( _lodPlanes[ 0 ], material ); + + const uniforms = material.uniforms; + + uniforms[ 'envMap' ].value = texture; + + if ( ! isCubeTexture ) { + + uniforms[ 'texelSize' ].value.set( 1.0 / texture.image.width, 1.0 / texture.image.height ); + + } + + _setViewport( cubeUVRenderTarget, 0, 0, 3 * SIZE_MAX, 2 * SIZE_MAX ); + + renderer.setRenderTarget( cubeUVRenderTarget ); + renderer.render( mesh, _flatCamera ); + + } + + _applyPMREM( cubeUVRenderTarget ) { + + const renderer = this._renderer; + const autoClear = renderer.autoClear; + renderer.autoClear = false; + + for ( let i = 1; i < TOTAL_LODS; i ++ ) { + + const sigma = Math.sqrt( _sigmas[ i ] * _sigmas[ i ] - _sigmas[ i - 1 ] * _sigmas[ i - 1 ] ); + + const poleAxis = _axisDirections[ ( i - 1 ) % _axisDirections.length ]; + + this._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis ); + + } + + renderer.autoClear = autoClear; + + } + + /** + * This is a two-pass Gaussian blur for a cubemap. Normally this is done + * vertically and horizontally, but this breaks down on a cube. Here we apply + * the blur latitudinally (around the poles), and then longitudinally (towards + * the poles) to approximate the orthogonally-separable blur. It is least + * accurate at the poles, but still does a decent job. + */ + _blur( cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis ) { + + const pingPongRenderTarget = this._pingPongRenderTarget; + + this._halfBlur( + cubeUVRenderTarget, + pingPongRenderTarget, + lodIn, + lodOut, + sigma, + 'latitudinal', + poleAxis ); + + this._halfBlur( + pingPongRenderTarget, + cubeUVRenderTarget, + lodOut, + lodOut, + sigma, + 'longitudinal', + poleAxis ); + + } + + _halfBlur( targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis ) { + + const renderer = this._renderer; + const blurMaterial = this._blurMaterial; + + if ( direction !== 'latitudinal' && direction !== 'longitudinal' ) { + + console.error( + 'blur direction must be either latitudinal or longitudinal!' ); + + } + + // Number of standard deviations at which to cut off the discrete approximation. + const STANDARD_DEVIATIONS = 3; + + const blurMesh = new Mesh( _lodPlanes[ lodOut ], blurMaterial ); + const blurUniforms = blurMaterial.uniforms; + + const pixels = _sizeLods[ lodIn ] - 1; + const radiansPerPixel = isFinite( sigmaRadians ) ? Math.PI / ( 2 * pixels ) : 2 * Math.PI / ( 2 * MAX_SAMPLES - 1 ); + const sigmaPixels = sigmaRadians / radiansPerPixel; + const samples = isFinite( sigmaRadians ) ? 1 + Math.floor( STANDARD_DEVIATIONS * sigmaPixels ) : MAX_SAMPLES; + + if ( samples > MAX_SAMPLES ) { + + console.warn( `sigmaRadians, ${ + sigmaRadians}, is too large and will clip, as it requested ${ + samples} samples when the maximum is set to ${MAX_SAMPLES}` ); + + } + + const weights = []; + let sum = 0; + + for ( let i = 0; i < MAX_SAMPLES; ++ i ) { + + const x = i / sigmaPixels; + const weight = Math.exp( - x * x / 2 ); + weights.push( weight ); + + if ( i === 0 ) { + + sum += weight; + + } else if ( i < samples ) { + + sum += 2 * weight; + + } + + } + + for ( let i = 0; i < weights.length; i ++ ) { + + weights[ i ] = weights[ i ] / sum; + + } + + blurUniforms[ 'envMap' ].value = targetIn.texture; + blurUniforms[ 'samples' ].value = samples; + blurUniforms[ 'weights' ].value = weights; + blurUniforms[ 'latitudinal' ].value = direction === 'latitudinal'; + + if ( poleAxis ) { + + blurUniforms[ 'poleAxis' ].value = poleAxis; + + } + + blurUniforms[ 'dTheta' ].value = radiansPerPixel; + blurUniforms[ 'mipInt' ].value = LOD_MAX - lodIn; + + const outputSize = _sizeLods[ lodOut ]; + const x = 3 * Math.max( 0, SIZE_MAX - 2 * outputSize ); + const y = ( lodOut === 0 ? 0 : 2 * SIZE_MAX ) + 2 * outputSize * ( lodOut > LOD_MAX - LOD_MIN ? lodOut - LOD_MAX + LOD_MIN : 0 ); + + _setViewport( targetOut, x, y, 3 * outputSize, 2 * outputSize ); + renderer.setRenderTarget( targetOut ); + renderer.render( blurMesh, _flatCamera ); + + } + +} + +function _createPlanes() { + + const _lodPlanes = []; + const _sizeLods = []; + const _sigmas = []; + + let lod = LOD_MAX; + + for ( let i = 0; i < TOTAL_LODS; i ++ ) { + + const sizeLod = Math.pow( 2, lod ); + _sizeLods.push( sizeLod ); + let sigma = 1.0 / sizeLod; + + if ( i > LOD_MAX - LOD_MIN ) { + + sigma = EXTRA_LOD_SIGMA[ i - LOD_MAX + LOD_MIN - 1 ]; + + } else if ( i === 0 ) { + + sigma = 0; + + } + + _sigmas.push( sigma ); + + const texelSize = 1.0 / ( sizeLod - 1 ); + const min = - texelSize / 2; + const max = 1 + texelSize / 2; + const uv1 = [ min, min, max, min, max, max, min, min, max, max, min, max ]; + + const cubeFaces = 6; + const vertices = 6; + const positionSize = 3; + const uvSize = 2; + const faceIndexSize = 1; + + const position = new Float32Array( positionSize * vertices * cubeFaces ); + const uv = new Float32Array( uvSize * vertices * cubeFaces ); + const faceIndex = new Float32Array( faceIndexSize * vertices * cubeFaces ); + + for ( let face = 0; face < cubeFaces; face ++ ) { + + const x = ( face % 3 ) * 2 / 3 - 1; + const y = face > 2 ? 0 : - 1; + const coordinates = [ + x, y, 0, + x + 2 / 3, y, 0, + x + 2 / 3, y + 1, 0, + x, y, 0, + x + 2 / 3, y + 1, 0, + x, y + 1, 0 + ]; + position.set( coordinates, positionSize * vertices * face ); + uv.set( uv1, uvSize * vertices * face ); + const fill = [ face, face, face, face, face, face ]; + faceIndex.set( fill, faceIndexSize * vertices * face ); + + } + + const planes = new BufferGeometry(); + planes.setAttribute( 'position', new BufferAttribute( position, positionSize ) ); + planes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) ); + planes.setAttribute( 'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) ); + _lodPlanes.push( planes ); + + if ( lod > LOD_MIN ) { + + lod --; + + } + + } + + return { _lodPlanes, _sizeLods, _sigmas }; + +} + +function _createRenderTarget( params ) { + + const cubeUVRenderTarget = new WebGLRenderTarget( 3 * SIZE_MAX, 3 * SIZE_MAX, params ); + cubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping; + cubeUVRenderTarget.texture.name = 'PMREM.cubeUv'; + cubeUVRenderTarget.scissorTest = true; + return cubeUVRenderTarget; + +} + +function _setViewport( target, x, y, width, height ) { + + target.viewport.set( x, y, width, height ); + target.scissor.set( x, y, width, height ); + +} + +function _getBlurShader( maxSamples ) { + + const weights = new Float32Array( maxSamples ); + const poleAxis = new Vector3( 0, 1, 0 ); + const shaderMaterial = new RawShaderMaterial( { + + name: 'SphericalGaussianBlur', + + defines: { 'n': maxSamples }, + + uniforms: { + 'envMap': { value: null }, + 'samples': { value: 1 }, + 'weights': { value: weights }, + 'latitudinal': { value: false }, + 'dTheta': { value: 0 }, + 'mipInt': { value: 0 }, + 'poleAxis': { value: poleAxis } + }, + + vertexShader: _getCommonVertexShader(), + + fragmentShader: /* glsl */` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `, + + blending: NoBlending, + depthTest: false, + depthWrite: false + + } ); + + return shaderMaterial; + +} + +function _getEquirectShader() { + + const texelSize = new Vector2( 1, 1 ); + const shaderMaterial = new RawShaderMaterial( { + + name: 'EquirectangularToCubeUV', + + uniforms: { + 'envMap': { value: null }, + 'texelSize': { value: texelSize } + }, + + vertexShader: _getCommonVertexShader(), + + fragmentShader: /* glsl */` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform vec2 texelSize; + + #include + + void main() { + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + vec2 f = fract( uv / texelSize - 0.5 ); + uv -= f * texelSize; + vec3 tl = texture2D ( envMap, uv ).rgb; + uv.x += texelSize.x; + vec3 tr = texture2D ( envMap, uv ).rgb; + uv.y += texelSize.y; + vec3 br = texture2D ( envMap, uv ).rgb; + uv.x -= texelSize.x; + vec3 bl = texture2D ( envMap, uv ).rgb; + + vec3 tm = mix( tl, tr, f.x ); + vec3 bm = mix( bl, br, f.x ); + gl_FragColor.rgb = mix( tm, bm, f.y ); + + } + `, + + blending: NoBlending, + depthTest: false, + depthWrite: false + + } ); + + return shaderMaterial; + +} + +function _getCubemapShader() { + + const shaderMaterial = new RawShaderMaterial( { + + name: 'CubemapToCubeUV', + + uniforms: { + 'envMap': { value: null }, + 'flipEnvMap': { value: - 1 } + }, + + vertexShader: _getCommonVertexShader(), + + fragmentShader: /* glsl */` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `, + + blending: NoBlending, + depthTest: false, + depthWrite: false + + } ); + + return shaderMaterial; + +} + +function _getCommonVertexShader() { + + return /* glsl */` + + precision mediump float; + precision mediump int; + + attribute vec3 position; + attribute vec2 uv; + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `; + +} + +function WebGLCubeUVMaps( renderer ) { + + let cubeUVmaps = new WeakMap(); + + let pmremGenerator = null; + + function get( texture ) { + + if ( texture && texture.isTexture ) { + + const mapping = texture.mapping; + + const isEquirectMap = ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ); + const isCubeMap = ( mapping === CubeReflectionMapping || mapping === CubeRefractionMapping ); + + // equirect/cube map to cubeUV conversion + + if ( isEquirectMap || isCubeMap ) { + + if ( texture.isRenderTargetTexture && texture.needsPMREMUpdate === true ) { + + texture.needsPMREMUpdate = false; + + let renderTarget = cubeUVmaps.get( texture ); + + if ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer ); + + renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture, renderTarget ) : pmremGenerator.fromCubemap( texture, renderTarget ); + cubeUVmaps.set( texture, renderTarget ); + + return renderTarget.texture; + + } else { + + if ( cubeUVmaps.has( texture ) ) { + + return cubeUVmaps.get( texture ).texture; + + } else { + + const image = texture.image; + + if ( ( isEquirectMap && image && image.height > 0 ) || ( isCubeMap && image && isCubeTextureComplete( image ) ) ) { + + if ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer ); + + const renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture ) : pmremGenerator.fromCubemap( texture ); + cubeUVmaps.set( texture, renderTarget ); + + texture.addEventListener( 'dispose', onTextureDispose ); + + return renderTarget.texture; + + } else { + + // image not yet ready. try the conversion next frame + + return null; + + } + + } + + } + + } + + } + + return texture; + + } + + function isCubeTextureComplete( image ) { + + let count = 0; + const length = 6; + + for ( let i = 0; i < length; i ++ ) { + + if ( image[ i ] !== undefined ) count ++; + + } + + return count === length; + + + } + + function onTextureDispose( event ) { + + const texture = event.target; + + texture.removeEventListener( 'dispose', onTextureDispose ); + + const cubemapUV = cubeUVmaps.get( texture ); + + if ( cubemapUV !== undefined ) { + + cubeUVmaps.delete( texture ); + cubemapUV.dispose(); + + } + + } + + function dispose() { + + cubeUVmaps = new WeakMap(); + + if ( pmremGenerator !== null ) { + + pmremGenerator.dispose(); + pmremGenerator = null; + + } + + } + + return { + get: get, + dispose: dispose + }; + +} + +function WebGLExtensions( gl ) { + + const extensions = {}; + + function getExtension( name ) { + + if ( extensions[ name ] !== undefined ) { + + return extensions[ name ]; + + } + + let extension; + + switch ( name ) { + + case 'WEBGL_depth_texture': + extension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' ); + break; + + case 'EXT_texture_filter_anisotropic': + extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); + break; + + case 'WEBGL_compressed_texture_s3tc': + extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' ); + break; + + case 'WEBGL_compressed_texture_pvrtc': + extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' ); + break; + + default: + extension = gl.getExtension( name ); + + } + + extensions[ name ] = extension; + + return extension; + + } + + return { + + has: function ( name ) { + + return getExtension( name ) !== null; + + }, + + init: function ( capabilities ) { + + if ( capabilities.isWebGL2 ) { + + getExtension( 'EXT_color_buffer_float' ); + + } else { + + getExtension( 'WEBGL_depth_texture' ); + getExtension( 'OES_texture_float' ); + getExtension( 'OES_texture_half_float' ); + getExtension( 'OES_texture_half_float_linear' ); + getExtension( 'OES_standard_derivatives' ); + getExtension( 'OES_element_index_uint' ); + getExtension( 'OES_vertex_array_object' ); + getExtension( 'ANGLE_instanced_arrays' ); + + } + + getExtension( 'OES_texture_float_linear' ); + getExtension( 'EXT_color_buffer_half_float' ); + getExtension( 'WEBGL_multisampled_render_to_texture' ); + + }, + + get: function ( name ) { + + const extension = getExtension( name ); + + if ( extension === null ) { + + console.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' ); + + } + + return extension; + + } + + }; + +} + +function WebGLGeometries( gl, attributes, info, bindingStates ) { + + const geometries = {}; + const wireframeAttributes = new WeakMap(); + + function onGeometryDispose( event ) { + + const geometry = event.target; + + if ( geometry.index !== null ) { + + attributes.remove( geometry.index ); + + } + + for ( const name in geometry.attributes ) { + + attributes.remove( geometry.attributes[ name ] ); + + } + + geometry.removeEventListener( 'dispose', onGeometryDispose ); + + delete geometries[ geometry.id ]; + + const attribute = wireframeAttributes.get( geometry ); + + if ( attribute ) { + + attributes.remove( attribute ); + wireframeAttributes.delete( geometry ); + + } + + bindingStates.releaseStatesOfGeometry( geometry ); + + if ( geometry.isInstancedBufferGeometry === true ) { + + delete geometry._maxInstanceCount; + + } + + // + + info.memory.geometries --; + + } + + function get( object, geometry ) { + + if ( geometries[ geometry.id ] === true ) return geometry; + + geometry.addEventListener( 'dispose', onGeometryDispose ); + + geometries[ geometry.id ] = true; + + info.memory.geometries ++; + + return geometry; + + } + + function update( geometry ) { + + const geometryAttributes = geometry.attributes; + + // Updating index buffer in VAO now. See WebGLBindingStates. + + for ( const name in geometryAttributes ) { + + attributes.update( geometryAttributes[ name ], 34962 ); + + } + + // morph targets + + const morphAttributes = geometry.morphAttributes; + + for ( const name in morphAttributes ) { + + const array = morphAttributes[ name ]; + + for ( let i = 0, l = array.length; i < l; i ++ ) { + + attributes.update( array[ i ], 34962 ); + + } + + } + + } + + function updateWireframeAttribute( geometry ) { + + const indices = []; + + const geometryIndex = geometry.index; + const geometryPosition = geometry.attributes.position; + let version = 0; + + if ( geometryIndex !== null ) { + + const array = geometryIndex.array; + version = geometryIndex.version; + + for ( let i = 0, l = array.length; i < l; i += 3 ) { + + const a = array[ i + 0 ]; + const b = array[ i + 1 ]; + const c = array[ i + 2 ]; + + indices.push( a, b, b, c, c, a ); + + } + + } else { + + const array = geometryPosition.array; + version = geometryPosition.version; + + for ( let i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) { + + const a = i + 0; + const b = i + 1; + const c = i + 2; + + indices.push( a, b, b, c, c, a ); + + } + + } + + const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); + attribute.version = version; + + // Updating index buffer in VAO now. See WebGLBindingStates + + // + + const previousAttribute = wireframeAttributes.get( geometry ); + + if ( previousAttribute ) attributes.remove( previousAttribute ); + + // + + wireframeAttributes.set( geometry, attribute ); + + } + + function getWireframeAttribute( geometry ) { + + const currentAttribute = wireframeAttributes.get( geometry ); + + if ( currentAttribute ) { + + const geometryIndex = geometry.index; + + if ( geometryIndex !== null ) { + + // if the attribute is obsolete, create a new one + + if ( currentAttribute.version < geometryIndex.version ) { + + updateWireframeAttribute( geometry ); + + } + + } + + } else { + + updateWireframeAttribute( geometry ); + + } + + return wireframeAttributes.get( geometry ); + + } + + return { + + get: get, + update: update, + + getWireframeAttribute: getWireframeAttribute + + }; + +} + +function WebGLIndexedBufferRenderer( gl, extensions, info, capabilities ) { + + const isWebGL2 = capabilities.isWebGL2; + + let mode; + + function setMode( value ) { + + mode = value; + + } + + let type, bytesPerElement; + + function setIndex( value ) { + + type = value.type; + bytesPerElement = value.bytesPerElement; + + } + + function render( start, count ) { + + gl.drawElements( mode, count, type, start * bytesPerElement ); + + info.update( count, mode, 1 ); + + } + + function renderInstances( start, count, primcount ) { + + if ( primcount === 0 ) return; + + let extension, methodName; + + if ( isWebGL2 ) { + + extension = gl; + methodName = 'drawElementsInstanced'; + + } else { + + extension = extensions.get( 'ANGLE_instanced_arrays' ); + methodName = 'drawElementsInstancedANGLE'; + + if ( extension === null ) { + + console.error( 'THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); + return; + + } + + } + + extension[ methodName ]( mode, count, type, start * bytesPerElement, primcount ); + + info.update( count, mode, primcount ); + + } + + // + + this.setMode = setMode; + this.setIndex = setIndex; + this.render = render; + this.renderInstances = renderInstances; + +} + +function WebGLInfo( gl ) { + + const memory = { + geometries: 0, + textures: 0 + }; + + const render = { + frame: 0, + calls: 0, + triangles: 0, + points: 0, + lines: 0 + }; + + function update( count, mode, instanceCount ) { + + render.calls ++; + + switch ( mode ) { + + case 4: + render.triangles += instanceCount * ( count / 3 ); + break; + + case 1: + render.lines += instanceCount * ( count / 2 ); + break; + + case 3: + render.lines += instanceCount * ( count - 1 ); + break; + + case 2: + render.lines += instanceCount * count; + break; + + case 0: + render.points += instanceCount * count; + break; + + default: + console.error( 'THREE.WebGLInfo: Unknown draw mode:', mode ); + break; + + } + + } + + function reset() { + + render.frame ++; + render.calls = 0; + render.triangles = 0; + render.points = 0; + render.lines = 0; + + } + + return { + memory: memory, + render: render, + programs: null, + autoReset: true, + reset: reset, + update: update + }; + +} + +class DataTexture2DArray extends Texture { + + constructor( data = null, width = 1, height = 1, depth = 1 ) { + + super( null ); + + this.image = { data, width, height, depth }; + + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; + + this.wrapR = ClampToEdgeWrapping; + + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; + + } + +} + +DataTexture2DArray.prototype.isDataTexture2DArray = true; + +function numericalSort( a, b ) { + + return a[ 0 ] - b[ 0 ]; + +} + +function absNumericalSort( a, b ) { + + return Math.abs( b[ 1 ] ) - Math.abs( a[ 1 ] ); + +} + +function denormalize( morph, attribute ) { + + let denominator = 1; + const array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array; + + if ( array instanceof Int8Array ) denominator = 127; + else if ( array instanceof Int16Array ) denominator = 32767; + else if ( array instanceof Int32Array ) denominator = 2147483647; + else console.error( 'THREE.WebGLMorphtargets: Unsupported morph attribute data type: ', array ); + + morph.divideScalar( denominator ); + +} + +function WebGLMorphtargets( gl, capabilities, textures ) { + + const influencesList = {}; + const morphInfluences = new Float32Array( 8 ); + const morphTextures = new WeakMap(); + const morph = new Vector3(); + + const workInfluences = []; + + for ( let i = 0; i < 8; i ++ ) { + + workInfluences[ i ] = [ i, 0 ]; + + } + + function update( object, geometry, material, program ) { + + const objectInfluences = object.morphTargetInfluences; + + if ( capabilities.isWebGL2 === true ) { + + // instead of using attributes, the WebGL 2 code path encodes morph targets + // into an array of data textures. Each layer represents a single morph target. + + const numberOfMorphTargets = geometry.morphAttributes.position.length; + + let entry = morphTextures.get( geometry ); + + if ( entry === undefined || entry.count !== numberOfMorphTargets ) { + + if ( entry !== undefined ) entry.texture.dispose(); + + const hasMorphNormals = geometry.morphAttributes.normal !== undefined; + + const morphTargets = geometry.morphAttributes.position; + const morphNormals = geometry.morphAttributes.normal || []; + + const numberOfVertices = geometry.attributes.position.count; + const numberOfVertexData = ( hasMorphNormals === true ) ? 2 : 1; // (v,n) vs. (v) + + let width = numberOfVertices * numberOfVertexData; + let height = 1; + + if ( width > capabilities.maxTextureSize ) { + + height = Math.ceil( width / capabilities.maxTextureSize ); + width = capabilities.maxTextureSize; + + } + + const buffer = new Float32Array( width * height * 4 * numberOfMorphTargets ); + + const texture = new DataTexture2DArray( buffer, width, height, numberOfMorphTargets ); + texture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower) + texture.type = FloatType; + texture.needsUpdate = true; + + // fill buffer + + const vertexDataStride = numberOfVertexData * 4; + + for ( let i = 0; i < numberOfMorphTargets; i ++ ) { + + const morphTarget = morphTargets[ i ]; + const morphNormal = morphNormals[ i ]; + + const offset = width * height * 4 * i; + + for ( let j = 0; j < morphTarget.count; j ++ ) { + + morph.fromBufferAttribute( morphTarget, j ); + + if ( morphTarget.normalized === true ) denormalize( morph, morphTarget ); + + const stride = j * vertexDataStride; + + buffer[ offset + stride + 0 ] = morph.x; + buffer[ offset + stride + 1 ] = morph.y; + buffer[ offset + stride + 2 ] = morph.z; + buffer[ offset + stride + 3 ] = 0; + + if ( hasMorphNormals === true ) { + + morph.fromBufferAttribute( morphNormal, j ); + + if ( morphNormal.normalized === true ) denormalize( morph, morphNormal ); + + buffer[ offset + stride + 4 ] = morph.x; + buffer[ offset + stride + 5 ] = morph.y; + buffer[ offset + stride + 6 ] = morph.z; + buffer[ offset + stride + 7 ] = 0; + + } + + } + + } + + entry = { + count: numberOfMorphTargets, + texture: texture, + size: new Vector2( width, height ) + }; + + morphTextures.set( geometry, entry ); + + function disposeTexture() { + + texture.dispose(); + + morphTextures.delete( geometry ); + + geometry.removeEventListener( 'dispose', disposeTexture ); + + } + + geometry.addEventListener( 'dispose', disposeTexture ); + + } + + // + + let morphInfluencesSum = 0; + + for ( let i = 0; i < objectInfluences.length; i ++ ) { + + morphInfluencesSum += objectInfluences[ i ]; + + } + + const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; + + program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence ); + program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences ); + + program.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures ); + program.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size ); + + + } else { + + // When object doesn't have morph target influences defined, we treat it as a 0-length array + // This is important to make sure we set up morphTargetBaseInfluence / morphTargetInfluences + + const length = objectInfluences === undefined ? 0 : objectInfluences.length; + + let influences = influencesList[ geometry.id ]; + + if ( influences === undefined || influences.length !== length ) { + + // initialise list + + influences = []; + + for ( let i = 0; i < length; i ++ ) { + + influences[ i ] = [ i, 0 ]; + + } + + influencesList[ geometry.id ] = influences; + + } + + // Collect influences + + for ( let i = 0; i < length; i ++ ) { + + const influence = influences[ i ]; + + influence[ 0 ] = i; + influence[ 1 ] = objectInfluences[ i ]; + + } + + influences.sort( absNumericalSort ); + + for ( let i = 0; i < 8; i ++ ) { + + if ( i < length && influences[ i ][ 1 ] ) { + + workInfluences[ i ][ 0 ] = influences[ i ][ 0 ]; + workInfluences[ i ][ 1 ] = influences[ i ][ 1 ]; + + } else { + + workInfluences[ i ][ 0 ] = Number.MAX_SAFE_INTEGER; + workInfluences[ i ][ 1 ] = 0; + + } + + } + + workInfluences.sort( numericalSort ); + + const morphTargets = geometry.morphAttributes.position; + const morphNormals = geometry.morphAttributes.normal; + + let morphInfluencesSum = 0; + + for ( let i = 0; i < 8; i ++ ) { + + const influence = workInfluences[ i ]; + const index = influence[ 0 ]; + const value = influence[ 1 ]; + + if ( index !== Number.MAX_SAFE_INTEGER && value ) { + + if ( morphTargets && geometry.getAttribute( 'morphTarget' + i ) !== morphTargets[ index ] ) { + + geometry.setAttribute( 'morphTarget' + i, morphTargets[ index ] ); + + } + + if ( morphNormals && geometry.getAttribute( 'morphNormal' + i ) !== morphNormals[ index ] ) { + + geometry.setAttribute( 'morphNormal' + i, morphNormals[ index ] ); + + } + + morphInfluences[ i ] = value; + morphInfluencesSum += value; + + } else { + + if ( morphTargets && geometry.hasAttribute( 'morphTarget' + i ) === true ) { + + geometry.deleteAttribute( 'morphTarget' + i ); + + } + + if ( morphNormals && geometry.hasAttribute( 'morphNormal' + i ) === true ) { + + geometry.deleteAttribute( 'morphNormal' + i ); + + } + + morphInfluences[ i ] = 0; + + } + + } + + // GLSL shader uses formula baseinfluence * base + sum(target * influence) + // This allows us to switch between absolute morphs and relative morphs without changing shader code + // When baseinfluence = 1 - sum(influence), the above is equivalent to sum((target - base) * influence) + const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; + + program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence ); + program.getUniforms().setValue( gl, 'morphTargetInfluences', morphInfluences ); + + } + + } + + return { + + update: update + + }; + +} + +function WebGLObjects( gl, geometries, attributes, info ) { + + let updateMap = new WeakMap(); + + function update( object ) { + + const frame = info.render.frame; + + const geometry = object.geometry; + const buffergeometry = geometries.get( object, geometry ); + + // Update once per frame + + if ( updateMap.get( buffergeometry ) !== frame ) { + + geometries.update( buffergeometry ); + + updateMap.set( buffergeometry, frame ); + + } + + if ( object.isInstancedMesh ) { + + if ( object.hasEventListener( 'dispose', onInstancedMeshDispose ) === false ) { + + object.addEventListener( 'dispose', onInstancedMeshDispose ); + + } + + attributes.update( object.instanceMatrix, 34962 ); + + if ( object.instanceColor !== null ) { + + attributes.update( object.instanceColor, 34962 ); + + } + + } + + return buffergeometry; + + } + + function dispose() { + + updateMap = new WeakMap(); + + } + + function onInstancedMeshDispose( event ) { + + const instancedMesh = event.target; + + instancedMesh.removeEventListener( 'dispose', onInstancedMeshDispose ); + + attributes.remove( instancedMesh.instanceMatrix ); + + if ( instancedMesh.instanceColor !== null ) attributes.remove( instancedMesh.instanceColor ); + + } + + return { + + update: update, + dispose: dispose + + }; + +} + +class DataTexture3D extends Texture { + + constructor( data = null, width = 1, height = 1, depth = 1 ) { + + // We're going to add .setXXX() methods for setting properties later. + // Users can still set in DataTexture3D directly. + // + // const texture = new THREE.DataTexture3D( data, width, height, depth ); + // texture.anisotropy = 16; + // + // See #14839 + + super( null ); + + this.image = { data, width, height, depth }; + + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; + + this.wrapR = ClampToEdgeWrapping; + + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; + + } + +} + +DataTexture3D.prototype.isDataTexture3D = true; + +/** + * Uniforms of a program. + * Those form a tree structure with a special top-level container for the root, + * which you get by calling 'new WebGLUniforms( gl, program )'. + * + * + * Properties of inner nodes including the top-level container: + * + * .seq - array of nested uniforms + * .map - nested uniforms by name + * + * + * Methods of all nodes except the top-level container: + * + * .setValue( gl, value, [textures] ) + * + * uploads a uniform value(s) + * the 'textures' parameter is needed for sampler uniforms + * + * + * Static methods of the top-level container (textures factorizations): + * + * .upload( gl, seq, values, textures ) + * + * sets uniforms in 'seq' to 'values[id].value' + * + * .seqWithValue( seq, values ) : filteredSeq + * + * filters 'seq' entries with corresponding entry in values + * + * + * Methods of the top-level container (textures factorizations): + * + * .setValue( gl, name, value, textures ) + * + * sets uniform with name 'name' to 'value' + * + * .setOptional( gl, obj, prop ) + * + * like .set for an optional property of the object + * + */ + +const emptyTexture = new Texture(); +const emptyTexture2dArray = new DataTexture2DArray(); +const emptyTexture3d = new DataTexture3D(); +const emptyCubeTexture = new CubeTexture(); + +// --- Utilities --- + +// Array Caches (provide typed arrays for temporary by size) + +const arrayCacheF32 = []; +const arrayCacheI32 = []; + +// Float32Array caches used for uploading Matrix uniforms + +const mat4array = new Float32Array( 16 ); +const mat3array = new Float32Array( 9 ); +const mat2array = new Float32Array( 4 ); + +// Flattening for arrays of vectors and matrices + +function flatten( array, nBlocks, blockSize ) { + + const firstElem = array[ 0 ]; + + if ( firstElem <= 0 || firstElem > 0 ) return array; + // unoptimized: ! isNaN( firstElem ) + // see http://jacksondunstan.com/articles/983 + + const n = nBlocks * blockSize; + let r = arrayCacheF32[ n ]; + + if ( r === undefined ) { + + r = new Float32Array( n ); + arrayCacheF32[ n ] = r; + + } + + if ( nBlocks !== 0 ) { + + firstElem.toArray( r, 0 ); + + for ( let i = 1, offset = 0; i !== nBlocks; ++ i ) { + + offset += blockSize; + array[ i ].toArray( r, offset ); + + } + + } + + return r; + +} + +function arraysEqual( a, b ) { + + if ( a.length !== b.length ) return false; + + for ( let i = 0, l = a.length; i < l; i ++ ) { + + if ( a[ i ] !== b[ i ] ) return false; + + } + + return true; + +} + +function copyArray( a, b ) { + + for ( let i = 0, l = b.length; i < l; i ++ ) { + + a[ i ] = b[ i ]; + + } + +} + +// Texture unit allocation + +function allocTexUnits( textures, n ) { + + let r = arrayCacheI32[ n ]; + + if ( r === undefined ) { + + r = new Int32Array( n ); + arrayCacheI32[ n ] = r; + + } + + for ( let i = 0; i !== n; ++ i ) { + + r[ i ] = textures.allocateTextureUnit(); + + } + + return r; + +} + +// --- Setters --- + +// Note: Defining these methods externally, because they come in a bunch +// and this way their names minify. + +// Single scalar + +function setValueV1f( gl, v ) { + + const cache = this.cache; + + if ( cache[ 0 ] === v ) return; + + gl.uniform1f( this.addr, v ); + + cache[ 0 ] = v; + +} + +// Single float vector (from flat array or THREE.VectorN) + +function setValueV2f( gl, v ) { + + const cache = this.cache; + + if ( v.x !== undefined ) { + + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) { + + gl.uniform2f( this.addr, v.x, v.y ); + + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + + } + + } else { + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform2fv( this.addr, v ); + + copyArray( cache, v ); + + } + +} + +function setValueV3f( gl, v ) { + + const cache = this.cache; + + if ( v.x !== undefined ) { + + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) { + + gl.uniform3f( this.addr, v.x, v.y, v.z ); + + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; + + } + + } else if ( v.r !== undefined ) { + + if ( cache[ 0 ] !== v.r || cache[ 1 ] !== v.g || cache[ 2 ] !== v.b ) { + + gl.uniform3f( this.addr, v.r, v.g, v.b ); + + cache[ 0 ] = v.r; + cache[ 1 ] = v.g; + cache[ 2 ] = v.b; + + } + + } else { + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform3fv( this.addr, v ); + + copyArray( cache, v ); + + } + +} + +function setValueV4f( gl, v ) { + + const cache = this.cache; + + if ( v.x !== undefined ) { + + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) { + + gl.uniform4f( this.addr, v.x, v.y, v.z, v.w ); + + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; + cache[ 3 ] = v.w; + + } + + } else { + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform4fv( this.addr, v ); + + copyArray( cache, v ); + + } + +} + +// Single matrix (from flat array or THREE.MatrixN) + +function setValueM2( gl, v ) { + + const cache = this.cache; + const elements = v.elements; + + if ( elements === undefined ) { + + if ( arraysEqual( cache, v ) ) return; + + gl.uniformMatrix2fv( this.addr, false, v ); + + copyArray( cache, v ); + + } else { + + if ( arraysEqual( cache, elements ) ) return; + + mat2array.set( elements ); + + gl.uniformMatrix2fv( this.addr, false, mat2array ); + + copyArray( cache, elements ); + + } + +} + +function setValueM3( gl, v ) { + + const cache = this.cache; + const elements = v.elements; + + if ( elements === undefined ) { + + if ( arraysEqual( cache, v ) ) return; + + gl.uniformMatrix3fv( this.addr, false, v ); + + copyArray( cache, v ); + + } else { + + if ( arraysEqual( cache, elements ) ) return; + + mat3array.set( elements ); + + gl.uniformMatrix3fv( this.addr, false, mat3array ); + + copyArray( cache, elements ); + + } + +} + +function setValueM4( gl, v ) { + + const cache = this.cache; + const elements = v.elements; + + if ( elements === undefined ) { + + if ( arraysEqual( cache, v ) ) return; + + gl.uniformMatrix4fv( this.addr, false, v ); + + copyArray( cache, v ); + + } else { + + if ( arraysEqual( cache, elements ) ) return; + + mat4array.set( elements ); + + gl.uniformMatrix4fv( this.addr, false, mat4array ); + + copyArray( cache, elements ); + + } + +} + +// Single integer / boolean + +function setValueV1i( gl, v ) { + + const cache = this.cache; + + if ( cache[ 0 ] === v ) return; + + gl.uniform1i( this.addr, v ); + + cache[ 0 ] = v; + +} + +// Single integer / boolean vector (from flat array) + +function setValueV2i( gl, v ) { + + const cache = this.cache; + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform2iv( this.addr, v ); + + copyArray( cache, v ); + +} + +function setValueV3i( gl, v ) { + + const cache = this.cache; + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform3iv( this.addr, v ); + + copyArray( cache, v ); + +} + +function setValueV4i( gl, v ) { + + const cache = this.cache; + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform4iv( this.addr, v ); + + copyArray( cache, v ); + +} + +// Single unsigned integer + +function setValueV1ui( gl, v ) { + + const cache = this.cache; + + if ( cache[ 0 ] === v ) return; + + gl.uniform1ui( this.addr, v ); + + cache[ 0 ] = v; + +} + +// Single unsigned integer vector (from flat array) + +function setValueV2ui( gl, v ) { + + const cache = this.cache; + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform2uiv( this.addr, v ); + + copyArray( cache, v ); + +} + +function setValueV3ui( gl, v ) { + + const cache = this.cache; + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform3uiv( this.addr, v ); + + copyArray( cache, v ); + +} + +function setValueV4ui( gl, v ) { + + const cache = this.cache; + + if ( arraysEqual( cache, v ) ) return; + + gl.uniform4uiv( this.addr, v ); + + copyArray( cache, v ); + +} + + +// Single texture (2D / Cube) + +function setValueT1( gl, v, textures ) { + + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + + if ( cache[ 0 ] !== unit ) { + + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; + + } + + textures.safeSetTexture2D( v || emptyTexture, unit ); + +} + +function setValueT3D1( gl, v, textures ) { + + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + + if ( cache[ 0 ] !== unit ) { + + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; + + } + + textures.setTexture3D( v || emptyTexture3d, unit ); + +} + +function setValueT6( gl, v, textures ) { + + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + + if ( cache[ 0 ] !== unit ) { + + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; + + } + + textures.safeSetTextureCube( v || emptyCubeTexture, unit ); + +} + +function setValueT2DArray1( gl, v, textures ) { + + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + + if ( cache[ 0 ] !== unit ) { + + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; + + } + + textures.setTexture2DArray( v || emptyTexture2dArray, unit ); + +} + +// Helper to pick the right setter for the singular case + +function getSingularSetter( type ) { + + switch ( type ) { + + case 0x1406: return setValueV1f; // FLOAT + case 0x8b50: return setValueV2f; // _VEC2 + case 0x8b51: return setValueV3f; // _VEC3 + case 0x8b52: return setValueV4f; // _VEC4 + + case 0x8b5a: return setValueM2; // _MAT2 + case 0x8b5b: return setValueM3; // _MAT3 + case 0x8b5c: return setValueM4; // _MAT4 + + case 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL + case 0x8b53: case 0x8b57: return setValueV2i; // _VEC2 + case 0x8b54: case 0x8b58: return setValueV3i; // _VEC3 + case 0x8b55: case 0x8b59: return setValueV4i; // _VEC4 + + case 0x1405: return setValueV1ui; // UINT + case 0x8dc6: return setValueV2ui; // _VEC2 + case 0x8dc7: return setValueV3ui; // _VEC3 + case 0x8dc8: return setValueV4ui; // _VEC4 + + case 0x8b5e: // SAMPLER_2D + case 0x8d66: // SAMPLER_EXTERNAL_OES + case 0x8dca: // INT_SAMPLER_2D + case 0x8dd2: // UNSIGNED_INT_SAMPLER_2D + case 0x8b62: // SAMPLER_2D_SHADOW + return setValueT1; + + case 0x8b5f: // SAMPLER_3D + case 0x8dcb: // INT_SAMPLER_3D + case 0x8dd3: // UNSIGNED_INT_SAMPLER_3D + return setValueT3D1; + + case 0x8b60: // SAMPLER_CUBE + case 0x8dcc: // INT_SAMPLER_CUBE + case 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE + case 0x8dc5: // SAMPLER_CUBE_SHADOW + return setValueT6; + + case 0x8dc1: // SAMPLER_2D_ARRAY + case 0x8dcf: // INT_SAMPLER_2D_ARRAY + case 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY + case 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW + return setValueT2DArray1; + + } + +} + + +// Array of scalars + +function setValueV1fArray( gl, v ) { + + gl.uniform1fv( this.addr, v ); + +} + +// Array of vectors (from flat array or array of THREE.VectorN) + +function setValueV2fArray( gl, v ) { + + const data = flatten( v, this.size, 2 ); + + gl.uniform2fv( this.addr, data ); + +} + +function setValueV3fArray( gl, v ) { + + const data = flatten( v, this.size, 3 ); + + gl.uniform3fv( this.addr, data ); + +} + +function setValueV4fArray( gl, v ) { + + const data = flatten( v, this.size, 4 ); + + gl.uniform4fv( this.addr, data ); + +} + +// Array of matrices (from flat array or array of THREE.MatrixN) + +function setValueM2Array( gl, v ) { + + const data = flatten( v, this.size, 4 ); + + gl.uniformMatrix2fv( this.addr, false, data ); + +} + +function setValueM3Array( gl, v ) { + + const data = flatten( v, this.size, 9 ); + + gl.uniformMatrix3fv( this.addr, false, data ); + +} + +function setValueM4Array( gl, v ) { + + const data = flatten( v, this.size, 16 ); + + gl.uniformMatrix4fv( this.addr, false, data ); + +} + +// Array of integer / boolean + +function setValueV1iArray( gl, v ) { + + gl.uniform1iv( this.addr, v ); + +} + +// Array of integer / boolean vectors (from flat array) + +function setValueV2iArray( gl, v ) { + + gl.uniform2iv( this.addr, v ); + +} + +function setValueV3iArray( gl, v ) { + + gl.uniform3iv( this.addr, v ); + +} + +function setValueV4iArray( gl, v ) { + + gl.uniform4iv( this.addr, v ); + +} + +// Array of unsigned integer + +function setValueV1uiArray( gl, v ) { + + gl.uniform1uiv( this.addr, v ); + +} + +// Array of unsigned integer vectors (from flat array) + +function setValueV2uiArray( gl, v ) { + + gl.uniform2uiv( this.addr, v ); + +} + +function setValueV3uiArray( gl, v ) { + + gl.uniform3uiv( this.addr, v ); + +} + +function setValueV4uiArray( gl, v ) { + + gl.uniform4uiv( this.addr, v ); + +} + + +// Array of textures (2D / 3D / Cube / 2DArray) + +function setValueT1Array( gl, v, textures ) { + + const n = v.length; + + const units = allocTexUnits( textures, n ); + + gl.uniform1iv( this.addr, units ); + + for ( let i = 0; i !== n; ++ i ) { + + textures.safeSetTexture2D( v[ i ] || emptyTexture, units[ i ] ); + + } + +} + +function setValueT3DArray( gl, v, textures ) { + + const n = v.length; + + const units = allocTexUnits( textures, n ); + + gl.uniform1iv( this.addr, units ); + + for ( let i = 0; i !== n; ++ i ) { + + textures.setTexture3D( v[ i ] || emptyTexture3d, units[ i ] ); + + } + +} + +function setValueT6Array( gl, v, textures ) { + + const n = v.length; + + const units = allocTexUnits( textures, n ); + + gl.uniform1iv( this.addr, units ); + + for ( let i = 0; i !== n; ++ i ) { + + textures.safeSetTextureCube( v[ i ] || emptyCubeTexture, units[ i ] ); + + } + +} + +function setValueT2DArrayArray( gl, v, textures ) { + + const n = v.length; + + const units = allocTexUnits( textures, n ); + + gl.uniform1iv( this.addr, units ); + + for ( let i = 0; i !== n; ++ i ) { + + textures.setTexture2DArray( v[ i ] || emptyTexture2dArray, units[ i ] ); + + } + +} + + +// Helper to pick the right setter for a pure (bottom-level) array + +function getPureArraySetter( type ) { + + switch ( type ) { + + case 0x1406: return setValueV1fArray; // FLOAT + case 0x8b50: return setValueV2fArray; // _VEC2 + case 0x8b51: return setValueV3fArray; // _VEC3 + case 0x8b52: return setValueV4fArray; // _VEC4 + + case 0x8b5a: return setValueM2Array; // _MAT2 + case 0x8b5b: return setValueM3Array; // _MAT3 + case 0x8b5c: return setValueM4Array; // _MAT4 + + case 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL + case 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2 + case 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3 + case 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4 + + case 0x1405: return setValueV1uiArray; // UINT + case 0x8dc6: return setValueV2uiArray; // _VEC2 + case 0x8dc7: return setValueV3uiArray; // _VEC3 + case 0x8dc8: return setValueV4uiArray; // _VEC4 + + case 0x8b5e: // SAMPLER_2D + case 0x8d66: // SAMPLER_EXTERNAL_OES + case 0x8dca: // INT_SAMPLER_2D + case 0x8dd2: // UNSIGNED_INT_SAMPLER_2D + case 0x8b62: // SAMPLER_2D_SHADOW + return setValueT1Array; + + case 0x8b5f: // SAMPLER_3D + case 0x8dcb: // INT_SAMPLER_3D + case 0x8dd3: // UNSIGNED_INT_SAMPLER_3D + return setValueT3DArray; + + case 0x8b60: // SAMPLER_CUBE + case 0x8dcc: // INT_SAMPLER_CUBE + case 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE + case 0x8dc5: // SAMPLER_CUBE_SHADOW + return setValueT6Array; + + case 0x8dc1: // SAMPLER_2D_ARRAY + case 0x8dcf: // INT_SAMPLER_2D_ARRAY + case 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY + case 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW + return setValueT2DArrayArray; + + } + +} + +// --- Uniform Classes --- + +function SingleUniform( id, activeInfo, addr ) { + + this.id = id; + this.addr = addr; + this.cache = []; + this.setValue = getSingularSetter( activeInfo.type ); + + // this.path = activeInfo.name; // DEBUG + +} + +function PureArrayUniform( id, activeInfo, addr ) { + + this.id = id; + this.addr = addr; + this.cache = []; + this.size = activeInfo.size; + this.setValue = getPureArraySetter( activeInfo.type ); + + // this.path = activeInfo.name; // DEBUG + +} + +PureArrayUniform.prototype.updateCache = function ( data ) { + + const cache = this.cache; + + if ( data instanceof Float32Array && cache.length !== data.length ) { + + this.cache = new Float32Array( data.length ); + + } + + copyArray( cache, data ); + +}; + +function StructuredUniform( id ) { + + this.id = id; + + this.seq = []; + this.map = {}; + +} + +StructuredUniform.prototype.setValue = function ( gl, value, textures ) { + + const seq = this.seq; + + for ( let i = 0, n = seq.length; i !== n; ++ i ) { + + const u = seq[ i ]; + u.setValue( gl, value[ u.id ], textures ); + + } + +}; + +// --- Top-level --- + +// Parser - builds up the property tree from the path strings + +const RePathPart = /(\w+)(\])?(\[|\.)?/g; + +// extracts +// - the identifier (member name or array index) +// - followed by an optional right bracket (found when array index) +// - followed by an optional left bracket or dot (type of subscript) +// +// Note: These portions can be read in a non-overlapping fashion and +// allow straightforward parsing of the hierarchy that WebGL encodes +// in the uniform names. + +function addUniform( container, uniformObject ) { + + container.seq.push( uniformObject ); + container.map[ uniformObject.id ] = uniformObject; + +} + +function parseUniform( activeInfo, addr, container ) { + + const path = activeInfo.name, + pathLength = path.length; + + // reset RegExp object, because of the early exit of a previous run + RePathPart.lastIndex = 0; + + while ( true ) { + + const match = RePathPart.exec( path ), + matchEnd = RePathPart.lastIndex; + + let id = match[ 1 ]; + const idIsIndex = match[ 2 ] === ']', + subscript = match[ 3 ]; + + if ( idIsIndex ) id = id | 0; // convert to integer + + if ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) { + + // bare name or "pure" bottom-level array "[0]" suffix + + addUniform( container, subscript === undefined ? + new SingleUniform( id, activeInfo, addr ) : + new PureArrayUniform( id, activeInfo, addr ) ); + + break; + + } else { + + // step into inner node / create it in case it doesn't exist + + const map = container.map; + let next = map[ id ]; + + if ( next === undefined ) { + + next = new StructuredUniform( id ); + addUniform( container, next ); + + } + + container = next; + + } + + } + +} + +// Root Container + +function WebGLUniforms( gl, program ) { + + this.seq = []; + this.map = {}; + + const n = gl.getProgramParameter( program, 35718 ); + + for ( let i = 0; i < n; ++ i ) { + + const info = gl.getActiveUniform( program, i ), + addr = gl.getUniformLocation( program, info.name ); + + parseUniform( info, addr, this ); + + } + +} + +WebGLUniforms.prototype.setValue = function ( gl, name, value, textures ) { + + const u = this.map[ name ]; + + if ( u !== undefined ) u.setValue( gl, value, textures ); + +}; + +WebGLUniforms.prototype.setOptional = function ( gl, object, name ) { + + const v = object[ name ]; + + if ( v !== undefined ) this.setValue( gl, name, v ); + +}; + + +// Static interface + +WebGLUniforms.upload = function ( gl, seq, values, textures ) { + + for ( let i = 0, n = seq.length; i !== n; ++ i ) { + + const u = seq[ i ], + v = values[ u.id ]; + + if ( v.needsUpdate !== false ) { + + // note: always updating when .needsUpdate is undefined + u.setValue( gl, v.value, textures ); + + } + + } + +}; + +WebGLUniforms.seqWithValue = function ( seq, values ) { + + const r = []; + + for ( let i = 0, n = seq.length; i !== n; ++ i ) { + + const u = seq[ i ]; + if ( u.id in values ) r.push( u ); + + } + + return r; + +}; + +function WebGLShader( gl, type, string ) { + + const shader = gl.createShader( type ); + + gl.shaderSource( shader, string ); + gl.compileShader( shader ); + + return shader; + +} + +let programIdCount = 0; + +function addLineNumbers( string ) { + + const lines = string.split( '\n' ); + + for ( let i = 0; i < lines.length; i ++ ) { + + lines[ i ] = ( i + 1 ) + ': ' + lines[ i ]; + + } + + return lines.join( '\n' ); + +} + +function getEncodingComponents( encoding ) { + + switch ( encoding ) { + + case LinearEncoding: + return [ 'Linear', '( value )' ]; + case sRGBEncoding: + return [ 'sRGB', '( value )' ]; + default: + console.warn( 'THREE.WebGLProgram: Unsupported encoding:', encoding ); + return [ 'Linear', '( value )' ]; + + } + +} + +function getShaderErrors( gl, shader, type ) { + + const status = gl.getShaderParameter( shader, 35713 ); + const errors = gl.getShaderInfoLog( shader ).trim(); + + if ( status && errors === '' ) return ''; + + // --enable-privileged-webgl-extension + // console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) ); + + return type.toUpperCase() + '\n\n' + errors + '\n\n' + addLineNumbers( gl.getShaderSource( shader ) ); + +} + +function getTexelEncodingFunction( functionName, encoding ) { + + const components = getEncodingComponents( encoding ); + return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }'; + +} + +function getToneMappingFunction( functionName, toneMapping ) { + + let toneMappingName; + + switch ( toneMapping ) { + + case LinearToneMapping: + toneMappingName = 'Linear'; + break; + + case ReinhardToneMapping: + toneMappingName = 'Reinhard'; + break; + + case CineonToneMapping: + toneMappingName = 'OptimizedCineon'; + break; + + case ACESFilmicToneMapping: + toneMappingName = 'ACESFilmic'; + break; + + case CustomToneMapping: + toneMappingName = 'Custom'; + break; + + default: + console.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping ); + toneMappingName = 'Linear'; + + } + + return 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }'; + +} + +function generateExtensions( parameters ) { + + const chunks = [ + ( parameters.extensionDerivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === 'physical' ) ? '#extension GL_OES_standard_derivatives : enable' : '', + ( parameters.extensionFragDepth || parameters.logarithmicDepthBuffer ) && parameters.rendererExtensionFragDepth ? '#extension GL_EXT_frag_depth : enable' : '', + ( parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ) ? '#extension GL_EXT_draw_buffers : require' : '', + ( parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission ) && parameters.rendererExtensionShaderTextureLod ? '#extension GL_EXT_shader_texture_lod : enable' : '' + ]; + + return chunks.filter( filterEmptyLine ).join( '\n' ); + +} + +function generateDefines( defines ) { + + const chunks = []; + + for ( const name in defines ) { + + const value = defines[ name ]; + + if ( value === false ) continue; + + chunks.push( '#define ' + name + ' ' + value ); + + } + + return chunks.join( '\n' ); + +} + +function fetchAttributeLocations( gl, program ) { + + const attributes = {}; + + const n = gl.getProgramParameter( program, 35721 ); + + for ( let i = 0; i < n; i ++ ) { + + const info = gl.getActiveAttrib( program, i ); + const name = info.name; + + let locationSize = 1; + if ( info.type === 35674 ) locationSize = 2; + if ( info.type === 35675 ) locationSize = 3; + if ( info.type === 35676 ) locationSize = 4; + + // console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i ); + + attributes[ name ] = { + type: info.type, + location: gl.getAttribLocation( program, name ), + locationSize: locationSize + }; + + } + + return attributes; + +} + +function filterEmptyLine( string ) { + + return string !== ''; + +} + +function replaceLightNums( string, parameters ) { + + return string + .replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights ) + .replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights ) + .replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights ) + .replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights ) + .replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights ) + .replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows ) + .replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows ) + .replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows ); + +} + +function replaceClippingPlaneNums( string, parameters ) { + + return string + .replace( /NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes ) + .replace( /UNION_CLIPPING_PLANES/g, ( parameters.numClippingPlanes - parameters.numClipIntersection ) ); + +} + +// Resolve Includes + +const includePattern = /^[ \t]*#include +<([\w\d./]+)>/gm; + +function resolveIncludes( string ) { + + return string.replace( includePattern, includeReplacer ); + +} + +function includeReplacer( match, include ) { + + const string = ShaderChunk[ include ]; + + if ( string === undefined ) { + + throw new Error( 'Can not resolve #include <' + include + '>' ); + + } + + return resolveIncludes( string ); + +} + +// Unroll Loops + +const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; +const unrollLoopPattern = /#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( string ) { + + return string + .replace( unrollLoopPattern, loopReplacer ) + .replace( deprecatedUnrollLoopPattern, deprecatedLoopReplacer ); + +} + +function deprecatedLoopReplacer( match, start, end, snippet ) { + + console.warn( 'WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.' ); + return loopReplacer( match, start, end, snippet ); + +} + +function loopReplacer( match, start, end, snippet ) { + + let string = ''; + + for ( let i = parseInt( start ); i < parseInt( end ); i ++ ) { + + string += snippet + .replace( /\[\s*i\s*\]/g, '[ ' + i + ' ]' ) + .replace( /UNROLLED_LOOP_INDEX/g, i ); + + } + + return string; + +} + +// + +function generatePrecision( parameters ) { + + let precisionstring = 'precision ' + parameters.precision + ' float;\nprecision ' + parameters.precision + ' int;'; + + if ( parameters.precision === 'highp' ) { + + precisionstring += '\n#define HIGH_PRECISION'; + + } else if ( parameters.precision === 'mediump' ) { + + precisionstring += '\n#define MEDIUM_PRECISION'; + + } else if ( parameters.precision === 'lowp' ) { + + precisionstring += '\n#define LOW_PRECISION'; + + } + + return precisionstring; + +} + +function generateShadowMapTypeDefine( parameters ) { + + let shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC'; + + if ( parameters.shadowMapType === PCFShadowMap ) { + + shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF'; + + } else if ( parameters.shadowMapType === PCFSoftShadowMap ) { + + shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT'; + + } else if ( parameters.shadowMapType === VSMShadowMap ) { + + shadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM'; + + } + + return shadowMapTypeDefine; + +} + +function generateEnvMapTypeDefine( parameters ) { + + let envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; + + if ( parameters.envMap ) { + + switch ( parameters.envMapMode ) { + + case CubeReflectionMapping: + case CubeRefractionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; + break; + + case CubeUVReflectionMapping: + case CubeUVRefractionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV'; + break; + + } + + } + + return envMapTypeDefine; + +} + +function generateEnvMapModeDefine( parameters ) { + + let envMapModeDefine = 'ENVMAP_MODE_REFLECTION'; + + if ( parameters.envMap ) { + + switch ( parameters.envMapMode ) { + + case CubeRefractionMapping: + case CubeUVRefractionMapping: + + envMapModeDefine = 'ENVMAP_MODE_REFRACTION'; + break; + + } + + } + + return envMapModeDefine; + +} + +function generateEnvMapBlendingDefine( parameters ) { + + let envMapBlendingDefine = 'ENVMAP_BLENDING_NONE'; + + if ( parameters.envMap ) { + + switch ( parameters.combine ) { + + case MultiplyOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; + break; + + case MixOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_MIX'; + break; + + case AddOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_ADD'; + break; + + } + + } + + return envMapBlendingDefine; + +} + +function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { + + // TODO Send this event to Three.js DevTools + // console.log( 'WebGLProgram', cacheKey ); + + const gl = renderer.getContext(); + + const defines = parameters.defines; + + let vertexShader = parameters.vertexShader; + let fragmentShader = parameters.fragmentShader; + + const shadowMapTypeDefine = generateShadowMapTypeDefine( parameters ); + const envMapTypeDefine = generateEnvMapTypeDefine( parameters ); + const envMapModeDefine = generateEnvMapModeDefine( parameters ); + const envMapBlendingDefine = generateEnvMapBlendingDefine( parameters ); + + const customExtensions = parameters.isWebGL2 ? '' : generateExtensions( parameters ); + + const customDefines = generateDefines( defines ); + + const program = gl.createProgram(); + + let prefixVertex, prefixFragment; + let versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\n' : ''; + + if ( parameters.isRawShaderMaterial ) { + + prefixVertex = [ + + customDefines + + ].filter( filterEmptyLine ).join( '\n' ); + + if ( prefixVertex.length > 0 ) { + + prefixVertex += '\n'; + + } + + prefixFragment = [ + + customExtensions, + customDefines + + ].filter( filterEmptyLine ).join( '\n' ); + + if ( prefixFragment.length > 0 ) { + + prefixFragment += '\n'; + + } + + } else { + + prefixVertex = [ + + generatePrecision( parameters ), + + '#define SHADER_NAME ' + parameters.shaderName, + + customDefines, + + parameters.instancing ? '#define USE_INSTANCING' : '', + parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '', + + parameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '', + + '#define MAX_BONES ' + parameters.maxBones, + ( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '', + ( parameters.useFog && parameters.fogExp2 ) ? '#define FOG_EXP2' : '', + + parameters.map ? '#define USE_MAP' : '', + parameters.envMap ? '#define USE_ENVMAP' : '', + parameters.envMap ? '#define ' + envMapModeDefine : '', + parameters.lightMap ? '#define USE_LIGHTMAP' : '', + parameters.aoMap ? '#define USE_AOMAP' : '', + parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', + parameters.bumpMap ? '#define USE_BUMPMAP' : '', + parameters.normalMap ? '#define USE_NORMALMAP' : '', + ( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '', + ( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '', + + parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', + parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', + parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', + + parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '', + + parameters.specularMap ? '#define USE_SPECULARMAP' : '', + parameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '', + parameters.specularColorMap ? '#define USE_SPECULARCOLORMAP' : '', + + parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', + parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', + parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + + parameters.transmission ? '#define USE_TRANSMISSION' : '', + parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', + parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', + + parameters.sheenColorMap ? '#define USE_SHEENCOLORMAP' : '', + parameters.sheenRoughnessMap ? '#define USE_SHEENROUGHNESSMAP' : '', + + parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexColors ? '#define USE_COLOR' : '', + parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', + parameters.vertexUvs ? '#define USE_UV' : '', + parameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '', + + parameters.flatShading ? '#define FLAT_SHADED' : '', + + parameters.skinning ? '#define USE_SKINNING' : '', + parameters.useVertexTexture ? '#define BONE_TEXTURE' : '', + + parameters.morphTargets ? '#define USE_MORPHTARGETS' : '', + parameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '', + ( parameters.morphTargets && parameters.isWebGL2 ) ? '#define MORPHTARGETS_TEXTURE' : '', + ( parameters.morphTargets && parameters.isWebGL2 ) ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '', + parameters.doubleSided ? '#define DOUBLE_SIDED' : '', + parameters.flipSided ? '#define FLIP_SIDED' : '', + + parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', + parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', + + parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', + + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', + ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '', + + 'uniform mat4 modelMatrix;', + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform mat4 viewMatrix;', + 'uniform mat3 normalMatrix;', + 'uniform vec3 cameraPosition;', + 'uniform bool isOrthographic;', + + '#ifdef USE_INSTANCING', + + ' attribute mat4 instanceMatrix;', + + '#endif', + + '#ifdef USE_INSTANCING_COLOR', + + ' attribute vec3 instanceColor;', + + '#endif', + + 'attribute vec3 position;', + 'attribute vec3 normal;', + 'attribute vec2 uv;', + + '#ifdef USE_TANGENT', + + ' attribute vec4 tangent;', + + '#endif', + + '#if defined( USE_COLOR_ALPHA )', + + ' attribute vec4 color;', + + '#elif defined( USE_COLOR )', + + ' attribute vec3 color;', + + '#endif', + + '#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )', + + ' attribute vec3 morphTarget0;', + ' attribute vec3 morphTarget1;', + ' attribute vec3 morphTarget2;', + ' attribute vec3 morphTarget3;', + + ' #ifdef USE_MORPHNORMALS', + + ' attribute vec3 morphNormal0;', + ' attribute vec3 morphNormal1;', + ' attribute vec3 morphNormal2;', + ' attribute vec3 morphNormal3;', + + ' #else', + + ' attribute vec3 morphTarget4;', + ' attribute vec3 morphTarget5;', + ' attribute vec3 morphTarget6;', + ' attribute vec3 morphTarget7;', + + ' #endif', + + '#endif', + + '#ifdef USE_SKINNING', + + ' attribute vec4 skinIndex;', + ' attribute vec4 skinWeight;', + + '#endif', + + '\n' + + ].filter( filterEmptyLine ).join( '\n' ); + + prefixFragment = [ + + customExtensions, + + generatePrecision( parameters ), + + '#define SHADER_NAME ' + parameters.shaderName, + + customDefines, + + ( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '', + ( parameters.useFog && parameters.fogExp2 ) ? '#define FOG_EXP2' : '', + + parameters.map ? '#define USE_MAP' : '', + parameters.matcap ? '#define USE_MATCAP' : '', + parameters.envMap ? '#define USE_ENVMAP' : '', + parameters.envMap ? '#define ' + envMapTypeDefine : '', + parameters.envMap ? '#define ' + envMapModeDefine : '', + parameters.envMap ? '#define ' + envMapBlendingDefine : '', + parameters.lightMap ? '#define USE_LIGHTMAP' : '', + parameters.aoMap ? '#define USE_AOMAP' : '', + parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', + parameters.bumpMap ? '#define USE_BUMPMAP' : '', + parameters.normalMap ? '#define USE_NORMALMAP' : '', + ( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '', + ( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '', + + parameters.clearcoat ? '#define USE_CLEARCOAT' : '', + parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', + parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', + parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', + + parameters.specularMap ? '#define USE_SPECULARMAP' : '', + parameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '', + parameters.specularColorMap ? '#define USE_SPECULARCOLORMAP' : '', + parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', + parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', + + parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + parameters.alphaTest ? '#define USE_ALPHATEST' : '', + + parameters.sheen ? '#define USE_SHEEN' : '', + parameters.sheenColorMap ? '#define USE_SHEENCOLORMAP' : '', + parameters.sheenRoughnessMap ? '#define USE_SHEENROUGHNESSMAP' : '', + + parameters.transmission ? '#define USE_TRANSMISSION' : '', + parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', + parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', + + parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '', + + parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '', + parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', + parameters.vertexUvs ? '#define USE_UV' : '', + parameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '', + + parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', + + parameters.flatShading ? '#define FLAT_SHADED' : '', + + parameters.doubleSided ? '#define DOUBLE_SIDED' : '', + parameters.flipSided ? '#define FLIP_SIDED' : '', + + parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', + parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', + + parameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '', + + parameters.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '', + + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', + ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '', + + ( ( parameters.extensionShaderTextureLOD || parameters.envMap ) && parameters.rendererExtensionShaderTextureLod ) ? '#define TEXTURE_LOD_EXT' : '', + + 'uniform mat4 viewMatrix;', + 'uniform vec3 cameraPosition;', + 'uniform bool isOrthographic;', + + ( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '', + ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below + ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '', + + parameters.dithering ? '#define DITHERING' : '', + parameters.transparent ? '' : '#define OPAQUE', + + ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below + getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputEncoding ), + + parameters.depthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '', + + '\n' + + ].filter( filterEmptyLine ).join( '\n' ); + + } + + vertexShader = resolveIncludes( vertexShader ); + vertexShader = replaceLightNums( vertexShader, parameters ); + vertexShader = replaceClippingPlaneNums( vertexShader, parameters ); + + fragmentShader = resolveIncludes( fragmentShader ); + fragmentShader = replaceLightNums( fragmentShader, parameters ); + fragmentShader = replaceClippingPlaneNums( fragmentShader, parameters ); + + vertexShader = unrollLoops( vertexShader ); + fragmentShader = unrollLoops( fragmentShader ); + + if ( parameters.isWebGL2 && parameters.isRawShaderMaterial !== true ) { + + // GLSL 3.0 conversion for built-in materials and ShaderMaterial + + versionString = '#version 300 es\n'; + + prefixVertex = [ + 'precision mediump sampler2DArray;', + '#define attribute in', + '#define varying out', + '#define texture2D texture' + ].join( '\n' ) + '\n' + prefixVertex; + + prefixFragment = [ + '#define varying in', + ( parameters.glslVersion === GLSL3 ) ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;', + ( parameters.glslVersion === GLSL3 ) ? '' : '#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' + prefixFragment; + + } + + const vertexGlsl = versionString + prefixVertex + vertexShader; + const fragmentGlsl = versionString + prefixFragment + fragmentShader; + + // console.log( '*VERTEX*', vertexGlsl ); + // console.log( '*FRAGMENT*', fragmentGlsl ); + + const glVertexShader = WebGLShader( gl, 35633, vertexGlsl ); + const glFragmentShader = WebGLShader( gl, 35632, fragmentGlsl ); + + gl.attachShader( program, glVertexShader ); + gl.attachShader( program, glFragmentShader ); + + // Force a particular attribute to index 0. + + if ( parameters.index0AttributeName !== undefined ) { + + gl.bindAttribLocation( program, 0, parameters.index0AttributeName ); + + } else if ( parameters.morphTargets === true ) { + + // programs with morphTargets displace position out of attribute 0 + gl.bindAttribLocation( program, 0, 'position' ); + + } + + gl.linkProgram( program ); + + // check for link errors + if ( renderer.debug.checkShaderErrors ) { + + const programLog = gl.getProgramInfoLog( program ).trim(); + const vertexLog = gl.getShaderInfoLog( glVertexShader ).trim(); + const fragmentLog = gl.getShaderInfoLog( glFragmentShader ).trim(); + + let runnable = true; + let haveDiagnostics = true; + + if ( gl.getProgramParameter( program, 35714 ) === false ) { + + runnable = false; + + const vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' ); + const fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' ); + + console.error( + 'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' + + 'VALIDATE_STATUS ' + gl.getProgramParameter( program, 35715 ) + '\n\n' + + 'Program Info Log: ' + programLog + '\n' + + vertexErrors + '\n' + + fragmentErrors + ); + + } else if ( programLog !== '' ) { + + console.warn( 'THREE.WebGLProgram: Program Info Log:', programLog ); + + } else if ( vertexLog === '' || fragmentLog === '' ) { + + haveDiagnostics = false; + + } + + if ( haveDiagnostics ) { + + this.diagnostics = { + + runnable: runnable, + + programLog: programLog, + + vertexShader: { + + log: vertexLog, + prefix: prefixVertex + + }, + + fragmentShader: { + + log: fragmentLog, + prefix: prefixFragment + + } + + }; + + } + + } + + // Clean up + + // Crashes in iOS9 and iOS10. #18402 + // gl.detachShader( program, glVertexShader ); + // gl.detachShader( program, glFragmentShader ); + + gl.deleteShader( glVertexShader ); + gl.deleteShader( glFragmentShader ); + + // set up caching for uniform locations + + let cachedUniforms; + + this.getUniforms = function () { + + if ( cachedUniforms === undefined ) { + + cachedUniforms = new WebGLUniforms( gl, program ); + + } + + return cachedUniforms; + + }; + + // set up caching for attribute locations + + let cachedAttributes; + + this.getAttributes = function () { + + if ( cachedAttributes === undefined ) { + + cachedAttributes = fetchAttributeLocations( gl, program ); + + } + + return cachedAttributes; + + }; + + // free resource + + this.destroy = function () { + + bindingStates.releaseStatesOfProgram( this ); + + gl.deleteProgram( program ); + this.program = undefined; + + }; + + // + + this.name = parameters.shaderName; + this.id = programIdCount ++; + this.cacheKey = cacheKey; + this.usedTimes = 1; + this.program = program; + this.vertexShader = glVertexShader; + this.fragmentShader = glFragmentShader; + + return this; + +} + +let _id = 0; + +class WebGLShaderCache { + + constructor() { + + this.shaderCache = new Map(); + this.materialCache = new Map(); + + } + + update( material ) { + + const vertexShader = material.vertexShader; + const fragmentShader = material.fragmentShader; + + const vertexShaderStage = this._getShaderStage( vertexShader ); + const fragmentShaderStage = this._getShaderStage( fragmentShader ); + + const materialShaders = this._getShaderCacheForMaterial( material ); + + if ( materialShaders.has( vertexShaderStage ) === false ) { + + materialShaders.add( vertexShaderStage ); + vertexShaderStage.usedTimes ++; + + } + + if ( materialShaders.has( fragmentShaderStage ) === false ) { + + materialShaders.add( fragmentShaderStage ); + fragmentShaderStage.usedTimes ++; + + } + + return this; + + } + + remove( material ) { + + const materialShaders = this.materialCache.get( material ); + + for ( const shaderStage of materialShaders ) { + + shaderStage.usedTimes --; + + if ( shaderStage.usedTimes === 0 ) this.shaderCache.delete( shaderStage ); + + } + + this.materialCache.delete( material ); + + return this; + + } + + getVertexShaderID( material ) { + + return this._getShaderStage( material.vertexShader ).id; + + } + + getFragmentShaderID( material ) { + + return this._getShaderStage( material.fragmentShader ).id; + + } + + dispose() { + + this.shaderCache.clear(); + this.materialCache.clear(); + + } + + _getShaderCacheForMaterial( material ) { + + const cache = this.materialCache; + + if ( cache.has( material ) === false ) { + + cache.set( material, new Set() ); + + } + + return cache.get( material ); + + } + + _getShaderStage( code ) { + + const cache = this.shaderCache; + + if ( cache.has( code ) === false ) { + + const stage = new WebGLShaderStage(); + cache.set( code, stage ); + + } + + return cache.get( code ); + + } + +} + +class WebGLShaderStage { + + constructor() { + + this.id = _id ++; + + this.usedTimes = 0; + + } + +} + +function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ) { + + const _programLayers = new Layers(); + const _customShaders = new WebGLShaderCache(); + const programs = []; + + const isWebGL2 = capabilities.isWebGL2; + const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer; + const floatVertexTextures = capabilities.floatVertexTextures; + const maxVertexUniforms = capabilities.maxVertexUniforms; + const vertexTextures = capabilities.vertexTextures; + let precision = capabilities.precision; + + const shaderIDs = { + 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 getMaxBones( object ) { + + const skeleton = object.skeleton; + const bones = skeleton.bones; + + if ( floatVertexTextures ) { + + return 1024; + + } else { + + // default for when object is not specified + // ( for example when prebuilding shader to be used with multiple objects ) + // + // - leave some extra space for other uniforms + // - limit here is ANGLE's 254 max uniform vectors + // (up to 54 should be safe) + + const nVertexUniforms = maxVertexUniforms; + const nVertexMatrices = Math.floor( ( nVertexUniforms - 20 ) / 4 ); + + const maxBones = Math.min( nVertexMatrices, bones.length ); + + if ( maxBones < bones.length ) { + + console.warn( 'THREE.WebGLRenderer: Skeleton has ' + bones.length + ' bones. This GPU supports ' + maxBones + '.' ); + return 0; + + } + + return maxBones; + + } + + } + + function getParameters( material, lights, shadows, scene, object ) { + + const fog = scene.fog; + const environment = material.isMeshStandardMaterial ? scene.environment : null; + + const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment ); + + const shaderID = shaderIDs[ material.type ]; + + // heuristics to create shader parameters according to lights in the scene + // (not to blow over maxLights budget) + + const maxBones = object.isSkinnedMesh ? getMaxBones( object ) : 0; + + if ( material.precision !== null ) { + + precision = capabilities.getMaxPrecision( material.precision ); + + if ( precision !== material.precision ) { + + console.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' ); + + } + + } + + let vertexShader, fragmentShader; + let customVertexShaderID, customFragmentShaderID; + + if ( shaderID ) { + + const shader = ShaderLib[ shaderID ]; + + vertexShader = shader.vertexShader; + fragmentShader = shader.fragmentShader; + + } else { + + vertexShader = material.vertexShader; + fragmentShader = material.fragmentShader; + + _customShaders.update( material ); + + customVertexShaderID = _customShaders.getVertexShaderID( material ); + customFragmentShaderID = _customShaders.getFragmentShaderID( material ); + + } + + const currentRenderTarget = renderer.getRenderTarget(); + + const useAlphaTest = material.alphaTest > 0; + const useClearcoat = material.clearcoat > 0; + + const parameters = { + + isWebGL2: isWebGL2, + + shaderID: shaderID, + shaderName: material.type, + + vertexShader: vertexShader, + fragmentShader: fragmentShader, + defines: material.defines, + + customVertexShaderID: customVertexShaderID, + customFragmentShaderID: customFragmentShaderID, + + isRawShaderMaterial: material.isRawShaderMaterial === true, + glslVersion: material.glslVersion, + + precision: precision, + + instancing: object.isInstancedMesh === true, + instancingColor: object.isInstancedMesh === true && object.instanceColor !== null, + + supportsVertexTextures: vertexTextures, + outputEncoding: ( currentRenderTarget === null ) ? renderer.outputEncoding : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.encoding : LinearEncoding ), + map: !! material.map, + matcap: !! material.matcap, + envMap: !! envMap, + envMapMode: envMap && envMap.mapping, + envMapCubeUV: ( !! envMap ) && ( ( envMap.mapping === CubeUVReflectionMapping ) || ( envMap.mapping === CubeUVRefractionMapping ) ), + lightMap: !! material.lightMap, + aoMap: !! material.aoMap, + emissiveMap: !! material.emissiveMap, + bumpMap: !! material.bumpMap, + normalMap: !! material.normalMap, + objectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap, + tangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap, + + decodeVideoTexture: !! material.map && ( material.map.isVideoTexture === true ) && ( material.map.encoding === sRGBEncoding ), + + clearcoat: useClearcoat, + clearcoatMap: useClearcoat && !! material.clearcoatMap, + clearcoatRoughnessMap: useClearcoat && !! material.clearcoatRoughnessMap, + clearcoatNormalMap: useClearcoat && !! material.clearcoatNormalMap, + + displacementMap: !! material.displacementMap, + roughnessMap: !! material.roughnessMap, + metalnessMap: !! material.metalnessMap, + specularMap: !! material.specularMap, + specularIntensityMap: !! material.specularIntensityMap, + specularColorMap: !! material.specularColorMap, + + transparent: material.transparent, + + alphaMap: !! material.alphaMap, + alphaTest: useAlphaTest, + + gradientMap: !! material.gradientMap, + + sheen: material.sheen > 0, + sheenColorMap: !! material.sheenColorMap, + sheenRoughnessMap: !! material.sheenRoughnessMap, + + transmission: material.transmission > 0, + transmissionMap: !! material.transmissionMap, + thicknessMap: !! material.thicknessMap, + + combine: material.combine, + + vertexTangents: ( !! material.normalMap && !! object.geometry && !! object.geometry.attributes.tangent ), + vertexColors: material.vertexColors, + vertexAlphas: material.vertexColors === true && !! object.geometry && !! object.geometry.attributes.color && object.geometry.attributes.color.itemSize === 4, + vertexUvs: !! material.map || !! material.bumpMap || !! material.normalMap || !! material.specularMap || !! material.alphaMap || !! material.emissiveMap || !! material.roughnessMap || !! material.metalnessMap || !! material.clearcoatMap || !! material.clearcoatRoughnessMap || !! material.clearcoatNormalMap || !! material.displacementMap || !! material.transmissionMap || !! material.thicknessMap || !! material.specularIntensityMap || !! material.specularColorMap || !! material.sheenColorMap || !! material.sheenRoughnessMap, + uvsVertexOnly: ! ( !! material.map || !! material.bumpMap || !! material.normalMap || !! material.specularMap || !! material.alphaMap || !! material.emissiveMap || !! material.roughnessMap || !! material.metalnessMap || !! material.clearcoatNormalMap || material.transmission > 0 || !! material.transmissionMap || !! material.thicknessMap || !! material.specularIntensityMap || !! material.specularColorMap || material.sheen > 0 || !! material.sheenColorMap || !! material.sheenRoughnessMap ) && !! material.displacementMap, + + fog: !! fog, + useFog: material.fog, + fogExp2: ( fog && fog.isFogExp2 ), + + flatShading: !! material.flatShading, + + sizeAttenuation: material.sizeAttenuation, + logarithmicDepthBuffer: logarithmicDepthBuffer, + + skinning: object.isSkinnedMesh === true && maxBones > 0, + maxBones: maxBones, + useVertexTexture: floatVertexTextures, + + morphTargets: !! object.geometry && !! object.geometry.morphAttributes.position, + morphNormals: !! object.geometry && !! object.geometry.morphAttributes.normal, + morphTargetsCount: ( !! object.geometry && !! object.geometry.morphAttributes.position ) ? object.geometry.morphAttributes.position.length : 0, + + numDirLights: lights.directional.length, + numPointLights: lights.point.length, + numSpotLights: lights.spot.length, + numRectAreaLights: lights.rectArea.length, + numHemiLights: lights.hemi.length, + + numDirLightShadows: lights.directionalShadowMap.length, + numPointLightShadows: lights.pointShadowMap.length, + numSpotLightShadows: lights.spotShadowMap.length, + + numClippingPlanes: clipping.numPlanes, + numClipIntersection: clipping.numIntersection, + + dithering: material.dithering, + + shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0, + shadowMapType: renderer.shadowMap.type, + + toneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping, + physicallyCorrectLights: renderer.physicallyCorrectLights, + + premultipliedAlpha: material.premultipliedAlpha, + + doubleSided: material.side === DoubleSide, + flipSided: material.side === BackSide, + + depthPacking: ( material.depthPacking !== undefined ) ? material.depthPacking : false, + + index0AttributeName: material.index0AttributeName, + + extensionDerivatives: material.extensions && material.extensions.derivatives, + extensionFragDepth: material.extensions && material.extensions.fragDepth, + extensionDrawBuffers: material.extensions && material.extensions.drawBuffers, + extensionShaderTextureLOD: material.extensions && material.extensions.shaderTextureLOD, + + rendererExtensionFragDepth: isWebGL2 || extensions.has( 'EXT_frag_depth' ), + rendererExtensionDrawBuffers: isWebGL2 || extensions.has( 'WEBGL_draw_buffers' ), + rendererExtensionShaderTextureLod: isWebGL2 || extensions.has( 'EXT_shader_texture_lod' ), + + customProgramCacheKey: material.customProgramCacheKey() + + }; + + return parameters; + + } + + function getProgramCacheKey( parameters ) { + + const array = []; + + if ( parameters.shaderID ) { + + array.push( parameters.shaderID ); + + } else { + + array.push( parameters.customVertexShaderID ); + array.push( parameters.customFragmentShaderID ); + + } + + if ( parameters.defines !== undefined ) { + + for ( const name in parameters.defines ) { + + array.push( name ); + array.push( parameters.defines[ name ] ); + + } + + } + + if ( parameters.isRawShaderMaterial === false ) { + + getProgramCacheKeyParameters( array, parameters ); + getProgramCacheKeyBooleans( array, parameters ); + array.push( renderer.outputEncoding ); + + } + + array.push( parameters.customProgramCacheKey ); + + return array.join(); + + } + + function getProgramCacheKeyParameters( array, parameters ) { + + array.push( parameters.precision ); + array.push( parameters.outputEncoding ); + array.push( parameters.envMapMode ); + array.push( parameters.combine ); + array.push( parameters.vertexUvs ); + array.push( parameters.fogExp2 ); + array.push( parameters.sizeAttenuation ); + array.push( parameters.maxBones ); + array.push( parameters.morphTargetsCount ); + array.push( parameters.numDirLights ); + array.push( parameters.numPointLights ); + array.push( parameters.numSpotLights ); + array.push( parameters.numHemiLights ); + array.push( parameters.numRectAreaLights ); + array.push( parameters.numDirLightShadows ); + array.push( parameters.numPointLightShadows ); + array.push( parameters.numSpotLightShadows ); + array.push( parameters.shadowMapType ); + array.push( parameters.toneMapping ); + array.push( parameters.numClippingPlanes ); + array.push( parameters.numClipIntersection ); + + } + + function getProgramCacheKeyBooleans( array, parameters ) { + + _programLayers.disableAll(); + + if ( parameters.isWebGL2 ) + _programLayers.enable( 0 ); + if ( parameters.supportsVertexTextures ) + _programLayers.enable( 1 ); + if ( parameters.instancing ) + _programLayers.enable( 2 ); + if ( parameters.instancingColor ) + _programLayers.enable( 3 ); + if ( parameters.map ) + _programLayers.enable( 4 ); + if ( parameters.matcap ) + _programLayers.enable( 5 ); + if ( parameters.envMap ) + _programLayers.enable( 6 ); + if ( parameters.envMapCubeUV ) + _programLayers.enable( 7 ); + if ( parameters.lightMap ) + _programLayers.enable( 8 ); + if ( parameters.aoMap ) + _programLayers.enable( 9 ); + if ( parameters.emissiveMap ) + _programLayers.enable( 10 ); + if ( parameters.bumpMap ) + _programLayers.enable( 11 ); + if ( parameters.normalMap ) + _programLayers.enable( 12 ); + if ( parameters.objectSpaceNormalMap ) + _programLayers.enable( 13 ); + if ( parameters.tangentSpaceNormalMap ) + _programLayers.enable( 14 ); + if ( parameters.clearcoat ) + _programLayers.enable( 15 ); + if ( parameters.clearcoatMap ) + _programLayers.enable( 16 ); + if ( parameters.clearcoatRoughnessMap ) + _programLayers.enable( 17 ); + if ( parameters.clearcoatNormalMap ) + _programLayers.enable( 18 ); + if ( parameters.displacementMap ) + _programLayers.enable( 19 ); + if ( parameters.specularMap ) + _programLayers.enable( 20 ); + if ( parameters.roughnessMap ) + _programLayers.enable( 21 ); + if ( parameters.metalnessMap ) + _programLayers.enable( 22 ); + if ( parameters.gradientMap ) + _programLayers.enable( 23 ); + if ( parameters.alphaMap ) + _programLayers.enable( 24 ); + if ( parameters.alphaTest ) + _programLayers.enable( 25 ); + if ( parameters.vertexColors ) + _programLayers.enable( 26 ); + if ( parameters.vertexAlphas ) + _programLayers.enable( 27 ); + if ( parameters.vertexUvs ) + _programLayers.enable( 28 ); + if ( parameters.vertexTangents ) + _programLayers.enable( 29 ); + if ( parameters.uvsVertexOnly ) + _programLayers.enable( 30 ); + if ( parameters.fog ) + _programLayers.enable( 31 ); + + array.push( _programLayers.mask ); + _programLayers.disableAll(); + + if ( parameters.useFog ) + _programLayers.enable( 0 ); + if ( parameters.flatShading ) + _programLayers.enable( 1 ); + if ( parameters.logarithmicDepthBuffer ) + _programLayers.enable( 2 ); + if ( parameters.skinning ) + _programLayers.enable( 3 ); + if ( parameters.useVertexTexture ) + _programLayers.enable( 4 ); + if ( parameters.morphTargets ) + _programLayers.enable( 5 ); + if ( parameters.morphNormals ) + _programLayers.enable( 6 ); + if ( parameters.premultipliedAlpha ) + _programLayers.enable( 7 ); + if ( parameters.shadowMapEnabled ) + _programLayers.enable( 8 ); + if ( parameters.physicallyCorrectLights ) + _programLayers.enable( 9 ); + if ( parameters.doubleSided ) + _programLayers.enable( 10 ); + if ( parameters.flipSided ) + _programLayers.enable( 11 ); + if ( parameters.depthPacking ) + _programLayers.enable( 12 ); + if ( parameters.dithering ) + _programLayers.enable( 13 ); + if ( parameters.specularIntensityMap ) + _programLayers.enable( 14 ); + if ( parameters.specularColorMap ) + _programLayers.enable( 15 ); + if ( parameters.transmission ) + _programLayers.enable( 16 ); + if ( parameters.transmissionMap ) + _programLayers.enable( 17 ); + if ( parameters.thicknessMap ) + _programLayers.enable( 18 ); + if ( parameters.sheen ) + _programLayers.enable( 19 ); + if ( parameters.sheenColorMap ) + _programLayers.enable( 20 ); + if ( parameters.sheenRoughnessMap ) + _programLayers.enable( 21 ); + if ( parameters.decodeVideoTexture ) + _programLayers.enable( 22 ); + if ( parameters.transparent ) + _programLayers.enable( 23 ); + + array.push( _programLayers.mask ); + + } + + function getUniforms( material ) { + + const shaderID = shaderIDs[ material.type ]; + let uniforms; + + if ( shaderID ) { + + const shader = ShaderLib[ shaderID ]; + uniforms = UniformsUtils.clone( shader.uniforms ); + + } else { + + uniforms = material.uniforms; + + } + + return uniforms; + + } + + function acquireProgram( parameters, cacheKey ) { + + let program; + + // Check if code has been already compiled + for ( let p = 0, pl = programs.length; p < pl; p ++ ) { + + const preexistingProgram = programs[ p ]; + + if ( preexistingProgram.cacheKey === cacheKey ) { + + program = preexistingProgram; + ++ program.usedTimes; + + break; + + } + + } + + if ( program === undefined ) { + + program = new WebGLProgram( renderer, cacheKey, parameters, bindingStates ); + programs.push( program ); + + } + + return program; + + } + + function releaseProgram( program ) { + + if ( -- program.usedTimes === 0 ) { + + // Remove from unordered set + const i = programs.indexOf( program ); + programs[ i ] = programs[ programs.length - 1 ]; + programs.pop(); + + // Free WebGL resources + program.destroy(); + + } + + } + + function releaseShaderCache( material ) { + + _customShaders.remove( material ); + + } + + function dispose() { + + _customShaders.dispose(); + + } + + return { + getParameters: getParameters, + getProgramCacheKey: getProgramCacheKey, + getUniforms: getUniforms, + acquireProgram: acquireProgram, + releaseProgram: releaseProgram, + releaseShaderCache: releaseShaderCache, + // Exposed for resource monitoring & error feedback via renderer.info: + programs: programs, + dispose: dispose + }; + +} + +function WebGLProperties() { + + let properties = new WeakMap(); + + function get( object ) { + + let map = properties.get( object ); + + if ( map === undefined ) { + + map = {}; + properties.set( object, map ); + + } + + return map; + + } + + function remove( object ) { + + properties.delete( object ); + + } + + function update( object, key, value ) { + + properties.get( object )[ key ] = value; + + } + + function dispose() { + + properties = new WeakMap(); + + } + + return { + get: get, + remove: remove, + update: update, + dispose: dispose + }; + +} + +function painterSortStable( a, b ) { + + if ( a.groupOrder !== b.groupOrder ) { + + return a.groupOrder - b.groupOrder; + + } else if ( a.renderOrder !== b.renderOrder ) { + + return a.renderOrder - b.renderOrder; + + } else if ( a.material.id !== b.material.id ) { + + return a.material.id - b.material.id; + + } else if ( a.z !== b.z ) { + + return a.z - b.z; + + } else { + + return a.id - b.id; + + } + +} + +function reversePainterSortStable( a, b ) { + + if ( a.groupOrder !== b.groupOrder ) { + + return a.groupOrder - b.groupOrder; + + } else if ( a.renderOrder !== b.renderOrder ) { + + return a.renderOrder - b.renderOrder; + + } else if ( a.z !== b.z ) { + + return b.z - a.z; + + } else { + + return a.id - b.id; + + } + +} + + +function WebGLRenderList() { + + const renderItems = []; + let renderItemsIndex = 0; + + const opaque = []; + const transmissive = []; + const transparent = []; + + function init() { + + renderItemsIndex = 0; + + opaque.length = 0; + transmissive.length = 0; + transparent.length = 0; + + } + + function getNextRenderItem( object, geometry, material, groupOrder, z, group ) { + + let renderItem = renderItems[ renderItemsIndex ]; + + if ( renderItem === undefined ) { + + renderItem = { + id: object.id, + object: object, + geometry: geometry, + material: material, + groupOrder: groupOrder, + renderOrder: object.renderOrder, + z: z, + group: group + }; + + renderItems[ renderItemsIndex ] = renderItem; + + } else { + + renderItem.id = object.id; + renderItem.object = object; + renderItem.geometry = geometry; + renderItem.material = material; + renderItem.groupOrder = groupOrder; + renderItem.renderOrder = object.renderOrder; + renderItem.z = z; + renderItem.group = group; + + } + + renderItemsIndex ++; + + return renderItem; + + } + + function push( object, geometry, material, groupOrder, z, group ) { + + const renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group ); + + if ( material.transmission > 0.0 ) { + + transmissive.push( renderItem ); + + } else if ( material.transparent === true ) { + + transparent.push( renderItem ); + + } else { + + opaque.push( renderItem ); + + } + + } + + function unshift( object, geometry, material, groupOrder, z, group ) { + + const renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group ); + + if ( material.transmission > 0.0 ) { + + transmissive.unshift( renderItem ); + + } else if ( material.transparent === true ) { + + transparent.unshift( renderItem ); + + } else { + + opaque.unshift( renderItem ); + + } + + } + + function sort( customOpaqueSort, customTransparentSort ) { + + if ( opaque.length > 1 ) opaque.sort( customOpaqueSort || painterSortStable ); + if ( transmissive.length > 1 ) transmissive.sort( customTransparentSort || reversePainterSortStable ); + if ( transparent.length > 1 ) transparent.sort( customTransparentSort || reversePainterSortStable ); + + } + + function finish() { + + // Clear references from inactive renderItems in the list + + for ( let i = renderItemsIndex, il = renderItems.length; i < il; i ++ ) { + + const renderItem = renderItems[ i ]; + + if ( renderItem.id === null ) break; + + renderItem.id = null; + renderItem.object = null; + renderItem.geometry = null; + renderItem.material = null; + renderItem.group = null; + + } + + } + + return { + + opaque: opaque, + transmissive: transmissive, + transparent: transparent, + + init: init, + push: push, + unshift: unshift, + finish: finish, + + sort: sort + }; + +} + +function WebGLRenderLists() { + + let lists = new WeakMap(); + + function get( scene, renderCallDepth ) { + + let list; + + if ( lists.has( scene ) === false ) { + + list = new WebGLRenderList(); + lists.set( scene, [ list ] ); + + } else { + + if ( renderCallDepth >= lists.get( scene ).length ) { + + list = new WebGLRenderList(); + lists.get( scene ).push( list ); + + } else { + + list = lists.get( scene )[ renderCallDepth ]; + + } + + } + + return list; + + } + + function dispose() { + + lists = new WeakMap(); + + } + + return { + get: get, + dispose: dispose + }; + +} + +function UniformsCache() { + + const lights = {}; + + return { + + get: function ( light ) { + + if ( lights[ light.id ] !== undefined ) { + + return lights[ light.id ]; + + } + + let uniforms; + + switch ( light.type ) { + + case 'DirectionalLight': + uniforms = { + direction: new Vector3(), + color: new Color() + }; + break; + + case 'SpotLight': + uniforms = { + position: new Vector3(), + direction: new Vector3(), + color: new Color(), + distance: 0, + coneCos: 0, + penumbraCos: 0, + decay: 0 + }; + break; + + case 'PointLight': + uniforms = { + position: new Vector3(), + color: new Color(), + distance: 0, + decay: 0 + }; + break; + + case 'HemisphereLight': + uniforms = { + direction: new Vector3(), + skyColor: new Color(), + groundColor: new Color() + }; + break; + + case 'RectAreaLight': + uniforms = { + color: new Color(), + position: new Vector3(), + halfWidth: new Vector3(), + halfHeight: new Vector3() + }; + break; + + } + + lights[ light.id ] = uniforms; + + return uniforms; + + } + + }; + +} + +function ShadowUniformsCache() { + + const lights = {}; + + return { + + get: function ( light ) { + + if ( lights[ light.id ] !== undefined ) { + + return lights[ light.id ]; + + } + + let uniforms; + + switch ( light.type ) { + + case 'DirectionalLight': + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; + + case 'SpotLight': + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; + + case 'PointLight': + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2(), + shadowCameraNear: 1, + shadowCameraFar: 1000 + }; + break; + + // TODO (abelnation): set RectAreaLight shadow uniforms + + } + + lights[ light.id ] = uniforms; + + return uniforms; + + } + + }; + +} + + + +let nextVersion = 0; + +function shadowCastingLightsFirst( lightA, lightB ) { + + return ( lightB.castShadow ? 1 : 0 ) - ( lightA.castShadow ? 1 : 0 ); + +} + +function WebGLLights( extensions, capabilities ) { + + const cache = new UniformsCache(); + + const shadowCache = ShadowUniformsCache(); + + const state = { + + version: 0, + + hash: { + directionalLength: - 1, + pointLength: - 1, + spotLength: - 1, + rectAreaLength: - 1, + hemiLength: - 1, + + numDirectionalShadows: - 1, + numPointShadows: - 1, + numSpotShadows: - 1 + }, + + ambient: [ 0, 0, 0 ], + probe: [], + directional: [], + directionalShadow: [], + directionalShadowMap: [], + directionalShadowMatrix: [], + spot: [], + spotShadow: [], + spotShadowMap: [], + spotShadowMatrix: [], + rectArea: [], + rectAreaLTC1: null, + rectAreaLTC2: null, + point: [], + pointShadow: [], + pointShadowMap: [], + pointShadowMatrix: [], + hemi: [] + + }; + + for ( let i = 0; i < 9; i ++ ) state.probe.push( new Vector3() ); + + const vector3 = new Vector3(); + const matrix4 = new Matrix4(); + const matrix42 = new Matrix4(); + + function setup( lights, physicallyCorrectLights ) { + + let r = 0, g = 0, b = 0; + + for ( let i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 ); + + let directionalLength = 0; + let pointLength = 0; + let spotLength = 0; + let rectAreaLength = 0; + let hemiLength = 0; + + let numDirectionalShadows = 0; + let numPointShadows = 0; + let numSpotShadows = 0; + + lights.sort( shadowCastingLightsFirst ); + + // artist-friendly light intensity scaling factor + const scaleFactor = ( physicallyCorrectLights !== true ) ? Math.PI : 1; + + for ( let i = 0, l = lights.length; i < l; i ++ ) { + + const light = lights[ i ]; + + const color = light.color; + const intensity = light.intensity; + const distance = light.distance; + + const shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null; + + if ( light.isAmbientLight ) { + + r += color.r * intensity * scaleFactor; + g += color.g * intensity * scaleFactor; + b += color.b * intensity * scaleFactor; + + } else if ( light.isLightProbe ) { + + for ( let j = 0; j < 9; j ++ ) { + + state.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity ); + + } + + } else if ( light.isDirectionalLight ) { + + const uniforms = cache.get( light ); + + uniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor ); + + if ( light.castShadow ) { + + const shadow = light.shadow; + + const shadowUniforms = shadowCache.get( light ); + + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; + + state.directionalShadow[ directionalLength ] = shadowUniforms; + state.directionalShadowMap[ directionalLength ] = shadowMap; + state.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix; + + numDirectionalShadows ++; + + } + + state.directional[ directionalLength ] = uniforms; + + directionalLength ++; + + } else if ( light.isSpotLight ) { + + const uniforms = cache.get( light ); + + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + + uniforms.color.copy( color ).multiplyScalar( intensity * scaleFactor ); + uniforms.distance = distance; + + uniforms.coneCos = Math.cos( light.angle ); + uniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) ); + uniforms.decay = light.decay; + + if ( light.castShadow ) { + + const shadow = light.shadow; + + const shadowUniforms = shadowCache.get( light ); + + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; + + state.spotShadow[ spotLength ] = shadowUniforms; + state.spotShadowMap[ spotLength ] = shadowMap; + state.spotShadowMatrix[ spotLength ] = light.shadow.matrix; + + numSpotShadows ++; + + } + + state.spot[ spotLength ] = uniforms; + + spotLength ++; + + } else if ( light.isRectAreaLight ) { + + const uniforms = cache.get( light ); + + // (a) intensity is the total visible light emitted + //uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) ); + + // (b) intensity is the brightness of the light + uniforms.color.copy( color ).multiplyScalar( intensity ); + + uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 ); + uniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 ); + + state.rectArea[ rectAreaLength ] = uniforms; + + rectAreaLength ++; + + } else if ( light.isPointLight ) { + + const uniforms = cache.get( light ); + + uniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor ); + uniforms.distance = light.distance; + uniforms.decay = light.decay; + + if ( light.castShadow ) { + + const shadow = light.shadow; + + const shadowUniforms = shadowCache.get( light ); + + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; + shadowUniforms.shadowCameraNear = shadow.camera.near; + shadowUniforms.shadowCameraFar = shadow.camera.far; + + state.pointShadow[ pointLength ] = shadowUniforms; + state.pointShadowMap[ pointLength ] = shadowMap; + state.pointShadowMatrix[ pointLength ] = light.shadow.matrix; + + numPointShadows ++; + + } + + state.point[ pointLength ] = uniforms; + + pointLength ++; + + } else if ( light.isHemisphereLight ) { + + const uniforms = cache.get( light ); + + uniforms.skyColor.copy( light.color ).multiplyScalar( intensity * scaleFactor ); + uniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity * scaleFactor ); + + state.hemi[ hemiLength ] = uniforms; + + hemiLength ++; + + } + + } + + if ( rectAreaLength > 0 ) { + + if ( capabilities.isWebGL2 ) { + + // WebGL 2 + + state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1; + state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2; + + } else { + + // WebGL 1 + + if ( extensions.has( 'OES_texture_float_linear' ) === true ) { + + state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1; + state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2; + + } else if ( extensions.has( 'OES_texture_half_float_linear' ) === true ) { + + state.rectAreaLTC1 = UniformsLib.LTC_HALF_1; + state.rectAreaLTC2 = UniformsLib.LTC_HALF_2; + + } else { + + console.error( 'THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.' ); + + } + + } + + } + + state.ambient[ 0 ] = r; + state.ambient[ 1 ] = g; + state.ambient[ 2 ] = b; + + const hash = state.hash; + + if ( hash.directionalLength !== directionalLength || + hash.pointLength !== pointLength || + hash.spotLength !== spotLength || + hash.rectAreaLength !== rectAreaLength || + hash.hemiLength !== hemiLength || + hash.numDirectionalShadows !== numDirectionalShadows || + hash.numPointShadows !== numPointShadows || + hash.numSpotShadows !== numSpotShadows ) { + + state.directional.length = directionalLength; + state.spot.length = spotLength; + state.rectArea.length = rectAreaLength; + state.point.length = pointLength; + state.hemi.length = hemiLength; + + state.directionalShadow.length = numDirectionalShadows; + state.directionalShadowMap.length = numDirectionalShadows; + state.pointShadow.length = numPointShadows; + state.pointShadowMap.length = numPointShadows; + state.spotShadow.length = numSpotShadows; + state.spotShadowMap.length = numSpotShadows; + state.directionalShadowMatrix.length = numDirectionalShadows; + state.pointShadowMatrix.length = numPointShadows; + state.spotShadowMatrix.length = numSpotShadows; + + hash.directionalLength = directionalLength; + hash.pointLength = pointLength; + hash.spotLength = spotLength; + hash.rectAreaLength = rectAreaLength; + hash.hemiLength = hemiLength; + + hash.numDirectionalShadows = numDirectionalShadows; + hash.numPointShadows = numPointShadows; + hash.numSpotShadows = numSpotShadows; + + state.version = nextVersion ++; + + } + + } + + function setupView( lights, camera ) { + + let directionalLength = 0; + let pointLength = 0; + let spotLength = 0; + let rectAreaLength = 0; + let hemiLength = 0; + + const viewMatrix = camera.matrixWorldInverse; + + for ( let i = 0, l = lights.length; i < l; i ++ ) { + + const light = lights[ i ]; + + if ( light.isDirectionalLight ) { + + const uniforms = state.directional[ directionalLength ]; + + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + vector3.setFromMatrixPosition( light.target.matrixWorld ); + uniforms.direction.sub( vector3 ); + uniforms.direction.transformDirection( viewMatrix ); + + directionalLength ++; + + } else if ( light.isSpotLight ) { + + const uniforms = state.spot[ spotLength ]; + + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); + + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + vector3.setFromMatrixPosition( light.target.matrixWorld ); + uniforms.direction.sub( vector3 ); + uniforms.direction.transformDirection( viewMatrix ); + + spotLength ++; + + } else if ( light.isRectAreaLight ) { + + const uniforms = state.rectArea[ rectAreaLength ]; + + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); + + // extract local rotation of light to derive width/height half vectors + matrix42.identity(); + matrix4.copy( light.matrixWorld ); + matrix4.premultiply( viewMatrix ); + matrix42.extractRotation( matrix4 ); + + uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 ); + uniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 ); + + uniforms.halfWidth.applyMatrix4( matrix42 ); + uniforms.halfHeight.applyMatrix4( matrix42 ); + + rectAreaLength ++; + + } else if ( light.isPointLight ) { + + const uniforms = state.point[ pointLength ]; + + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); + + pointLength ++; + + } else if ( light.isHemisphereLight ) { + + const uniforms = state.hemi[ hemiLength ]; + + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + uniforms.direction.transformDirection( viewMatrix ); + uniforms.direction.normalize(); + + hemiLength ++; + + } + + } + + } + + return { + setup: setup, + setupView: setupView, + state: state + }; + +} + +function WebGLRenderState( extensions, capabilities ) { + + const lights = new WebGLLights( extensions, capabilities ); + + const lightsArray = []; + const shadowsArray = []; + + function init() { + + lightsArray.length = 0; + shadowsArray.length = 0; + + } + + function pushLight( light ) { + + lightsArray.push( light ); + + } + + function pushShadow( shadowLight ) { + + shadowsArray.push( shadowLight ); + + } + + function setupLights( physicallyCorrectLights ) { + + lights.setup( lightsArray, physicallyCorrectLights ); + + } + + function setupLightsView( camera ) { + + lights.setupView( lightsArray, camera ); + + } + + const state = { + lightsArray: lightsArray, + shadowsArray: shadowsArray, + + lights: lights + }; + + return { + init: init, + state: state, + setupLights: setupLights, + setupLightsView: setupLightsView, + + pushLight: pushLight, + pushShadow: pushShadow + }; + +} + +function WebGLRenderStates( extensions, capabilities ) { + + let renderStates = new WeakMap(); + + function get( scene, renderCallDepth = 0 ) { + + let renderState; + + if ( renderStates.has( scene ) === false ) { + + renderState = new WebGLRenderState( extensions, capabilities ); + renderStates.set( scene, [ renderState ] ); + + } else { + + if ( renderCallDepth >= renderStates.get( scene ).length ) { + + renderState = new WebGLRenderState( extensions, capabilities ); + renderStates.get( scene ).push( renderState ); + + } else { + + renderState = renderStates.get( scene )[ renderCallDepth ]; + + } + + } + + return renderState; + + } + + function dispose() { + + renderStates = new WeakMap(); + + } + + return { + get: get, + dispose: dispose + }; + +} + +/** + * parameters = { + * + * opacity: , + * + * map: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * wireframe: , + * wireframeLinewidth: + * } + */ + +class MeshDepthMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'MeshDepthMaterial'; + + this.depthPacking = BasicDepthPacking; + + this.map = null; + + this.alphaMap = null; + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.wireframe = false; + this.wireframeLinewidth = 1; + + this.fog = false; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.depthPacking = source.depthPacking; + + this.map = source.map; + + this.alphaMap = source.alphaMap; + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + + return this; + + } + +} + +MeshDepthMaterial.prototype.isMeshDepthMaterial = true; + +/** + * parameters = { + * + * referencePosition: , + * nearDistance: , + * farDistance: , + * + * map: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: + * + * } + */ + +class MeshDistanceMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'MeshDistanceMaterial'; + + this.referencePosition = new Vector3(); + this.nearDistance = 1; + this.farDistance = 1000; + + this.map = null; + + this.alphaMap = null; + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.fog = false; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.referencePosition.copy( source.referencePosition ); + this.nearDistance = source.nearDistance; + this.farDistance = source.farDistance; + + this.map = source.map; + + this.alphaMap = source.alphaMap; + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + return this; + + } + +} + +MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true; + +const vertex = "void main() {\n\tgl_Position = vec4( position, 1.0 );\n}"; + +const fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \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}"; + +function WebGLShadowMap( _renderer, _objects, _capabilities ) { + + let _frustum = new Frustum(); + + const _shadowMapSize = new Vector2(), + _viewportSize = new Vector2(), + + _viewport = new Vector4(), + + _depthMaterial = new MeshDepthMaterial( { depthPacking: RGBADepthPacking } ), + _distanceMaterial = new MeshDistanceMaterial(), + + _materialCache = {}, + + _maxTextureSize = _capabilities.maxTextureSize; + + const shadowSide = { 0: BackSide, 1: FrontSide, 2: DoubleSide }; + + const shadowMaterialVertical = new ShaderMaterial( { + defines: { + VSM_SAMPLES: 8 + }, + uniforms: { + shadow_pass: { value: null }, + resolution: { value: new Vector2() }, + radius: { value: 4.0 } + }, + + vertexShader: vertex, + fragmentShader: fragment + + } ); + + const shadowMaterialHorizontal = shadowMaterialVertical.clone(); + shadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1; + + const fullScreenTri = new BufferGeometry(); + fullScreenTri.setAttribute( + 'position', + new BufferAttribute( + new Float32Array( [ - 1, - 1, 0.5, 3, - 1, 0.5, - 1, 3, 0.5 ] ), + 3 + ) + ); + + const fullScreenMesh = new Mesh( fullScreenTri, shadowMaterialVertical ); + + const scope = this; + + this.enabled = false; + + this.autoUpdate = true; + this.needsUpdate = false; + + this.type = PCFShadowMap; + + this.render = function ( lights, scene, camera ) { + + if ( scope.enabled === false ) return; + if ( scope.autoUpdate === false && scope.needsUpdate === false ) return; + + if ( lights.length === 0 ) return; + + const currentRenderTarget = _renderer.getRenderTarget(); + const activeCubeFace = _renderer.getActiveCubeFace(); + const activeMipmapLevel = _renderer.getActiveMipmapLevel(); + + const _state = _renderer.state; + + // Set GL state for depth map. + _state.setBlending( NoBlending ); + _state.buffers.color.setClear( 1, 1, 1, 1 ); + _state.buffers.depth.setTest( true ); + _state.setScissorTest( false ); + + // render depth map + + for ( let i = 0, il = lights.length; i < il; i ++ ) { + + const light = lights[ i ]; + const shadow = light.shadow; + + if ( shadow === undefined ) { + + console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' ); + continue; + + } + + if ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue; + + _shadowMapSize.copy( shadow.mapSize ); + + const shadowFrameExtents = shadow.getFrameExtents(); + + _shadowMapSize.multiply( shadowFrameExtents ); + + _viewportSize.copy( shadow.mapSize ); + + if ( _shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize ) { + + if ( _shadowMapSize.x > _maxTextureSize ) { + + _viewportSize.x = Math.floor( _maxTextureSize / shadowFrameExtents.x ); + _shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x; + shadow.mapSize.x = _viewportSize.x; + + } + + if ( _shadowMapSize.y > _maxTextureSize ) { + + _viewportSize.y = Math.floor( _maxTextureSize / shadowFrameExtents.y ); + _shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y; + shadow.mapSize.y = _viewportSize.y; + + } + + } + + if ( shadow.map === null && ! shadow.isPointLightShadow && this.type === VSMShadowMap ) { + + const pars = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat }; + + shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); + shadow.map.texture.name = light.name + '.shadowMap'; + + shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); + + shadow.camera.updateProjectionMatrix(); + + } + + if ( shadow.map === null ) { + + const pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat }; + + shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); + shadow.map.texture.name = light.name + '.shadowMap'; + + shadow.camera.updateProjectionMatrix(); + + } + + _renderer.setRenderTarget( shadow.map ); + _renderer.clear(); + + const viewportCount = shadow.getViewportCount(); + + for ( let vp = 0; vp < viewportCount; vp ++ ) { + + const viewport = shadow.getViewport( vp ); + + _viewport.set( + _viewportSize.x * viewport.x, + _viewportSize.y * viewport.y, + _viewportSize.x * viewport.z, + _viewportSize.y * viewport.w + ); + + _state.viewport( _viewport ); + + shadow.updateMatrices( light, vp ); + + _frustum = shadow.getFrustum(); + + renderObject( scene, camera, shadow.camera, light, this.type ); + + } + + // do blur pass for VSM + + if ( ! shadow.isPointLightShadow && this.type === VSMShadowMap ) { + + VSMPass( shadow, camera ); + + } + + shadow.needsUpdate = false; + + } + + scope.needsUpdate = false; + + _renderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel ); + + }; + + function VSMPass( shadow, camera ) { + + const geometry = _objects.update( fullScreenMesh ); + + if ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) { + + shadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples; + shadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples; + + shadowMaterialVertical.needsUpdate = true; + shadowMaterialHorizontal.needsUpdate = true; + + } + + // vertical pass + + shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture; + shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize; + shadowMaterialVertical.uniforms.radius.value = shadow.radius; + _renderer.setRenderTarget( shadow.mapPass ); + _renderer.clear(); + _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null ); + + // horizontal pass + + shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture; + shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize; + shadowMaterialHorizontal.uniforms.radius.value = shadow.radius; + _renderer.setRenderTarget( shadow.map ); + _renderer.clear(); + _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null ); + + } + + function getDepthMaterial( object, geometry, material, light, shadowCameraNear, shadowCameraFar, type ) { + + let result = null; + + const customMaterial = ( light.isPointLight === true ) ? object.customDistanceMaterial : object.customDepthMaterial; + + if ( customMaterial !== undefined ) { + + result = customMaterial; + + } else { + + result = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial; + + } + + if ( ( _renderer.localClippingEnabled && material.clipShadows === true && material.clippingPlanes.length !== 0 ) || + ( material.displacementMap && material.displacementScale !== 0 ) || + ( material.alphaMap && material.alphaTest > 0 ) ) { + + // in this case we need a unique material instance reflecting the + // appropriate state + + const keyA = result.uuid, keyB = material.uuid; + + let materialsForVariant = _materialCache[ keyA ]; + + if ( materialsForVariant === undefined ) { + + materialsForVariant = {}; + _materialCache[ keyA ] = materialsForVariant; + + } + + let cachedMaterial = materialsForVariant[ keyB ]; + + if ( cachedMaterial === undefined ) { + + cachedMaterial = result.clone(); + materialsForVariant[ keyB ] = cachedMaterial; + + } + + result = cachedMaterial; + + } + + result.visible = material.visible; + result.wireframe = material.wireframe; + + if ( type === VSMShadowMap ) { + + result.side = ( material.shadowSide !== null ) ? material.shadowSide : material.side; + + } else { + + result.side = ( material.shadowSide !== null ) ? material.shadowSide : shadowSide[ material.side ]; + + } + + result.alphaMap = material.alphaMap; + result.alphaTest = material.alphaTest; + + result.clipShadows = material.clipShadows; + result.clippingPlanes = material.clippingPlanes; + result.clipIntersection = material.clipIntersection; + + result.displacementMap = material.displacementMap; + result.displacementScale = material.displacementScale; + result.displacementBias = material.displacementBias; + + result.wireframeLinewidth = material.wireframeLinewidth; + result.linewidth = material.linewidth; + + if ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) { + + result.referencePosition.setFromMatrixPosition( light.matrixWorld ); + result.nearDistance = shadowCameraNear; + result.farDistance = shadowCameraFar; + + } + + return result; + + } + + function renderObject( object, camera, shadowCamera, light, type ) { + + if ( object.visible === false ) return; + + const visible = object.layers.test( camera.layers ); + + if ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) { + + if ( ( object.castShadow || ( object.receiveShadow && type === VSMShadowMap ) ) && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) { + + object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); + + const geometry = _objects.update( object ); + const material = object.material; + + if ( Array.isArray( material ) ) { + + const groups = geometry.groups; + + for ( let k = 0, kl = groups.length; k < kl; k ++ ) { + + const group = groups[ k ]; + const groupMaterial = material[ group.materialIndex ]; + + if ( groupMaterial && groupMaterial.visible ) { + + const depthMaterial = getDepthMaterial( object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type ); + + _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group ); + + } + + } + + } else if ( material.visible ) { + + const depthMaterial = getDepthMaterial( object, geometry, material, light, shadowCamera.near, shadowCamera.far, type ); + + _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null ); + + } + + } + + } + + const children = object.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + renderObject( children[ i ], camera, shadowCamera, light, type ); + + } + + } + +} + +function WebGLState( gl, extensions, capabilities ) { + + const isWebGL2 = capabilities.isWebGL2; + + function ColorBuffer() { + + let locked = false; + + const color = new Vector4(); + let currentColorMask = null; + const currentColorClear = new Vector4( 0, 0, 0, 0 ); + + return { + + setMask: function ( colorMask ) { + + if ( currentColorMask !== colorMask && ! locked ) { + + gl.colorMask( colorMask, colorMask, colorMask, colorMask ); + currentColorMask = colorMask; + + } + + }, + + setLocked: function ( lock ) { + + locked = lock; + + }, + + setClear: function ( r, g, b, a, premultipliedAlpha ) { + + if ( premultipliedAlpha === true ) { + + r *= a; g *= a; b *= a; + + } + + color.set( r, g, b, a ); + + if ( currentColorClear.equals( color ) === false ) { + + gl.clearColor( r, g, b, a ); + currentColorClear.copy( color ); + + } + + }, + + reset: function () { + + locked = false; + + currentColorMask = null; + currentColorClear.set( - 1, 0, 0, 0 ); // set to invalid state + + } + + }; + + } + + function DepthBuffer() { + + let locked = false; + + let currentDepthMask = null; + let currentDepthFunc = null; + let currentDepthClear = null; + + return { + + setTest: function ( depthTest ) { + + if ( depthTest ) { + + enable( 2929 ); + + } else { + + disable( 2929 ); + + } + + }, + + setMask: function ( depthMask ) { + + if ( currentDepthMask !== depthMask && ! locked ) { + + gl.depthMask( depthMask ); + currentDepthMask = depthMask; + + } + + }, + + setFunc: function ( depthFunc ) { + + if ( currentDepthFunc !== depthFunc ) { + + if ( depthFunc ) { + + switch ( depthFunc ) { + + case NeverDepth: + + gl.depthFunc( 512 ); + break; + + case AlwaysDepth: + + gl.depthFunc( 519 ); + break; + + case LessDepth: + + gl.depthFunc( 513 ); + break; + + case LessEqualDepth: + + gl.depthFunc( 515 ); + break; + + case EqualDepth: + + gl.depthFunc( 514 ); + break; + + case GreaterEqualDepth: + + gl.depthFunc( 518 ); + break; + + case GreaterDepth: + + gl.depthFunc( 516 ); + break; + + case NotEqualDepth: + + gl.depthFunc( 517 ); + break; + + default: + + gl.depthFunc( 515 ); + + } + + } else { + + gl.depthFunc( 515 ); + + } + + currentDepthFunc = depthFunc; + + } + + }, + + setLocked: function ( lock ) { + + locked = lock; + + }, + + setClear: function ( depth ) { + + if ( currentDepthClear !== depth ) { + + gl.clearDepth( depth ); + currentDepthClear = depth; + + } + + }, + + reset: function () { + + locked = false; + + currentDepthMask = null; + currentDepthFunc = null; + currentDepthClear = null; + + } + + }; + + } + + function StencilBuffer() { + + let locked = false; + + let currentStencilMask = null; + let currentStencilFunc = null; + let currentStencilRef = null; + let currentStencilFuncMask = null; + let currentStencilFail = null; + let currentStencilZFail = null; + let currentStencilZPass = null; + let currentStencilClear = null; + + return { + + setTest: function ( stencilTest ) { + + if ( ! locked ) { + + if ( stencilTest ) { + + enable( 2960 ); + + } else { + + disable( 2960 ); + + } + + } + + }, + + setMask: function ( stencilMask ) { + + if ( currentStencilMask !== stencilMask && ! locked ) { + + gl.stencilMask( stencilMask ); + currentStencilMask = stencilMask; + + } + + }, + + setFunc: function ( stencilFunc, stencilRef, stencilMask ) { + + if ( currentStencilFunc !== stencilFunc || + currentStencilRef !== stencilRef || + currentStencilFuncMask !== stencilMask ) { + + gl.stencilFunc( stencilFunc, stencilRef, stencilMask ); + + currentStencilFunc = stencilFunc; + currentStencilRef = stencilRef; + currentStencilFuncMask = stencilMask; + + } + + }, + + setOp: function ( stencilFail, stencilZFail, stencilZPass ) { + + if ( currentStencilFail !== stencilFail || + currentStencilZFail !== stencilZFail || + currentStencilZPass !== stencilZPass ) { + + gl.stencilOp( stencilFail, stencilZFail, stencilZPass ); + + currentStencilFail = stencilFail; + currentStencilZFail = stencilZFail; + currentStencilZPass = stencilZPass; + + } + + }, + + setLocked: function ( lock ) { + + locked = lock; + + }, + + setClear: function ( stencil ) { + + if ( currentStencilClear !== stencil ) { + + gl.clearStencil( stencil ); + currentStencilClear = stencil; + + } + + }, + + reset: function () { + + locked = false; + + currentStencilMask = null; + currentStencilFunc = null; + currentStencilRef = null; + currentStencilFuncMask = null; + currentStencilFail = null; + currentStencilZFail = null; + currentStencilZPass = null; + currentStencilClear = null; + + } + + }; + + } + + // + + const colorBuffer = new ColorBuffer(); + const depthBuffer = new DepthBuffer(); + const stencilBuffer = new StencilBuffer(); + + let enabledCapabilities = {}; + + let currentBoundFramebuffers = {}; + let currentDrawbuffers = new WeakMap(); + let defaultDrawbuffers = []; + + let currentProgram = null; + + let currentBlendingEnabled = false; + let currentBlending = null; + let currentBlendEquation = null; + let currentBlendSrc = null; + let currentBlendDst = null; + let currentBlendEquationAlpha = null; + let currentBlendSrcAlpha = null; + let currentBlendDstAlpha = null; + let currentPremultipledAlpha = false; + + let currentFlipSided = null; + let currentCullFace = null; + + let currentLineWidth = null; + + let currentPolygonOffsetFactor = null; + let currentPolygonOffsetUnits = null; + + const maxTextures = gl.getParameter( 35661 ); + + let lineWidthAvailable = false; + let version = 0; + const glVersion = gl.getParameter( 7938 ); + + if ( glVersion.indexOf( 'WebGL' ) !== - 1 ) { + + version = parseFloat( /^WebGL (\d)/.exec( glVersion )[ 1 ] ); + lineWidthAvailable = ( version >= 1.0 ); + + } else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) { + + version = parseFloat( /^OpenGL ES (\d)/.exec( glVersion )[ 1 ] ); + lineWidthAvailable = ( version >= 2.0 ); + + } + + let currentTextureSlot = null; + let currentBoundTextures = {}; + + const scissorParam = gl.getParameter( 3088 ); + const viewportParam = gl.getParameter( 2978 ); + + const currentScissor = new Vector4().fromArray( scissorParam ); + const currentViewport = new Vector4().fromArray( viewportParam ); + + function createTexture( type, target, count ) { + + const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4. + const texture = gl.createTexture(); + + gl.bindTexture( type, texture ); + gl.texParameteri( type, 10241, 9728 ); + gl.texParameteri( type, 10240, 9728 ); + + for ( let i = 0; i < count; i ++ ) { + + gl.texImage2D( target + i, 0, 6408, 1, 1, 0, 6408, 5121, data ); + + } + + return texture; + + } + + const emptyTextures = {}; + emptyTextures[ 3553 ] = createTexture( 3553, 3553, 1 ); + emptyTextures[ 34067 ] = createTexture( 34067, 34069, 6 ); + + // init + + colorBuffer.setClear( 0, 0, 0, 1 ); + depthBuffer.setClear( 1 ); + stencilBuffer.setClear( 0 ); + + enable( 2929 ); + depthBuffer.setFunc( LessEqualDepth ); + + setFlipSided( false ); + setCullFace( CullFaceBack ); + enable( 2884 ); + + setBlending( NoBlending ); + + // + + function enable( id ) { + + if ( enabledCapabilities[ id ] !== true ) { + + gl.enable( id ); + enabledCapabilities[ id ] = true; + + } + + } + + function disable( id ) { + + if ( enabledCapabilities[ id ] !== false ) { + + gl.disable( id ); + enabledCapabilities[ id ] = false; + + } + + } + + function bindFramebuffer( target, framebuffer ) { + + if ( currentBoundFramebuffers[ target ] !== framebuffer ) { + + gl.bindFramebuffer( target, framebuffer ); + + currentBoundFramebuffers[ target ] = framebuffer; + + if ( isWebGL2 ) { + + // 36009 is equivalent to 36160 + + if ( target === 36009 ) { + + currentBoundFramebuffers[ 36160 ] = framebuffer; + + } + + if ( target === 36160 ) { + + currentBoundFramebuffers[ 36009 ] = framebuffer; + + } + + } + + return true; + + } + + return false; + + } + + function drawBuffers( renderTarget, framebuffer ) { + + let drawBuffers = defaultDrawbuffers; + + let needsUpdate = false; + + if ( renderTarget ) { + + drawBuffers = currentDrawbuffers.get( framebuffer ); + + if ( drawBuffers === undefined ) { + + drawBuffers = []; + currentDrawbuffers.set( framebuffer, drawBuffers ); + + } + + if ( renderTarget.isWebGLMultipleRenderTargets ) { + + const textures = renderTarget.texture; + + if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== 36064 ) { + + for ( let i = 0, il = textures.length; i < il; i ++ ) { + + drawBuffers[ i ] = 36064 + i; + + } + + drawBuffers.length = textures.length; + + needsUpdate = true; + + } + + } else { + + if ( drawBuffers[ 0 ] !== 36064 ) { + + drawBuffers[ 0 ] = 36064; + + needsUpdate = true; + + } + + } + + } else { + + if ( drawBuffers[ 0 ] !== 1029 ) { + + drawBuffers[ 0 ] = 1029; + + needsUpdate = true; + + } + + } + + if ( needsUpdate ) { + + if ( capabilities.isWebGL2 ) { + + gl.drawBuffers( drawBuffers ); + + } else { + + extensions.get( 'WEBGL_draw_buffers' ).drawBuffersWEBGL( drawBuffers ); + + } + + } + + + } + + function useProgram( program ) { + + if ( currentProgram !== program ) { + + gl.useProgram( program ); + + currentProgram = program; + + return true; + + } + + return false; + + } + + const equationToGL = { + [ AddEquation ]: 32774, + [ SubtractEquation ]: 32778, + [ ReverseSubtractEquation ]: 32779 + }; + + if ( isWebGL2 ) { + + equationToGL[ MinEquation ] = 32775; + equationToGL[ MaxEquation ] = 32776; + + } else { + + const extension = extensions.get( 'EXT_blend_minmax' ); + + if ( extension !== null ) { + + equationToGL[ MinEquation ] = extension.MIN_EXT; + equationToGL[ MaxEquation ] = extension.MAX_EXT; + + } + + } + + const factorToGL = { + [ ZeroFactor ]: 0, + [ OneFactor ]: 1, + [ SrcColorFactor ]: 768, + [ SrcAlphaFactor ]: 770, + [ SrcAlphaSaturateFactor ]: 776, + [ DstColorFactor ]: 774, + [ DstAlphaFactor ]: 772, + [ OneMinusSrcColorFactor ]: 769, + [ OneMinusSrcAlphaFactor ]: 771, + [ OneMinusDstColorFactor ]: 775, + [ OneMinusDstAlphaFactor ]: 773 + }; + + function setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) { + + if ( blending === NoBlending ) { + + if ( currentBlendingEnabled === true ) { + + disable( 3042 ); + currentBlendingEnabled = false; + + } + + return; + + } + + if ( currentBlendingEnabled === false ) { + + enable( 3042 ); + currentBlendingEnabled = true; + + } + + if ( blending !== CustomBlending ) { + + if ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) { + + if ( currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation ) { + + gl.blendEquation( 32774 ); + + currentBlendEquation = AddEquation; + currentBlendEquationAlpha = AddEquation; + + } + + if ( premultipliedAlpha ) { + + switch ( blending ) { + + case NormalBlending: + gl.blendFuncSeparate( 1, 771, 1, 771 ); + break; + + case AdditiveBlending: + gl.blendFunc( 1, 1 ); + break; + + case SubtractiveBlending: + gl.blendFuncSeparate( 0, 769, 0, 1 ); + break; + + case MultiplyBlending: + gl.blendFuncSeparate( 0, 768, 0, 770 ); + break; + + default: + console.error( 'THREE.WebGLState: Invalid blending: ', blending ); + break; + + } + + } else { + + switch ( blending ) { + + case NormalBlending: + gl.blendFuncSeparate( 770, 771, 1, 771 ); + break; + + case AdditiveBlending: + gl.blendFunc( 770, 1 ); + break; + + case SubtractiveBlending: + gl.blendFuncSeparate( 0, 769, 0, 1 ); + break; + + case MultiplyBlending: + gl.blendFunc( 0, 768 ); + break; + + default: + console.error( 'THREE.WebGLState: Invalid blending: ', blending ); + break; + + } + + } + + currentBlendSrc = null; + currentBlendDst = null; + currentBlendSrcAlpha = null; + currentBlendDstAlpha = null; + + currentBlending = blending; + currentPremultipledAlpha = premultipliedAlpha; + + } + + return; + + } + + // custom blending + + blendEquationAlpha = blendEquationAlpha || blendEquation; + blendSrcAlpha = blendSrcAlpha || blendSrc; + blendDstAlpha = blendDstAlpha || blendDst; + + if ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) { + + gl.blendEquationSeparate( equationToGL[ blendEquation ], equationToGL[ blendEquationAlpha ] ); + + currentBlendEquation = blendEquation; + currentBlendEquationAlpha = blendEquationAlpha; + + } + + if ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) { + + gl.blendFuncSeparate( factorToGL[ blendSrc ], factorToGL[ blendDst ], factorToGL[ blendSrcAlpha ], factorToGL[ blendDstAlpha ] ); + + currentBlendSrc = blendSrc; + currentBlendDst = blendDst; + currentBlendSrcAlpha = blendSrcAlpha; + currentBlendDstAlpha = blendDstAlpha; + + } + + currentBlending = blending; + currentPremultipledAlpha = null; + + } + + function setMaterial( material, frontFaceCW ) { + + material.side === DoubleSide + ? disable( 2884 ) + : enable( 2884 ); + + let flipSided = ( material.side === BackSide ); + if ( frontFaceCW ) flipSided = ! flipSided; + + setFlipSided( flipSided ); + + ( material.blending === NormalBlending && material.transparent === false ) + ? setBlending( NoBlending ) + : setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha ); + + depthBuffer.setFunc( material.depthFunc ); + depthBuffer.setTest( material.depthTest ); + depthBuffer.setMask( material.depthWrite ); + colorBuffer.setMask( material.colorWrite ); + + const stencilWrite = material.stencilWrite; + stencilBuffer.setTest( stencilWrite ); + if ( stencilWrite ) { + + stencilBuffer.setMask( material.stencilWriteMask ); + stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask ); + stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass ); + + } + + setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); + + material.alphaToCoverage === true + ? enable( 32926 ) + : disable( 32926 ); + + } + + // + + function setFlipSided( flipSided ) { + + if ( currentFlipSided !== flipSided ) { + + if ( flipSided ) { + + gl.frontFace( 2304 ); + + } else { + + gl.frontFace( 2305 ); + + } + + currentFlipSided = flipSided; + + } + + } + + function setCullFace( cullFace ) { + + if ( cullFace !== CullFaceNone ) { + + enable( 2884 ); + + if ( cullFace !== currentCullFace ) { + + if ( cullFace === CullFaceBack ) { + + gl.cullFace( 1029 ); + + } else if ( cullFace === CullFaceFront ) { + + gl.cullFace( 1028 ); + + } else { + + gl.cullFace( 1032 ); + + } + + } + + } else { + + disable( 2884 ); + + } + + currentCullFace = cullFace; + + } + + function setLineWidth( width ) { + + if ( width !== currentLineWidth ) { + + if ( lineWidthAvailable ) gl.lineWidth( width ); + + currentLineWidth = width; + + } + + } + + function setPolygonOffset( polygonOffset, factor, units ) { + + if ( polygonOffset ) { + + enable( 32823 ); + + if ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) { + + gl.polygonOffset( factor, units ); + + currentPolygonOffsetFactor = factor; + currentPolygonOffsetUnits = units; + + } + + } else { + + disable( 32823 ); + + } + + } + + function setScissorTest( scissorTest ) { + + if ( scissorTest ) { + + enable( 3089 ); + + } else { + + disable( 3089 ); + + } + + } + + // texture + + function activeTexture( webglSlot ) { + + if ( webglSlot === undefined ) webglSlot = 33984 + maxTextures - 1; + + if ( currentTextureSlot !== webglSlot ) { + + gl.activeTexture( webglSlot ); + currentTextureSlot = webglSlot; + + } + + } + + function bindTexture( webglType, webglTexture ) { + + if ( currentTextureSlot === null ) { + + activeTexture(); + + } + + let boundTexture = currentBoundTextures[ currentTextureSlot ]; + + if ( boundTexture === undefined ) { + + boundTexture = { type: undefined, texture: undefined }; + currentBoundTextures[ currentTextureSlot ] = boundTexture; + + } + + if ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) { + + gl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] ); + + boundTexture.type = webglType; + boundTexture.texture = webglTexture; + + } + + } + + function unbindTexture() { + + const boundTexture = currentBoundTextures[ currentTextureSlot ]; + + if ( boundTexture !== undefined && boundTexture.type !== undefined ) { + + gl.bindTexture( boundTexture.type, null ); + + boundTexture.type = undefined; + boundTexture.texture = undefined; + + } + + } + + function compressedTexImage2D() { + + try { + + gl.compressedTexImage2D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + function texSubImage2D() { + + try { + + gl.texSubImage2D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + function texSubImage3D() { + + try { + + gl.texSubImage3D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + function compressedTexSubImage2D() { + + try { + + gl.compressedTexSubImage2D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + function texStorage2D() { + + try { + + gl.texStorage2D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + function texStorage3D() { + + try { + + gl.texStorage3D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + function texImage2D() { + + try { + + gl.texImage2D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + function texImage3D() { + + try { + + gl.texImage3D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); + + } + + } + + // + + function scissor( scissor ) { + + if ( currentScissor.equals( scissor ) === false ) { + + gl.scissor( scissor.x, scissor.y, scissor.z, scissor.w ); + currentScissor.copy( scissor ); + + } + + } + + function viewport( viewport ) { + + if ( currentViewport.equals( viewport ) === false ) { + + gl.viewport( viewport.x, viewport.y, viewport.z, viewport.w ); + currentViewport.copy( viewport ); + + } + + } + + // + + function reset() { + + // reset state + + gl.disable( 3042 ); + gl.disable( 2884 ); + gl.disable( 2929 ); + gl.disable( 32823 ); + gl.disable( 3089 ); + gl.disable( 2960 ); + gl.disable( 32926 ); + + gl.blendEquation( 32774 ); + gl.blendFunc( 1, 0 ); + gl.blendFuncSeparate( 1, 0, 1, 0 ); + + gl.colorMask( true, true, true, true ); + gl.clearColor( 0, 0, 0, 0 ); + + gl.depthMask( true ); + gl.depthFunc( 513 ); + gl.clearDepth( 1 ); + + gl.stencilMask( 0xffffffff ); + gl.stencilFunc( 519, 0, 0xffffffff ); + gl.stencilOp( 7680, 7680, 7680 ); + gl.clearStencil( 0 ); + + gl.cullFace( 1029 ); + gl.frontFace( 2305 ); + + gl.polygonOffset( 0, 0 ); + + gl.activeTexture( 33984 ); + + gl.bindFramebuffer( 36160, null ); + + if ( isWebGL2 === true ) { + + gl.bindFramebuffer( 36009, null ); + gl.bindFramebuffer( 36008, null ); + + } + + gl.useProgram( null ); + + gl.lineWidth( 1 ); + + gl.scissor( 0, 0, gl.canvas.width, gl.canvas.height ); + gl.viewport( 0, 0, gl.canvas.width, gl.canvas.height ); + + // reset internals + + enabledCapabilities = {}; + + currentTextureSlot = null; + currentBoundTextures = {}; + + currentBoundFramebuffers = {}; + currentDrawbuffers = new WeakMap(); + defaultDrawbuffers = []; + + currentProgram = null; + + currentBlendingEnabled = false; + currentBlending = null; + currentBlendEquation = null; + currentBlendSrc = null; + currentBlendDst = null; + currentBlendEquationAlpha = null; + currentBlendSrcAlpha = null; + currentBlendDstAlpha = null; + currentPremultipledAlpha = false; + + currentFlipSided = null; + currentCullFace = null; + + currentLineWidth = null; + + currentPolygonOffsetFactor = null; + currentPolygonOffsetUnits = null; + + currentScissor.set( 0, 0, gl.canvas.width, gl.canvas.height ); + currentViewport.set( 0, 0, gl.canvas.width, gl.canvas.height ); + + colorBuffer.reset(); + depthBuffer.reset(); + stencilBuffer.reset(); + + } + + return { + + buffers: { + color: colorBuffer, + depth: depthBuffer, + stencil: stencilBuffer + }, + + enable: enable, + disable: disable, + + bindFramebuffer: bindFramebuffer, + drawBuffers: drawBuffers, + + useProgram: useProgram, + + setBlending: setBlending, + setMaterial: setMaterial, + + setFlipSided: setFlipSided, + setCullFace: setCullFace, + + setLineWidth: setLineWidth, + setPolygonOffset: setPolygonOffset, + + setScissorTest: setScissorTest, + + activeTexture: activeTexture, + bindTexture: bindTexture, + unbindTexture: unbindTexture, + compressedTexImage2D: compressedTexImage2D, + texImage2D: texImage2D, + texImage3D: texImage3D, + + texStorage2D: texStorage2D, + texStorage3D: texStorage3D, + texSubImage2D: texSubImage2D, + texSubImage3D: texSubImage3D, + compressedTexSubImage2D: compressedTexSubImage2D, + + scissor: scissor, + viewport: viewport, + + reset: reset + + }; + +} + +function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) { + + const isWebGL2 = capabilities.isWebGL2; + const maxTextures = capabilities.maxTextures; + const maxCubemapSize = capabilities.maxCubemapSize; + const maxTextureSize = capabilities.maxTextureSize; + const maxSamples = capabilities.maxSamples; + const hasMultisampledRenderToTexture = extensions.has( 'WEBGL_multisampled_render_to_texture' ); + const MultisampledRenderToTextureExtension = hasMultisampledRenderToTexture ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : undefined; + + const _videoTextures = new WeakMap(); + let _canvas; + + // cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas, + // also OffscreenCanvas.getContext("webgl"), but not OffscreenCanvas.getContext("2d")! + // Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d). + + let useOffscreenCanvas = false; + + try { + + useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' + && ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null; + + } catch ( err ) { + + // Ignore any errors + + } + + function createCanvas( width, height ) { + + // Use OffscreenCanvas when available. Specially needed in web workers + + return useOffscreenCanvas ? + new OffscreenCanvas( width, height ) : createElementNS( 'canvas' ); + + } + + function resizeImage( image, needsPowerOfTwo, needsNewCanvas, maxSize ) { + + let scale = 1; + + // handle case if texture exceeds max size + + if ( image.width > maxSize || image.height > maxSize ) { + + scale = maxSize / Math.max( image.width, image.height ); + + } + + // only perform resize if necessary + + if ( scale < 1 || needsPowerOfTwo === true ) { + + // only perform resize for certain image types + + if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || + ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) || + ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) { + + const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor; + + const width = floor( scale * image.width ); + const height = floor( scale * image.height ); + + if ( _canvas === undefined ) _canvas = createCanvas( width, height ); + + // cube textures can't reuse the same canvas + + const canvas = needsNewCanvas ? createCanvas( width, height ) : _canvas; + + canvas.width = width; + canvas.height = height; + + const context = canvas.getContext( '2d' ); + context.drawImage( image, 0, 0, width, height ); + + console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' ); + + return canvas; + + } else { + + if ( 'data' in image ) { + + console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').' ); + + } + + return image; + + } + + } + + return image; + + } + + function isPowerOfTwo$1( image ) { + + return isPowerOfTwo( image.width ) && isPowerOfTwo( image.height ); + + } + + function textureNeedsPowerOfTwo( texture ) { + + if ( isWebGL2 ) return false; + + return ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) || + ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ); + + } + + function textureNeedsGenerateMipmaps( texture, supportsMips ) { + + return texture.generateMipmaps && supportsMips && + texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter; + + } + + function generateMipmap( target ) { + + _gl.generateMipmap( target ); + + } + + function getInternalFormat( internalFormatName, glFormat, glType, encoding, isVideoTexture = false ) { + + if ( isWebGL2 === false ) return glFormat; + + if ( internalFormatName !== null ) { + + if ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ]; + + console.warn( 'THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \'' + internalFormatName + '\'' ); + + } + + let internalFormat = glFormat; + + if ( glFormat === 6403 ) { + + if ( glType === 5126 ) internalFormat = 33326; + if ( glType === 5131 ) internalFormat = 33325; + if ( glType === 5121 ) internalFormat = 33321; + + } + + if ( glFormat === 33319 ) { + + if ( glType === 5126 ) internalFormat = 33328; + if ( glType === 5131 ) internalFormat = 33327; + if ( glType === 5121 ) internalFormat = 33323; + + } + + if ( glFormat === 6408 ) { + + if ( glType === 5126 ) internalFormat = 34836; + if ( glType === 5131 ) internalFormat = 34842; + if ( glType === 5121 ) internalFormat = ( encoding === sRGBEncoding && isVideoTexture === false ) ? 35907 : 32856; + if ( glType === 32819 ) internalFormat = 32854; + if ( glType === 32820 ) internalFormat = 32855; + + } + + if ( internalFormat === 33325 || internalFormat === 33326 || + internalFormat === 33327 || internalFormat === 33328 || + internalFormat === 34842 || internalFormat === 34836 ) { + + extensions.get( 'EXT_color_buffer_float' ); + + } + + return internalFormat; + + } + + function getMipLevels( texture, image, supportsMips ) { + + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) === true || ( texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) ) { + + return Math.log2( Math.max( image.width, image.height ) ) + 1; + + } else if ( texture.mipmaps !== undefined && texture.mipmaps.length > 0 ) { + + // user-defined mipmaps + + return texture.mipmaps.length; + + } else if ( texture.isCompressedTexture && Array.isArray( texture.image ) ) { + + return image.mipmaps.length; + + } else { + + // texture without mipmaps (only base level) + + return 1; + + } + + } + + // Fallback filters for non-power-of-2 textures + + function filterFallback( f ) { + + if ( f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter ) { + + return 9728; + + } + + return 9729; + + } + + // + + function onTextureDispose( event ) { + + const texture = event.target; + + texture.removeEventListener( 'dispose', onTextureDispose ); + + deallocateTexture( texture ); + + if ( texture.isVideoTexture ) { + + _videoTextures.delete( texture ); + + } + + info.memory.textures --; + + } + + function onRenderTargetDispose( event ) { + + const renderTarget = event.target; + + renderTarget.removeEventListener( 'dispose', onRenderTargetDispose ); + + deallocateRenderTarget( renderTarget ); + + } + + // + + function deallocateTexture( texture ) { + + const textureProperties = properties.get( texture ); + + if ( textureProperties.__webglInit === undefined ) return; + + _gl.deleteTexture( textureProperties.__webglTexture ); + + properties.remove( texture ); + + } + + function deallocateRenderTarget( renderTarget ) { + + const texture = renderTarget.texture; + + const renderTargetProperties = properties.get( renderTarget ); + const textureProperties = properties.get( texture ); + + if ( ! renderTarget ) return; + + if ( textureProperties.__webglTexture !== undefined ) { + + _gl.deleteTexture( textureProperties.__webglTexture ); + + info.memory.textures --; + + } + + if ( renderTarget.depthTexture ) { + + renderTarget.depthTexture.dispose(); + + } + + if ( renderTarget.isWebGLCubeRenderTarget ) { + + for ( let i = 0; i < 6; i ++ ) { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); + + } + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); + if ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer ); + if ( renderTargetProperties.__webglColorRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglColorRenderbuffer ); + if ( renderTargetProperties.__webglDepthRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthRenderbuffer ); + + } + + if ( renderTarget.isWebGLMultipleRenderTargets ) { + + for ( let i = 0, il = texture.length; i < il; i ++ ) { + + const attachmentProperties = properties.get( texture[ i ] ); + + if ( attachmentProperties.__webglTexture ) { + + _gl.deleteTexture( attachmentProperties.__webglTexture ); + + info.memory.textures --; + + } + + properties.remove( texture[ i ] ); + + } + + } + + properties.remove( texture ); + properties.remove( renderTarget ); + + } + + // + + let textureUnits = 0; + + function resetTextureUnits() { + + textureUnits = 0; + + } + + function allocateTextureUnit() { + + const textureUnit = textureUnits; + + if ( textureUnit >= maxTextures ) { + + console.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + maxTextures ); + + } + + textureUnits += 1; + + return textureUnit; + + } + + // + + function setTexture2D( texture, slot ) { + + const textureProperties = properties.get( texture ); + + if ( texture.isVideoTexture ) updateVideoTexture( texture ); + + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + + const image = texture.image; + + if ( image === undefined ) { + + console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined' ); + + } else if ( image.complete === false ) { + + console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' ); + + } else { + + uploadTexture( textureProperties, texture, slot ); + return; + + } + + } + + state.activeTexture( 33984 + slot ); + state.bindTexture( 3553, textureProperties.__webglTexture ); + + } + + function setTexture2DArray( texture, slot ) { + + const textureProperties = properties.get( texture ); + + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + + uploadTexture( textureProperties, texture, slot ); + return; + + } + + state.activeTexture( 33984 + slot ); + state.bindTexture( 35866, textureProperties.__webglTexture ); + + } + + function setTexture3D( texture, slot ) { + + const textureProperties = properties.get( texture ); + + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + + uploadTexture( textureProperties, texture, slot ); + return; + + } + + state.activeTexture( 33984 + slot ); + state.bindTexture( 32879, textureProperties.__webglTexture ); + + } + + function setTextureCube( texture, slot ) { + + const textureProperties = properties.get( texture ); + + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + + uploadCubeTexture( textureProperties, texture, slot ); + return; + + } + + state.activeTexture( 33984 + slot ); + state.bindTexture( 34067, textureProperties.__webglTexture ); + + } + + const wrappingToGL = { + [ RepeatWrapping ]: 10497, + [ ClampToEdgeWrapping ]: 33071, + [ MirroredRepeatWrapping ]: 33648 + }; + + const filterToGL = { + [ NearestFilter ]: 9728, + [ NearestMipmapNearestFilter ]: 9984, + [ NearestMipmapLinearFilter ]: 9986, + + [ LinearFilter ]: 9729, + [ LinearMipmapNearestFilter ]: 9985, + [ LinearMipmapLinearFilter ]: 9987 + }; + + function setTextureParameters( textureType, texture, supportsMips ) { + + if ( supportsMips ) { + + _gl.texParameteri( textureType, 10242, wrappingToGL[ texture.wrapS ] ); + _gl.texParameteri( textureType, 10243, wrappingToGL[ texture.wrapT ] ); + + if ( textureType === 32879 || textureType === 35866 ) { + + _gl.texParameteri( textureType, 32882, wrappingToGL[ texture.wrapR ] ); + + } + + _gl.texParameteri( textureType, 10240, filterToGL[ texture.magFilter ] ); + _gl.texParameteri( textureType, 10241, filterToGL[ texture.minFilter ] ); + + } else { + + _gl.texParameteri( textureType, 10242, 33071 ); + _gl.texParameteri( textureType, 10243, 33071 ); + + if ( textureType === 32879 || textureType === 35866 ) { + + _gl.texParameteri( textureType, 32882, 33071 ); + + } + + if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) { + + console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' ); + + } + + _gl.texParameteri( textureType, 10240, filterFallback( texture.magFilter ) ); + _gl.texParameteri( textureType, 10241, filterFallback( texture.minFilter ) ); + + if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) { + + console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.' ); + + } + + } + + if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) { + + const extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + + if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2 + if ( isWebGL2 === false && ( texture.type === HalfFloatType && extensions.has( 'OES_texture_half_float_linear' ) === false ) ) return; // verify extension for WebGL 1 only + + if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) { + + _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) ); + properties.get( texture ).__currentAnisotropy = texture.anisotropy; + + } + + } + + } + + function initTexture( textureProperties, texture ) { + + if ( textureProperties.__webglInit === undefined ) { + + textureProperties.__webglInit = true; + + texture.addEventListener( 'dispose', onTextureDispose ); + + textureProperties.__webglTexture = _gl.createTexture(); + + info.memory.textures ++; + + } + + } + + function uploadTexture( textureProperties, texture, slot ) { + + let textureType = 3553; + + if ( texture.isDataTexture2DArray ) textureType = 35866; + if ( texture.isDataTexture3D ) textureType = 32879; + + initTexture( textureProperties, texture ); + + state.activeTexture( 33984 + slot ); + state.bindTexture( textureType, textureProperties.__webglTexture ); + + _gl.pixelStorei( 37440, texture.flipY ); + _gl.pixelStorei( 37441, texture.premultiplyAlpha ); + _gl.pixelStorei( 3317, texture.unpackAlignment ); + _gl.pixelStorei( 37443, 0 ); + + const needsPowerOfTwo = textureNeedsPowerOfTwo( texture ) && isPowerOfTwo$1( texture.image ) === false; + let image = resizeImage( texture.image, needsPowerOfTwo, false, maxTextureSize ); + image = verifyColorSpace( texture, image ); + + const supportsMips = isPowerOfTwo$1( image ) || isWebGL2, + glFormat = utils.convert( texture.format, texture.encoding ); + + let glType = utils.convert( texture.type ), + glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding, texture.isVideoTexture ); + + setTextureParameters( textureType, texture, supportsMips ); + + let mipmap; + const mipmaps = texture.mipmaps; + + const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true ); + const allocateMemory = ( textureProperties.__version === undefined ); + const levels = getMipLevels( texture, image, supportsMips ); + + if ( texture.isDepthTexture ) { + + // populate depth texture with dummy data + + glInternalFormat = 6402; + + if ( isWebGL2 ) { + + if ( texture.type === FloatType ) { + + glInternalFormat = 36012; + + } else if ( texture.type === UnsignedIntType ) { + + glInternalFormat = 33190; + + } else if ( texture.type === UnsignedInt248Type ) { + + glInternalFormat = 35056; + + } else { + + glInternalFormat = 33189; // WebGL2 requires sized internalformat for glTexImage2D + + } + + } else { + + if ( texture.type === FloatType ) { + + console.error( 'WebGLRenderer: Floating point depth texture requires WebGL2.' ); + + } + + } + + // validation checks for WebGL 1 + + if ( texture.format === DepthFormat && glInternalFormat === 6402 ) { + + // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are + // DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT + // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) + if ( texture.type !== UnsignedShortType && texture.type !== UnsignedIntType ) { + + console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' ); + + texture.type = UnsignedShortType; + glType = utils.convert( texture.type ); + + } + + } + + if ( texture.format === DepthStencilFormat && glInternalFormat === 6402 ) { + + // Depth stencil textures need the DEPTH_STENCIL internal format + // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) + glInternalFormat = 34041; + + // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are + // DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL. + // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) + if ( texture.type !== UnsignedInt248Type ) { + + console.warn( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' ); + + texture.type = UnsignedInt248Type; + glType = utils.convert( texture.type ); + + } + + } + + // + + if ( useTexStorage && allocateMemory ) { + + state.texStorage2D( 3553, 1, glInternalFormat, image.width, image.height ); + + } else { + + state.texImage2D( 3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null ); + + } + + } else if ( texture.isDataTexture ) { + + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels + + if ( mipmaps.length > 0 && supportsMips ) { + + if ( useTexStorage && allocateMemory ) { + + state.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height ); + + } + + for ( let i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + + if ( useTexStorage ) { + + state.texSubImage2D( 3553, 0, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data ); + + } else { + + state.texImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + + } + + } + + texture.generateMipmaps = false; + + } else { + + if ( useTexStorage ) { + + if ( allocateMemory ) { + + state.texStorage2D( 3553, levels, glInternalFormat, image.width, image.height ); + + } + + state.texSubImage2D( 3553, 0, 0, 0, image.width, image.height, glFormat, glType, image.data ); + + } else { + + state.texImage2D( 3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data ); + + } + + } + + } else if ( texture.isCompressedTexture ) { + + if ( useTexStorage && allocateMemory ) { + + state.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height ); + + } + + for ( let i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + + if ( texture.format !== RGBAFormat ) { + + if ( glFormat !== null ) { + + if ( useTexStorage ) { + + state.compressedTexSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data ); + + } else { + + state.compressedTexImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + + } + + } else { + + console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' ); + + } + + } else { + + if ( useTexStorage ) { + + state.texSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data ); + + } else { + + state.texImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + + } + + } + + } + + } else if ( texture.isDataTexture2DArray ) { + + if ( useTexStorage ) { + + if ( allocateMemory ) { + + state.texStorage3D( 35866, levels, glInternalFormat, image.width, image.height, image.depth ); + + } + + state.texSubImage3D( 35866, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data ); + + } else { + + state.texImage3D( 35866, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data ); + + } + + } else if ( texture.isDataTexture3D ) { + + if ( useTexStorage ) { + + if ( allocateMemory ) { + + state.texStorage3D( 32879, levels, glInternalFormat, image.width, image.height, image.depth ); + + } + + state.texSubImage3D( 32879, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data ); + + } else { + + state.texImage3D( 32879, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data ); + + } + + } else if ( texture.isFramebufferTexture ) { + + if ( useTexStorage && allocateMemory ) { + + state.texStorage2D( 3553, levels, glInternalFormat, image.width, image.height ); + + } else { + + state.texImage2D( 3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null ); + + } + + } else { + + // regular Texture (image, video, canvas) + + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels + + if ( mipmaps.length > 0 && supportsMips ) { + + if ( useTexStorage && allocateMemory ) { + + state.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height ); + + } + + for ( let i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + + if ( useTexStorage ) { + + state.texSubImage2D( 3553, i, 0, 0, glFormat, glType, mipmap ); + + } else { + + state.texImage2D( 3553, i, glInternalFormat, glFormat, glType, mipmap ); + + } + + } + + texture.generateMipmaps = false; + + } else { + + if ( useTexStorage ) { + + if ( allocateMemory ) { + + state.texStorage2D( 3553, levels, glInternalFormat, image.width, image.height ); + + } + + state.texSubImage2D( 3553, 0, 0, 0, glFormat, glType, image ); + + } else { + + state.texImage2D( 3553, 0, glInternalFormat, glFormat, glType, image ); + + } + + } + + } + + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { + + generateMipmap( textureType ); + + } + + textureProperties.__version = texture.version; + + if ( texture.onUpdate ) texture.onUpdate( texture ); + + } + + function uploadCubeTexture( textureProperties, texture, slot ) { + + if ( texture.image.length !== 6 ) return; + + initTexture( textureProperties, texture ); + + state.activeTexture( 33984 + slot ); + state.bindTexture( 34067, textureProperties.__webglTexture ); + + _gl.pixelStorei( 37440, texture.flipY ); + _gl.pixelStorei( 37441, texture.premultiplyAlpha ); + _gl.pixelStorei( 3317, texture.unpackAlignment ); + _gl.pixelStorei( 37443, 0 ); + + const isCompressed = ( texture && ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture ) ); + const isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture ); + + const cubeImage = []; + + for ( let i = 0; i < 6; i ++ ) { + + if ( ! isCompressed && ! isDataTexture ) { + + cubeImage[ i ] = resizeImage( texture.image[ i ], false, true, maxCubemapSize ); + + } else { + + cubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ]; + + } + + cubeImage[ i ] = verifyColorSpace( texture, cubeImage[ i ] ); + + } + + const image = cubeImage[ 0 ], + supportsMips = isPowerOfTwo$1( image ) || isWebGL2, + glFormat = utils.convert( texture.format, texture.encoding ), + glType = utils.convert( texture.type ), + glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding ); + + const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true ); + const allocateMemory = ( textureProperties.__version === undefined ); + let levels = getMipLevels( texture, image, supportsMips ); + + setTextureParameters( 34067, texture, supportsMips ); + + let mipmaps; + + if ( isCompressed ) { + + if ( useTexStorage && allocateMemory ) { + + state.texStorage2D( 34067, levels, glInternalFormat, image.width, image.height ); + + } + + for ( let i = 0; i < 6; i ++ ) { + + mipmaps = cubeImage[ i ].mipmaps; + + for ( let j = 0; j < mipmaps.length; j ++ ) { + + const mipmap = mipmaps[ j ]; + + if ( texture.format !== RGBAFormat ) { + + if ( glFormat !== null ) { + + if ( useTexStorage ) { + + state.compressedTexSubImage2D( 34069 + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data ); + + } else { + + state.compressedTexImage2D( 34069 + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + + } + + } else { + + console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' ); + + } + + } else { + + if ( useTexStorage ) { + + state.texSubImage2D( 34069 + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data ); + + } else { + + state.texImage2D( 34069 + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + + } + + } + + } + + } + + } else { + + mipmaps = texture.mipmaps; + + if ( useTexStorage && allocateMemory ) { + + // TODO: Uniformly handle mipmap definitions + // Normal textures and compressed cube textures define base level + mips with their mipmap array + // Uncompressed cube textures use their mipmap array only for mips (no base level) + + if ( mipmaps.length > 0 ) levels ++; + + state.texStorage2D( 34067, levels, glInternalFormat, cubeImage[ 0 ].width, cubeImage[ 0 ].height ); + + } + + for ( let i = 0; i < 6; i ++ ) { + + if ( isDataTexture ) { + + if ( useTexStorage ) { + + state.texSubImage2D( 34069 + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data ); + + } else { + + state.texImage2D( 34069 + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); + + } + + for ( let j = 0; j < mipmaps.length; j ++ ) { + + const mipmap = mipmaps[ j ]; + const mipmapImage = mipmap.image[ i ].image; + + if ( useTexStorage ) { + + state.texSubImage2D( 34069 + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data ); + + } else { + + state.texImage2D( 34069 + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data ); + + } + + } + + } else { + + if ( useTexStorage ) { + + state.texSubImage2D( 34069 + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] ); + + } else { + + state.texImage2D( 34069 + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] ); + + } + + for ( let j = 0; j < mipmaps.length; j ++ ) { + + const mipmap = mipmaps[ j ]; + + if ( useTexStorage ) { + + state.texSubImage2D( 34069 + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] ); + + } else { + + state.texImage2D( 34069 + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[ i ] ); + + } + + } + + } + + } + + } + + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { + + // We assume images for cube map have the same size. + generateMipmap( 34067 ); + + } + + textureProperties.__version = texture.version; + + if ( texture.onUpdate ) texture.onUpdate( texture ); + + } + + // Render targets + + // Setup storage for target texture and bind it to correct framebuffer + function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) { + + const glFormat = utils.convert( texture.format, texture.encoding ); + const glType = utils.convert( texture.type ); + const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding ); + const renderTargetProperties = properties.get( renderTarget ); + + if ( ! renderTargetProperties.__hasExternalTextures ) { + + if ( textureTarget === 32879 || textureTarget === 35866 ) { + + state.texImage3D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null ); + + } else { + + state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); + + } + + } + + state.bindFramebuffer( 36160, framebuffer ); + if ( renderTarget.useRenderToTexture ) { + + MultisampledRenderToTextureExtension.framebufferTexture2DMultisampleEXT( 36160, attachment, textureTarget, properties.get( texture ).__webglTexture, 0, getRenderTargetSamples( renderTarget ) ); + + } else { + + _gl.framebufferTexture2D( 36160, attachment, textureTarget, properties.get( texture ).__webglTexture, 0 ); + + } + + state.bindFramebuffer( 36160, null ); + + } + + + // Setup storage for internal depth/stencil buffers and bind to correct framebuffer + function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) { + + _gl.bindRenderbuffer( 36161, renderbuffer ); + + if ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) { + + let glInternalFormat = 33189; + + if ( isMultisample || renderTarget.useRenderToTexture ) { + + const depthTexture = renderTarget.depthTexture; + + if ( depthTexture && depthTexture.isDepthTexture ) { + + if ( depthTexture.type === FloatType ) { + + glInternalFormat = 36012; + + } else if ( depthTexture.type === UnsignedIntType ) { + + glInternalFormat = 33190; + + } + + } + + const samples = getRenderTargetSamples( renderTarget ); + + if ( renderTarget.useRenderToTexture ) { + + MultisampledRenderToTextureExtension.renderbufferStorageMultisampleEXT( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height ); + + } else { + + _gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height ); + + } + + } else { + + _gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height ); + + } + + _gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer ); + + } else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) { + + const samples = getRenderTargetSamples( renderTarget ); + + if ( isMultisample && renderTarget.useRenderbuffer ) { + + _gl.renderbufferStorageMultisample( 36161, samples, 35056, renderTarget.width, renderTarget.height ); + + } else if ( renderTarget.useRenderToTexture ) { + + MultisampledRenderToTextureExtension.renderbufferStorageMultisampleEXT( 36161, samples, 35056, renderTarget.width, renderTarget.height ); + + } else { + + _gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height ); + + } + + + _gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer ); + + } else { + + // Use the first texture for MRT so far + const texture = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture[ 0 ] : renderTarget.texture; + + const glFormat = utils.convert( texture.format, texture.encoding ); + const glType = utils.convert( texture.type ); + const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding ); + const samples = getRenderTargetSamples( renderTarget ); + + if ( isMultisample && renderTarget.useRenderbuffer ) { + + _gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height ); + + } else if ( renderTarget.useRenderToTexture ) { + + MultisampledRenderToTextureExtension.renderbufferStorageMultisampleEXT( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height ); + + } else { + + _gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height ); + + } + + } + + _gl.bindRenderbuffer( 36161, null ); + + } + + // Setup resources for a Depth Texture for a FBO (needs an extension) + function setupDepthTexture( framebuffer, renderTarget ) { + + const isCube = ( renderTarget && renderTarget.isWebGLCubeRenderTarget ); + if ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' ); + + state.bindFramebuffer( 36160, framebuffer ); + + if ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) { + + throw new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' ); + + } + + // upload an empty depth texture with framebuffer size + if ( ! properties.get( renderTarget.depthTexture ).__webglTexture || + renderTarget.depthTexture.image.width !== renderTarget.width || + renderTarget.depthTexture.image.height !== renderTarget.height ) { + + renderTarget.depthTexture.image.width = renderTarget.width; + renderTarget.depthTexture.image.height = renderTarget.height; + renderTarget.depthTexture.needsUpdate = true; + + } + + setTexture2D( renderTarget.depthTexture, 0 ); + + const webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture; + const samples = getRenderTargetSamples( renderTarget ); + + if ( renderTarget.depthTexture.format === DepthFormat ) { + + if ( renderTarget.useRenderToTexture ) { + + MultisampledRenderToTextureExtension.framebufferTexture2DMultisampleEXT( 36160, 36096, 3553, webglDepthTexture, 0, samples ); + + } else { + + _gl.framebufferTexture2D( 36160, 36096, 3553, webglDepthTexture, 0 ); + + } + + } else if ( renderTarget.depthTexture.format === DepthStencilFormat ) { + + if ( renderTarget.useRenderToTexture ) { + + MultisampledRenderToTextureExtension.framebufferTexture2DMultisampleEXT( 36160, 33306, 3553, webglDepthTexture, 0, samples ); + + } else { + + _gl.framebufferTexture2D( 36160, 33306, 3553, webglDepthTexture, 0 ); + + } + + } else { + + throw new Error( 'Unknown depthTexture format' ); + + } + + } + + // Setup GL resources for a non-texture depth buffer + function setupDepthRenderbuffer( renderTarget ) { + + const renderTargetProperties = properties.get( renderTarget ); + const isCube = ( renderTarget.isWebGLCubeRenderTarget === true ); + + if ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) { + + if ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' ); + + setupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget ); + + } else { + + if ( isCube ) { + + renderTargetProperties.__webglDepthbuffer = []; + + for ( let i = 0; i < 6; i ++ ) { + + state.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] ); + renderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false ); + + } + + } else { + + state.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer ); + renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false ); + + } + + } + + state.bindFramebuffer( 36160, null ); + + } + + // rebind framebuffer with external textures + function rebindTextures( renderTarget, colorTexture, depthTexture ) { + + const renderTargetProperties = properties.get( renderTarget ); + + if ( colorTexture !== undefined ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, 36064, 3553 ); + + } + + if ( depthTexture !== undefined ) { + + setupDepthRenderbuffer( renderTarget ); + + } + + } + + // Set up GL resources for the render target + function setupRenderTarget( renderTarget ) { + + const texture = renderTarget.texture; + + const renderTargetProperties = properties.get( renderTarget ); + const textureProperties = properties.get( texture ); + + renderTarget.addEventListener( 'dispose', onRenderTargetDispose ); + + if ( renderTarget.isWebGLMultipleRenderTargets !== true ) { + + if ( textureProperties.__webglTexture === undefined ) { + + textureProperties.__webglTexture = _gl.createTexture(); + + } + + textureProperties.__version = texture.version; + info.memory.textures ++; + + } + + const isCube = ( renderTarget.isWebGLCubeRenderTarget === true ); + const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true ); + const isRenderTarget3D = texture.isDataTexture3D || texture.isDataTexture2DArray; + const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2; + + // Setup framebuffer + + if ( isCube ) { + + renderTargetProperties.__webglFramebuffer = []; + + for ( let i = 0; i < 6; i ++ ) { + + renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + + if ( isMultipleRenderTargets ) { + + if ( capabilities.drawBuffers ) { + + const textures = renderTarget.texture; + + for ( let i = 0, il = textures.length; i < il; i ++ ) { + + const attachmentProperties = properties.get( textures[ i ] ); + + if ( attachmentProperties.__webglTexture === undefined ) { + + attachmentProperties.__webglTexture = _gl.createTexture(); + + info.memory.textures ++; + + } + + } + + } else { + + console.warn( 'THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.' ); + + } + + } else if ( renderTarget.useRenderbuffer ) { + + if ( isWebGL2 ) { + + renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer(); + renderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer(); + + _gl.bindRenderbuffer( 36161, renderTargetProperties.__webglColorRenderbuffer ); + + const glFormat = utils.convert( texture.format, texture.encoding ); + const glType = utils.convert( texture.type ); + const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding ); + const samples = getRenderTargetSamples( renderTarget ); + _gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height ); + + state.bindFramebuffer( 36160, renderTargetProperties.__webglMultisampledFramebuffer ); + _gl.framebufferRenderbuffer( 36160, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer ); + _gl.bindRenderbuffer( 36161, null ); + + if ( renderTarget.depthBuffer ) { + + renderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true ); + + } + + state.bindFramebuffer( 36160, null ); + + + } else { + + console.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' ); + + } + + } + + } + + // Setup color buffer + + if ( isCube ) { + + state.bindTexture( 34067, textureProperties.__webglTexture ); + setTextureParameters( 34067, texture, supportsMips ); + + for ( let i = 0; i < 6; i ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, 36064, 34069 + i ); + + } + + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { + + generateMipmap( 34067 ); + + } + + state.unbindTexture(); + + } else if ( isMultipleRenderTargets ) { + + const textures = renderTarget.texture; + + for ( let i = 0, il = textures.length; i < il; i ++ ) { + + const attachment = textures[ i ]; + const attachmentProperties = properties.get( attachment ); + + state.bindTexture( 3553, attachmentProperties.__webglTexture ); + setTextureParameters( 3553, attachment, supportsMips ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, 36064 + i, 3553 ); + + if ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) { + + generateMipmap( 3553 ); + + } + + } + + state.unbindTexture(); + + } else { + + let glTextureType = 3553; + + if ( isRenderTarget3D ) { + + // Render targets containing layers, i.e: Texture 3D and 2d arrays + + if ( isWebGL2 ) { + + const isTexture3D = texture.isDataTexture3D; + glTextureType = isTexture3D ? 32879 : 35866; + + } else { + + console.warn( 'THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.' ); + + } + + } + + state.bindTexture( glTextureType, textureProperties.__webglTexture ); + setTextureParameters( glTextureType, texture, supportsMips ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, 36064, glTextureType ); + + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { + + generateMipmap( glTextureType ); + + } + + state.unbindTexture(); + + } + + // Setup depth and stencil buffers + + if ( renderTarget.depthBuffer ) { + + setupDepthRenderbuffer( renderTarget ); + + } + + } + + function updateRenderTargetMipmap( renderTarget ) { + + const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2; + + const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ]; + + for ( let i = 0, il = textures.length; i < il; i ++ ) { + + const texture = textures[ i ]; + + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { + + const target = renderTarget.isWebGLCubeRenderTarget ? 34067 : 3553; + const webglTexture = properties.get( texture ).__webglTexture; + + state.bindTexture( target, webglTexture ); + generateMipmap( target ); + state.unbindTexture(); + + } + + } + + } + + function updateMultisampleRenderTarget( renderTarget ) { + + if ( renderTarget.useRenderbuffer ) { + + if ( isWebGL2 ) { + + const width = renderTarget.width; + const height = renderTarget.height; + let mask = 16384; + const invalidationArray = [ 36064 ]; + const depthStyle = renderTarget.stencilBuffer ? 33306 : 36096; + + if ( renderTarget.depthBuffer ) { + + invalidationArray.push( depthStyle ); + + } + + if ( ! renderTarget.ignoreDepthForMultisampleCopy ) { + + if ( renderTarget.depthBuffer ) mask |= 256; + if ( renderTarget.stencilBuffer ) mask |= 1024; + + } + + const renderTargetProperties = properties.get( renderTarget ); + + state.bindFramebuffer( 36008, renderTargetProperties.__webglMultisampledFramebuffer ); + state.bindFramebuffer( 36009, renderTargetProperties.__webglFramebuffer ); + + if ( renderTarget.ignoreDepthForMultisampleCopy ) { + + _gl.invalidateFramebuffer( 36008, [ depthStyle ] ); + _gl.invalidateFramebuffer( 36009, [ depthStyle ] ); + + } + + _gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, 9728 ); + _gl.invalidateFramebuffer( 36008, invalidationArray ); + + state.bindFramebuffer( 36008, null ); + state.bindFramebuffer( 36009, renderTargetProperties.__webglMultisampledFramebuffer ); + + } else { + + console.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' ); + + } + + } + + } + + function getRenderTargetSamples( renderTarget ) { + + return ( isWebGL2 && ( renderTarget.useRenderbuffer || renderTarget.useRenderToTexture ) ) ? + Math.min( maxSamples, renderTarget.samples ) : 0; + + } + + function updateVideoTexture( texture ) { + + const frame = info.render.frame; + + // Check the last frame we updated the VideoTexture + + if ( _videoTextures.get( texture ) !== frame ) { + + _videoTextures.set( texture, frame ); + texture.update(); + + } + + } + + function verifyColorSpace( texture, image ) { + + const encoding = texture.encoding; + const format = texture.format; + const type = texture.type; + + if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image; + + if ( encoding !== LinearEncoding ) { + + // sRGB + + if ( encoding === sRGBEncoding ) { + + if ( isWebGL2 === false ) { + + // in WebGL 1, try to use EXT_sRGB extension and unsized formats + + if ( extensions.has( 'EXT_sRGB' ) === true && format === RGBAFormat ) { + + texture.format = _SRGBAFormat; + + // it's not possible to generate mips in WebGL 1 with this extension + + texture.minFilter = LinearFilter; + texture.generateMipmaps = false; + + } else { + + // slow fallback (CPU decode) + + image = ImageUtils.sRGBToLinear( image ); + + } + + } else { + + // in WebGL 2 uncompressed textures can only be sRGB encoded if they have the RGBA8 format + + if ( format !== RGBAFormat || type !== UnsignedByteType ) { + + console.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' ); + + } + + } + + } else { + + console.error( 'THREE.WebGLTextures: Unsupported texture encoding:', encoding ); + + } + + } + + return image; + + } + + // backwards compatibility + + let warnedTexture2D = false; + let warnedTextureCube = false; + + function safeSetTexture2D( texture, slot ) { + + if ( texture && texture.isWebGLRenderTarget ) { + + if ( warnedTexture2D === false ) { + + console.warn( 'THREE.WebGLTextures.safeSetTexture2D: don\'t use render targets as textures. Use their .texture property instead.' ); + warnedTexture2D = true; + + } + + texture = texture.texture; + + } + + setTexture2D( texture, slot ); + + } + + function safeSetTextureCube( texture, slot ) { + + if ( texture && texture.isWebGLCubeRenderTarget ) { + + if ( warnedTextureCube === false ) { + + console.warn( 'THREE.WebGLTextures.safeSetTextureCube: don\'t use cube render targets as textures. Use their .texture property instead.' ); + warnedTextureCube = true; + + } + + texture = texture.texture; + + } + + + setTextureCube( texture, slot ); + + } + + // + + this.allocateTextureUnit = allocateTextureUnit; + this.resetTextureUnits = resetTextureUnits; + + this.setTexture2D = setTexture2D; + this.setTexture2DArray = setTexture2DArray; + this.setTexture3D = setTexture3D; + this.setTextureCube = setTextureCube; + this.rebindTextures = rebindTextures; + this.setupRenderTarget = setupRenderTarget; + this.updateRenderTargetMipmap = updateRenderTargetMipmap; + this.updateMultisampleRenderTarget = updateMultisampleRenderTarget; + this.setupDepthRenderbuffer = setupDepthRenderbuffer; + this.setupFrameBufferTexture = setupFrameBufferTexture; + + this.safeSetTexture2D = safeSetTexture2D; + this.safeSetTextureCube = safeSetTextureCube; + +} + +function WebGLUtils( gl, extensions, capabilities ) { + + const isWebGL2 = capabilities.isWebGL2; + + function convert( p, encoding = null ) { + + let extension; + + if ( p === UnsignedByteType ) return 5121; + if ( p === UnsignedShort4444Type ) return 32819; + if ( p === UnsignedShort5551Type ) return 32820; + + if ( p === ByteType ) return 5120; + if ( p === ShortType ) return 5122; + if ( p === UnsignedShortType ) return 5123; + if ( p === IntType ) return 5124; + if ( p === UnsignedIntType ) return 5125; + if ( p === FloatType ) return 5126; + + if ( p === HalfFloatType ) { + + if ( isWebGL2 ) return 5131; + + extension = extensions.get( 'OES_texture_half_float' ); + + if ( extension !== null ) { + + return extension.HALF_FLOAT_OES; + + } else { + + return null; + + } + + } + + if ( p === AlphaFormat ) return 6406; + if ( p === RGBAFormat ) return 6408; + if ( p === LuminanceFormat ) return 6409; + if ( p === LuminanceAlphaFormat ) return 6410; + if ( p === DepthFormat ) return 6402; + if ( p === DepthStencilFormat ) return 34041; + if ( p === RedFormat ) return 6403; + + if ( p === RGBFormat ) { + + console.warn( 'THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228' ); + return 6408; + + } + + // WebGL 1 sRGB fallback + + if ( p === _SRGBAFormat ) { + + extension = extensions.get( 'EXT_sRGB' ); + + if ( extension !== null ) { + + return extension.SRGB_ALPHA_EXT; + + } else { + + return null; + + } + + } + + // WebGL2 formats. + + if ( p === RedIntegerFormat ) return 36244; + if ( p === RGFormat ) return 33319; + if ( p === RGIntegerFormat ) return 33320; + if ( p === RGBAIntegerFormat ) return 36249; + + // S3TC + + if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { + + if ( encoding === sRGBEncoding ) { + + extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' ); + + if ( extension !== null ) { + + if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + + } else { + + return null; + + } + + } else { + + extension = extensions.get( 'WEBGL_compressed_texture_s3tc' ); + + if ( extension !== null ) { + + if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; + if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; + + } else { + + return null; + + } + + } + + } + + // PVRTC + + if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' ); + + if ( extension !== null ) { + + if ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + if ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + + } else { + + return null; + + } + + } + + // ETC1 + + if ( p === RGB_ETC1_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_etc1' ); + + if ( extension !== null ) { + + return extension.COMPRESSED_RGB_ETC1_WEBGL; + + } else { + + return null; + + } + + } + + // ETC2 + + if ( p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_etc' ); + + if ( extension !== null ) { + + if ( p === RGB_ETC2_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; + if ( p === RGBA_ETC2_EAC_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; + + } else { + + return null; + + } + + } + + // ASTC + + if ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || + p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || + p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || + p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || + p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_astc' ); + + if ( extension !== null ) { + + if ( p === RGBA_ASTC_4x4_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; + if ( p === RGBA_ASTC_5x4_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; + if ( p === RGBA_ASTC_5x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; + if ( p === RGBA_ASTC_6x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; + if ( p === RGBA_ASTC_6x6_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; + if ( p === RGBA_ASTC_8x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; + if ( p === RGBA_ASTC_8x6_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; + if ( p === RGBA_ASTC_8x8_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; + if ( p === RGBA_ASTC_10x5_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; + if ( p === RGBA_ASTC_10x6_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; + if ( p === RGBA_ASTC_10x8_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; + if ( p === RGBA_ASTC_10x10_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; + if ( p === RGBA_ASTC_12x10_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; + if ( p === RGBA_ASTC_12x12_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; + + } else { + + return null; + + } + + } + + // BPTC + + if ( p === RGBA_BPTC_Format ) { + + extension = extensions.get( 'EXT_texture_compression_bptc' ); + + if ( extension !== null ) { + + if ( p === RGBA_BPTC_Format ) return ( encoding === sRGBEncoding ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + + } else { + + return null; + + } + + } + + // + + if ( p === UnsignedInt248Type ) { + + if ( isWebGL2 ) return 34042; + + extension = extensions.get( 'WEBGL_depth_texture' ); + + if ( extension !== null ) { + + return extension.UNSIGNED_INT_24_8_WEBGL; + + } else { + + return null; + + } + + } + + } + + return { convert: convert }; + +} + +class ArrayCamera extends PerspectiveCamera { + + constructor( array = [] ) { + + super(); + + this.cameras = array; + + } + +} + +ArrayCamera.prototype.isArrayCamera = true; + +class Group extends Object3D { + + constructor() { + + super(); + + this.type = 'Group'; + + } + +} + +Group.prototype.isGroup = true; + +const _moveEvent = { type: 'move' }; + +class WebXRController { + + constructor() { + + this._targetRay = null; + this._grip = null; + this._hand = null; + + } + + getHandSpace() { + + if ( this._hand === null ) { + + this._hand = new Group(); + this._hand.matrixAutoUpdate = false; + this._hand.visible = false; + + this._hand.joints = {}; + this._hand.inputState = { pinching: false }; + + } + + return this._hand; + + } + + getTargetRaySpace() { + + if ( this._targetRay === null ) { + + this._targetRay = new Group(); + this._targetRay.matrixAutoUpdate = false; + this._targetRay.visible = false; + this._targetRay.hasLinearVelocity = false; + this._targetRay.linearVelocity = new Vector3(); + this._targetRay.hasAngularVelocity = false; + this._targetRay.angularVelocity = new Vector3(); + + } + + return this._targetRay; + + } + + getGripSpace() { + + if ( this._grip === null ) { + + this._grip = new Group(); + this._grip.matrixAutoUpdate = false; + this._grip.visible = false; + this._grip.hasLinearVelocity = false; + this._grip.linearVelocity = new Vector3(); + this._grip.hasAngularVelocity = false; + this._grip.angularVelocity = new Vector3(); + + } + + return this._grip; + + } + + dispatchEvent( event ) { + + if ( this._targetRay !== null ) { + + this._targetRay.dispatchEvent( event ); + + } + + if ( this._grip !== null ) { + + this._grip.dispatchEvent( event ); + + } + + if ( this._hand !== null ) { + + this._hand.dispatchEvent( event ); + + } + + return this; + + } + + disconnect( inputSource ) { + + this.dispatchEvent( { type: 'disconnected', data: inputSource } ); + + if ( this._targetRay !== null ) { + + this._targetRay.visible = false; + + } + + if ( this._grip !== null ) { + + this._grip.visible = false; + + } + + if ( this._hand !== null ) { + + this._hand.visible = false; + + } + + return this; + + } + + update( inputSource, frame, referenceSpace ) { + + let inputPose = null; + let gripPose = null; + let handPose = null; + + const targetRay = this._targetRay; + const grip = this._grip; + const hand = this._hand; + + if ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) { + + if ( targetRay !== null ) { + + inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace ); + + if ( inputPose !== null ) { + + targetRay.matrix.fromArray( inputPose.transform.matrix ); + targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale ); + + if ( inputPose.linearVelocity ) { + + targetRay.hasLinearVelocity = true; + targetRay.linearVelocity.copy( inputPose.linearVelocity ); + + } else { + + targetRay.hasLinearVelocity = false; + + } + + if ( inputPose.angularVelocity ) { + + targetRay.hasAngularVelocity = true; + targetRay.angularVelocity.copy( inputPose.angularVelocity ); + + } else { + + targetRay.hasAngularVelocity = false; + + } + + this.dispatchEvent( _moveEvent ); + + } + + } + + if ( hand && inputSource.hand ) { + + handPose = true; + + for ( const inputjoint of inputSource.hand.values() ) { + + // Update the joints groups with the XRJoint poses + const jointPose = frame.getJointPose( inputjoint, referenceSpace ); + + if ( hand.joints[ inputjoint.jointName ] === undefined ) { + + // The transform of this joint will be updated with the joint pose on each frame + const joint = new Group(); + joint.matrixAutoUpdate = false; + joint.visible = false; + hand.joints[ inputjoint.jointName ] = joint; + // ?? + hand.add( joint ); + + } + + const joint = hand.joints[ inputjoint.jointName ]; + + if ( jointPose !== null ) { + + joint.matrix.fromArray( jointPose.transform.matrix ); + joint.matrix.decompose( joint.position, joint.rotation, joint.scale ); + joint.jointRadius = jointPose.radius; + + } + + joint.visible = jointPose !== null; + + } + + // Custom events + + // Check pinchz + const indexTip = hand.joints[ 'index-finger-tip' ]; + const thumbTip = hand.joints[ 'thumb-tip' ]; + const distance = indexTip.position.distanceTo( thumbTip.position ); + + const distanceToPinch = 0.02; + const threshold = 0.005; + + if ( hand.inputState.pinching && distance > distanceToPinch + threshold ) { + + hand.inputState.pinching = false; + this.dispatchEvent( { + type: 'pinchend', + handedness: inputSource.handedness, + target: this + } ); + + } else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) { + + hand.inputState.pinching = true; + this.dispatchEvent( { + type: 'pinchstart', + handedness: inputSource.handedness, + target: this + } ); + + } + + } else { + + if ( grip !== null && inputSource.gripSpace ) { + + gripPose = frame.getPose( inputSource.gripSpace, referenceSpace ); + + if ( gripPose !== null ) { + + grip.matrix.fromArray( gripPose.transform.matrix ); + grip.matrix.decompose( grip.position, grip.rotation, grip.scale ); + + if ( gripPose.linearVelocity ) { + + grip.hasLinearVelocity = true; + grip.linearVelocity.copy( gripPose.linearVelocity ); + + } else { + + grip.hasLinearVelocity = false; + + } + + if ( gripPose.angularVelocity ) { + + grip.hasAngularVelocity = true; + grip.angularVelocity.copy( gripPose.angularVelocity ); + + } else { + + grip.hasAngularVelocity = false; + + } + + } + + } + + } + + } + + if ( targetRay !== null ) { + + targetRay.visible = ( inputPose !== null ); + + } + + if ( grip !== null ) { + + grip.visible = ( gripPose !== null ); + + } + + if ( hand !== null ) { + + hand.visible = ( handPose !== null ); + + } + + return this; + + } + +} + +class DepthTexture extends Texture { + + constructor( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) { + + format = format !== undefined ? format : DepthFormat; + + if ( format !== DepthFormat && format !== DepthStencilFormat ) { + + throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' ); + + } + + if ( type === undefined && format === DepthFormat ) type = UnsignedShortType; + if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type; + + super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + + this.image = { width: width, height: height }; + + this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; + this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; + + this.flipY = false; + this.generateMipmaps = false; + + } + + +} + +DepthTexture.prototype.isDepthTexture = true; + +class WebXRManager extends EventDispatcher { + + constructor( renderer, gl ) { + + super(); + + const scope = this; + + let session = null; + let framebufferScaleFactor = 1.0; + + let referenceSpace = null; + let referenceSpaceType = 'local-floor'; + const hasMultisampledRenderToTexture = renderer.extensions.has( 'WEBGL_multisampled_render_to_texture' ); + + let pose = null; + let glBinding = null; + let glProjLayer = null; + let glBaseLayer = null; + let isMultisample = false; + let xrFrame = null; + const attributes = gl.getContextAttributes(); + let initialRenderTarget = null; + let newRenderTarget = null; + + const controllers = []; + const inputSourcesMap = new Map(); + + // + + const cameraL = new PerspectiveCamera(); + cameraL.layers.enable( 1 ); + cameraL.viewport = new Vector4(); + + const cameraR = new PerspectiveCamera(); + cameraR.layers.enable( 2 ); + cameraR.viewport = new Vector4(); + + const cameras = [ cameraL, cameraR ]; + + const cameraVR = new ArrayCamera(); + cameraVR.layers.enable( 1 ); + cameraVR.layers.enable( 2 ); + + let _currentDepthNear = null; + let _currentDepthFar = null; + + // + + this.cameraAutoUpdate = true; + this.enabled = false; + + this.isPresenting = false; + + this.getController = function ( index ) { + + let controller = controllers[ index ]; + + if ( controller === undefined ) { + + controller = new WebXRController(); + controllers[ index ] = controller; + + } + + return controller.getTargetRaySpace(); + + }; + + this.getControllerGrip = function ( index ) { + + let controller = controllers[ index ]; + + if ( controller === undefined ) { + + controller = new WebXRController(); + controllers[ index ] = controller; + + } + + return controller.getGripSpace(); + + }; + + this.getHand = function ( index ) { + + let controller = controllers[ index ]; + + if ( controller === undefined ) { + + controller = new WebXRController(); + controllers[ index ] = controller; + + } + + return controller.getHandSpace(); + + }; + + // + + function onSessionEvent( event ) { + + const controller = inputSourcesMap.get( event.inputSource ); + + if ( controller ) { + + controller.dispatchEvent( { type: event.type, data: event.inputSource } ); + + } + + } + + function onSessionEnd() { + + inputSourcesMap.forEach( function ( controller, inputSource ) { + + controller.disconnect( inputSource ); + + } ); + + inputSourcesMap.clear(); + + _currentDepthNear = null; + _currentDepthFar = null; + + // restore framebuffer/rendering state + + renderer.setRenderTarget( initialRenderTarget ); + + glBaseLayer = null; + glProjLayer = null; + glBinding = null; + session = null; + newRenderTarget = null; + + // + + animation.stop(); + + scope.isPresenting = false; + + scope.dispatchEvent( { type: 'sessionend' } ); + + } + + this.setFramebufferScaleFactor = function ( value ) { + + framebufferScaleFactor = value; + + if ( scope.isPresenting === true ) { + + console.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' ); + + } + + }; + + this.setReferenceSpaceType = function ( value ) { + + referenceSpaceType = value; + + if ( scope.isPresenting === true ) { + + console.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' ); + + } + + }; + + this.getReferenceSpace = function () { + + return referenceSpace; + + }; + + this.getBaseLayer = function () { + + return glProjLayer !== null ? glProjLayer : glBaseLayer; + + }; + + this.getBinding = function () { + + return glBinding; + + }; + + this.getFrame = function () { + + return xrFrame; + + }; + + this.getSession = function () { + + return session; + + }; + + this.setSession = async function ( value ) { + + session = value; + + if ( session !== null ) { + + initialRenderTarget = renderer.getRenderTarget(); + + session.addEventListener( 'select', onSessionEvent ); + session.addEventListener( 'selectstart', onSessionEvent ); + session.addEventListener( 'selectend', onSessionEvent ); + session.addEventListener( 'squeeze', onSessionEvent ); + session.addEventListener( 'squeezestart', onSessionEvent ); + session.addEventListener( 'squeezeend', onSessionEvent ); + session.addEventListener( 'end', onSessionEnd ); + session.addEventListener( 'inputsourceschange', onInputSourcesChange ); + + if ( attributes.xrCompatible !== true ) { + + await gl.makeXRCompatible(); + + } + + if ( ( session.renderState.layers === undefined ) || ( renderer.capabilities.isWebGL2 === false ) ) { + + const layerInit = { + antialias: ( session.renderState.layers === undefined ) ? attributes.antialias : true, + alpha: attributes.alpha, + depth: attributes.depth, + stencil: attributes.stencil, + framebufferScaleFactor: framebufferScaleFactor + }; + + glBaseLayer = new XRWebGLLayer( session, gl, layerInit ); + + session.updateRenderState( { baseLayer: glBaseLayer } ); + + newRenderTarget = new WebGLRenderTarget( + glBaseLayer.framebufferWidth, + glBaseLayer.framebufferHeight, + { + format: RGBAFormat, + type: UnsignedByteType, + encoding: renderer.outputEncoding + } + ); + + } else { + + isMultisample = attributes.antialias; + let depthFormat = null; + let depthType = null; + let glDepthFormat = null; + + if ( attributes.depth ) { + + glDepthFormat = attributes.stencil ? 35056 : 33190; + depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat; + depthType = attributes.stencil ? UnsignedInt248Type : UnsignedShortType; + + } + + const projectionlayerInit = { + colorFormat: ( renderer.outputEncoding === sRGBEncoding ) ? 35907 : 32856, + depthFormat: glDepthFormat, + scaleFactor: framebufferScaleFactor + }; + + glBinding = new XRWebGLBinding( session, gl ); + + glProjLayer = glBinding.createProjectionLayer( projectionlayerInit ); + + session.updateRenderState( { layers: [ glProjLayer ] } ); + + if ( isMultisample ) { + + newRenderTarget = new WebGLMultisampleRenderTarget( + glProjLayer.textureWidth, + glProjLayer.textureHeight, + { + format: RGBAFormat, + type: UnsignedByteType, + depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ), + stencilBuffer: attributes.stencil, + ignoreDepth: glProjLayer.ignoreDepthValues, + useRenderToTexture: hasMultisampledRenderToTexture, + encoding: renderer.outputEncoding + } ); + + } else { + + newRenderTarget = new WebGLRenderTarget( + glProjLayer.textureWidth, + glProjLayer.textureHeight, + { + format: RGBAFormat, + type: UnsignedByteType, + depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ), + stencilBuffer: attributes.stencil, + ignoreDepth: glProjLayer.ignoreDepthValues, + encoding: renderer.outputEncoding + } ); + + } + + } + + newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278 + + // Set foveation to maximum. + this.setFoveation( 1.0 ); + + referenceSpace = await session.requestReferenceSpace( referenceSpaceType ); + + animation.setContext( session ); + animation.start(); + + scope.isPresenting = true; + + scope.dispatchEvent( { type: 'sessionstart' } ); + + } + + }; + + function onInputSourcesChange( event ) { + + const inputSources = session.inputSources; + + // Assign inputSources to available controllers + + for ( let i = 0; i < controllers.length; i ++ ) { + + inputSourcesMap.set( inputSources[ i ], controllers[ i ] ); + + } + + // Notify disconnected + + for ( let i = 0; i < event.removed.length; i ++ ) { + + const inputSource = event.removed[ i ]; + const controller = inputSourcesMap.get( inputSource ); + + if ( controller ) { + + controller.dispatchEvent( { type: 'disconnected', data: inputSource } ); + inputSourcesMap.delete( inputSource ); + + } + + } + + // Notify connected + + for ( let i = 0; i < event.added.length; i ++ ) { + + const inputSource = event.added[ i ]; + const controller = inputSourcesMap.get( inputSource ); + + if ( controller ) { + + controller.dispatchEvent( { type: 'connected', data: inputSource } ); + + } + + } + + } + + // + + const cameraLPos = new Vector3(); + const cameraRPos = new Vector3(); + + /** + * Assumes 2 cameras that are parallel and share an X-axis, and that + * the cameras' projection and world matrices have already been set. + * And that near and far planes are identical for both cameras. + * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765 + */ + function setProjectionFromUnion( camera, cameraL, cameraR ) { + + cameraLPos.setFromMatrixPosition( cameraL.matrixWorld ); + cameraRPos.setFromMatrixPosition( cameraR.matrixWorld ); + + const ipd = cameraLPos.distanceTo( cameraRPos ); + + const projL = cameraL.projectionMatrix.elements; + const projR = cameraR.projectionMatrix.elements; + + // VR systems will have identical far and near planes, and + // most likely identical top and bottom frustum extents. + // Use the left camera for these values. + const near = projL[ 14 ] / ( projL[ 10 ] - 1 ); + const far = projL[ 14 ] / ( projL[ 10 ] + 1 ); + const topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ]; + const bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ]; + + const leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ]; + const rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ]; + const left = near * leftFov; + const right = near * rightFov; + + // Calculate the new camera's position offset from the + // left camera. xOffset should be roughly half `ipd`. + const zOffset = ipd / ( - leftFov + rightFov ); + const xOffset = zOffset * - leftFov; + + // TODO: Better way to apply this offset? + cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale ); + camera.translateX( xOffset ); + camera.translateZ( zOffset ); + camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale ); + camera.matrixWorldInverse.copy( camera.matrixWorld ).invert(); + + // Find the union of the frustum values of the cameras and scale + // the values so that the near plane's position does not change in world space, + // although must now be relative to the new union camera. + const near2 = near + zOffset; + const far2 = far + zOffset; + const left2 = left - xOffset; + const right2 = right + ( ipd - xOffset ); + const top2 = topFov * far / far2 * near2; + const bottom2 = bottomFov * far / far2 * near2; + + camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 ); + + } + + function updateCamera( camera, parent ) { + + if ( parent === null ) { + + camera.matrixWorld.copy( camera.matrix ); + + } else { + + camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix ); + + } + + camera.matrixWorldInverse.copy( camera.matrixWorld ).invert(); + + } + + this.updateCamera = function ( camera ) { + + if ( session === null ) return; + + cameraVR.near = cameraR.near = cameraL.near = camera.near; + cameraVR.far = cameraR.far = cameraL.far = camera.far; + + if ( _currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far ) { + + // Note that the new renderState won't apply until the next frame. See #18320 + + session.updateRenderState( { + depthNear: cameraVR.near, + depthFar: cameraVR.far + } ); + + _currentDepthNear = cameraVR.near; + _currentDepthFar = cameraVR.far; + + } + + const parent = camera.parent; + const cameras = cameraVR.cameras; + + updateCamera( cameraVR, parent ); + + for ( let i = 0; i < cameras.length; i ++ ) { + + updateCamera( cameras[ i ], parent ); + + } + + cameraVR.matrixWorld.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale ); + + // update user camera and its children + + camera.position.copy( cameraVR.position ); + camera.quaternion.copy( cameraVR.quaternion ); + camera.scale.copy( cameraVR.scale ); + camera.matrix.copy( cameraVR.matrix ); + camera.matrixWorld.copy( cameraVR.matrixWorld ); + + const children = camera.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].updateMatrixWorld( true ); + + } + + // update projection matrix for proper view frustum culling + + if ( cameras.length === 2 ) { + + setProjectionFromUnion( cameraVR, cameraL, cameraR ); + + } else { + + // assume single camera setup (AR) + + cameraVR.projectionMatrix.copy( cameraL.projectionMatrix ); + + } + + }; + + this.getCamera = function () { + + return cameraVR; + + }; + + this.getFoveation = function () { + + if ( glProjLayer !== null ) { + + return glProjLayer.fixedFoveation; + + } + + if ( glBaseLayer !== null ) { + + return glBaseLayer.fixedFoveation; + + } + + return undefined; + + }; + + this.setFoveation = function ( foveation ) { + + // 0 = no foveation = full resolution + // 1 = maximum foveation = the edges render at lower resolution + + if ( glProjLayer !== null ) { + + glProjLayer.fixedFoveation = foveation; + + } + + if ( glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined ) { + + glBaseLayer.fixedFoveation = foveation; + + } + + }; + + // Animation Loop + + let onAnimationFrameCallback = null; + + function onAnimationFrame( time, frame ) { + + pose = frame.getViewerPose( referenceSpace ); + xrFrame = frame; + + if ( pose !== null ) { + + const views = pose.views; + + if ( glBaseLayer !== null ) { + + renderer.setRenderTargetFramebuffer( newRenderTarget, glBaseLayer.framebuffer ); + renderer.setRenderTarget( newRenderTarget ); + + } + + let cameraVRNeedsUpdate = false; + + // check if it's necessary to rebuild cameraVR's camera list + + if ( views.length !== cameraVR.cameras.length ) { + + cameraVR.cameras.length = 0; + cameraVRNeedsUpdate = true; + + } + + for ( let i = 0; i < views.length; i ++ ) { + + const view = views[ i ]; + + let viewport = null; + + if ( glBaseLayer !== null ) { + + viewport = glBaseLayer.getViewport( view ); + + } else { + + const glSubImage = glBinding.getViewSubImage( glProjLayer, view ); + viewport = glSubImage.viewport; + + // For side-by-side projection, we only produce a single texture for both eyes. + if ( i === 0 ) { + + renderer.setRenderTargetTextures( + newRenderTarget, + glSubImage.colorTexture, + glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture ); + + renderer.setRenderTarget( newRenderTarget ); + + } + + } + + const camera = cameras[ i ]; + + camera.matrix.fromArray( view.transform.matrix ); + camera.projectionMatrix.fromArray( view.projectionMatrix ); + camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height ); + + if ( i === 0 ) { + + cameraVR.matrix.copy( camera.matrix ); + + } + + if ( cameraVRNeedsUpdate === true ) { + + cameraVR.cameras.push( camera ); + + } + + } + + } + + // + + const inputSources = session.inputSources; + + for ( let i = 0; i < controllers.length; i ++ ) { + + const controller = controllers[ i ]; + const inputSource = inputSources[ i ]; + + controller.update( inputSource, frame, referenceSpace ); + + } + + if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame ); + + xrFrame = null; + + } + + const animation = new WebGLAnimation(); + + animation.setAnimationLoop( onAnimationFrame ); + + this.setAnimationLoop = function ( callback ) { + + onAnimationFrameCallback = callback; + + }; + + this.dispose = function () {}; + + } + +} + +function WebGLMaterials( properties ) { + + function refreshFogUniforms( uniforms, fog ) { + + uniforms.fogColor.value.copy( fog.color ); + + if ( fog.isFog ) { + + uniforms.fogNear.value = fog.near; + uniforms.fogFar.value = fog.far; + + } else if ( fog.isFogExp2 ) { + + uniforms.fogDensity.value = fog.density; + + } + + } + + function refreshMaterialUniforms( uniforms, material, pixelRatio, height, transmissionRenderTarget ) { + + if ( material.isMeshBasicMaterial ) { + + refreshUniformsCommon( uniforms, material ); + + } else if ( material.isMeshLambertMaterial ) { + + refreshUniformsCommon( uniforms, material ); + refreshUniformsLambert( uniforms, material ); + + } else if ( material.isMeshToonMaterial ) { + + refreshUniformsCommon( uniforms, material ); + refreshUniformsToon( uniforms, material ); + + } else if ( material.isMeshPhongMaterial ) { + + refreshUniformsCommon( uniforms, material ); + refreshUniformsPhong( uniforms, material ); + + } else if ( material.isMeshStandardMaterial ) { + + refreshUniformsCommon( uniforms, material ); + + if ( material.isMeshPhysicalMaterial ) { + + refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ); + + } else { + + refreshUniformsStandard( uniforms, material ); + + } + + } else if ( material.isMeshMatcapMaterial ) { + + refreshUniformsCommon( uniforms, material ); + refreshUniformsMatcap( uniforms, material ); + + } else if ( material.isMeshDepthMaterial ) { + + refreshUniformsCommon( uniforms, material ); + refreshUniformsDepth( uniforms, material ); + + } else if ( material.isMeshDistanceMaterial ) { + + refreshUniformsCommon( uniforms, material ); + refreshUniformsDistance( uniforms, material ); + + } else if ( material.isMeshNormalMaterial ) { + + refreshUniformsCommon( uniforms, material ); + refreshUniformsNormal( uniforms, material ); + + } else if ( material.isLineBasicMaterial ) { + + refreshUniformsLine( uniforms, material ); + + if ( material.isLineDashedMaterial ) { + + refreshUniformsDash( uniforms, material ); + + } + + } else if ( material.isPointsMaterial ) { + + refreshUniformsPoints( uniforms, material, pixelRatio, height ); + + } else if ( material.isSpriteMaterial ) { + + refreshUniformsSprites( uniforms, material ); + + } else if ( material.isShadowMaterial ) { + + uniforms.color.value.copy( material.color ); + uniforms.opacity.value = material.opacity; + + } else if ( material.isShaderMaterial ) { + + material.uniformsNeedUpdate = false; // #15581 + + } + + } + + function refreshUniformsCommon( uniforms, material ) { + + uniforms.opacity.value = material.opacity; + + if ( material.color ) { + + uniforms.diffuse.value.copy( material.color ); + + } + + if ( material.emissive ) { + + uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity ); + + } + + if ( material.map ) { + + uniforms.map.value = material.map; + + } + + if ( material.alphaMap ) { + + uniforms.alphaMap.value = material.alphaMap; + + } + + if ( material.specularMap ) { + + uniforms.specularMap.value = material.specularMap; + + } + + if ( material.alphaTest > 0 ) { + + uniforms.alphaTest.value = material.alphaTest; + + } + + const envMap = properties.get( material ).envMap; + + if ( envMap ) { + + uniforms.envMap.value = envMap; + + uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1; + + uniforms.reflectivity.value = material.reflectivity; + uniforms.ior.value = material.ior; + uniforms.refractionRatio.value = material.refractionRatio; + + } + + if ( material.lightMap ) { + + uniforms.lightMap.value = material.lightMap; + uniforms.lightMapIntensity.value = material.lightMapIntensity; + + } + + if ( material.aoMap ) { + + uniforms.aoMap.value = material.aoMap; + uniforms.aoMapIntensity.value = material.aoMapIntensity; + + } + + // uv repeat and offset setting priorities + // 1. color map + // 2. specular map + // 3. displacementMap map + // 4. normal map + // 5. bump map + // 6. roughnessMap map + // 7. metalnessMap map + // 8. alphaMap map + // 9. emissiveMap map + // 10. clearcoat map + // 11. clearcoat normal map + // 12. clearcoat roughnessMap map + // 13. specular intensity map + // 14. specular tint map + // 15. transmission map + // 16. thickness map + + let uvScaleMap; + + if ( material.map ) { + + uvScaleMap = material.map; + + } else if ( material.specularMap ) { + + uvScaleMap = material.specularMap; + + } else if ( material.displacementMap ) { + + uvScaleMap = material.displacementMap; + + } else if ( material.normalMap ) { + + uvScaleMap = material.normalMap; + + } else if ( material.bumpMap ) { + + uvScaleMap = material.bumpMap; + + } else if ( material.roughnessMap ) { + + uvScaleMap = material.roughnessMap; + + } else if ( material.metalnessMap ) { + + uvScaleMap = material.metalnessMap; + + } else if ( material.alphaMap ) { + + uvScaleMap = material.alphaMap; + + } else if ( material.emissiveMap ) { + + uvScaleMap = material.emissiveMap; + + } else if ( material.clearcoatMap ) { + + uvScaleMap = material.clearcoatMap; + + } else if ( material.clearcoatNormalMap ) { + + uvScaleMap = material.clearcoatNormalMap; + + } else if ( material.clearcoatRoughnessMap ) { + + uvScaleMap = material.clearcoatRoughnessMap; + + } else if ( material.specularIntensityMap ) { + + uvScaleMap = material.specularIntensityMap; + + } else if ( material.specularColorMap ) { + + uvScaleMap = material.specularColorMap; + + } else if ( material.transmissionMap ) { + + uvScaleMap = material.transmissionMap; + + } else if ( material.thicknessMap ) { + + uvScaleMap = material.thicknessMap; + + } else if ( material.sheenColorMap ) { + + uvScaleMap = material.sheenColorMap; + + } else if ( material.sheenRoughnessMap ) { + + uvScaleMap = material.sheenRoughnessMap; + + } + + if ( uvScaleMap !== undefined ) { + + // backwards compatibility + if ( uvScaleMap.isWebGLRenderTarget ) { + + uvScaleMap = uvScaleMap.texture; + + } + + if ( uvScaleMap.matrixAutoUpdate === true ) { + + uvScaleMap.updateMatrix(); + + } + + uniforms.uvTransform.value.copy( uvScaleMap.matrix ); + + } + + // uv repeat and offset setting priorities for uv2 + // 1. ao map + // 2. light map + + let uv2ScaleMap; + + if ( material.aoMap ) { + + uv2ScaleMap = material.aoMap; + + } else if ( material.lightMap ) { + + uv2ScaleMap = material.lightMap; + + } + + if ( uv2ScaleMap !== undefined ) { + + // backwards compatibility + if ( uv2ScaleMap.isWebGLRenderTarget ) { + + uv2ScaleMap = uv2ScaleMap.texture; + + } + + if ( uv2ScaleMap.matrixAutoUpdate === true ) { + + uv2ScaleMap.updateMatrix(); + + } + + uniforms.uv2Transform.value.copy( uv2ScaleMap.matrix ); + + } + + } + + function refreshUniformsLine( uniforms, material ) { + + uniforms.diffuse.value.copy( material.color ); + uniforms.opacity.value = material.opacity; + + } + + function refreshUniformsDash( uniforms, material ) { + + uniforms.dashSize.value = material.dashSize; + uniforms.totalSize.value = material.dashSize + material.gapSize; + uniforms.scale.value = material.scale; + + } + + function refreshUniformsPoints( uniforms, material, pixelRatio, height ) { + + uniforms.diffuse.value.copy( material.color ); + uniforms.opacity.value = material.opacity; + uniforms.size.value = material.size * pixelRatio; + uniforms.scale.value = height * 0.5; + + if ( material.map ) { + + uniforms.map.value = material.map; + + } + + if ( material.alphaMap ) { + + uniforms.alphaMap.value = material.alphaMap; + + } + + if ( material.alphaTest > 0 ) { + + uniforms.alphaTest.value = material.alphaTest; + + } + + // uv repeat and offset setting priorities + // 1. color map + // 2. alpha map + + let uvScaleMap; + + if ( material.map ) { + + uvScaleMap = material.map; + + } else if ( material.alphaMap ) { + + uvScaleMap = material.alphaMap; + + } + + if ( uvScaleMap !== undefined ) { + + if ( uvScaleMap.matrixAutoUpdate === true ) { + + uvScaleMap.updateMatrix(); + + } + + uniforms.uvTransform.value.copy( uvScaleMap.matrix ); + + } + + } + + function refreshUniformsSprites( uniforms, material ) { + + uniforms.diffuse.value.copy( material.color ); + uniforms.opacity.value = material.opacity; + uniforms.rotation.value = material.rotation; + + if ( material.map ) { + + uniforms.map.value = material.map; + + } + + if ( material.alphaMap ) { + + uniforms.alphaMap.value = material.alphaMap; + + } + + if ( material.alphaTest > 0 ) { + + uniforms.alphaTest.value = material.alphaTest; + + } + + // uv repeat and offset setting priorities + // 1. color map + // 2. alpha map + + let uvScaleMap; + + if ( material.map ) { + + uvScaleMap = material.map; + + } else if ( material.alphaMap ) { + + uvScaleMap = material.alphaMap; + + } + + if ( uvScaleMap !== undefined ) { + + if ( uvScaleMap.matrixAutoUpdate === true ) { + + uvScaleMap.updateMatrix(); + + } + + uniforms.uvTransform.value.copy( uvScaleMap.matrix ); + + } + + } + + function refreshUniformsLambert( uniforms, material ) { + + if ( material.emissiveMap ) { + + uniforms.emissiveMap.value = material.emissiveMap; + + } + + } + + function refreshUniformsPhong( uniforms, material ) { + + uniforms.specular.value.copy( material.specular ); + uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 ) + + if ( material.emissiveMap ) { + + uniforms.emissiveMap.value = material.emissiveMap; + + } + + if ( material.bumpMap ) { + + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; + + } + + if ( material.normalMap ) { + + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy( material.normalScale ); + if ( material.side === BackSide ) uniforms.normalScale.value.negate(); + + } + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + } + + function refreshUniformsToon( uniforms, material ) { + + if ( material.gradientMap ) { + + uniforms.gradientMap.value = material.gradientMap; + + } + + if ( material.emissiveMap ) { + + uniforms.emissiveMap.value = material.emissiveMap; + + } + + if ( material.bumpMap ) { + + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; + + } + + if ( material.normalMap ) { + + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy( material.normalScale ); + if ( material.side === BackSide ) uniforms.normalScale.value.negate(); + + } + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + } + + function refreshUniformsStandard( uniforms, material ) { + + uniforms.roughness.value = material.roughness; + uniforms.metalness.value = material.metalness; + + if ( material.roughnessMap ) { + + uniforms.roughnessMap.value = material.roughnessMap; + + } + + if ( material.metalnessMap ) { + + uniforms.metalnessMap.value = material.metalnessMap; + + } + + if ( material.emissiveMap ) { + + uniforms.emissiveMap.value = material.emissiveMap; + + } + + if ( material.bumpMap ) { + + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; + + } + + if ( material.normalMap ) { + + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy( material.normalScale ); + if ( material.side === BackSide ) uniforms.normalScale.value.negate(); + + } + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + const envMap = properties.get( material ).envMap; + + if ( envMap ) { + + //uniforms.envMap.value = material.envMap; // part of uniforms common + uniforms.envMapIntensity.value = material.envMapIntensity; + + } + + } + + function refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ) { + + refreshUniformsStandard( uniforms, material ); + + uniforms.ior.value = material.ior; // also part of uniforms common + + if ( material.sheen > 0 ) { + + uniforms.sheenColor.value.copy( material.sheenColor ).multiplyScalar( material.sheen ); + + uniforms.sheenRoughness.value = material.sheenRoughness; + + if ( material.sheenColorMap ) { + + uniforms.sheenColorMap.value = material.sheenColorMap; + + } + + if ( material.sheenRoughnessMap ) { + + uniforms.sheenRoughnessMap.value = material.sheenRoughnessMap; + + } + + } + + if ( material.clearcoat > 0 ) { + + uniforms.clearcoat.value = material.clearcoat; + uniforms.clearcoatRoughness.value = material.clearcoatRoughness; + + if ( material.clearcoatMap ) { + + uniforms.clearcoatMap.value = material.clearcoatMap; + + } + + if ( material.clearcoatRoughnessMap ) { + + uniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap; + + } + + if ( material.clearcoatNormalMap ) { + + uniforms.clearcoatNormalScale.value.copy( material.clearcoatNormalScale ); + uniforms.clearcoatNormalMap.value = material.clearcoatNormalMap; + + if ( material.side === BackSide ) { + + uniforms.clearcoatNormalScale.value.negate(); + + } + + } + + } + + if ( material.transmission > 0 ) { + + uniforms.transmission.value = material.transmission; + uniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture; + uniforms.transmissionSamplerSize.value.set( transmissionRenderTarget.width, transmissionRenderTarget.height ); + + if ( material.transmissionMap ) { + + uniforms.transmissionMap.value = material.transmissionMap; + + } + + uniforms.thickness.value = material.thickness; + + if ( material.thicknessMap ) { + + uniforms.thicknessMap.value = material.thicknessMap; + + } + + uniforms.attenuationDistance.value = material.attenuationDistance; + uniforms.attenuationColor.value.copy( material.attenuationColor ); + + } + + uniforms.specularIntensity.value = material.specularIntensity; + uniforms.specularColor.value.copy( material.specularColor ); + + if ( material.specularIntensityMap ) { + + uniforms.specularIntensityMap.value = material.specularIntensityMap; + + } + + if ( material.specularColorMap ) { + + uniforms.specularColorMap.value = material.specularColorMap; + + } + + } + + function refreshUniformsMatcap( uniforms, material ) { + + if ( material.matcap ) { + + uniforms.matcap.value = material.matcap; + + } + + if ( material.bumpMap ) { + + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; + + } + + if ( material.normalMap ) { + + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy( material.normalScale ); + if ( material.side === BackSide ) uniforms.normalScale.value.negate(); + + } + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + } + + function refreshUniformsDepth( uniforms, material ) { + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + } + + function refreshUniformsDistance( uniforms, material ) { + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + uniforms.referencePosition.value.copy( material.referencePosition ); + uniforms.nearDistance.value = material.nearDistance; + uniforms.farDistance.value = material.farDistance; + + } + + function refreshUniformsNormal( uniforms, material ) { + + if ( material.bumpMap ) { + + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; + + } + + if ( material.normalMap ) { + + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy( material.normalScale ); + if ( material.side === BackSide ) uniforms.normalScale.value.negate(); + + } + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + } + + return { + refreshFogUniforms: refreshFogUniforms, + refreshMaterialUniforms: refreshMaterialUniforms + }; + +} + +function createCanvasElement() { + + const canvas = createElementNS( 'canvas' ); + canvas.style.display = 'block'; + return canvas; + +} + +function WebGLRenderer( parameters = {} ) { + + const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(), + _context = parameters.context !== undefined ? parameters.context : null, + + _alpha = parameters.alpha !== undefined ? parameters.alpha : false, + _depth = parameters.depth !== undefined ? parameters.depth : true, + _stencil = parameters.stencil !== undefined ? parameters.stencil : true, + _antialias = parameters.antialias !== undefined ? parameters.antialias : false, + _premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true, + _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false, + _powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default', + _failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false; + + let currentRenderList = null; + let currentRenderState = null; + + // render() can be called from within a callback triggered by another render. + // We track this so that the nested render call gets its list and state isolated from the parent render call. + + const renderListStack = []; + const renderStateStack = []; + + // public properties + + this.domElement = _canvas; + + // Debug configuration container + this.debug = { + + /** + * Enables error checking and reporting when shader programs are being compiled + * @type {boolean} + */ + checkShaderErrors: true + }; + + // clearing + + this.autoClear = true; + this.autoClearColor = true; + this.autoClearDepth = true; + this.autoClearStencil = true; + + // scene graph + + this.sortObjects = true; + + // user-defined clipping + + this.clippingPlanes = []; + this.localClippingEnabled = false; + + // physically based shading + + this.outputEncoding = LinearEncoding; + + // physical lights + + this.physicallyCorrectLights = false; + + // tone mapping + + this.toneMapping = NoToneMapping; + this.toneMappingExposure = 1.0; + + // internal properties + + const _this = this; + + let _isContextLost = false; + + // internal state cache + + let _currentActiveCubeFace = 0; + let _currentActiveMipmapLevel = 0; + let _currentRenderTarget = null; + let _currentMaterialId = - 1; + + let _currentCamera = null; + + const _currentViewport = new Vector4(); + const _currentScissor = new Vector4(); + let _currentScissorTest = null; + + // + + let _width = _canvas.width; + let _height = _canvas.height; + + let _pixelRatio = 1; + let _opaqueSort = null; + let _transparentSort = null; + + const _viewport = new Vector4( 0, 0, _width, _height ); + const _scissor = new Vector4( 0, 0, _width, _height ); + let _scissorTest = false; + + // frustum + + const _frustum = new Frustum(); + + // clipping + + let _clippingEnabled = false; + let _localClippingEnabled = false; + + // transmission + + let _transmissionRenderTarget = null; + + // camera matrices cache + + const _projScreenMatrix = new Matrix4(); + + const _vector3 = new Vector3(); + + const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true }; + + function getTargetPixelRatio() { + + return _currentRenderTarget === null ? _pixelRatio : 1; + + } + + // initialize + + let _gl = _context; + + function getContext( contextNames, contextAttributes ) { + + for ( let i = 0; i < contextNames.length; i ++ ) { + + const contextName = contextNames[ i ]; + const context = _canvas.getContext( contextName, contextAttributes ); + if ( context !== null ) return context; + + } + + return null; + + } + + try { + + const contextAttributes = { + alpha: true, + depth: _depth, + stencil: _stencil, + antialias: _antialias, + premultipliedAlpha: _premultipliedAlpha, + preserveDrawingBuffer: _preserveDrawingBuffer, + powerPreference: _powerPreference, + failIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat + }; + + // OffscreenCanvas does not have setAttribute, see #22811 + if ( 'setAttribute' in _canvas ) _canvas.setAttribute( 'data-engine', `three.js r${REVISION}` ); + + // event listeners must be registered before WebGL context is created, see #12753 + _canvas.addEventListener( 'webglcontextlost', onContextLost, false ); + _canvas.addEventListener( 'webglcontextrestored', onContextRestore, false ); + + if ( _gl === null ) { + + const contextNames = [ 'webgl2', 'webgl', 'experimental-webgl' ]; + + if ( _this.isWebGL1Renderer === true ) { + + contextNames.shift(); + + } + + _gl = getContext( contextNames, contextAttributes ); + + if ( _gl === null ) { + + if ( getContext( contextNames ) ) { + + throw new Error( 'Error creating WebGL context with your selected attributes.' ); + + } else { + + throw new Error( 'Error creating WebGL context.' ); + + } + + } + + } + + // Some experimental-webgl implementations do not have getShaderPrecisionFormat + + if ( _gl.getShaderPrecisionFormat === undefined ) { + + _gl.getShaderPrecisionFormat = function () { + + return { 'rangeMin': 1, 'rangeMax': 1, 'precision': 1 }; + + }; + + } + + } catch ( error ) { + + console.error( 'THREE.WebGLRenderer: ' + error.message ); + throw error; + + } + + let extensions, capabilities, state, info; + let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects; + let programCache, materials, renderLists, renderStates, clipping, shadowMap; + + let background, morphtargets, bufferRenderer, indexedBufferRenderer; + + let utils, bindingStates; + + function initGLContext() { + + extensions = new WebGLExtensions( _gl ); + + capabilities = new WebGLCapabilities( _gl, extensions, parameters ); + + extensions.init( capabilities ); + + utils = new WebGLUtils( _gl, extensions, capabilities ); + + state = new WebGLState( _gl, extensions, capabilities ); + + info = new WebGLInfo( _gl ); + properties = new WebGLProperties(); + textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ); + cubemaps = new WebGLCubeMaps( _this ); + cubeuvmaps = new WebGLCubeUVMaps( _this ); + attributes = new WebGLAttributes( _gl, capabilities ); + bindingStates = new WebGLBindingStates( _gl, extensions, attributes, capabilities ); + geometries = new WebGLGeometries( _gl, attributes, info, bindingStates ); + objects = new WebGLObjects( _gl, geometries, attributes, info ); + morphtargets = new WebGLMorphtargets( _gl, capabilities, textures ); + clipping = new WebGLClipping( properties ); + programCache = new WebGLPrograms( _this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ); + materials = new WebGLMaterials( properties ); + renderLists = new WebGLRenderLists(); + renderStates = new WebGLRenderStates( extensions, capabilities ); + background = new WebGLBackground( _this, cubemaps, state, objects, _alpha, _premultipliedAlpha ); + shadowMap = new WebGLShadowMap( _this, objects, capabilities ); + + bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities ); + indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities ); + + info.programs = programCache.programs; + + _this.capabilities = capabilities; + _this.extensions = extensions; + _this.properties = properties; + _this.renderLists = renderLists; + _this.shadowMap = shadowMap; + _this.state = state; + _this.info = info; + + } + + initGLContext(); + + // xr + + const xr = new WebXRManager( _this, _gl ); + + this.xr = xr; + + // API + + this.getContext = function () { + + return _gl; + + }; + + this.getContextAttributes = function () { + + return _gl.getContextAttributes(); + + }; + + this.forceContextLoss = function () { + + const extension = extensions.get( 'WEBGL_lose_context' ); + if ( extension ) extension.loseContext(); + + }; + + this.forceContextRestore = function () { + + const extension = extensions.get( 'WEBGL_lose_context' ); + if ( extension ) extension.restoreContext(); + + }; + + this.getPixelRatio = function () { + + return _pixelRatio; + + }; + + this.setPixelRatio = function ( value ) { + + if ( value === undefined ) return; + + _pixelRatio = value; + + this.setSize( _width, _height, false ); + + }; + + this.getSize = function ( target ) { + + return target.set( _width, _height ); + + }; + + this.setSize = function ( width, height, updateStyle ) { + + if ( xr.isPresenting ) { + + console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' ); + return; + + } + + _width = width; + _height = height; + + _canvas.width = Math.floor( width * _pixelRatio ); + _canvas.height = Math.floor( height * _pixelRatio ); + + if ( updateStyle !== false ) { + + _canvas.style.width = width + 'px'; + _canvas.style.height = height + 'px'; + + } + + this.setViewport( 0, 0, width, height ); + + }; + + this.getDrawingBufferSize = function ( target ) { + + return target.set( _width * _pixelRatio, _height * _pixelRatio ).floor(); + + }; + + this.setDrawingBufferSize = function ( width, height, pixelRatio ) { + + _width = width; + _height = height; + + _pixelRatio = pixelRatio; + + _canvas.width = Math.floor( width * pixelRatio ); + _canvas.height = Math.floor( height * pixelRatio ); + + this.setViewport( 0, 0, width, height ); + + }; + + this.getCurrentViewport = function ( target ) { + + return target.copy( _currentViewport ); + + }; + + this.getViewport = function ( target ) { + + return target.copy( _viewport ); + + }; + + this.setViewport = function ( x, y, width, height ) { + + if ( x.isVector4 ) { + + _viewport.set( x.x, x.y, x.z, x.w ); + + } else { + + _viewport.set( x, y, width, height ); + + } + + state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() ); + + }; + + this.getScissor = function ( target ) { + + return target.copy( _scissor ); + + }; + + this.setScissor = function ( x, y, width, height ) { + + if ( x.isVector4 ) { + + _scissor.set( x.x, x.y, x.z, x.w ); + + } else { + + _scissor.set( x, y, width, height ); + + } + + state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() ); + + }; + + this.getScissorTest = function () { + + return _scissorTest; + + }; + + this.setScissorTest = function ( boolean ) { + + state.setScissorTest( _scissorTest = boolean ); + + }; + + this.setOpaqueSort = function ( method ) { + + _opaqueSort = method; + + }; + + this.setTransparentSort = function ( method ) { + + _transparentSort = method; + + }; + + // Clearing + + this.getClearColor = function ( target ) { + + return target.copy( background.getClearColor() ); + + }; + + this.setClearColor = function () { + + background.setClearColor.apply( background, arguments ); + + }; + + this.getClearAlpha = function () { + + return background.getClearAlpha(); + + }; + + this.setClearAlpha = function () { + + background.setClearAlpha.apply( background, arguments ); + + }; + + this.clear = function ( color, depth, stencil ) { + + let bits = 0; + + if ( color === undefined || color ) bits |= 16384; + if ( depth === undefined || depth ) bits |= 256; + if ( stencil === undefined || stencil ) bits |= 1024; + + _gl.clear( bits ); + + }; + + this.clearColor = function () { + + this.clear( true, false, false ); + + }; + + this.clearDepth = function () { + + this.clear( false, true, false ); + + }; + + this.clearStencil = function () { + + this.clear( false, false, true ); + + }; + + // + + this.dispose = function () { + + _canvas.removeEventListener( 'webglcontextlost', onContextLost, false ); + _canvas.removeEventListener( 'webglcontextrestored', onContextRestore, false ); + + renderLists.dispose(); + renderStates.dispose(); + properties.dispose(); + cubemaps.dispose(); + cubeuvmaps.dispose(); + objects.dispose(); + bindingStates.dispose(); + programCache.dispose(); + + xr.dispose(); + + xr.removeEventListener( 'sessionstart', onXRSessionStart ); + xr.removeEventListener( 'sessionend', onXRSessionEnd ); + + if ( _transmissionRenderTarget ) { + + _transmissionRenderTarget.dispose(); + _transmissionRenderTarget = null; + + } + + animation.stop(); + + }; + + // Events + + function onContextLost( event ) { + + event.preventDefault(); + + console.log( 'THREE.WebGLRenderer: Context Lost.' ); + + _isContextLost = true; + + } + + function onContextRestore( /* event */ ) { + + console.log( 'THREE.WebGLRenderer: Context Restored.' ); + + _isContextLost = false; + + const infoAutoReset = info.autoReset; + const shadowMapEnabled = shadowMap.enabled; + const shadowMapAutoUpdate = shadowMap.autoUpdate; + const shadowMapNeedsUpdate = shadowMap.needsUpdate; + const shadowMapType = shadowMap.type; + + initGLContext(); + + info.autoReset = infoAutoReset; + shadowMap.enabled = shadowMapEnabled; + shadowMap.autoUpdate = shadowMapAutoUpdate; + shadowMap.needsUpdate = shadowMapNeedsUpdate; + shadowMap.type = shadowMapType; + + } + + function onMaterialDispose( event ) { + + const material = event.target; + + material.removeEventListener( 'dispose', onMaterialDispose ); + + deallocateMaterial( material ); + + } + + // Buffer deallocation + + function deallocateMaterial( material ) { + + releaseMaterialProgramReferences( material ); + + properties.remove( material ); + + } + + + function releaseMaterialProgramReferences( material ) { + + const programs = properties.get( material ).programs; + + if ( programs !== undefined ) { + + programs.forEach( function ( program ) { + + programCache.releaseProgram( program ); + + } ); + + if ( material.isShaderMaterial ) { + + programCache.releaseShaderCache( material ); + + } + + } + + } + + // Buffer rendering + + this.renderBufferDirect = function ( camera, scene, geometry, material, object, group ) { + + if ( scene === null ) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null) + + const frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 ); + + const program = setProgram( camera, scene, geometry, material, object ); + + state.setMaterial( material, frontFaceCW ); + + // + + let index = geometry.index; + const position = geometry.attributes.position; + + // + + if ( index === null ) { + + if ( position === undefined || position.count === 0 ) return; + + } else if ( index.count === 0 ) { + + return; + + } + + // + + let rangeFactor = 1; + + if ( material.wireframe === true ) { + + index = geometries.getWireframeAttribute( geometry ); + rangeFactor = 2; + + } + + bindingStates.setup( object, material, program, geometry, index ); + + let attribute; + let renderer = bufferRenderer; + + if ( index !== null ) { + + attribute = attributes.get( index ); + + renderer = indexedBufferRenderer; + renderer.setIndex( attribute ); + + } + + // + + const dataCount = ( index !== null ) ? index.count : position.count; + + const rangeStart = geometry.drawRange.start * rangeFactor; + const rangeCount = geometry.drawRange.count * rangeFactor; + + const groupStart = group !== null ? group.start * rangeFactor : 0; + const groupCount = group !== null ? group.count * rangeFactor : Infinity; + + const drawStart = Math.max( rangeStart, groupStart ); + const drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1; + + const drawCount = Math.max( 0, drawEnd - drawStart + 1 ); + + if ( drawCount === 0 ) return; + + // + + if ( object.isMesh ) { + + if ( material.wireframe === true ) { + + state.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() ); + renderer.setMode( 1 ); + + } else { + + renderer.setMode( 4 ); + + } + + } else if ( object.isLine ) { + + let lineWidth = material.linewidth; + + if ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material + + state.setLineWidth( lineWidth * getTargetPixelRatio() ); + + if ( object.isLineSegments ) { + + renderer.setMode( 1 ); + + } else if ( object.isLineLoop ) { + + renderer.setMode( 2 ); + + } else { + + renderer.setMode( 3 ); + + } + + } else if ( object.isPoints ) { + + renderer.setMode( 0 ); + + } else if ( object.isSprite ) { + + renderer.setMode( 4 ); + + } + + if ( object.isInstancedMesh ) { + + renderer.renderInstances( drawStart, drawCount, object.count ); + + } else if ( geometry.isInstancedBufferGeometry ) { + + const instanceCount = Math.min( geometry.instanceCount, geometry._maxInstanceCount ); + + renderer.renderInstances( drawStart, drawCount, instanceCount ); + + } else { + + renderer.render( drawStart, drawCount ); + + } + + }; + + // Compile + + this.compile = function ( scene, camera ) { + + currentRenderState = renderStates.get( scene ); + currentRenderState.init(); + + renderStateStack.push( currentRenderState ); + + scene.traverseVisible( function ( object ) { + + if ( object.isLight && object.layers.test( camera.layers ) ) { + + currentRenderState.pushLight( object ); + + if ( object.castShadow ) { + + currentRenderState.pushShadow( object ); + + } + + } + + } ); + + currentRenderState.setupLights( _this.physicallyCorrectLights ); + + scene.traverse( function ( object ) { + + const material = object.material; + + if ( material ) { + + if ( Array.isArray( material ) ) { + + for ( let i = 0; i < material.length; i ++ ) { + + const material2 = material[ i ]; + + getProgram( material2, scene, object ); + + } + + } else { + + getProgram( material, scene, object ); + + } + + } + + } ); + + renderStateStack.pop(); + currentRenderState = null; + + }; + + // Animation Loop + + let onAnimationFrameCallback = null; + + function onAnimationFrame( time ) { + + if ( onAnimationFrameCallback ) onAnimationFrameCallback( time ); + + } + + function onXRSessionStart() { + + animation.stop(); + + } + + function onXRSessionEnd() { + + animation.start(); + + } + + const animation = new WebGLAnimation(); + animation.setAnimationLoop( onAnimationFrame ); + + if ( typeof window !== 'undefined' ) animation.setContext( window ); + + this.setAnimationLoop = function ( callback ) { + + onAnimationFrameCallback = callback; + xr.setAnimationLoop( callback ); + + ( callback === null ) ? animation.stop() : animation.start(); + + }; + + xr.addEventListener( 'sessionstart', onXRSessionStart ); + xr.addEventListener( 'sessionend', onXRSessionEnd ); + + // Rendering + + this.render = function ( scene, camera ) { + + if ( camera !== undefined && camera.isCamera !== true ) { + + console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' ); + return; + + } + + if ( _isContextLost === true ) return; + + // update scene graph + + if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); + + // update camera matrices and frustum + + if ( camera.parent === null ) camera.updateMatrixWorld(); + + if ( xr.enabled === true && xr.isPresenting === true ) { + + if ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera ); + + camera = xr.getCamera(); // use XR camera for rendering + + } + + // + if ( scene.isScene === true ) scene.onBeforeRender( _this, scene, camera, _currentRenderTarget ); + + currentRenderState = renderStates.get( scene, renderStateStack.length ); + currentRenderState.init(); + + renderStateStack.push( currentRenderState ); + + _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); + _frustum.setFromProjectionMatrix( _projScreenMatrix ); + + _localClippingEnabled = this.localClippingEnabled; + _clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); + + currentRenderList = renderLists.get( scene, renderListStack.length ); + currentRenderList.init(); + + renderListStack.push( currentRenderList ); + + projectObject( scene, camera, 0, _this.sortObjects ); + + currentRenderList.finish(); + + if ( _this.sortObjects === true ) { + + currentRenderList.sort( _opaqueSort, _transparentSort ); + + } + + // + + if ( _clippingEnabled === true ) clipping.beginShadows(); + + const shadowsArray = currentRenderState.state.shadowsArray; + + shadowMap.render( shadowsArray, scene, camera ); + + if ( _clippingEnabled === true ) clipping.endShadows(); + + // + + if ( this.info.autoReset === true ) this.info.reset(); + + // + + background.render( currentRenderList, scene ); + + // render scene + + currentRenderState.setupLights( _this.physicallyCorrectLights ); + + if ( camera.isArrayCamera ) { + + const cameras = camera.cameras; + + for ( let i = 0, l = cameras.length; i < l; i ++ ) { + + const camera2 = cameras[ i ]; + + renderScene( currentRenderList, scene, camera2, camera2.viewport ); + + } + + } else { + + renderScene( currentRenderList, scene, camera ); + + } + + // + + if ( _currentRenderTarget !== null ) { + + // resolve multisample renderbuffers to a single-sample texture if necessary + + textures.updateMultisampleRenderTarget( _currentRenderTarget ); + + // Generate mipmap if we're using any kind of mipmap filtering + + textures.updateRenderTargetMipmap( _currentRenderTarget ); + + } + + // + + if ( scene.isScene === true ) scene.onAfterRender( _this, scene, camera ); + + // Ensure depth buffer writing is enabled so it can be cleared on next render + + state.buffers.depth.setTest( true ); + state.buffers.depth.setMask( true ); + state.buffers.color.setMask( true ); + + state.setPolygonOffset( false ); + + // _gl.finish(); + + bindingStates.resetDefaultState(); + _currentMaterialId = - 1; + _currentCamera = null; + + renderStateStack.pop(); + + if ( renderStateStack.length > 0 ) { + + currentRenderState = renderStateStack[ renderStateStack.length - 1 ]; + + } else { + + currentRenderState = null; + + } + + renderListStack.pop(); + + if ( renderListStack.length > 0 ) { + + currentRenderList = renderListStack[ renderListStack.length - 1 ]; + + } else { + + currentRenderList = null; + + } + + }; + + function projectObject( object, camera, groupOrder, sortObjects ) { + + if ( object.visible === false ) return; + + const visible = object.layers.test( camera.layers ); + + if ( visible ) { + + if ( object.isGroup ) { + + groupOrder = object.renderOrder; + + } else if ( object.isLOD ) { + + if ( object.autoUpdate === true ) object.update( camera ); + + } else if ( object.isLight ) { + + currentRenderState.pushLight( object ); + + if ( object.castShadow ) { + + currentRenderState.pushShadow( object ); + + } + + } else if ( object.isSprite ) { + + if ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) { + + if ( sortObjects ) { + + _vector3.setFromMatrixPosition( object.matrixWorld ) + .applyMatrix4( _projScreenMatrix ); + + } + + const geometry = objects.update( object ); + const material = object.material; + + if ( material.visible ) { + + currentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null ); + + } + + } + + } else if ( object.isMesh || object.isLine || object.isPoints ) { + + if ( object.isSkinnedMesh ) { + + // update skeleton only once in a frame + + if ( object.skeleton.frame !== info.render.frame ) { + + object.skeleton.update(); + object.skeleton.frame = info.render.frame; + + } + + } + + if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { + + if ( sortObjects ) { + + _vector3.setFromMatrixPosition( object.matrixWorld ) + .applyMatrix4( _projScreenMatrix ); + + } + + const geometry = objects.update( object ); + const material = object.material; + + if ( Array.isArray( material ) ) { + + const groups = geometry.groups; + + for ( let i = 0, l = groups.length; i < l; i ++ ) { + + const group = groups[ i ]; + const groupMaterial = material[ group.materialIndex ]; + + if ( groupMaterial && groupMaterial.visible ) { + + currentRenderList.push( object, geometry, groupMaterial, groupOrder, _vector3.z, group ); + + } + + } + + } else if ( material.visible ) { + + currentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null ); + + } + + } + + } + + } + + const children = object.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + projectObject( children[ i ], camera, groupOrder, sortObjects ); + + } + + } + + function renderScene( currentRenderList, scene, camera, viewport ) { + + const opaqueObjects = currentRenderList.opaque; + const transmissiveObjects = currentRenderList.transmissive; + const transparentObjects = currentRenderList.transparent; + + currentRenderState.setupLightsView( camera ); + + if ( transmissiveObjects.length > 0 ) renderTransmissionPass( opaqueObjects, scene, camera ); + + if ( viewport ) state.viewport( _currentViewport.copy( viewport ) ); + + if ( opaqueObjects.length > 0 ) renderObjects( opaqueObjects, scene, camera ); + if ( transmissiveObjects.length > 0 ) renderObjects( transmissiveObjects, scene, camera ); + if ( transparentObjects.length > 0 ) renderObjects( transparentObjects, scene, camera ); + + } + + function renderTransmissionPass( opaqueObjects, scene, camera ) { + + if ( _transmissionRenderTarget === null ) { + + const needsAntialias = _antialias === true && capabilities.isWebGL2 === true; + const renderTargetType = needsAntialias ? WebGLMultisampleRenderTarget : WebGLRenderTarget; + + _transmissionRenderTarget = new renderTargetType( 1024, 1024, { + generateMipmaps: true, + type: utils.convert( HalfFloatType ) !== null ? HalfFloatType : UnsignedByteType, + minFilter: LinearMipmapLinearFilter, + magFilter: NearestFilter, + wrapS: ClampToEdgeWrapping, + wrapT: ClampToEdgeWrapping, + useRenderToTexture: extensions.has( 'WEBGL_multisampled_render_to_texture' ) + } ); + + } + + const currentRenderTarget = _this.getRenderTarget(); + _this.setRenderTarget( _transmissionRenderTarget ); + _this.clear(); + + // Turn off the features which can affect the frag color for opaque objects pass. + // Otherwise they are applied twice in opaque objects pass and transmission objects pass. + const currentToneMapping = _this.toneMapping; + _this.toneMapping = NoToneMapping; + + renderObjects( opaqueObjects, scene, camera ); + + _this.toneMapping = currentToneMapping; + + textures.updateMultisampleRenderTarget( _transmissionRenderTarget ); + textures.updateRenderTargetMipmap( _transmissionRenderTarget ); + + _this.setRenderTarget( currentRenderTarget ); + + } + + function renderObjects( renderList, scene, camera ) { + + const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null; + + for ( let i = 0, l = renderList.length; i < l; i ++ ) { + + const renderItem = renderList[ i ]; + + const object = renderItem.object; + const geometry = renderItem.geometry; + const material = overrideMaterial === null ? renderItem.material : overrideMaterial; + const group = renderItem.group; + + if ( object.layers.test( camera.layers ) ) { + + renderObject( object, scene, camera, geometry, material, group ); + + } + + } + + } + + function renderObject( object, scene, camera, geometry, material, group ) { + + object.onBeforeRender( _this, scene, camera, geometry, material, group ); + + object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); + object.normalMatrix.getNormalMatrix( object.modelViewMatrix ); + + material.onBeforeRender( _this, scene, camera, geometry, object, group ); + + if ( material.transparent === true && material.side === DoubleSide ) { + + material.side = BackSide; + material.needsUpdate = true; + _this.renderBufferDirect( camera, scene, geometry, material, object, group ); + + material.side = FrontSide; + material.needsUpdate = true; + _this.renderBufferDirect( camera, scene, geometry, material, object, group ); + + material.side = DoubleSide; + + } else { + + _this.renderBufferDirect( camera, scene, geometry, material, object, group ); + + } + + object.onAfterRender( _this, scene, camera, geometry, material, group ); + + } + + function getProgram( material, scene, object ) { + + if ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ... + + const materialProperties = properties.get( material ); + + const lights = currentRenderState.state.lights; + const shadowsArray = currentRenderState.state.shadowsArray; + + const lightsStateVersion = lights.state.version; + + const parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object ); + const programCacheKey = programCache.getProgramCacheKey( parameters ); + + let programs = materialProperties.programs; + + // always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change + + materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null; + materialProperties.fog = scene.fog; + materialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment ); + + if ( programs === undefined ) { + + // new material + + material.addEventListener( 'dispose', onMaterialDispose ); + + programs = new Map(); + materialProperties.programs = programs; + + } + + let program = programs.get( programCacheKey ); + + if ( program !== undefined ) { + + // early out if program and light state is identical + + if ( materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion ) { + + updateCommonMaterialProperties( material, parameters ); + + return program; + + } + + } else { + + parameters.uniforms = programCache.getUniforms( material ); + + material.onBuild( object, parameters, _this ); + + material.onBeforeCompile( parameters, _this ); + + program = programCache.acquireProgram( parameters, programCacheKey ); + programs.set( programCacheKey, program ); + + materialProperties.uniforms = parameters.uniforms; + + } + + const uniforms = materialProperties.uniforms; + + if ( ( ! material.isShaderMaterial && ! material.isRawShaderMaterial ) || material.clipping === true ) { + + uniforms.clippingPlanes = clipping.uniform; + + } + + updateCommonMaterialProperties( material, parameters ); + + // store the light setup it was created for + + materialProperties.needsLights = materialNeedsLights( material ); + materialProperties.lightsStateVersion = lightsStateVersion; + + if ( materialProperties.needsLights ) { + + // wire up the material to this renderer's lighting state + + uniforms.ambientLightColor.value = lights.state.ambient; + uniforms.lightProbe.value = lights.state.probe; + uniforms.directionalLights.value = lights.state.directional; + uniforms.directionalLightShadows.value = lights.state.directionalShadow; + uniforms.spotLights.value = lights.state.spot; + uniforms.spotLightShadows.value = lights.state.spotShadow; + uniforms.rectAreaLights.value = lights.state.rectArea; + uniforms.ltc_1.value = lights.state.rectAreaLTC1; + uniforms.ltc_2.value = lights.state.rectAreaLTC2; + uniforms.pointLights.value = lights.state.point; + uniforms.pointLightShadows.value = lights.state.pointShadow; + uniforms.hemisphereLights.value = lights.state.hemi; + + uniforms.directionalShadowMap.value = lights.state.directionalShadowMap; + uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix; + uniforms.spotShadowMap.value = lights.state.spotShadowMap; + uniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix; + uniforms.pointShadowMap.value = lights.state.pointShadowMap; + uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix; + // TODO (abelnation): add area lights shadow info to uniforms + + } + + const progUniforms = program.getUniforms(); + const uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); + + materialProperties.currentProgram = program; + materialProperties.uniformsList = uniformsList; + + return program; + + } + + function updateCommonMaterialProperties( material, parameters ) { + + const materialProperties = properties.get( material ); + + materialProperties.outputEncoding = parameters.outputEncoding; + materialProperties.instancing = parameters.instancing; + materialProperties.skinning = parameters.skinning; + materialProperties.morphTargets = parameters.morphTargets; + materialProperties.morphNormals = parameters.morphNormals; + materialProperties.morphTargetsCount = parameters.morphTargetsCount; + materialProperties.numClippingPlanes = parameters.numClippingPlanes; + materialProperties.numIntersection = parameters.numClipIntersection; + materialProperties.vertexAlphas = parameters.vertexAlphas; + materialProperties.vertexTangents = parameters.vertexTangents; + materialProperties.toneMapping = parameters.toneMapping; + + } + + function setProgram( camera, scene, geometry, material, object ) { + + if ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ... + + textures.resetTextureUnits(); + + const fog = scene.fog; + const environment = material.isMeshStandardMaterial ? scene.environment : null; + const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.encoding : LinearEncoding ); + const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment ); + const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4; + const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent; + const morphTargets = !! geometry.morphAttributes.position; + const morphNormals = !! geometry.morphAttributes.normal; + const morphTargetsCount = !! geometry.morphAttributes.position ? geometry.morphAttributes.position.length : 0; + const toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping; + + const materialProperties = properties.get( material ); + const lights = currentRenderState.state.lights; + + if ( _clippingEnabled === true ) { + + if ( _localClippingEnabled === true || camera !== _currentCamera ) { + + const useCache = + camera === _currentCamera && + material.id === _currentMaterialId; + + // we might want to call this function with some ClippingGroup + // object instead of the material, once it becomes feasible + // (#8465, #8379) + clipping.setState( material, camera, useCache ); + + } + + } + + // + + let needsProgramChange = false; + + if ( material.version === materialProperties.__version ) { + + if ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) { + + needsProgramChange = true; + + } else if ( materialProperties.outputEncoding !== encoding ) { + + needsProgramChange = true; + + } else if ( object.isInstancedMesh && materialProperties.instancing === false ) { + + needsProgramChange = true; + + } else if ( ! object.isInstancedMesh && materialProperties.instancing === true ) { + + needsProgramChange = true; + + } else if ( object.isSkinnedMesh && materialProperties.skinning === false ) { + + needsProgramChange = true; + + } else if ( ! object.isSkinnedMesh && materialProperties.skinning === true ) { + + needsProgramChange = true; + + } else if ( materialProperties.envMap !== envMap ) { + + needsProgramChange = true; + + } else if ( material.fog && materialProperties.fog !== fog ) { + + needsProgramChange = true; + + } else if ( materialProperties.numClippingPlanes !== undefined && + ( materialProperties.numClippingPlanes !== clipping.numPlanes || + materialProperties.numIntersection !== clipping.numIntersection ) ) { + + needsProgramChange = true; + + } else if ( materialProperties.vertexAlphas !== vertexAlphas ) { + + needsProgramChange = true; + + } else if ( materialProperties.vertexTangents !== vertexTangents ) { + + needsProgramChange = true; + + } else if ( materialProperties.morphTargets !== morphTargets ) { + + needsProgramChange = true; + + } else if ( materialProperties.morphNormals !== morphNormals ) { + + needsProgramChange = true; + + } else if ( materialProperties.toneMapping !== toneMapping ) { + + needsProgramChange = true; + + } else if ( capabilities.isWebGL2 === true && materialProperties.morphTargetsCount !== morphTargetsCount ) { + + needsProgramChange = true; + + } + + } else { + + needsProgramChange = true; + materialProperties.__version = material.version; + + } + + // + + let program = materialProperties.currentProgram; + + if ( needsProgramChange === true ) { + + program = getProgram( material, scene, object ); + + } + + let refreshProgram = false; + let refreshMaterial = false; + let refreshLights = false; + + const p_uniforms = program.getUniforms(), + m_uniforms = materialProperties.uniforms; + + if ( state.useProgram( program.program ) ) { + + refreshProgram = true; + refreshMaterial = true; + refreshLights = true; + + } + + if ( material.id !== _currentMaterialId ) { + + _currentMaterialId = material.id; + + refreshMaterial = true; + + } + + if ( refreshProgram || _currentCamera !== camera ) { + + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + + if ( capabilities.logarithmicDepthBuffer ) { + + p_uniforms.setValue( _gl, 'logDepthBufFC', + 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); + + } + + if ( _currentCamera !== camera ) { + + _currentCamera = camera; + + // lighting uniforms depend on the camera so enforce an update + // now, in case this material supports lights - or later, when + // the next material that does gets activated: + + refreshMaterial = true; // set to true on material change + refreshLights = true; // remains set until update done + + } + + // load material specific uniforms + // (shader material also gets them for the sake of genericity) + + if ( material.isShaderMaterial || + material.isMeshPhongMaterial || + material.isMeshToonMaterial || + material.isMeshStandardMaterial || + material.envMap ) { + + const uCamPos = p_uniforms.map.cameraPosition; + + if ( uCamPos !== undefined ) { + + uCamPos.setValue( _gl, + _vector3.setFromMatrixPosition( camera.matrixWorld ) ); + + } + + } + + if ( material.isMeshPhongMaterial || + material.isMeshToonMaterial || + material.isMeshLambertMaterial || + material.isMeshBasicMaterial || + material.isMeshStandardMaterial || + material.isShaderMaterial ) { + + p_uniforms.setValue( _gl, 'isOrthographic', camera.isOrthographicCamera === true ); + + } + + if ( material.isMeshPhongMaterial || + material.isMeshToonMaterial || + material.isMeshLambertMaterial || + material.isMeshBasicMaterial || + material.isMeshStandardMaterial || + material.isShaderMaterial || + material.isShadowMaterial || + object.isSkinnedMesh ) { + + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + + } + + } + + // skinning and morph target uniforms must be set even if material didn't change + // auto-setting of texture unit for bone and morph texture must go before other textures + // otherwise textures used for skinning and morphing can take over texture units reserved for other material textures + + if ( object.isSkinnedMesh ) { + + p_uniforms.setOptional( _gl, object, 'bindMatrix' ); + p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' ); + + const skeleton = object.skeleton; + + if ( skeleton ) { + + if ( capabilities.floatVertexTextures ) { + + if ( skeleton.boneTexture === null ) skeleton.computeBoneTexture(); + + p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures ); + p_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize ); + + } else { + + p_uniforms.setOptional( _gl, skeleton, 'boneMatrices' ); + + } + + } + + } + + if ( !! geometry && ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) ) { + + morphtargets.update( object, geometry, material, program ); + + } + + + if ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) { + + materialProperties.receiveShadow = object.receiveShadow; + p_uniforms.setValue( _gl, 'receiveShadow', object.receiveShadow ); + + } + + if ( refreshMaterial ) { + + p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure ); + + if ( materialProperties.needsLights ) { + + // the current material requires lighting info + + // note: all lighting uniforms are always set correctly + // they simply reference the renderer's state for their + // values + // + // use the current material's .needsUpdate flags to set + // the GL state when required + + markUniformsLightsNeedsUpdate( m_uniforms, refreshLights ); + + } + + // refresh uniforms common to several materials + + if ( fog && material.fog ) { + + materials.refreshFogUniforms( m_uniforms, fog ); + + } + + materials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height, _transmissionRenderTarget ); + + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); + + } + + if ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) { + + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); + material.uniformsNeedUpdate = false; + + } + + if ( material.isSpriteMaterial ) { + + p_uniforms.setValue( _gl, 'center', object.center ); + + } + + // common matrices + + p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); + p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); + + return program; + + } + + // If uniforms are marked as clean, they don't need to be loaded to the GPU. + + function markUniformsLightsNeedsUpdate( uniforms, value ) { + + uniforms.ambientLightColor.needsUpdate = value; + uniforms.lightProbe.needsUpdate = value; + + uniforms.directionalLights.needsUpdate = value; + uniforms.directionalLightShadows.needsUpdate = value; + uniforms.pointLights.needsUpdate = value; + uniforms.pointLightShadows.needsUpdate = value; + uniforms.spotLights.needsUpdate = value; + uniforms.spotLightShadows.needsUpdate = value; + uniforms.rectAreaLights.needsUpdate = value; + uniforms.hemisphereLights.needsUpdate = value; + + } + + function materialNeedsLights( material ) { + + return material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial || + material.isMeshStandardMaterial || material.isShadowMaterial || + ( material.isShaderMaterial && material.lights === true ); + + } + + this.getActiveCubeFace = function () { + + return _currentActiveCubeFace; + + }; + + this.getActiveMipmapLevel = function () { + + return _currentActiveMipmapLevel; + + }; + + this.getRenderTarget = function () { + + return _currentRenderTarget; + + }; + + this.setRenderTargetTextures = function ( renderTarget, colorTexture, depthTexture ) { + + properties.get( renderTarget.texture ).__webglTexture = colorTexture; + properties.get( renderTarget.depthTexture ).__webglTexture = depthTexture; + + const renderTargetProperties = properties.get( renderTarget ); + renderTargetProperties.__hasExternalTextures = true; + + if ( renderTargetProperties.__hasExternalTextures ) { + + renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined; + + if ( ! renderTargetProperties.__autoAllocateDepthBuffer ) { + + // The multisample_render_to_texture extension doesn't work properly if there + // are midframe flushes and an external depth buffer. Disable use of the extension. + if ( renderTarget.useRenderToTexture ) { + + console.warn( 'render-to-texture extension was disabled because an external texture was provided' ); + renderTarget.useRenderToTexture = false; + renderTarget.useRenderbuffer = true; + + } + + } + + } + + }; + + this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) { + + const renderTargetProperties = properties.get( renderTarget ); + renderTargetProperties.__webglFramebuffer = defaultFramebuffer; + renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined; + + }; + + this.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) { + + _currentRenderTarget = renderTarget; + _currentActiveCubeFace = activeCubeFace; + _currentActiveMipmapLevel = activeMipmapLevel; + let useDefaultFramebuffer = true; + + if ( renderTarget ) { + + const renderTargetProperties = properties.get( renderTarget ); + + if ( renderTargetProperties.__useDefaultFramebuffer !== undefined ) { + + // We need to make sure to rebind the framebuffer. + state.bindFramebuffer( 36160, null ); + useDefaultFramebuffer = false; + + } else if ( renderTargetProperties.__webglFramebuffer === undefined ) { + + textures.setupRenderTarget( renderTarget ); + + } else if ( renderTargetProperties.__hasExternalTextures ) { + + // Color and depth texture must be rebound in order for the swapchain to update. + textures.rebindTextures( renderTarget, properties.get( renderTarget.texture ).__webglTexture, properties.get( renderTarget.depthTexture ).__webglTexture ); + + } + + } + + let framebuffer = null; + let isCube = false; + let isRenderTarget3D = false; + + if ( renderTarget ) { + + const texture = renderTarget.texture; + + if ( texture.isDataTexture3D || texture.isDataTexture2DArray ) { + + isRenderTarget3D = true; + + } + + const __webglFramebuffer = properties.get( renderTarget ).__webglFramebuffer; + + if ( renderTarget.isWebGLCubeRenderTarget ) { + + framebuffer = __webglFramebuffer[ activeCubeFace ]; + isCube = true; + + } else if ( renderTarget.useRenderbuffer ) { + + framebuffer = properties.get( renderTarget ).__webglMultisampledFramebuffer; + + } else { + + framebuffer = __webglFramebuffer; + + } + + _currentViewport.copy( renderTarget.viewport ); + _currentScissor.copy( renderTarget.scissor ); + _currentScissorTest = renderTarget.scissorTest; + + } else { + + _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor(); + _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor(); + _currentScissorTest = _scissorTest; + + } + + const framebufferBound = state.bindFramebuffer( 36160, framebuffer ); + + if ( framebufferBound && capabilities.drawBuffers && useDefaultFramebuffer ) { + + state.drawBuffers( renderTarget, framebuffer ); + + } + + state.viewport( _currentViewport ); + state.scissor( _currentScissor ); + state.setScissorTest( _currentScissorTest ); + + if ( isCube ) { + + const textureProperties = properties.get( renderTarget.texture ); + _gl.framebufferTexture2D( 36160, 36064, 34069 + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel ); + + } else if ( isRenderTarget3D ) { + + const textureProperties = properties.get( renderTarget.texture ); + const layer = activeCubeFace || 0; + _gl.framebufferTextureLayer( 36160, 36064, textureProperties.__webglTexture, activeMipmapLevel || 0, layer ); + + } + + _currentMaterialId = - 1; // reset current material to ensure correct uniform bindings + + }; + + this.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex ) { + + if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' ); + return; + + } + + let framebuffer = properties.get( renderTarget ).__webglFramebuffer; + + if ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) { + + framebuffer = framebuffer[ activeCubeFaceIndex ]; + + } + + if ( framebuffer ) { + + state.bindFramebuffer( 36160, framebuffer ); + + try { + + const texture = renderTarget.texture; + const textureFormat = texture.format; + const textureType = texture.type; + + if ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== _gl.getParameter( 35739 ) ) { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' ); + return; + + } + + const halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || ( capabilities.isWebGL2 && extensions.has( 'EXT_color_buffer_float' ) ) ); + + if ( textureType !== UnsignedByteType && utils.convert( textureType ) !== _gl.getParameter( 35738 ) && // Edge and Chrome Mac < 52 (#9513) + ! ( textureType === FloatType && ( capabilities.isWebGL2 || extensions.has( 'OES_texture_float' ) || extensions.has( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox + ! halfFloatSupportedByExt ) { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' ); + return; + + } + + if ( _gl.checkFramebufferStatus( 36160 ) === 36053 ) { + + // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604) + + if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) { + + _gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer ); + + } + + } else { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' ); + + } + + } finally { + + // restore framebuffer of current render target if necessary + + const framebuffer = ( _currentRenderTarget !== null ) ? properties.get( _currentRenderTarget ).__webglFramebuffer : null; + state.bindFramebuffer( 36160, framebuffer ); + + } + + } + + }; + + this.copyFramebufferToTexture = function ( position, texture, level = 0 ) { + + if ( texture.isFramebufferTexture !== true ) { + + console.error( 'THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.' ); + return; + + } + + const levelScale = Math.pow( 2, - level ); + const width = Math.floor( texture.image.width * levelScale ); + const height = Math.floor( texture.image.height * levelScale ); + + textures.setTexture2D( texture, 0 ); + + _gl.copyTexSubImage2D( 3553, level, 0, 0, position.x, position.y, width, height ); + + state.unbindTexture(); + + }; + + this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level = 0 ) { + + const width = srcTexture.image.width; + const height = srcTexture.image.height; + const glFormat = utils.convert( dstTexture.format ); + const glType = utils.convert( dstTexture.type ); + + textures.setTexture2D( dstTexture, 0 ); + + // As another texture upload may have changed pixelStorei + // parameters, make sure they are correct for the dstTexture + _gl.pixelStorei( 37440, dstTexture.flipY ); + _gl.pixelStorei( 37441, dstTexture.premultiplyAlpha ); + _gl.pixelStorei( 3317, dstTexture.unpackAlignment ); + + if ( srcTexture.isDataTexture ) { + + _gl.texSubImage2D( 3553, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data ); + + } else { + + if ( srcTexture.isCompressedTexture ) { + + _gl.compressedTexSubImage2D( 3553, level, position.x, position.y, srcTexture.mipmaps[ 0 ].width, srcTexture.mipmaps[ 0 ].height, glFormat, srcTexture.mipmaps[ 0 ].data ); + + } else { + + _gl.texSubImage2D( 3553, level, position.x, position.y, glFormat, glType, srcTexture.image ); + + } + + } + + // Generate mipmaps only when copying level 0 + if ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( 3553 ); + + state.unbindTexture(); + + }; + + this.copyTextureToTexture3D = function ( sourceBox, position, srcTexture, dstTexture, level = 0 ) { + + if ( _this.isWebGL1Renderer ) { + + console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.' ); + return; + + } + + const width = sourceBox.max.x - sourceBox.min.x + 1; + const height = sourceBox.max.y - sourceBox.min.y + 1; + const depth = sourceBox.max.z - sourceBox.min.z + 1; + const glFormat = utils.convert( dstTexture.format ); + const glType = utils.convert( dstTexture.type ); + let glTarget; + + if ( dstTexture.isDataTexture3D ) { + + textures.setTexture3D( dstTexture, 0 ); + glTarget = 32879; + + } else if ( dstTexture.isDataTexture2DArray ) { + + textures.setTexture2DArray( dstTexture, 0 ); + glTarget = 35866; + + } else { + + console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.' ); + return; + + } + + _gl.pixelStorei( 37440, dstTexture.flipY ); + _gl.pixelStorei( 37441, dstTexture.premultiplyAlpha ); + _gl.pixelStorei( 3317, dstTexture.unpackAlignment ); + + const unpackRowLen = _gl.getParameter( 3314 ); + const unpackImageHeight = _gl.getParameter( 32878 ); + const unpackSkipPixels = _gl.getParameter( 3316 ); + const unpackSkipRows = _gl.getParameter( 3315 ); + const unpackSkipImages = _gl.getParameter( 32877 ); + + const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ 0 ] : srcTexture.image; + + _gl.pixelStorei( 3314, image.width ); + _gl.pixelStorei( 32878, image.height ); + _gl.pixelStorei( 3316, sourceBox.min.x ); + _gl.pixelStorei( 3315, sourceBox.min.y ); + _gl.pixelStorei( 32877, sourceBox.min.z ); + + if ( srcTexture.isDataTexture || srcTexture.isDataTexture3D ) { + + _gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data ); + + } else { + + if ( srcTexture.isCompressedTexture ) { + + console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' ); + _gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data ); + + } else { + + _gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image ); + + } + + } + + _gl.pixelStorei( 3314, unpackRowLen ); + _gl.pixelStorei( 32878, unpackImageHeight ); + _gl.pixelStorei( 3316, unpackSkipPixels ); + _gl.pixelStorei( 3315, unpackSkipRows ); + _gl.pixelStorei( 32877, unpackSkipImages ); + + // Generate mipmaps only when copying level 0 + if ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( glTarget ); + + state.unbindTexture(); + + }; + + this.initTexture = function ( texture ) { + + textures.setTexture2D( texture, 0 ); + + state.unbindTexture(); + + }; + + this.resetState = function () { + + _currentActiveCubeFace = 0; + _currentActiveMipmapLevel = 0; + _currentRenderTarget = null; + + state.reset(); + bindingStates.reset(); + + }; + + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); + + } + +} + +WebGLRenderer.prototype.isWebGLRenderer = true; + +class WebGL1Renderer extends WebGLRenderer {} + +WebGL1Renderer.prototype.isWebGL1Renderer = true; + +class FogExp2 { + + constructor( color, density = 0.00025 ) { + + this.name = ''; + + this.color = new Color( color ); + this.density = density; + + } + + clone() { + + return new FogExp2( this.color, this.density ); + + } + + toJSON( /* meta */ ) { + + return { + type: 'FogExp2', + color: this.color.getHex(), + density: this.density + }; + + } + +} + +FogExp2.prototype.isFogExp2 = true; + +class Fog { + + constructor( color, near = 1, far = 1000 ) { + + this.name = ''; + + this.color = new Color( color ); + + this.near = near; + this.far = far; + + } + + clone() { + + return new Fog( this.color, this.near, this.far ); + + } + + toJSON( /* meta */ ) { + + return { + type: 'Fog', + color: this.color.getHex(), + near: this.near, + far: this.far + }; + + } + +} + +Fog.prototype.isFog = true; + +class Scene extends Object3D { + + constructor() { + + super(); + + this.type = 'Scene'; + + this.background = null; + this.environment = null; + this.fog = null; + + this.overrideMaterial = null; + + this.autoUpdate = true; // checked by the renderer + + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); + + } + + } + + copy( source, recursive ) { + + super.copy( source, recursive ); + + if ( source.background !== null ) this.background = source.background.clone(); + if ( source.environment !== null ) this.environment = source.environment.clone(); + if ( source.fog !== null ) this.fog = source.fog.clone(); + + if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone(); + + this.autoUpdate = source.autoUpdate; + this.matrixAutoUpdate = source.matrixAutoUpdate; + + return this; + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + if ( this.fog !== null ) data.object.fog = this.fog.toJSON(); + + return data; + + } + +} + +Scene.prototype.isScene = true; + +class InterleavedBuffer { + + constructor( array, stride ) { + + this.array = array; + this.stride = stride; + this.count = array !== undefined ? array.length / stride : 0; + + this.usage = StaticDrawUsage; + this.updateRange = { offset: 0, count: - 1 }; + + this.version = 0; + + this.uuid = generateUUID(); + + } + + onUploadCallback() {} + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + } + + setUsage( value ) { + + this.usage = value; + + return this; + + } + + copy( source ) { + + this.array = new source.array.constructor( source.array ); + this.count = source.count; + this.stride = source.stride; + this.usage = source.usage; + + return this; + + } + + copyAt( index1, attribute, index2 ) { + + index1 *= this.stride; + index2 *= attribute.stride; + + for ( let i = 0, l = this.stride; i < l; i ++ ) { + + this.array[ index1 + i ] = attribute.array[ index2 + i ]; + + } + + return this; + + } + + set( value, offset = 0 ) { + + this.array.set( value, offset ); + + return this; + + } + + clone( data ) { + + if ( data.arrayBuffers === undefined ) { + + data.arrayBuffers = {}; + + } + + if ( this.array.buffer._uuid === undefined ) { + + this.array.buffer._uuid = generateUUID(); + + } + + if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) { + + data.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer; + + } + + const array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] ); + + const ib = new this.constructor( array, this.stride ); + ib.setUsage( this.usage ); + + return ib; + + } + + onUpload( callback ) { + + this.onUploadCallback = callback; + + return this; + + } + + toJSON( data ) { + + if ( data.arrayBuffers === undefined ) { + + data.arrayBuffers = {}; + + } + + // generate UUID for array buffer if necessary + + if ( this.array.buffer._uuid === undefined ) { + + this.array.buffer._uuid = generateUUID(); + + } + + if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) { + + data.arrayBuffers[ this.array.buffer._uuid ] = Array.prototype.slice.call( new Uint32Array( this.array.buffer ) ); + + } + + // + + return { + uuid: this.uuid, + buffer: this.array.buffer._uuid, + type: this.array.constructor.name, + stride: this.stride + }; + + } + +} + +InterleavedBuffer.prototype.isInterleavedBuffer = true; + +const _vector$6 = /*@__PURE__*/ new Vector3(); + +class InterleavedBufferAttribute { + + constructor( interleavedBuffer, itemSize, offset, normalized = false ) { + + this.name = ''; + + this.data = interleavedBuffer; + this.itemSize = itemSize; + this.offset = offset; + + this.normalized = normalized === true; + + } + + get count() { + + return this.data.count; + + } + + get array() { + + return this.data.array; + + } + + set needsUpdate( value ) { + + this.data.needsUpdate = value; + + } + + applyMatrix4( m ) { + + for ( let i = 0, l = this.data.count; i < l; i ++ ) { + + _vector$6.x = this.getX( i ); + _vector$6.y = this.getY( i ); + _vector$6.z = this.getZ( i ); + + _vector$6.applyMatrix4( m ); + + this.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z ); + + } + + return this; + + } + + applyNormalMatrix( m ) { + + for ( let i = 0, l = this.count; i < l; i ++ ) { + + _vector$6.x = this.getX( i ); + _vector$6.y = this.getY( i ); + _vector$6.z = this.getZ( i ); + + _vector$6.applyNormalMatrix( m ); + + this.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z ); + + } + + return this; + + } + + transformDirection( m ) { + + for ( let i = 0, l = this.count; i < l; i ++ ) { + + _vector$6.x = this.getX( i ); + _vector$6.y = this.getY( i ); + _vector$6.z = this.getZ( i ); + + _vector$6.transformDirection( m ); + + this.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z ); + + } + + return this; + + } + + setX( index, x ) { + + this.data.array[ index * this.data.stride + this.offset ] = x; + + return this; + + } + + setY( index, y ) { + + this.data.array[ index * this.data.stride + this.offset + 1 ] = y; + + return this; + + } + + setZ( index, z ) { + + this.data.array[ index * this.data.stride + this.offset + 2 ] = z; + + return this; + + } + + setW( index, w ) { + + this.data.array[ index * this.data.stride + this.offset + 3 ] = w; + + return this; + + } + + getX( index ) { + + return this.data.array[ index * this.data.stride + this.offset ]; + + } + + getY( index ) { + + return this.data.array[ index * this.data.stride + this.offset + 1 ]; + + } + + getZ( index ) { + + return this.data.array[ index * this.data.stride + this.offset + 2 ]; + + } + + getW( index ) { + + return this.data.array[ index * this.data.stride + this.offset + 3 ]; + + } + + setXY( index, x, y ) { + + index = index * this.data.stride + this.offset; + + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + + return this; + + } + + setXYZ( index, x, y, z ) { + + index = index * this.data.stride + this.offset; + + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + this.data.array[ index + 2 ] = z; + + return this; + + } + + setXYZW( index, x, y, z, w ) { + + index = index * this.data.stride + this.offset; + + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + this.data.array[ index + 2 ] = z; + this.data.array[ index + 3 ] = w; + + return this; + + } + + clone( data ) { + + if ( data === undefined ) { + + console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.' ); + + const array = []; + + for ( let i = 0; i < this.count; i ++ ) { + + const index = i * this.data.stride + this.offset; + + for ( let j = 0; j < this.itemSize; j ++ ) { + + array.push( this.data.array[ index + j ] ); + + } + + } + + return new BufferAttribute( new this.array.constructor( array ), this.itemSize, this.normalized ); + + } else { + + if ( data.interleavedBuffers === undefined ) { + + data.interleavedBuffers = {}; + + } + + if ( data.interleavedBuffers[ this.data.uuid ] === undefined ) { + + data.interleavedBuffers[ this.data.uuid ] = this.data.clone( data ); + + } + + return new InterleavedBufferAttribute( data.interleavedBuffers[ this.data.uuid ], this.itemSize, this.offset, this.normalized ); + + } + + } + + toJSON( data ) { + + if ( data === undefined ) { + + console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.' ); + + const array = []; + + for ( let i = 0; i < this.count; i ++ ) { + + const index = i * this.data.stride + this.offset; + + for ( let j = 0; j < this.itemSize; j ++ ) { + + array.push( this.data.array[ index + j ] ); + + } + + } + + // deinterleave data and save it as an ordinary buffer attribute for now + + return { + itemSize: this.itemSize, + type: this.array.constructor.name, + array: array, + normalized: this.normalized + }; + + } else { + + // save as true interlaved attribtue + + if ( data.interleavedBuffers === undefined ) { + + data.interleavedBuffers = {}; + + } + + if ( data.interleavedBuffers[ this.data.uuid ] === undefined ) { + + data.interleavedBuffers[ this.data.uuid ] = this.data.toJSON( data ); + + } + + return { + isInterleavedBufferAttribute: true, + itemSize: this.itemSize, + data: this.data.uuid, + offset: this.offset, + normalized: this.normalized + }; + + } + + } + +} + +InterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true; + +/** + * parameters = { + * color: , + * map: new THREE.Texture( ), + * alphaMap: new THREE.Texture( ), + * rotation: , + * sizeAttenuation: + * } + */ + +class SpriteMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'SpriteMaterial'; + + this.color = new Color( 0xffffff ); + + this.map = null; + + this.alphaMap = null; + + this.rotation = 0; + + this.sizeAttenuation = true; + + this.transparent = true; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + + this.map = source.map; + + this.alphaMap = source.alphaMap; + + this.rotation = source.rotation; + + this.sizeAttenuation = source.sizeAttenuation; + + return this; + + } + +} + +SpriteMaterial.prototype.isSpriteMaterial = true; + +let _geometry; + +const _intersectPoint = /*@__PURE__*/ new Vector3(); +const _worldScale = /*@__PURE__*/ new Vector3(); +const _mvPosition = /*@__PURE__*/ new Vector3(); + +const _alignedPosition = /*@__PURE__*/ new Vector2(); +const _rotatedPosition = /*@__PURE__*/ new Vector2(); +const _viewWorldMatrix = /*@__PURE__*/ new Matrix4(); + +const _vA = /*@__PURE__*/ new Vector3(); +const _vB = /*@__PURE__*/ new Vector3(); +const _vC = /*@__PURE__*/ new Vector3(); + +const _uvA = /*@__PURE__*/ new Vector2(); +const _uvB = /*@__PURE__*/ new Vector2(); +const _uvC = /*@__PURE__*/ new Vector2(); + +class Sprite extends Object3D { + + constructor( material ) { + + super(); + + this.type = 'Sprite'; + + if ( _geometry === undefined ) { + + _geometry = new BufferGeometry(); + + const float32Array = new Float32Array( [ + - 0.5, - 0.5, 0, 0, 0, + 0.5, - 0.5, 0, 1, 0, + 0.5, 0.5, 0, 1, 1, + - 0.5, 0.5, 0, 0, 1 + ] ); + + const interleavedBuffer = new InterleavedBuffer( float32Array, 5 ); + + _geometry.setIndex( [ 0, 1, 2, 0, 2, 3 ] ); + _geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) ); + _geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) ); + + } + + this.geometry = _geometry; + this.material = ( material !== undefined ) ? material : new SpriteMaterial(); + + this.center = new Vector2( 0.5, 0.5 ); + + } + + raycast( raycaster, intersects ) { + + if ( raycaster.camera === null ) { + + console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' ); + + } + + _worldScale.setFromMatrixScale( this.matrixWorld ); + + _viewWorldMatrix.copy( raycaster.camera.matrixWorld ); + this.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld ); + + _mvPosition.setFromMatrixPosition( this.modelViewMatrix ); + + if ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) { + + _worldScale.multiplyScalar( - _mvPosition.z ); + + } + + const rotation = this.material.rotation; + let sin, cos; + + if ( rotation !== 0 ) { + + cos = Math.cos( rotation ); + sin = Math.sin( rotation ); + + } + + const center = this.center; + + transformVertex( _vA.set( - 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); + transformVertex( _vB.set( 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); + transformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); + + _uvA.set( 0, 0 ); + _uvB.set( 1, 0 ); + _uvC.set( 1, 1 ); + + // check first triangle + let intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint ); + + if ( intersect === null ) { + + // check second triangle + transformVertex( _vB.set( - 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); + _uvB.set( 0, 1 ); + + intersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint ); + if ( intersect === null ) { + + return; + + } + + } + + const distance = raycaster.ray.origin.distanceTo( _intersectPoint ); + + if ( distance < raycaster.near || distance > raycaster.far ) return; + + intersects.push( { + + distance: distance, + point: _intersectPoint.clone(), + uv: Triangle.getUV( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ), + face: null, + object: this + + } ); + + } + + copy( source ) { + + super.copy( source ); + + if ( source.center !== undefined ) this.center.copy( source.center ); + + this.material = source.material; + + return this; + + } + +} + +Sprite.prototype.isSprite = true; + +function transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) { + + // compute position in camera space + _alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale ); + + // to check if rotation is not zero + if ( sin !== undefined ) { + + _rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y ); + _rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y ); + + } else { + + _rotatedPosition.copy( _alignedPosition ); + + } + + + vertexPosition.copy( mvPosition ); + vertexPosition.x += _rotatedPosition.x; + vertexPosition.y += _rotatedPosition.y; + + // transform to world space + vertexPosition.applyMatrix4( _viewWorldMatrix ); + +} + +const _v1$2 = /*@__PURE__*/ new Vector3(); +const _v2$1 = /*@__PURE__*/ new Vector3(); + +class LOD extends Object3D { + + constructor() { + + super(); + + this._currentLevel = 0; + + this.type = 'LOD'; + + Object.defineProperties( this, { + levels: { + enumerable: true, + value: [] + }, + isLOD: { + value: true, + } + } ); + + this.autoUpdate = true; + + } + + copy( source ) { + + super.copy( source, false ); + + const levels = source.levels; + + for ( let i = 0, l = levels.length; i < l; i ++ ) { + + const level = levels[ i ]; + + this.addLevel( level.object.clone(), level.distance ); + + } + + this.autoUpdate = source.autoUpdate; + + return this; + + } + + addLevel( object, distance = 0 ) { + + distance = Math.abs( distance ); + + const levels = this.levels; + + let l; + + for ( l = 0; l < levels.length; l ++ ) { + + if ( distance < levels[ l ].distance ) { + + break; + + } + + } + + levels.splice( l, 0, { distance: distance, object: object } ); + + this.add( object ); + + return this; + + } + + getCurrentLevel() { + + return this._currentLevel; + + } + + getObjectForDistance( distance ) { + + const levels = this.levels; + + if ( levels.length > 0 ) { + + let i, l; + + for ( i = 1, l = levels.length; i < l; i ++ ) { + + if ( distance < levels[ i ].distance ) { + + break; + + } + + } + + return levels[ i - 1 ].object; + + } + + return null; + + } + + raycast( raycaster, intersects ) { + + const levels = this.levels; + + if ( levels.length > 0 ) { + + _v1$2.setFromMatrixPosition( this.matrixWorld ); + + const distance = raycaster.ray.origin.distanceTo( _v1$2 ); + + this.getObjectForDistance( distance ).raycast( raycaster, intersects ); + + } + + } + + update( camera ) { + + const levels = this.levels; + + if ( levels.length > 1 ) { + + _v1$2.setFromMatrixPosition( camera.matrixWorld ); + _v2$1.setFromMatrixPosition( this.matrixWorld ); + + const distance = _v1$2.distanceTo( _v2$1 ) / camera.zoom; + + levels[ 0 ].object.visible = true; + + let i, l; + + for ( i = 1, l = levels.length; i < l; i ++ ) { + + if ( distance >= levels[ i ].distance ) { + + levels[ i - 1 ].object.visible = false; + levels[ i ].object.visible = true; + + } else { + + break; + + } + + } + + this._currentLevel = i - 1; + + for ( ; i < l; i ++ ) { + + levels[ i ].object.visible = false; + + } + + } + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + if ( this.autoUpdate === false ) data.object.autoUpdate = false; + + data.object.levels = []; + + const levels = this.levels; + + for ( let i = 0, l = levels.length; i < l; i ++ ) { + + const level = levels[ i ]; + + data.object.levels.push( { + object: level.object.uuid, + distance: level.distance + } ); + + } + + return data; + + } + +} + +const _basePosition = /*@__PURE__*/ new Vector3(); + +const _skinIndex = /*@__PURE__*/ new Vector4(); +const _skinWeight = /*@__PURE__*/ new Vector4(); + +const _vector$5 = /*@__PURE__*/ new Vector3(); +const _matrix = /*@__PURE__*/ new Matrix4(); + +class SkinnedMesh extends Mesh { + + constructor( geometry, material ) { + + super( geometry, material ); + + this.type = 'SkinnedMesh'; + + this.bindMode = 'attached'; + this.bindMatrix = new Matrix4(); + this.bindMatrixInverse = new Matrix4(); + + } + + copy( source ) { + + super.copy( source ); + + this.bindMode = source.bindMode; + this.bindMatrix.copy( source.bindMatrix ); + this.bindMatrixInverse.copy( source.bindMatrixInverse ); + + this.skeleton = source.skeleton; + + return this; + + } + + bind( skeleton, bindMatrix ) { + + this.skeleton = skeleton; + + if ( bindMatrix === undefined ) { + + this.updateMatrixWorld( true ); + + this.skeleton.calculateInverses(); + + bindMatrix = this.matrixWorld; + + } + + this.bindMatrix.copy( bindMatrix ); + this.bindMatrixInverse.copy( bindMatrix ).invert(); + + } + + pose() { + + this.skeleton.pose(); + + } + + normalizeSkinWeights() { + + const vector = new Vector4(); + + const skinWeight = this.geometry.attributes.skinWeight; + + for ( let i = 0, l = skinWeight.count; i < l; i ++ ) { + + vector.x = skinWeight.getX( i ); + vector.y = skinWeight.getY( i ); + vector.z = skinWeight.getZ( i ); + vector.w = skinWeight.getW( i ); + + const scale = 1.0 / vector.manhattanLength(); + + if ( scale !== Infinity ) { + + vector.multiplyScalar( scale ); + + } else { + + vector.set( 1, 0, 0, 0 ); // do something reasonable + + } + + skinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w ); + + } + + } + + updateMatrixWorld( force ) { + + super.updateMatrixWorld( force ); + + if ( this.bindMode === 'attached' ) { + + this.bindMatrixInverse.copy( this.matrixWorld ).invert(); + + } else if ( this.bindMode === 'detached' ) { + + this.bindMatrixInverse.copy( this.bindMatrix ).invert(); + + } else { + + console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode ); + + } + + } + + boneTransform( index, target ) { + + const skeleton = this.skeleton; + const geometry = this.geometry; + + _skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index ); + _skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index ); + + _basePosition.copy( target ).applyMatrix4( this.bindMatrix ); + + target.set( 0, 0, 0 ); + + for ( let i = 0; i < 4; i ++ ) { + + const weight = _skinWeight.getComponent( i ); + + if ( weight !== 0 ) { + + const boneIndex = _skinIndex.getComponent( i ); + + _matrix.multiplyMatrices( skeleton.bones[ boneIndex ].matrixWorld, skeleton.boneInverses[ boneIndex ] ); + + target.addScaledVector( _vector$5.copy( _basePosition ).applyMatrix4( _matrix ), weight ); + + } + + } + + return target.applyMatrix4( this.bindMatrixInverse ); + + } + +} + +SkinnedMesh.prototype.isSkinnedMesh = true; + +class Bone extends Object3D { + + constructor() { + + super(); + + this.type = 'Bone'; + + } + +} + +Bone.prototype.isBone = true; + +class DataTexture extends Texture { + + constructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding ) { + + super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + + this.image = { data: data, width: width, height: height }; + + this.magFilter = magFilter; + this.minFilter = minFilter; + + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; + + } + +} + +DataTexture.prototype.isDataTexture = true; + +const _offsetMatrix = /*@__PURE__*/ new Matrix4(); +const _identityMatrix = /*@__PURE__*/ new Matrix4(); + +class Skeleton { + + constructor( bones = [], boneInverses = [] ) { + + this.uuid = generateUUID(); + + this.bones = bones.slice( 0 ); + this.boneInverses = boneInverses; + this.boneMatrices = null; + + this.boneTexture = null; + this.boneTextureSize = 0; + + this.frame = - 1; + + this.init(); + + } + + init() { + + const bones = this.bones; + const boneInverses = this.boneInverses; + + this.boneMatrices = new Float32Array( bones.length * 16 ); + + // calculate inverse bone matrices if necessary + + if ( boneInverses.length === 0 ) { + + this.calculateInverses(); + + } else { + + // handle special case + + if ( bones.length !== boneInverses.length ) { + + console.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' ); + + this.boneInverses = []; + + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { + + this.boneInverses.push( new Matrix4() ); + + } + + } + + } + + } + + calculateInverses() { + + this.boneInverses.length = 0; + + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { + + const inverse = new Matrix4(); + + if ( this.bones[ i ] ) { + + inverse.copy( this.bones[ i ].matrixWorld ).invert(); + + } + + this.boneInverses.push( inverse ); + + } + + } + + pose() { + + // recover the bind-time world matrices + + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { + + const bone = this.bones[ i ]; + + if ( bone ) { + + bone.matrixWorld.copy( this.boneInverses[ i ] ).invert(); + + } + + } + + // compute the local matrices, positions, rotations and scales + + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { + + const bone = this.bones[ i ]; + + if ( bone ) { + + if ( bone.parent && bone.parent.isBone ) { + + bone.matrix.copy( bone.parent.matrixWorld ).invert(); + bone.matrix.multiply( bone.matrixWorld ); + + } else { + + bone.matrix.copy( bone.matrixWorld ); + + } + + bone.matrix.decompose( bone.position, bone.quaternion, bone.scale ); + + } + + } + + } + + update() { + + const bones = this.bones; + const boneInverses = this.boneInverses; + const boneMatrices = this.boneMatrices; + const boneTexture = this.boneTexture; + + // flatten bone matrices to array + + for ( let i = 0, il = bones.length; i < il; i ++ ) { + + // compute the offset between the current and the original transform + + const matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix; + + _offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] ); + _offsetMatrix.toArray( boneMatrices, i * 16 ); + + } + + if ( boneTexture !== null ) { + + boneTexture.needsUpdate = true; + + } + + } + + clone() { + + return new Skeleton( this.bones, this.boneInverses ); + + } + + computeBoneTexture() { + + // layout (1 matrix = 4 pixels) + // RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4) + // with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8) + // 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16) + // 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32) + // 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64) + + let size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix + size = ceilPowerOfTwo( size ); + size = Math.max( size, 4 ); + + const boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel + boneMatrices.set( this.boneMatrices ); // copy current values + + const boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType ); + boneTexture.needsUpdate = true; + + this.boneMatrices = boneMatrices; + this.boneTexture = boneTexture; + this.boneTextureSize = size; + + return this; + + } + + getBoneByName( name ) { + + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { + + const bone = this.bones[ i ]; + + if ( bone.name === name ) { + + return bone; + + } + + } + + return undefined; + + } + + dispose( ) { + + if ( this.boneTexture !== null ) { + + this.boneTexture.dispose(); + + this.boneTexture = null; + + } + + } + + fromJSON( json, bones ) { + + this.uuid = json.uuid; + + for ( let i = 0, l = json.bones.length; i < l; i ++ ) { + + const uuid = json.bones[ i ]; + let bone = bones[ uuid ]; + + if ( bone === undefined ) { + + console.warn( 'THREE.Skeleton: No bone found with UUID:', uuid ); + bone = new Bone(); + + } + + this.bones.push( bone ); + this.boneInverses.push( new Matrix4().fromArray( json.boneInverses[ i ] ) ); + + } + + this.init(); + + return this; + + } + + toJSON() { + + const data = { + metadata: { + version: 4.5, + type: 'Skeleton', + generator: 'Skeleton.toJSON' + }, + bones: [], + boneInverses: [] + }; + + data.uuid = this.uuid; + + const bones = this.bones; + const boneInverses = this.boneInverses; + + for ( let i = 0, l = bones.length; i < l; i ++ ) { + + const bone = bones[ i ]; + data.bones.push( bone.uuid ); + + const boneInverse = boneInverses[ i ]; + data.boneInverses.push( boneInverse.toArray() ); + + } + + return data; + + } + +} + +class InstancedBufferAttribute extends BufferAttribute { + + constructor( array, itemSize, normalized, meshPerAttribute = 1 ) { + + if ( typeof normalized === 'number' ) { + + meshPerAttribute = normalized; + + normalized = false; + + console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' ); + + } + + super( array, itemSize, normalized ); + + this.meshPerAttribute = meshPerAttribute; + + } + + copy( source ) { + + super.copy( source ); + + this.meshPerAttribute = source.meshPerAttribute; + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.meshPerAttribute = this.meshPerAttribute; + + data.isInstancedBufferAttribute = true; + + return data; + + } + +} + +InstancedBufferAttribute.prototype.isInstancedBufferAttribute = true; + +const _instanceLocalMatrix = /*@__PURE__*/ new Matrix4(); +const _instanceWorldMatrix = /*@__PURE__*/ new Matrix4(); + +const _instanceIntersects = []; + +const _mesh = /*@__PURE__*/ new Mesh(); + +class InstancedMesh extends Mesh { + + constructor( geometry, material, count ) { + + super( geometry, material ); + + this.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 ); + this.instanceColor = null; + + this.count = count; + + this.frustumCulled = false; + + } + + copy( source ) { + + super.copy( source ); + + this.instanceMatrix.copy( source.instanceMatrix ); + + if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone(); + + this.count = source.count; + + return this; + + } + + getColorAt( index, color ) { + + color.fromArray( this.instanceColor.array, index * 3 ); + + } + + getMatrixAt( index, matrix ) { + + matrix.fromArray( this.instanceMatrix.array, index * 16 ); + + } + + raycast( raycaster, intersects ) { + + const matrixWorld = this.matrixWorld; + const raycastTimes = this.count; + + _mesh.geometry = this.geometry; + _mesh.material = this.material; + + if ( _mesh.material === undefined ) return; + + for ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) { + + // calculate the world matrix for each instance + + this.getMatrixAt( instanceId, _instanceLocalMatrix ); + + _instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix ); + + // the mesh represents this single instance + + _mesh.matrixWorld = _instanceWorldMatrix; + + _mesh.raycast( raycaster, _instanceIntersects ); + + // process the result of raycast + + for ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) { + + const intersect = _instanceIntersects[ i ]; + intersect.instanceId = instanceId; + intersect.object = this; + intersects.push( intersect ); + + } + + _instanceIntersects.length = 0; + + } + + } + + setColorAt( index, color ) { + + if ( this.instanceColor === null ) { + + this.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ), 3 ); + + } + + color.toArray( this.instanceColor.array, index * 3 ); + + } + + setMatrixAt( index, matrix ) { + + matrix.toArray( this.instanceMatrix.array, index * 16 ); + + } + + updateMorphTargets() { + + } + + dispose() { + + this.dispatchEvent( { type: 'dispose' } ); + + } + +} + +InstancedMesh.prototype.isInstancedMesh = true; + +/** + * parameters = { + * color: , + * opacity: , + * + * linewidth: , + * linecap: "round", + * linejoin: "round" + * } + */ + +class LineBasicMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'LineBasicMaterial'; + + this.color = new Color( 0xffffff ); + + this.linewidth = 1; + this.linecap = 'round'; + this.linejoin = 'round'; + + this.setValues( parameters ); + + } + + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + + this.linewidth = source.linewidth; + this.linecap = source.linecap; + this.linejoin = source.linejoin; + + return this; + + } + +} + +LineBasicMaterial.prototype.isLineBasicMaterial = true; + +const _start$1 = /*@__PURE__*/ new Vector3(); +const _end$1 = /*@__PURE__*/ new Vector3(); +const _inverseMatrix$1 = /*@__PURE__*/ new Matrix4(); +const _ray$1 = /*@__PURE__*/ new Ray(); +const _sphere$1 = /*@__PURE__*/ new Sphere(); + +class Line extends Object3D { + + constructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) { + + super(); + + this.type = 'Line'; + + this.geometry = geometry; + this.material = material; + + this.updateMorphTargets(); + + } + + copy( source ) { + + super.copy( source ); + + this.material = source.material; + this.geometry = source.geometry; + + return this; + + } + + computeLineDistances() { + + const geometry = this.geometry; + + if ( geometry.isBufferGeometry ) { + + // we assume non-indexed geometry + + if ( geometry.index === null ) { + + const positionAttribute = geometry.attributes.position; + const lineDistances = [ 0 ]; + + for ( let i = 1, l = positionAttribute.count; i < l; i ++ ) { + + _start$1.fromBufferAttribute( positionAttribute, i - 1 ); + _end$1.fromBufferAttribute( positionAttribute, i ); + + lineDistances[ i ] = lineDistances[ i - 1 ]; + lineDistances[ i ] += _start$1.distanceTo( _end$1 ); + + } + + geometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) ); + + } else { + + console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ); + + } + + } else if ( geometry.isGeometry ) { + + console.error( 'THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + return this; + + } + + raycast( raycaster, intersects ) { + + const geometry = this.geometry; + const matrixWorld = this.matrixWorld; + const threshold = raycaster.params.Line.threshold; + const drawRange = geometry.drawRange; + + // Checking boundingSphere distance to ray + + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + + _sphere$1.copy( geometry.boundingSphere ); + _sphere$1.applyMatrix4( matrixWorld ); + _sphere$1.radius += threshold; + + if ( raycaster.ray.intersectsSphere( _sphere$1 ) === false ) return; + + // + + _inverseMatrix$1.copy( matrixWorld ).invert(); + _ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 ); + + const localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); + const localThresholdSq = localThreshold * localThreshold; + + const vStart = new Vector3(); + const vEnd = new Vector3(); + const interSegment = new Vector3(); + const interRay = new Vector3(); + const step = this.isLineSegments ? 2 : 1; + + if ( geometry.isBufferGeometry ) { + + const index = geometry.index; + const attributes = geometry.attributes; + const positionAttribute = attributes.position; + + if ( index !== null ) { + + const start = Math.max( 0, drawRange.start ); + const end = Math.min( index.count, ( drawRange.start + drawRange.count ) ); + + for ( let i = start, l = end - 1; i < l; i += step ) { + + const a = index.getX( i ); + const b = index.getX( i + 1 ); + + vStart.fromBufferAttribute( positionAttribute, a ); + vEnd.fromBufferAttribute( positionAttribute, b ); + + const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); + + if ( distSq > localThresholdSq ) continue; + + interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + + const distance = raycaster.ray.origin.distanceTo( interRay ); + + if ( distance < raycaster.near || distance > raycaster.far ) continue; + + intersects.push( { + + distance: distance, + // What do we want? intersection point on the ray or on the segment?? + // point: raycaster.ray.at( distance ), + point: interSegment.clone().applyMatrix4( this.matrixWorld ), + index: i, + face: null, + faceIndex: null, + object: this + + } ); + + } + + } else { + + const start = Math.max( 0, drawRange.start ); + const end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) ); + + for ( let i = start, l = end - 1; i < l; i += step ) { + + vStart.fromBufferAttribute( positionAttribute, i ); + vEnd.fromBufferAttribute( positionAttribute, i + 1 ); + + const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); + + if ( distSq > localThresholdSq ) continue; + + interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + + const distance = raycaster.ray.origin.distanceTo( interRay ); + + if ( distance < raycaster.near || distance > raycaster.far ) continue; + + intersects.push( { + + distance: distance, + // What do we want? intersection point on the ray or on the segment?? + // point: raycaster.ray.at( distance ), + point: interSegment.clone().applyMatrix4( this.matrixWorld ), + index: i, + face: null, + faceIndex: null, + object: this + + } ); + + } + + } + + } else if ( geometry.isGeometry ) { + + console.error( 'THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + } + + updateMorphTargets() { + + const geometry = this.geometry; + + if ( geometry.isBufferGeometry ) { + + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys( morphAttributes ); + + if ( keys.length > 0 ) { + + const morphAttribute = morphAttributes[ keys[ 0 ] ]; + + if ( morphAttribute !== undefined ) { + + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; + + for ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) { + + const name = morphAttribute[ m ].name || String( m ); + + this.morphTargetInfluences.push( 0 ); + this.morphTargetDictionary[ name ] = m; + + } + + } + + } + + } else { + + const morphTargets = geometry.morphTargets; + + if ( morphTargets !== undefined && morphTargets.length > 0 ) { + + console.error( 'THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + } + + } + +} + +Line.prototype.isLine = true; + +const _start = /*@__PURE__*/ new Vector3(); +const _end = /*@__PURE__*/ new Vector3(); + +class LineSegments extends Line { + + constructor( geometry, material ) { + + super( geometry, material ); + + this.type = 'LineSegments'; + + } + + computeLineDistances() { + + const geometry = this.geometry; + + if ( geometry.isBufferGeometry ) { + + // we assume non-indexed geometry + + if ( geometry.index === null ) { + + const positionAttribute = geometry.attributes.position; + const lineDistances = []; + + for ( let i = 0, l = positionAttribute.count; i < l; i += 2 ) { + + _start.fromBufferAttribute( positionAttribute, i ); + _end.fromBufferAttribute( positionAttribute, i + 1 ); + + lineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ]; + lineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end ); + + } + + geometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) ); + + } else { + + console.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ); + + } + + } else if ( geometry.isGeometry ) { + + console.error( 'THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + return this; + + } + +} + +LineSegments.prototype.isLineSegments = true; + +class LineLoop extends Line { + + constructor( geometry, material ) { + + super( geometry, material ); + + this.type = 'LineLoop'; + + } + +} + +LineLoop.prototype.isLineLoop = true; + +/** + * parameters = { + * color: , + * opacity: , + * map: new THREE.Texture( ), + * alphaMap: new THREE.Texture( ), + * + * size: , + * sizeAttenuation: + * + * } + */ + +class PointsMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'PointsMaterial'; + + this.color = new Color( 0xffffff ); + + this.map = null; + + this.alphaMap = null; + + this.size = 1; + this.sizeAttenuation = true; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + + this.map = source.map; + + this.alphaMap = source.alphaMap; + + this.size = source.size; + this.sizeAttenuation = source.sizeAttenuation; + + return this; + + } + +} + +PointsMaterial.prototype.isPointsMaterial = true; + +const _inverseMatrix = /*@__PURE__*/ new Matrix4(); +const _ray = /*@__PURE__*/ new Ray(); +const _sphere = /*@__PURE__*/ new Sphere(); +const _position$2 = /*@__PURE__*/ new Vector3(); + +class Points extends Object3D { + + constructor( geometry = new BufferGeometry(), material = new PointsMaterial() ) { + + super(); + + this.type = 'Points'; + + this.geometry = geometry; + this.material = material; + + this.updateMorphTargets(); + + } + + copy( source ) { + + super.copy( source ); + + this.material = source.material; + this.geometry = source.geometry; + + return this; + + } + + raycast( raycaster, intersects ) { + + const geometry = this.geometry; + const matrixWorld = this.matrixWorld; + const threshold = raycaster.params.Points.threshold; + const drawRange = geometry.drawRange; + + // Checking boundingSphere distance to ray + + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + + _sphere.copy( geometry.boundingSphere ); + _sphere.applyMatrix4( matrixWorld ); + _sphere.radius += threshold; + + if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return; + + // + + _inverseMatrix.copy( matrixWorld ).invert(); + _ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix ); + + const localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); + const localThresholdSq = localThreshold * localThreshold; + + if ( geometry.isBufferGeometry ) { + + const index = geometry.index; + const attributes = geometry.attributes; + const positionAttribute = attributes.position; + + if ( index !== null ) { + + const start = Math.max( 0, drawRange.start ); + const end = Math.min( index.count, ( drawRange.start + drawRange.count ) ); + + for ( let i = start, il = end; i < il; i ++ ) { + + const a = index.getX( i ); + + _position$2.fromBufferAttribute( positionAttribute, a ); + + testPoint( _position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this ); + + } + + } else { + + const start = Math.max( 0, drawRange.start ); + const end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) ); + + for ( let i = start, l = end; i < l; i ++ ) { + + _position$2.fromBufferAttribute( positionAttribute, i ); + + testPoint( _position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this ); + + } + + } + + } else { + + console.error( 'THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + } + + updateMorphTargets() { + + const geometry = this.geometry; + + if ( geometry.isBufferGeometry ) { + + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys( morphAttributes ); + + if ( keys.length > 0 ) { + + const morphAttribute = morphAttributes[ keys[ 0 ] ]; + + if ( morphAttribute !== undefined ) { + + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; + + for ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) { + + const name = morphAttribute[ m ].name || String( m ); + + this.morphTargetInfluences.push( 0 ); + this.morphTargetDictionary[ name ] = m; + + } + + } + + } + + } else { + + const morphTargets = geometry.morphTargets; + + if ( morphTargets !== undefined && morphTargets.length > 0 ) { + + console.error( 'THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.' ); + + } + + } + + } + +} + +Points.prototype.isPoints = true; + +function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) { + + const rayPointDistanceSq = _ray.distanceSqToPoint( point ); + + if ( rayPointDistanceSq < localThresholdSq ) { + + const intersectPoint = new Vector3(); + + _ray.closestPointToPoint( point, intersectPoint ); + intersectPoint.applyMatrix4( matrixWorld ); + + const distance = raycaster.ray.origin.distanceTo( intersectPoint ); + + if ( distance < raycaster.near || distance > raycaster.far ) return; + + intersects.push( { + + distance: distance, + distanceToRay: Math.sqrt( rayPointDistanceSq ), + point: intersectPoint, + index: index, + face: null, + object: object + + } ); + + } + +} + +class VideoTexture extends Texture { + + constructor( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { + + super( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + + this.minFilter = minFilter !== undefined ? minFilter : LinearFilter; + this.magFilter = magFilter !== undefined ? magFilter : LinearFilter; + + this.generateMipmaps = false; + + const scope = this; + + function updateVideo() { + + scope.needsUpdate = true; + video.requestVideoFrameCallback( updateVideo ); + + } + + if ( 'requestVideoFrameCallback' in video ) { + + video.requestVideoFrameCallback( updateVideo ); + + } + + } + + clone() { + + return new this.constructor( this.image ).copy( this ); + + } + + update() { + + const video = this.image; + const hasVideoFrameCallback = 'requestVideoFrameCallback' in video; + + if ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA ) { + + this.needsUpdate = true; + + } + + } + +} + +VideoTexture.prototype.isVideoTexture = true; + +class FramebufferTexture extends Texture { + + constructor( width, height, format ) { + + super( { width, height } ); + + this.format = format; + + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; + + this.generateMipmaps = false; + + this.needsUpdate = true; + + } + +} + +FramebufferTexture.prototype.isFramebufferTexture = true; + +class CompressedTexture extends Texture { + + constructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) { + + super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + + this.image = { width: width, height: height }; + this.mipmaps = mipmaps; + + // no flipping for cube textures + // (also flipping doesn't work for compressed textures ) + + this.flipY = false; + + // can't generate mipmaps for compressed textures + // mips must be embedded in DDS files + + this.generateMipmaps = false; + + } + +} + +CompressedTexture.prototype.isCompressedTexture = true; + +class CanvasTexture extends Texture { + + constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { + + super( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + + this.needsUpdate = true; + + } + +} + +CanvasTexture.prototype.isCanvasTexture = true; + +class CircleGeometry extends BufferGeometry { + + constructor( radius = 1, segments = 8, thetaStart = 0, thetaLength = Math.PI * 2 ) { + + super(); + + this.type = 'CircleGeometry'; + + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + segments = Math.max( 3, segments ); + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // helper variables + + const vertex = new Vector3(); + const uv = new Vector2(); + + // center point + + vertices.push( 0, 0, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( 0.5, 0.5 ); + + for ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) { + + const segment = thetaStart + s / segments * thetaLength; + + // vertex + + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); + + vertices.push( vertex.x, vertex.y, vertex.z ); + + // normal + + normals.push( 0, 0, 1 ); + + // uvs + + uv.x = ( vertices[ i ] / radius + 1 ) / 2; + uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; + + uvs.push( uv.x, uv.y ); + + } + + // indices + + for ( let i = 1; i <= segments; i ++ ) { + + indices.push( i, i + 1, 0 ); + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + } + + static fromJSON( data ) { + + return new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength ); + + } + +} + +class CylinderGeometry extends BufferGeometry { + + constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) { + + super(); + this.type = 'CylinderGeometry'; + + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + const scope = this; + + radialSegments = Math.floor( radialSegments ); + heightSegments = Math.floor( heightSegments ); + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // helper variables + + let index = 0; + const indexArray = []; + const halfHeight = height / 2; + let groupStart = 0; + + // generate geometry + + generateTorso(); + + if ( openEnded === false ) { + + if ( radiusTop > 0 ) generateCap( true ); + if ( radiusBottom > 0 ) generateCap( false ); + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + function generateTorso() { + + const normal = new Vector3(); + const vertex = new Vector3(); + + let groupCount = 0; + + // this will be used to calculate the normal + const slope = ( radiusBottom - radiusTop ) / height; + + // generate vertices, normals and uvs + + for ( let y = 0; y <= heightSegments; y ++ ) { + + const indexRow = []; + + const v = y / heightSegments; + + // calculate the radius of the current row + + const radius = v * ( radiusBottom - radiusTop ) + radiusTop; + + for ( let x = 0; x <= radialSegments; x ++ ) { + + const u = x / radialSegments; + + const theta = u * thetaLength + thetaStart; + + const sinTheta = Math.sin( theta ); + const cosTheta = Math.cos( theta ); + + // vertex + + vertex.x = radius * sinTheta; + vertex.y = - v * height + halfHeight; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); + + // normal + + normal.set( sinTheta, slope, cosTheta ).normalize(); + normals.push( normal.x, normal.y, normal.z ); + + // uv + + uvs.push( u, 1 - v ); + + // save index of vertex in respective row + + indexRow.push( index ++ ); + + } + + // now save vertices of the row in our index array + + indexArray.push( indexRow ); + + } + + // generate indices + + for ( let x = 0; x < radialSegments; x ++ ) { + + for ( let y = 0; y < heightSegments; y ++ ) { + + // we use the index array to access the correct indices + + const a = indexArray[ y ][ x ]; + const b = indexArray[ y + 1 ][ x ]; + const c = indexArray[ y + 1 ][ x + 1 ]; + const d = indexArray[ y ][ x + 1 ]; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + // update group counter + + groupCount += 6; + + } + + } + + // add a group to the geometry. this will ensure multi material support + + scope.addGroup( groupStart, groupCount, 0 ); + + // calculate new start value for groups + + groupStart += groupCount; + + } + + function generateCap( top ) { + + // save the index of the first center vertex + const centerIndexStart = index; + + const uv = new Vector2(); + const vertex = new Vector3(); + + let groupCount = 0; + + const radius = ( top === true ) ? radiusTop : radiusBottom; + const sign = ( top === true ) ? 1 : - 1; + + // first we generate the center vertex data of the cap. + // because the geometry needs one set of uvs per face, + // we must generate a center vertex per face/segment + + for ( let x = 1; x <= radialSegments; x ++ ) { + + // vertex + + vertices.push( 0, halfHeight * sign, 0 ); + + // normal + + normals.push( 0, sign, 0 ); + + // uv + + uvs.push( 0.5, 0.5 ); + + // increase index + + index ++; + + } + + // save the index of the last center vertex + const centerIndexEnd = index; + + // now we generate the surrounding vertices, normals and uvs + + for ( let x = 0; x <= radialSegments; x ++ ) { + + const u = x / radialSegments; + const theta = u * thetaLength + thetaStart; + + const cosTheta = Math.cos( theta ); + const sinTheta = Math.sin( theta ); + + // vertex + + vertex.x = radius * sinTheta; + vertex.y = halfHeight * sign; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); + + // normal + + normals.push( 0, sign, 0 ); + + // uv + + uv.x = ( cosTheta * 0.5 ) + 0.5; + uv.y = ( sinTheta * 0.5 * sign ) + 0.5; + uvs.push( uv.x, uv.y ); + + // increase index + + index ++; + + } + + // generate indices + + for ( let x = 0; x < radialSegments; x ++ ) { + + const c = centerIndexStart + x; + const i = centerIndexEnd + x; + + if ( top === true ) { + + // face top + + indices.push( i, i + 1, c ); + + } else { + + // face bottom + + indices.push( i + 1, i, c ); + + } + + groupCount += 3; + + } + + // add a group to the geometry. this will ensure multi material support + + scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); + + // calculate new start value for groups + + groupStart += groupCount; + + } + + } + + static fromJSON( data ) { + + return new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength ); + + } + +} + +class ConeGeometry extends CylinderGeometry { + + constructor( radius = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) { + + super( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + + this.type = 'ConeGeometry'; + + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + } + + static fromJSON( data ) { + + return new ConeGeometry( data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength ); + + } + +} + +class PolyhedronGeometry extends BufferGeometry { + + constructor( vertices = [], indices = [], radius = 1, detail = 0 ) { + + super(); + + this.type = 'PolyhedronGeometry'; + + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; + + // default buffer data + + const vertexBuffer = []; + const uvBuffer = []; + + // the subdivision creates the vertex buffer data + + subdivide( detail ); + + // all vertices should lie on a conceptual sphere with a given radius + + applyRadius( radius ); + + // finally, create the uv data + + generateUVs(); + + // build non-indexed geometry + + this.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); + + if ( detail === 0 ) { + + this.computeVertexNormals(); // flat normals + + } else { + + this.normalizeNormals(); // smooth normals + + } + + // helper functions + + function subdivide( detail ) { + + const a = new Vector3(); + const b = new Vector3(); + const c = new Vector3(); + + // iterate over all faces and apply a subdivison with the given detail value + + for ( let i = 0; i < indices.length; i += 3 ) { + + // get the vertices of the face + + getVertexByIndex( indices[ i + 0 ], a ); + getVertexByIndex( indices[ i + 1 ], b ); + getVertexByIndex( indices[ i + 2 ], c ); + + // perform subdivision + + subdivideFace( a, b, c, detail ); + + } + + } + + function subdivideFace( a, b, c, detail ) { + + const cols = detail + 1; + + // we use this multidimensional array as a data structure for creating the subdivision + + const v = []; + + // construct all of the vertices for this subdivision + + for ( let i = 0; i <= cols; i ++ ) { + + v[ i ] = []; + + const aj = a.clone().lerp( c, i / cols ); + const bj = b.clone().lerp( c, i / cols ); + + const rows = cols - i; + + for ( let j = 0; j <= rows; j ++ ) { + + if ( j === 0 && i === cols ) { + + v[ i ][ j ] = aj; + + } else { + + v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); + + } + + } + + } + + // construct all of the faces + + for ( let i = 0; i < cols; i ++ ) { + + for ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) { + + const k = Math.floor( j / 2 ); + + if ( j % 2 === 0 ) { + + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); + pushVertex( v[ i ][ k ] ); + + } else { + + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); + + } + + } + + } + + } + + function applyRadius( radius ) { + + const vertex = new Vector3(); + + // iterate over the entire buffer and apply the radius to each vertex + + for ( let i = 0; i < vertexBuffer.length; i += 3 ) { + + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; + + vertex.normalize().multiplyScalar( radius ); + + vertexBuffer[ i + 0 ] = vertex.x; + vertexBuffer[ i + 1 ] = vertex.y; + vertexBuffer[ i + 2 ] = vertex.z; + + } + + } + + function generateUVs() { + + const vertex = new Vector3(); + + for ( let i = 0; i < vertexBuffer.length; i += 3 ) { + + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; + + const u = azimuth( vertex ) / 2 / Math.PI + 0.5; + const v = inclination( vertex ) / Math.PI + 0.5; + uvBuffer.push( u, 1 - v ); + + } + + correctUVs(); + + correctSeam(); + + } + + function correctSeam() { + + // handle case when face straddles the seam, see #3269 + + for ( let i = 0; i < uvBuffer.length; i += 6 ) { + + // uv data of a single face + + const x0 = uvBuffer[ i + 0 ]; + const x1 = uvBuffer[ i + 2 ]; + const x2 = uvBuffer[ i + 4 ]; + + const max = Math.max( x0, x1, x2 ); + const min = Math.min( x0, x1, x2 ); + + // 0.9 is somewhat arbitrary + + if ( max > 0.9 && min < 0.1 ) { + + if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1; + if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1; + if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1; + + } + + } + + } + + function pushVertex( vertex ) { + + vertexBuffer.push( vertex.x, vertex.y, vertex.z ); + + } + + function getVertexByIndex( index, vertex ) { + + const stride = index * 3; + + vertex.x = vertices[ stride + 0 ]; + vertex.y = vertices[ stride + 1 ]; + vertex.z = vertices[ stride + 2 ]; + + } + + function correctUVs() { + + const a = new Vector3(); + const b = new Vector3(); + const c = new Vector3(); + + const centroid = new Vector3(); + + const uvA = new Vector2(); + const uvB = new Vector2(); + const uvC = new Vector2(); + + for ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { + + a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); + b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); + c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); + + uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); + uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); + uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); + + centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); + + const azi = azimuth( centroid ); + + correctUV( uvA, j + 0, a, azi ); + correctUV( uvB, j + 2, b, azi ); + correctUV( uvC, j + 4, c, azi ); + + } + + } + + function correctUV( uv, stride, vector, azimuth ) { + + if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { + + uvBuffer[ stride ] = uv.x - 1; + + } + + if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { + + uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; + + } + + } + + // Angle around the Y axis, counter-clockwise when looking from above. + + function azimuth( vector ) { + + return Math.atan2( vector.z, - vector.x ); + + } + + + // Angle above the XZ plane. + + function inclination( vector ) { + + return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); + + } + + } + + static fromJSON( data ) { + + return new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.details ); + + } + +} + +class DodecahedronGeometry extends PolyhedronGeometry { + + constructor( radius = 1, detail = 0 ) { + + const t = ( 1 + Math.sqrt( 5 ) ) / 2; + const r = 1 / t; + + const vertices = [ + + // (±1, ±1, ±1) + - 1, - 1, - 1, - 1, - 1, 1, + - 1, 1, - 1, - 1, 1, 1, + 1, - 1, - 1, 1, - 1, 1, + 1, 1, - 1, 1, 1, 1, + + // (0, ±1/φ, ±φ) + 0, - r, - t, 0, - r, t, + 0, r, - t, 0, r, t, + + // (±1/φ, ±φ, 0) + - r, - t, 0, - r, t, 0, + r, - t, 0, r, t, 0, + + // (±φ, 0, ±1/φ) + - t, 0, - r, t, 0, - r, + - t, 0, r, t, 0, r + ]; + + const indices = [ + 3, 11, 7, 3, 7, 15, 3, 15, 13, + 7, 19, 17, 7, 17, 6, 7, 6, 15, + 17, 4, 8, 17, 8, 10, 17, 10, 6, + 8, 0, 16, 8, 16, 2, 8, 2, 10, + 0, 12, 1, 0, 1, 18, 0, 18, 16, + 6, 10, 2, 6, 2, 13, 6, 13, 15, + 2, 16, 18, 2, 18, 3, 2, 3, 13, + 18, 1, 9, 18, 9, 11, 18, 11, 3, + 4, 14, 12, 4, 12, 0, 4, 0, 8, + 11, 9, 5, 11, 5, 19, 11, 19, 7, + 19, 5, 14, 19, 14, 4, 19, 4, 17, + 1, 12, 14, 1, 14, 5, 1, 5, 9 + ]; + + super( vertices, indices, radius, detail ); + + this.type = 'DodecahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + static fromJSON( data ) { + + return new DodecahedronGeometry( data.radius, data.detail ); + + } + +} + +const _v0 = new Vector3(); +const _v1$1 = new Vector3(); +const _normal = new Vector3(); +const _triangle = new Triangle(); + +class EdgesGeometry extends BufferGeometry { + + constructor( geometry = null, thresholdAngle = 1 ) { + + super(); + this.type = 'EdgesGeometry'; + + this.parameters = { + geometry: geometry, + thresholdAngle: thresholdAngle + }; + + if ( geometry !== null ) { + + const precisionPoints = 4; + const precision = Math.pow( 10, precisionPoints ); + const thresholdDot = Math.cos( DEG2RAD * thresholdAngle ); + + const indexAttr = geometry.getIndex(); + const positionAttr = geometry.getAttribute( 'position' ); + const indexCount = indexAttr ? indexAttr.count : positionAttr.count; + + const indexArr = [ 0, 0, 0 ]; + const vertKeys = [ 'a', 'b', 'c' ]; + const hashes = new Array( 3 ); + + const edgeData = {}; + const vertices = []; + for ( let i = 0; i < indexCount; i += 3 ) { + + if ( indexAttr ) { + + indexArr[ 0 ] = indexAttr.getX( i ); + indexArr[ 1 ] = indexAttr.getX( i + 1 ); + indexArr[ 2 ] = indexAttr.getX( i + 2 ); + + } else { + + indexArr[ 0 ] = i; + indexArr[ 1 ] = i + 1; + indexArr[ 2 ] = i + 2; + + } + + const { a, b, c } = _triangle; + a.fromBufferAttribute( positionAttr, indexArr[ 0 ] ); + b.fromBufferAttribute( positionAttr, indexArr[ 1 ] ); + c.fromBufferAttribute( positionAttr, indexArr[ 2 ] ); + _triangle.getNormal( _normal ); + + // create hashes for the edge from the vertices + hashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`; + hashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`; + hashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`; + + // skip degenerate triangles + if ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) { + + continue; + + } + + // iterate over every edge + for ( let j = 0; j < 3; j ++ ) { + + // get the first and next vertex making up the edge + const jNext = ( j + 1 ) % 3; + const vecHash0 = hashes[ j ]; + const vecHash1 = hashes[ jNext ]; + const v0 = _triangle[ vertKeys[ j ] ]; + const v1 = _triangle[ vertKeys[ jNext ] ]; + + const hash = `${ vecHash0 }_${ vecHash1 }`; + const reverseHash = `${ vecHash1 }_${ vecHash0 }`; + + if ( reverseHash in edgeData && edgeData[ reverseHash ] ) { + + // if we found a sibling edge add it into the vertex array if + // it meets the angle threshold and delete the edge from the map. + if ( _normal.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) { + + vertices.push( v0.x, v0.y, v0.z ); + vertices.push( v1.x, v1.y, v1.z ); + + } + + edgeData[ reverseHash ] = null; + + } else if ( ! ( hash in edgeData ) ) { + + // if we've already got an edge here then skip adding a new one + edgeData[ hash ] = { + + index0: indexArr[ j ], + index1: indexArr[ jNext ], + normal: _normal.clone(), + + }; + + } + + } + + } + + // iterate over all remaining, unmatched edges and add them to the vertex array + for ( const key in edgeData ) { + + if ( edgeData[ key ] ) { + + const { index0, index1 } = edgeData[ key ]; + _v0.fromBufferAttribute( positionAttr, index0 ); + _v1$1.fromBufferAttribute( positionAttr, index1 ); + + vertices.push( _v0.x, _v0.y, _v0.z ); + vertices.push( _v1$1.x, _v1$1.y, _v1$1.z ); + + } + + } + + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + + } + + } + +} + +/** + * Extensible curve object. + * + * Some common of curve methods: + * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget ) + * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget ) + * .getPoints(), .getSpacedPoints() + * .getLength() + * .updateArcLengths() + * + * This following curves inherit from THREE.Curve: + * + * -- 2D curves -- + * THREE.ArcCurve + * THREE.CubicBezierCurve + * THREE.EllipseCurve + * THREE.LineCurve + * THREE.QuadraticBezierCurve + * THREE.SplineCurve + * + * -- 3D curves -- + * THREE.CatmullRomCurve3 + * THREE.CubicBezierCurve3 + * THREE.LineCurve3 + * THREE.QuadraticBezierCurve3 + * + * A series of curves can be represented as a THREE.CurvePath. + * + **/ + +class Curve { + + constructor() { + + this.type = 'Curve'; + + this.arcLengthDivisions = 200; + + } + + // Virtual base class method to overwrite and implement in subclasses + // - t [0 .. 1] + + getPoint( /* t, optionalTarget */ ) { + + console.warn( 'THREE.Curve: .getPoint() not implemented.' ); + return null; + + } + + // Get point at relative position in curve according to arc length + // - u [0 .. 1] + + getPointAt( u, optionalTarget ) { + + const t = this.getUtoTmapping( u ); + return this.getPoint( t, optionalTarget ); + + } + + // Get sequence of points using getPoint( t ) + + getPoints( divisions = 5 ) { + + const points = []; + + for ( let d = 0; d <= divisions; d ++ ) { + + points.push( this.getPoint( d / divisions ) ); + + } + + return points; + + } + + // Get sequence of points using getPointAt( u ) + + getSpacedPoints( divisions = 5 ) { + + const points = []; + + for ( let d = 0; d <= divisions; d ++ ) { + + points.push( this.getPointAt( d / divisions ) ); + + } + + return points; + + } + + // Get total curve arc length + + getLength() { + + const lengths = this.getLengths(); + return lengths[ lengths.length - 1 ]; + + } + + // Get list of cumulative segment lengths + + getLengths( divisions = this.arcLengthDivisions ) { + + if ( this.cacheArcLengths && + ( this.cacheArcLengths.length === divisions + 1 ) && + ! this.needsUpdate ) { + + return this.cacheArcLengths; + + } + + this.needsUpdate = false; + + const cache = []; + let current, last = this.getPoint( 0 ); + let sum = 0; + + cache.push( 0 ); + + for ( let p = 1; p <= divisions; p ++ ) { + + current = this.getPoint( p / divisions ); + sum += current.distanceTo( last ); + cache.push( sum ); + last = current; + + } + + this.cacheArcLengths = cache; + + return cache; // { sums: cache, sum: sum }; Sum is in the last element. + + } + + updateArcLengths() { + + this.needsUpdate = true; + this.getLengths(); + + } + + // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant + + getUtoTmapping( u, distance ) { + + const arcLengths = this.getLengths(); + + let i = 0; + const il = arcLengths.length; + + let targetArcLength; // The targeted u distance value to get + + if ( distance ) { + + targetArcLength = distance; + + } else { + + targetArcLength = u * arcLengths[ il - 1 ]; + + } + + // binary search for the index with largest value smaller than target u distance + + let low = 0, high = il - 1, comparison; + + while ( low <= high ) { + + i = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats + + comparison = arcLengths[ i ] - targetArcLength; + + if ( comparison < 0 ) { + + low = i + 1; + + } else if ( comparison > 0 ) { + + high = i - 1; + + } else { + + high = i; + break; + + // DONE + + } + + } + + i = high; + + if ( arcLengths[ i ] === targetArcLength ) { + + return i / ( il - 1 ); + + } + + // we could get finer grain at lengths, or use simple interpolation between two points + + const lengthBefore = arcLengths[ i ]; + const lengthAfter = arcLengths[ i + 1 ]; + + const segmentLength = lengthAfter - lengthBefore; + + // determine where we are between the 'before' and 'after' points + + const segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength; + + // add that fractional amount to t + + const t = ( i + segmentFraction ) / ( il - 1 ); + + return t; + + } + + // Returns a unit vector tangent at t + // In case any sub curve does not implement its tangent derivation, + // 2 points a small delta apart will be used to find its gradient + // which seems to give a reasonable approximation + + getTangent( t, optionalTarget ) { + + const delta = 0.0001; + let t1 = t - delta; + let t2 = t + delta; + + // Capping in case of danger + + if ( t1 < 0 ) t1 = 0; + if ( t2 > 1 ) t2 = 1; + + const pt1 = this.getPoint( t1 ); + const pt2 = this.getPoint( t2 ); + + const tangent = optionalTarget || ( ( pt1.isVector2 ) ? new Vector2() : new Vector3() ); + + tangent.copy( pt2 ).sub( pt1 ).normalize(); + + return tangent; + + } + + getTangentAt( u, optionalTarget ) { + + const t = this.getUtoTmapping( u ); + return this.getTangent( t, optionalTarget ); + + } + + computeFrenetFrames( segments, closed ) { + + // see http://www.cs.indiana.edu/pub/techreports/TR425.pdf + + const normal = new Vector3(); + + const tangents = []; + const normals = []; + const binormals = []; + + const vec = new Vector3(); + const mat = new Matrix4(); + + // compute the tangent vectors for each segment on the curve + + for ( let i = 0; i <= segments; i ++ ) { + + const u = i / segments; + + tangents[ i ] = this.getTangentAt( u, new Vector3() ); + + } + + // select an initial normal vector perpendicular to the first tangent vector, + // and in the direction of the minimum tangent xyz component + + normals[ 0 ] = new Vector3(); + binormals[ 0 ] = new Vector3(); + let min = Number.MAX_VALUE; + const tx = Math.abs( tangents[ 0 ].x ); + const ty = Math.abs( tangents[ 0 ].y ); + const tz = Math.abs( tangents[ 0 ].z ); + + if ( tx <= min ) { + + min = tx; + normal.set( 1, 0, 0 ); + + } + + if ( ty <= min ) { + + min = ty; + normal.set( 0, 1, 0 ); + + } + + if ( tz <= min ) { + + normal.set( 0, 0, 1 ); + + } + + vec.crossVectors( tangents[ 0 ], normal ).normalize(); + + normals[ 0 ].crossVectors( tangents[ 0 ], vec ); + binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] ); + + + // compute the slowly-varying normal and binormal vectors for each segment on the curve + + for ( let i = 1; i <= segments; i ++ ) { + + normals[ i ] = normals[ i - 1 ].clone(); + + binormals[ i ] = binormals[ i - 1 ].clone(); + + vec.crossVectors( tangents[ i - 1 ], tangents[ i ] ); + + if ( vec.length() > Number.EPSILON ) { + + vec.normalize(); + + const theta = Math.acos( clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors + + normals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) ); + + } + + binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); + + } + + // if the curve is closed, postprocess the vectors so the first and last normal vectors are the same + + if ( closed === true ) { + + let theta = Math.acos( clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) ); + theta /= segments; + + if ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) { + + theta = - theta; + + } + + for ( let i = 1; i <= segments; i ++ ) { + + // twist a little... + normals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) ); + binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); + + } + + } + + return { + tangents: tangents, + normals: normals, + binormals: binormals + }; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( source ) { + + this.arcLengthDivisions = source.arcLengthDivisions; + + return this; + + } + + toJSON() { + + const data = { + metadata: { + version: 4.5, + type: 'Curve', + generator: 'Curve.toJSON' + } + }; + + data.arcLengthDivisions = this.arcLengthDivisions; + data.type = this.type; + + return data; + + } + + fromJSON( json ) { + + this.arcLengthDivisions = json.arcLengthDivisions; + + return this; + + } + +} + +class EllipseCurve extends Curve { + + constructor( aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0 ) { + + super(); + + this.type = 'EllipseCurve'; + + this.aX = aX; + this.aY = aY; + + this.xRadius = xRadius; + this.yRadius = yRadius; + + this.aStartAngle = aStartAngle; + this.aEndAngle = aEndAngle; + + this.aClockwise = aClockwise; + + this.aRotation = aRotation; + + } + + getPoint( t, optionalTarget ) { + + const point = optionalTarget || new Vector2(); + + const twoPi = Math.PI * 2; + let deltaAngle = this.aEndAngle - this.aStartAngle; + const samePoints = Math.abs( deltaAngle ) < Number.EPSILON; + + // ensures that deltaAngle is 0 .. 2 PI + while ( deltaAngle < 0 ) deltaAngle += twoPi; + while ( deltaAngle > twoPi ) deltaAngle -= twoPi; + + if ( deltaAngle < Number.EPSILON ) { + + if ( samePoints ) { + + deltaAngle = 0; + + } else { + + deltaAngle = twoPi; + + } + + } + + if ( this.aClockwise === true && ! samePoints ) { + + if ( deltaAngle === twoPi ) { + + deltaAngle = - twoPi; + + } else { + + deltaAngle = deltaAngle - twoPi; + + } + + } + + const angle = this.aStartAngle + t * deltaAngle; + let x = this.aX + this.xRadius * Math.cos( angle ); + let y = this.aY + this.yRadius * Math.sin( angle ); + + if ( this.aRotation !== 0 ) { + + const cos = Math.cos( this.aRotation ); + const sin = Math.sin( this.aRotation ); + + const tx = x - this.aX; + const ty = y - this.aY; + + // Rotate the point about the center of the ellipse. + x = tx * cos - ty * sin + this.aX; + y = tx * sin + ty * cos + this.aY; + + } + + return point.set( x, y ); + + } + + copy( source ) { + + super.copy( source ); + + this.aX = source.aX; + this.aY = source.aY; + + this.xRadius = source.xRadius; + this.yRadius = source.yRadius; + + this.aStartAngle = source.aStartAngle; + this.aEndAngle = source.aEndAngle; + + this.aClockwise = source.aClockwise; + + this.aRotation = source.aRotation; + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.aX = this.aX; + data.aY = this.aY; + + data.xRadius = this.xRadius; + data.yRadius = this.yRadius; + + data.aStartAngle = this.aStartAngle; + data.aEndAngle = this.aEndAngle; + + data.aClockwise = this.aClockwise; + + data.aRotation = this.aRotation; + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.aX = json.aX; + this.aY = json.aY; + + this.xRadius = json.xRadius; + this.yRadius = json.yRadius; + + this.aStartAngle = json.aStartAngle; + this.aEndAngle = json.aEndAngle; + + this.aClockwise = json.aClockwise; + + this.aRotation = json.aRotation; + + return this; + + } + +} + +EllipseCurve.prototype.isEllipseCurve = true; + +class ArcCurve extends EllipseCurve { + + constructor( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + + super( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); + + this.type = 'ArcCurve'; + + } + +} + +ArcCurve.prototype.isArcCurve = true; + +/** + * Centripetal CatmullRom Curve - which is useful for avoiding + * cusps and self-intersections in non-uniform catmull rom curves. + * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf + * + * curve.type accepts centripetal(default), chordal and catmullrom + * curve.tension is used for catmullrom which defaults to 0.5 + */ + + +/* +Based on an optimized c++ solution in + - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/ + - http://ideone.com/NoEbVM + +This CubicPoly class could be used for reusing some variables and calculations, +but for three.js curve use, it could be possible inlined and flatten into a single function call +which can be placed in CurveUtils. +*/ + +function CubicPoly() { + + let c0 = 0, c1 = 0, c2 = 0, c3 = 0; + + /* + * Compute coefficients for a cubic polynomial + * p(s) = c0 + c1*s + c2*s^2 + c3*s^3 + * such that + * p(0) = x0, p(1) = x1 + * and + * p'(0) = t0, p'(1) = t1. + */ + function init( x0, x1, t0, t1 ) { + + c0 = x0; + c1 = t0; + c2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1; + c3 = 2 * x0 - 2 * x1 + t0 + t1; + + } + + return { + + initCatmullRom: function ( x0, x1, x2, x3, tension ) { + + init( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) ); + + }, + + initNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) { + + // compute tangents when parameterized in [t1,t2] + let t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1; + let t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2; + + // rescale tangents for parametrization in [0,1] + t1 *= dt1; + t2 *= dt1; + + init( x1, x2, t1, t2 ); + + }, + + calc: function ( t ) { + + const t2 = t * t; + const t3 = t2 * t; + return c0 + c1 * t + c2 * t2 + c3 * t3; + + } + + }; + +} + +// + +const tmp = new Vector3(); +const px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly(); + +class CatmullRomCurve3 extends Curve { + + constructor( points = [], closed = false, curveType = 'centripetal', tension = 0.5 ) { + + super(); + + this.type = 'CatmullRomCurve3'; + + this.points = points; + this.closed = closed; + this.curveType = curveType; + this.tension = tension; + + } + + getPoint( t, optionalTarget = new Vector3() ) { + + const point = optionalTarget; + + const points = this.points; + const l = points.length; + + const p = ( l - ( this.closed ? 0 : 1 ) ) * t; + let intPoint = Math.floor( p ); + let weight = p - intPoint; + + if ( this.closed ) { + + intPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l; + + } else if ( weight === 0 && intPoint === l - 1 ) { + + intPoint = l - 2; + weight = 1; + + } + + let p0, p3; // 4 points (p1 & p2 defined below) + + if ( this.closed || intPoint > 0 ) { + + p0 = points[ ( intPoint - 1 ) % l ]; + + } else { + + // extrapolate first point + tmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] ); + p0 = tmp; + + } + + const p1 = points[ intPoint % l ]; + const p2 = points[ ( intPoint + 1 ) % l ]; + + if ( this.closed || intPoint + 2 < l ) { + + p3 = points[ ( intPoint + 2 ) % l ]; + + } else { + + // extrapolate last point + tmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] ); + p3 = tmp; + + } + + if ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) { + + // init Centripetal / Chordal Catmull-Rom + const pow = this.curveType === 'chordal' ? 0.5 : 0.25; + let dt0 = Math.pow( p0.distanceToSquared( p1 ), pow ); + let dt1 = Math.pow( p1.distanceToSquared( p2 ), pow ); + let dt2 = Math.pow( p2.distanceToSquared( p3 ), pow ); + + // safety check for repeated points + if ( dt1 < 1e-4 ) dt1 = 1.0; + if ( dt0 < 1e-4 ) dt0 = dt1; + if ( dt2 < 1e-4 ) dt2 = dt1; + + px.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 ); + py.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 ); + pz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 ); + + } else if ( this.curveType === 'catmullrom' ) { + + px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension ); + py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension ); + pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension ); + + } + + point.set( + px.calc( weight ), + py.calc( weight ), + pz.calc( weight ) + ); + + return point; + + } + + copy( source ) { + + super.copy( source ); + + this.points = []; + + for ( let i = 0, l = source.points.length; i < l; i ++ ) { + + const point = source.points[ i ]; + + this.points.push( point.clone() ); + + } + + this.closed = source.closed; + this.curveType = source.curveType; + this.tension = source.tension; + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.points = []; + + for ( let i = 0, l = this.points.length; i < l; i ++ ) { + + const point = this.points[ i ]; + data.points.push( point.toArray() ); + + } + + data.closed = this.closed; + data.curveType = this.curveType; + data.tension = this.tension; + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.points = []; + + for ( let i = 0, l = json.points.length; i < l; i ++ ) { + + const point = json.points[ i ]; + this.points.push( new Vector3().fromArray( point ) ); + + } + + this.closed = json.closed; + this.curveType = json.curveType; + this.tension = json.tension; + + return this; + + } + +} + +CatmullRomCurve3.prototype.isCatmullRomCurve3 = true; + +/** + * Bezier Curves formulas obtained from + * https://en.wikipedia.org/wiki/B%C3%A9zier_curve + */ + +function CatmullRom( t, p0, p1, p2, p3 ) { + + const v0 = ( p2 - p0 ) * 0.5; + const v1 = ( p3 - p1 ) * 0.5; + const t2 = t * t; + const t3 = t * t2; + return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1; + +} + +// + +function QuadraticBezierP0( t, p ) { + + const k = 1 - t; + return k * k * p; + +} + +function QuadraticBezierP1( t, p ) { + + return 2 * ( 1 - t ) * t * p; + +} + +function QuadraticBezierP2( t, p ) { + + return t * t * p; + +} + +function QuadraticBezier( t, p0, p1, p2 ) { + + return QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) + + QuadraticBezierP2( t, p2 ); + +} + +// + +function CubicBezierP0( t, p ) { + + const k = 1 - t; + return k * k * k * p; + +} + +function CubicBezierP1( t, p ) { + + const k = 1 - t; + return 3 * k * k * t * p; + +} + +function CubicBezierP2( t, p ) { + + return 3 * ( 1 - t ) * t * t * p; + +} + +function CubicBezierP3( t, p ) { + + return t * t * t * p; + +} + +function CubicBezier( t, p0, p1, p2, p3 ) { + + return CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) + + CubicBezierP3( t, p3 ); + +} + +class CubicBezierCurve extends Curve { + + constructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) { + + super(); + + this.type = 'CubicBezierCurve'; + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; + + } + + getPoint( t, optionalTarget = new Vector2() ) { + + const point = optionalTarget; + + const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; + + point.set( + CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), + CubicBezier( t, v0.y, v1.y, v2.y, v3.y ) + ); + + return point; + + } + + copy( source ) { + + super.copy( source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + this.v3.copy( source.v3 ); + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + data.v3 = this.v3.toArray(); + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + this.v3.fromArray( json.v3 ); + + return this; + + } + +} + +CubicBezierCurve.prototype.isCubicBezierCurve = true; + +class CubicBezierCurve3 extends Curve { + + constructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3() ) { + + super(); + + this.type = 'CubicBezierCurve3'; + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; + + } + + getPoint( t, optionalTarget = new Vector3() ) { + + const point = optionalTarget; + + const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; + + point.set( + CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), + CubicBezier( t, v0.y, v1.y, v2.y, v3.y ), + CubicBezier( t, v0.z, v1.z, v2.z, v3.z ) + ); + + return point; + + } + + copy( source ) { + + super.copy( source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + this.v3.copy( source.v3 ); + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + data.v3 = this.v3.toArray(); + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + this.v3.fromArray( json.v3 ); + + return this; + + } + +} + +CubicBezierCurve3.prototype.isCubicBezierCurve3 = true; + +class LineCurve extends Curve { + + constructor( v1 = new Vector2(), v2 = new Vector2() ) { + + super(); + + this.type = 'LineCurve'; + + this.v1 = v1; + this.v2 = v2; + + } + + getPoint( t, optionalTarget = new Vector2() ) { + + const point = optionalTarget; + + if ( t === 1 ) { + + point.copy( this.v2 ); + + } else { + + point.copy( this.v2 ).sub( this.v1 ); + point.multiplyScalar( t ).add( this.v1 ); + + } + + return point; + + } + + // Line curve is linear, so we can overwrite default getPointAt + getPointAt( u, optionalTarget ) { + + return this.getPoint( u, optionalTarget ); + + } + + getTangent( t, optionalTarget ) { + + const tangent = optionalTarget || new Vector2(); + + tangent.copy( this.v2 ).sub( this.v1 ).normalize(); + + return tangent; + + } + + copy( source ) { + + super.copy( source ); + + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + + return this; + + } + +} + +LineCurve.prototype.isLineCurve = true; + +class LineCurve3 extends Curve { + + constructor( v1 = new Vector3(), v2 = new Vector3() ) { + + super(); + + this.type = 'LineCurve3'; + this.isLineCurve3 = true; + + this.v1 = v1; + this.v2 = v2; + + } + getPoint( t, optionalTarget = new Vector3() ) { + + const point = optionalTarget; + + if ( t === 1 ) { + + point.copy( this.v2 ); + + } else { + + point.copy( this.v2 ).sub( this.v1 ); + point.multiplyScalar( t ).add( this.v1 ); + + } + + return point; + + } + // Line curve is linear, so we can overwrite default getPointAt + getPointAt( u, optionalTarget ) { + + return this.getPoint( u, optionalTarget ); + + } + copy( source ) { + + super.copy( source ); + + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + } + toJSON() { + + const data = super.toJSON(); + + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + + return data; + + } + fromJSON( json ) { + + super.fromJSON( json ); + + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + + return this; + + } + +} + +class QuadraticBezierCurve extends Curve { + + constructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2() ) { + + super(); + + this.type = 'QuadraticBezierCurve'; + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + + } + + getPoint( t, optionalTarget = new Vector2() ) { + + const point = optionalTarget; + + const v0 = this.v0, v1 = this.v1, v2 = this.v2; + + point.set( + QuadraticBezier( t, v0.x, v1.x, v2.x ), + QuadraticBezier( t, v0.y, v1.y, v2.y ) + ); + + return point; + + } + + copy( source ) { + + super.copy( source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + + return this; + + } + +} + +QuadraticBezierCurve.prototype.isQuadraticBezierCurve = true; + +class QuadraticBezierCurve3 extends Curve { + + constructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3() ) { + + super(); + + this.type = 'QuadraticBezierCurve3'; + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + + } + + getPoint( t, optionalTarget = new Vector3() ) { + + const point = optionalTarget; + + const v0 = this.v0, v1 = this.v1, v2 = this.v2; + + point.set( + QuadraticBezier( t, v0.x, v1.x, v2.x ), + QuadraticBezier( t, v0.y, v1.y, v2.y ), + QuadraticBezier( t, v0.z, v1.z, v2.z ) + ); + + return point; + + } + + copy( source ) { + + super.copy( source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + + return this; + + } + +} + +QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true; + +class SplineCurve extends Curve { + + constructor( points = [] ) { + + super(); + + this.type = 'SplineCurve'; + + this.points = points; + + } + + getPoint( t, optionalTarget = new Vector2() ) { + + const point = optionalTarget; + + const points = this.points; + const p = ( points.length - 1 ) * t; + + const intPoint = Math.floor( p ); + const weight = p - intPoint; + + const p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ]; + const p1 = points[ intPoint ]; + const p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; + const p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; + + point.set( + CatmullRom( weight, p0.x, p1.x, p2.x, p3.x ), + CatmullRom( weight, p0.y, p1.y, p2.y, p3.y ) + ); + + return point; + + } + + copy( source ) { + + super.copy( source ); + + this.points = []; + + for ( let i = 0, l = source.points.length; i < l; i ++ ) { + + const point = source.points[ i ]; + + this.points.push( point.clone() ); + + } + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.points = []; + + for ( let i = 0, l = this.points.length; i < l; i ++ ) { + + const point = this.points[ i ]; + data.points.push( point.toArray() ); + + } + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.points = []; + + for ( let i = 0, l = json.points.length; i < l; i ++ ) { + + const point = json.points[ i ]; + this.points.push( new Vector2().fromArray( point ) ); + + } + + return this; + + } + +} + +SplineCurve.prototype.isSplineCurve = true; + +var Curves = /*#__PURE__*/Object.freeze({ + __proto__: null, + ArcCurve: ArcCurve, + CatmullRomCurve3: CatmullRomCurve3, + CubicBezierCurve: CubicBezierCurve, + CubicBezierCurve3: CubicBezierCurve3, + EllipseCurve: EllipseCurve, + LineCurve: LineCurve, + LineCurve3: LineCurve3, + QuadraticBezierCurve: QuadraticBezierCurve, + QuadraticBezierCurve3: QuadraticBezierCurve3, + SplineCurve: SplineCurve +}); + +/************************************************************** + * Curved Path - a curve path is simply a array of connected + * curves, but retains the api of a curve + **************************************************************/ + +class CurvePath extends Curve { + + constructor() { + + super(); + + this.type = 'CurvePath'; + + this.curves = []; + this.autoClose = false; // Automatically closes the path + + } + + add( curve ) { + + this.curves.push( curve ); + + } + + closePath() { + + // Add a line curve if start and end of lines are not connected + const startPoint = this.curves[ 0 ].getPoint( 0 ); + const endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 ); + + if ( ! startPoint.equals( endPoint ) ) { + + this.curves.push( new LineCurve( endPoint, startPoint ) ); + + } + + } + + // To get accurate point with reference to + // entire path distance at time t, + // following has to be done: + + // 1. Length of each sub path have to be known + // 2. Locate and identify type of curve + // 3. Get t for the curve + // 4. Return curve.getPointAt(t') + + getPoint( t, optionalTarget ) { + + const d = t * this.getLength(); + const curveLengths = this.getCurveLengths(); + let i = 0; + + // To think about boundaries points. + + while ( i < curveLengths.length ) { + + if ( curveLengths[ i ] >= d ) { + + const diff = curveLengths[ i ] - d; + const curve = this.curves[ i ]; + + const segmentLength = curve.getLength(); + const u = segmentLength === 0 ? 0 : 1 - diff / segmentLength; + + return curve.getPointAt( u, optionalTarget ); + + } + + i ++; + + } + + return null; + + // loop where sum != 0, sum > d , sum+1 1 && ! points[ points.length - 1 ].equals( points[ 0 ] ) ) { + + points.push( points[ 0 ] ); + + } + + return points; + + } + + copy( source ) { + + super.copy( source ); + + this.curves = []; + + for ( let i = 0, l = source.curves.length; i < l; i ++ ) { + + const curve = source.curves[ i ]; + + this.curves.push( curve.clone() ); + + } + + this.autoClose = source.autoClose; + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.autoClose = this.autoClose; + data.curves = []; + + for ( let i = 0, l = this.curves.length; i < l; i ++ ) { + + const curve = this.curves[ i ]; + data.curves.push( curve.toJSON() ); + + } + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.autoClose = json.autoClose; + this.curves = []; + + for ( let i = 0, l = json.curves.length; i < l; i ++ ) { + + const curve = json.curves[ i ]; + this.curves.push( new Curves[ curve.type ]().fromJSON( curve ) ); + + } + + return this; + + } + +} + +class Path extends CurvePath { + + constructor( points ) { + + super(); + this.type = 'Path'; + + this.currentPoint = new Vector2(); + + if ( points ) { + + this.setFromPoints( points ); + + } + + } + + setFromPoints( points ) { + + this.moveTo( points[ 0 ].x, points[ 0 ].y ); + + for ( let i = 1, l = points.length; i < l; i ++ ) { + + this.lineTo( points[ i ].x, points[ i ].y ); + + } + + return this; + + } + + moveTo( x, y ) { + + this.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying? + + return this; + + } + + lineTo( x, y ) { + + const curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) ); + this.curves.push( curve ); + + this.currentPoint.set( x, y ); + + return this; + + } + + quadraticCurveTo( aCPx, aCPy, aX, aY ) { + + const curve = new QuadraticBezierCurve( + this.currentPoint.clone(), + new Vector2( aCPx, aCPy ), + new Vector2( aX, aY ) + ); + + this.curves.push( curve ); + + this.currentPoint.set( aX, aY ); + + return this; + + } + + bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { + + const curve = new CubicBezierCurve( + this.currentPoint.clone(), + new Vector2( aCP1x, aCP1y ), + new Vector2( aCP2x, aCP2y ), + new Vector2( aX, aY ) + ); + + this.curves.push( curve ); + + this.currentPoint.set( aX, aY ); + + return this; + + } + + splineThru( pts /*Array of Vector*/ ) { + + const npts = [ this.currentPoint.clone() ].concat( pts ); + + const curve = new SplineCurve( npts ); + this.curves.push( curve ); + + this.currentPoint.copy( pts[ pts.length - 1 ] ); + + return this; + + } + + arc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + + const x0 = this.currentPoint.x; + const y0 = this.currentPoint.y; + + this.absarc( aX + x0, aY + y0, aRadius, + aStartAngle, aEndAngle, aClockwise ); + + return this; + + } + + absarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + + this.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); + + return this; + + } + + ellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + + const x0 = this.currentPoint.x; + const y0 = this.currentPoint.y; + + this.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); + + return this; + + } + + absellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + + const curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); + + if ( this.curves.length > 0 ) { + + // if a previous curve is present, attempt to join + const firstPoint = curve.getPoint( 0 ); + + if ( ! firstPoint.equals( this.currentPoint ) ) { + + this.lineTo( firstPoint.x, firstPoint.y ); + + } + + } + + this.curves.push( curve ); + + const lastPoint = curve.getPoint( 1 ); + this.currentPoint.copy( lastPoint ); + + return this; + + } + + copy( source ) { + + super.copy( source ); + + this.currentPoint.copy( source.currentPoint ); + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.currentPoint = this.currentPoint.toArray(); + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.currentPoint.fromArray( json.currentPoint ); + + return this; + + } + +} + +class Shape extends Path { + + constructor( points ) { + + super( points ); + + this.uuid = generateUUID(); + + this.type = 'Shape'; + + this.holes = []; + + } + + getPointsHoles( divisions ) { + + const holesPts = []; + + for ( let i = 0, l = this.holes.length; i < l; i ++ ) { + + holesPts[ i ] = this.holes[ i ].getPoints( divisions ); + + } + + return holesPts; + + } + + // get points of shape and holes (keypoints based on segments parameter) + + extractPoints( divisions ) { + + return { + + shape: this.getPoints( divisions ), + holes: this.getPointsHoles( divisions ) + + }; + + } + + copy( source ) { + + super.copy( source ); + + this.holes = []; + + for ( let i = 0, l = source.holes.length; i < l; i ++ ) { + + const hole = source.holes[ i ]; + + this.holes.push( hole.clone() ); + + } + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.uuid = this.uuid; + data.holes = []; + + for ( let i = 0, l = this.holes.length; i < l; i ++ ) { + + const hole = this.holes[ i ]; + data.holes.push( hole.toJSON() ); + + } + + return data; + + } + + fromJSON( json ) { + + super.fromJSON( json ); + + this.uuid = json.uuid; + this.holes = []; + + for ( let i = 0, l = json.holes.length; i < l; i ++ ) { + + const hole = json.holes[ i ]; + this.holes.push( new Path().fromJSON( hole ) ); + + } + + return this; + + } + +} + +/** + * Port from https://github.com/mapbox/earcut (v2.2.2) + */ + +const Earcut = { + + triangulate: function ( data, holeIndices, dim = 2 ) { + + const hasHoles = holeIndices && holeIndices.length; + const outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length; + let outerNode = linkedList( data, 0, outerLen, dim, true ); + const triangles = []; + + if ( ! outerNode || outerNode.next === outerNode.prev ) return triangles; + + let minX, minY, maxX, maxY, x, y, invSize; + + if ( hasHoles ) outerNode = eliminateHoles( data, holeIndices, outerNode, dim ); + + // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox + if ( data.length > 80 * dim ) { + + minX = maxX = data[ 0 ]; + minY = maxY = data[ 1 ]; + + for ( let i = dim; i < outerLen; i += dim ) { + + x = data[ i ]; + y = data[ i + 1 ]; + if ( x < minX ) minX = x; + if ( y < minY ) minY = y; + if ( x > maxX ) maxX = x; + if ( y > maxY ) maxY = y; + + } + + // minX, minY and invSize are later used to transform coords into integers for z-order calculation + invSize = Math.max( maxX - minX, maxY - minY ); + invSize = invSize !== 0 ? 1 / invSize : 0; + + } + + earcutLinked( outerNode, triangles, dim, minX, minY, invSize ); + + return triangles; + + } + +}; + +// create a circular doubly linked list from polygon points in the specified winding order +function linkedList( data, start, end, dim, clockwise ) { + + let i, last; + + if ( clockwise === ( signedArea( data, start, end, dim ) > 0 ) ) { + + for ( i = start; i < end; i += dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last ); + + } else { + + for ( i = end - dim; i >= start; i -= dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last ); + + } + + if ( last && equals( last, last.next ) ) { + + removeNode( last ); + last = last.next; + + } + + return last; + +} + +// eliminate colinear or duplicate points +function filterPoints( start, end ) { + + if ( ! start ) return start; + if ( ! end ) end = start; + + let p = start, + again; + do { + + again = false; + + if ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) { + + removeNode( p ); + p = end = p.prev; + if ( p === p.next ) break; + again = true; + + } else { + + p = p.next; + + } + + } while ( again || p !== end ); + + return end; + +} + +// main ear slicing loop which triangulates a polygon (given as a linked list) +function earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) { + + if ( ! ear ) return; + + // interlink polygon nodes in z-order + if ( ! pass && invSize ) indexCurve( ear, minX, minY, invSize ); + + let stop = ear, + prev, next; + + // iterate through ears, slicing them one by one + while ( ear.prev !== ear.next ) { + + prev = ear.prev; + next = ear.next; + + if ( invSize ? isEarHashed( ear, minX, minY, invSize ) : isEar( ear ) ) { + + // cut off the triangle + triangles.push( prev.i / dim ); + triangles.push( ear.i / dim ); + triangles.push( next.i / dim ); + + removeNode( ear ); + + // skipping the next vertex leads to less sliver triangles + ear = next.next; + stop = next.next; + + continue; + + } + + ear = next; + + // if we looped through the whole remaining polygon and can't find any more ears + if ( ear === stop ) { + + // try filtering points and slicing again + if ( ! pass ) { + + earcutLinked( filterPoints( ear ), triangles, dim, minX, minY, invSize, 1 ); + + // if this didn't work, try curing all small self-intersections locally + + } else if ( pass === 1 ) { + + ear = cureLocalIntersections( filterPoints( ear ), triangles, dim ); + earcutLinked( ear, triangles, dim, minX, minY, invSize, 2 ); + + // as a last resort, try splitting the remaining polygon into two + + } else if ( pass === 2 ) { + + splitEarcut( ear, triangles, dim, minX, minY, invSize ); + + } + + break; + + } + + } + +} + +// check whether a polygon node forms a valid ear with adjacent nodes +function isEar( ear ) { + + const a = ear.prev, + b = ear, + c = ear.next; + + if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear + + // now make sure we don't have other points inside the potential ear + let p = ear.next.next; + + while ( p !== ear.prev ) { + + if ( pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) && + area( p.prev, p, p.next ) >= 0 ) return false; + p = p.next; + + } + + return true; + +} + +function isEarHashed( ear, minX, minY, invSize ) { + + const a = ear.prev, + b = ear, + c = ear.next; + + if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear + + // triangle bbox; min & max are calculated like this for speed + const minTX = a.x < b.x ? ( a.x < c.x ? a.x : c.x ) : ( b.x < c.x ? b.x : c.x ), + minTY = a.y < b.y ? ( a.y < c.y ? a.y : c.y ) : ( b.y < c.y ? b.y : c.y ), + maxTX = a.x > b.x ? ( a.x > c.x ? a.x : c.x ) : ( b.x > c.x ? b.x : c.x ), + maxTY = a.y > b.y ? ( a.y > c.y ? a.y : c.y ) : ( b.y > c.y ? b.y : c.y ); + + // z-order range for the current triangle bbox; + const minZ = zOrder( minTX, minTY, minX, minY, invSize ), + maxZ = zOrder( maxTX, maxTY, minX, minY, invSize ); + + let p = ear.prevZ, + n = ear.nextZ; + + // look for points inside the triangle in both directions + while ( p && p.z >= minZ && n && n.z <= maxZ ) { + + if ( p !== ear.prev && p !== ear.next && + pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) && + area( p.prev, p, p.next ) >= 0 ) return false; + p = p.prevZ; + + if ( n !== ear.prev && n !== ear.next && + pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) && + area( n.prev, n, n.next ) >= 0 ) return false; + n = n.nextZ; + + } + + // look for remaining points in decreasing z-order + while ( p && p.z >= minZ ) { + + if ( p !== ear.prev && p !== ear.next && + pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) && + area( p.prev, p, p.next ) >= 0 ) return false; + p = p.prevZ; + + } + + // look for remaining points in increasing z-order + while ( n && n.z <= maxZ ) { + + if ( n !== ear.prev && n !== ear.next && + pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) && + area( n.prev, n, n.next ) >= 0 ) return false; + n = n.nextZ; + + } + + return true; + +} + +// go through all polygon nodes and cure small local self-intersections +function cureLocalIntersections( start, triangles, dim ) { + + let p = start; + do { + + const a = p.prev, + b = p.next.next; + + if ( ! equals( a, b ) && intersects( a, p, p.next, b ) && locallyInside( a, b ) && locallyInside( b, a ) ) { + + triangles.push( a.i / dim ); + triangles.push( p.i / dim ); + triangles.push( b.i / dim ); + + // remove two nodes involved + removeNode( p ); + removeNode( p.next ); + + p = start = b; + + } + + p = p.next; + + } while ( p !== start ); + + return filterPoints( p ); + +} + +// try splitting polygon into two and triangulate them independently +function splitEarcut( start, triangles, dim, minX, minY, invSize ) { + + // look for a valid diagonal that divides the polygon into two + let a = start; + do { + + let b = a.next.next; + while ( b !== a.prev ) { + + if ( a.i !== b.i && isValidDiagonal( a, b ) ) { + + // split the polygon in two by the diagonal + let c = splitPolygon( a, b ); + + // filter colinear points around the cuts + a = filterPoints( a, a.next ); + c = filterPoints( c, c.next ); + + // run earcut on each half + earcutLinked( a, triangles, dim, minX, minY, invSize ); + earcutLinked( c, triangles, dim, minX, minY, invSize ); + return; + + } + + b = b.next; + + } + + a = a.next; + + } while ( a !== start ); + +} + +// link every hole into the outer loop, producing a single-ring polygon without holes +function eliminateHoles( data, holeIndices, outerNode, dim ) { + + const queue = []; + let i, len, start, end, list; + + for ( i = 0, len = holeIndices.length; i < len; i ++ ) { + + start = holeIndices[ i ] * dim; + end = i < len - 1 ? holeIndices[ i + 1 ] * dim : data.length; + list = linkedList( data, start, end, dim, false ); + if ( list === list.next ) list.steiner = true; + queue.push( getLeftmost( list ) ); + + } + + queue.sort( compareX ); + + // process holes from left to right + for ( i = 0; i < queue.length; i ++ ) { + + eliminateHole( queue[ i ], outerNode ); + outerNode = filterPoints( outerNode, outerNode.next ); + + } + + return outerNode; + +} + +function compareX( a, b ) { + + return a.x - b.x; + +} + +// find a bridge between vertices that connects hole with an outer ring and and link it +function eliminateHole( hole, outerNode ) { + + outerNode = findHoleBridge( hole, outerNode ); + if ( outerNode ) { + + const b = splitPolygon( outerNode, hole ); + + // filter collinear points around the cuts + filterPoints( outerNode, outerNode.next ); + filterPoints( b, b.next ); + + } + +} + +// David Eberly's algorithm for finding a bridge between hole and outer polygon +function findHoleBridge( hole, outerNode ) { + + let p = outerNode; + const hx = hole.x; + const hy = hole.y; + let qx = - Infinity, m; + + // find a segment intersected by a ray from the hole's leftmost point to the left; + // segment's endpoint with lesser x will be potential connection point + do { + + if ( hy <= p.y && hy >= p.next.y && p.next.y !== p.y ) { + + const x = p.x + ( hy - p.y ) * ( p.next.x - p.x ) / ( p.next.y - p.y ); + if ( x <= hx && x > qx ) { + + qx = x; + if ( x === hx ) { + + if ( hy === p.y ) return p; + if ( hy === p.next.y ) return p.next; + + } + + m = p.x < p.next.x ? p : p.next; + + } + + } + + p = p.next; + + } while ( p !== outerNode ); + + if ( ! m ) return null; + + if ( hx === qx ) return m; // hole touches outer segment; pick leftmost endpoint + + // look for points inside the triangle of hole point, segment intersection and endpoint; + // if there are no points found, we have a valid connection; + // otherwise choose the point of the minimum angle with the ray as connection point + + const stop = m, + mx = m.x, + my = m.y; + let tanMin = Infinity, tan; + + p = m; + + do { + + if ( hx >= p.x && p.x >= mx && hx !== p.x && + pointInTriangle( hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y ) ) { + + tan = Math.abs( hy - p.y ) / ( hx - p.x ); // tangential + + if ( locallyInside( p, hole ) && ( tan < tanMin || ( tan === tanMin && ( p.x > m.x || ( p.x === m.x && sectorContainsSector( m, p ) ) ) ) ) ) { + + m = p; + tanMin = tan; + + } + + } + + p = p.next; + + } while ( p !== stop ); + + return m; + +} + +// whether sector in vertex m contains sector in vertex p in the same coordinates +function sectorContainsSector( m, p ) { + + return area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0; + +} + +// interlink polygon nodes in z-order +function indexCurve( start, minX, minY, invSize ) { + + let p = start; + do { + + if ( p.z === null ) p.z = zOrder( p.x, p.y, minX, minY, invSize ); + p.prevZ = p.prev; + p.nextZ = p.next; + p = p.next; + + } while ( p !== start ); + + p.prevZ.nextZ = null; + p.prevZ = null; + + sortLinked( p ); + +} + +// Simon Tatham's linked list merge sort algorithm +// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html +function sortLinked( list ) { + + let i, p, q, e, tail, numMerges, pSize, qSize, + inSize = 1; + + do { + + p = list; + list = null; + tail = null; + numMerges = 0; + + while ( p ) { + + numMerges ++; + q = p; + pSize = 0; + for ( i = 0; i < inSize; i ++ ) { + + pSize ++; + q = q.nextZ; + if ( ! q ) break; + + } + + qSize = inSize; + + while ( pSize > 0 || ( qSize > 0 && q ) ) { + + if ( pSize !== 0 && ( qSize === 0 || ! q || p.z <= q.z ) ) { + + e = p; + p = p.nextZ; + pSize --; + + } else { + + e = q; + q = q.nextZ; + qSize --; + + } + + if ( tail ) tail.nextZ = e; + else list = e; + + e.prevZ = tail; + tail = e; + + } + + p = q; + + } + + tail.nextZ = null; + inSize *= 2; + + } while ( numMerges > 1 ); + + return list; + +} + +// z-order of a point given coords and inverse of the longer side of data bbox +function zOrder( x, y, minX, minY, invSize ) { + + // coords are transformed into non-negative 15-bit integer range + x = 32767 * ( x - minX ) * invSize; + y = 32767 * ( y - minY ) * invSize; + + x = ( x | ( x << 8 ) ) & 0x00FF00FF; + x = ( x | ( x << 4 ) ) & 0x0F0F0F0F; + x = ( x | ( x << 2 ) ) & 0x33333333; + x = ( x | ( x << 1 ) ) & 0x55555555; + + y = ( y | ( y << 8 ) ) & 0x00FF00FF; + y = ( y | ( y << 4 ) ) & 0x0F0F0F0F; + y = ( y | ( y << 2 ) ) & 0x33333333; + y = ( y | ( y << 1 ) ) & 0x55555555; + + return x | ( y << 1 ); + +} + +// find the leftmost node of a polygon ring +function getLeftmost( start ) { + + let p = start, + leftmost = start; + do { + + if ( p.x < leftmost.x || ( p.x === leftmost.x && p.y < leftmost.y ) ) leftmost = p; + p = p.next; + + } while ( p !== start ); + + return leftmost; + +} + +// check if a point lies within a convex triangle +function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) { + + return ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 && + ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 && + ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0; + +} + +// check if a diagonal between two polygon nodes is valid (lies in polygon interior) +function isValidDiagonal( a, b ) { + + return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // dones't intersect other edges + ( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible + ( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors + equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case + +} + +// signed area of a triangle +function area( p, q, r ) { + + return ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y ); + +} + +// check if two points are equal +function equals( p1, p2 ) { + + return p1.x === p2.x && p1.y === p2.y; + +} + +// check if two segments intersect +function intersects( p1, q1, p2, q2 ) { + + const o1 = sign( area( p1, q1, p2 ) ); + const o2 = sign( area( p1, q1, q2 ) ); + const o3 = sign( area( p2, q2, p1 ) ); + const o4 = sign( area( p2, q2, q1 ) ); + + if ( o1 !== o2 && o3 !== o4 ) return true; // general case + + if ( o1 === 0 && onSegment( p1, p2, q1 ) ) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1 + if ( o2 === 0 && onSegment( p1, q2, q1 ) ) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1 + if ( o3 === 0 && onSegment( p2, p1, q2 ) ) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2 + if ( o4 === 0 && onSegment( p2, q1, q2 ) ) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2 + + return false; + +} + +// for collinear points p, q, r, check if point q lies on segment pr +function onSegment( p, q, r ) { + + return q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y ); + +} + +function sign( num ) { + + return num > 0 ? 1 : num < 0 ? - 1 : 0; + +} + +// check if a polygon diagonal intersects any polygon segments +function intersectsPolygon( a, b ) { + + let p = a; + do { + + if ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && + intersects( p, p.next, a, b ) ) return true; + p = p.next; + + } while ( p !== a ); + + return false; + +} + +// check if a polygon diagonal is locally inside the polygon +function locallyInside( a, b ) { + + return area( a.prev, a, a.next ) < 0 ? + area( a, b, a.next ) >= 0 && area( a, a.prev, b ) >= 0 : + area( a, b, a.prev ) < 0 || area( a, a.next, b ) < 0; + +} + +// check if the middle point of a polygon diagonal is inside the polygon +function middleInside( a, b ) { + + let p = a, + inside = false; + const px = ( a.x + b.x ) / 2, + py = ( a.y + b.y ) / 2; + do { + + if ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y && + ( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) ) + inside = ! inside; + p = p.next; + + } while ( p !== a ); + + return inside; + +} + +// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; +// if one belongs to the outer ring and another to a hole, it merges it into a single ring +function splitPolygon( a, b ) { + + const a2 = new Node( a.i, a.x, a.y ), + b2 = new Node( b.i, b.x, b.y ), + an = a.next, + bp = b.prev; + + a.next = b; + b.prev = a; + + a2.next = an; + an.prev = a2; + + b2.next = a2; + a2.prev = b2; + + bp.next = b2; + b2.prev = bp; + + return b2; + +} + +// create a node and optionally link it with previous one (in a circular doubly linked list) +function insertNode( i, x, y, last ) { + + const p = new Node( i, x, y ); + + if ( ! last ) { + + p.prev = p; + p.next = p; + + } else { + + p.next = last.next; + p.prev = last; + last.next.prev = p; + last.next = p; + + } + + return p; + +} + +function removeNode( p ) { + + p.next.prev = p.prev; + p.prev.next = p.next; + + if ( p.prevZ ) p.prevZ.nextZ = p.nextZ; + if ( p.nextZ ) p.nextZ.prevZ = p.prevZ; + +} + +function Node( i, x, y ) { + + // vertex index in coordinates array + this.i = i; + + // vertex coordinates + this.x = x; + this.y = y; + + // previous and next vertex nodes in a polygon ring + this.prev = null; + this.next = null; + + // z-order curve value + this.z = null; + + // previous and next nodes in z-order + this.prevZ = null; + this.nextZ = null; + + // indicates whether this is a steiner point + this.steiner = false; + +} + +function signedArea( data, start, end, dim ) { + + let sum = 0; + for ( let i = start, j = end - dim; i < end; i += dim ) { + + sum += ( data[ j ] - data[ i ] ) * ( data[ i + 1 ] + data[ j + 1 ] ); + j = i; + + } + + return sum; + +} + +class ShapeUtils { + + // calculate area of the contour polygon + + static area( contour ) { + + const n = contour.length; + let a = 0.0; + + for ( let p = n - 1, q = 0; q < n; p = q ++ ) { + + a += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y; + + } + + return a * 0.5; + + } + + static isClockWise( pts ) { + + return ShapeUtils.area( pts ) < 0; + + } + + static triangulateShape( contour, holes ) { + + const vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ] + const holeIndices = []; // array of hole indices + const faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ] + + removeDupEndPts( contour ); + addContour( vertices, contour ); + + // + + let holeIndex = contour.length; + + holes.forEach( removeDupEndPts ); + + for ( let i = 0; i < holes.length; i ++ ) { + + holeIndices.push( holeIndex ); + holeIndex += holes[ i ].length; + addContour( vertices, holes[ i ] ); + + } + + // + + const triangles = Earcut.triangulate( vertices, holeIndices ); + + // + + for ( let i = 0; i < triangles.length; i += 3 ) { + + faces.push( triangles.slice( i, i + 3 ) ); + + } + + return faces; + + } + +} + +function removeDupEndPts( points ) { + + const l = points.length; + + if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) { + + points.pop(); + + } + +} + +function addContour( vertices, contour ) { + + for ( let i = 0; i < contour.length; i ++ ) { + + vertices.push( contour[ i ].x ); + vertices.push( contour[ i ].y ); + + } + +} + +/** + * Creates extruded geometry from a path shape. + * + * parameters = { + * + * curveSegments: , // number of points on the curves + * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too + * depth: , // Depth to extrude the shape + * + * bevelEnabled: , // turn on bevel + * bevelThickness: , // how deep into the original shape bevel goes + * bevelSize: , // how far from shape outline (including bevelOffset) is bevel + * bevelOffset: , // how far from shape outline does bevel start + * bevelSegments: , // number of bevel layers + * + * extrudePath: // curve to extrude shape along + * + * UVGenerator: // object that provides UV generator functions + * + * } + */ + +class ExtrudeGeometry extends BufferGeometry { + + constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) { + + super(); + + this.type = 'ExtrudeGeometry'; + + this.parameters = { + shapes: shapes, + options: options + }; + + shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; + + const scope = this; + + const verticesArray = []; + const uvArray = []; + + for ( let i = 0, l = shapes.length; i < l; i ++ ) { + + const shape = shapes[ i ]; + addShape( shape ); + + } + + // build geometry + + this.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) ); + + this.computeVertexNormals(); + + // functions + + function addShape( shape ) { + + const placeholder = []; + + // options + + const curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; + const steps = options.steps !== undefined ? options.steps : 1; + let depth = options.depth !== undefined ? options.depth : 1; + + let bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; + let bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2; + let bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1; + let bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0; + let bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; + + const extrudePath = options.extrudePath; + + const uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; + + // deprecated options + + if ( options.amount !== undefined ) { + + console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' ); + depth = options.amount; + + } + + // + + let extrudePts, extrudeByPath = false; + let splineTube, binormal, normal, position2; + + if ( extrudePath ) { + + extrudePts = extrudePath.getSpacedPoints( steps ); + + extrudeByPath = true; + bevelEnabled = false; // bevels not supported for path extrusion + + // SETUP TNB variables + + // TODO1 - have a .isClosed in spline? + + splineTube = extrudePath.computeFrenetFrames( steps, false ); + + // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); + + binormal = new Vector3(); + normal = new Vector3(); + position2 = new Vector3(); + + } + + // Safeguards if bevels are not enabled + + if ( ! bevelEnabled ) { + + bevelSegments = 0; + bevelThickness = 0; + bevelSize = 0; + bevelOffset = 0; + + } + + // Variables initialization + + const shapePoints = shape.extractPoints( curveSegments ); + + let vertices = shapePoints.shape; + const holes = shapePoints.holes; + + const reverse = ! ShapeUtils.isClockWise( vertices ); + + if ( reverse ) { + + vertices = vertices.reverse(); + + // Maybe we should also check if holes are in the opposite direction, just to be safe ... + + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + + const ahole = holes[ h ]; + + if ( ShapeUtils.isClockWise( ahole ) ) { + + holes[ h ] = ahole.reverse(); + + } + + } + + } + + + const faces = ShapeUtils.triangulateShape( vertices, holes ); + + /* Vertices */ + + const contour = vertices; // vertices has all points but contour has only points of circumference + + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + + const ahole = holes[ h ]; + + vertices = vertices.concat( ahole ); + + } + + + function scalePt2( pt, vec, size ) { + + if ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' ); + + return vec.clone().multiplyScalar( size ).add( pt ); + + } + + const vlen = vertices.length, flen = faces.length; + + + // Find directions for point movement + + + function getBevelVec( inPt, inPrev, inNext ) { + + // computes for inPt the corresponding point inPt' on a new contour + // shifted by 1 unit (length of normalized vector) to the left + // if we walk along contour clockwise, this new contour is outside the old one + // + // inPt' is the intersection of the two lines parallel to the two + // adjacent edges of inPt at a distance of 1 unit on the left side. + + let v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt + + // good reading for geometry algorithms (here: line-line intersection) + // http://geomalgorithms.com/a05-_intersect-1.html + + const v_prev_x = inPt.x - inPrev.x, + v_prev_y = inPt.y - inPrev.y; + const v_next_x = inNext.x - inPt.x, + v_next_y = inNext.y - inPt.y; + + const v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); + + // check for collinear edges + const collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + + if ( Math.abs( collinear0 ) > Number.EPSILON ) { + + // not collinear + + // length of vectors for normalizing + + const v_prev_len = Math.sqrt( v_prev_lensq ); + const v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); + + // shift adjacent points by unit vectors to the left + + const ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); + const ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); + + const ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); + const ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); + + // scaling factor for v_prev to intersection point + + const sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - + ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / + ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + + // vector from inPt to intersection point + + v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); + v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); + + // Don't normalize!, otherwise sharp corners become ugly + // but prevent crazy spikes + const v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); + if ( v_trans_lensq <= 2 ) { + + return new Vector2( v_trans_x, v_trans_y ); + + } else { + + shrink_by = Math.sqrt( v_trans_lensq / 2 ); + + } + + } else { + + // handle special case of collinear edges + + let direction_eq = false; // assumes: opposite + + if ( v_prev_x > Number.EPSILON ) { + + if ( v_next_x > Number.EPSILON ) { + + direction_eq = true; + + } + + } else { + + if ( v_prev_x < - Number.EPSILON ) { + + if ( v_next_x < - Number.EPSILON ) { + + direction_eq = true; + + } + + } else { + + if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { + + direction_eq = true; + + } + + } + + } + + if ( direction_eq ) { + + // console.log("Warning: lines are a straight sequence"); + v_trans_x = - v_prev_y; + v_trans_y = v_prev_x; + shrink_by = Math.sqrt( v_prev_lensq ); + + } else { + + // console.log("Warning: lines are a straight spike"); + v_trans_x = v_prev_x; + v_trans_y = v_prev_y; + shrink_by = Math.sqrt( v_prev_lensq / 2 ); + + } + + } + + return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); + + } + + + const contourMovements = []; + + for ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + + if ( j === il ) j = 0; + if ( k === il ) k = 0; + + // (j)---(i)---(k) + // console.log('i,j,k', i, j , k) + + contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); + + } + + const holesMovements = []; + let oneHoleMovements, verticesMovements = contourMovements.concat(); + + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + + const ahole = holes[ h ]; + + oneHoleMovements = []; + + for ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + + if ( j === il ) j = 0; + if ( k === il ) k = 0; + + // (j)---(i)---(k) + oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); + + } + + holesMovements.push( oneHoleMovements ); + verticesMovements = verticesMovements.concat( oneHoleMovements ); + + } + + + // Loop bevelSegments, 1 for the front, 1 for the back + + for ( let b = 0; b < bevelSegments; b ++ ) { + + //for ( b = bevelSegments; b > 0; b -- ) { + + const t = b / bevelSegments; + const z = bevelThickness * Math.cos( t * Math.PI / 2 ); + const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; + + // contract shape + + for ( let i = 0, il = contour.length; i < il; i ++ ) { + + const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + + v( vert.x, vert.y, - z ); + + } + + // expand holes + + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + + const ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; + + for ( let i = 0, il = ahole.length; i < il; i ++ ) { + + const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); + + v( vert.x, vert.y, - z ); + + } + + } + + } + + const bs = bevelSize + bevelOffset; + + // Back facing vertices + + for ( let i = 0; i < vlen; i ++ ) { + + const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + + if ( ! extrudeByPath ) { + + v( vert.x, vert.y, 0 ); + + } else { + + // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); + + normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y ); + + position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); + + v( position2.x, position2.y, position2.z ); + + } + + } + + // Add stepped vertices... + // Including front facing vertices + + for ( let s = 1; s <= steps; s ++ ) { + + for ( let i = 0; i < vlen; i ++ ) { + + const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + + if ( ! extrudeByPath ) { + + v( vert.x, vert.y, depth / steps * s ); + + } else { + + // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); + + normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y ); + + position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); + + v( position2.x, position2.y, position2.z ); + + } + + } + + } + + + // Add bevel segments planes + + //for ( b = 1; b <= bevelSegments; b ++ ) { + for ( let b = bevelSegments - 1; b >= 0; b -- ) { + + const t = b / bevelSegments; + const z = bevelThickness * Math.cos( t * Math.PI / 2 ); + const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; + + // contract shape + + for ( let i = 0, il = contour.length; i < il; i ++ ) { + + const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + v( vert.x, vert.y, depth + z ); + + } + + // expand holes + + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + + const ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; + + for ( let i = 0, il = ahole.length; i < il; i ++ ) { + + const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); + + if ( ! extrudeByPath ) { + + v( vert.x, vert.y, depth + z ); + + } else { + + v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); + + } + + } + + } + + } + + /* Faces */ + + // Top and bottom faces + + buildLidFaces(); + + // Sides faces + + buildSideFaces(); + + + ///// Internal functions + + function buildLidFaces() { + + const start = verticesArray.length / 3; + + if ( bevelEnabled ) { + + let layer = 0; // steps + 1 + let offset = vlen * layer; + + // Bottom faces + + for ( let i = 0; i < flen; i ++ ) { + + const face = faces[ i ]; + f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); + + } + + layer = steps + bevelSegments * 2; + offset = vlen * layer; + + // Top faces + + for ( let i = 0; i < flen; i ++ ) { + + const face = faces[ i ]; + f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); + + } + + } else { + + // Bottom faces + + for ( let i = 0; i < flen; i ++ ) { + + const face = faces[ i ]; + f3( face[ 2 ], face[ 1 ], face[ 0 ] ); + + } + + // Top faces + + for ( let i = 0; i < flen; i ++ ) { + + const face = faces[ i ]; + f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); + + } + + } + + scope.addGroup( start, verticesArray.length / 3 - start, 0 ); + + } + + // Create faces for the z-sides of the shape + + function buildSideFaces() { + + const start = verticesArray.length / 3; + let layeroffset = 0; + sidewalls( contour, layeroffset ); + layeroffset += contour.length; + + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + + const ahole = holes[ h ]; + sidewalls( ahole, layeroffset ); + + //, true + layeroffset += ahole.length; + + } + + + scope.addGroup( start, verticesArray.length / 3 - start, 1 ); + + + } + + function sidewalls( contour, layeroffset ) { + + let i = contour.length; + + while ( -- i >= 0 ) { + + const j = i; + let k = i - 1; + if ( k < 0 ) k = contour.length - 1; + + //console.log('b', i,j, i-1, k,vertices.length); + + for ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) { + + const slen1 = vlen * s; + const slen2 = vlen * ( s + 1 ); + + const a = layeroffset + j + slen1, + b = layeroffset + k + slen1, + c = layeroffset + k + slen2, + d = layeroffset + j + slen2; + + f4( a, b, c, d ); + + } + + } + + } + + function v( x, y, z ) { + + placeholder.push( x ); + placeholder.push( y ); + placeholder.push( z ); + + } + + + function f3( a, b, c ) { + + addVertex( a ); + addVertex( b ); + addVertex( c ); + + const nextIndex = verticesArray.length / 3; + const uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); + + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); + + } + + function f4( a, b, c, d ) { + + addVertex( a ); + addVertex( b ); + addVertex( d ); + + addVertex( b ); + addVertex( c ); + addVertex( d ); + + + const nextIndex = verticesArray.length / 3; + const uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); + + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 3 ] ); + + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); + addUV( uvs[ 3 ] ); + + } + + function addVertex( index ) { + + verticesArray.push( placeholder[ index * 3 + 0 ] ); + verticesArray.push( placeholder[ index * 3 + 1 ] ); + verticesArray.push( placeholder[ index * 3 + 2 ] ); + + } + + + function addUV( vector2 ) { + + uvArray.push( vector2.x ); + uvArray.push( vector2.y ); + + } + + } + + } + + toJSON() { + + const data = super.toJSON(); + + const shapes = this.parameters.shapes; + const options = this.parameters.options; + + return toJSON$1( shapes, options, data ); + + } + + static fromJSON( data, shapes ) { + + const geometryShapes = []; + + for ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) { + + const shape = shapes[ data.shapes[ j ] ]; + + geometryShapes.push( shape ); + + } + + const extrudePath = data.options.extrudePath; + + if ( extrudePath !== undefined ) { + + data.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath ); + + } + + return new ExtrudeGeometry( geometryShapes, data.options ); + + } + +} + +const WorldUVGenerator = { + + generateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) { + + const a_x = vertices[ indexA * 3 ]; + const a_y = vertices[ indexA * 3 + 1 ]; + const b_x = vertices[ indexB * 3 ]; + const b_y = vertices[ indexB * 3 + 1 ]; + const c_x = vertices[ indexC * 3 ]; + const c_y = vertices[ indexC * 3 + 1 ]; + + return [ + new Vector2( a_x, a_y ), + new Vector2( b_x, b_y ), + new Vector2( c_x, c_y ) + ]; + + }, + + generateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) { + + const a_x = vertices[ indexA * 3 ]; + const a_y = vertices[ indexA * 3 + 1 ]; + const a_z = vertices[ indexA * 3 + 2 ]; + const b_x = vertices[ indexB * 3 ]; + const b_y = vertices[ indexB * 3 + 1 ]; + const b_z = vertices[ indexB * 3 + 2 ]; + const c_x = vertices[ indexC * 3 ]; + const c_y = vertices[ indexC * 3 + 1 ]; + const c_z = vertices[ indexC * 3 + 2 ]; + const d_x = vertices[ indexD * 3 ]; + const d_y = vertices[ indexD * 3 + 1 ]; + const d_z = vertices[ indexD * 3 + 2 ]; + + if ( Math.abs( a_y - b_y ) < Math.abs( a_x - b_x ) ) { + + return [ + new Vector2( a_x, 1 - a_z ), + new Vector2( b_x, 1 - b_z ), + new Vector2( c_x, 1 - c_z ), + new Vector2( d_x, 1 - d_z ) + ]; + + } else { + + return [ + new Vector2( a_y, 1 - a_z ), + new Vector2( b_y, 1 - b_z ), + new Vector2( c_y, 1 - c_z ), + new Vector2( d_y, 1 - d_z ) + ]; + + } + + } + +}; + +function toJSON$1( shapes, options, data ) { + + data.shapes = []; + + if ( Array.isArray( shapes ) ) { + + for ( let i = 0, l = shapes.length; i < l; i ++ ) { + + const shape = shapes[ i ]; + + data.shapes.push( shape.uuid ); + + } + + } else { + + data.shapes.push( shapes.uuid ); + + } + + if ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON(); + + return data; + +} + +class IcosahedronGeometry extends PolyhedronGeometry { + + constructor( radius = 1, detail = 0 ) { + + const t = ( 1 + Math.sqrt( 5 ) ) / 2; + + const vertices = [ + - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, + 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, + t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 + ]; + + const indices = [ + 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, + 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, + 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, + 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 + ]; + + super( vertices, indices, radius, detail ); + + this.type = 'IcosahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + static fromJSON( data ) { + + return new IcosahedronGeometry( data.radius, data.detail ); + + } + +} + +class LatheGeometry extends BufferGeometry { + + constructor( points = [ new Vector2( 0, 0.5 ), new Vector2( 0.5, 0 ), new Vector2( 0, - 0.5 ) ], segments = 12, phiStart = 0, phiLength = Math.PI * 2 ) { + + super(); + + this.type = 'LatheGeometry'; + + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; + + segments = Math.floor( segments ); + + // clamp phiLength so it's in range of [ 0, 2PI ] + + phiLength = clamp( phiLength, 0, Math.PI * 2 ); + + // buffers + + const indices = []; + const vertices = []; + const uvs = []; + const initNormals = []; + const normals = []; + + // helper variables + + const inverseSegments = 1.0 / segments; + const vertex = new Vector3(); + const uv = new Vector2(); + const normal = new Vector3(); + const curNormal = new Vector3(); + const prevNormal = new Vector3(); + let dx = 0; + let dy = 0; + + // pre-compute normals for initial "meridian" + + for ( let j = 0; j <= ( points.length - 1 ); j ++ ) { + + switch ( j ) { + + case 0: // special handling for 1st vertex on path + + dx = points[ j + 1 ].x - points[ j ].x; + dy = points[ j + 1 ].y - points[ j ].y; + + normal.x = dy * 1.0; + normal.y = - dx; + normal.z = dy * 0.0; + + prevNormal.copy( normal ); + + normal.normalize(); + + initNormals.push( normal.x, normal.y, normal.z ); + + break; + + case ( points.length - 1 ): // special handling for last Vertex on path + + initNormals.push( prevNormal.x, prevNormal.y, prevNormal.z ); + + break; + + default: // default handling for all vertices in between + + dx = points[ j + 1 ].x - points[ j ].x; + dy = points[ j + 1 ].y - points[ j ].y; + + normal.x = dy * 1.0; + normal.y = - dx; + normal.z = dy * 0.0; + + curNormal.copy( normal ); + + normal.x += prevNormal.x; + normal.y += prevNormal.y; + normal.z += prevNormal.z; + + normal.normalize(); + + initNormals.push( normal.x, normal.y, normal.z ); + + prevNormal.copy( curNormal ); + + } + + } + + // generate vertices, uvs and normals + + for ( let i = 0; i <= segments; i ++ ) { + + const phi = phiStart + i * inverseSegments * phiLength; + + const sin = Math.sin( phi ); + const cos = Math.cos( phi ); + + for ( let j = 0; j <= ( points.length - 1 ); j ++ ) { + + // vertex + + vertex.x = points[ j ].x * sin; + vertex.y = points[ j ].y; + vertex.z = points[ j ].x * cos; + + vertices.push( vertex.x, vertex.y, vertex.z ); + + // uv + + uv.x = i / segments; + uv.y = j / ( points.length - 1 ); + + uvs.push( uv.x, uv.y ); + + // normal + + const x = initNormals[ 3 * j + 0 ] * sin; + const y = initNormals[ 3 * j + 1 ]; + const z = initNormals[ 3 * j + 0 ] * cos; + + normals.push( x, y, z ); + + } + + } + + // indices + + for ( let i = 0; i < segments; i ++ ) { + + for ( let j = 0; j < ( points.length - 1 ); j ++ ) { + + const base = j + i * points.length; + + const a = base; + const b = base + points.length; + const c = base + points.length + 1; + const d = base + 1; + + // faces + + indices.push( a, b, d ); + indices.push( c, d, b ); + + } + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + + } + + static fromJSON( data ) { + + return new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength ); + + } + +} + +class OctahedronGeometry extends PolyhedronGeometry { + + constructor( radius = 1, detail = 0 ) { + + const vertices = [ + 1, 0, 0, - 1, 0, 0, 0, 1, 0, + 0, - 1, 0, 0, 0, 1, 0, 0, - 1 + ]; + + const indices = [ + 0, 2, 4, 0, 4, 3, 0, 3, 5, + 0, 5, 2, 1, 2, 5, 1, 5, 3, + 1, 3, 4, 1, 4, 2 + ]; + + super( vertices, indices, radius, detail ); + + this.type = 'OctahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + static fromJSON( data ) { + + return new OctahedronGeometry( data.radius, data.detail ); + + } + +} + +class RingGeometry extends BufferGeometry { + + constructor( innerRadius = 0.5, outerRadius = 1, thetaSegments = 8, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2 ) { + + super(); + + this.type = 'RingGeometry'; + + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + thetaSegments = Math.max( 3, thetaSegments ); + phiSegments = Math.max( 1, phiSegments ); + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // some helper variables + + let radius = innerRadius; + const radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); + const vertex = new Vector3(); + const uv = new Vector2(); + + // generate vertices, normals and uvs + + for ( let j = 0; j <= phiSegments; j ++ ) { + + for ( let i = 0; i <= thetaSegments; i ++ ) { + + // values are generate from the inside of the ring to the outside + + const segment = thetaStart + i / thetaSegments * thetaLength; + + // vertex + + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); + + vertices.push( vertex.x, vertex.y, vertex.z ); + + // normal + + normals.push( 0, 0, 1 ); + + // uv + + uv.x = ( vertex.x / outerRadius + 1 ) / 2; + uv.y = ( vertex.y / outerRadius + 1 ) / 2; + + uvs.push( uv.x, uv.y ); + + } + + // increase the radius for next row of vertices + + radius += radiusStep; + + } + + // indices + + for ( let j = 0; j < phiSegments; j ++ ) { + + const thetaSegmentLevel = j * ( thetaSegments + 1 ); + + for ( let i = 0; i < thetaSegments; i ++ ) { + + const segment = i + thetaSegmentLevel; + + const a = segment; + const b = segment + thetaSegments + 1; + const c = segment + thetaSegments + 2; + const d = segment + 1; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + } + + static fromJSON( data ) { + + return new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength ); + + } + +} + +class ShapeGeometry extends BufferGeometry { + + constructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), curveSegments = 12 ) { + + super(); + this.type = 'ShapeGeometry'; + + this.parameters = { + shapes: shapes, + curveSegments: curveSegments + }; + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // helper variables + + let groupStart = 0; + let groupCount = 0; + + // allow single and array values for "shapes" parameter + + if ( Array.isArray( shapes ) === false ) { + + addShape( shapes ); + + } else { + + for ( let i = 0; i < shapes.length; i ++ ) { + + addShape( shapes[ i ] ); + + this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support + + groupStart += groupCount; + groupCount = 0; + + } + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + + // helper functions + + function addShape( shape ) { + + const indexOffset = vertices.length / 3; + const points = shape.extractPoints( curveSegments ); + + let shapeVertices = points.shape; + const shapeHoles = points.holes; + + // check direction of vertices + + if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { + + shapeVertices = shapeVertices.reverse(); + + } + + for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { + + const shapeHole = shapeHoles[ i ]; + + if ( ShapeUtils.isClockWise( shapeHole ) === true ) { + + shapeHoles[ i ] = shapeHole.reverse(); + + } + + } + + const faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); + + // join vertices of inner and outer paths to a single array + + for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { + + const shapeHole = shapeHoles[ i ]; + shapeVertices = shapeVertices.concat( shapeHole ); + + } + + // vertices, normals, uvs + + for ( let i = 0, l = shapeVertices.length; i < l; i ++ ) { + + const vertex = shapeVertices[ i ]; + + vertices.push( vertex.x, vertex.y, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( vertex.x, vertex.y ); // world uvs + + } + + // incides + + for ( let i = 0, l = faces.length; i < l; i ++ ) { + + const face = faces[ i ]; + + const a = face[ 0 ] + indexOffset; + const b = face[ 1 ] + indexOffset; + const c = face[ 2 ] + indexOffset; + + indices.push( a, b, c ); + groupCount += 3; + + } + + } + + } + + toJSON() { + + const data = super.toJSON(); + + const shapes = this.parameters.shapes; + + return toJSON( shapes, data ); + + } + + static fromJSON( data, shapes ) { + + const geometryShapes = []; + + for ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) { + + const shape = shapes[ data.shapes[ j ] ]; + + geometryShapes.push( shape ); + + } + + return new ShapeGeometry( geometryShapes, data.curveSegments ); + + } + +} + +function toJSON( shapes, data ) { + + data.shapes = []; + + if ( Array.isArray( shapes ) ) { + + for ( let i = 0, l = shapes.length; i < l; i ++ ) { + + const shape = shapes[ i ]; + + data.shapes.push( shape.uuid ); + + } + + } else { + + data.shapes.push( shapes.uuid ); + + } + + return data; + +} + +class SphereGeometry extends BufferGeometry { + + constructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) { + + super(); + this.type = 'SphereGeometry'; + + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + widthSegments = Math.max( 3, Math.floor( widthSegments ) ); + heightSegments = Math.max( 2, Math.floor( heightSegments ) ); + + const thetaEnd = Math.min( thetaStart + thetaLength, Math.PI ); + + let index = 0; + const grid = []; + + const vertex = new Vector3(); + const normal = new Vector3(); + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // generate vertices, normals and uvs + + for ( let iy = 0; iy <= heightSegments; iy ++ ) { + + const verticesRow = []; + + const v = iy / heightSegments; + + // special case for the poles + + let uOffset = 0; + + if ( iy == 0 && thetaStart == 0 ) { + + uOffset = 0.5 / widthSegments; + + } else if ( iy == heightSegments && thetaEnd == Math.PI ) { + + uOffset = - 0.5 / widthSegments; + + } + + for ( let ix = 0; ix <= widthSegments; ix ++ ) { + + const u = ix / widthSegments; + + // vertex + + vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); + vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + + vertices.push( vertex.x, vertex.y, vertex.z ); + + // normal + + normal.copy( vertex ).normalize(); + normals.push( normal.x, normal.y, normal.z ); + + // uv + + uvs.push( u + uOffset, 1 - v ); + + verticesRow.push( index ++ ); + + } + + grid.push( verticesRow ); + + } + + // indices + + for ( let iy = 0; iy < heightSegments; iy ++ ) { + + for ( let ix = 0; ix < widthSegments; ix ++ ) { + + const a = grid[ iy ][ ix + 1 ]; + const b = grid[ iy ][ ix ]; + const c = grid[ iy + 1 ][ ix ]; + const d = grid[ iy + 1 ][ ix + 1 ]; + + if ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d ); + if ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d ); + + } + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + } + + static fromJSON( data ) { + + return new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength ); + + } + +} + +class TetrahedronGeometry extends PolyhedronGeometry { + + constructor( radius = 1, detail = 0 ) { + + const vertices = [ + 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 + ]; + + const indices = [ + 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 + ]; + + super( vertices, indices, radius, detail ); + + this.type = 'TetrahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + static fromJSON( data ) { + + return new TetrahedronGeometry( data.radius, data.detail ); + + } + +} + +class TorusGeometry extends BufferGeometry { + + constructor( radius = 1, tube = 0.4, radialSegments = 8, tubularSegments = 6, arc = Math.PI * 2 ) { + + super(); + this.type = 'TorusGeometry'; + + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; + + radialSegments = Math.floor( radialSegments ); + tubularSegments = Math.floor( tubularSegments ); + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // helper variables + + const center = new Vector3(); + const vertex = new Vector3(); + const normal = new Vector3(); + + // generate vertices, normals and uvs + + for ( let j = 0; j <= radialSegments; j ++ ) { + + for ( let i = 0; i <= tubularSegments; i ++ ) { + + const u = i / tubularSegments * arc; + const v = j / radialSegments * Math.PI * 2; + + // vertex + + vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); + vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); + vertex.z = tube * Math.sin( v ); + + vertices.push( vertex.x, vertex.y, vertex.z ); + + // normal + + center.x = radius * Math.cos( u ); + center.y = radius * Math.sin( u ); + normal.subVectors( vertex, center ).normalize(); + + normals.push( normal.x, normal.y, normal.z ); + + // uv + + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); + + } + + } + + // generate indices + + for ( let j = 1; j <= radialSegments; j ++ ) { + + for ( let i = 1; i <= tubularSegments; i ++ ) { + + // indices + + const a = ( tubularSegments + 1 ) * j + i - 1; + const b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; + const c = ( tubularSegments + 1 ) * ( j - 1 ) + i; + const d = ( tubularSegments + 1 ) * j + i; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + } + + static fromJSON( data ) { + + return new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc ); + + } + +} + +class TorusKnotGeometry extends BufferGeometry { + + constructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) { + + super(); + this.type = 'TorusKnotGeometry'; + + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; + + tubularSegments = Math.floor( tubularSegments ); + radialSegments = Math.floor( radialSegments ); + + // buffers + + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + + // helper variables + + const vertex = new Vector3(); + const normal = new Vector3(); + + const P1 = new Vector3(); + const P2 = new Vector3(); + + const B = new Vector3(); + const T = new Vector3(); + const N = new Vector3(); + + // generate vertices, normals and uvs + + for ( let i = 0; i <= tubularSegments; ++ i ) { + + // the radian "u" is used to calculate the position on the torus curve of the current tubular segement + + const u = i / tubularSegments * p * Math.PI * 2; + + // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. + // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions + + calculatePositionOnCurve( u, p, q, radius, P1 ); + calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); + + // calculate orthonormal basis + + T.subVectors( P2, P1 ); + N.addVectors( P2, P1 ); + B.crossVectors( T, N ); + N.crossVectors( B, T ); + + // normalize B, N. T can be ignored, we don't use it + + B.normalize(); + N.normalize(); + + for ( let j = 0; j <= radialSegments; ++ j ) { + + // now calculate the vertices. they are nothing more than an extrusion of the torus curve. + // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. + + const v = j / radialSegments * Math.PI * 2; + const cx = - tube * Math.cos( v ); + const cy = tube * Math.sin( v ); + + // now calculate the final vertex position. + // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve + + vertex.x = P1.x + ( cx * N.x + cy * B.x ); + vertex.y = P1.y + ( cx * N.y + cy * B.y ); + vertex.z = P1.z + ( cx * N.z + cy * B.z ); + + vertices.push( vertex.x, vertex.y, vertex.z ); + + // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) + + normal.subVectors( vertex, P1 ).normalize(); + + normals.push( normal.x, normal.y, normal.z ); + + // uv + + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); + + } + + } + + // generate indices + + for ( let j = 1; j <= tubularSegments; j ++ ) { + + for ( let i = 1; i <= radialSegments; i ++ ) { + + // indices + + const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + const b = ( radialSegments + 1 ) * j + ( i - 1 ); + const c = ( radialSegments + 1 ) * j + i; + const d = ( radialSegments + 1 ) * ( j - 1 ) + i; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } + + } + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + // this function calculates the current position on the torus curve + + function calculatePositionOnCurve( u, p, q, radius, position ) { + + const cu = Math.cos( u ); + const su = Math.sin( u ); + const quOverP = q / p * u; + const cs = Math.cos( quOverP ); + + position.x = radius * ( 2 + cs ) * 0.5 * cu; + position.y = radius * ( 2 + cs ) * su * 0.5; + position.z = radius * Math.sin( quOverP ) * 0.5; + + } + + } + + static fromJSON( data ) { + + return new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q ); + + } + +} + +class TubeGeometry extends BufferGeometry { + + constructor( path = new QuadraticBezierCurve3( new Vector3( - 1, - 1, 0 ), new Vector3( - 1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) { + + super(); + this.type = 'TubeGeometry'; + + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; + + const frames = path.computeFrenetFrames( tubularSegments, closed ); + + // expose internals + + this.tangents = frames.tangents; + this.normals = frames.normals; + this.binormals = frames.binormals; + + // helper variables + + const vertex = new Vector3(); + const normal = new Vector3(); + const uv = new Vector2(); + let P = new Vector3(); + + // buffer + + const vertices = []; + const normals = []; + const uvs = []; + const indices = []; + + // create buffer data + + generateBufferData(); + + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + + // functions + + function generateBufferData() { + + for ( let i = 0; i < tubularSegments; i ++ ) { + + generateSegment( i ); + + } + + // if the geometry is not closed, generate the last row of vertices and normals + // at the regular position on the given path + // + // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) + + generateSegment( ( closed === false ) ? tubularSegments : 0 ); + + // uvs are generated in a separate function. + // this makes it easy compute correct values for closed geometries + + generateUVs(); + + // finally create faces + + generateIndices(); + + } + + function generateSegment( i ) { + + // we use getPointAt to sample evenly distributed points from the given path + + P = path.getPointAt( i / tubularSegments, P ); + + // retrieve corresponding normal and binormal + + const N = frames.normals[ i ]; + const B = frames.binormals[ i ]; + + // generate normals and vertices for the current segment + + for ( let j = 0; j <= radialSegments; j ++ ) { + + const v = j / radialSegments * Math.PI * 2; + + const sin = Math.sin( v ); + const cos = - Math.cos( v ); + + // normal + + normal.x = ( cos * N.x + sin * B.x ); + normal.y = ( cos * N.y + sin * B.y ); + normal.z = ( cos * N.z + sin * B.z ); + normal.normalize(); + + normals.push( normal.x, normal.y, normal.z ); + + // vertex + + vertex.x = P.x + radius * normal.x; + vertex.y = P.y + radius * normal.y; + vertex.z = P.z + radius * normal.z; + + vertices.push( vertex.x, vertex.y, vertex.z ); + + } + + } + + function generateIndices() { + + for ( let j = 1; j <= tubularSegments; j ++ ) { + + for ( let i = 1; i <= radialSegments; i ++ ) { + + const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + const b = ( radialSegments + 1 ) * j + ( i - 1 ); + const c = ( radialSegments + 1 ) * j + i; + const d = ( radialSegments + 1 ) * ( j - 1 ) + i; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } + + } + + } + + function generateUVs() { + + for ( let i = 0; i <= tubularSegments; i ++ ) { + + for ( let j = 0; j <= radialSegments; j ++ ) { + + uv.x = i / tubularSegments; + uv.y = j / radialSegments; + + uvs.push( uv.x, uv.y ); + + } + + } + + } + + } + + toJSON() { + + const data = super.toJSON(); + + data.path = this.parameters.path.toJSON(); + + return data; + + } + + static fromJSON( data ) { + + // This only works for built-in curves (e.g. CatmullRomCurve3). + // User defined curves or instances of CurvePath will not be deserialized. + return new TubeGeometry( + new Curves[ data.path.type ]().fromJSON( data.path ), + data.tubularSegments, + data.radius, + data.radialSegments, + data.closed + ); + + } + +} + +class WireframeGeometry extends BufferGeometry { + + constructor( geometry = null ) { + + super(); + this.type = 'WireframeGeometry'; + + this.parameters = { + geometry: geometry + }; + + if ( geometry !== null ) { + + // buffer + + const vertices = []; + const edges = new Set(); + + // helper variables + + const start = new Vector3(); + const end = new Vector3(); + + if ( geometry.index !== null ) { + + // indexed BufferGeometry + + const position = geometry.attributes.position; + const indices = geometry.index; + let groups = geometry.groups; + + if ( groups.length === 0 ) { + + groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; + + } + + // create a data structure that contains all eges without duplicates + + for ( let o = 0, ol = groups.length; o < ol; ++ o ) { + + const group = groups[ o ]; + + const groupStart = group.start; + const groupCount = group.count; + + for ( let i = groupStart, l = ( groupStart + groupCount ); i < l; i += 3 ) { + + for ( let j = 0; j < 3; j ++ ) { + + const index1 = indices.getX( i + j ); + const index2 = indices.getX( i + ( j + 1 ) % 3 ); + + start.fromBufferAttribute( position, index1 ); + end.fromBufferAttribute( position, index2 ); + + if ( isUniqueEdge( start, end, edges ) === true ) { + + vertices.push( start.x, start.y, start.z ); + vertices.push( end.x, end.y, end.z ); + + } + + } + + } + + } + + } else { + + // non-indexed BufferGeometry + + const position = geometry.attributes.position; + + for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) { + + for ( let j = 0; j < 3; j ++ ) { + + // three edges per triangle, an edge is represented as (index1, index2) + // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) + + const index1 = 3 * i + j; + const index2 = 3 * i + ( ( j + 1 ) % 3 ); + + start.fromBufferAttribute( position, index1 ); + end.fromBufferAttribute( position, index2 ); + + if ( isUniqueEdge( start, end, edges ) === true ) { + + vertices.push( start.x, start.y, start.z ); + vertices.push( end.x, end.y, end.z ); + + } + + } + + } + + } + + // build geometry + + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + + } + + } + +} + +function isUniqueEdge( start, end, edges ) { + + const hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`; + const hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge + + if ( edges.has( hash1 ) === true || edges.has( hash2 ) === true ) { + + return false; + + } else { + + edges.add( hash1, hash2 ); + return true; + + } + +} + +var Geometries = /*#__PURE__*/Object.freeze({ + __proto__: null, + BoxGeometry: BoxGeometry, + BoxBufferGeometry: BoxGeometry, + CircleGeometry: CircleGeometry, + CircleBufferGeometry: CircleGeometry, + ConeGeometry: ConeGeometry, + ConeBufferGeometry: ConeGeometry, + CylinderGeometry: CylinderGeometry, + CylinderBufferGeometry: CylinderGeometry, + DodecahedronGeometry: DodecahedronGeometry, + DodecahedronBufferGeometry: DodecahedronGeometry, + EdgesGeometry: EdgesGeometry, + ExtrudeGeometry: ExtrudeGeometry, + ExtrudeBufferGeometry: ExtrudeGeometry, + IcosahedronGeometry: IcosahedronGeometry, + IcosahedronBufferGeometry: IcosahedronGeometry, + LatheGeometry: LatheGeometry, + LatheBufferGeometry: LatheGeometry, + OctahedronGeometry: OctahedronGeometry, + OctahedronBufferGeometry: OctahedronGeometry, + PlaneGeometry: PlaneGeometry, + PlaneBufferGeometry: PlaneGeometry, + PolyhedronGeometry: PolyhedronGeometry, + PolyhedronBufferGeometry: PolyhedronGeometry, + RingGeometry: RingGeometry, + RingBufferGeometry: RingGeometry, + ShapeGeometry: ShapeGeometry, + ShapeBufferGeometry: ShapeGeometry, + SphereGeometry: SphereGeometry, + SphereBufferGeometry: SphereGeometry, + TetrahedronGeometry: TetrahedronGeometry, + TetrahedronBufferGeometry: TetrahedronGeometry, + TorusGeometry: TorusGeometry, + TorusBufferGeometry: TorusGeometry, + TorusKnotGeometry: TorusKnotGeometry, + TorusKnotBufferGeometry: TorusKnotGeometry, + TubeGeometry: TubeGeometry, + TubeBufferGeometry: TubeGeometry, + WireframeGeometry: WireframeGeometry +}); + +/** + * parameters = { + * color: + * } + */ + +class ShadowMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'ShadowMaterial'; + + this.color = new Color( 0x000000 ); + this.transparent = true; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + + return this; + + } + +} + +ShadowMaterial.prototype.isShadowMaterial = true; + +/** + * parameters = { + * color: , + * roughness: , + * metalness: , + * opacity: , + * + * map: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * emissive: , + * emissiveIntensity: + * emissiveMap: new THREE.Texture( ), + * + * bumpMap: new THREE.Texture( ), + * bumpScale: , + * + * normalMap: new THREE.Texture( ), + * normalMapType: THREE.TangentSpaceNormalMap, + * normalScale: , + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * roughnessMap: new THREE.Texture( ), + * + * metalnessMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), + * envMapIntensity: + * + * refractionRatio: , + * + * wireframe: , + * wireframeLinewidth: , + * + * flatShading: + * } + */ + +class MeshStandardMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.defines = { 'STANDARD': '' }; + + this.type = 'MeshStandardMaterial'; + + this.color = new Color( 0xffffff ); // diffuse + this.roughness = 1.0; + this.metalness = 0.0; + + this.map = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; + + this.bumpMap = null; + this.bumpScale = 1; + + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.roughnessMap = null; + + this.metalnessMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.envMapIntensity = 1.0; + + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.flatShading = false; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.defines = { 'STANDARD': '' }; + + this.color.copy( source.color ); + this.roughness = source.roughness; + this.metalness = source.metalness; + + this.map = source.map; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; + + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.roughnessMap = source.roughnessMap; + + this.metalnessMap = source.metalnessMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.envMapIntensity = source.envMapIntensity; + + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + this.flatShading = source.flatShading; + + return this; + + } + +} + +MeshStandardMaterial.prototype.isMeshStandardMaterial = true; + +/** + * parameters = { + * clearcoat: , + * clearcoatMap: new THREE.Texture( ), + * clearcoatRoughness: , + * clearcoatRoughnessMap: new THREE.Texture( ), + * clearcoatNormalScale: , + * clearcoatNormalMap: new THREE.Texture( ), + * + * ior: , + * reflectivity: , + * + * sheen: , + * sheenColor: , + * sheenColorMap: new THREE.Texture( ), + * sheenRoughness: , + * sheenRoughnessMap: new THREE.Texture( ), + * + * transmission: , + * transmissionMap: new THREE.Texture( ), + * + * thickness: , + * thicknessMap: new THREE.Texture( ), + * attenuationDistance: , + * attenuationColor: , + * + * specularIntensity: , + * specularIntensityMap: new THREE.Texture( ), + * specularColor: , + * specularColorMap: new THREE.Texture( ) + * } + */ + +class MeshPhysicalMaterial extends MeshStandardMaterial { + + constructor( parameters ) { + + super(); + + this.defines = { + + 'STANDARD': '', + 'PHYSICAL': '' + + }; + + this.type = 'MeshPhysicalMaterial'; + + this.clearcoatMap = null; + this.clearcoatRoughness = 0.0; + this.clearcoatRoughnessMap = null; + this.clearcoatNormalScale = new Vector2( 1, 1 ); + this.clearcoatNormalMap = null; + + this.ior = 1.5; + + Object.defineProperty( this, 'reflectivity', { + get: function () { + + return ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) ); + + }, + set: function ( reflectivity ) { + + this.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity ); + + } + } ); + + this.sheenColor = new Color( 0x000000 ); + this.sheenColorMap = null; + this.sheenRoughness = 1.0; + this.sheenRoughnessMap = null; + + this.transmissionMap = null; + + this.thickness = 0; + this.thicknessMap = null; + this.attenuationDistance = 0.0; + this.attenuationColor = new Color( 1, 1, 1 ); + + this.specularIntensity = 1.0; + this.specularIntensityMap = null; + this.specularColor = new Color( 1, 1, 1 ); + this.specularColorMap = null; + + this._sheen = 0.0; + this._clearcoat = 0; + this._transmission = 0; + + this.setValues( parameters ); + + } + + get sheen() { + + return this._sheen; + + } + + set sheen( value ) { + + if ( this._sheen > 0 !== value > 0 ) { + + this.version ++; + + } + + this._sheen = value; + + } + + get clearcoat() { + + return this._clearcoat; + + } + + set clearcoat( value ) { + + if ( this._clearcoat > 0 !== value > 0 ) { + + this.version ++; + + } + + this._clearcoat = value; + + } + + get transmission() { + + return this._transmission; + + } + + set transmission( value ) { + + if ( this._transmission > 0 !== value > 0 ) { + + this.version ++; + + } + + this._transmission = value; + + } + + copy( source ) { + + super.copy( source ); + + this.defines = { + + 'STANDARD': '', + 'PHYSICAL': '' + + }; + + this.clearcoat = source.clearcoat; + this.clearcoatMap = source.clearcoatMap; + this.clearcoatRoughness = source.clearcoatRoughness; + this.clearcoatRoughnessMap = source.clearcoatRoughnessMap; + this.clearcoatNormalMap = source.clearcoatNormalMap; + this.clearcoatNormalScale.copy( source.clearcoatNormalScale ); + + this.ior = source.ior; + + this.sheen = source.sheen; + this.sheenColor.copy( source.sheenColor ); + this.sheenColorMap = source.sheenColorMap; + this.sheenRoughness = source.sheenRoughness; + this.sheenRoughnessMap = source.sheenRoughnessMap; + + this.transmission = source.transmission; + this.transmissionMap = source.transmissionMap; + + this.thickness = source.thickness; + this.thicknessMap = source.thicknessMap; + this.attenuationDistance = source.attenuationDistance; + this.attenuationColor.copy( source.attenuationColor ); + + this.specularIntensity = source.specularIntensity; + this.specularIntensityMap = source.specularIntensityMap; + this.specularColor.copy( source.specularColor ); + this.specularColorMap = source.specularColorMap; + + return this; + + } + +} + +MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true; + +/** + * parameters = { + * color: , + * specular: , + * shininess: , + * opacity: , + * + * map: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * emissive: , + * emissiveIntensity: + * emissiveMap: new THREE.Texture( ), + * + * bumpMap: new THREE.Texture( ), + * bumpScale: , + * + * normalMap: new THREE.Texture( ), + * normalMapType: THREE.TangentSpaceNormalMap, + * normalScale: , + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * specularMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), + * combine: THREE.MultiplyOperation, + * reflectivity: , + * refractionRatio: , + * + * wireframe: , + * wireframeLinewidth: , + * + * flatShading: + * } + */ + +class MeshPhongMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'MeshPhongMaterial'; + + this.color = new Color( 0xffffff ); // diffuse + this.specular = new Color( 0x111111 ); + this.shininess = 30; + + this.map = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; + + this.bumpMap = null; + this.bumpScale = 1; + + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.specularMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.flatShading = false; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + this.specular.copy( source.specular ); + this.shininess = source.shininess; + + this.map = source.map; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; + + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.specularMap = source.specularMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + this.flatShading = source.flatShading; + + return this; + + } + +} + +MeshPhongMaterial.prototype.isMeshPhongMaterial = true; + +/** + * parameters = { + * color: , + * + * map: new THREE.Texture( ), + * gradientMap: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * emissive: , + * emissiveIntensity: + * emissiveMap: new THREE.Texture( ), + * + * bumpMap: new THREE.Texture( ), + * bumpScale: , + * + * normalMap: new THREE.Texture( ), + * normalMapType: THREE.TangentSpaceNormalMap, + * normalScale: , + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * alphaMap: new THREE.Texture( ), + * + * wireframe: , + * wireframeLinewidth: , + * + * } + */ + +class MeshToonMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.defines = { 'TOON': '' }; + + this.type = 'MeshToonMaterial'; + + this.color = new Color( 0xffffff ); + + this.map = null; + this.gradientMap = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; + + this.bumpMap = null; + this.bumpScale = 1; + + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.alphaMap = null; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + + this.map = source.map; + this.gradientMap = source.gradientMap; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; + + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.alphaMap = source.alphaMap; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + return this; + + } + +} + +MeshToonMaterial.prototype.isMeshToonMaterial = true; + +/** + * parameters = { + * opacity: , + * + * bumpMap: new THREE.Texture( ), + * bumpScale: , + * + * normalMap: new THREE.Texture( ), + * normalMapType: THREE.TangentSpaceNormalMap, + * normalScale: , + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * wireframe: , + * wireframeLinewidth: + * + * flatShading: + * } + */ + +class MeshNormalMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'MeshNormalMaterial'; + + this.bumpMap = null; + this.bumpScale = 1; + + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.wireframe = false; + this.wireframeLinewidth = 1; + + this.fog = false; + + this.flatShading = false; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; + + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + + this.flatShading = source.flatShading; + + return this; + + } + +} + +MeshNormalMaterial.prototype.isMeshNormalMaterial = true; + +/** + * parameters = { + * color: , + * opacity: , + * + * map: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * emissive: , + * emissiveIntensity: + * emissiveMap: new THREE.Texture( ), + * + * specularMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), + * combine: THREE.Multiply, + * reflectivity: , + * refractionRatio: , + * + * wireframe: , + * wireframeLinewidth: , + * + * } + */ + +class MeshLambertMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.type = 'MeshLambertMaterial'; + + this.color = new Color( 0xffffff ); // diffuse + + this.map = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; + + this.specularMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + + this.map = source.map; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + + this.specularMap = source.specularMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + return this; + + } + +} + +MeshLambertMaterial.prototype.isMeshLambertMaterial = true; + +/** + * parameters = { + * color: , + * opacity: , + * + * matcap: new THREE.Texture( ), + * + * map: new THREE.Texture( ), + * + * bumpMap: new THREE.Texture( ), + * bumpScale: , + * + * normalMap: new THREE.Texture( ), + * normalMapType: THREE.TangentSpaceNormalMap, + * normalScale: , + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * alphaMap: new THREE.Texture( ), + * + * flatShading: + * } + */ + +class MeshMatcapMaterial extends Material { + + constructor( parameters ) { + + super(); + + this.defines = { 'MATCAP': '' }; + + this.type = 'MeshMatcapMaterial'; + + this.color = new Color( 0xffffff ); // diffuse + + this.matcap = null; + + this.map = null; + + this.bumpMap = null; + this.bumpScale = 1; + + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.alphaMap = null; + + this.flatShading = false; + + this.setValues( parameters ); + + } + + + copy( source ) { + + super.copy( source ); + + this.defines = { 'MATCAP': '' }; + + this.color.copy( source.color ); + + this.matcap = source.matcap; + + this.map = source.map; + + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; + + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.alphaMap = source.alphaMap; + + this.flatShading = source.flatShading; + + return this; + + } + +} + +MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true; + +/** + * parameters = { + * color: , + * opacity: , + * + * linewidth: , + * + * scale: , + * dashSize: , + * gapSize: + * } + */ + +class LineDashedMaterial extends LineBasicMaterial { + + constructor( parameters ) { + + super(); + + this.type = 'LineDashedMaterial'; + + this.scale = 1; + this.dashSize = 3; + this.gapSize = 1; + + this.setValues( parameters ); + + } + + copy( source ) { + + super.copy( source ); + + this.scale = source.scale; + this.dashSize = source.dashSize; + this.gapSize = source.gapSize; + + return this; + + } + +} + +LineDashedMaterial.prototype.isLineDashedMaterial = true; + +var Materials = /*#__PURE__*/Object.freeze({ + __proto__: null, + ShadowMaterial: ShadowMaterial, + SpriteMaterial: SpriteMaterial, + RawShaderMaterial: RawShaderMaterial, + ShaderMaterial: ShaderMaterial, + PointsMaterial: PointsMaterial, + MeshPhysicalMaterial: MeshPhysicalMaterial, + MeshStandardMaterial: MeshStandardMaterial, + MeshPhongMaterial: MeshPhongMaterial, + MeshToonMaterial: MeshToonMaterial, + MeshNormalMaterial: MeshNormalMaterial, + MeshLambertMaterial: MeshLambertMaterial, + MeshDepthMaterial: MeshDepthMaterial, + MeshDistanceMaterial: MeshDistanceMaterial, + MeshBasicMaterial: MeshBasicMaterial, + MeshMatcapMaterial: MeshMatcapMaterial, + LineDashedMaterial: LineDashedMaterial, + LineBasicMaterial: LineBasicMaterial, + Material: Material +}); + +const AnimationUtils = { + + // same as Array.prototype.slice, but also works on typed arrays + arraySlice: function ( array, from, to ) { + + if ( AnimationUtils.isTypedArray( array ) ) { + + // in ios9 array.subarray(from, undefined) will return empty array + // but array.subarray(from) or array.subarray(from, len) is correct + return new array.constructor( array.subarray( from, to !== undefined ? to : array.length ) ); + + } + + return array.slice( from, to ); + + }, + + // converts an array to a specific type + convertArray: function ( array, type, forceClone ) { + + if ( ! array || // let 'undefined' and 'null' pass + ! forceClone && array.constructor === type ) return array; + + if ( typeof type.BYTES_PER_ELEMENT === 'number' ) { + + return new type( array ); // create typed array + + } + + return Array.prototype.slice.call( array ); // create Array + + }, + + isTypedArray: function ( object ) { + + return ArrayBuffer.isView( object ) && + ! ( object instanceof DataView ); + + }, + + // returns an array by which times and values can be sorted + getKeyframeOrder: function ( times ) { + + function compareTime( i, j ) { + + return times[ i ] - times[ j ]; + + } + + const n = times.length; + const result = new Array( n ); + for ( let i = 0; i !== n; ++ i ) result[ i ] = i; + + result.sort( compareTime ); + + return result; + + }, + + // uses the array previously returned by 'getKeyframeOrder' to sort data + sortedArray: function ( values, stride, order ) { + + const nValues = values.length; + const result = new values.constructor( nValues ); + + for ( let i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) { + + const srcOffset = order[ i ] * stride; + + for ( let j = 0; j !== stride; ++ j ) { + + result[ dstOffset ++ ] = values[ srcOffset + j ]; + + } + + } + + return result; + + }, + + // function for parsing AOS keyframe formats + flattenJSON: function ( jsonKeys, times, values, valuePropertyName ) { + + let i = 1, key = jsonKeys[ 0 ]; + + while ( key !== undefined && key[ valuePropertyName ] === undefined ) { + + key = jsonKeys[ i ++ ]; + + } + + if ( key === undefined ) return; // no data + + let value = key[ valuePropertyName ]; + if ( value === undefined ) return; // no data + + if ( Array.isArray( value ) ) { + + do { + + value = key[ valuePropertyName ]; + + if ( value !== undefined ) { + + times.push( key.time ); + values.push.apply( values, value ); // push all elements + + } + + key = jsonKeys[ i ++ ]; + + } while ( key !== undefined ); + + } else if ( value.toArray !== undefined ) { + + // ...assume THREE.Math-ish + + do { + + value = key[ valuePropertyName ]; + + if ( value !== undefined ) { + + times.push( key.time ); + value.toArray( values, values.length ); + + } + + key = jsonKeys[ i ++ ]; + + } while ( key !== undefined ); + + } else { + + // otherwise push as-is + + do { + + value = key[ valuePropertyName ]; + + if ( value !== undefined ) { + + times.push( key.time ); + values.push( value ); + + } + + key = jsonKeys[ i ++ ]; + + } while ( key !== undefined ); + + } + + }, + + subclip: function ( sourceClip, name, startFrame, endFrame, fps = 30 ) { + + const clip = sourceClip.clone(); + + clip.name = name; + + const tracks = []; + + for ( let i = 0; i < clip.tracks.length; ++ i ) { + + const track = clip.tracks[ i ]; + const valueSize = track.getValueSize(); + + const times = []; + const values = []; + + for ( let j = 0; j < track.times.length; ++ j ) { + + const frame = track.times[ j ] * fps; + + if ( frame < startFrame || frame >= endFrame ) continue; + + times.push( track.times[ j ] ); + + for ( let k = 0; k < valueSize; ++ k ) { + + values.push( track.values[ j * valueSize + k ] ); + + } + + } + + if ( times.length === 0 ) continue; + + track.times = AnimationUtils.convertArray( times, track.times.constructor ); + track.values = AnimationUtils.convertArray( values, track.values.constructor ); + + tracks.push( track ); + + } + + clip.tracks = tracks; + + // find minimum .times value across all tracks in the trimmed clip + + let minStartTime = Infinity; + + for ( let i = 0; i < clip.tracks.length; ++ i ) { + + if ( minStartTime > clip.tracks[ i ].times[ 0 ] ) { + + minStartTime = clip.tracks[ i ].times[ 0 ]; + + } + + } + + // shift all tracks such that clip begins at t=0 + + for ( let i = 0; i < clip.tracks.length; ++ i ) { + + clip.tracks[ i ].shift( - 1 * minStartTime ); + + } + + clip.resetDuration(); + + return clip; + + }, + + makeClipAdditive: function ( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) { + + if ( fps <= 0 ) fps = 30; + + const numTracks = referenceClip.tracks.length; + const referenceTime = referenceFrame / fps; + + // Make each track's values relative to the values at the reference frame + for ( let i = 0; i < numTracks; ++ i ) { + + const referenceTrack = referenceClip.tracks[ i ]; + const referenceTrackType = referenceTrack.ValueTypeName; + + // Skip this track if it's non-numeric + if ( referenceTrackType === 'bool' || referenceTrackType === 'string' ) continue; + + // Find the track in the target clip whose name and type matches the reference track + const targetTrack = targetClip.tracks.find( function ( track ) { + + return track.name === referenceTrack.name + && track.ValueTypeName === referenceTrackType; + + } ); + + if ( targetTrack === undefined ) continue; + + let referenceOffset = 0; + const referenceValueSize = referenceTrack.getValueSize(); + + if ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { + + referenceOffset = referenceValueSize / 3; + + } + + let targetOffset = 0; + const targetValueSize = targetTrack.getValueSize(); + + if ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { + + targetOffset = targetValueSize / 3; + + } + + const lastIndex = referenceTrack.times.length - 1; + let referenceValue; + + // Find the value to subtract out of the track + if ( referenceTime <= referenceTrack.times[ 0 ] ) { + + // Reference frame is earlier than the first keyframe, so just use the first keyframe + const startIndex = referenceOffset; + const endIndex = referenceValueSize - referenceOffset; + referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex, endIndex ); + + } else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) { + + // Reference frame is after the last keyframe, so just use the last keyframe + const startIndex = lastIndex * referenceValueSize + referenceOffset; + const endIndex = startIndex + referenceValueSize - referenceOffset; + referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex, endIndex ); + + } else { + + // Interpolate to the reference value + const interpolant = referenceTrack.createInterpolant(); + const startIndex = referenceOffset; + const endIndex = referenceValueSize - referenceOffset; + interpolant.evaluate( referenceTime ); + referenceValue = AnimationUtils.arraySlice( interpolant.resultBuffer, startIndex, endIndex ); + + } + + // Conjugate the quaternion + if ( referenceTrackType === 'quaternion' ) { + + const referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate(); + referenceQuat.toArray( referenceValue ); + + } + + // Subtract the reference value from all of the track values + + const numTimes = targetTrack.times.length; + for ( let j = 0; j < numTimes; ++ j ) { + + const valueStart = j * targetValueSize + targetOffset; + + if ( referenceTrackType === 'quaternion' ) { + + // Multiply the conjugate for quaternion track types + Quaternion.multiplyQuaternionsFlat( + targetTrack.values, + valueStart, + referenceValue, + 0, + targetTrack.values, + valueStart + ); + + } else { + + const valueEnd = targetValueSize - targetOffset * 2; + + // Subtract each value for all other numeric track types + for ( let k = 0; k < valueEnd; ++ k ) { + + targetTrack.values[ valueStart + k ] -= referenceValue[ k ]; + + } + + } + + } + + } + + targetClip.blendMode = AdditiveAnimationBlendMode; + + return targetClip; + + } + +}; + +/** + * Abstract base class of interpolants over parametric samples. + * + * The parameter domain is one dimensional, typically the time or a path + * along a curve defined by the data. + * + * The sample values can have any dimensionality and derived classes may + * apply special interpretations to the data. + * + * This class provides the interval seek in a Template Method, deferring + * the actual interpolation to derived classes. + * + * Time complexity is O(1) for linear access crossing at most two points + * and O(log N) for random access, where N is the number of positions. + * + * References: + * + * http://www.oodesign.com/template-method-pattern.html + * + */ + +class Interpolant { + + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + this.parameterPositions = parameterPositions; + this._cachedIndex = 0; + + this.resultBuffer = resultBuffer !== undefined ? + resultBuffer : new sampleValues.constructor( sampleSize ); + this.sampleValues = sampleValues; + this.valueSize = sampleSize; + + this.settings = null; + this.DefaultSettings_ = {}; + + } + + evaluate( t ) { + + const pp = this.parameterPositions; + let i1 = this._cachedIndex, + t1 = pp[ i1 ], + t0 = pp[ i1 - 1 ]; + + validate_interval: { + + seek: { + + let right; + + linear_scan: { + + //- See http://jsperf.com/comparison-to-undefined/3 + //- slower code: + //- + //- if ( t >= t1 || t1 === undefined ) { + forward_scan: if ( ! ( t < t1 ) ) { + + for ( let giveUpAt = i1 + 2; ; ) { + + if ( t1 === undefined ) { + + if ( t < t0 ) break forward_scan; + + // after end + + i1 = pp.length; + this._cachedIndex = i1; + return this.afterEnd_( i1 - 1, t, t0 ); + + } + + if ( i1 === giveUpAt ) break; // this loop + + t0 = t1; + t1 = pp[ ++ i1 ]; + + if ( t < t1 ) { + + // we have arrived at the sought interval + break seek; + + } + + } + + // prepare binary search on the right side of the index + right = pp.length; + break linear_scan; + + } + + //- slower code: + //- if ( t < t0 || t0 === undefined ) { + if ( ! ( t >= t0 ) ) { + + // looping? + + const t1global = pp[ 1 ]; + + if ( t < t1global ) { + + i1 = 2; // + 1, using the scan for the details + t0 = t1global; + + } + + // linear reverse scan + + for ( let giveUpAt = i1 - 2; ; ) { + + if ( t0 === undefined ) { + + // before start + + this._cachedIndex = 0; + return this.beforeStart_( 0, t, t1 ); + + } + + if ( i1 === giveUpAt ) break; // this loop + + t1 = t0; + t0 = pp[ -- i1 - 1 ]; + + if ( t >= t0 ) { + + // we have arrived at the sought interval + break seek; + + } + + } + + // prepare binary search on the left side of the index + right = i1; + i1 = 0; + break linear_scan; + + } + + // the interval is valid + + break validate_interval; + + } // linear scan + + // binary search + + while ( i1 < right ) { + + const mid = ( i1 + right ) >>> 1; + + if ( t < pp[ mid ] ) { + + right = mid; + + } else { + + i1 = mid + 1; + + } + + } + + t1 = pp[ i1 ]; + t0 = pp[ i1 - 1 ]; + + // check boundary cases, again + + if ( t0 === undefined ) { + + this._cachedIndex = 0; + return this.beforeStart_( 0, t, t1 ); + + } + + if ( t1 === undefined ) { + + i1 = pp.length; + this._cachedIndex = i1; + return this.afterEnd_( i1 - 1, t0, t ); + + } + + } // seek + + this._cachedIndex = i1; + + this.intervalChanged_( i1, t0, t1 ); + + } // validate_interval + + return this.interpolate_( i1, t0, t, t1 ); + + } + + getSettings_() { + + return this.settings || this.DefaultSettings_; + + } + + copySampleValue_( index ) { + + // copies a sample value to the result buffer + + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + offset = index * stride; + + for ( let i = 0; i !== stride; ++ i ) { + + result[ i ] = values[ offset + i ]; + + } + + return result; + + } + + // Template methods for derived classes: + + interpolate_( /* i1, t0, t, t1 */ ) { + + throw new Error( 'call to abstract method' ); + // implementations shall return this.resultBuffer + + } + + intervalChanged_( /* i1, t0, t1 */ ) { + + // empty + + } + +} + +// ALIAS DEFINITIONS + +Interpolant.prototype.beforeStart_ = Interpolant.prototype.copySampleValue_; +Interpolant.prototype.afterEnd_ = Interpolant.prototype.copySampleValue_; + +/** + * Fast and simple cubic spline interpolant. + * + * It was derived from a Hermitian construction setting the first derivative + * at each sample position to the linear slope between neighboring positions + * over their parameter interval. + */ + +class CubicInterpolant extends Interpolant { + + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); + + this._weightPrev = - 0; + this._offsetPrev = - 0; + this._weightNext = - 0; + this._offsetNext = - 0; + + this.DefaultSettings_ = { + + endingStart: ZeroCurvatureEnding, + endingEnd: ZeroCurvatureEnding + + }; + + } + + intervalChanged_( i1, t0, t1 ) { + + const pp = this.parameterPositions; + let iPrev = i1 - 2, + iNext = i1 + 1, + + tPrev = pp[ iPrev ], + tNext = pp[ iNext ]; + + if ( tPrev === undefined ) { + + switch ( this.getSettings_().endingStart ) { + + case ZeroSlopeEnding: + + // f'(t0) = 0 + iPrev = i1; + tPrev = 2 * t0 - t1; + + break; + + case WrapAroundEnding: + + // use the other end of the curve + iPrev = pp.length - 2; + tPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ]; + + break; + + default: // ZeroCurvatureEnding + + // f''(t0) = 0 a.k.a. Natural Spline + iPrev = i1; + tPrev = t1; + + } + + } + + if ( tNext === undefined ) { + + switch ( this.getSettings_().endingEnd ) { + + case ZeroSlopeEnding: + + // f'(tN) = 0 + iNext = i1; + tNext = 2 * t1 - t0; + + break; + + case WrapAroundEnding: + + // use the other end of the curve + iNext = 1; + tNext = t1 + pp[ 1 ] - pp[ 0 ]; + + break; + + default: // ZeroCurvatureEnding + + // f''(tN) = 0, a.k.a. Natural Spline + iNext = i1 - 1; + tNext = t0; + + } + + } + + const halfDt = ( t1 - t0 ) * 0.5, + stride = this.valueSize; + + this._weightPrev = halfDt / ( t0 - tPrev ); + this._weightNext = halfDt / ( tNext - t1 ); + this._offsetPrev = iPrev * stride; + this._offsetNext = iNext * stride; + + } + + interpolate_( i1, t0, t, t1 ) { + + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + + o1 = i1 * stride, o0 = o1 - stride, + oP = this._offsetPrev, oN = this._offsetNext, + wP = this._weightPrev, wN = this._weightNext, + + p = ( t - t0 ) / ( t1 - t0 ), + pp = p * p, + ppp = pp * p; + + // evaluate polynomials + + const sP = - wP * ppp + 2 * wP * pp - wP * p; + const s0 = ( 1 + wP ) * ppp + ( - 1.5 - 2 * wP ) * pp + ( - 0.5 + wP ) * p + 1; + const s1 = ( - 1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p; + const sN = wN * ppp - wN * pp; + + // combine data linearly + + for ( let i = 0; i !== stride; ++ i ) { + + result[ i ] = + sP * values[ oP + i ] + + s0 * values[ o0 + i ] + + s1 * values[ o1 + i ] + + sN * values[ oN + i ]; + + } + + return result; + + } + +} + +class LinearInterpolant extends Interpolant { + + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + interpolate_( i1, t0, t, t1 ) { + + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + + offset1 = i1 * stride, + offset0 = offset1 - stride, + + weight1 = ( t - t0 ) / ( t1 - t0 ), + weight0 = 1 - weight1; + + for ( let i = 0; i !== stride; ++ i ) { + + result[ i ] = + values[ offset0 + i ] * weight0 + + values[ offset1 + i ] * weight1; + + } + + return result; + + } + +} + +/** + * + * Interpolant that evaluates to the sample value at the position preceeding + * the parameter. + */ + +class DiscreteInterpolant extends Interpolant { + + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + interpolate_( i1 /*, t0, t, t1 */ ) { + + return this.copySampleValue_( i1 - 1 ); + + } + +} + +class KeyframeTrack { + + constructor( name, times, values, interpolation ) { + + if ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' ); + if ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name ); + + this.name = name; + + this.times = AnimationUtils.convertArray( times, this.TimeBufferType ); + this.values = AnimationUtils.convertArray( values, this.ValueBufferType ); + + this.setInterpolation( interpolation || this.DefaultInterpolation ); + + } + + // Serialization (in static context, because of constructor invocation + // and automatic invocation of .toJSON): + + static toJSON( track ) { + + const trackType = track.constructor; + + let json; + + // derived classes can define a static toJSON method + if ( trackType.toJSON !== this.toJSON ) { + + json = trackType.toJSON( track ); + + } else { + + // by default, we assume the data can be serialized as-is + json = { + + 'name': track.name, + 'times': AnimationUtils.convertArray( track.times, Array ), + 'values': AnimationUtils.convertArray( track.values, Array ) + + }; + + const interpolation = track.getInterpolation(); + + if ( interpolation !== track.DefaultInterpolation ) { + + json.interpolation = interpolation; + + } + + } + + json.type = track.ValueTypeName; // mandatory + + return json; + + } + + InterpolantFactoryMethodDiscrete( result ) { + + return new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result ); + + } + + InterpolantFactoryMethodLinear( result ) { + + return new LinearInterpolant( this.times, this.values, this.getValueSize(), result ); + + } + + InterpolantFactoryMethodSmooth( result ) { + + return new CubicInterpolant( this.times, this.values, this.getValueSize(), result ); + + } + + setInterpolation( interpolation ) { + + let factoryMethod; + + switch ( interpolation ) { + + case InterpolateDiscrete: + + factoryMethod = this.InterpolantFactoryMethodDiscrete; + + break; + + case InterpolateLinear: + + factoryMethod = this.InterpolantFactoryMethodLinear; + + break; + + case InterpolateSmooth: + + factoryMethod = this.InterpolantFactoryMethodSmooth; + + break; + + } + + if ( factoryMethod === undefined ) { + + const message = 'unsupported interpolation for ' + + this.ValueTypeName + ' keyframe track named ' + this.name; + + if ( this.createInterpolant === undefined ) { + + // fall back to default, unless the default itself is messed up + if ( interpolation !== this.DefaultInterpolation ) { + + this.setInterpolation( this.DefaultInterpolation ); + + } else { + + throw new Error( message ); // fatal, in this case + + } + + } + + console.warn( 'THREE.KeyframeTrack:', message ); + return this; + + } + + this.createInterpolant = factoryMethod; + + return this; + + } + + getInterpolation() { + + switch ( this.createInterpolant ) { + + case this.InterpolantFactoryMethodDiscrete: + + return InterpolateDiscrete; + + case this.InterpolantFactoryMethodLinear: + + return InterpolateLinear; + + case this.InterpolantFactoryMethodSmooth: + + return InterpolateSmooth; + + } + + } + + getValueSize() { + + return this.values.length / this.times.length; + + } + + // move all keyframes either forwards or backwards in time + shift( timeOffset ) { + + if ( timeOffset !== 0.0 ) { + + const times = this.times; + + for ( let i = 0, n = times.length; i !== n; ++ i ) { + + times[ i ] += timeOffset; + + } + + } + + return this; + + } + + // scale all keyframe times by a factor (useful for frame <-> seconds conversions) + scale( timeScale ) { + + if ( timeScale !== 1.0 ) { + + const times = this.times; + + for ( let i = 0, n = times.length; i !== n; ++ i ) { + + times[ i ] *= timeScale; + + } + + } + + return this; + + } + + // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. + // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values + trim( startTime, endTime ) { + + const times = this.times, + nKeys = times.length; + + let from = 0, + to = nKeys - 1; + + while ( from !== nKeys && times[ from ] < startTime ) { + + ++ from; + + } + + while ( to !== - 1 && times[ to ] > endTime ) { + + -- to; + + } + + ++ to; // inclusive -> exclusive bound + + if ( from !== 0 || to !== nKeys ) { + + // empty tracks are forbidden, so keep at least one keyframe + if ( from >= to ) { + + to = Math.max( to, 1 ); + from = to - 1; + + } + + const stride = this.getValueSize(); + this.times = AnimationUtils.arraySlice( times, from, to ); + this.values = AnimationUtils.arraySlice( this.values, from * stride, to * stride ); + + } + + return this; + + } + + // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable + validate() { + + let valid = true; + + const valueSize = this.getValueSize(); + if ( valueSize - Math.floor( valueSize ) !== 0 ) { + + console.error( 'THREE.KeyframeTrack: Invalid value size in track.', this ); + valid = false; + + } + + const times = this.times, + values = this.values, + + nKeys = times.length; + + if ( nKeys === 0 ) { + + console.error( 'THREE.KeyframeTrack: Track is empty.', this ); + valid = false; + + } + + let prevTime = null; + + for ( let i = 0; i !== nKeys; i ++ ) { + + const currTime = times[ i ]; + + if ( typeof currTime === 'number' && isNaN( currTime ) ) { + + console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime ); + valid = false; + break; + + } + + if ( prevTime !== null && prevTime > currTime ) { + + console.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime ); + valid = false; + break; + + } + + prevTime = currTime; + + } + + if ( values !== undefined ) { + + if ( AnimationUtils.isTypedArray( values ) ) { + + for ( let i = 0, n = values.length; i !== n; ++ i ) { + + const value = values[ i ]; + + if ( isNaN( value ) ) { + + console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value ); + valid = false; + break; + + } + + } + + } + + } + + return valid; + + } + + // removes equivalent sequential keys as common in morph target sequences + // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) + optimize() { + + // times or values may be shared with other tracks, so overwriting is unsafe + const times = AnimationUtils.arraySlice( this.times ), + values = AnimationUtils.arraySlice( this.values ), + stride = this.getValueSize(), + + smoothInterpolation = this.getInterpolation() === InterpolateSmooth, + + lastIndex = times.length - 1; + + let writeIndex = 1; + + for ( let i = 1; i < lastIndex; ++ i ) { + + let keep = false; + + const time = times[ i ]; + const timeNext = times[ i + 1 ]; + + // remove adjacent keyframes scheduled at the same time + + if ( time !== timeNext && ( i !== 1 || time !== times[ 0 ] ) ) { + + if ( ! smoothInterpolation ) { + + // remove unnecessary keyframes same as their neighbors + + const offset = i * stride, + offsetP = offset - stride, + offsetN = offset + stride; + + for ( let j = 0; j !== stride; ++ j ) { + + const value = values[ offset + j ]; + + if ( value !== values[ offsetP + j ] || + value !== values[ offsetN + j ] ) { + + keep = true; + break; + + } + + } + + } else { + + keep = true; + + } + + } + + // in-place compaction + + if ( keep ) { + + if ( i !== writeIndex ) { + + times[ writeIndex ] = times[ i ]; + + const readOffset = i * stride, + writeOffset = writeIndex * stride; + + for ( let j = 0; j !== stride; ++ j ) { + + values[ writeOffset + j ] = values[ readOffset + j ]; + + } + + } + + ++ writeIndex; + + } + + } + + // flush last keyframe (compaction looks ahead) + + if ( lastIndex > 0 ) { + + times[ writeIndex ] = times[ lastIndex ]; + + for ( let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) { + + values[ writeOffset + j ] = values[ readOffset + j ]; + + } + + ++ writeIndex; + + } + + if ( writeIndex !== times.length ) { + + this.times = AnimationUtils.arraySlice( times, 0, writeIndex ); + this.values = AnimationUtils.arraySlice( values, 0, writeIndex * stride ); + + } else { + + this.times = times; + this.values = values; + + } + + return this; + + } + + clone() { + + const times = AnimationUtils.arraySlice( this.times, 0 ); + const values = AnimationUtils.arraySlice( this.values, 0 ); + + const TypedKeyframeTrack = this.constructor; + const track = new TypedKeyframeTrack( this.name, times, values ); + + // Interpolant argument to constructor is not saved, so copy the factory method directly. + track.createInterpolant = this.createInterpolant; + + return track; + + } + +} + +KeyframeTrack.prototype.TimeBufferType = Float32Array; +KeyframeTrack.prototype.ValueBufferType = Float32Array; +KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; + +/** + * A Track of Boolean keyframe values. + */ +class BooleanKeyframeTrack extends KeyframeTrack {} + +BooleanKeyframeTrack.prototype.ValueTypeName = 'bool'; +BooleanKeyframeTrack.prototype.ValueBufferType = Array; +BooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; +BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined; +BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; + +/** + * A Track of keyframe values that represent color. + */ +class ColorKeyframeTrack extends KeyframeTrack {} + +ColorKeyframeTrack.prototype.ValueTypeName = 'color'; + +/** + * A Track of numeric keyframe values. + */ +class NumberKeyframeTrack extends KeyframeTrack {} + +NumberKeyframeTrack.prototype.ValueTypeName = 'number'; + +/** + * Spherical linear unit quaternion interpolant. + */ + +class QuaternionLinearInterpolant extends Interpolant { + + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + interpolate_( i1, t0, t, t1 ) { + + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + + alpha = ( t - t0 ) / ( t1 - t0 ); + + let offset = i1 * stride; + + for ( let end = offset + stride; offset !== end; offset += 4 ) { + + Quaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha ); + + } + + return result; + + } + +} + +/** + * A Track of quaternion keyframe values. + */ +class QuaternionKeyframeTrack extends KeyframeTrack { + + InterpolantFactoryMethodLinear( result ) { + + return new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result ); + + } + +} + +QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion'; +// ValueBufferType is inherited +QuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; +QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; + +/** + * A Track that interpolates Strings + */ +class StringKeyframeTrack extends KeyframeTrack {} + +StringKeyframeTrack.prototype.ValueTypeName = 'string'; +StringKeyframeTrack.prototype.ValueBufferType = Array; +StringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; +StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined; +StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; + +/** + * A Track of vectored keyframe values. + */ +class VectorKeyframeTrack extends KeyframeTrack {} + +VectorKeyframeTrack.prototype.ValueTypeName = 'vector'; + +class AnimationClip { + + constructor( name, duration = - 1, tracks, blendMode = NormalAnimationBlendMode ) { + + this.name = name; + this.tracks = tracks; + this.duration = duration; + this.blendMode = blendMode; + + this.uuid = generateUUID(); + + // this means it should figure out its duration by scanning the tracks + if ( this.duration < 0 ) { + + this.resetDuration(); + + } + + } + + + static parse( json ) { + + const tracks = [], + jsonTracks = json.tracks, + frameTime = 1.0 / ( json.fps || 1.0 ); + + for ( let i = 0, n = jsonTracks.length; i !== n; ++ i ) { + + tracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) ); + + } + + const clip = new this( json.name, json.duration, tracks, json.blendMode ); + clip.uuid = json.uuid; + + return clip; + + } + + static toJSON( clip ) { + + const tracks = [], + clipTracks = clip.tracks; + + const json = { + + 'name': clip.name, + 'duration': clip.duration, + 'tracks': tracks, + 'uuid': clip.uuid, + 'blendMode': clip.blendMode + + }; + + for ( let i = 0, n = clipTracks.length; i !== n; ++ i ) { + + tracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) ); + + } + + return json; + + } + + static CreateFromMorphTargetSequence( name, morphTargetSequence, fps, noLoop ) { + + const numMorphTargets = morphTargetSequence.length; + const tracks = []; + + for ( let i = 0; i < numMorphTargets; i ++ ) { + + let times = []; + let values = []; + + times.push( + ( i + numMorphTargets - 1 ) % numMorphTargets, + i, + ( i + 1 ) % numMorphTargets ); + + values.push( 0, 1, 0 ); + + const order = AnimationUtils.getKeyframeOrder( times ); + times = AnimationUtils.sortedArray( times, 1, order ); + values = AnimationUtils.sortedArray( values, 1, order ); + + // if there is a key at the first frame, duplicate it as the + // last frame as well for perfect loop. + if ( ! noLoop && times[ 0 ] === 0 ) { + + times.push( numMorphTargets ); + values.push( values[ 0 ] ); + + } + + tracks.push( + new NumberKeyframeTrack( + '.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']', + times, values + ).scale( 1.0 / fps ) ); + + } + + return new this( name, - 1, tracks ); + + } + + static findByName( objectOrClipArray, name ) { + + let clipArray = objectOrClipArray; + + if ( ! Array.isArray( objectOrClipArray ) ) { + + const o = objectOrClipArray; + clipArray = o.geometry && o.geometry.animations || o.animations; + + } + + for ( let i = 0; i < clipArray.length; i ++ ) { + + if ( clipArray[ i ].name === name ) { + + return clipArray[ i ]; + + } + + } + + return null; + + } + + static CreateClipsFromMorphTargetSequences( morphTargets, fps, noLoop ) { + + const animationToMorphTargets = {}; + + // tested with https://regex101.com/ on trick sequences + // such flamingo_flyA_003, flamingo_run1_003, crdeath0059 + const pattern = /^([\w-]*?)([\d]+)$/; + + // sort morph target names into animation groups based + // patterns like Walk_001, Walk_002, Run_001, Run_002 + for ( let i = 0, il = morphTargets.length; i < il; i ++ ) { + + const morphTarget = morphTargets[ i ]; + const parts = morphTarget.name.match( pattern ); + + if ( parts && parts.length > 1 ) { + + const name = parts[ 1 ]; + + let animationMorphTargets = animationToMorphTargets[ name ]; + + if ( ! animationMorphTargets ) { + + animationToMorphTargets[ name ] = animationMorphTargets = []; + + } + + animationMorphTargets.push( morphTarget ); + + } + + } + + const clips = []; + + for ( const name in animationToMorphTargets ) { + + clips.push( this.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) ); + + } + + return clips; + + } + + // parse the animation.hierarchy format + static parseAnimation( animation, bones ) { + + if ( ! animation ) { + + console.error( 'THREE.AnimationClip: No animation in JSONLoader data.' ); + return null; + + } + + const addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) { + + // only return track if there are actually keys. + if ( animationKeys.length !== 0 ) { + + const times = []; + const values = []; + + AnimationUtils.flattenJSON( animationKeys, times, values, propertyName ); + + // empty keys are filtered out, so check again + if ( times.length !== 0 ) { + + destTracks.push( new trackType( trackName, times, values ) ); + + } + + } + + }; + + const tracks = []; + + const clipName = animation.name || 'default'; + const fps = animation.fps || 30; + const blendMode = animation.blendMode; + + // automatic length determination in AnimationClip. + let duration = animation.length || - 1; + + const hierarchyTracks = animation.hierarchy || []; + + for ( let h = 0; h < hierarchyTracks.length; h ++ ) { + + const animationKeys = hierarchyTracks[ h ].keys; + + // skip empty tracks + if ( ! animationKeys || animationKeys.length === 0 ) continue; + + // process morph targets + if ( animationKeys[ 0 ].morphTargets ) { + + // figure out all morph targets used in this track + const morphTargetNames = {}; + + let k; + + for ( k = 0; k < animationKeys.length; k ++ ) { + + if ( animationKeys[ k ].morphTargets ) { + + for ( let m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) { + + morphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1; + + } + + } + + } + + // create a track for each morph target with all zero + // morphTargetInfluences except for the keys in which + // the morphTarget is named. + for ( const morphTargetName in morphTargetNames ) { + + const times = []; + const values = []; + + for ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) { + + const animationKey = animationKeys[ k ]; + + times.push( animationKey.time ); + values.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 ); + + } + + tracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) ); + + } + + duration = morphTargetNames.length * ( fps || 1.0 ); + + } else { + + // ...assume skeletal animation + + const boneName = '.bones[' + bones[ h ].name + ']'; + + addNonemptyTrack( + VectorKeyframeTrack, boneName + '.position', + animationKeys, 'pos', tracks ); + + addNonemptyTrack( + QuaternionKeyframeTrack, boneName + '.quaternion', + animationKeys, 'rot', tracks ); + + addNonemptyTrack( + VectorKeyframeTrack, boneName + '.scale', + animationKeys, 'scl', tracks ); + + } + + } + + if ( tracks.length === 0 ) { + + return null; + + } + + const clip = new this( clipName, duration, tracks, blendMode ); + + return clip; + + } + + resetDuration() { + + const tracks = this.tracks; + let duration = 0; + + for ( let i = 0, n = tracks.length; i !== n; ++ i ) { + + const track = this.tracks[ i ]; + + duration = Math.max( duration, track.times[ track.times.length - 1 ] ); + + } + + this.duration = duration; + + return this; + + } + + trim() { + + for ( let i = 0; i < this.tracks.length; i ++ ) { + + this.tracks[ i ].trim( 0, this.duration ); + + } + + return this; + + } + + validate() { + + let valid = true; + + for ( let i = 0; i < this.tracks.length; i ++ ) { + + valid = valid && this.tracks[ i ].validate(); + + } + + return valid; + + } + + optimize() { + + for ( let i = 0; i < this.tracks.length; i ++ ) { + + this.tracks[ i ].optimize(); + + } + + return this; + + } + + clone() { + + const tracks = []; + + for ( let i = 0; i < this.tracks.length; i ++ ) { + + tracks.push( this.tracks[ i ].clone() ); + + } + + return new this.constructor( this.name, this.duration, tracks, this.blendMode ); + + } + + toJSON() { + + return this.constructor.toJSON( this ); + + } + +} + +function getTrackTypeForValueTypeName( typeName ) { + + switch ( typeName.toLowerCase() ) { + + case 'scalar': + case 'double': + case 'float': + case 'number': + case 'integer': + + return NumberKeyframeTrack; + + case 'vector': + case 'vector2': + case 'vector3': + case 'vector4': + + return VectorKeyframeTrack; + + case 'color': + + return ColorKeyframeTrack; + + case 'quaternion': + + return QuaternionKeyframeTrack; + + case 'bool': + case 'boolean': + + return BooleanKeyframeTrack; + + case 'string': + + return StringKeyframeTrack; + + } + + throw new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName ); + +} + +function parseKeyframeTrack( json ) { + + if ( json.type === undefined ) { + + throw new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' ); + + } + + const trackType = getTrackTypeForValueTypeName( json.type ); + + if ( json.times === undefined ) { + + const times = [], values = []; + + AnimationUtils.flattenJSON( json.keys, times, values, 'value' ); + + json.times = times; + json.values = values; + + } + + // derived classes can define a static parse method + if ( trackType.parse !== undefined ) { + + return trackType.parse( json ); + + } else { + + // by default, we assume a constructor compatible with the base + return new trackType( json.name, json.times, json.values, json.interpolation ); + + } + +} + +const Cache = { + + enabled: false, + + files: {}, + + add: function ( key, file ) { + + if ( this.enabled === false ) return; + + // console.log( 'THREE.Cache', 'Adding key:', key ); + + this.files[ key ] = file; + + }, + + get: function ( key ) { + + if ( this.enabled === false ) return; + + // console.log( 'THREE.Cache', 'Checking key:', key ); + + return this.files[ key ]; + + }, + + remove: function ( key ) { + + delete this.files[ key ]; + + }, + + clear: function () { + + this.files = {}; + + } + +}; + +class LoadingManager { + + constructor( onLoad, onProgress, onError ) { + + const scope = this; + + let isLoading = false; + let itemsLoaded = 0; + let itemsTotal = 0; + let urlModifier = undefined; + const handlers = []; + + // Refer to #5689 for the reason why we don't set .onStart + // in the constructor + + this.onStart = undefined; + this.onLoad = onLoad; + this.onProgress = onProgress; + this.onError = onError; + + this.itemStart = function ( url ) { + + itemsTotal ++; + + if ( isLoading === false ) { + + if ( scope.onStart !== undefined ) { + + scope.onStart( url, itemsLoaded, itemsTotal ); + + } + + } + + isLoading = true; + + }; + + this.itemEnd = function ( url ) { + + itemsLoaded ++; + + if ( scope.onProgress !== undefined ) { + + scope.onProgress( url, itemsLoaded, itemsTotal ); + + } + + if ( itemsLoaded === itemsTotal ) { + + isLoading = false; + + if ( scope.onLoad !== undefined ) { + + scope.onLoad(); + + } + + } + + }; + + this.itemError = function ( url ) { + + if ( scope.onError !== undefined ) { + + scope.onError( url ); + + } + + }; + + this.resolveURL = function ( url ) { + + if ( urlModifier ) { + + return urlModifier( url ); + + } + + return url; + + }; + + this.setURLModifier = function ( transform ) { + + urlModifier = transform; + + return this; + + }; + + this.addHandler = function ( regex, loader ) { + + handlers.push( regex, loader ); + + return this; + + }; + + this.removeHandler = function ( regex ) { + + const index = handlers.indexOf( regex ); + + if ( index !== - 1 ) { + + handlers.splice( index, 2 ); + + } + + return this; + + }; + + this.getHandler = function ( file ) { + + for ( let i = 0, l = handlers.length; i < l; i += 2 ) { + + const regex = handlers[ i ]; + const loader = handlers[ i + 1 ]; + + if ( regex.global ) regex.lastIndex = 0; // see #17920 + + if ( regex.test( file ) ) { + + return loader; + + } + + } + + return null; + + }; + + } + +} + +const DefaultLoadingManager = new LoadingManager(); + +class Loader { + + constructor( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + this.crossOrigin = 'anonymous'; + this.withCredentials = false; + this.path = ''; + this.resourcePath = ''; + this.requestHeader = {}; + + } + + load( /* url, onLoad, onProgress, onError */ ) {} + + loadAsync( url, onProgress ) { + + const scope = this; + + return new Promise( function ( resolve, reject ) { + + scope.load( url, resolve, onProgress, reject ); + + } ); + + } + + parse( /* data */ ) {} + + setCrossOrigin( crossOrigin ) { + + this.crossOrigin = crossOrigin; + return this; + + } + + setWithCredentials( value ) { + + this.withCredentials = value; + return this; + + } + + setPath( path ) { + + this.path = path; + return this; + + } + + setResourcePath( resourcePath ) { + + this.resourcePath = resourcePath; + return this; + + } + + setRequestHeader( requestHeader ) { + + this.requestHeader = requestHeader; + return this; + + } + +} + +const loading = {}; + +class FileLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + if ( url === undefined ) url = ''; + + if ( this.path !== undefined ) url = this.path + url; + + url = this.manager.resolveURL( url ); + + const cached = Cache.get( url ); + + if ( cached !== undefined ) { + + this.manager.itemStart( url ); + + setTimeout( () => { + + if ( onLoad ) onLoad( cached ); + + this.manager.itemEnd( url ); + + }, 0 ); + + return cached; + + } + + // Check if request is duplicate + + if ( loading[ url ] !== undefined ) { + + loading[ url ].push( { + + onLoad: onLoad, + onProgress: onProgress, + onError: onError + + } ); + + return; + + } + + // Initialise array for duplicate requests + loading[ url ] = []; + + loading[ url ].push( { + onLoad: onLoad, + onProgress: onProgress, + onError: onError, + } ); + + // create request + const req = new Request( url, { + headers: new Headers( this.requestHeader ), + credentials: this.withCredentials ? 'include' : 'same-origin', + // An abort controller could be added within a future PR + } ); + + // record states ( avoid data race ) + const mimeType = this.mimeType; + const responseType = this.responseType; + + // start the fetch + fetch( req ) + .then( response => { + + if ( response.status === 200 || response.status === 0 ) { + + // Some browsers return HTTP Status 0 when using non-http protocol + // e.g. 'file://' or 'data://'. Handle as success. + + if ( response.status === 0 ) { + + console.warn( 'THREE.FileLoader: HTTP Status 0 received.' ); + + } + + if ( typeof ReadableStream === 'undefined' || response.body.getReader === undefined ) { + + return response; + + } + + const callbacks = loading[ url ]; + const reader = response.body.getReader(); + const contentLength = response.headers.get( 'Content-Length' ); + const total = contentLength ? parseInt( contentLength ) : 0; + const lengthComputable = total !== 0; + let loaded = 0; + + // periodically read data into the new stream tracking while download progress + const stream = new ReadableStream( { + start( controller ) { + + readData(); + + function readData() { + + reader.read().then( ( { done, value } ) => { + + if ( done ) { + + controller.close(); + + } else { + + loaded += value.byteLength; + + const event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } ); + for ( let i = 0, il = callbacks.length; i < il; i ++ ) { + + const callback = callbacks[ i ]; + if ( callback.onProgress ) callback.onProgress( event ); + + } + + controller.enqueue( value ); + readData(); + + } + + } ); + + } + + } + + } ); + + return new Response( stream ); + + } else { + + throw Error( `fetch for "${response.url}" responded with ${response.status}: ${response.statusText}` ); + + } + + } ) + .then( response => { + + switch ( responseType ) { + + case 'arraybuffer': + + return response.arrayBuffer(); + + case 'blob': + + return response.blob(); + + case 'document': + + return response.text() + .then( text => { + + const parser = new DOMParser(); + return parser.parseFromString( text, mimeType ); + + } ); + + case 'json': + + return response.json(); + + default: + + if ( mimeType === undefined ) { + + return response.text(); + + } else { + + // sniff encoding + const re = /charset="?([^;"\s]*)"?/i; + const exec = re.exec( mimeType ); + const label = exec && exec[ 1 ] ? exec[ 1 ].toLowerCase() : undefined; + const decoder = new TextDecoder( label ); + return response.arrayBuffer().then( ab => decoder.decode( ab ) ); + + } + + } + + } ) + .then( data => { + + // Add to cache only on HTTP success, so that we do not cache + // error response bodies as proper responses to requests. + Cache.add( url, data ); + + const callbacks = loading[ url ]; + delete loading[ url ]; + + for ( let i = 0, il = callbacks.length; i < il; i ++ ) { + + const callback = callbacks[ i ]; + if ( callback.onLoad ) callback.onLoad( data ); + + } + + } ) + .catch( err => { + + // Abort errors and other errors are handled the same + + const callbacks = loading[ url ]; + + if ( callbacks === undefined ) { + + // When onLoad was called and url was deleted in `loading` + this.manager.itemError( url ); + throw err; + + } + + delete loading[ url ]; + + for ( let i = 0, il = callbacks.length; i < il; i ++ ) { + + const callback = callbacks[ i ]; + if ( callback.onError ) callback.onError( err ); + + } + + this.manager.itemError( url ); + + } ) + .finally( () => { + + this.manager.itemEnd( url ); + + } ); + + this.manager.itemStart( url ); + + } + + setResponseType( value ) { + + this.responseType = value; + return this; + + } + + setMimeType( value ) { + + this.mimeType = value; + return this; + + } + +} + +class AnimationLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( text ) { + + try { + + onLoad( scope.parse( JSON.parse( text ) ) ); + + } catch ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + + } + + }, onProgress, onError ); + + } + + parse( json ) { + + const animations = []; + + for ( let i = 0; i < json.length; i ++ ) { + + const clip = AnimationClip.parse( json[ i ] ); + + animations.push( clip ); + + } + + return animations; + + } + +} + +/** + * Abstract Base class to block based textures loader (dds, pvr, ...) + * + * Sub classes have to implement the parse() method which will be used in load(). + */ + +class CompressedTextureLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const images = []; + + const texture = new CompressedTexture(); + + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( scope.withCredentials ); + + let loaded = 0; + + function loadTexture( i ) { + + loader.load( url[ i ], function ( buffer ) { + + const texDatas = scope.parse( buffer, true ); + + images[ i ] = { + width: texDatas.width, + height: texDatas.height, + format: texDatas.format, + mipmaps: texDatas.mipmaps + }; + + loaded += 1; + + if ( loaded === 6 ) { + + if ( texDatas.mipmapCount === 1 ) texture.minFilter = LinearFilter; + + texture.image = images; + texture.format = texDatas.format; + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + } + + }, onProgress, onError ); + + } + + if ( Array.isArray( url ) ) { + + for ( let i = 0, il = url.length; i < il; ++ i ) { + + loadTexture( i ); + + } + + } else { + + // compressed cubemap texture stored in a single DDS file + + loader.load( url, function ( buffer ) { + + const texDatas = scope.parse( buffer, true ); + + if ( texDatas.isCubemap ) { + + const faces = texDatas.mipmaps.length / texDatas.mipmapCount; + + for ( let f = 0; f < faces; f ++ ) { + + images[ f ] = { mipmaps: [] }; + + for ( let i = 0; i < texDatas.mipmapCount; i ++ ) { + + images[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] ); + images[ f ].format = texDatas.format; + images[ f ].width = texDatas.width; + images[ f ].height = texDatas.height; + + } + + } + + texture.image = images; + + } else { + + texture.image.width = texDatas.width; + texture.image.height = texDatas.height; + texture.mipmaps = texDatas.mipmaps; + + } + + if ( texDatas.mipmapCount === 1 ) { + + texture.minFilter = LinearFilter; + + } + + texture.format = texDatas.format; + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + }, onProgress, onError ); + + } + + return texture; + + } + +} + +class ImageLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + if ( this.path !== undefined ) url = this.path + url; + + url = this.manager.resolveURL( url ); + + const scope = this; + + const cached = Cache.get( url ); + + if ( cached !== undefined ) { + + scope.manager.itemStart( url ); + + setTimeout( function () { + + if ( onLoad ) onLoad( cached ); + + scope.manager.itemEnd( url ); + + }, 0 ); + + return cached; + + } + + const image = createElementNS( 'img' ); + + function onImageLoad() { + + removeEventListeners(); + + Cache.add( url, this ); + + if ( onLoad ) onLoad( this ); + + scope.manager.itemEnd( url ); + + } + + function onImageError( event ) { + + removeEventListeners(); + + if ( onError ) onError( event ); + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + } + + function removeEventListeners() { + + image.removeEventListener( 'load', onImageLoad, false ); + image.removeEventListener( 'error', onImageError, false ); + + } + + image.addEventListener( 'load', onImageLoad, false ); + image.addEventListener( 'error', onImageError, false ); + + if ( url.substr( 0, 5 ) !== 'data:' ) { + + if ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin; + + } + + scope.manager.itemStart( url ); + + image.src = url; + + return image; + + } + +} + +class CubeTextureLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( urls, onLoad, onProgress, onError ) { + + const texture = new CubeTexture(); + + const loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + loader.setPath( this.path ); + + let loaded = 0; + + function loadTexture( i ) { + + loader.load( urls[ i ], function ( image ) { + + texture.images[ i ] = image; + + loaded ++; + + if ( loaded === 6 ) { + + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + } + + }, undefined, onError ); + + } + + for ( let i = 0; i < urls.length; ++ i ) { + + loadTexture( i ); + + } + + return texture; + + } + +} + +/** + * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) + * + * Sub classes have to implement the parse() method which will be used in load(). + */ + +class DataTextureLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const texture = new DataTexture(); + + const loader = new FileLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setPath( this.path ); + loader.setWithCredentials( scope.withCredentials ); + loader.load( url, function ( buffer ) { + + const texData = scope.parse( buffer ); + + if ( ! texData ) return; + + if ( texData.image !== undefined ) { + + texture.image = texData.image; + + } else if ( texData.data !== undefined ) { + + texture.image.width = texData.width; + texture.image.height = texData.height; + texture.image.data = texData.data; + + } + + texture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping; + texture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping; + + texture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter; + texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter; + + texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; + + if ( texData.encoding !== undefined ) { + + texture.encoding = texData.encoding; + + } + + if ( texData.flipY !== undefined ) { + + texture.flipY = texData.flipY; + + } + + if ( texData.format !== undefined ) { + + texture.format = texData.format; + + } + + if ( texData.type !== undefined ) { + + texture.type = texData.type; + + } + + if ( texData.mipmaps !== undefined ) { + + texture.mipmaps = texData.mipmaps; + texture.minFilter = LinearMipmapLinearFilter; // presumably... + + } + + if ( texData.mipmapCount === 1 ) { + + texture.minFilter = LinearFilter; + + } + + if ( texData.generateMipmaps !== undefined ) { + + texture.generateMipmaps = texData.generateMipmaps; + + } + + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture, texData ); + + }, onProgress, onError ); + + + return texture; + + } + +} + +class TextureLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const texture = new Texture(); + + const loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + loader.setPath( this.path ); + + loader.load( url, function ( image ) { + + texture.image = image; + texture.needsUpdate = true; + + if ( onLoad !== undefined ) { + + onLoad( texture ); + + } + + }, onProgress, onError ); + + return texture; + + } + +} + +class Light extends Object3D { + + constructor( color, intensity = 1 ) { + + super(); + + this.type = 'Light'; + + this.color = new Color( color ); + this.intensity = intensity; + + } + + dispose() { + + // Empty here in base class; some subclasses override. + + } + + copy( source ) { + + super.copy( source ); + + this.color.copy( source.color ); + this.intensity = source.intensity; + + return this; + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + data.object.color = this.color.getHex(); + data.object.intensity = this.intensity; + + if ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex(); + + if ( this.distance !== undefined ) data.object.distance = this.distance; + if ( this.angle !== undefined ) data.object.angle = this.angle; + if ( this.decay !== undefined ) data.object.decay = this.decay; + if ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra; + + if ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON(); + + return data; + + } + +} + +Light.prototype.isLight = true; + +class HemisphereLight extends Light { + + constructor( skyColor, groundColor, intensity ) { + + super( skyColor, intensity ); + + this.type = 'HemisphereLight'; + + this.position.copy( Object3D.DefaultUp ); + this.updateMatrix(); + + this.groundColor = new Color( groundColor ); + + } + + copy( source ) { + + Light.prototype.copy.call( this, source ); + + this.groundColor.copy( source.groundColor ); + + return this; + + } + +} + +HemisphereLight.prototype.isHemisphereLight = true; + +const _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4(); +const _lightPositionWorld$1 = /*@__PURE__*/ new Vector3(); +const _lookTarget$1 = /*@__PURE__*/ new Vector3(); + +class LightShadow { + + constructor( camera ) { + + this.camera = camera; + + this.bias = 0; + this.normalBias = 0; + this.radius = 1; + this.blurSamples = 8; + + this.mapSize = new Vector2( 512, 512 ); + + this.map = null; + this.mapPass = null; + this.matrix = new Matrix4(); + + this.autoUpdate = true; + this.needsUpdate = false; + + this._frustum = new Frustum(); + this._frameExtents = new Vector2( 1, 1 ); + + this._viewportCount = 1; + + this._viewports = [ + + new Vector4( 0, 0, 1, 1 ) + + ]; + + } + + getViewportCount() { + + return this._viewportCount; + + } + + getFrustum() { + + return this._frustum; + + } + + updateMatrices( light ) { + + const shadowCamera = this.camera; + const shadowMatrix = this.matrix; + + _lightPositionWorld$1.setFromMatrixPosition( light.matrixWorld ); + shadowCamera.position.copy( _lightPositionWorld$1 ); + + _lookTarget$1.setFromMatrixPosition( light.target.matrixWorld ); + shadowCamera.lookAt( _lookTarget$1 ); + shadowCamera.updateMatrixWorld(); + + _projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); + this._frustum.setFromProjectionMatrix( _projScreenMatrix$1 ); + + shadowMatrix.set( + 0.5, 0.0, 0.0, 0.5, + 0.0, 0.5, 0.0, 0.5, + 0.0, 0.0, 0.5, 0.5, + 0.0, 0.0, 0.0, 1.0 + ); + + shadowMatrix.multiply( shadowCamera.projectionMatrix ); + shadowMatrix.multiply( shadowCamera.matrixWorldInverse ); + + } + + getViewport( viewportIndex ) { + + return this._viewports[ viewportIndex ]; + + } + + getFrameExtents() { + + return this._frameExtents; + + } + + dispose() { + + if ( this.map ) { + + this.map.dispose(); + + } + + if ( this.mapPass ) { + + this.mapPass.dispose(); + + } + + } + + copy( source ) { + + this.camera = source.camera.clone(); + + this.bias = source.bias; + this.radius = source.radius; + + this.mapSize.copy( source.mapSize ); + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + toJSON() { + + const object = {}; + + if ( this.bias !== 0 ) object.bias = this.bias; + if ( this.normalBias !== 0 ) object.normalBias = this.normalBias; + if ( this.radius !== 1 ) object.radius = this.radius; + if ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray(); + + object.camera = this.camera.toJSON( false ).object; + delete object.camera.matrix; + + return object; + + } + +} + +class SpotLightShadow extends LightShadow { + + constructor() { + + super( new PerspectiveCamera( 50, 1, 0.5, 500 ) ); + + this.focus = 1; + + } + + updateMatrices( light ) { + + const camera = this.camera; + + const fov = RAD2DEG * 2 * light.angle * this.focus; + const aspect = this.mapSize.width / this.mapSize.height; + const far = light.distance || camera.far; + + if ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) { + + camera.fov = fov; + camera.aspect = aspect; + camera.far = far; + camera.updateProjectionMatrix(); + + } + + super.updateMatrices( light ); + + } + + copy( source ) { + + super.copy( source ); + + this.focus = source.focus; + + return this; + + } + +} + +SpotLightShadow.prototype.isSpotLightShadow = true; + +class SpotLight extends Light { + + constructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 1 ) { + + super( color, intensity ); + + this.type = 'SpotLight'; + + this.position.copy( Object3D.DefaultUp ); + this.updateMatrix(); + + this.target = new Object3D(); + + this.distance = distance; + this.angle = angle; + this.penumbra = penumbra; + this.decay = decay; // for physically correct lights, should be 2. + + this.shadow = new SpotLightShadow(); + + } + + get power() { + + // compute the light's luminous power (in lumens) from its intensity (in candela) + // by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd) + return this.intensity * Math.PI; + + } + + set power( power ) { + + // set the light's intensity (in candela) from the desired luminous power (in lumens) + this.intensity = power / Math.PI; + + } + + dispose() { + + this.shadow.dispose(); + + } + + copy( source ) { + + super.copy( source ); + + this.distance = source.distance; + this.angle = source.angle; + this.penumbra = source.penumbra; + this.decay = source.decay; + + this.target = source.target.clone(); + + this.shadow = source.shadow.clone(); + + return this; + + } + +} + +SpotLight.prototype.isSpotLight = true; + +const _projScreenMatrix = /*@__PURE__*/ new Matrix4(); +const _lightPositionWorld = /*@__PURE__*/ new Vector3(); +const _lookTarget = /*@__PURE__*/ new Vector3(); + +class PointLightShadow extends LightShadow { + + constructor() { + + super( new PerspectiveCamera( 90, 1, 0.5, 500 ) ); + + this._frameExtents = new Vector2( 4, 2 ); + + this._viewportCount = 6; + + this._viewports = [ + // These viewports map a cube-map onto a 2D texture with the + // following orientation: + // + // xzXZ + // y Y + // + // X - Positive x direction + // x - Negative x direction + // Y - Positive y direction + // y - Negative y direction + // Z - Positive z direction + // z - Negative z direction + + // positive X + new Vector4( 2, 1, 1, 1 ), + // negative X + new Vector4( 0, 1, 1, 1 ), + // positive Z + new Vector4( 3, 1, 1, 1 ), + // negative Z + new Vector4( 1, 1, 1, 1 ), + // positive Y + new Vector4( 3, 0, 1, 1 ), + // negative Y + new Vector4( 1, 0, 1, 1 ) + ]; + + this._cubeDirections = [ + new Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ), + new Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 ) + ]; + + this._cubeUps = [ + new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), + new Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ), new Vector3( 0, 0, - 1 ) + ]; + + } + + updateMatrices( light, viewportIndex = 0 ) { + + const camera = this.camera; + const shadowMatrix = this.matrix; + + const far = light.distance || camera.far; + + if ( far !== camera.far ) { + + camera.far = far; + camera.updateProjectionMatrix(); + + } + + _lightPositionWorld.setFromMatrixPosition( light.matrixWorld ); + camera.position.copy( _lightPositionWorld ); + + _lookTarget.copy( camera.position ); + _lookTarget.add( this._cubeDirections[ viewportIndex ] ); + camera.up.copy( this._cubeUps[ viewportIndex ] ); + camera.lookAt( _lookTarget ); + camera.updateMatrixWorld(); + + shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z ); + + _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); + this._frustum.setFromProjectionMatrix( _projScreenMatrix ); + + } + +} + +PointLightShadow.prototype.isPointLightShadow = true; + +class PointLight extends Light { + + constructor( color, intensity, distance = 0, decay = 1 ) { + + super( color, intensity ); + + this.type = 'PointLight'; + + this.distance = distance; + this.decay = decay; // for physically correct lights, should be 2. + + this.shadow = new PointLightShadow(); + + } + + get power() { + + // compute the light's luminous power (in lumens) from its intensity (in candela) + // for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd) + return this.intensity * 4 * Math.PI; + + } + + set power( power ) { + + // set the light's intensity (in candela) from the desired luminous power (in lumens) + this.intensity = power / ( 4 * Math.PI ); + + } + + dispose() { + + this.shadow.dispose(); + + } + + copy( source ) { + + super.copy( source ); + + this.distance = source.distance; + this.decay = source.decay; + + this.shadow = source.shadow.clone(); + + return this; + + } + +} + +PointLight.prototype.isPointLight = true; + +class DirectionalLightShadow extends LightShadow { + + constructor() { + + super( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) ); + + } + +} + +DirectionalLightShadow.prototype.isDirectionalLightShadow = true; + +class DirectionalLight extends Light { + + constructor( color, intensity ) { + + super( color, intensity ); + + this.type = 'DirectionalLight'; + + this.position.copy( Object3D.DefaultUp ); + this.updateMatrix(); + + this.target = new Object3D(); + + this.shadow = new DirectionalLightShadow(); + + } + + dispose() { + + this.shadow.dispose(); + + } + + copy( source ) { + + super.copy( source ); + + this.target = source.target.clone(); + this.shadow = source.shadow.clone(); + + return this; + + } + +} + +DirectionalLight.prototype.isDirectionalLight = true; + +class AmbientLight extends Light { + + constructor( color, intensity ) { + + super( color, intensity ); + + this.type = 'AmbientLight'; + + } + +} + +AmbientLight.prototype.isAmbientLight = true; + +class RectAreaLight extends Light { + + constructor( color, intensity, width = 10, height = 10 ) { + + super( color, intensity ); + + this.type = 'RectAreaLight'; + + this.width = width; + this.height = height; + + } + + get power() { + + // compute the light's luminous power (in lumens) from its intensity (in nits) + return this.intensity * this.width * this.height * Math.PI; + + } + + set power( power ) { + + // set the light's intensity (in nits) from the desired luminous power (in lumens) + this.intensity = power / ( this.width * this.height * Math.PI ); + + } + + copy( source ) { + + super.copy( source ); + + this.width = source.width; + this.height = source.height; + + return this; + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + data.object.width = this.width; + data.object.height = this.height; + + return data; + + } + +} + +RectAreaLight.prototype.isRectAreaLight = true; + +/** + * Primary reference: + * https://graphics.stanford.edu/papers/envmap/envmap.pdf + * + * Secondary reference: + * https://www.ppsloan.org/publications/StupidSH36.pdf + */ + +// 3-band SH defined by 9 coefficients + +class SphericalHarmonics3 { + + constructor() { + + this.coefficients = []; + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients.push( new Vector3() ); + + } + + } + + set( coefficients ) { + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].copy( coefficients[ i ] ); + + } + + return this; + + } + + zero() { + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].set( 0, 0, 0 ); + + } + + return this; + + } + + // get the radiance in the direction of the normal + // target is a Vector3 + getAt( normal, target ) { + + // normal is assumed to be unit length + + const x = normal.x, y = normal.y, z = normal.z; + + const coeff = this.coefficients; + + // band 0 + target.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 ); + + // band 1 + target.addScaledVector( coeff[ 1 ], 0.488603 * y ); + target.addScaledVector( coeff[ 2 ], 0.488603 * z ); + target.addScaledVector( coeff[ 3 ], 0.488603 * x ); + + // band 2 + target.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) ); + target.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) ); + target.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) ); + target.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) ); + target.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) ); + + return target; + + } + + // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal + // target is a Vector3 + // https://graphics.stanford.edu/papers/envmap/envmap.pdf + getIrradianceAt( normal, target ) { + + // normal is assumed to be unit length + + const x = normal.x, y = normal.y, z = normal.z; + + const coeff = this.coefficients; + + // band 0 + target.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095 + + // band 1 + target.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603 + target.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z ); + target.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x ); + + // band 2 + target.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548 + target.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z ); + target.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3 + target.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z ); + target.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274 + + return target; + + } + + add( sh ) { + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].add( sh.coefficients[ i ] ); + + } + + return this; + + } + + addScaledSH( sh, s ) { + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s ); + + } + + return this; + + } + + scale( s ) { + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].multiplyScalar( s ); + + } + + return this; + + } + + lerp( sh, alpha ) { + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].lerp( sh.coefficients[ i ], alpha ); + + } + + return this; + + } + + equals( sh ) { + + for ( let i = 0; i < 9; i ++ ) { + + if ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) { + + return false; + + } + + } + + return true; + + } + + copy( sh ) { + + return this.set( sh.coefficients ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + fromArray( array, offset = 0 ) { + + const coefficients = this.coefficients; + + for ( let i = 0; i < 9; i ++ ) { + + coefficients[ i ].fromArray( array, offset + ( i * 3 ) ); + + } + + return this; + + } + + toArray( array = [], offset = 0 ) { + + const coefficients = this.coefficients; + + for ( let i = 0; i < 9; i ++ ) { + + coefficients[ i ].toArray( array, offset + ( i * 3 ) ); + + } + + return array; + + } + + // evaluate the basis functions + // shBasis is an Array[ 9 ] + static getBasisAt( normal, shBasis ) { + + // normal is assumed to be unit length + + const x = normal.x, y = normal.y, z = normal.z; + + // band 0 + shBasis[ 0 ] = 0.282095; + + // band 1 + shBasis[ 1 ] = 0.488603 * y; + shBasis[ 2 ] = 0.488603 * z; + shBasis[ 3 ] = 0.488603 * x; + + // band 2 + shBasis[ 4 ] = 1.092548 * x * y; + shBasis[ 5 ] = 1.092548 * y * z; + shBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 ); + shBasis[ 7 ] = 1.092548 * x * z; + shBasis[ 8 ] = 0.546274 * ( x * x - y * y ); + + } + +} + +SphericalHarmonics3.prototype.isSphericalHarmonics3 = true; + +class LightProbe extends Light { + + constructor( sh = new SphericalHarmonics3(), intensity = 1 ) { + + super( undefined, intensity ); + + this.sh = sh; + + } + + copy( source ) { + + super.copy( source ); + + this.sh.copy( source.sh ); + + return this; + + } + + fromJSON( json ) { + + this.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON(); + this.sh.fromArray( json.sh ); + + return this; + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + data.object.sh = this.sh.toArray(); + + return data; + + } + +} + +LightProbe.prototype.isLightProbe = true; + +class MaterialLoader extends Loader { + + constructor( manager ) { + + super( manager ); + this.textures = {}; + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const loader = new FileLoader( scope.manager ); + loader.setPath( scope.path ); + loader.setRequestHeader( scope.requestHeader ); + loader.setWithCredentials( scope.withCredentials ); + loader.load( url, function ( text ) { + + try { + + onLoad( scope.parse( JSON.parse( text ) ) ); + + } catch ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + + } + + }, onProgress, onError ); + + } + + parse( json ) { + + const textures = this.textures; + + function getTexture( name ) { + + if ( textures[ name ] === undefined ) { + + console.warn( 'THREE.MaterialLoader: Undefined texture', name ); + + } + + return textures[ name ]; + + } + + const material = new Materials[ json.type ](); + + if ( json.uuid !== undefined ) material.uuid = json.uuid; + if ( json.name !== undefined ) material.name = json.name; + if ( json.color !== undefined && material.color !== undefined ) material.color.setHex( json.color ); + if ( json.roughness !== undefined ) material.roughness = json.roughness; + if ( json.metalness !== undefined ) material.metalness = json.metalness; + if ( json.sheen !== undefined ) material.sheen = json.sheen; + if ( json.sheenColor !== undefined ) material.sheenColor = new Color().setHex( json.sheenColor ); + if ( json.sheenRoughness !== undefined ) material.sheenRoughness = json.sheenRoughness; + if ( json.emissive !== undefined && material.emissive !== undefined ) material.emissive.setHex( json.emissive ); + if ( json.specular !== undefined && material.specular !== undefined ) material.specular.setHex( json.specular ); + if ( json.specularIntensity !== undefined ) material.specularIntensity = json.specularIntensity; + if ( json.specularColor !== undefined && material.specularColor !== undefined ) material.specularColor.setHex( json.specularColor ); + if ( json.shininess !== undefined ) material.shininess = json.shininess; + if ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat; + if ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness; + if ( json.transmission !== undefined ) material.transmission = json.transmission; + if ( json.thickness !== undefined ) material.thickness = json.thickness; + if ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance; + if ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor ); + if ( json.fog !== undefined ) material.fog = json.fog; + if ( json.flatShading !== undefined ) material.flatShading = json.flatShading; + if ( json.blending !== undefined ) material.blending = json.blending; + if ( json.combine !== undefined ) material.combine = json.combine; + if ( json.side !== undefined ) material.side = json.side; + if ( json.shadowSide !== undefined ) material.shadowSide = json.shadowSide; + if ( json.opacity !== undefined ) material.opacity = json.opacity; + if ( json.transparent !== undefined ) material.transparent = json.transparent; + if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; + if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; + if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; + if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; + + if ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite; + if ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask; + if ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc; + if ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef; + if ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask; + if ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail; + if ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail; + if ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass; + + if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; + if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; + if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap; + if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin; + + if ( json.rotation !== undefined ) material.rotation = json.rotation; + + if ( json.linewidth !== 1 ) material.linewidth = json.linewidth; + if ( json.dashSize !== undefined ) material.dashSize = json.dashSize; + if ( json.gapSize !== undefined ) material.gapSize = json.gapSize; + if ( json.scale !== undefined ) material.scale = json.scale; + + if ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset; + if ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor; + if ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits; + + if ( json.dithering !== undefined ) material.dithering = json.dithering; + + if ( json.alphaToCoverage !== undefined ) material.alphaToCoverage = json.alphaToCoverage; + if ( json.premultipliedAlpha !== undefined ) material.premultipliedAlpha = json.premultipliedAlpha; + + if ( json.visible !== undefined ) material.visible = json.visible; + + if ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped; + + if ( json.userData !== undefined ) material.userData = json.userData; + + if ( json.vertexColors !== undefined ) { + + if ( typeof json.vertexColors === 'number' ) { + + material.vertexColors = ( json.vertexColors > 0 ) ? true : false; + + } else { + + material.vertexColors = json.vertexColors; + + } + + } + + // Shader Material + + if ( json.uniforms !== undefined ) { + + for ( const name in json.uniforms ) { + + const uniform = json.uniforms[ name ]; + + material.uniforms[ name ] = {}; + + switch ( uniform.type ) { + + case 't': + material.uniforms[ name ].value = getTexture( uniform.value ); + break; + + case 'c': + material.uniforms[ name ].value = new Color().setHex( uniform.value ); + break; + + case 'v2': + material.uniforms[ name ].value = new Vector2().fromArray( uniform.value ); + break; + + case 'v3': + material.uniforms[ name ].value = new Vector3().fromArray( uniform.value ); + break; + + case 'v4': + material.uniforms[ name ].value = new Vector4().fromArray( uniform.value ); + break; + + case 'm3': + material.uniforms[ name ].value = new Matrix3().fromArray( uniform.value ); + break; + + case 'm4': + material.uniforms[ name ].value = new Matrix4().fromArray( uniform.value ); + break; + + default: + material.uniforms[ name ].value = uniform.value; + + } + + } + + } + + if ( json.defines !== undefined ) material.defines = json.defines; + if ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader; + if ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader; + + if ( json.extensions !== undefined ) { + + for ( const key in json.extensions ) { + + material.extensions[ key ] = json.extensions[ key ]; + + } + + } + + // Deprecated + + if ( json.shading !== undefined ) material.flatShading = json.shading === 1; // THREE.FlatShading + + // for PointsMaterial + + if ( json.size !== undefined ) material.size = json.size; + if ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation; + + // maps + + if ( json.map !== undefined ) material.map = getTexture( json.map ); + if ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap ); + + if ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap ); + + if ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap ); + if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale; + + if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap ); + if ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType; + if ( json.normalScale !== undefined ) { + + let normalScale = json.normalScale; + + if ( Array.isArray( normalScale ) === false ) { + + // Blender exporter used to export a scalar. See #7459 + + normalScale = [ normalScale, normalScale ]; + + } + + material.normalScale = new Vector2().fromArray( normalScale ); + + } + + if ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap ); + if ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale; + if ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias; + + if ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap ); + if ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap ); + + if ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap ); + if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity; + + if ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap ); + if ( json.specularIntensityMap !== undefined ) material.specularIntensityMap = getTexture( json.specularIntensityMap ); + if ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap ); + + if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap ); + if ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity; + + if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity; + if ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio; + + if ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap ); + if ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity; + + if ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap ); + if ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity; + + if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap ); + + if ( json.clearcoatMap !== undefined ) material.clearcoatMap = getTexture( json.clearcoatMap ); + if ( json.clearcoatRoughnessMap !== undefined ) material.clearcoatRoughnessMap = getTexture( json.clearcoatRoughnessMap ); + if ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap ); + if ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale ); + + if ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap ); + if ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap ); + + if ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap ); + if ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap ); + + return material; + + } + + setTextures( value ) { + + this.textures = value; + return this; + + } + +} + +class LoaderUtils { + + static decodeText( array ) { + + if ( typeof TextDecoder !== 'undefined' ) { + + return new TextDecoder().decode( array ); + + } + + // Avoid the String.fromCharCode.apply(null, array) shortcut, which + // throws a "maximum call stack size exceeded" error for large arrays. + + let s = ''; + + for ( let i = 0, il = array.length; i < il; i ++ ) { + + // Implicitly assumes little-endian. + s += String.fromCharCode( array[ i ] ); + + } + + try { + + // merges multi-byte utf-8 characters. + + return decodeURIComponent( escape( s ) ); + + } catch ( e ) { // see #16358 + + return s; + + } + + } + + static extractUrlBase( url ) { + + const index = url.lastIndexOf( '/' ); + + if ( index === - 1 ) return './'; + + return url.substr( 0, index + 1 ); + + } + + static resolveURL( url, path ) { + + // Invalid URL + if ( typeof url !== 'string' || url === '' ) return ''; + + // Host Relative URL + if ( /^https?:\/\//i.test( path ) && /^\//.test( url ) ) { + + path = path.replace( /(^https?:\/\/[^\/]+).*/i, '$1' ); + + } + + // Absolute URL http://,https://,// + if ( /^(https?:)?\/\//i.test( url ) ) return url; + + // Data URI + if ( /^data:.*,.*$/i.test( url ) ) return url; + + // Blob URL + if ( /^blob:.*$/i.test( url ) ) return url; + + // Relative URL + return path + url; + + } + +} + +class InstancedBufferGeometry extends BufferGeometry { + + constructor() { + + super(); + + this.type = 'InstancedBufferGeometry'; + this.instanceCount = Infinity; + + } + + copy( source ) { + + super.copy( source ); + + this.instanceCount = source.instanceCount; + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + toJSON() { + + const data = super.toJSON( this ); + + data.instanceCount = this.instanceCount; + + data.isInstancedBufferGeometry = true; + + return data; + + } + +} + +InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true; + +class BufferGeometryLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const loader = new FileLoader( scope.manager ); + loader.setPath( scope.path ); + loader.setRequestHeader( scope.requestHeader ); + loader.setWithCredentials( scope.withCredentials ); + loader.load( url, function ( text ) { + + try { + + onLoad( scope.parse( JSON.parse( text ) ) ); + + } catch ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + + } + + }, onProgress, onError ); + + } + + parse( json ) { + + const interleavedBufferMap = {}; + const arrayBufferMap = {}; + + function getInterleavedBuffer( json, uuid ) { + + if ( interleavedBufferMap[ uuid ] !== undefined ) return interleavedBufferMap[ uuid ]; + + const interleavedBuffers = json.interleavedBuffers; + const interleavedBuffer = interleavedBuffers[ uuid ]; + + const buffer = getArrayBuffer( json, interleavedBuffer.buffer ); + + const array = getTypedArray( interleavedBuffer.type, buffer ); + const ib = new InterleavedBuffer( array, interleavedBuffer.stride ); + ib.uuid = interleavedBuffer.uuid; + + interleavedBufferMap[ uuid ] = ib; + + return ib; + + } + + function getArrayBuffer( json, uuid ) { + + if ( arrayBufferMap[ uuid ] !== undefined ) return arrayBufferMap[ uuid ]; + + const arrayBuffers = json.arrayBuffers; + const arrayBuffer = arrayBuffers[ uuid ]; + + const ab = new Uint32Array( arrayBuffer ).buffer; + + arrayBufferMap[ uuid ] = ab; + + return ab; + + } + + const geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry(); + + const index = json.data.index; + + if ( index !== undefined ) { + + const typedArray = getTypedArray( index.type, index.array ); + geometry.setIndex( new BufferAttribute( typedArray, 1 ) ); + + } + + const attributes = json.data.attributes; + + for ( const key in attributes ) { + + const attribute = attributes[ key ]; + let bufferAttribute; + + if ( attribute.isInterleavedBufferAttribute ) { + + const interleavedBuffer = getInterleavedBuffer( json.data, attribute.data ); + bufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized ); + + } else { + + const typedArray = getTypedArray( attribute.type, attribute.array ); + const bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute; + bufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized ); + + } + + if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name; + if ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage ); + + if ( attribute.updateRange !== undefined ) { + + bufferAttribute.updateRange.offset = attribute.updateRange.offset; + bufferAttribute.updateRange.count = attribute.updateRange.count; + + } + + geometry.setAttribute( key, bufferAttribute ); + + } + + const morphAttributes = json.data.morphAttributes; + + if ( morphAttributes ) { + + for ( const key in morphAttributes ) { + + const attributeArray = morphAttributes[ key ]; + + const array = []; + + for ( let i = 0, il = attributeArray.length; i < il; i ++ ) { + + const attribute = attributeArray[ i ]; + let bufferAttribute; + + if ( attribute.isInterleavedBufferAttribute ) { + + const interleavedBuffer = getInterleavedBuffer( json.data, attribute.data ); + bufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized ); + + } else { + + const typedArray = getTypedArray( attribute.type, attribute.array ); + bufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized ); + + } + + if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name; + array.push( bufferAttribute ); + + } + + geometry.morphAttributes[ key ] = array; + + } + + } + + const morphTargetsRelative = json.data.morphTargetsRelative; + + if ( morphTargetsRelative ) { + + geometry.morphTargetsRelative = true; + + } + + const groups = json.data.groups || json.data.drawcalls || json.data.offsets; + + if ( groups !== undefined ) { + + for ( let i = 0, n = groups.length; i !== n; ++ i ) { + + const group = groups[ i ]; + + geometry.addGroup( group.start, group.count, group.materialIndex ); + + } + + } + + const boundingSphere = json.data.boundingSphere; + + if ( boundingSphere !== undefined ) { + + const center = new Vector3(); + + if ( boundingSphere.center !== undefined ) { + + center.fromArray( boundingSphere.center ); + + } + + geometry.boundingSphere = new Sphere( center, boundingSphere.radius ); + + } + + if ( json.name ) geometry.name = json.name; + if ( json.userData ) geometry.userData = json.userData; + + return geometry; + + } + +} + +class ObjectLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path; + this.resourcePath = this.resourcePath || path; + + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( text ) { + + let json = null; + + try { + + json = JSON.parse( text ); + + } catch ( error ) { + + if ( onError !== undefined ) onError( error ); + + console.error( 'THREE:ObjectLoader: Can\'t parse ' + url + '.', error.message ); + + return; + + } + + const metadata = json.metadata; + + if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) { + + console.error( 'THREE.ObjectLoader: Can\'t load ' + url ); + return; + + } + + scope.parse( json, onLoad ); + + }, onProgress, onError ); + + } + + async loadAsync( url, onProgress ) { + + const scope = this; + + const path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path; + this.resourcePath = this.resourcePath || path; + + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + + const text = await loader.loadAsync( url, onProgress ); + + const json = JSON.parse( text ); + + const metadata = json.metadata; + + if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) { + + throw new Error( 'THREE.ObjectLoader: Can\'t load ' + url ); + + } + + return await scope.parseAsync( json ); + + } + + parse( json, onLoad ) { + + const animations = this.parseAnimations( json.animations ); + const shapes = this.parseShapes( json.shapes ); + const geometries = this.parseGeometries( json.geometries, shapes ); + + const images = this.parseImages( json.images, function () { + + if ( onLoad !== undefined ) onLoad( object ); + + } ); + + const textures = this.parseTextures( json.textures, images ); + const materials = this.parseMaterials( json.materials, textures ); + + const object = this.parseObject( json.object, geometries, materials, textures, animations ); + const skeletons = this.parseSkeletons( json.skeletons, object ); + + this.bindSkeletons( object, skeletons ); + + // + + if ( onLoad !== undefined ) { + + let hasImages = false; + + for ( const uuid in images ) { + + if ( images[ uuid ] instanceof HTMLImageElement ) { + + hasImages = true; + break; + + } + + } + + if ( hasImages === false ) onLoad( object ); + + } + + return object; + + } + + async parseAsync( json ) { + + const animations = this.parseAnimations( json.animations ); + const shapes = this.parseShapes( json.shapes ); + const geometries = this.parseGeometries( json.geometries, shapes ); + + const images = await this.parseImagesAsync( json.images ); + + const textures = this.parseTextures( json.textures, images ); + const materials = this.parseMaterials( json.materials, textures ); + + const object = this.parseObject( json.object, geometries, materials, textures, animations ); + const skeletons = this.parseSkeletons( json.skeletons, object ); + + this.bindSkeletons( object, skeletons ); + + return object; + + } + + parseShapes( json ) { + + const shapes = {}; + + if ( json !== undefined ) { + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const shape = new Shape().fromJSON( json[ i ] ); + + shapes[ shape.uuid ] = shape; + + } + + } + + return shapes; + + } + + parseSkeletons( json, object ) { + + const skeletons = {}; + const bones = {}; + + // generate bone lookup table + + object.traverse( function ( child ) { + + if ( child.isBone ) bones[ child.uuid ] = child; + + } ); + + // create skeletons + + if ( json !== undefined ) { + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const skeleton = new Skeleton().fromJSON( json[ i ], bones ); + + skeletons[ skeleton.uuid ] = skeleton; + + } + + } + + return skeletons; + + } + + parseGeometries( json, shapes ) { + + const geometries = {}; + + if ( json !== undefined ) { + + const bufferGeometryLoader = new BufferGeometryLoader(); + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + let geometry; + const data = json[ i ]; + + switch ( data.type ) { + + case 'BufferGeometry': + case 'InstancedBufferGeometry': + + geometry = bufferGeometryLoader.parse( data ); + + break; + + case 'Geometry': + + console.error( 'THREE.ObjectLoader: The legacy Geometry type is no longer supported.' ); + + break; + + default: + + if ( data.type in Geometries ) { + + geometry = Geometries[ data.type ].fromJSON( data, shapes ); + + } else { + + console.warn( `THREE.ObjectLoader: Unsupported geometry type "${ data.type }"` ); + + } + + } + + geometry.uuid = data.uuid; + + if ( data.name !== undefined ) geometry.name = data.name; + if ( geometry.isBufferGeometry === true && data.userData !== undefined ) geometry.userData = data.userData; + + geometries[ data.uuid ] = geometry; + + } + + } + + return geometries; + + } + + parseMaterials( json, textures ) { + + const cache = {}; // MultiMaterial + const materials = {}; + + if ( json !== undefined ) { + + const loader = new MaterialLoader(); + loader.setTextures( textures ); + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const data = json[ i ]; + + if ( data.type === 'MultiMaterial' ) { + + // Deprecated + + const array = []; + + for ( let j = 0; j < data.materials.length; j ++ ) { + + const material = data.materials[ j ]; + + if ( cache[ material.uuid ] === undefined ) { + + cache[ material.uuid ] = loader.parse( material ); + + } + + array.push( cache[ material.uuid ] ); + + } + + materials[ data.uuid ] = array; + + } else { + + if ( cache[ data.uuid ] === undefined ) { + + cache[ data.uuid ] = loader.parse( data ); + + } + + materials[ data.uuid ] = cache[ data.uuid ]; + + } + + } + + } + + return materials; + + } + + parseAnimations( json ) { + + const animations = {}; + + if ( json !== undefined ) { + + for ( let i = 0; i < json.length; i ++ ) { + + const data = json[ i ]; + + const clip = AnimationClip.parse( data ); + + animations[ clip.uuid ] = clip; + + } + + } + + return animations; + + } + + parseImages( json, onLoad ) { + + const scope = this; + const images = {}; + + let loader; + + function loadImage( url ) { + + scope.manager.itemStart( url ); + + return loader.load( url, function () { + + scope.manager.itemEnd( url ); + + }, undefined, function () { + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + } ); + + } + + function deserializeImage( image ) { + + if ( typeof image === 'string' ) { + + const url = image; + + const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( url ) ? url : scope.resourcePath + url; + + return loadImage( path ); + + } else { + + if ( image.data ) { + + return { + data: getTypedArray( image.type, image.data ), + width: image.width, + height: image.height + }; + + } else { + + return null; + + } + + } + + } + + if ( json !== undefined && json.length > 0 ) { + + const manager = new LoadingManager( onLoad ); + + loader = new ImageLoader( manager ); + loader.setCrossOrigin( this.crossOrigin ); + + for ( let i = 0, il = json.length; i < il; i ++ ) { + + const image = json[ i ]; + const url = image.url; + + if ( Array.isArray( url ) ) { + + // load array of images e.g CubeTexture + + images[ image.uuid ] = []; + + for ( let j = 0, jl = url.length; j < jl; j ++ ) { + + const currentUrl = url[ j ]; + + const deserializedImage = deserializeImage( currentUrl ); + + if ( deserializedImage !== null ) { + + if ( deserializedImage instanceof HTMLImageElement ) { + + images[ image.uuid ].push( deserializedImage ); + + } else { + + // special case: handle array of data textures for cube textures + + images[ image.uuid ].push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) ); + + } + + } + + } + + } else { + + // load single image + + const deserializedImage = deserializeImage( image.url ); + + if ( deserializedImage !== null ) { + + images[ image.uuid ] = deserializedImage; + + } + + } + + } + + } + + return images; + + } + + async parseImagesAsync( json ) { + + const scope = this; + const images = {}; + + let loader; + + async function deserializeImage( image ) { + + if ( typeof image === 'string' ) { + + const url = image; + + const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( url ) ? url : scope.resourcePath + url; + + return await loader.loadAsync( path ); + + } else { + + if ( image.data ) { + + return { + data: getTypedArray( image.type, image.data ), + width: image.width, + height: image.height + }; + + } else { + + return null; + + } + + } + + } + + if ( json !== undefined && json.length > 0 ) { + + loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + + for ( let i = 0, il = json.length; i < il; i ++ ) { + + const image = json[ i ]; + const url = image.url; + + if ( Array.isArray( url ) ) { + + // load array of images e.g CubeTexture + + images[ image.uuid ] = []; + + for ( let j = 0, jl = url.length; j < jl; j ++ ) { + + const currentUrl = url[ j ]; + + const deserializedImage = await deserializeImage( currentUrl ); + + if ( deserializedImage !== null ) { + + if ( deserializedImage instanceof HTMLImageElement ) { + + images[ image.uuid ].push( deserializedImage ); + + } else { + + // special case: handle array of data textures for cube textures + + images[ image.uuid ].push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) ); + + } + + } + + } + + } else { + + // load single image + + const deserializedImage = await deserializeImage( image.url ); + + if ( deserializedImage !== null ) { + + images[ image.uuid ] = deserializedImage; + + } + + } + + } + + } + + return images; + + } + + parseTextures( json, images ) { + + function parseConstant( value, type ) { + + if ( typeof value === 'number' ) return value; + + console.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value ); + + return type[ value ]; + + } + + const textures = {}; + + if ( json !== undefined ) { + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const data = json[ i ]; + + if ( data.image === undefined ) { + + console.warn( 'THREE.ObjectLoader: No "image" specified for', data.uuid ); + + } + + if ( images[ data.image ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined image', data.image ); + + } + + let texture; + const image = images[ data.image ]; + + if ( Array.isArray( image ) ) { + + texture = new CubeTexture( image ); + + if ( image.length === 6 ) texture.needsUpdate = true; + + } else { + + if ( image && image.data ) { + + texture = new DataTexture( image.data, image.width, image.height ); + + } else { + + texture = new Texture( image ); + + } + + if ( image ) texture.needsUpdate = true; // textures can have undefined image data + + } + + texture.uuid = data.uuid; + + if ( data.name !== undefined ) texture.name = data.name; + + if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING ); + + if ( data.offset !== undefined ) texture.offset.fromArray( data.offset ); + if ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat ); + if ( data.center !== undefined ) texture.center.fromArray( data.center ); + if ( data.rotation !== undefined ) texture.rotation = data.rotation; + + if ( data.wrap !== undefined ) { + + texture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING ); + texture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING ); + + } + + if ( data.format !== undefined ) texture.format = data.format; + if ( data.type !== undefined ) texture.type = data.type; + if ( data.encoding !== undefined ) texture.encoding = data.encoding; + + if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER ); + if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER ); + if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy; + + if ( data.flipY !== undefined ) texture.flipY = data.flipY; + + if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha; + if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment; + + if ( data.userData !== undefined ) texture.userData = data.userData; + + textures[ data.uuid ] = texture; + + } + + } + + return textures; + + } + + parseObject( data, geometries, materials, textures, animations ) { + + let object; + + function getGeometry( name ) { + + if ( geometries[ name ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined geometry', name ); + + } + + return geometries[ name ]; + + } + + function getMaterial( name ) { + + if ( name === undefined ) return undefined; + + if ( Array.isArray( name ) ) { + + const array = []; + + for ( let i = 0, l = name.length; i < l; i ++ ) { + + const uuid = name[ i ]; + + if ( materials[ uuid ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined material', uuid ); + + } + + array.push( materials[ uuid ] ); + + } + + return array; + + } + + if ( materials[ name ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined material', name ); + + } + + return materials[ name ]; + + } + + function getTexture( uuid ) { + + if ( textures[ uuid ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined texture', uuid ); + + } + + return textures[ uuid ]; + + } + + let geometry, material; + + switch ( data.type ) { + + case 'Scene': + + object = new Scene(); + + if ( data.background !== undefined ) { + + if ( Number.isInteger( data.background ) ) { + + object.background = new Color( data.background ); + + } else { + + object.background = getTexture( data.background ); + + } + + } + + if ( data.environment !== undefined ) { + + object.environment = getTexture( data.environment ); + + } + + if ( data.fog !== undefined ) { + + if ( data.fog.type === 'Fog' ) { + + object.fog = new Fog( data.fog.color, data.fog.near, data.fog.far ); + + } else if ( data.fog.type === 'FogExp2' ) { + + object.fog = new FogExp2( data.fog.color, data.fog.density ); + + } + + } + + break; + + case 'PerspectiveCamera': + + object = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far ); + + if ( data.focus !== undefined ) object.focus = data.focus; + if ( data.zoom !== undefined ) object.zoom = data.zoom; + if ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge; + if ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset; + if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); + + break; + + case 'OrthographicCamera': + + object = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far ); + + if ( data.zoom !== undefined ) object.zoom = data.zoom; + if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); + + break; + + case 'AmbientLight': + + object = new AmbientLight( data.color, data.intensity ); + + break; + + case 'DirectionalLight': + + object = new DirectionalLight( data.color, data.intensity ); + + break; + + case 'PointLight': + + object = new PointLight( data.color, data.intensity, data.distance, data.decay ); + + break; + + case 'RectAreaLight': + + object = new RectAreaLight( data.color, data.intensity, data.width, data.height ); + + break; + + case 'SpotLight': + + object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay ); + + break; + + case 'HemisphereLight': + + object = new HemisphereLight( data.color, data.groundColor, data.intensity ); + + break; + + case 'LightProbe': + + object = new LightProbe().fromJSON( data ); + + break; + + case 'SkinnedMesh': + + geometry = getGeometry( data.geometry ); + material = getMaterial( data.material ); + + object = new SkinnedMesh( geometry, material ); + + if ( data.bindMode !== undefined ) object.bindMode = data.bindMode; + if ( data.bindMatrix !== undefined ) object.bindMatrix.fromArray( data.bindMatrix ); + if ( data.skeleton !== undefined ) object.skeleton = data.skeleton; + + break; + + case 'Mesh': + + geometry = getGeometry( data.geometry ); + material = getMaterial( data.material ); + + object = new Mesh( geometry, material ); + + break; + + case 'InstancedMesh': + + geometry = getGeometry( data.geometry ); + material = getMaterial( data.material ); + const count = data.count; + const instanceMatrix = data.instanceMatrix; + const instanceColor = data.instanceColor; + + object = new InstancedMesh( geometry, material, count ); + object.instanceMatrix = new InstancedBufferAttribute( new Float32Array( instanceMatrix.array ), 16 ); + if ( instanceColor !== undefined ) object.instanceColor = new InstancedBufferAttribute( new Float32Array( instanceColor.array ), instanceColor.itemSize ); + + break; + + case 'LOD': + + object = new LOD(); + + break; + + case 'Line': + + object = new Line( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'LineLoop': + + object = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'LineSegments': + + object = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'PointCloud': + case 'Points': + + object = new Points( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'Sprite': + + object = new Sprite( getMaterial( data.material ) ); + + break; + + case 'Group': + + object = new Group(); + + break; + + case 'Bone': + + object = new Bone(); + + break; + + default: + + object = new Object3D(); + + } + + object.uuid = data.uuid; + + if ( data.name !== undefined ) object.name = data.name; + + if ( data.matrix !== undefined ) { + + object.matrix.fromArray( data.matrix ); + + if ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate; + if ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale ); + + } else { + + if ( data.position !== undefined ) object.position.fromArray( data.position ); + if ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation ); + if ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion ); + if ( data.scale !== undefined ) object.scale.fromArray( data.scale ); + + } + + if ( data.castShadow !== undefined ) object.castShadow = data.castShadow; + if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow; + + if ( data.shadow ) { + + if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias; + if ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias; + if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius; + if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize ); + if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera ); + + } + + if ( data.visible !== undefined ) object.visible = data.visible; + if ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled; + if ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder; + if ( data.userData !== undefined ) object.userData = data.userData; + if ( data.layers !== undefined ) object.layers.mask = data.layers; + + if ( data.children !== undefined ) { + + const children = data.children; + + for ( let i = 0; i < children.length; i ++ ) { + + object.add( this.parseObject( children[ i ], geometries, materials, textures, animations ) ); + + } + + } + + if ( data.animations !== undefined ) { + + const objectAnimations = data.animations; + + for ( let i = 0; i < objectAnimations.length; i ++ ) { + + const uuid = objectAnimations[ i ]; + + object.animations.push( animations[ uuid ] ); + + } + + } + + if ( data.type === 'LOD' ) { + + if ( data.autoUpdate !== undefined ) object.autoUpdate = data.autoUpdate; + + const levels = data.levels; + + for ( let l = 0; l < levels.length; l ++ ) { + + const level = levels[ l ]; + const child = object.getObjectByProperty( 'uuid', level.object ); + + if ( child !== undefined ) { + + object.addLevel( child, level.distance ); + + } + + } + + } + + return object; + + } + + bindSkeletons( object, skeletons ) { + + if ( Object.keys( skeletons ).length === 0 ) return; + + object.traverse( function ( child ) { + + if ( child.isSkinnedMesh === true && child.skeleton !== undefined ) { + + const skeleton = skeletons[ child.skeleton ]; + + if ( skeleton === undefined ) { + + console.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton ); + + } else { + + child.bind( skeleton, child.bindMatrix ); + + } + + } + + } ); + + } + + /* DEPRECATED */ + + setTexturePath( value ) { + + console.warn( 'THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().' ); + return this.setResourcePath( value ); + + } + +} + +const TEXTURE_MAPPING = { + UVMapping: UVMapping, + CubeReflectionMapping: CubeReflectionMapping, + CubeRefractionMapping: CubeRefractionMapping, + EquirectangularReflectionMapping: EquirectangularReflectionMapping, + EquirectangularRefractionMapping: EquirectangularRefractionMapping, + CubeUVReflectionMapping: CubeUVReflectionMapping, + CubeUVRefractionMapping: CubeUVRefractionMapping +}; + +const TEXTURE_WRAPPING = { + RepeatWrapping: RepeatWrapping, + ClampToEdgeWrapping: ClampToEdgeWrapping, + MirroredRepeatWrapping: MirroredRepeatWrapping +}; + +const TEXTURE_FILTER = { + NearestFilter: NearestFilter, + NearestMipmapNearestFilter: NearestMipmapNearestFilter, + NearestMipmapLinearFilter: NearestMipmapLinearFilter, + LinearFilter: LinearFilter, + LinearMipmapNearestFilter: LinearMipmapNearestFilter, + LinearMipmapLinearFilter: LinearMipmapLinearFilter +}; + +class ImageBitmapLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + if ( typeof createImageBitmap === 'undefined' ) { + + console.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' ); + + } + + if ( typeof fetch === 'undefined' ) { + + console.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' ); + + } + + this.options = { premultiplyAlpha: 'none' }; + + } + + setOptions( options ) { + + this.options = options; + + return this; + + } + + load( url, onLoad, onProgress, onError ) { + + if ( url === undefined ) url = ''; + + if ( this.path !== undefined ) url = this.path + url; + + url = this.manager.resolveURL( url ); + + const scope = this; + + const cached = Cache.get( url ); + + if ( cached !== undefined ) { + + scope.manager.itemStart( url ); + + setTimeout( function () { + + if ( onLoad ) onLoad( cached ); + + scope.manager.itemEnd( url ); + + }, 0 ); + + return cached; + + } + + const fetchOptions = {}; + fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include'; + fetchOptions.headers = this.requestHeader; + + fetch( url, fetchOptions ).then( function ( res ) { + + return res.blob(); + + } ).then( function ( blob ) { + + return createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) ); + + } ).then( function ( imageBitmap ) { + + Cache.add( url, imageBitmap ); + + if ( onLoad ) onLoad( imageBitmap ); + + scope.manager.itemEnd( url ); + + } ).catch( function ( e ) { + + if ( onError ) onError( e ); + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + } ); + + scope.manager.itemStart( url ); + + } + +} + +ImageBitmapLoader.prototype.isImageBitmapLoader = true; + +let _context; + +const AudioContext = { + + getContext: function () { + + if ( _context === undefined ) { + + _context = new ( window.AudioContext || window.webkitAudioContext )(); + + } + + return _context; + + }, + + setContext: function ( value ) { + + _context = value; + + } + +}; + +class AudioLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const loader = new FileLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( buffer ) { + + try { + + // Create a copy of the buffer. The `decodeAudioData` method + // detaches the buffer when complete, preventing reuse. + const bufferCopy = buffer.slice( 0 ); + + const context = AudioContext.getContext(); + context.decodeAudioData( bufferCopy, function ( audioBuffer ) { + + onLoad( audioBuffer ); + + } ); + + } catch ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + + } + + }, onProgress, onError ); + + } + +} + +class HemisphereLightProbe extends LightProbe { + + constructor( skyColor, groundColor, intensity = 1 ) { + + super( undefined, intensity ); + + const color1 = new Color().set( skyColor ); + const color2 = new Color().set( groundColor ); + + const sky = new Vector3( color1.r, color1.g, color1.b ); + const ground = new Vector3( color2.r, color2.g, color2.b ); + + // without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI ); + const c0 = Math.sqrt( Math.PI ); + const c1 = c0 * Math.sqrt( 0.75 ); + + this.sh.coefficients[ 0 ].copy( sky ).add( ground ).multiplyScalar( c0 ); + this.sh.coefficients[ 1 ].copy( sky ).sub( ground ).multiplyScalar( c1 ); + + } + +} + +HemisphereLightProbe.prototype.isHemisphereLightProbe = true; + +class AmbientLightProbe extends LightProbe { + + constructor( color, intensity = 1 ) { + + super( undefined, intensity ); + + const color1 = new Color().set( color ); + + // without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI ); + this.sh.coefficients[ 0 ].set( color1.r, color1.g, color1.b ).multiplyScalar( 2 * Math.sqrt( Math.PI ) ); + + } + +} + +AmbientLightProbe.prototype.isAmbientLightProbe = true; + +const _eyeRight = /*@__PURE__*/ new Matrix4(); +const _eyeLeft = /*@__PURE__*/ new Matrix4(); +const _projectionMatrix = /*@__PURE__*/ new Matrix4(); + +class StereoCamera { + + constructor() { + + this.type = 'StereoCamera'; + + this.aspect = 1; + + this.eyeSep = 0.064; + + this.cameraL = new PerspectiveCamera(); + this.cameraL.layers.enable( 1 ); + this.cameraL.matrixAutoUpdate = false; + + this.cameraR = new PerspectiveCamera(); + this.cameraR.layers.enable( 2 ); + this.cameraR.matrixAutoUpdate = false; + + this._cache = { + focus: null, + fov: null, + aspect: null, + near: null, + far: null, + zoom: null, + eyeSep: null + }; + + } + + update( camera ) { + + const cache = this._cache; + + const needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov || + cache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near || + cache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep; + + if ( needsUpdate ) { + + cache.focus = camera.focus; + cache.fov = camera.fov; + cache.aspect = camera.aspect * this.aspect; + cache.near = camera.near; + cache.far = camera.far; + cache.zoom = camera.zoom; + cache.eyeSep = this.eyeSep; + + // Off-axis stereoscopic effect based on + // http://paulbourke.net/stereographics/stereorender/ + + _projectionMatrix.copy( camera.projectionMatrix ); + const eyeSepHalf = cache.eyeSep / 2; + const eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus; + const ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom; + let xmin, xmax; + + // translate xOffset + + _eyeLeft.elements[ 12 ] = - eyeSepHalf; + _eyeRight.elements[ 12 ] = eyeSepHalf; + + // for left eye + + xmin = - ymax * cache.aspect + eyeSepOnProjection; + xmax = ymax * cache.aspect + eyeSepOnProjection; + + _projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin ); + _projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + + this.cameraL.projectionMatrix.copy( _projectionMatrix ); + + // for right eye + + xmin = - ymax * cache.aspect - eyeSepOnProjection; + xmax = ymax * cache.aspect - eyeSepOnProjection; + + _projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin ); + _projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + + this.cameraR.projectionMatrix.copy( _projectionMatrix ); + + } + + this.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft ); + this.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight ); + + } + +} + +class Clock { + + constructor( autoStart = true ) { + + this.autoStart = autoStart; + + this.startTime = 0; + this.oldTime = 0; + this.elapsedTime = 0; + + this.running = false; + + } + + start() { + + this.startTime = now(); + + this.oldTime = this.startTime; + this.elapsedTime = 0; + this.running = true; + + } + + stop() { + + this.getElapsedTime(); + this.running = false; + this.autoStart = false; + + } + + getElapsedTime() { + + this.getDelta(); + return this.elapsedTime; + + } + + getDelta() { + + let diff = 0; + + if ( this.autoStart && ! this.running ) { + + this.start(); + return 0; + + } + + if ( this.running ) { + + const newTime = now(); + + diff = ( newTime - this.oldTime ) / 1000; + this.oldTime = newTime; + + this.elapsedTime += diff; + + } + + return diff; + + } + +} + +function now() { + + return ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732 + +} + +const _position$1 = /*@__PURE__*/ new Vector3(); +const _quaternion$1 = /*@__PURE__*/ new Quaternion(); +const _scale$1 = /*@__PURE__*/ new Vector3(); +const _orientation$1 = /*@__PURE__*/ new Vector3(); + +class AudioListener extends Object3D { + + constructor() { + + super(); + + this.type = 'AudioListener'; + + this.context = AudioContext.getContext(); + + this.gain = this.context.createGain(); + this.gain.connect( this.context.destination ); + + this.filter = null; + + this.timeDelta = 0; + + // private + + this._clock = new Clock(); + + } + + getInput() { + + return this.gain; + + } + + removeFilter() { + + if ( this.filter !== null ) { + + this.gain.disconnect( this.filter ); + this.filter.disconnect( this.context.destination ); + this.gain.connect( this.context.destination ); + this.filter = null; + + } + + return this; + + } + + getFilter() { + + return this.filter; + + } + + setFilter( value ) { + + if ( this.filter !== null ) { + + this.gain.disconnect( this.filter ); + this.filter.disconnect( this.context.destination ); + + } else { + + this.gain.disconnect( this.context.destination ); + + } + + this.filter = value; + this.gain.connect( this.filter ); + this.filter.connect( this.context.destination ); + + return this; + + } + + getMasterVolume() { + + return this.gain.gain.value; + + } + + setMasterVolume( value ) { + + this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); + + return this; + + } + + updateMatrixWorld( force ) { + + super.updateMatrixWorld( force ); + + const listener = this.context.listener; + const up = this.up; + + this.timeDelta = this._clock.getDelta(); + + this.matrixWorld.decompose( _position$1, _quaternion$1, _scale$1 ); + + _orientation$1.set( 0, 0, - 1 ).applyQuaternion( _quaternion$1 ); + + if ( listener.positionX ) { + + // code path for Chrome (see #14393) + + const endTime = this.context.currentTime + this.timeDelta; + + listener.positionX.linearRampToValueAtTime( _position$1.x, endTime ); + listener.positionY.linearRampToValueAtTime( _position$1.y, endTime ); + listener.positionZ.linearRampToValueAtTime( _position$1.z, endTime ); + listener.forwardX.linearRampToValueAtTime( _orientation$1.x, endTime ); + listener.forwardY.linearRampToValueAtTime( _orientation$1.y, endTime ); + listener.forwardZ.linearRampToValueAtTime( _orientation$1.z, endTime ); + listener.upX.linearRampToValueAtTime( up.x, endTime ); + listener.upY.linearRampToValueAtTime( up.y, endTime ); + listener.upZ.linearRampToValueAtTime( up.z, endTime ); + + } else { + + listener.setPosition( _position$1.x, _position$1.y, _position$1.z ); + listener.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z ); + + } + + } + +} + +class Audio extends Object3D { + + constructor( listener ) { + + super(); + + this.type = 'Audio'; + + this.listener = listener; + this.context = listener.context; + + this.gain = this.context.createGain(); + this.gain.connect( listener.getInput() ); + + this.autoplay = false; + + this.buffer = null; + this.detune = 0; + this.loop = false; + this.loopStart = 0; + this.loopEnd = 0; + this.offset = 0; + this.duration = undefined; + this.playbackRate = 1; + this.isPlaying = false; + this.hasPlaybackControl = true; + this.source = null; + this.sourceType = 'empty'; + + this._startedAt = 0; + this._progress = 0; + this._connected = false; + + this.filters = []; + + } + + getOutput() { + + return this.gain; + + } + + setNodeSource( audioNode ) { + + this.hasPlaybackControl = false; + this.sourceType = 'audioNode'; + this.source = audioNode; + this.connect(); + + return this; + + } + + setMediaElementSource( mediaElement ) { + + this.hasPlaybackControl = false; + this.sourceType = 'mediaNode'; + this.source = this.context.createMediaElementSource( mediaElement ); + this.connect(); + + return this; + + } + + setMediaStreamSource( mediaStream ) { + + this.hasPlaybackControl = false; + this.sourceType = 'mediaStreamNode'; + this.source = this.context.createMediaStreamSource( mediaStream ); + this.connect(); + + return this; + + } + + setBuffer( audioBuffer ) { + + this.buffer = audioBuffer; + this.sourceType = 'buffer'; + + if ( this.autoplay ) this.play(); + + return this; + + } + + play( delay = 0 ) { + + if ( this.isPlaying === true ) { + + console.warn( 'THREE.Audio: Audio is already playing.' ); + return; + + } + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this._startedAt = this.context.currentTime + delay; + + const source = this.context.createBufferSource(); + source.buffer = this.buffer; + source.loop = this.loop; + source.loopStart = this.loopStart; + source.loopEnd = this.loopEnd; + source.onended = this.onEnded.bind( this ); + source.start( this._startedAt, this._progress + this.offset, this.duration ); + + this.isPlaying = true; + + this.source = source; + + this.setDetune( this.detune ); + this.setPlaybackRate( this.playbackRate ); + + return this.connect(); + + } + + pause() { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + if ( this.isPlaying === true ) { + + // update current progress + + this._progress += Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate; + + if ( this.loop === true ) { + + // ensure _progress does not exceed duration with looped audios + + this._progress = this._progress % ( this.duration || this.buffer.duration ); + + } + + this.source.stop(); + this.source.onended = null; + + this.isPlaying = false; + + } + + return this; + + } + + stop() { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this._progress = 0; + + this.source.stop(); + this.source.onended = null; + this.isPlaying = false; + + return this; + + } + + connect() { + + if ( this.filters.length > 0 ) { + + this.source.connect( this.filters[ 0 ] ); + + for ( let i = 1, l = this.filters.length; i < l; i ++ ) { + + this.filters[ i - 1 ].connect( this.filters[ i ] ); + + } + + this.filters[ this.filters.length - 1 ].connect( this.getOutput() ); + + } else { + + this.source.connect( this.getOutput() ); + + } + + this._connected = true; + + return this; + + } + + disconnect() { + + if ( this.filters.length > 0 ) { + + this.source.disconnect( this.filters[ 0 ] ); + + for ( let i = 1, l = this.filters.length; i < l; i ++ ) { + + this.filters[ i - 1 ].disconnect( this.filters[ i ] ); + + } + + this.filters[ this.filters.length - 1 ].disconnect( this.getOutput() ); + + } else { + + this.source.disconnect( this.getOutput() ); + + } + + this._connected = false; + + return this; + + } + + getFilters() { + + return this.filters; + + } + + setFilters( value ) { + + if ( ! value ) value = []; + + if ( this._connected === true ) { + + this.disconnect(); + this.filters = value.slice(); + this.connect(); + + } else { + + this.filters = value.slice(); + + } + + return this; + + } + + setDetune( value ) { + + this.detune = value; + + if ( this.source.detune === undefined ) return; // only set detune when available + + if ( this.isPlaying === true ) { + + this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 ); + + } + + return this; + + } + + getDetune() { + + return this.detune; + + } + + getFilter() { + + return this.getFilters()[ 0 ]; + + } + + setFilter( filter ) { + + return this.setFilters( filter ? [ filter ] : [] ); + + } + + setPlaybackRate( value ) { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.playbackRate = value; + + if ( this.isPlaying === true ) { + + this.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 ); + + } + + return this; + + } + + getPlaybackRate() { + + return this.playbackRate; + + } + + onEnded() { + + this.isPlaying = false; + + } + + getLoop() { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return false; + + } + + return this.loop; + + } + + setLoop( value ) { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.loop = value; + + if ( this.isPlaying === true ) { + + this.source.loop = this.loop; + + } + + return this; + + } + + setLoopStart( value ) { + + this.loopStart = value; + + return this; + + } + + setLoopEnd( value ) { + + this.loopEnd = value; + + return this; + + } + + getVolume() { + + return this.gain.gain.value; + + } + + setVolume( value ) { + + this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); + + return this; + + } + +} + +const _position = /*@__PURE__*/ new Vector3(); +const _quaternion = /*@__PURE__*/ new Quaternion(); +const _scale = /*@__PURE__*/ new Vector3(); +const _orientation = /*@__PURE__*/ new Vector3(); + +class PositionalAudio extends Audio { + + constructor( listener ) { + + super( listener ); + + this.panner = this.context.createPanner(); + this.panner.panningModel = 'HRTF'; + this.panner.connect( this.gain ); + + } + + getOutput() { + + return this.panner; + + } + + getRefDistance() { + + return this.panner.refDistance; + + } + + setRefDistance( value ) { + + this.panner.refDistance = value; + + return this; + + } + + getRolloffFactor() { + + return this.panner.rolloffFactor; + + } + + setRolloffFactor( value ) { + + this.panner.rolloffFactor = value; + + return this; + + } + + getDistanceModel() { + + return this.panner.distanceModel; + + } + + setDistanceModel( value ) { + + this.panner.distanceModel = value; + + return this; + + } + + getMaxDistance() { + + return this.panner.maxDistance; + + } + + setMaxDistance( value ) { + + this.panner.maxDistance = value; + + return this; + + } + + setDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) { + + this.panner.coneInnerAngle = coneInnerAngle; + this.panner.coneOuterAngle = coneOuterAngle; + this.panner.coneOuterGain = coneOuterGain; + + return this; + + } + + updateMatrixWorld( force ) { + + super.updateMatrixWorld( force ); + + if ( this.hasPlaybackControl === true && this.isPlaying === false ) return; + + this.matrixWorld.decompose( _position, _quaternion, _scale ); + + _orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion ); + + const panner = this.panner; + + if ( panner.positionX ) { + + // code path for Chrome and Firefox (see #14393) + + const endTime = this.context.currentTime + this.listener.timeDelta; + + panner.positionX.linearRampToValueAtTime( _position.x, endTime ); + panner.positionY.linearRampToValueAtTime( _position.y, endTime ); + panner.positionZ.linearRampToValueAtTime( _position.z, endTime ); + panner.orientationX.linearRampToValueAtTime( _orientation.x, endTime ); + panner.orientationY.linearRampToValueAtTime( _orientation.y, endTime ); + panner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime ); + + } else { + + panner.setPosition( _position.x, _position.y, _position.z ); + panner.setOrientation( _orientation.x, _orientation.y, _orientation.z ); + + } + + } + +} + +class AudioAnalyser { + + constructor( audio, fftSize = 2048 ) { + + this.analyser = audio.context.createAnalyser(); + this.analyser.fftSize = fftSize; + + this.data = new Uint8Array( this.analyser.frequencyBinCount ); + + audio.getOutput().connect( this.analyser ); + + } + + + getFrequencyData() { + + this.analyser.getByteFrequencyData( this.data ); + + return this.data; + + } + + getAverageFrequency() { + + let value = 0; + const data = this.getFrequencyData(); + + for ( let i = 0; i < data.length; i ++ ) { + + value += data[ i ]; + + } + + return value / data.length; + + } + +} + +class PropertyMixer { + + constructor( binding, typeName, valueSize ) { + + this.binding = binding; + this.valueSize = valueSize; + + let mixFunction, + mixFunctionAdditive, + setIdentity; + + // buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ] + // + // interpolators can use .buffer as their .result + // the data then goes to 'incoming' + // + // 'accu0' and 'accu1' are used frame-interleaved for + // the cumulative result and are compared to detect + // changes + // + // 'orig' stores the original state of the property + // + // 'add' is used for additive cumulative results + // + // 'work' is optional and is only present for quaternion types. It is used + // to store intermediate quaternion multiplication results + + switch ( typeName ) { + + case 'quaternion': + mixFunction = this._slerp; + mixFunctionAdditive = this._slerpAdditive; + setIdentity = this._setAdditiveIdentityQuaternion; + + this.buffer = new Float64Array( valueSize * 6 ); + this._workIndex = 5; + break; + + case 'string': + case 'bool': + mixFunction = this._select; + + // Use the regular mix function and for additive on these types, + // additive is not relevant for non-numeric types + mixFunctionAdditive = this._select; + + setIdentity = this._setAdditiveIdentityOther; + + this.buffer = new Array( valueSize * 5 ); + break; + + default: + mixFunction = this._lerp; + mixFunctionAdditive = this._lerpAdditive; + setIdentity = this._setAdditiveIdentityNumeric; + + this.buffer = new Float64Array( valueSize * 5 ); + + } + + this._mixBufferRegion = mixFunction; + this._mixBufferRegionAdditive = mixFunctionAdditive; + this._setIdentity = setIdentity; + this._origIndex = 3; + this._addIndex = 4; + + this.cumulativeWeight = 0; + this.cumulativeWeightAdditive = 0; + + this.useCount = 0; + this.referenceCount = 0; + + } + + // accumulate data in the 'incoming' region into 'accu' + accumulate( accuIndex, weight ) { + + // note: happily accumulating nothing when weight = 0, the caller knows + // the weight and shouldn't have made the call in the first place + + const buffer = this.buffer, + stride = this.valueSize, + offset = accuIndex * stride + stride; + + let currentWeight = this.cumulativeWeight; + + if ( currentWeight === 0 ) { + + // accuN := incoming * weight + + for ( let i = 0; i !== stride; ++ i ) { + + buffer[ offset + i ] = buffer[ i ]; + + } + + currentWeight = weight; + + } else { + + // accuN := accuN + incoming * weight + + currentWeight += weight; + const mix = weight / currentWeight; + this._mixBufferRegion( buffer, offset, 0, mix, stride ); + + } + + this.cumulativeWeight = currentWeight; + + } + + // accumulate data in the 'incoming' region into 'add' + accumulateAdditive( weight ) { + + const buffer = this.buffer, + stride = this.valueSize, + offset = stride * this._addIndex; + + if ( this.cumulativeWeightAdditive === 0 ) { + + // add = identity + + this._setIdentity(); + + } + + // add := add + incoming * weight + + this._mixBufferRegionAdditive( buffer, offset, 0, weight, stride ); + this.cumulativeWeightAdditive += weight; + + } + + // apply the state of 'accu' to the binding when accus differ + apply( accuIndex ) { + + const stride = this.valueSize, + buffer = this.buffer, + offset = accuIndex * stride + stride, + + weight = this.cumulativeWeight, + weightAdditive = this.cumulativeWeightAdditive, + + binding = this.binding; + + this.cumulativeWeight = 0; + this.cumulativeWeightAdditive = 0; + + if ( weight < 1 ) { + + // accuN := accuN + original * ( 1 - cumulativeWeight ) + + const originalValueOffset = stride * this._origIndex; + + this._mixBufferRegion( + buffer, offset, originalValueOffset, 1 - weight, stride ); + + } + + if ( weightAdditive > 0 ) { + + // accuN := accuN + additive accuN + + this._mixBufferRegionAdditive( buffer, offset, this._addIndex * stride, 1, stride ); + + } + + for ( let i = stride, e = stride + stride; i !== e; ++ i ) { + + if ( buffer[ i ] !== buffer[ i + stride ] ) { + + // value has changed -> update scene graph + + binding.setValue( buffer, offset ); + break; + + } + + } + + } + + // remember the state of the bound property and copy it to both accus + saveOriginalState() { + + const binding = this.binding; + + const buffer = this.buffer, + stride = this.valueSize, + + originalValueOffset = stride * this._origIndex; + + binding.getValue( buffer, originalValueOffset ); + + // accu[0..1] := orig -- initially detect changes against the original + for ( let i = stride, e = originalValueOffset; i !== e; ++ i ) { + + buffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ]; + + } + + // Add to identity for additive + this._setIdentity(); + + this.cumulativeWeight = 0; + this.cumulativeWeightAdditive = 0; + + } + + // apply the state previously taken via 'saveOriginalState' to the binding + restoreOriginalState() { + + const originalValueOffset = this.valueSize * 3; + this.binding.setValue( this.buffer, originalValueOffset ); + + } + + _setAdditiveIdentityNumeric() { + + const startIndex = this._addIndex * this.valueSize; + const endIndex = startIndex + this.valueSize; + + for ( let i = startIndex; i < endIndex; i ++ ) { + + this.buffer[ i ] = 0; + + } + + } + + _setAdditiveIdentityQuaternion() { + + this._setAdditiveIdentityNumeric(); + this.buffer[ this._addIndex * this.valueSize + 3 ] = 1; + + } + + _setAdditiveIdentityOther() { + + const startIndex = this._origIndex * this.valueSize; + const targetIndex = this._addIndex * this.valueSize; + + for ( let i = 0; i < this.valueSize; i ++ ) { + + this.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ]; + + } + + } + + + // mix functions + + _select( buffer, dstOffset, srcOffset, t, stride ) { + + if ( t >= 0.5 ) { + + for ( let i = 0; i !== stride; ++ i ) { + + buffer[ dstOffset + i ] = buffer[ srcOffset + i ]; + + } + + } + + } + + _slerp( buffer, dstOffset, srcOffset, t ) { + + Quaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t ); + + } + + _slerpAdditive( buffer, dstOffset, srcOffset, t, stride ) { + + const workOffset = this._workIndex * stride; + + // Store result in intermediate buffer offset + Quaternion.multiplyQuaternionsFlat( buffer, workOffset, buffer, dstOffset, buffer, srcOffset ); + + // Slerp to the intermediate result + Quaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t ); + + } + + _lerp( buffer, dstOffset, srcOffset, t, stride ) { + + const s = 1 - t; + + for ( let i = 0; i !== stride; ++ i ) { + + const j = dstOffset + i; + + buffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t; + + } + + } + + _lerpAdditive( buffer, dstOffset, srcOffset, t, stride ) { + + for ( let i = 0; i !== stride; ++ i ) { + + const j = dstOffset + i; + + buffer[ j ] = buffer[ j ] + buffer[ srcOffset + i ] * t; + + } + + } + +} + +// Characters [].:/ are reserved for track binding syntax. +const _RESERVED_CHARS_RE = '\\[\\]\\.:\\/'; +const _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' ); + +// Attempts to allow node names from any language. ES5's `\w` regexp matches +// only latin characters, and the unicode \p{L} is not yet supported. So +// instead, we exclude reserved characters and match everything else. +const _wordChar = '[^' + _RESERVED_CHARS_RE + ']'; +const _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\.', '' ) + ']'; + +// Parent directories, delimited by '/' or ':'. Currently unused, but must +// be matched to parse the rest of the track name. +const _directoryRe = /((?:WC+[\/:])*)/.source.replace( 'WC', _wordChar ); + +// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. +const _nodeRe = /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot ); + +// Object on target node, and accessor. May not contain reserved +// characters. Accessor may contain any character except closing bracket. +const _objectRe = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', _wordChar ); + +// Property and accessor. May not contain reserved characters. Accessor may +// contain any non-bracket characters. +const _propertyRe = /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', _wordChar ); + +const _trackRe = new RegExp( '' + + '^' + + _directoryRe + + _nodeRe + + _objectRe + + _propertyRe + + '$' +); + +const _supportedObjectNames = [ 'material', 'materials', 'bones' ]; + +class Composite { + + constructor( targetGroup, path, optionalParsedPath ) { + + const parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path ); + + this._targetGroup = targetGroup; + this._bindings = targetGroup.subscribe_( path, parsedPath ); + + } + + getValue( array, offset ) { + + this.bind(); // bind all binding + + const firstValidIndex = this._targetGroup.nCachedObjects_, + binding = this._bindings[ firstValidIndex ]; + + // and only call .getValue on the first + if ( binding !== undefined ) binding.getValue( array, offset ); + + } + + setValue( array, offset ) { + + const bindings = this._bindings; + + for ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].setValue( array, offset ); + + } + + } + + bind() { + + const bindings = this._bindings; + + for ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].bind(); + + } + + } + + unbind() { + + const bindings = this._bindings; + + for ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].unbind(); + + } + + } + +} + +// Note: This class uses a State pattern on a per-method basis: +// 'bind' sets 'this.getValue' / 'setValue' and shadows the +// prototype version of these methods with one that represents +// the bound state. When the property is not found, the methods +// become no-ops. +class PropertyBinding { + + constructor( rootNode, path, parsedPath ) { + + this.path = path; + this.parsedPath = parsedPath || PropertyBinding.parseTrackName( path ); + + this.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName ) || rootNode; + + this.rootNode = rootNode; + + // initial state of these methods that calls 'bind' + this.getValue = this._getValue_unbound; + this.setValue = this._setValue_unbound; + + } + + + static create( root, path, parsedPath ) { + + if ( ! ( root && root.isAnimationObjectGroup ) ) { + + return new PropertyBinding( root, path, parsedPath ); + + } else { + + return new PropertyBinding.Composite( root, path, parsedPath ); + + } + + } + + /** + * Replaces spaces with underscores and removes unsupported characters from + * node names, to ensure compatibility with parseTrackName(). + * + * @param {string} name Node name to be sanitized. + * @return {string} + */ + static sanitizeNodeName( name ) { + + return name.replace( /\s/g, '_' ).replace( _reservedRe, '' ); + + } + + static parseTrackName( trackName ) { + + const matches = _trackRe.exec( trackName ); + + if ( ! matches ) { + + throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); + + } + + const results = { + // directoryName: matches[ 1 ], // (tschw) currently unused + nodeName: matches[ 2 ], + objectName: matches[ 3 ], + objectIndex: matches[ 4 ], + propertyName: matches[ 5 ], // required + propertyIndex: matches[ 6 ] + }; + + const lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); + + if ( lastDot !== undefined && lastDot !== - 1 ) { + + const objectName = results.nodeName.substring( lastDot + 1 ); + + // Object names must be checked against an allowlist. Otherwise, there + // is no way to parse 'foo.bar.baz': 'baz' must be a property, but + // 'bar' could be the objectName, or part of a nodeName (which can + // include '.' characters). + if ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) { + + results.nodeName = results.nodeName.substring( 0, lastDot ); + results.objectName = objectName; + + } + + } + + if ( results.propertyName === null || results.propertyName.length === 0 ) { + + throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); + + } + + return results; + + } + + static findNode( root, nodeName ) { + + if ( ! nodeName || nodeName === '' || nodeName === '.' || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) { + + return root; + + } + + // search into skeleton bones. + if ( root.skeleton ) { + + const bone = root.skeleton.getBoneByName( nodeName ); + + if ( bone !== undefined ) { + + return bone; + + } + + } + + // search into node subtree. + if ( root.children ) { + + const searchNodeSubtree = function ( children ) { + + for ( let i = 0; i < children.length; i ++ ) { + + const childNode = children[ i ]; + + if ( childNode.name === nodeName || childNode.uuid === nodeName ) { + + return childNode; + + } + + const result = searchNodeSubtree( childNode.children ); + + if ( result ) return result; + + } + + return null; + + }; + + const subTreeNode = searchNodeSubtree( root.children ); + + if ( subTreeNode ) { + + return subTreeNode; + + } + + } + + return null; + + } + + // these are used to "bind" a nonexistent property + _getValue_unavailable() {} + _setValue_unavailable() {} + + // Getters + + _getValue_direct( buffer, offset ) { + + buffer[ offset ] = this.targetObject[ this.propertyName ]; + + } + + _getValue_array( buffer, offset ) { + + const source = this.resolvedProperty; + + for ( let i = 0, n = source.length; i !== n; ++ i ) { + + buffer[ offset ++ ] = source[ i ]; + + } + + } + + _getValue_arrayElement( buffer, offset ) { + + buffer[ offset ] = this.resolvedProperty[ this.propertyIndex ]; + + } + + _getValue_toArray( buffer, offset ) { + + this.resolvedProperty.toArray( buffer, offset ); + + } + + // Direct + + _setValue_direct( buffer, offset ) { + + this.targetObject[ this.propertyName ] = buffer[ offset ]; + + } + + _setValue_direct_setNeedsUpdate( buffer, offset ) { + + this.targetObject[ this.propertyName ] = buffer[ offset ]; + this.targetObject.needsUpdate = true; + + } + + _setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.targetObject[ this.propertyName ] = buffer[ offset ]; + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + // EntireArray + + _setValue_array( buffer, offset ) { + + const dest = this.resolvedProperty; + + for ( let i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + } + + _setValue_array_setNeedsUpdate( buffer, offset ) { + + const dest = this.resolvedProperty; + + for ( let i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + this.targetObject.needsUpdate = true; + + } + + _setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) { + + const dest = this.resolvedProperty; + + for ( let i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + // ArrayElement + + _setValue_arrayElement( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + + } + + _setValue_arrayElement_setNeedsUpdate( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + this.targetObject.needsUpdate = true; + + } + + _setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + // HasToFromArray + + _setValue_fromArray( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + + } + + _setValue_fromArray_setNeedsUpdate( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + this.targetObject.needsUpdate = true; + + } + + _setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + _getValue_unbound( targetArray, offset ) { + + this.bind(); + this.getValue( targetArray, offset ); + + } + + _setValue_unbound( sourceArray, offset ) { + + this.bind(); + this.setValue( sourceArray, offset ); + + } + + // create getter / setter pair for a property in the scene graph + bind() { + + let targetObject = this.node; + const parsedPath = this.parsedPath; + + const objectName = parsedPath.objectName; + const propertyName = parsedPath.propertyName; + let propertyIndex = parsedPath.propertyIndex; + + if ( ! targetObject ) { + + targetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName ) || this.rootNode; + + this.node = targetObject; + + } + + // set fail state so we can just 'return' on error + this.getValue = this._getValue_unavailable; + this.setValue = this._setValue_unavailable; + + // ensure there is a value node + if ( ! targetObject ) { + + console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\'t found.' ); + return; + + } + + if ( objectName ) { + + let objectIndex = parsedPath.objectIndex; + + // special cases were we need to reach deeper into the hierarchy to get the face materials.... + switch ( objectName ) { + + case 'materials': + + if ( ! targetObject.material ) { + + console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this ); + return; + + } + + if ( ! targetObject.material.materials ) { + + console.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this ); + return; + + } + + targetObject = targetObject.material.materials; + + break; + + case 'bones': + + if ( ! targetObject.skeleton ) { + + console.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this ); + return; + + } + + // potential future optimization: skip this if propertyIndex is already an integer + // and convert the integer string to a true integer. + + targetObject = targetObject.skeleton.bones; + + // support resolving morphTarget names into indices. + for ( let i = 0; i < targetObject.length; i ++ ) { + + if ( targetObject[ i ].name === objectIndex ) { + + objectIndex = i; + break; + + } + + } + + break; + + default: + + if ( targetObject[ objectName ] === undefined ) { + + console.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this ); + return; + + } + + targetObject = targetObject[ objectName ]; + + } + + + if ( objectIndex !== undefined ) { + + if ( targetObject[ objectIndex ] === undefined ) { + + console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject ); + return; + + } + + targetObject = targetObject[ objectIndex ]; + + } + + } + + // resolve property + const nodeProperty = targetObject[ propertyName ]; + + if ( nodeProperty === undefined ) { + + const nodeName = parsedPath.nodeName; + + console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName + + '.' + propertyName + ' but it wasn\'t found.', targetObject ); + return; + + } + + // determine versioning scheme + let versioning = this.Versioning.None; + + this.targetObject = targetObject; + + if ( targetObject.needsUpdate !== undefined ) { // material + + versioning = this.Versioning.NeedsUpdate; + + } else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform + + versioning = this.Versioning.MatrixWorldNeedsUpdate; + + } + + // determine how the property gets bound + let bindingType = this.BindingType.Direct; + + if ( propertyIndex !== undefined ) { + + // access a sub element of the property array (only primitives are supported right now) + + if ( propertyName === 'morphTargetInfluences' ) { + + // potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer. + + // support resolving morphTarget names into indices. + if ( ! targetObject.geometry ) { + + console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this ); + return; + + } + + if ( targetObject.geometry.isBufferGeometry ) { + + if ( ! targetObject.geometry.morphAttributes ) { + + console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this ); + return; + + } + + if ( targetObject.morphTargetDictionary[ propertyIndex ] !== undefined ) { + + propertyIndex = targetObject.morphTargetDictionary[ propertyIndex ]; + + } + + + } else { + + console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.', this ); + return; + + } + + } + + bindingType = this.BindingType.ArrayElement; + + this.resolvedProperty = nodeProperty; + this.propertyIndex = propertyIndex; + + } else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) { + + // must use copy for Object3D.Euler/Quaternion + + bindingType = this.BindingType.HasFromToArray; + + this.resolvedProperty = nodeProperty; + + } else if ( Array.isArray( nodeProperty ) ) { + + bindingType = this.BindingType.EntireArray; + + this.resolvedProperty = nodeProperty; + + } else { + + this.propertyName = propertyName; + + } + + // select getter / setter + this.getValue = this.GetterByBindingType[ bindingType ]; + this.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ]; + + } + + unbind() { + + this.node = null; + + // back to the prototype version of getValue / setValue + // note: avoiding to mutate the shape of 'this' via 'delete' + this.getValue = this._getValue_unbound; + this.setValue = this._setValue_unbound; + + } + +} + +PropertyBinding.Composite = Composite; + +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 = [ + + [ + // Direct + PropertyBinding.prototype._setValue_direct, + PropertyBinding.prototype._setValue_direct_setNeedsUpdate, + PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate, + + ], [ + + // EntireArray + + PropertyBinding.prototype._setValue_array, + PropertyBinding.prototype._setValue_array_setNeedsUpdate, + PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate, + + ], [ + + // ArrayElement + PropertyBinding.prototype._setValue_arrayElement, + PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate, + PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate, + + ], [ + + // HasToFromArray + PropertyBinding.prototype._setValue_fromArray, + PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate, + PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate, + + ] + +]; + +/** + * + * A group of objects that receives a shared animation state. + * + * Usage: + * + * - Add objects you would otherwise pass as 'root' to the + * constructor or the .clipAction method of AnimationMixer. + * + * - Instead pass this object as 'root'. + * + * - You can also add and remove objects later when the mixer + * is running. + * + * Note: + * + * Objects of this class appear as one object to the mixer, + * so cache control of the individual objects must be done + * on the group. + * + * Limitation: + * + * - The animated properties must be compatible among the + * all objects in the group. + * + * - A single property can either be controlled through a + * target group or directly, but not both. + */ + +class AnimationObjectGroup { + + constructor() { + + this.uuid = generateUUID(); + + // cached objects followed by the active ones + this._objects = Array.prototype.slice.call( arguments ); + + this.nCachedObjects_ = 0; // threshold + // note: read by PropertyBinding.Composite + + const indices = {}; + this._indicesByUUID = indices; // for bookkeeping + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + indices[ arguments[ i ].uuid ] = i; + + } + + this._paths = []; // inside: string + this._parsedPaths = []; // inside: { we don't care, here } + this._bindings = []; // inside: Array< PropertyBinding > + this._bindingsIndicesByPath = {}; // inside: indices in these arrays + + const scope = this; + + this.stats = { + + objects: { + get total() { + + return scope._objects.length; + + }, + get inUse() { + + return this.total - scope.nCachedObjects_; + + } + }, + get bindingsPerObject() { + + return scope._bindings.length; + + } + + }; + + } + + add() { + + const objects = this._objects, + indicesByUUID = this._indicesByUUID, + paths = this._paths, + parsedPaths = this._parsedPaths, + bindings = this._bindings, + nBindings = bindings.length; + + let knownObject = undefined, + nObjects = objects.length, + nCachedObjects = this.nCachedObjects_; + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + const object = arguments[ i ], + uuid = object.uuid; + let index = indicesByUUID[ uuid ]; + + if ( index === undefined ) { + + // unknown object -> add it to the ACTIVE region + + index = nObjects ++; + indicesByUUID[ uuid ] = index; + objects.push( object ); + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + bindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) ); + + } + + } else if ( index < nCachedObjects ) { + + knownObject = objects[ index ]; + + // move existing object to the ACTIVE region + + const firstActiveIndex = -- nCachedObjects, + lastCachedObject = objects[ firstActiveIndex ]; + + indicesByUUID[ lastCachedObject.uuid ] = index; + objects[ index ] = lastCachedObject; + + indicesByUUID[ uuid ] = firstActiveIndex; + objects[ firstActiveIndex ] = object; + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ], + lastCached = bindingsForPath[ firstActiveIndex ]; + + let binding = bindingsForPath[ index ]; + + bindingsForPath[ index ] = lastCached; + + if ( binding === undefined ) { + + // since we do not bother to create new bindings + // for objects that are cached, the binding may + // or may not exist + + binding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ); + + } + + bindingsForPath[ firstActiveIndex ] = binding; + + } + + } else if ( objects[ index ] !== knownObject ) { + + console.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' + + 'detected. Clean the caches or recreate your infrastructure when reloading scenes.' ); + + } // else the object is already where we want it to be + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + } + + remove() { + + const objects = this._objects, + indicesByUUID = this._indicesByUUID, + bindings = this._bindings, + nBindings = bindings.length; + + let nCachedObjects = this.nCachedObjects_; + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + const object = arguments[ i ], + uuid = object.uuid, + index = indicesByUUID[ uuid ]; + + if ( index !== undefined && index >= nCachedObjects ) { + + // move existing object into the CACHED region + + const lastCachedIndex = nCachedObjects ++, + firstActiveObject = objects[ lastCachedIndex ]; + + indicesByUUID[ firstActiveObject.uuid ] = index; + objects[ index ] = firstActiveObject; + + indicesByUUID[ uuid ] = lastCachedIndex; + objects[ lastCachedIndex ] = object; + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ], + firstActive = bindingsForPath[ lastCachedIndex ], + binding = bindingsForPath[ index ]; + + bindingsForPath[ index ] = firstActive; + bindingsForPath[ lastCachedIndex ] = binding; + + } + + } + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + } + + // remove & forget + uncache() { + + const objects = this._objects, + indicesByUUID = this._indicesByUUID, + bindings = this._bindings, + nBindings = bindings.length; + + let nCachedObjects = this.nCachedObjects_, + nObjects = objects.length; + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + const object = arguments[ i ], + uuid = object.uuid, + index = indicesByUUID[ uuid ]; + + if ( index !== undefined ) { + + delete indicesByUUID[ uuid ]; + + if ( index < nCachedObjects ) { + + // object is cached, shrink the CACHED region + + const firstActiveIndex = -- nCachedObjects, + lastCachedObject = objects[ firstActiveIndex ], + lastIndex = -- nObjects, + lastObject = objects[ lastIndex ]; + + // last cached object takes this object's place + indicesByUUID[ lastCachedObject.uuid ] = index; + objects[ index ] = lastCachedObject; + + // last object goes to the activated slot and pop + indicesByUUID[ lastObject.uuid ] = firstActiveIndex; + objects[ firstActiveIndex ] = lastObject; + objects.pop(); + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ], + lastCached = bindingsForPath[ firstActiveIndex ], + last = bindingsForPath[ lastIndex ]; + + bindingsForPath[ index ] = lastCached; + bindingsForPath[ firstActiveIndex ] = last; + bindingsForPath.pop(); + + } + + } else { + + // object is active, just swap with the last and pop + + const lastIndex = -- nObjects, + lastObject = objects[ lastIndex ]; + + if ( lastIndex > 0 ) { + + indicesByUUID[ lastObject.uuid ] = index; + + } + + objects[ index ] = lastObject; + objects.pop(); + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ]; + + bindingsForPath[ index ] = bindingsForPath[ lastIndex ]; + bindingsForPath.pop(); + + } + + } // cached or active + + } // if object is known + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + } + + // Internal interface used by befriended PropertyBinding.Composite: + + subscribe_( path, parsedPath ) { + + // returns an array of bindings for the given path that is changed + // according to the contained objects in the group + + const indicesByPath = this._bindingsIndicesByPath; + let index = indicesByPath[ path ]; + const bindings = this._bindings; + + if ( index !== undefined ) return bindings[ index ]; + + const paths = this._paths, + parsedPaths = this._parsedPaths, + objects = this._objects, + nObjects = objects.length, + nCachedObjects = this.nCachedObjects_, + bindingsForPath = new Array( nObjects ); + + index = bindings.length; + + indicesByPath[ path ] = index; + + paths.push( path ); + parsedPaths.push( parsedPath ); + bindings.push( bindingsForPath ); + + for ( let i = nCachedObjects, n = objects.length; i !== n; ++ i ) { + + const object = objects[ i ]; + bindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath ); + + } + + return bindingsForPath; + + } + + unsubscribe_( path ) { + + // tells the group to forget about a property path and no longer + // update the array previously obtained with 'subscribe_' + + const indicesByPath = this._bindingsIndicesByPath, + index = indicesByPath[ path ]; + + if ( index !== undefined ) { + + const paths = this._paths, + parsedPaths = this._parsedPaths, + bindings = this._bindings, + lastBindingsIndex = bindings.length - 1, + lastBindings = bindings[ lastBindingsIndex ], + lastBindingsPath = path[ lastBindingsIndex ]; + + indicesByPath[ lastBindingsPath ] = index; + + bindings[ index ] = lastBindings; + bindings.pop(); + + parsedPaths[ index ] = parsedPaths[ lastBindingsIndex ]; + parsedPaths.pop(); + + paths[ index ] = paths[ lastBindingsIndex ]; + paths.pop(); + + } + + } + +} + +AnimationObjectGroup.prototype.isAnimationObjectGroup = true; + +class AnimationAction { + + constructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) { + + this._mixer = mixer; + this._clip = clip; + this._localRoot = localRoot; + this.blendMode = blendMode; + + const tracks = clip.tracks, + nTracks = tracks.length, + interpolants = new Array( nTracks ); + + const interpolantSettings = { + endingStart: ZeroCurvatureEnding, + endingEnd: ZeroCurvatureEnding + }; + + for ( let i = 0; i !== nTracks; ++ i ) { + + const interpolant = tracks[ i ].createInterpolant( null ); + interpolants[ i ] = interpolant; + interpolant.settings = interpolantSettings; + + } + + this._interpolantSettings = interpolantSettings; + + this._interpolants = interpolants; // bound by the mixer + + // inside: PropertyMixer (managed by the mixer) + this._propertyBindings = new Array( nTracks ); + + this._cacheIndex = null; // for the memory manager + this._byClipCacheIndex = null; // for the memory manager + + this._timeScaleInterpolant = null; + this._weightInterpolant = null; + + this.loop = LoopRepeat; + this._loopCount = - 1; + + // global mixer time when the action is to be started + // it's set back to 'null' upon start of the action + this._startTime = null; + + // scaled local time of the action + // gets clamped or wrapped to 0..clip.duration according to loop + this.time = 0; + + this.timeScale = 1; + this._effectiveTimeScale = 1; + + this.weight = 1; + this._effectiveWeight = 1; + + this.repetitions = Infinity; // no. of repetitions when looping + + this.paused = false; // true -> zero effective time scale + this.enabled = true; // false -> zero effective weight + + this.clampWhenFinished = false;// keep feeding the last frame? + + this.zeroSlopeAtStart = true;// for smooth interpolation w/o separate + this.zeroSlopeAtEnd = true;// clips for start, loop and end + + } + + // State & Scheduling + + play() { + + this._mixer._activateAction( this ); + + return this; + + } + + stop() { + + this._mixer._deactivateAction( this ); + + return this.reset(); + + } + + reset() { + + this.paused = false; + this.enabled = true; + + this.time = 0; // restart clip + this._loopCount = - 1;// forget previous loops + this._startTime = null;// forget scheduling + + return this.stopFading().stopWarping(); + + } + + isRunning() { + + return this.enabled && ! this.paused && this.timeScale !== 0 && + this._startTime === null && this._mixer._isActiveAction( this ); + + } + + // return true when play has been called + isScheduled() { + + return this._mixer._isActiveAction( this ); + + } + + startAt( time ) { + + this._startTime = time; + + return this; + + } + + setLoop( mode, repetitions ) { + + this.loop = mode; + this.repetitions = repetitions; + + return this; + + } + + // Weight + + // set the weight stopping any scheduled fading + // although .enabled = false yields an effective weight of zero, this + // method does *not* change .enabled, because it would be confusing + setEffectiveWeight( weight ) { + + this.weight = weight; + + // note: same logic as when updated at runtime + this._effectiveWeight = this.enabled ? weight : 0; + + return this.stopFading(); + + } + + // return the weight considering fading and .enabled + getEffectiveWeight() { + + return this._effectiveWeight; + + } + + fadeIn( duration ) { + + return this._scheduleFading( duration, 0, 1 ); + + } + + fadeOut( duration ) { + + return this._scheduleFading( duration, 1, 0 ); + + } + + crossFadeFrom( fadeOutAction, duration, warp ) { + + fadeOutAction.fadeOut( duration ); + this.fadeIn( duration ); + + if ( warp ) { + + const fadeInDuration = this._clip.duration, + fadeOutDuration = fadeOutAction._clip.duration, + + startEndRatio = fadeOutDuration / fadeInDuration, + endStartRatio = fadeInDuration / fadeOutDuration; + + fadeOutAction.warp( 1.0, startEndRatio, duration ); + this.warp( endStartRatio, 1.0, duration ); + + } + + return this; + + } + + crossFadeTo( fadeInAction, duration, warp ) { + + return fadeInAction.crossFadeFrom( this, duration, warp ); + + } + + stopFading() { + + const weightInterpolant = this._weightInterpolant; + + if ( weightInterpolant !== null ) { + + this._weightInterpolant = null; + this._mixer._takeBackControlInterpolant( weightInterpolant ); + + } + + return this; + + } + + // Time Scale Control + + // set the time scale stopping any scheduled warping + // although .paused = true yields an effective time scale of zero, this + // method does *not* change .paused, because it would be confusing + setEffectiveTimeScale( timeScale ) { + + this.timeScale = timeScale; + this._effectiveTimeScale = this.paused ? 0 : timeScale; + + return this.stopWarping(); + + } + + // return the time scale considering warping and .paused + getEffectiveTimeScale() { + + return this._effectiveTimeScale; + + } + + setDuration( duration ) { + + this.timeScale = this._clip.duration / duration; + + return this.stopWarping(); + + } + + syncWith( action ) { + + this.time = action.time; + this.timeScale = action.timeScale; + + return this.stopWarping(); + + } + + halt( duration ) { + + return this.warp( this._effectiveTimeScale, 0, duration ); + + } + + warp( startTimeScale, endTimeScale, duration ) { + + const mixer = this._mixer, + now = mixer.time, + timeScale = this.timeScale; + + let interpolant = this._timeScaleInterpolant; + + if ( interpolant === null ) { + + interpolant = mixer._lendControlInterpolant(); + this._timeScaleInterpolant = interpolant; + + } + + const times = interpolant.parameterPositions, + values = interpolant.sampleValues; + + times[ 0 ] = now; + times[ 1 ] = now + duration; + + values[ 0 ] = startTimeScale / timeScale; + values[ 1 ] = endTimeScale / timeScale; + + return this; + + } + + stopWarping() { + + const timeScaleInterpolant = this._timeScaleInterpolant; + + if ( timeScaleInterpolant !== null ) { + + this._timeScaleInterpolant = null; + this._mixer._takeBackControlInterpolant( timeScaleInterpolant ); + + } + + return this; + + } + + // Object Accessors + + getMixer() { + + return this._mixer; + + } + + getClip() { + + return this._clip; + + } + + getRoot() { + + return this._localRoot || this._mixer._root; + + } + + // Interna + + _update( time, deltaTime, timeDirection, accuIndex ) { + + // called by the mixer + + if ( ! this.enabled ) { + + // call ._updateWeight() to update ._effectiveWeight + + this._updateWeight( time ); + return; + + } + + const startTime = this._startTime; + + if ( startTime !== null ) { + + // check for scheduled start of action + + const timeRunning = ( time - startTime ) * timeDirection; + if ( timeRunning < 0 || timeDirection === 0 ) { + + return; // yet to come / don't decide when delta = 0 + + } + + // start + + this._startTime = null; // unschedule + deltaTime = timeDirection * timeRunning; + + } + + // apply time scale and advance time + + deltaTime *= this._updateTimeScale( time ); + const clipTime = this._updateTime( deltaTime ); + + // note: _updateTime may disable the action resulting in + // an effective weight of 0 + + const weight = this._updateWeight( time ); + + if ( weight > 0 ) { + + const interpolants = this._interpolants; + const propertyMixers = this._propertyBindings; + + switch ( this.blendMode ) { + + case AdditiveAnimationBlendMode: + + for ( let j = 0, m = interpolants.length; j !== m; ++ j ) { + + interpolants[ j ].evaluate( clipTime ); + propertyMixers[ j ].accumulateAdditive( weight ); + + } + + break; + + case NormalAnimationBlendMode: + default: + + for ( let j = 0, m = interpolants.length; j !== m; ++ j ) { + + interpolants[ j ].evaluate( clipTime ); + propertyMixers[ j ].accumulate( accuIndex, weight ); + + } + + } + + } + + } + + _updateWeight( time ) { + + let weight = 0; + + if ( this.enabled ) { + + weight = this.weight; + const interpolant = this._weightInterpolant; + + if ( interpolant !== null ) { + + const interpolantValue = interpolant.evaluate( time )[ 0 ]; + + weight *= interpolantValue; + + if ( time > interpolant.parameterPositions[ 1 ] ) { + + this.stopFading(); + + if ( interpolantValue === 0 ) { + + // faded out, disable + this.enabled = false; + + } + + } + + } + + } + + this._effectiveWeight = weight; + return weight; + + } + + _updateTimeScale( time ) { + + let timeScale = 0; + + if ( ! this.paused ) { + + timeScale = this.timeScale; + + const interpolant = this._timeScaleInterpolant; + + if ( interpolant !== null ) { + + const interpolantValue = interpolant.evaluate( time )[ 0 ]; + + timeScale *= interpolantValue; + + if ( time > interpolant.parameterPositions[ 1 ] ) { + + this.stopWarping(); + + if ( timeScale === 0 ) { + + // motion has halted, pause + this.paused = true; + + } else { + + // warp done - apply final time scale + this.timeScale = timeScale; + + } + + } + + } + + } + + this._effectiveTimeScale = timeScale; + return timeScale; + + } + + _updateTime( deltaTime ) { + + const duration = this._clip.duration; + const loop = this.loop; + + let time = this.time + deltaTime; + let loopCount = this._loopCount; + + const pingPong = ( loop === LoopPingPong ); + + if ( deltaTime === 0 ) { + + if ( loopCount === - 1 ) return time; + + return ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time; + + } + + if ( loop === LoopOnce ) { + + if ( loopCount === - 1 ) { + + // just started + + this._loopCount = 0; + this._setEndings( true, true, false ); + + } + + handle_stop: { + + if ( time >= duration ) { + + time = duration; + + } else if ( time < 0 ) { + + time = 0; + + } else { + + this.time = time; + + break handle_stop; + + } + + if ( this.clampWhenFinished ) this.paused = true; + else this.enabled = false; + + this.time = time; + + this._mixer.dispatchEvent( { + type: 'finished', action: this, + direction: deltaTime < 0 ? - 1 : 1 + } ); + + } + + } else { // repetitive Repeat or PingPong + + if ( loopCount === - 1 ) { + + // just started + + if ( deltaTime >= 0 ) { + + loopCount = 0; + + this._setEndings( true, this.repetitions === 0, pingPong ); + + } else { + + // when looping in reverse direction, the initial + // transition through zero counts as a repetition, + // so leave loopCount at -1 + + this._setEndings( this.repetitions === 0, true, pingPong ); + + } + + } + + if ( time >= duration || time < 0 ) { + + // wrap around + + const loopDelta = Math.floor( time / duration ); // signed + time -= duration * loopDelta; + + loopCount += Math.abs( loopDelta ); + + const pending = this.repetitions - loopCount; + + if ( pending <= 0 ) { + + // have to stop (switch state, clamp time, fire event) + + if ( this.clampWhenFinished ) this.paused = true; + else this.enabled = false; + + time = deltaTime > 0 ? duration : 0; + + this.time = time; + + this._mixer.dispatchEvent( { + type: 'finished', action: this, + direction: deltaTime > 0 ? 1 : - 1 + } ); + + } else { + + // keep running + + if ( pending === 1 ) { + + // entering the last round + + const atStart = deltaTime < 0; + this._setEndings( atStart, ! atStart, pingPong ); + + } else { + + this._setEndings( false, false, pingPong ); + + } + + this._loopCount = loopCount; + + this.time = time; + + this._mixer.dispatchEvent( { + type: 'loop', action: this, loopDelta: loopDelta + } ); + + } + + } else { + + this.time = time; + + } + + if ( pingPong && ( loopCount & 1 ) === 1 ) { + + // invert time for the "pong round" + + return duration - time; + + } + + } + + return time; + + } + + _setEndings( atStart, atEnd, pingPong ) { + + const settings = this._interpolantSettings; + + if ( pingPong ) { + + settings.endingStart = ZeroSlopeEnding; + settings.endingEnd = ZeroSlopeEnding; + + } else { + + // assuming for LoopOnce atStart == atEnd == true + + if ( atStart ) { + + settings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding; + + } else { + + settings.endingStart = WrapAroundEnding; + + } + + if ( atEnd ) { + + settings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding; + + } else { + + settings.endingEnd = WrapAroundEnding; + + } + + } + + } + + _scheduleFading( duration, weightNow, weightThen ) { + + const mixer = this._mixer, now = mixer.time; + let interpolant = this._weightInterpolant; + + if ( interpolant === null ) { + + interpolant = mixer._lendControlInterpolant(); + this._weightInterpolant = interpolant; + + } + + const times = interpolant.parameterPositions, + values = interpolant.sampleValues; + + times[ 0 ] = now; + values[ 0 ] = weightNow; + times[ 1 ] = now + duration; + values[ 1 ] = weightThen; + + return this; + + } + +} + +class AnimationMixer extends EventDispatcher { + + constructor( root ) { + + super(); + + this._root = root; + this._initMemoryManager(); + this._accuIndex = 0; + this.time = 0; + this.timeScale = 1.0; + + } + + _bindAction( action, prototypeAction ) { + + const root = action._localRoot || this._root, + tracks = action._clip.tracks, + nTracks = tracks.length, + bindings = action._propertyBindings, + interpolants = action._interpolants, + rootUuid = root.uuid, + bindingsByRoot = this._bindingsByRootAndName; + + let bindingsByName = bindingsByRoot[ rootUuid ]; + + if ( bindingsByName === undefined ) { + + bindingsByName = {}; + bindingsByRoot[ rootUuid ] = bindingsByName; + + } + + for ( let i = 0; i !== nTracks; ++ i ) { + + const track = tracks[ i ], + trackName = track.name; + + let binding = bindingsByName[ trackName ]; + + if ( binding !== undefined ) { + + ++ binding.referenceCount; + bindings[ i ] = binding; + + } else { + + binding = bindings[ i ]; + + if ( binding !== undefined ) { + + // existing binding, make sure the cache knows + + if ( binding._cacheIndex === null ) { + + ++ binding.referenceCount; + this._addInactiveBinding( binding, rootUuid, trackName ); + + } + + continue; + + } + + const path = prototypeAction && prototypeAction. + _propertyBindings[ i ].binding.parsedPath; + + binding = new PropertyMixer( + PropertyBinding.create( root, trackName, path ), + track.ValueTypeName, track.getValueSize() ); + + ++ binding.referenceCount; + this._addInactiveBinding( binding, rootUuid, trackName ); + + bindings[ i ] = binding; + + } + + interpolants[ i ].resultBuffer = binding.buffer; + + } + + } + + _activateAction( action ) { + + if ( ! this._isActiveAction( action ) ) { + + if ( action._cacheIndex === null ) { + + // this action has been forgotten by the cache, but the user + // appears to be still using it -> rebind + + const rootUuid = ( action._localRoot || this._root ).uuid, + clipUuid = action._clip.uuid, + actionsForClip = this._actionsByClip[ clipUuid ]; + + this._bindAction( action, + actionsForClip && actionsForClip.knownActions[ 0 ] ); + + this._addInactiveAction( action, clipUuid, rootUuid ); + + } + + const bindings = action._propertyBindings; + + // increment reference counts / sort out state + for ( let i = 0, n = bindings.length; i !== n; ++ i ) { + + const binding = bindings[ i ]; + + if ( binding.useCount ++ === 0 ) { + + this._lendBinding( binding ); + binding.saveOriginalState(); + + } + + } + + this._lendAction( action ); + + } + + } + + _deactivateAction( action ) { + + if ( this._isActiveAction( action ) ) { + + const bindings = action._propertyBindings; + + // decrement reference counts / sort out state + for ( let i = 0, n = bindings.length; i !== n; ++ i ) { + + const binding = bindings[ i ]; + + if ( -- binding.useCount === 0 ) { + + binding.restoreOriginalState(); + this._takeBackBinding( binding ); + + } + + } + + this._takeBackAction( action ); + + } + + } + + // Memory manager + + _initMemoryManager() { + + this._actions = []; // 'nActiveActions' followed by inactive ones + this._nActiveActions = 0; + + this._actionsByClip = {}; + // inside: + // { + // knownActions: Array< AnimationAction > - used as prototypes + // actionByRoot: AnimationAction - lookup + // } + + + this._bindings = []; // 'nActiveBindings' followed by inactive ones + this._nActiveBindings = 0; + + this._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer > + + + this._controlInterpolants = []; // same game as above + this._nActiveControlInterpolants = 0; + + const scope = this; + + this.stats = { + + actions: { + get total() { + + return scope._actions.length; + + }, + get inUse() { + + return scope._nActiveActions; + + } + }, + bindings: { + get total() { + + return scope._bindings.length; + + }, + get inUse() { + + return scope._nActiveBindings; + + } + }, + controlInterpolants: { + get total() { + + return scope._controlInterpolants.length; + + }, + get inUse() { + + return scope._nActiveControlInterpolants; + + } + } + + }; + + } + + // Memory management for AnimationAction objects + + _isActiveAction( action ) { + + const index = action._cacheIndex; + return index !== null && index < this._nActiveActions; + + } + + _addInactiveAction( action, clipUuid, rootUuid ) { + + const actions = this._actions, + actionsByClip = this._actionsByClip; + + let actionsForClip = actionsByClip[ clipUuid ]; + + if ( actionsForClip === undefined ) { + + actionsForClip = { + + knownActions: [ action ], + actionByRoot: {} + + }; + + action._byClipCacheIndex = 0; + + actionsByClip[ clipUuid ] = actionsForClip; + + } else { + + const knownActions = actionsForClip.knownActions; + + action._byClipCacheIndex = knownActions.length; + knownActions.push( action ); + + } + + action._cacheIndex = actions.length; + actions.push( action ); + + actionsForClip.actionByRoot[ rootUuid ] = action; + + } + + _removeInactiveAction( action ) { + + const actions = this._actions, + lastInactiveAction = actions[ actions.length - 1 ], + cacheIndex = action._cacheIndex; + + lastInactiveAction._cacheIndex = cacheIndex; + actions[ cacheIndex ] = lastInactiveAction; + actions.pop(); + + action._cacheIndex = null; + + + const clipUuid = action._clip.uuid, + actionsByClip = this._actionsByClip, + actionsForClip = actionsByClip[ clipUuid ], + knownActionsForClip = actionsForClip.knownActions, + + lastKnownAction = + knownActionsForClip[ knownActionsForClip.length - 1 ], + + byClipCacheIndex = action._byClipCacheIndex; + + lastKnownAction._byClipCacheIndex = byClipCacheIndex; + knownActionsForClip[ byClipCacheIndex ] = lastKnownAction; + knownActionsForClip.pop(); + + action._byClipCacheIndex = null; + + + const actionByRoot = actionsForClip.actionByRoot, + rootUuid = ( action._localRoot || this._root ).uuid; + + delete actionByRoot[ rootUuid ]; + + if ( knownActionsForClip.length === 0 ) { + + delete actionsByClip[ clipUuid ]; + + } + + this._removeInactiveBindingsForAction( action ); + + } + + _removeInactiveBindingsForAction( action ) { + + const bindings = action._propertyBindings; + + for ( let i = 0, n = bindings.length; i !== n; ++ i ) { + + const binding = bindings[ i ]; + + if ( -- binding.referenceCount === 0 ) { + + this._removeInactiveBinding( binding ); + + } + + } + + } + + _lendAction( action ) { + + // [ active actions | inactive actions ] + // [ active actions >| inactive actions ] + // s a + // <-swap-> + // a s + + const actions = this._actions, + prevIndex = action._cacheIndex, + + lastActiveIndex = this._nActiveActions ++, + + firstInactiveAction = actions[ lastActiveIndex ]; + + action._cacheIndex = lastActiveIndex; + actions[ lastActiveIndex ] = action; + + firstInactiveAction._cacheIndex = prevIndex; + actions[ prevIndex ] = firstInactiveAction; + + } + + _takeBackAction( action ) { + + // [ active actions | inactive actions ] + // [ active actions |< inactive actions ] + // a s + // <-swap-> + // s a + + const actions = this._actions, + prevIndex = action._cacheIndex, + + firstInactiveIndex = -- this._nActiveActions, + + lastActiveAction = actions[ firstInactiveIndex ]; + + action._cacheIndex = firstInactiveIndex; + actions[ firstInactiveIndex ] = action; + + lastActiveAction._cacheIndex = prevIndex; + actions[ prevIndex ] = lastActiveAction; + + } + + // Memory management for PropertyMixer objects + + _addInactiveBinding( binding, rootUuid, trackName ) { + + const bindingsByRoot = this._bindingsByRootAndName, + bindings = this._bindings; + + let bindingByName = bindingsByRoot[ rootUuid ]; + + if ( bindingByName === undefined ) { + + bindingByName = {}; + bindingsByRoot[ rootUuid ] = bindingByName; + + } + + bindingByName[ trackName ] = binding; + + binding._cacheIndex = bindings.length; + bindings.push( binding ); + + } + + _removeInactiveBinding( binding ) { + + const bindings = this._bindings, + propBinding = binding.binding, + rootUuid = propBinding.rootNode.uuid, + trackName = propBinding.path, + bindingsByRoot = this._bindingsByRootAndName, + bindingByName = bindingsByRoot[ rootUuid ], + + lastInactiveBinding = bindings[ bindings.length - 1 ], + cacheIndex = binding._cacheIndex; + + lastInactiveBinding._cacheIndex = cacheIndex; + bindings[ cacheIndex ] = lastInactiveBinding; + bindings.pop(); + + delete bindingByName[ trackName ]; + + if ( Object.keys( bindingByName ).length === 0 ) { + + delete bindingsByRoot[ rootUuid ]; + + } + + } + + _lendBinding( binding ) { + + const bindings = this._bindings, + prevIndex = binding._cacheIndex, + + lastActiveIndex = this._nActiveBindings ++, + + firstInactiveBinding = bindings[ lastActiveIndex ]; + + binding._cacheIndex = lastActiveIndex; + bindings[ lastActiveIndex ] = binding; + + firstInactiveBinding._cacheIndex = prevIndex; + bindings[ prevIndex ] = firstInactiveBinding; + + } + + _takeBackBinding( binding ) { + + const bindings = this._bindings, + prevIndex = binding._cacheIndex, + + firstInactiveIndex = -- this._nActiveBindings, + + lastActiveBinding = bindings[ firstInactiveIndex ]; + + binding._cacheIndex = firstInactiveIndex; + bindings[ firstInactiveIndex ] = binding; + + lastActiveBinding._cacheIndex = prevIndex; + bindings[ prevIndex ] = lastActiveBinding; + + } + + + // Memory management of Interpolants for weight and time scale + + _lendControlInterpolant() { + + const interpolants = this._controlInterpolants, + lastActiveIndex = this._nActiveControlInterpolants ++; + + let interpolant = interpolants[ lastActiveIndex ]; + + if ( interpolant === undefined ) { + + interpolant = new LinearInterpolant( + new Float32Array( 2 ), new Float32Array( 2 ), + 1, this._controlInterpolantsResultBuffer ); + + interpolant.__cacheIndex = lastActiveIndex; + interpolants[ lastActiveIndex ] = interpolant; + + } + + return interpolant; + + } + + _takeBackControlInterpolant( interpolant ) { + + const interpolants = this._controlInterpolants, + prevIndex = interpolant.__cacheIndex, + + firstInactiveIndex = -- this._nActiveControlInterpolants, + + lastActiveInterpolant = interpolants[ firstInactiveIndex ]; + + interpolant.__cacheIndex = firstInactiveIndex; + interpolants[ firstInactiveIndex ] = interpolant; + + lastActiveInterpolant.__cacheIndex = prevIndex; + interpolants[ prevIndex ] = lastActiveInterpolant; + + } + + // return an action for a clip optionally using a custom root target + // object (this method allocates a lot of dynamic memory in case a + // previously unknown clip/root combination is specified) + clipAction( clip, optionalRoot, blendMode ) { + + const root = optionalRoot || this._root, + rootUuid = root.uuid; + + let clipObject = typeof clip === 'string' ? AnimationClip.findByName( root, clip ) : clip; + + const clipUuid = clipObject !== null ? clipObject.uuid : clip; + + const actionsForClip = this._actionsByClip[ clipUuid ]; + let prototypeAction = null; + + if ( blendMode === undefined ) { + + if ( clipObject !== null ) { + + blendMode = clipObject.blendMode; + + } else { + + blendMode = NormalAnimationBlendMode; + + } + + } + + if ( actionsForClip !== undefined ) { + + const existingAction = actionsForClip.actionByRoot[ rootUuid ]; + + if ( existingAction !== undefined && existingAction.blendMode === blendMode ) { + + return existingAction; + + } + + // we know the clip, so we don't have to parse all + // the bindings again but can just copy + prototypeAction = actionsForClip.knownActions[ 0 ]; + + // also, take the clip from the prototype action + if ( clipObject === null ) + clipObject = prototypeAction._clip; + + } + + // clip must be known when specified via string + if ( clipObject === null ) return null; + + // allocate all resources required to run it + const newAction = new AnimationAction( this, clipObject, optionalRoot, blendMode ); + + this._bindAction( newAction, prototypeAction ); + + // and make the action known to the memory manager + this._addInactiveAction( newAction, clipUuid, rootUuid ); + + return newAction; + + } + + // get an existing action + existingAction( clip, optionalRoot ) { + + const root = optionalRoot || this._root, + rootUuid = root.uuid, + + clipObject = typeof clip === 'string' ? + AnimationClip.findByName( root, clip ) : clip, + + clipUuid = clipObject ? clipObject.uuid : clip, + + actionsForClip = this._actionsByClip[ clipUuid ]; + + if ( actionsForClip !== undefined ) { + + return actionsForClip.actionByRoot[ rootUuid ] || null; + + } + + return null; + + } + + // deactivates all previously scheduled actions + stopAllAction() { + + const actions = this._actions, + nActions = this._nActiveActions; + + for ( let i = nActions - 1; i >= 0; -- i ) { + + actions[ i ].stop(); + + } + + return this; + + } + + // advance the time and update apply the animation + update( deltaTime ) { + + deltaTime *= this.timeScale; + + const actions = this._actions, + nActions = this._nActiveActions, + + time = this.time += deltaTime, + timeDirection = Math.sign( deltaTime ), + + accuIndex = this._accuIndex ^= 1; + + // run active actions + + for ( let i = 0; i !== nActions; ++ i ) { + + const action = actions[ i ]; + + action._update( time, deltaTime, timeDirection, accuIndex ); + + } + + // update scene graph + + const bindings = this._bindings, + nBindings = this._nActiveBindings; + + for ( let i = 0; i !== nBindings; ++ i ) { + + bindings[ i ].apply( accuIndex ); + + } + + return this; + + } + + // Allows you to seek to a specific time in an animation. + setTime( timeInSeconds ) { + + this.time = 0; // Zero out time attribute for AnimationMixer object; + for ( let i = 0; i < this._actions.length; i ++ ) { + + this._actions[ i ].time = 0; // Zero out time attribute for all associated AnimationAction objects. + + } + + return this.update( timeInSeconds ); // Update used to set exact time. Returns "this" AnimationMixer object. + + } + + // return this mixer's root target object + getRoot() { + + return this._root; + + } + + // free all resources specific to a particular clip + uncacheClip( clip ) { + + const actions = this._actions, + clipUuid = clip.uuid, + actionsByClip = this._actionsByClip, + actionsForClip = actionsByClip[ clipUuid ]; + + if ( actionsForClip !== undefined ) { + + // note: just calling _removeInactiveAction would mess up the + // iteration state and also require updating the state we can + // just throw away + + const actionsToRemove = actionsForClip.knownActions; + + for ( let i = 0, n = actionsToRemove.length; i !== n; ++ i ) { + + const action = actionsToRemove[ i ]; + + this._deactivateAction( action ); + + const cacheIndex = action._cacheIndex, + lastInactiveAction = actions[ actions.length - 1 ]; + + action._cacheIndex = null; + action._byClipCacheIndex = null; + + lastInactiveAction._cacheIndex = cacheIndex; + actions[ cacheIndex ] = lastInactiveAction; + actions.pop(); + + this._removeInactiveBindingsForAction( action ); + + } + + delete actionsByClip[ clipUuid ]; + + } + + } + + // free all resources specific to a particular root target object + uncacheRoot( root ) { + + const rootUuid = root.uuid, + actionsByClip = this._actionsByClip; + + for ( const clipUuid in actionsByClip ) { + + const actionByRoot = actionsByClip[ clipUuid ].actionByRoot, + action = actionByRoot[ rootUuid ]; + + if ( action !== undefined ) { + + this._deactivateAction( action ); + this._removeInactiveAction( action ); + + } + + } + + const bindingsByRoot = this._bindingsByRootAndName, + bindingByName = bindingsByRoot[ rootUuid ]; + + if ( bindingByName !== undefined ) { + + for ( const trackName in bindingByName ) { + + const binding = bindingByName[ trackName ]; + binding.restoreOriginalState(); + this._removeInactiveBinding( binding ); + + } + + } + + } + + // remove a targeted clip from the cache + uncacheAction( clip, optionalRoot ) { + + const action = this.existingAction( clip, optionalRoot ); + + if ( action !== null ) { + + this._deactivateAction( action ); + this._removeInactiveAction( action ); + + } + + } + +} + +AnimationMixer.prototype._controlInterpolantsResultBuffer = new Float32Array( 1 ); + +class Uniform { + + constructor( value ) { + + if ( typeof value === 'string' ) { + + console.warn( 'THREE.Uniform: Type parameter is no longer needed.' ); + value = arguments[ 1 ]; + + } + + this.value = value; + + } + + clone() { + + return new Uniform( this.value.clone === undefined ? this.value : this.value.clone() ); + + } + +} + +class InstancedInterleavedBuffer extends InterleavedBuffer { + + constructor( array, stride, meshPerAttribute = 1 ) { + + super( array, stride ); + + this.meshPerAttribute = meshPerAttribute; + + } + + copy( source ) { + + super.copy( source ); + + this.meshPerAttribute = source.meshPerAttribute; + + return this; + + } + + clone( data ) { + + const ib = super.clone( data ); + + ib.meshPerAttribute = this.meshPerAttribute; + + return ib; + + } + + toJSON( data ) { + + const json = super.toJSON( data ); + + json.isInstancedInterleavedBuffer = true; + json.meshPerAttribute = this.meshPerAttribute; + + return json; + + } + +} + +InstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true; + +class GLBufferAttribute { + + constructor( buffer, type, itemSize, elementSize, count ) { + + this.buffer = buffer; + this.type = type; + this.itemSize = itemSize; + this.elementSize = elementSize; + this.count = count; + + this.version = 0; + + } + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + } + + setBuffer( buffer ) { + + this.buffer = buffer; + + return this; + + } + + setType( type, elementSize ) { + + this.type = type; + this.elementSize = elementSize; + + return this; + + } + + setItemSize( itemSize ) { + + this.itemSize = itemSize; + + return this; + + } + + setCount( count ) { + + this.count = count; + + return this; + + } + +} + +GLBufferAttribute.prototype.isGLBufferAttribute = true; + +class Raycaster { + + constructor( origin, direction, near = 0, far = Infinity ) { + + this.ray = new Ray( origin, direction ); + // direction is assumed to be normalized (for accurate distance calculations) + + this.near = near; + this.far = far; + this.camera = null; + this.layers = new Layers(); + + this.params = { + Mesh: {}, + Line: { threshold: 1 }, + LOD: {}, + Points: { threshold: 1 }, + Sprite: {} + }; + + } + + set( origin, direction ) { + + // direction is assumed to be normalized (for accurate distance calculations) + + this.ray.set( origin, direction ); + + } + + setFromCamera( coords, camera ) { + + if ( camera && camera.isPerspectiveCamera ) { + + this.ray.origin.setFromMatrixPosition( camera.matrixWorld ); + this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize(); + this.camera = camera; + + } else if ( camera && camera.isOrthographicCamera ) { + + this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera + this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ); + this.camera = camera; + + } else { + + console.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type ); + + } + + } + + intersectObject( object, recursive = true, intersects = [] ) { + + intersectObject( object, this, intersects, recursive ); + + intersects.sort( ascSort ); + + return intersects; + + } + + intersectObjects( objects, recursive = true, intersects = [] ) { + + for ( let i = 0, l = objects.length; i < l; i ++ ) { + + intersectObject( objects[ i ], this, intersects, recursive ); + + } + + intersects.sort( ascSort ); + + return intersects; + + } + +} + +function ascSort( a, b ) { + + return a.distance - b.distance; + +} + +function intersectObject( object, raycaster, intersects, recursive ) { + + if ( object.layers.test( raycaster.layers ) ) { + + object.raycast( raycaster, intersects ); + + } + + if ( recursive === true ) { + + const children = object.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + intersectObject( children[ i ], raycaster, intersects, true ); + + } + + } + +} + +/** + * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system + * + * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up. + * The azimuthal angle (theta) is measured from the positive z-axis. + */ + +class Spherical { + + constructor( radius = 1, phi = 0, theta = 0 ) { + + this.radius = radius; + this.phi = phi; // polar angle + this.theta = theta; // azimuthal angle + + return this; + + } + + set( radius, phi, theta ) { + + this.radius = radius; + this.phi = phi; + this.theta = theta; + + return this; + + } + + copy( other ) { + + this.radius = other.radius; + this.phi = other.phi; + this.theta = other.theta; + + return this; + + } + + // restrict phi to be betwee EPS and PI-EPS + makeSafe() { + + const EPS = 0.000001; + this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) ); + + return this; + + } + + setFromVector3( v ) { + + return this.setFromCartesianCoords( v.x, v.y, v.z ); + + } + + setFromCartesianCoords( x, y, z ) { + + this.radius = Math.sqrt( x * x + y * y + z * z ); + + if ( this.radius === 0 ) { + + this.theta = 0; + this.phi = 0; + + } else { + + this.theta = Math.atan2( x, z ); + this.phi = Math.acos( clamp( y / this.radius, - 1, 1 ) ); + + } + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +/** + * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system + */ + +class Cylindrical { + + constructor( radius = 1, theta = 0, y = 0 ) { + + this.radius = radius; // distance from the origin to a point in the x-z plane + this.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis + this.y = y; // height above the x-z plane + + return this; + + } + + set( radius, theta, y ) { + + this.radius = radius; + this.theta = theta; + this.y = y; + + return this; + + } + + copy( other ) { + + this.radius = other.radius; + this.theta = other.theta; + this.y = other.y; + + return this; + + } + + setFromVector3( v ) { + + return this.setFromCartesianCoords( v.x, v.y, v.z ); + + } + + setFromCartesianCoords( x, y, z ) { + + this.radius = Math.sqrt( x * x + z * z ); + this.theta = Math.atan2( x, z ); + this.y = y; + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +const _vector$4 = /*@__PURE__*/ new Vector2(); + +class Box2 { + + constructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) { + + this.min = min; + this.max = max; + + } + + set( min, max ) { + + this.min.copy( min ); + this.max.copy( max ); + + return this; + + } + + setFromPoints( points ) { + + this.makeEmpty(); + + for ( let i = 0, il = points.length; i < il; i ++ ) { + + this.expandByPoint( points[ i ] ); + + } + + return this; + + } + + setFromCenterAndSize( center, size ) { + + const halfSize = _vector$4.copy( size ).multiplyScalar( 0.5 ); + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( box ) { + + this.min.copy( box.min ); + this.max.copy( box.max ); + + return this; + + } + + makeEmpty() { + + this.min.x = this.min.y = + Infinity; + this.max.x = this.max.y = - Infinity; + + return this; + + } + + isEmpty() { + + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); + + } + + getCenter( target ) { + + return this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + + } + + getSize( target ) { + + return this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min ); + + } + + expandByPoint( point ) { + + this.min.min( point ); + this.max.max( point ); + + return this; + + } + + expandByVector( vector ) { + + this.min.sub( vector ); + this.max.add( vector ); + + return this; + + } + + expandByScalar( scalar ) { + + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); + + return this; + + } + + containsPoint( point ) { + + return point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y ? false : true; + + } + + containsBox( box ) { + + return this.min.x <= box.min.x && box.max.x <= this.max.x && + this.min.y <= box.min.y && box.max.y <= this.max.y; + + } + + getParameter( point, target ) { + + // This can potentially have a divide by zero if the box + // has a size dimension of 0. + + return target.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ) + ); + + } + + intersectsBox( box ) { + + // using 4 splitting planes to rule out intersections + + return box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y ? false : true; + + } + + clampPoint( point, target ) { + + return target.copy( point ).clamp( this.min, this.max ); + + } + + distanceToPoint( point ) { + + const clampedPoint = _vector$4.copy( point ).clamp( this.min, this.max ); + return clampedPoint.sub( point ).length(); + + } + + intersect( box ) { + + this.min.max( box.min ); + this.max.min( box.max ); + + return this; + + } + + union( box ) { + + this.min.min( box.min ); + this.max.max( box.max ); + + return this; + + } + + translate( offset ) { + + this.min.add( offset ); + this.max.add( offset ); + + return this; + + } + + equals( box ) { + + return box.min.equals( this.min ) && box.max.equals( this.max ); + + } + +} + +Box2.prototype.isBox2 = true; + +const _startP = /*@__PURE__*/ new Vector3(); +const _startEnd = /*@__PURE__*/ new Vector3(); + +class Line3 { + + constructor( start = new Vector3(), end = new Vector3() ) { + + this.start = start; + this.end = end; + + } + + set( start, end ) { + + this.start.copy( start ); + this.end.copy( end ); + + return this; + + } + + copy( line ) { + + this.start.copy( line.start ); + this.end.copy( line.end ); + + return this; + + } + + getCenter( target ) { + + return target.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); + + } + + delta( target ) { + + return target.subVectors( this.end, this.start ); + + } + + distanceSq() { + + return this.start.distanceToSquared( this.end ); + + } + + distance() { + + return this.start.distanceTo( this.end ); + + } + + at( t, target ) { + + return this.delta( target ).multiplyScalar( t ).add( this.start ); + + } + + closestPointToPointParameter( point, clampToLine ) { + + _startP.subVectors( point, this.start ); + _startEnd.subVectors( this.end, this.start ); + + const startEnd2 = _startEnd.dot( _startEnd ); + const startEnd_startP = _startEnd.dot( _startP ); + + let t = startEnd_startP / startEnd2; + + if ( clampToLine ) { + + t = clamp( t, 0, 1 ); + + } + + return t; + + } + + closestPointToPoint( point, clampToLine, target ) { + + const t = this.closestPointToPointParameter( point, clampToLine ); + + return this.delta( target ).multiplyScalar( t ).add( this.start ); + + } + + applyMatrix4( matrix ) { + + this.start.applyMatrix4( matrix ); + this.end.applyMatrix4( matrix ); + + return this; + + } + + equals( line ) { + + return line.start.equals( this.start ) && line.end.equals( this.end ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + +} + +const _vector$3 = /*@__PURE__*/ new Vector3(); + +class SpotLightHelper extends Object3D { + + constructor( light, color ) { + + super(); + this.light = light; + this.light.updateMatrixWorld(); + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + this.color = color; + + const geometry = new BufferGeometry(); + + const positions = [ + 0, 0, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 1, + 0, 0, 0, - 1, 0, 1, + 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, - 1, 1 + ]; + + for ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { + + const p1 = ( i / l ) * Math.PI * 2; + const p2 = ( j / l ) * Math.PI * 2; + + positions.push( + Math.cos( p1 ), Math.sin( p1 ), 1, + Math.cos( p2 ), Math.sin( p2 ), 1 + ); + + } + + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + + const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + + this.cone = new LineSegments( geometry, material ); + this.add( this.cone ); + + this.update(); + + } + + dispose() { + + this.cone.geometry.dispose(); + this.cone.material.dispose(); + + } + + update() { + + this.light.updateMatrixWorld(); + + const coneLength = this.light.distance ? this.light.distance : 1000; + const coneWidth = coneLength * Math.tan( this.light.angle ); + + this.cone.scale.set( coneWidth, coneWidth, coneLength ); + + _vector$3.setFromMatrixPosition( this.light.target.matrixWorld ); + + this.cone.lookAt( _vector$3 ); + + if ( this.color !== undefined ) { + + this.cone.material.color.set( this.color ); + + } else { + + this.cone.material.color.copy( this.light.color ); + + } + + } + +} + +const _vector$2 = /*@__PURE__*/ new Vector3(); +const _boneMatrix = /*@__PURE__*/ new Matrix4(); +const _matrixWorldInv = /*@__PURE__*/ new Matrix4(); + + +class SkeletonHelper extends LineSegments { + + constructor( object ) { + + const bones = getBoneList( object ); + + const geometry = new BufferGeometry(); + + const vertices = []; + const colors = []; + + const color1 = new Color( 0, 0, 1 ); + const color2 = new Color( 0, 1, 0 ); + + for ( let i = 0; i < bones.length; i ++ ) { + + const bone = bones[ i ]; + + if ( bone.parent && bone.parent.isBone ) { + + vertices.push( 0, 0, 0 ); + vertices.push( 0, 0, 0 ); + colors.push( color1.r, color1.g, color1.b ); + colors.push( color2.r, color2.g, color2.b ); + + } + + } + + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } ); + + super( geometry, material ); + + this.type = 'SkeletonHelper'; + this.isSkeletonHelper = true; + + this.root = object; + this.bones = bones; + + this.matrix = object.matrixWorld; + this.matrixAutoUpdate = false; + + } + + updateMatrixWorld( force ) { + + const bones = this.bones; + + const geometry = this.geometry; + const position = geometry.getAttribute( 'position' ); + + _matrixWorldInv.copy( this.root.matrixWorld ).invert(); + + for ( let i = 0, j = 0; i < bones.length; i ++ ) { + + const bone = bones[ i ]; + + if ( bone.parent && bone.parent.isBone ) { + + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); + _vector$2.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j, _vector$2.x, _vector$2.y, _vector$2.z ); + + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); + _vector$2.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j + 1, _vector$2.x, _vector$2.y, _vector$2.z ); + + j += 2; + + } + + } + + geometry.getAttribute( 'position' ).needsUpdate = true; + + super.updateMatrixWorld( force ); + + } + +} + + +function getBoneList( object ) { + + const boneList = []; + + if ( object && object.isBone ) { + + boneList.push( object ); + + } + + for ( let i = 0; i < object.children.length; i ++ ) { + + boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); + + } + + return boneList; + +} + +class PointLightHelper extends Mesh { + + constructor( light, sphereSize, color ) { + + const geometry = new SphereGeometry( sphereSize, 4, 2 ); + const material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + + super( geometry, material ); + + this.light = light; + this.light.updateMatrixWorld(); + + this.color = color; + + this.type = 'PointLightHelper'; + + this.matrix = this.light.matrixWorld; + this.matrixAutoUpdate = false; + + this.update(); + + + /* + // TODO: delete this comment? + const distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 ); + const distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } ); + + this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial ); + this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial ); + + const d = light.distance; + + if ( d === 0.0 ) { + + this.lightDistance.visible = false; + + } else { + + this.lightDistance.scale.set( d, d, d ); + + } + + this.add( this.lightDistance ); + */ + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + update() { + + if ( this.color !== undefined ) { + + this.material.color.set( this.color ); + + } else { + + this.material.color.copy( this.light.color ); + + } + + /* + const d = this.light.distance; + + if ( d === 0.0 ) { + + this.lightDistance.visible = false; + + } else { + + this.lightDistance.visible = true; + this.lightDistance.scale.set( d, d, d ); + + } + */ + + } + +} + +const _vector$1 = /*@__PURE__*/ new Vector3(); +const _color1 = /*@__PURE__*/ new Color(); +const _color2 = /*@__PURE__*/ new Color(); + +class HemisphereLightHelper extends Object3D { + + constructor( light, size, color ) { + + super(); + this.light = light; + this.light.updateMatrixWorld(); + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + this.color = color; + + const geometry = new OctahedronGeometry( size ); + geometry.rotateY( Math.PI * 0.5 ); + + this.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + if ( this.color === undefined ) this.material.vertexColors = true; + + const position = geometry.getAttribute( 'position' ); + const colors = new Float32Array( position.count * 3 ); + + geometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) ); + + this.add( new Mesh( geometry, this.material ) ); + + this.update(); + + } + + dispose() { + + this.children[ 0 ].geometry.dispose(); + this.children[ 0 ].material.dispose(); + + } + + update() { + + const mesh = this.children[ 0 ]; + + if ( this.color !== undefined ) { + + this.material.color.set( this.color ); + + } else { + + const colors = mesh.geometry.getAttribute( 'color' ); + + _color1.copy( this.light.color ); + _color2.copy( this.light.groundColor ); + + for ( let i = 0, l = colors.count; i < l; i ++ ) { + + const color = ( i < ( l / 2 ) ) ? _color1 : _color2; + + colors.setXYZ( i, color.r, color.g, color.b ); + + } + + colors.needsUpdate = true; + + } + + mesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() ); + + } + +} + +class GridHelper extends LineSegments { + + constructor( size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888 ) { + + color1 = new Color( color1 ); + color2 = new Color( color2 ); + + const center = divisions / 2; + const step = size / divisions; + const halfSize = size / 2; + + const vertices = [], colors = []; + + for ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { + + vertices.push( - halfSize, 0, k, halfSize, 0, k ); + vertices.push( k, 0, - halfSize, k, 0, halfSize ); + + const color = i === center ? color1 : color2; + + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + + } + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + + super( geometry, material ); + + this.type = 'GridHelper'; + + } + +} + +class PolarGridHelper extends LineSegments { + + constructor( radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) { + + color1 = new Color( color1 ); + color2 = new Color( color2 ); + + const vertices = []; + const colors = []; + + // create the radials + + for ( let i = 0; i <= radials; i ++ ) { + + const v = ( i / radials ) * ( Math.PI * 2 ); + + const x = Math.sin( v ) * radius; + const z = Math.cos( v ) * radius; + + vertices.push( 0, 0, 0 ); + vertices.push( x, 0, z ); + + const color = ( i & 1 ) ? color1 : color2; + + colors.push( color.r, color.g, color.b ); + colors.push( color.r, color.g, color.b ); + + } + + // create the circles + + for ( let i = 0; i <= circles; i ++ ) { + + const color = ( i & 1 ) ? color1 : color2; + + const r = radius - ( radius / circles * i ); + + for ( let j = 0; j < divisions; j ++ ) { + + // first vertex + + let v = ( j / divisions ) * ( Math.PI * 2 ); + + let x = Math.sin( v ) * r; + let z = Math.cos( v ) * r; + + vertices.push( x, 0, z ); + colors.push( color.r, color.g, color.b ); + + // second vertex + + v = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); + + x = Math.sin( v ) * r; + z = Math.cos( v ) * r; + + vertices.push( x, 0, z ); + colors.push( color.r, color.g, color.b ); + + } + + } + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + + super( geometry, material ); + + this.type = 'PolarGridHelper'; + + } + +} + +const _v1 = /*@__PURE__*/ new Vector3(); +const _v2 = /*@__PURE__*/ new Vector3(); +const _v3 = /*@__PURE__*/ new Vector3(); + +class DirectionalLightHelper extends Object3D { + + constructor( light, size, color ) { + + super(); + this.light = light; + this.light.updateMatrixWorld(); + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + this.color = color; + + if ( size === undefined ) size = 1; + + let geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ + - size, size, 0, + size, size, 0, + size, - size, 0, + - size, - size, 0, + - size, size, 0 + ], 3 ) ); + + const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + + this.lightPlane = new Line( geometry, material ); + this.add( this.lightPlane ); + + geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); + + this.targetLine = new Line( geometry, material ); + this.add( this.targetLine ); + + this.update(); + + } + + dispose() { + + this.lightPlane.geometry.dispose(); + this.lightPlane.material.dispose(); + this.targetLine.geometry.dispose(); + this.targetLine.material.dispose(); + + } + + update() { + + _v1.setFromMatrixPosition( this.light.matrixWorld ); + _v2.setFromMatrixPosition( this.light.target.matrixWorld ); + _v3.subVectors( _v2, _v1 ); + + this.lightPlane.lookAt( _v2 ); + + if ( this.color !== undefined ) { + + this.lightPlane.material.color.set( this.color ); + this.targetLine.material.color.set( this.color ); + + } else { + + this.lightPlane.material.color.copy( this.light.color ); + this.targetLine.material.color.copy( this.light.color ); + + } + + this.targetLine.lookAt( _v2 ); + this.targetLine.scale.z = _v3.length(); + + } + +} + +const _vector = /*@__PURE__*/ new Vector3(); +const _camera = /*@__PURE__*/ new Camera(); + +/** + * - shows frustum, line of sight and up of the camera + * - suitable for fast updates + * - based on frustum visualization in lightgl.js shadowmap example + * https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html + */ + +class CameraHelper extends LineSegments { + + constructor( camera ) { + + const geometry = new BufferGeometry(); + const material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } ); + + const vertices = []; + const colors = []; + + const pointMap = {}; + + // colors + + const colorFrustum = new Color( 0xffaa00 ); + const colorCone = new Color( 0xff0000 ); + const colorUp = new Color( 0x00aaff ); + const colorTarget = new Color( 0xffffff ); + const colorCross = new Color( 0x333333 ); + + // near + + addLine( 'n1', 'n2', colorFrustum ); + addLine( 'n2', 'n4', colorFrustum ); + addLine( 'n4', 'n3', colorFrustum ); + addLine( 'n3', 'n1', colorFrustum ); + + // far + + addLine( 'f1', 'f2', colorFrustum ); + addLine( 'f2', 'f4', colorFrustum ); + addLine( 'f4', 'f3', colorFrustum ); + addLine( 'f3', 'f1', colorFrustum ); + + // sides + + addLine( 'n1', 'f1', colorFrustum ); + addLine( 'n2', 'f2', colorFrustum ); + addLine( 'n3', 'f3', colorFrustum ); + addLine( 'n4', 'f4', colorFrustum ); + + // cone + + addLine( 'p', 'n1', colorCone ); + addLine( 'p', 'n2', colorCone ); + addLine( 'p', 'n3', colorCone ); + addLine( 'p', 'n4', colorCone ); + + // up + + addLine( 'u1', 'u2', colorUp ); + addLine( 'u2', 'u3', colorUp ); + addLine( 'u3', 'u1', colorUp ); + + // target + + addLine( 'c', 't', colorTarget ); + addLine( 'p', 'c', colorCross ); + + // cross + + addLine( 'cn1', 'cn2', colorCross ); + addLine( 'cn3', 'cn4', colorCross ); + + addLine( 'cf1', 'cf2', colorCross ); + addLine( 'cf3', 'cf4', colorCross ); + + function addLine( a, b, color ) { + + addPoint( a, color ); + addPoint( b, color ); + + } + + function addPoint( id, color ) { + + vertices.push( 0, 0, 0 ); + colors.push( color.r, color.g, color.b ); + + if ( pointMap[ id ] === undefined ) { + + pointMap[ id ] = []; + + } + + pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); + + } + + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + super( geometry, material ); + + this.type = 'CameraHelper'; + + this.camera = camera; + if ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix(); + + this.matrix = camera.matrixWorld; + this.matrixAutoUpdate = false; + + this.pointMap = pointMap; + + this.update(); + + } + + update() { + + const geometry = this.geometry; + const pointMap = this.pointMap; + + const w = 1, h = 1; + + // we need just camera projection matrix inverse + // world matrix must be identity + + _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse ); + + // center / target + + setPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 ); + setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 ); + + // near + + setPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 ); + setPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 ); + setPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 ); + setPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 ); + + // far + + setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 ); + setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 ); + setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 ); + setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 ); + + // up + + setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 ); + setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 ); + setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 ); + + // cross + + setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 ); + setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 ); + setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 ); + setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 ); + + setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 ); + setPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 ); + setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 ); + setPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 ); + + geometry.getAttribute( 'position' ).needsUpdate = true; + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + +} + + +function setPoint( point, pointMap, geometry, camera, x, y, z ) { + + _vector.set( x, y, z ).unproject( camera ); + + const points = pointMap[ point ]; + + if ( points !== undefined ) { + + const position = geometry.getAttribute( 'position' ); + + for ( let i = 0, l = points.length; i < l; i ++ ) { + + position.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z ); + + } + + } + +} + +const _box = /*@__PURE__*/ new Box3(); + +class BoxHelper extends LineSegments { + + constructor( object, color = 0xffff00 ) { + + const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + const positions = new Float32Array( 8 * 3 ); + + const geometry = new BufferGeometry(); + geometry.setIndex( new BufferAttribute( indices, 1 ) ); + geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) ); + + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + + this.object = object; + this.type = 'BoxHelper'; + + this.matrixAutoUpdate = false; + + this.update(); + + } + + update( object ) { + + if ( object !== undefined ) { + + console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); + + } + + if ( this.object !== undefined ) { + + _box.setFromObject( this.object ); + + } + + if ( _box.isEmpty() ) return; + + const min = _box.min; + const max = _box.max; + + /* + 5____4 + 1/___0/| + | 6__|_7 + 2/___3/ + + 0: max.x, max.y, max.z + 1: min.x, max.y, max.z + 2: min.x, min.y, max.z + 3: max.x, min.y, max.z + 4: max.x, max.y, min.z + 5: min.x, max.y, min.z + 6: min.x, min.y, min.z + 7: max.x, min.y, min.z + */ + + const position = this.geometry.attributes.position; + const array = position.array; + + array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; + array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; + array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; + array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; + array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; + array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; + array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; + array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; + + position.needsUpdate = true; + + this.geometry.computeBoundingSphere(); + + + } + + setFromObject( object ) { + + this.object = object; + this.update(); + + return this; + + } + + copy( source ) { + + LineSegments.prototype.copy.call( this, source ); + + this.object = source.object; + + return this; + + } + +} + +class Box3Helper extends LineSegments { + + constructor( box, color = 0xffff00 ) { + + const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + + const positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ]; + + const geometry = new BufferGeometry(); + + geometry.setIndex( new BufferAttribute( indices, 1 ) ); + + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + + this.box = box; + + this.type = 'Box3Helper'; + + this.geometry.computeBoundingSphere(); + + } + + updateMatrixWorld( force ) { + + const box = this.box; + + if ( box.isEmpty() ) return; + + box.getCenter( this.position ); + + box.getSize( this.scale ); + + this.scale.multiplyScalar( 0.5 ); + + super.updateMatrixWorld( force ); + + } + +} + +class PlaneHelper extends Line { + + constructor( plane, size = 1, hex = 0xffff00 ) { + + const color = hex; + + const positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ]; + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + geometry.computeBoundingSphere(); + + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + + this.type = 'PlaneHelper'; + + this.plane = plane; + + this.size = size; + + const positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ]; + + const geometry2 = new BufferGeometry(); + geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); + geometry2.computeBoundingSphere(); + + this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) ); + + } + + updateMatrixWorld( force ) { + + let scale = - this.plane.constant; + + if ( Math.abs( scale ) < 1e-8 ) scale = 1e-8; // sign does not matter + + this.scale.set( 0.5 * this.size, 0.5 * this.size, scale ); + + this.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here + + this.lookAt( this.plane.normal ); + + super.updateMatrixWorld( force ); + + } + +} + +const _axis = /*@__PURE__*/ new Vector3(); +let _lineGeometry, _coneGeometry; + +class ArrowHelper extends Object3D { + + // dir is assumed to be normalized + + constructor( dir = new Vector3( 0, 0, 1 ), origin = new Vector3( 0, 0, 0 ), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2 ) { + + super(); + + this.type = 'ArrowHelper'; + + if ( _lineGeometry === undefined ) { + + _lineGeometry = new BufferGeometry(); + _lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); + + _coneGeometry = new CylinderGeometry( 0, 0.5, 1, 5, 1 ); + _coneGeometry.translate( 0, - 0.5, 0 ); + + } + + this.position.copy( origin ); + + this.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.line.matrixAutoUpdate = false; + this.add( this.line ); + + this.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) ); + this.cone.matrixAutoUpdate = false; + this.add( this.cone ); + + this.setDirection( dir ); + this.setLength( length, headLength, headWidth ); + + } + + setDirection( dir ) { + + // dir is assumed to be normalized + + if ( dir.y > 0.99999 ) { + + this.quaternion.set( 0, 0, 0, 1 ); + + } else if ( dir.y < - 0.99999 ) { + + this.quaternion.set( 1, 0, 0, 0 ); + + } else { + + _axis.set( dir.z, 0, - dir.x ).normalize(); + + const radians = Math.acos( dir.y ); + + this.quaternion.setFromAxisAngle( _axis, radians ); + + } + + } + + setLength( length, headLength = length * 0.2, headWidth = headLength * 0.2 ) { + + this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 + this.line.updateMatrix(); + + this.cone.scale.set( headWidth, headLength, headWidth ); + this.cone.position.y = length; + this.cone.updateMatrix(); + + } + + setColor( color ) { + + this.line.material.color.set( color ); + this.cone.material.color.set( color ); + + } + + copy( source ) { + + super.copy( source, false ); + + this.line.copy( source.line ); + this.cone.copy( source.cone ); + + return this; + + } + +} + +class AxesHelper extends LineSegments { + + constructor( size = 1 ) { + + const vertices = [ + 0, 0, 0, size, 0, 0, + 0, 0, 0, 0, size, 0, + 0, 0, 0, 0, 0, size + ]; + + const colors = [ + 1, 0, 0, 1, 0.6, 0, + 0, 1, 0, 0.6, 1, 0, + 0, 0, 1, 0, 0.6, 1 + ]; + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + + super( geometry, material ); + + this.type = 'AxesHelper'; + + } + + setColors( xAxisColor, yAxisColor, zAxisColor ) { + + const color = new Color(); + const array = this.geometry.attributes.color.array; + + color.set( xAxisColor ); + color.toArray( array, 0 ); + color.toArray( array, 3 ); + + color.set( yAxisColor ); + color.toArray( array, 6 ); + color.toArray( array, 9 ); + + color.set( zAxisColor ); + color.toArray( array, 12 ); + color.toArray( array, 15 ); + + this.geometry.attributes.color.needsUpdate = true; + + return this; + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + +} + +class ShapePath { + + constructor() { + + this.type = 'ShapePath'; + + this.color = new Color(); + + this.subPaths = []; + this.currentPath = null; + + } + + moveTo( x, y ) { + + this.currentPath = new Path(); + this.subPaths.push( this.currentPath ); + this.currentPath.moveTo( x, y ); + + return this; + + } + + lineTo( x, y ) { + + this.currentPath.lineTo( x, y ); + + return this; + + } + + quadraticCurveTo( aCPx, aCPy, aX, aY ) { + + this.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY ); + + return this; + + } + + bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { + + this.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ); + + return this; + + } + + splineThru( pts ) { + + this.currentPath.splineThru( pts ); + + return this; + + } + + toShapes( isCCW, noHoles ) { + + function toShapesNoHoles( inSubpaths ) { + + const shapes = []; + + for ( let i = 0, l = inSubpaths.length; i < l; i ++ ) { + + const tmpPath = inSubpaths[ i ]; + + const tmpShape = new Shape(); + tmpShape.curves = tmpPath.curves; + + shapes.push( tmpShape ); + + } + + return shapes; + + } + + function isPointInsidePolygon( inPt, inPolygon ) { + + const polyLen = inPolygon.length; + + // inPt on polygon contour => immediate success or + // toggling of inside/outside at every single! intersection point of an edge + // with the horizontal line through inPt, left of inPt + // not counting lowerY endpoints of edges and whole edges on that line + let inside = false; + for ( let p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) { + + let edgeLowPt = inPolygon[ p ]; + let edgeHighPt = inPolygon[ q ]; + + let edgeDx = edgeHighPt.x - edgeLowPt.x; + let edgeDy = edgeHighPt.y - edgeLowPt.y; + + if ( Math.abs( edgeDy ) > Number.EPSILON ) { + + // not parallel + if ( edgeDy < 0 ) { + + edgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx; + edgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy; + + } + + if ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) continue; + + if ( inPt.y === edgeLowPt.y ) { + + if ( inPt.x === edgeLowPt.x ) return true; // inPt is on contour ? + // continue; // no intersection or edgeLowPt => doesn't count !!! + + } else { + + const perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y ); + if ( perpEdge === 0 ) return true; // inPt is on contour ? + if ( perpEdge < 0 ) continue; + inside = ! inside; // true intersection left of inPt + + } + + } else { + + // parallel or collinear + if ( inPt.y !== edgeLowPt.y ) continue; // parallel + // edge lies on the same horizontal line as inPt + if ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) || + ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) ) return true; // inPt: Point on contour ! + // continue; + + } + + } + + return inside; + + } + + const isClockWise = ShapeUtils.isClockWise; + + const subPaths = this.subPaths; + if ( subPaths.length === 0 ) return []; + + if ( noHoles === true ) return toShapesNoHoles( subPaths ); + + + let solid, tmpPath, tmpShape; + const shapes = []; + + if ( subPaths.length === 1 ) { + + tmpPath = subPaths[ 0 ]; + tmpShape = new Shape(); + tmpShape.curves = tmpPath.curves; + shapes.push( tmpShape ); + return shapes; + + } + + let holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() ); + holesFirst = isCCW ? ! holesFirst : holesFirst; + + // console.log("Holes first", holesFirst); + + const betterShapeHoles = []; + const newShapes = []; + let newShapeHoles = []; + let mainIdx = 0; + let tmpPoints; + + newShapes[ mainIdx ] = undefined; + newShapeHoles[ mainIdx ] = []; + + for ( let i = 0, l = subPaths.length; i < l; i ++ ) { + + tmpPath = subPaths[ i ]; + tmpPoints = tmpPath.getPoints(); + solid = isClockWise( tmpPoints ); + solid = isCCW ? ! solid : solid; + + if ( solid ) { + + if ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) ) mainIdx ++; + + newShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints }; + newShapes[ mainIdx ].s.curves = tmpPath.curves; + + if ( holesFirst ) mainIdx ++; + newShapeHoles[ mainIdx ] = []; + + //console.log('cw', i); + + } else { + + newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } ); + + //console.log('ccw', i); + + } + + } + + // only Holes? -> probably all Shapes with wrong orientation + if ( ! newShapes[ 0 ] ) return toShapesNoHoles( subPaths ); + + + if ( newShapes.length > 1 ) { + + let ambiguous = false; + const toChange = []; + + for ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + + betterShapeHoles[ sIdx ] = []; + + } + + for ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + + const sho = newShapeHoles[ sIdx ]; + + for ( let hIdx = 0; hIdx < sho.length; hIdx ++ ) { + + const ho = sho[ hIdx ]; + let hole_unassigned = true; + + for ( let s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) { + + if ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) { + + if ( sIdx !== s2Idx ) toChange.push( { froms: sIdx, tos: s2Idx, hole: hIdx } ); + if ( hole_unassigned ) { + + hole_unassigned = false; + betterShapeHoles[ s2Idx ].push( ho ); + + } else { + + ambiguous = true; + + } + + } + + } + + if ( hole_unassigned ) { + + betterShapeHoles[ sIdx ].push( ho ); + + } + + } + + } + // console.log("ambiguous: ", ambiguous); + + if ( toChange.length > 0 ) { + + // console.log("to change: ", toChange); + if ( ! ambiguous ) newShapeHoles = betterShapeHoles; + + } + + } + + let tmpHoles; + + for ( let i = 0, il = newShapes.length; i < il; i ++ ) { + + tmpShape = newShapes[ i ].s; + shapes.push( tmpShape ); + tmpHoles = newShapeHoles[ i ]; + + for ( let j = 0, jl = tmpHoles.length; j < jl; j ++ ) { + + tmpShape.holes.push( tmpHoles[ j ].h ); + + } + + } + + //console.log("shape", shapes); + + return shapes; + + } + +} + +const _floatView = new Float32Array( 1 ); +const _int32View = new Int32Array( _floatView.buffer ); + +class DataUtils { + + // Converts float32 to float16 (stored as uint16 value). + + static toHalfFloat( val ) { + + if ( val > 65504 ) { + + console.warn( 'THREE.DataUtils.toHalfFloat(): value exceeds 65504.' ); + + val = 65504; // maximum representable value in float16 + + } + + // Source: http://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410 + + /* This method is faster than the OpenEXR implementation (very often + * used, eg. in Ogre), with the additional benefit of rounding, inspired + * by James Tursa?s half-precision code. */ + + _floatView[ 0 ] = val; + const x = _int32View[ 0 ]; + + let bits = ( x >> 16 ) & 0x8000; /* Get the sign */ + let m = ( x >> 12 ) & 0x07ff; /* Keep one extra bit for rounding */ + const e = ( x >> 23 ) & 0xff; /* Using int is faster here */ + + /* If zero, or denormal, or exponent underflows too much for a denormal + * half, return signed zero. */ + if ( e < 103 ) return bits; + + /* If NaN, return NaN. If Inf or exponent overflow, return Inf. */ + if ( e > 142 ) { + + bits |= 0x7c00; + /* If exponent was 0xff and one mantissa bit was set, it means NaN, + * not Inf, so make sure we set one mantissa bit too. */ + bits |= ( ( e == 255 ) ? 0 : 1 ) && ( x & 0x007fffff ); + return bits; + + } + + /* If exponent underflows but not too much, return a denormal */ + if ( e < 113 ) { + + m |= 0x0800; + /* Extra rounding may overflow and set mantissa to 0 and exponent + * to 1, which is OK. */ + bits |= ( m >> ( 114 - e ) ) + ( ( m >> ( 113 - e ) ) & 1 ); + return bits; + + } + + bits |= ( ( e - 112 ) << 10 ) | ( m >> 1 ); + /* Extra rounding. An overflow will set mantissa to 0 and increment + * the exponent, which is OK. */ + bits += m & 1; + return bits; + + } + +} + +const LineStrip = 0; +const LinePieces = 1; +const NoColors = 0; +const FaceColors = 1; +const VertexColors = 2; + +function MeshFaceMaterial( materials ) { + + console.warn( 'THREE.MeshFaceMaterial has been removed. Use an Array instead.' ); + return materials; + +} + +function MultiMaterial( materials = [] ) { + + console.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' ); + materials.isMultiMaterial = true; + materials.materials = materials; + materials.clone = function () { + + return materials.slice(); + + }; + + return materials; + +} + +function PointCloud( geometry, material ) { + + console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' ); + return new Points( geometry, material ); + +} + +function Particle( material ) { + + console.warn( 'THREE.Particle has been renamed to THREE.Sprite.' ); + return new Sprite( material ); + +} + +function ParticleSystem( geometry, material ) { + + console.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' ); + return new Points( geometry, material ); + +} + +function PointCloudMaterial( parameters ) { + + console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' ); + return new PointsMaterial( parameters ); + +} + +function ParticleBasicMaterial( parameters ) { + + console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' ); + return new PointsMaterial( parameters ); + +} + +function ParticleSystemMaterial( parameters ) { + + console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' ); + return new PointsMaterial( parameters ); + +} + +function Vertex( x, y, z ) { + + console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' ); + return new Vector3( x, y, z ); + +} + +// + +function DynamicBufferAttribute( array, itemSize ) { + + console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.' ); + return new BufferAttribute( array, itemSize ).setUsage( DynamicDrawUsage ); + +} + +function Int8Attribute( array, itemSize ) { + + console.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.' ); + return new Int8BufferAttribute( array, itemSize ); + +} + +function Uint8Attribute( array, itemSize ) { + + console.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.' ); + return new Uint8BufferAttribute( array, itemSize ); + +} + +function Uint8ClampedAttribute( array, itemSize ) { + + console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.' ); + return new Uint8ClampedBufferAttribute( array, itemSize ); + +} + +function Int16Attribute( array, itemSize ) { + + console.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.' ); + return new Int16BufferAttribute( array, itemSize ); + +} + +function Uint16Attribute( array, itemSize ) { + + console.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.' ); + return new Uint16BufferAttribute( array, itemSize ); + +} + +function Int32Attribute( array, itemSize ) { + + console.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.' ); + return new Int32BufferAttribute( array, itemSize ); + +} + +function Uint32Attribute( array, itemSize ) { + + console.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.' ); + return new Uint32BufferAttribute( array, itemSize ); + +} + +function Float32Attribute( array, itemSize ) { + + console.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.' ); + return new Float32BufferAttribute( array, itemSize ); + +} + +function Float64Attribute( array, itemSize ) { + + console.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.' ); + return new Float64BufferAttribute( array, itemSize ); + +} + +// + +Curve.create = function ( construct, getPoint ) { + + console.log( 'THREE.Curve.create() has been deprecated' ); + + construct.prototype = Object.create( Curve.prototype ); + construct.prototype.constructor = construct; + construct.prototype.getPoint = getPoint; + + return construct; + +}; + +// + +Path.prototype.fromPoints = function ( points ) { + + console.warn( 'THREE.Path: .fromPoints() has been renamed to .setFromPoints().' ); + return this.setFromPoints( points ); + +}; + +// + +function AxisHelper( size ) { + + console.warn( 'THREE.AxisHelper has been renamed to THREE.AxesHelper.' ); + return new AxesHelper( size ); + +} + +function BoundingBoxHelper( object, color ) { + + console.warn( 'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.' ); + return new BoxHelper( object, color ); + +} + +function EdgesHelper( object, hex ) { + + console.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' ); + return new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); + +} + +GridHelper.prototype.setColors = function () { + + console.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' ); + +}; + +SkeletonHelper.prototype.update = function () { + + console.error( 'THREE.SkeletonHelper: update() no longer needs to be called.' ); + +}; + +function WireframeHelper( object, hex ) { + + console.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' ); + return new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); + +} + +// + +Loader.prototype.extractUrlBase = function ( url ) { + + console.warn( 'THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.' ); + return LoaderUtils.extractUrlBase( url ); + +}; + +Loader.Handlers = { + + add: function ( /* regex, loader */ ) { + + console.error( 'THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.' ); + + }, + + get: function ( /* file */ ) { + + console.error( 'THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.' ); + + } + +}; + +function XHRLoader( manager ) { + + console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' ); + return new FileLoader( manager ); + +} + +function BinaryTextureLoader( manager ) { + + console.warn( 'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.' ); + return new DataTextureLoader( manager ); + +} + +// + +Box2.prototype.center = function ( optionalTarget ) { + + console.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' ); + return this.getCenter( optionalTarget ); + +}; + +Box2.prototype.empty = function () { + + console.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' ); + return this.isEmpty(); + +}; + +Box2.prototype.isIntersectionBox = function ( box ) { + + console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' ); + return this.intersectsBox( box ); + +}; + +Box2.prototype.size = function ( optionalTarget ) { + + console.warn( 'THREE.Box2: .size() has been renamed to .getSize().' ); + return this.getSize( optionalTarget ); + +}; + +// + +Box3.prototype.center = function ( optionalTarget ) { + + console.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' ); + return this.getCenter( optionalTarget ); + +}; + +Box3.prototype.empty = function () { + + console.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' ); + return this.isEmpty(); + +}; + +Box3.prototype.isIntersectionBox = function ( box ) { + + console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' ); + return this.intersectsBox( box ); + +}; + +Box3.prototype.isIntersectionSphere = function ( sphere ) { + + console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); + return this.intersectsSphere( sphere ); + +}; + +Box3.prototype.size = function ( optionalTarget ) { + + console.warn( 'THREE.Box3: .size() has been renamed to .getSize().' ); + return this.getSize( optionalTarget ); + +}; + +// + +Sphere.prototype.empty = function () { + + console.warn( 'THREE.Sphere: .empty() has been renamed to .isEmpty().' ); + return this.isEmpty(); + +}; + +// + +Frustum.prototype.setFromMatrix = function ( m ) { + + console.warn( 'THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().' ); + return this.setFromProjectionMatrix( m ); + +}; + +// + +Line3.prototype.center = function ( optionalTarget ) { + + console.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' ); + return this.getCenter( optionalTarget ); + +}; + +// + +Matrix3.prototype.flattenToArrayOffset = function ( array, offset ) { + + console.warn( 'THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' ); + return this.toArray( array, offset ); + +}; + +Matrix3.prototype.multiplyVector3 = function ( vector ) { + + console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' ); + return vector.applyMatrix3( this ); + +}; + +Matrix3.prototype.multiplyVector3Array = function ( /* a */ ) { + + console.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.' ); + +}; + +Matrix3.prototype.applyToBufferAttribute = function ( attribute ) { + + console.warn( 'THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.' ); + return attribute.applyMatrix3( this ); + +}; + +Matrix3.prototype.applyToVector3Array = function ( /* array, offset, length */ ) { + + console.error( 'THREE.Matrix3: .applyToVector3Array() has been removed.' ); + +}; + +Matrix3.prototype.getInverse = function ( matrix ) { + + console.warn( 'THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' ); + return this.copy( matrix ).invert(); + +}; + +// + +Matrix4.prototype.extractPosition = function ( m ) { + + console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' ); + return this.copyPosition( m ); + +}; + +Matrix4.prototype.flattenToArrayOffset = function ( array, offset ) { + + console.warn( 'THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' ); + return this.toArray( array, offset ); + +}; + +Matrix4.prototype.getPosition = function () { + + console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); + return new Vector3().setFromMatrixColumn( this, 3 ); + +}; + +Matrix4.prototype.setRotationFromQuaternion = function ( q ) { + + console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' ); + return this.makeRotationFromQuaternion( q ); + +}; + +Matrix4.prototype.multiplyToArray = function () { + + console.warn( 'THREE.Matrix4: .multiplyToArray() has been removed.' ); + +}; + +Matrix4.prototype.multiplyVector3 = function ( vector ) { + + console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); + return vector.applyMatrix4( this ); + +}; + +Matrix4.prototype.multiplyVector4 = function ( vector ) { + + console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); + return vector.applyMatrix4( this ); + +}; + +Matrix4.prototype.multiplyVector3Array = function ( /* a */ ) { + + console.error( 'THREE.Matrix4: .multiplyVector3Array() has been removed.' ); + +}; + +Matrix4.prototype.rotateAxis = function ( v ) { + + console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' ); + v.transformDirection( this ); + +}; + +Matrix4.prototype.crossVector = function ( vector ) { + + console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); + return vector.applyMatrix4( this ); + +}; + +Matrix4.prototype.translate = function () { + + console.error( 'THREE.Matrix4: .translate() has been removed.' ); + +}; + +Matrix4.prototype.rotateX = function () { + + console.error( 'THREE.Matrix4: .rotateX() has been removed.' ); + +}; + +Matrix4.prototype.rotateY = function () { + + console.error( 'THREE.Matrix4: .rotateY() has been removed.' ); + +}; + +Matrix4.prototype.rotateZ = function () { + + console.error( 'THREE.Matrix4: .rotateZ() has been removed.' ); + +}; + +Matrix4.prototype.rotateByAxis = function () { + + console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' ); + +}; + +Matrix4.prototype.applyToBufferAttribute = function ( attribute ) { + + console.warn( 'THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.' ); + return attribute.applyMatrix4( this ); + +}; + +Matrix4.prototype.applyToVector3Array = function ( /* array, offset, length */ ) { + + console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' ); + +}; + +Matrix4.prototype.makeFrustum = function ( left, right, bottom, top, near, far ) { + + console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' ); + return this.makePerspective( left, right, top, bottom, near, far ); + +}; + +Matrix4.prototype.getInverse = function ( matrix ) { + + console.warn( 'THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' ); + return this.copy( matrix ).invert(); + +}; + +// + +Plane.prototype.isIntersectionLine = function ( line ) { + + console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' ); + return this.intersectsLine( line ); + +}; + +// + +Quaternion.prototype.multiplyVector3 = function ( vector ) { + + console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' ); + return vector.applyQuaternion( this ); + +}; + +Quaternion.prototype.inverse = function ( ) { + + console.warn( 'THREE.Quaternion: .inverse() has been renamed to invert().' ); + return this.invert(); + +}; + +// + +Ray.prototype.isIntersectionBox = function ( box ) { + + console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' ); + return this.intersectsBox( box ); + +}; + +Ray.prototype.isIntersectionPlane = function ( plane ) { + + console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' ); + return this.intersectsPlane( plane ); + +}; + +Ray.prototype.isIntersectionSphere = function ( sphere ) { + + console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); + return this.intersectsSphere( sphere ); + +}; + +// + +Triangle.prototype.area = function () { + + console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' ); + return this.getArea(); + +}; + +Triangle.prototype.barycoordFromPoint = function ( point, target ) { + + console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' ); + return this.getBarycoord( point, target ); + +}; + +Triangle.prototype.midpoint = function ( target ) { + + console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' ); + return this.getMidpoint( target ); + +}; + +Triangle.prototypenormal = function ( target ) { + + console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' ); + return this.getNormal( target ); + +}; + +Triangle.prototype.plane = function ( target ) { + + console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' ); + return this.getPlane( target ); + +}; + +Triangle.barycoordFromPoint = function ( point, a, b, c, target ) { + + console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' ); + return Triangle.getBarycoord( point, a, b, c, target ); + +}; + +Triangle.normal = function ( a, b, c, target ) { + + console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' ); + return Triangle.getNormal( a, b, c, target ); + +}; + +// + +Shape.prototype.extractAllPoints = function ( divisions ) { + + console.warn( 'THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.' ); + return this.extractPoints( divisions ); + +}; + +Shape.prototype.extrude = function ( options ) { + + console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' ); + return new ExtrudeGeometry( this, options ); + +}; + +Shape.prototype.makeGeometry = function ( options ) { + + console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' ); + return new ShapeGeometry( this, options ); + +}; + +// + +Vector2.prototype.fromAttribute = function ( attribute, index, offset ) { + + console.warn( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' ); + return this.fromBufferAttribute( attribute, index, offset ); + +}; + +Vector2.prototype.distanceToManhattan = function ( v ) { + + console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' ); + return this.manhattanDistanceTo( v ); + +}; + +Vector2.prototype.lengthManhattan = function () { + + console.warn( 'THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().' ); + return this.manhattanLength(); + +}; + +// + +Vector3.prototype.setEulerFromRotationMatrix = function () { + + console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' ); + +}; + +Vector3.prototype.setEulerFromQuaternion = function () { + + console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' ); + +}; + +Vector3.prototype.getPositionFromMatrix = function ( m ) { + + console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' ); + return this.setFromMatrixPosition( m ); + +}; + +Vector3.prototype.getScaleFromMatrix = function ( m ) { + + console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' ); + return this.setFromMatrixScale( m ); + +}; + +Vector3.prototype.getColumnFromMatrix = function ( index, matrix ) { + + console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' ); + return this.setFromMatrixColumn( matrix, index ); + +}; + +Vector3.prototype.applyProjection = function ( m ) { + + console.warn( 'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.' ); + return this.applyMatrix4( m ); + +}; + +Vector3.prototype.fromAttribute = function ( attribute, index, offset ) { + + console.warn( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' ); + return this.fromBufferAttribute( attribute, index, offset ); + +}; + +Vector3.prototype.distanceToManhattan = function ( v ) { + + console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' ); + return this.manhattanDistanceTo( v ); + +}; + +Vector3.prototype.lengthManhattan = function () { + + console.warn( 'THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().' ); + return this.manhattanLength(); + +}; + +// + +Vector4.prototype.fromAttribute = function ( attribute, index, offset ) { + + console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' ); + return this.fromBufferAttribute( attribute, index, offset ); + +}; + +Vector4.prototype.lengthManhattan = function () { + + console.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' ); + return this.manhattanLength(); + +}; + +// + +Object3D.prototype.getChildByName = function ( name ) { + + console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' ); + return this.getObjectByName( name ); + +}; + +Object3D.prototype.renderDepth = function () { + + console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' ); + +}; + +Object3D.prototype.translate = function ( distance, axis ) { + + console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' ); + return this.translateOnAxis( axis, distance ); + +}; + +Object3D.prototype.getWorldRotation = function () { + + console.error( 'THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.' ); + +}; + +Object3D.prototype.applyMatrix = function ( matrix ) { + + console.warn( 'THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().' ); + return this.applyMatrix4( matrix ); + +}; + +Object.defineProperties( Object3D.prototype, { + + eulerOrder: { + get: function () { + + console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); + return this.rotation.order; + + }, + set: function ( value ) { + + console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); + this.rotation.order = value; + + } + }, + useQuaternion: { + get: function () { + + console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); + + }, + set: function () { + + console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); + + } + } + +} ); + +Mesh.prototype.setDrawMode = function () { + + console.error( 'THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' ); + +}; + +Object.defineProperties( Mesh.prototype, { + + drawMode: { + get: function () { + + console.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.' ); + return TrianglesDrawMode; + + }, + set: function () { + + console.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' ); + + } + } + +} ); + +SkinnedMesh.prototype.initBones = function () { + + console.error( 'THREE.SkinnedMesh: initBones() has been removed.' ); + +}; + +// + +PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) { + + console.warn( 'THREE.PerspectiveCamera.setLens is deprecated. ' + + 'Use .setFocalLength and .filmGauge for a photographic setup.' ); + + if ( filmGauge !== undefined ) this.filmGauge = filmGauge; + this.setFocalLength( focalLength ); + +}; + +// + +Object.defineProperties( Light.prototype, { + onlyShadow: { + set: function () { + + console.warn( 'THREE.Light: .onlyShadow has been removed.' ); + + } + }, + shadowCameraFov: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' ); + this.shadow.camera.fov = value; + + } + }, + shadowCameraLeft: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' ); + this.shadow.camera.left = value; + + } + }, + shadowCameraRight: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' ); + this.shadow.camera.right = value; + + } + }, + shadowCameraTop: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' ); + this.shadow.camera.top = value; + + } + }, + shadowCameraBottom: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' ); + this.shadow.camera.bottom = value; + + } + }, + shadowCameraNear: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' ); + this.shadow.camera.near = value; + + } + }, + shadowCameraFar: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' ); + this.shadow.camera.far = value; + + } + }, + shadowCameraVisible: { + set: function () { + + console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' ); + + } + }, + shadowBias: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' ); + this.shadow.bias = value; + + } + }, + shadowDarkness: { + set: function () { + + console.warn( 'THREE.Light: .shadowDarkness has been removed.' ); + + } + }, + shadowMapWidth: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' ); + this.shadow.mapSize.width = value; + + } + }, + shadowMapHeight: { + set: function ( value ) { + + console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' ); + this.shadow.mapSize.height = value; + + } + } +} ); + +// + +Object.defineProperties( BufferAttribute.prototype, { + + length: { + get: function () { + + console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' ); + return this.array.length; + + } + }, + dynamic: { + get: function () { + + console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' ); + return this.usage === DynamicDrawUsage; + + }, + set: function ( /* value */ ) { + + console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' ); + this.setUsage( DynamicDrawUsage ); + + } + } + +} ); + +BufferAttribute.prototype.setDynamic = function ( value ) { + + console.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.' ); + this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage ); + return this; + +}; + +BufferAttribute.prototype.copyIndicesArray = function ( /* indices */ ) { + + console.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' ); + +}, + +BufferAttribute.prototype.setArray = function ( /* array */ ) { + + console.error( 'THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' ); + +}; + +// + +BufferGeometry.prototype.addIndex = function ( index ) { + + console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' ); + this.setIndex( index ); + +}; + +BufferGeometry.prototype.addAttribute = function ( name, attribute ) { + + console.warn( 'THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().' ); + + if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) { + + console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' ); + + return this.setAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) ); + + } + + if ( name === 'index' ) { + + console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' ); + this.setIndex( attribute ); + + return this; + + } + + return this.setAttribute( name, attribute ); + +}; + +BufferGeometry.prototype.addDrawCall = function ( start, count, indexOffset ) { + + if ( indexOffset !== undefined ) { + + console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' ); + + } + + console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' ); + this.addGroup( start, count ); + +}; + +BufferGeometry.prototype.clearDrawCalls = function () { + + console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' ); + this.clearGroups(); + +}; + +BufferGeometry.prototype.computeOffsets = function () { + + console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' ); + +}; + +BufferGeometry.prototype.removeAttribute = function ( name ) { + + console.warn( 'THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().' ); + + return this.deleteAttribute( name ); + +}; + +BufferGeometry.prototype.applyMatrix = function ( matrix ) { + + console.warn( 'THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().' ); + return this.applyMatrix4( matrix ); + +}; + +Object.defineProperties( BufferGeometry.prototype, { + + drawcalls: { + get: function () { + + console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' ); + return this.groups; + + } + }, + offsets: { + get: function () { + + console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' ); + return this.groups; + + } + } + +} ); + +InterleavedBuffer.prototype.setDynamic = function ( value ) { + + console.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.' ); + this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage ); + return this; + +}; + +InterleavedBuffer.prototype.setArray = function ( /* array */ ) { + + console.error( 'THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' ); + +}; + +// + +ExtrudeGeometry.prototype.getArrays = function () { + + console.error( 'THREE.ExtrudeGeometry: .getArrays() has been removed.' ); + +}; + +ExtrudeGeometry.prototype.addShapeList = function () { + + console.error( 'THREE.ExtrudeGeometry: .addShapeList() has been removed.' ); + +}; + +ExtrudeGeometry.prototype.addShape = function () { + + console.error( 'THREE.ExtrudeGeometry: .addShape() has been removed.' ); + +}; + +// + +Scene.prototype.dispose = function () { + + console.error( 'THREE.Scene: .dispose() has been removed.' ); + +}; + +// + +Uniform.prototype.onUpdate = function () { + + console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' ); + return this; + +}; + +// + +Object.defineProperties( Material.prototype, { + + wrapAround: { + get: function () { + + console.warn( 'THREE.Material: .wrapAround has been removed.' ); + + }, + set: function () { + + console.warn( 'THREE.Material: .wrapAround has been removed.' ); + + } + }, + + overdraw: { + get: function () { + + console.warn( 'THREE.Material: .overdraw has been removed.' ); + + }, + set: function () { + + console.warn( 'THREE.Material: .overdraw has been removed.' ); + + } + }, + + wrapRGB: { + get: function () { + + console.warn( 'THREE.Material: .wrapRGB has been removed.' ); + return new Color(); + + } + }, + + shading: { + get: function () { + + console.error( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); + + }, + set: function ( value ) { + + console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); + this.flatShading = ( value === FlatShading ); + + } + }, + + stencilMask: { + get: function () { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + return this.stencilFuncMask; + + }, + set: function ( value ) { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + this.stencilFuncMask = value; + + } + }, + + vertexTangents: { + get: function () { + + console.warn( 'THREE.' + this.type + ': .vertexTangents has been removed.' ); + + }, + set: function () { + + console.warn( 'THREE.' + this.type + ': .vertexTangents has been removed.' ); + + } + }, + +} ); + +Object.defineProperties( ShaderMaterial.prototype, { + + derivatives: { + get: function () { + + console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); + return this.extensions.derivatives; + + }, + set: function ( value ) { + + console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); + this.extensions.derivatives = value; + + } + } + +} ); + +// + +WebGLRenderer.prototype.clearTarget = function ( renderTarget, color, depth, stencil ) { + + console.warn( 'THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.' ); + this.setRenderTarget( renderTarget ); + this.clear( color, depth, stencil ); + +}; + +WebGLRenderer.prototype.animate = function ( callback ) { + + console.warn( 'THREE.WebGLRenderer: .animate() is now .setAnimationLoop().' ); + this.setAnimationLoop( callback ); + +}; + +WebGLRenderer.prototype.getCurrentRenderTarget = function () { + + console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' ); + return this.getRenderTarget(); + +}; + +WebGLRenderer.prototype.getMaxAnisotropy = function () { + + console.warn( 'THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().' ); + return this.capabilities.getMaxAnisotropy(); + +}; + +WebGLRenderer.prototype.getPrecision = function () { + + console.warn( 'THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.' ); + return this.capabilities.precision; + +}; + +WebGLRenderer.prototype.resetGLState = function () { + + console.warn( 'THREE.WebGLRenderer: .resetGLState() is now .state.reset().' ); + return this.state.reset(); + +}; + +WebGLRenderer.prototype.supportsFloatTextures = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' ); + return this.extensions.get( 'OES_texture_float' ); + +}; + +WebGLRenderer.prototype.supportsHalfFloatTextures = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' ); + return this.extensions.get( 'OES_texture_half_float' ); + +}; + +WebGLRenderer.prototype.supportsStandardDerivatives = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' ); + return this.extensions.get( 'OES_standard_derivatives' ); + +}; + +WebGLRenderer.prototype.supportsCompressedTextureS3TC = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' ); + return this.extensions.get( 'WEBGL_compressed_texture_s3tc' ); + +}; + +WebGLRenderer.prototype.supportsCompressedTexturePVRTC = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' ); + return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' ); + +}; + +WebGLRenderer.prototype.supportsBlendMinMax = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' ); + return this.extensions.get( 'EXT_blend_minmax' ); + +}; + +WebGLRenderer.prototype.supportsVertexTextures = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' ); + return this.capabilities.vertexTextures; + +}; + +WebGLRenderer.prototype.supportsInstancedArrays = function () { + + console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' ); + return this.extensions.get( 'ANGLE_instanced_arrays' ); + +}; + +WebGLRenderer.prototype.enableScissorTest = function ( boolean ) { + + console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' ); + this.setScissorTest( boolean ); + +}; + +WebGLRenderer.prototype.initMaterial = function () { + + console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' ); + +}; + +WebGLRenderer.prototype.addPrePlugin = function () { + + console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' ); + +}; + +WebGLRenderer.prototype.addPostPlugin = function () { + + console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' ); + +}; + +WebGLRenderer.prototype.updateShadowMap = function () { + + console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' ); + +}; + +WebGLRenderer.prototype.setFaceCulling = function () { + + console.warn( 'THREE.WebGLRenderer: .setFaceCulling() has been removed.' ); + +}; + +WebGLRenderer.prototype.allocTextureUnit = function () { + + console.warn( 'THREE.WebGLRenderer: .allocTextureUnit() has been removed.' ); + +}; + +WebGLRenderer.prototype.setTexture = function () { + + console.warn( 'THREE.WebGLRenderer: .setTexture() has been removed.' ); + +}; + +WebGLRenderer.prototype.setTexture2D = function () { + + console.warn( 'THREE.WebGLRenderer: .setTexture2D() has been removed.' ); + +}; + +WebGLRenderer.prototype.setTextureCube = function () { + + console.warn( 'THREE.WebGLRenderer: .setTextureCube() has been removed.' ); + +}; + +WebGLRenderer.prototype.getActiveMipMapLevel = function () { + + console.warn( 'THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().' ); + return this.getActiveMipmapLevel(); + +}; + +Object.defineProperties( WebGLRenderer.prototype, { + + shadowMapEnabled: { + get: function () { + + return this.shadowMap.enabled; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' ); + this.shadowMap.enabled = value; + + } + }, + shadowMapType: { + get: function () { + + return this.shadowMap.type; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' ); + this.shadowMap.type = value; + + } + }, + shadowMapCullFace: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' ); + return undefined; + + }, + set: function ( /* value */ ) { + + console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' ); + + } + }, + context: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.' ); + return this.getContext(); + + } + }, + vr: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .vr has been renamed to .xr' ); + return this.xr; + + } + }, + gammaInput: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' ); + return false; + + }, + set: function () { + + console.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' ); + + } + }, + gammaOutput: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' ); + return false; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' ); + this.outputEncoding = ( value === true ) ? sRGBEncoding : LinearEncoding; + + } + }, + toneMappingWhitePoint: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' ); + return 1.0; + + }, + set: function () { + + console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' ); + + } + }, + gammaFactor: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' ); + return 2; + + }, + set: function () { + + console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' ); + + } + } +} ); + +Object.defineProperties( WebGLShadowMap.prototype, { + + cullFace: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' ); + return undefined; + + }, + set: function ( /* cullFace */ ) { + + console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' ); + + } + }, + renderReverseSided: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' ); + return undefined; + + }, + set: function () { + + console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' ); + + } + }, + renderSingleSided: { + get: function () { + + console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' ); + return undefined; + + }, + set: function () { + + console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' ); + + } + } + +} ); + +function WebGLRenderTargetCube( width, height, options ) { + + console.warn( 'THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).' ); + return new WebGLCubeRenderTarget( width, options ); + +} + +// + +Object.defineProperties( WebGLRenderTarget.prototype, { + + wrapS: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); + return this.texture.wrapS; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); + this.texture.wrapS = value; + + } + }, + wrapT: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); + return this.texture.wrapT; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); + this.texture.wrapT = value; + + } + }, + magFilter: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); + return this.texture.magFilter; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); + this.texture.magFilter = value; + + } + }, + minFilter: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); + return this.texture.minFilter; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); + this.texture.minFilter = value; + + } + }, + anisotropy: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); + return this.texture.anisotropy; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); + this.texture.anisotropy = value; + + } + }, + offset: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); + return this.texture.offset; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); + this.texture.offset = value; + + } + }, + repeat: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); + return this.texture.repeat; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); + this.texture.repeat = value; + + } + }, + format: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); + return this.texture.format; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); + this.texture.format = value; + + } + }, + type: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); + return this.texture.type; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); + this.texture.type = value; + + } + }, + generateMipmaps: { + get: function () { + + console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); + return this.texture.generateMipmaps; + + }, + set: function ( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); + this.texture.generateMipmaps = value; + + } + } + +} ); + +// + +Audio.prototype.load = function ( file ) { + + console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' ); + const scope = this; + const audioLoader = new AudioLoader(); + audioLoader.load( file, function ( buffer ) { + + scope.setBuffer( buffer ); + + } ); + return this; + +}; + + +AudioAnalyser.prototype.getData = function () { + + console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' ); + return this.getFrequencyData(); + +}; + +// + +CubeCamera.prototype.updateCubeMap = function ( renderer, scene ) { + + console.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' ); + return this.update( renderer, scene ); + +}; + +CubeCamera.prototype.clear = function ( renderer, color, depth, stencil ) { + + console.warn( 'THREE.CubeCamera: .clear() is now .renderTarget.clear().' ); + return this.renderTarget.clear( renderer, color, depth, stencil ); + +}; + +ImageUtils.crossOrigin = undefined; + +ImageUtils.loadTexture = function ( url, mapping, onLoad, onError ) { + + console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' ); + + const loader = new TextureLoader(); + loader.setCrossOrigin( this.crossOrigin ); + + const texture = loader.load( url, onLoad, undefined, onError ); + + if ( mapping ) texture.mapping = mapping; + + return texture; + +}; + +ImageUtils.loadTextureCube = function ( urls, mapping, onLoad, onError ) { + + console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' ); + + const loader = new CubeTextureLoader(); + loader.setCrossOrigin( this.crossOrigin ); + + const texture = loader.load( urls, onLoad, undefined, onError ); + + if ( mapping ) texture.mapping = mapping; + + return texture; + +}; + +ImageUtils.loadCompressedTexture = function () { + + console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' ); + +}; + +ImageUtils.loadCompressedTextureCube = function () { + + console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' ); + +}; + +// + +function CanvasRenderer() { + + console.error( 'THREE.CanvasRenderer has been removed' ); + +} + +// + +function JSONLoader() { + + console.error( 'THREE.JSONLoader has been removed.' ); + +} + +// + +const SceneUtils = { + + createMultiMaterialObject: function ( /* geometry, materials */ ) { + + console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' ); + + }, + + detach: function ( /* child, parent, scene */ ) { + + console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' ); + + }, + + attach: function ( /* child, scene, parent */ ) { + + console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' ); + + } + +}; + +// + +function LensFlare() { + + console.error( 'THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js' ); + +} + +// + +function ParametricGeometry() { + + console.error( 'THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js' ); + return new BufferGeometry(); + +} + +function TextGeometry() { + + console.error( 'THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js' ); + return new BufferGeometry(); + +} + +function FontLoader() { + + console.error( 'THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js' ); + +} + +function Font() { + + console.error( 'THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js' ); + +} + +function ImmediateRenderObject() { + + console.error( 'THREE.ImmediateRenderObject has been removed.' ); + +} + +if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { + revision: REVISION, + } } ) ); + +} + +if ( typeof window !== 'undefined' ) { + + if ( window.__THREE__ ) { + + console.warn( 'WARNING: Multiple instances of Three.js being imported.' ); + + } else { + + window.__THREE__ = REVISION; + + } + +} + + + + +/***/ }), +/* 100 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** +* implementation : +* cf. http://uihacker.blogspot.fr/2011/07/javascript-formatting-latitudelongitude.html?m=1 +* cf. http://andrew.hedges.name/experiments/convert_lat_long/ +* FIXME formater la sortie +* cf. http://mottie.github.io/javascript-number-formatter/ +* cf. https://github.com/j-/number-formatter +* +*/ +/** ... */ +var PositionFormater = { + /** ... */ + NORTH: "N", + /** ... */ + SOUTH: "S", + /** ... */ + EAST: "E", + /** ... */ + WEST: "W", + /** ... */ + digitSecond: 2, + /** ... */ + digitDecimal: 5, + /** ... */ + digitRadian: 8, + roundToDecimal: function roundToDecimal(inputNum, numPoints) { + var multiplier = Math.pow(10, numPoints); + return Math.round(inputNum * multiplier) / multiplier; + }, + decimalToRadian: function decimalToRadian(location) { + var d = 0.01745329251994329577; + return this.roundToDecimal(location * d, this.digitRadian); + }, + decimalToGrade: function decimalToGrade(location) { + var d = 1.11111111111111111111; + return this.roundToDecimal(location * d, this.digitRadian); + }, + decimalToDMS: function decimalToDMS(location, hemisphere) { + if (location < 0) { + location *= -1; // strip dash '-' + } + + var degrees = Math.floor(location); // strip decimal remainer for degrees + var minutesFromRemainder = (location - degrees) * 60; // multiply the remainer by 60 + var minutes = Math.floor(minutesFromRemainder); // get minutes from integer + var secondsFromRemainder = (minutesFromRemainder - minutes) * 60; // multiply the remainer by 60 + var seconds = this.roundToDecimal(secondsFromRemainder, this.digitSecond); // get minutes by rounding to integer + + var dms = degrees + "° " + minutes + "' " + seconds + "\" "; + if (hemisphere) { + dms += hemisphere; + } + return dms; + }, + decimalLatToDMS: function decimalLatToDMS(location) { + var hemisphere = location < 0 ? this.SOUTH : this.NORTH; // south if negative + return this.decimalToDMS(location, hemisphere); + }, + decimalLongToDMS: function decimalLongToDMS(location) { + var hemisphere = location < 0 ? this.WEST : this.EAST; // west if negative + return this.decimalToDMS(location, hemisphere); + }, + DMSToDecimal: function DMSToDecimal(degrees, minutes, seconds, hemisphere) { + var ddVal = degrees + minutes / 60 + seconds / 3600; + ddVal = hemisphere === this.SOUTH || hemisphere === this.WEST ? ddVal * -1 : ddVal; + var decimal = this.roundToDecimal(ddVal, this.digitDecimal); + return decimal; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (PositionFormater); + +/***/ }), +/* 101 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +var CRS = { + /** + * CRS : WGS84 + * + * @property EPSG:4326 + * @private + */ + "EPSG:4326": "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +units=degrees", + /** + * CRS : PseudoMercator + * + * @property EPSG:3857 + * @private + */ + "EPSG:3857": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", + /** + * CRS : Lambert 93 + * + * @property EPSG:2154 + * @private + */ + "EPSG:2154": "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + /** + * CRS : Lambert 2 extended + * + * @property EPSG:27572 + * @private + */ + "EPSG:27572": "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs", + /** + * CRS : UTM 20N (Guadeloupe, Martinique) + * + * @property EPSG:32620 + * @private + */ + "EPSG:32620": "+proj=utm +zone=20 +ellps=WGS84 +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 21N (Saint-Pierre-et-Miquelon) + * + * @property EPSG:4467 + * @private + */ + "EPSG:4467": "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + /** + * CRS : UTM 22N (Guyane) + * + * @property EPSG:2972 + * @private + */ + "EPSG:2972": "+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + /** + * CRS : UTM 30N (France métropolitaine) + * + * @property EPSG:32630 + * @private + */ + "EPSG:32630": "+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 31N (France métropolitaine) + * + * @property EPSG:32631 + * @private + */ + "EPSG:32631": "+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 32N (France métropolitaine) + * + * @property EPSG:32632 + * @private + */ + "EPSG:32632": "+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 38S (Mayotte) + * + * @property EPSG:4471 + * @private + */ + "EPSG:4471": "+proj=utm +zone=38 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + /** + * CRS : UTM 40S (Réunion) + * + * @property EPSG:2975 + * @private + */ + "EPSG:2975": "+proj=utm +zone=40 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + /** + * CRS : UTM 5S (Polynésie) + * + * @property EPSG:3296 + * @private + */ + "EPSG:3296": "+proj=utm +zone=5 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs", + /** + * CRS : UTM 6S (Polynésie) + * + * @property EPSG:3297 + * @private + */ + "EPSG:3297": "+proj=utm +zone=6 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs", + /** + * CRS : UTM 7S (Polynésie) + * + * @property EPSG:32707 + * @private + */ + "EPSG:32707": "+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 8S (Polynésie) + * + * @property EPSG:32708 + * @private + */ + "EPSG:32708": "+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 12N (Ile de Clipperton) + * + * @property EPSG:26912 + * @private + */ + "EPSG:26912": "+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + /** + * CRS : UTM 42S (Iles Kerguelen) + * + * @property EPSG:32742 + * @private + */ + "EPSG:32742": "+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 39S (Iles Crozet) + * + * @property EPSG:32739 + * @private + */ + "EPSG:32739": "+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 43S (Iles St-Paul et Amsterdam) + * + * @property EPSG:32743 + * @private + */ + "EPSG:32743": "+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs", + /** + * CRS : Stéréographique polaire (Terre Adelie) + * + * @property EPSG:2986 + * @private + */ + "EPSG:2986": "", + /** + * CRS : UTM 37S (Iles du canal de Mozambique) + * + * @property EPSG:32737 + * @private + */ + "EPSG:32737": "+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 38S (Iles du canal de Mozambique) + * + * @property EPSG:32738 + * @private + */ + "EPSG:32738": "+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs", + /** + * CRS : UTM 1S (Wallis-et-Futuna) + * + * @property EPSG:2988 + * @private + */ + "EPSG:2988": "+proj=utm +zone=1 +south +ellps=intl +towgs84=253,-132,-127,0,0,0,0 +units=m +no_defs", + /** + * CRS : RGNC91-93 (Nouvelle-Calédonie) + * + * @property EPSG:3163 + * @private + */ + "EPSG:3163": "+proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" +}; +/* harmony default export */ __webpack_exports__["default"] = (CRS); + +/***/ }), +/* 102 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(103); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } + + + + + + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__["default"].getLogger("LayerSwitcher"); + +/** + * @classdesc + * Control to manage globe layers : their order, visibility and opacity, and display their informations (title, description, legends, metadata...) + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.LayerSwitcher + * @param {Object} lsOptions - control options + * @param {Array} [lsOptions.layers] - list of layers to be configured. Each array element is an object, with following properties : + * @param {String} [lsOptions.layers.id] - ol.layer.Layer layer to be configured (that has been added to globe) + * @param {Object} [lsOptions.layers.config] - custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties : + * @param {String} [lsOptions.layers.config.title] - layer alias, to be displayed in widget layer list. E.g. : "Cartes IGN" + * @param {String} [lsOptions.layers.config.description] - layer description, to be displayed on title hover, or in layer information panel. + * @param {String} [lsOptions.layers.config.quicklookUrl] - link to a quick look image for this layer. + * @param {Array} [lsOptions.layers.config.legends] - array of layer legends. Each array element is an object, with following properties : + * - url (String, mandatory) : link to a legend + * - minScaleDenominator (Number, optional) : min scale denominator for legend validity. + * @param {Array} [lsOptions.layers.config.metadata] - array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata + * @param {Object} [lsOptions.options] - Itowns.control.Control options + * @param {Boolean} [lsOptions.options.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading. + * @example + * var layerSwitcher = new itowns.control.LayerSwitcher({ + * layers : [ + * { + * id : "myLayer", + * config : { + * title : "test layer name 1", + * description : "test layer desc 1", + * } + * } + * ], + * options : { + * collapsed : false + * } + * )); + */ +function LayerSwitcher(lsOptions) { + lsOptions = lsOptions || {}; + var options = lsOptions.options || {}; + var layers = lsOptions.layers || []; + if (!(this instanceof LayerSwitcher)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + if (!Array.isArray(layers)) { + throw new Error("ERROR WRONG_TYPE : layers should be an array"); + } + if (_typeof(options) !== "object") { + throw new Error("ERROR WRONG_TYPE : options should be an object"); + } + this._initialize(options, layers); + var container = this._initContainer(options); + // property to save layers conf added after the LS is initialized + this._addedLayerConf = {}; + _Widget__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, { + name: "LayerSwitcher", + element: container, + target: options.target, + position: options.position + }); +} + +/* + * @lends module:LayerSwitcher + */ +LayerSwitcher.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_5__["default"].prototype, {}); + +// retrieves methods of the common class LayerSwitcherDOM +_Common_Utils__WEBPACK_IMPORTED_MODULE_2__["default"].assign(LayerSwitcher.prototype, _Common_Controls_LayerSwitcherDOM__WEBPACK_IMPORTED_MODULE_4__["default"]); + +/** + * Constructor (alias) + * + * @private + */ +LayerSwitcher.prototype.constructor = LayerSwitcher; + +// ################################################################### // +// ############## public methods (getters, setters) ################## // +// ################################################################### // + +/** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ +LayerSwitcher.prototype.setGlobe = function (globe) { + var layers; + if (globe) { + // in the case the control is added to the globe + var self = this; + + // add options layers to layerlist. + // (only the layers configurated by the user in the options of the layerSwitcher ) + // the other layers of the map will be added in the setGlobe method + for (var i = 0; i < this._initLayers.length; i++) { + // retrieves the layer... + var layer = null; + if (this._initLayers[i].id) { + layer = globe.getLayerById(this._initLayers[i].id); + } + if (layer && this._initLayers[i].displayed) { + // .. and the infos of the configuration if they exist (title, description, legends, quicklook, metadata) + var conf = this._initLayers[i].config || {}; + var layerOptions = { + title: conf.title || layer.title || this._initLayers[i].id, + description: conf.description || null, + legends: conf.legends || [], + metadata: conf.metadata || [], + quicklookUrl: conf.quicklookUrl || null + }; + if (typeof conf.ipr !== "undefined") { + layerOptions.ipr = conf.ipr; + } + if (typeof conf.opacity !== "undefined") { + layerOptions.opacity = conf.opacity; + } + if (typeof conf.visibility !== "undefined") { + layerOptions.visibility = conf.visibility; + } + this._layers[layer.id] = layerOptions; + } + } + + // adds the layers + this._addGlobeLayers(globe); + + // adding of listeners + this._callbacks.onOpacityLayerCallBack = function (e) { + self._updateLayerOpacity(e.target.id, e["new"].opacity); + }; + this._callbacks.onVisibilityLayerCallBack = function (e) { + self._updateLayerVisibility(e.target.id, e["new"].visible); + }; + + // At every globe movement, layer switcher may be updated, + // according to layers on globe, and their range. + this._callbacks.onChangedViewCallBack = function (e) { + self._inRangeUpdate(e.colorLayersId); + }; + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack); + // prerender events returns visible layers + globe.preRenderEventFetchColorLayersDisplayed(); + this._callbacks.onAddedLayerCallBack = function (e) { + var id = e.layerId; + if (self) { + if (!self._layerDisplayedInLayerSwitcher(id)) { + return; + } + var layer = self.getGlobe().getLayerById(id); + if (layer.type === "elevation") { + return; + } + var layerConf = self._getLayerConf(id) || self._addedLayerConf[id]; + if (layerConf) { + self.addLayer(layer, layerConf); + } else { + self.addLayer(layer); + } + } + }; + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack); + this._callbacks.onRemovedLayerCallBack = function (e) { + var id = e.layerId; + + // update the index max and delete the layer from the layerswitcher + if (self) { + self.removeLayer(id); + } + }; + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack); + this._callbacks.onIndexLayerCallBack = function (e) { + var arraysEquals = function arraysEquals(a1, a2) { + if (a1.length !== a2.length) { + return false; + } + for (var i = 0; i < a1.length; ++i) { + if (a1[i] !== a2[i]) { + return false; + } + } + return true; + }; + if (!arraysEquals(e["new"].sequence, e.previous.sequence)) { + self._updateLayerListContainer(); + } + }; + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack); + layers = globe.getColorLayers(); + for (var ii = 0; ii < layers.length; ++ii) { + globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack); + globe.addLayerListener(layers[ii], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack); + self._updateLayerVisibility(layers[ii].id, layers[ii].visible); + self._updateLayerOpacity(layers[ii].id, layers[ii].opacity); + } + } else { + // removes the listeners associated to the deleted layerswitcher + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.PRE_RENDER, this._callbacks.onChangedViewCallBack); + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.LAYER_ADDED, this._callbacks.onAddedLayerCallBack); + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.LAYER_REMOVED, this._callbacks.onRemovedLayerCallBack); + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.LAYERS_ORDER_CHANGED, this._callbacks.onIndexLayerCallBack); + layers = this._globe.getColorLayers(); + for (var j = 0; j < layers.length; ++j) { + this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack); + this._globe.removeLayerListener(layers[j], _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack); + } + // deletes the layerSwitcher DOM + while (this._element.hasChildNodes()) { + this._element.removeChild(this._element.lastChild); + } + this._element.parentNode.removeChild(this._element); + } + + // calls original setGlobe method + _Widget__WEBPACK_IMPORTED_MODULE_5__["default"].prototype.setGlobe.call(this, globe); +}; + +/** + * Adds a new layer to control (when added to globe) or add new layer configuration + * + * @param {Object} layer - layer to add to layer switcher + * @param {Object} [config] - additional options for layer configuration + * @param {Object} [config.title] - layer title (default is layer identifier) + * @param {Object} [config.description] - layer description (default is null) + * @param {Object} [config.legends] - layer legends (default is an empty array) + * @param {Object} [config.metadata] - layer metadata (default is an empty array) + * @param {Object} [config.quicklookUrl] - layer quicklookUrl (default is null) + * @example + * layerSwitcher.addLayer({ + * layer : gpParcels, + * config : { + * title : "Parcelles cadastrales", + * description : "description de la couche", + * quicklookUrl : "http://quicklookUrl.fr" + * } + * }) + */ +LayerSwitcher.prototype.addLayer = function (layer, config) { + config = config || {}; + var globe = this.getGlobe(); + if (!layer) { + logger.error("LayerSwitcher:addLayer - missing layer parameter"); + return; + } + var id = layer.id; + if (id === "undefined") { + logger.error("LayerSwitcher:addLayer - configuration cannot be set for " + layer + " layer (layer id not found)"); + return; + } + + // subscription to the events + globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.OPACITY_PROPERTY_CHANGED, this._callbacks.onOpacityLayerCallBack); + globe.addLayerListener(layer, _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.VISIBLE_PROPERTY_CHANGED, this._callbacks.onVisibilityLayerCallBack); + + // make sure layer is in globe layers + var LayerInGlobe = globe.getLayerById(id); + if (!LayerInGlobe) { + logger.error("LayerSwitcher:addLayer - configuration cannot be set for ", layer, " layer (layer is not in globe layers )"); + return; + } + + // if layer is not already in layers list, add it to control (layers list and container div) + if (!this._layers[id]) { + // 1. add layer to layers list + var layerInfos = this._getLayerInfo(layer) || {}; + var layerOptions = { + title: config.title || layerInfos._title || id, + description: config.description || layerInfos._description || null, + legends: config.legends || layerInfos._legends || [], + metadata: config.metadata || layerInfos._metadata || [], + quicklookUrl: config.quicklookUrl || layerInfos._quicklookUrl || null + }; + if (typeof config.ipr !== "undefined") { + layerOptions.ipr = config.ipr; + layer.attribution = layerOptions.ipr; + } + if (typeof config.opacity !== "undefined") { + layerOptions.opacity = config.opacity; + layer.opacity = layerOptions.opacity; + } + if (typeof config.visibility !== "undefined") { + layerOptions.visibility = config.visibility; + layer.visible = layerOptions.visibility; + } + this._layers[id] = layerOptions; + + // creation of the div of the layer which will be added to the layerSwitcher + this._layers[id].div = this._createLayerDiv(id); + this._updateLayerListContainer(); + + // user may also add a new configuration for an already added layer + } else { + // add new configuration parameters to layer informations + for (var prop in config) { + if (config.hasOwnProperty(prop)) { + this._layers[id][prop] = config[prop]; + } + } + if (typeof config.ipr !== "undefined") { + layer.attribution = config.ipr; + } + if (typeof config.opacity !== "undefined") { + layer.opacity = config.opacity; + } + if (typeof config.visibility !== "undefined") { + layer.visible = config.visibility; + } + // set new title in layer div + if (config.title) { + var nameDiv = document.getElementById(this._addUID("GPname_ID_" + id)); + if (nameDiv) { + nameDiv.innerHTML = config.title; + // FIXME a ajouter? + // nameDiv.title = config.description || config.title; + } + } + // add layer info picto if necessary + var infodiv = document.getElementById(this._addUID("GPinfo_ID_" + id)); + if (!document.getElementById(this._addUID("GPinfo_ID_" + id)) && config.description && (config.legends || config.metadata || config.quicklookUrl)) { + var advancedTools = document.getElementById(this._addUID("GPadvancedTools_ID_" + id)); + if (advancedTools) { + advancedTools.appendChild(this._createAdvancedToolInformationElement({ + id: id + })); + } + } + // close layer info element if open, to update information. + if (infodiv && infodiv.className === "GPlayerInfoOpened") { + document.getElementById(this._addUID("GPlayerInfoPanel")).className = "GPlayerInfoPanelClosed"; + infodiv.className = "GPlayerInfo"; + } + } +}; + +/** + * Removes a layer from control + * + * @param {Object} layerId - layer to remove to layer switcher + */ +LayerSwitcher.prototype.removeLayer = function (layerId) { + var layerList = document.getElementById(this._addUID("GPlayersList")); + // close layer info element if open. + var infodiv = document.getElementById(this._addUID("GPinfo_ID_" + layerId)); + if (infodiv && infodiv.className === "GPlayerInfoOpened") { + document.getElementById(this._addUID("GPlayerInfoPanel")).className = "GPlayerInfoPanelClosed"; + infodiv.className = "GPlayerInfo"; + } + // remove layer div + var layerDiv = document.getElementById(this._addUID("GPlayerSwitcher_ID_" + layerId)); + + // no layerDiv retrieved for VT-label layers + if (layerDiv) { + layerList.removeChild(layerDiv); + } + + // removes layer of the layer list + delete this._layers[layerId]; +}; + +/** + * Collapse or display control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ +LayerSwitcher.prototype.setCollapsed = function (collapsed) { + if (collapsed === undefined) { + logger.error("LayerSwitcher:setCollapsed - missing collapsed parameter"); + return; + } + var isCollapsed = this.getCollapsed(); + if (collapsed && isCollapsed || !collapsed && !isCollapsed) { + return; + } + // simulates the panel opening after a click + if (!isCollapsed) { + var layers = document.getElementsByClassName("GPlayerInfoOpened"); + for (var i = 0; i < layers.length; i++) { + layers[i].className = "GPlayerInfo"; + } + document.getElementById(this._addUID("GPlayerInfoPanel")).className = "GPlayerInfoPanelClosed"; + } + document.getElementById(this._addUID("GPshowLayersList")).checked = !collapsed; +}; + +/** + * Returns true if widget is collapsed (minimize), false otherwise + * @return {Boolean} is collapsed + */ +LayerSwitcher.prototype.getCollapsed = function () { + return !document.getElementById(this._addUID("GPshowLayersList")).checked; +}; + +// ################################################################### // +// ##################### init component ############################## // +// ################################################################### // + +/** + * Initialize LayerSwitcher control (called by constructor) + * + * @param {Object} options - Itowns.control.Control options + * @param {Array} layers - list of layers to be configured. Each array element is an object, with following properties : + * @private + */ +LayerSwitcher.prototype._initialize = function (options, layers) { + // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page) + this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__["default"].generate(); + + // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, opacity, visibility, title, description...) + this._layers = {}; + + // div which will contain the divs of the lists + this._layerListContainer = null; + + // callbacks + this._callbacks = {}; + + // options + this._options = options; + this._initLayers = layers; +}; + +/** + * Returns the layer configuration defined at widget initialization + * + * @method _getLayerConf + * @param {String} layerId - layer id + * @return {Object} layerConfig - layer configuration + * @private + */ +LayerSwitcher.prototype._getLayerConf = function (layerId) { + for (var i = 0; i < this._initLayers.length; ++i) { + if (this._initLayers[i].id === layerId) { + return this._initLayers[i].config; + } + } + return null; +}; + +/** + * Indicates if the layer must be displayed in the layerSwitcher + * + * @method _layerDisplayedInLayerSwitcher + * @param {String} layerId - layer id + * @return {Boolean} displayed + * @private + */ +LayerSwitcher.prototype._layerDisplayedInLayerSwitcher = function (layerId) { + for (var i = 0; i < this._initLayers.length; ++i) { + if (this._initLayers[i].id === layerId) { + return typeof this._initLayers[i].displayed === "undefined" || this._initLayers[i].displayed; + } + } + return true; +}; + +/** + * Creates control main container + * + * @method _initContainer + * @param {Object} options - control options + * @returns {DOMElement} container - widget container + * @private + */ +LayerSwitcher.prototype._initContainer = function (options) { + // creation of the main container + var container = this._createMainContainerElement(); + + // adding in the main container + var input = this._createMainLayersShowElement(); + container.appendChild(input); + + // handling of the "collapsed" mode + if (!options.collapsed) { + input.checked = "checked"; + } + // adds the layer list in the main container + var divL = this._layerListContainer = this._createMainLayersElement(); + container.appendChild(divL); + + // creates the draggable mode + this._createDraggableElement(divL, this); + + // adds the control picto in the main container + var picto = this._createMainPictoElement(); + container.appendChild(picto); + + // adds the info panel in the main container + var divI = this._createMainInfoElement(); + container.appendChild(divI); + return container; +}; + +/** + * Adds control layers to control main container + * + * @method _addGlobeLayers + * @param {Object} globe - the Itowns.GlobeViewExtended object + * @private + */ +LayerSwitcher.prototype._addGlobeLayers = function (globe) { + // Retrieves the element which contains the different layers + var elementLayersList; + var childNodes = this.getElement().childNodes; + for (var i = 0; i < childNodes.length; i++) { + if (childNodes[i].id === this._addUID("GPlayersList")) { + elementLayersList = childNodes[i]; + break; + } + } + // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array) + var layers = globe.getColorLayers(); + var orderedLayers = layers.sort(function (a, b) { + return b.sequence - a.sequence; + }); + + // loop over all the layers of the map in order to add them to the control layer list (if they are not already added) + orderedLayers.forEach(function (layer) { + // adds the map layers to the list + var id; + id = layer.id; + if (!this._layerDisplayedInLayerSwitcher(id)) { + return; + } + var layerConf = this._getLayerConf(id) || this._addedLayerConf[id] || {}; + var layerInfos = this._getLayerInfo(layer) || {}; + if (!this._layers[id]) { + // if the layer is not yet in the layer list (this._layers), we add it + var layerOptions = { + title: layerConf.title || layerInfos._title || id, + description: layerConf.description || layerInfos._description || null, + legends: layerConf.legends || layerInfos._legends || [], + metadata: layerConf.metadata || layerInfos._metadata || [], + quicklookUrl: layerConf.quicklookUrl || layerInfos._quicklookUrl || null + }; + this._layers[id] = layerOptions; + } else { + var lsLayerConf = this._layers[id]; + if (typeof lsLayerConf.ipr !== "undefined") { + layer.options.attribution = lsLayerConf.ipr; + } + if (typeof lsLayerConf.opacity !== "undefined") { + layer.opacity = lsLayerConf.opacity; + } + if (typeof lsLayerConf.visibility !== "undefined") { + layer.visible = lsLayerConf.visibility; + } + } + var layerDiv = this._createLayerDiv(id); + this._layers[id].div = layerDiv; + elementLayersList.appendChild(layerDiv); + }, this); +}; + +/** + * creates layer div (to append to control DOM element). + * + * @method _createLayerDiv + * @param {String} layerId - layer id + * @returns {DOMElement} layer div + * @private + */ +LayerSwitcher.prototype._createLayerDiv = function (layerId) { + var layerOptions = this._layers[layerId]; + var isLegends = layerOptions.legends && layerOptions.legends.length !== 0; + var isMetadata = layerOptions.metadata && layerOptions.metadata.length !== 0; + var isQuicklookUrl = layerOptions.quicklookUrl; + if (isLegends || isMetadata || isQuicklookUrl) { + layerOptions.displayInformationElement = true; + } + + // adds a specific div in the control for the layer + layerOptions.id = layerId; + var layerDiv = this._createContainerLayerElement(layerOptions); + if (!layerOptions.inRange) { + layerDiv.classList.add("outOfRange"); + } + return layerDiv; +}; + +// ################################################################### // +// ######################### DOM events ############################## // +// ################################################################### // + +/** + * Changes layer opacity on layer opacity picto click + * + * @method _onChangeLayerOpacity + * @param {Object} e - HTML event + * @private + */ +LayerSwitcher.prototype._onChangeLayerOpacity = function (e) { + var globe = this.getGlobe(); + var layerID = this._resolveLayerId(e.target.id); + var opacityValue = e.target.value; + var opacityId = document.getElementById(this._addUID("GPopacityValue_ID_" + layerID)); + opacityId.innerHTML = opacityValue + "%"; + globe.setLayerOpacity(layerID, opacityValue / 100); +}; + +/** + * Updates picto opacity value on layer opacity change + * + * @method _updateLayerOpacity + * @param {String} layerId - layer id + * @param {Number} opacity - opacity value + * @private + */ +LayerSwitcher.prototype._updateLayerOpacity = function (layerId, opacity) { + if (opacity > 1) { + opacity = 1; + } + if (opacity < 0) { + opacity = 0; + } + var layerOpacityInput = document.getElementById(this._addUID("GPopacityValueDiv_ID_" + layerId)); + if (layerOpacityInput) { + layerOpacityInput.value = Math.round(opacity * 100); + } + var layerOpacitySpan = document.getElementById(this._addUID("GPopacityValue_ID_" + layerId)); + if (layerOpacitySpan) { + layerOpacitySpan.innerHTML = Math.round(opacity * 100) + "%"; + } +}; + +/** + * Changes layer visibility on layer visibility picto click + * + * @method _onVisibilityLayerClick + * @param {Object} e - HTML event + * @private + */ +LayerSwitcher.prototype._onVisibilityLayerClick = function (e) { + var globe = this.getGlobe(); + var layerID = this._resolveLayerId(e.target.id); + globe.setLayerVisibility(layerID, e.target.checked); // update viewer +}; + +/** + * Changes picto visibility on layer visibility change + * + * @method _updateLayerVisibility + * @param {String} layerId - layer id + * @param {Boolean} visibility - visible if true + * @private + */ +LayerSwitcher.prototype._updateLayerVisibility = function (layerId, visibility) { + var layerVisibilityInput = document.getElementById(this._addUID("GPvisibility_ID_" + layerId)); + if (layerVisibilityInput) { + layerVisibilityInput.checked = visibility; + } +}; + +/** + * Opens layer information panel on picto click + * + * @method _onOpenLayerInfoClick + * @param {Event} e - MouseEvent + * @private + */ +LayerSwitcher.prototype._onOpenLayerInfoClick = function (e) { + var layerID = this._resolveLayerId(e.target.id); + var layerOptions = this._layers[layerID]; + var panel; + var info; + + // Close layer info panel + var divId = document.getElementById(e.target.id); + if (divId.className === "GPlayerInfoOpened") { + if (divId.classList !== undefined) { + divId.classList.remove("GPlayerInfoOpened"); + divId.classList.add("GPlayerInfo"); + } + panel = document.getElementById(this._addUID("GPlayerInfoPanel")); + if (panel.classList !== undefined) { + panel.classList.remove("GPpanel"); + panel.classList.remove("GPlayerInfoPanelOpened"); + panel.classList.add("GPlayerInfoPanelClosed"); + } + info = document.getElementById(this._addUID("GPlayerInfoContent")); + panel.removeChild(info); + return; + } + var layers = document.getElementsByClassName("GPlayerInfoOpened"); + for (var i = 0; i < layers.length; i++) { + layers[i].className = "GPlayerInfo"; + } + + // Open layer info panel + if (divId.classList !== undefined) { + divId.classList.remove("GPlayerInfo"); + divId.classList.add("GPlayerInfoOpened"); + } + panel = document.getElementById(this._addUID("GPlayerInfoPanel")); + if (panel.classList !== undefined) { + panel.classList.add("GPpanel"); + panel.classList.remove("GPlayerInfoPanelClosed"); + panel.classList.add("GPlayerInfoPanelOpened"); + } + info = document.getElementById(this._addUID("GPlayerInfoContent")); + if (info) { + panel.removeChild(info); + } + + // on récupère les infos associées au layer pour mettre dynamiquement le contenu du panel d'informations + var obj = { + title: layerOptions.title, + description: layerOptions.description, + quicklookUrl: layerOptions.quicklookUrl, + metadata: layerOptions.metadata, + legends: layerOptions.legends + }; + var infoLayer = this._createContainerLayerInfoElement(obj); + panel.appendChild(infoLayer); +}; + +/** + * removes layer from layer switcher and globe on picto click + * + * @method _onDropLayerClick + * @param {Event} e - MouseEvent + * @private + */ +LayerSwitcher.prototype._onDropLayerClick = function (e) { + var globe = this.getGlobe(); + var layerID = this._resolveLayerId(e.target.id); + // removing the layer will trigger the event listener + // which will call this.removeLayer and delete the div + globe.removeLayer(layerID); + this._updateLayerListContainer(); +}; + +/** + * changes layers order on drag and drop + * + * @method _onDropLayerClick + * @param {Event} e - HTML event + * @private + */ +LayerSwitcher.prototype._onDragAndDropLayerClick = function (e) { + var globe = this.getGlobe(); + + // Handling of the indexes : gives the little indexes (lowest layers) to the non-visible layers (displayed: false) + // when the index of a visible layer changes. + // Always moves the non-visible layers under the other layers (to not hide them) + + if (e.newIndex - e.oldIndex === 0) { + return; + } + var targetIndex = null; + if (e.newIndex) { + var layerTargetID = this._resolveLayerId(e.from.childNodes[e.newIndex + (e.newIndex - e.oldIndex < 0 ? 1 : -1)].id); + targetIndex = globe.getLayerById(layerTargetID).sequence; + } else { + targetIndex = globe.getColorLayers().length - 1; + } + var layerID = this._resolveLayerId(e.item.id); + globe.moveLayerToIndex(layerID, targetIndex); +}; + +/** + * Checks layers range + * + * @method _inRangeUpdate + * @param {Array} layersDisplayed - list of displayed layers id + * @private + */ +LayerSwitcher.prototype._inRangeUpdate = function (layersDisplayed) { + for (var layerKey in this._layers) { + var layer = this._layers[layerKey]; + if (!layer) { + continue; + } + // Check if layer is displayed. + var layerDiv; + var bInRange = layersDisplayed.indexOf(layer.id) >= 0; + if (bInRange && !layer.inRange) { + layer.inRange = true; + layerDiv = document.getElementById(this._addUID("GPlayerSwitcher_ID_" + layer.id)); + layerDiv.classList.remove("outOfRange"); + } else if (!bInRange && layer.inRange) { + layer.inRange = false; + layerDiv = document.getElementById(this._addUID("GPlayerSwitcher_ID_" + layer.id)); + layerDiv.classList.add("outOfRange"); + } + } +}; + +/** + * Update the layer list container + * + * @method _updateLayerListContainer + * @private + */ +LayerSwitcher.prototype._updateLayerListContainer = function () { + if (this._layerListContainer) { + var globe = this.getGlobe(); + + // empty the previous container + while (this._layerListContainer.firstChild) { + this._layerListContainer.removeChild(this._layerListContainer.firstChild); + } + // reorders layers according to the layer stack (globe.getLayers returns an reverse ordenered array).. + var layers = globe.getColorLayers(); + var orderedLayers = layers.sort(function (a, b) { + return b.sequence - a.sequence; + }); + // ... and adds the correct div to the different layers, in the zindex decreasing order + for (var j = 0; j < orderedLayers.length; j++) { + if (!this._layers[orderedLayers[j].id]) { + continue; + } + // retrieves the div of the layer, stored in the _layers array + var layerDiv = this._layers[orderedLayers[j].id].div; + this._layerListContainer.appendChild(layerDiv); + } + } else { + logger.error("[Itowns.control.LayerSwitcher] _updateLayerListContainer : layer list container not found to update layers order ?!"); + } +}; + +// ################################################################### // +// ############################ Utils ################################ // +// ################################################################### // + +/** + * Gets layer informations : title, description, quicklookurl, legends, metadata + * + * @private + * @memberof LayerSwitcher + * @method _getLayerInfo + * @param {Object} layer - the layer object + * @returns {Object} layerInfo - layer informations + */ +LayerSwitcher.prototype._getLayerInfo = function (layer) { + var layerInfo = {}; + if (layer) { + layerInfo._title = layer.title || null; + layerInfo._description = layer.description || null; + layerInfo._quicklookUrl = layer.quicklookUrl || null; + layerInfo._metadata = layer.metadata || null; + layerInfo._legends = layer.legends || null; + } + return layerInfo; +}; + +/** + * Gets layer id from div id + * + * @method _resolveLayerId + * @param {String} divId - HTML div id + * @returns {String} layer id + * @private + */ +LayerSwitcher.prototype._resolveLayerId = function (divId) { + var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__["default"].name(divId); // ex GPvisibilityPicto_ID_26 + return divName.substring(divName.indexOf("_ID_") + 4); // ex. 26 +}; + +/* harmony default export */ __webpack_exports__["default"] = (LayerSwitcher); + +/***/ }), +/* 103 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(104); + +var LayerSwitcherDOM = { + /** + * Creation du drag and drop + * + * @param {Object} elementDraggable - Element HTML (DOM) Container + * @param {Object} context - this + */ + _createDraggableElement: function _createDraggableElement(elementDraggable, context) { + // FIXME retirer cette détection user-agent pour solution propre + // option forcefallback pour réparer sortable sous Chrome 97 + // option forcefallback casse le layerswitcher du portail sous firefox + if (navigator.userAgent.match(/chrome|chromium|crios/i)) { + sortablejs__WEBPACK_IMPORTED_MODULE_0__["default"].create(elementDraggable, { + handle: ".GPlayerName", + draggable: ".draggable-layer", + ghostClass: "GPghostLayer", + animation: 200, + forceFallback: true, + // Call event function on drag and drop + onEnd: function onEnd(e) { + // FIXME pas terrrible, mais il faut bien passer ce contexte... + context._onDragAndDropLayerClick(e); + } + }); + } else { + sortablejs__WEBPACK_IMPORTED_MODULE_0__["default"].create(elementDraggable, { + handle: ".GPlayerName", + draggable: ".draggable-layer", + ghostClass: "GPghostLayer", + animation: 200, + // Call event function on drag and drop + onEnd: function onEnd(e) { + // FIXME pas terrrible, mais il faut bien passer ce contexte... + context._onDragAndDropLayerClick(e); + } + }); + } + }, + // ################################################################### // + // ######################### Main container ########################## // + // ################################################################### // + + /** + * Add uuid to the tag ID + * @param {String} id - id selector + * @returns {String} uid - id selector with an unique id + */ + _addUID: function _addUID(id) { + var uid = this._uid ? id + "-" + this._uid : id; + return uid; + }, + /** + * Creation du container principal (DOM) + * + * @returns {DOMElement} container - layer switcher DOM element + */ + _createMainContainerElement: function _createMainContainerElement() { + var container = document.createElement("div"); + container.id = this._addUID("GPlayerSwitcher"); + container.className = "GPwidget"; + return container; + }, + /** + * Creation du container principal d"affichage des layers (DOM) + * + * @returns {DOMElement} input - element for minimizing/maximizing the layer switcher + */ + _createMainLayersShowElement: function _createMainLayersShowElement() { + // + var input = document.createElement("input"); + input.id = this._addUID("GPshowLayersList"); + input.type = "checkbox"; + return input; + }, + /** + * Creation du container principal des layers (DOM) + * + * @returns {DOMElement} container - layers list container + */ + _createMainLayersElement: function _createMainLayersElement() { + // ajout de la liste des layers dans le container principal + //
+ // (...) + //
+ var div = document.createElement("div"); + div.id = this._addUID("GPlayersList"); + div.className = "GPpanel"; + return div; + }, + /** + * Creation du container du picto du controle (DOM) + * + * @returns {DOMElement} label + */ + _createMainPictoElement: function _createMainPictoElement() { + var self = this; + + // exemple : + // + // + + var label = document.createElement("label"); + label.id = this._addUID("GPshowLayersListPicto"); + label.className = "GPshowAdvancedToolPicto"; + label.htmlFor = this._addUID("GPshowLayersList"); + label.title = "Afficher/masquer le gestionnaire de couches"; + var spanOpen = document.createElement("span"); + spanOpen.id = this._addUID("GPshowLayersListOpen"); + spanOpen.className = "GPshowAdvancedToolOpen"; + spanOpen.addEventListener("click", function () { + if (document.getElementById(self._addUID("GPshowLayersList")).checked) { + var layers = document.getElementsByClassName("GPlayerInfoOpened"); + for (var i = 0; i < layers.length; i++) { + layers[i].className = "GPlayerInfo"; + } + document.getElementById(self._addUID("GPlayerInfoPanel")).className = "GPlayerInfoPanelClosed"; + } + }); + label.appendChild(spanOpen); + var spanClose = document.createElement("span"); + spanClose.addEventListener("click", function () { + if (document.getElementById(self._addUID("GPshowLayersList")).checked) { + var layers = document.getElementsByClassName("GPlayerInfoOpened"); + for (var i = 0; i < layers.length; i++) { + layers[i].className = "GPlayerInfo"; + } + document.getElementById(self._addUID("GPlayerInfoPanel")).className = "GPlayerInfoPanelClosed"; + } + }); + spanClose.id = self._addUID("GPshowLayersListClose"); + label.appendChild(spanClose); + return label; + }, + /** + * Creation du container du panneau d"information (DOM) + * + * @returns {DOMElement} container + */ + _createMainInfoElement: function _createMainInfoElement() { + // gestion du panneau d"information dans le container principal + //
...
+ var div = document.createElement("div"); + div.id = this._addUID("GPlayerInfoPanel"); + div.className = "GPpanel GPlayerInfoPanelClosed"; + return div; + }, + // ################################################################### // + // ######################### Layer container ######################### // + // ################################################################### // + + /** + * Creation du container du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * @param {Object} obj.layer - couche (ol ou leaflet) + * @param {String} obj.id - identifiant de la couche (pour ol ou leaflet) + * @param {String} obj.title - nom de la couche à afficher dans le controle + * @param {String} obj.description - description de la couche à afficher + * @param {Boolean} obj.visibility - visibilité de la couche dans la carte (true or false) + * @param {Float} obj.opacity - opacité de la couche + * + * @returns {DOMElement} container + */ + _createContainerLayerElement: function _createContainerLayerElement(obj) { + // exemple : + //
+ // + // + // + //
+ + // + // + var container = document.createElement("div"); + container.id = this._addUID("GPlayerSwitcher_ID_" + obj.id); + container.className = "GPlayerSwitcher_layer draggable-layer"; + + // ajout des outils basiques (visibility / layer name) + container.appendChild(this._createBasicToolElement(obj)); + + // liste des outils avancés (layer info / opacity slider / opacity value / removal) + var array = this._createAdvancedToolShowElement(obj); + for (var i = 0; i < array.length; i++) { + container.appendChild(array[i]); + } + + // ajout des outils avancés + container.appendChild(this._createAdvancedToolElement(obj)); + return container; + }, + // ################################################################### // + // ############################ Layer tool ########################### // + // ################################################################### // + + /** + * Creation du container des outils basiques du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement} container + */ + _createBasicToolElement: function _createBasicToolElement(obj) { + // exemple : + //
+ // + // + //
+ + var div = document.createElement("div"); + div.id = this._addUID("GPbasicTools_ID_" + obj.id); + div.className = "GPlayerBasicTools"; + div.appendChild(this._createBasicToolNameElement(obj)); + var array = this._createBasicToolVisibilityElement(obj); + for (var i = 0; i < array.length; i++) { + div.appendChild(array[i]); + } + return div; + }, + /** + * Creation du nom du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement} container + */ + _createBasicToolNameElement: function _createBasicToolNameElement(obj) { + // exemple : + // Quartiers prioritaires de la ville + var span = document.createElement("span"); + span.id = this._addUID("GPname_ID_" + obj.id); + span.className = "GPlayerName"; + span.title = obj.description || obj.title; + span.innerHTML = obj.title; + return span; + }, + /** + * Creation de l'icone de visibilité du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * @returns {DOMElement[]} array containing input and label elements + */ + _createBasicToolVisibilityElement: function _createBasicToolVisibilityElement(obj) { + // exemple : + // + // + + var list = []; + var checked = typeof obj.visibility !== "undefined" ? obj.visibility : true; + var id = this._addUID("GPvisibility_ID_" + obj.id); + var input = document.createElement("input"); + input.id = id; + input.type = "checkbox"; + input.checked = checked; + var label = document.createElement("label"); + label.htmlFor = id; + label.id = this._addUID("GPvisibilityPicto_ID_" + obj.id); + label.className = "GPlayerVisibility"; + label.title = "Afficher/masquer la couche"; + + // add event for visibility change + var context = this; + if (input.addEventListener) { + input.addEventListener("click", function (e) { + context._onVisibilityLayerClick(e); + }); + } else if (input.attachEvent) { + // internet explorer + input.attachEvent("onclick", function (e) { + context._onVisibilityLayerClick(e); + }); + } + list.push(input); + list.push(label); + return list; + }, + /** + * Creation de l'affichage du menu des outils avancés du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement[]} array containing input and label elements + */ + _createAdvancedToolShowElement: function _createAdvancedToolShowElement(obj) { + // + // + + var list = []; + var label = document.createElement("label"); + label.id = this._addUID("GPshowAdvancedToolsPicto_ID_" + obj.id); + label.htmlFor = this._addUID("GPshowAdvancedTools_ID_" + obj.id); + label.title = "Plus d'outils"; + label.className = "GPshowMoreOptions GPshowLayerAdvancedTools"; + var input = document.createElement("input"); + input.type = "checkbox"; + input.id = this._addUID("GPshowAdvancedTools_ID_" + obj.id); + list.push(input); + list.push(label); + return list; + }, + /** + * Creation du container des outils avancés du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement} container + */ + _createAdvancedToolElement: function _createAdvancedToolElement(obj) { + // exemple : + //
+ // + // + // + //
+ + var container = document.createElement("div"); + container.id = this._addUID("GPadvancedTools_ID_" + obj.id); + container.className = "GPlayerAdvancedTools"; + container.appendChild(this._createAdvancedToolDeleteElement(obj)); + + // si on n'a de l'informations à afficher, on met en place ce composant + if (obj.title && obj.description) { + container.appendChild(this._createAdvancedToolInformationElement(obj)); + } + if (obj.type !== "feature") { + var array = this._createAdvancedToolOpacityElement(obj); + for (var i = 0; i < array.length; i++) { + container.appendChild(array[i]); + } + } + return container; + }, + /** + * Creation de l'icone de suppression du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement} container + */ + _createAdvancedToolDeleteElement: function _createAdvancedToolDeleteElement(obj) { + // exemple : + //
+ + var div = document.createElement("div"); + div.id = this._addUID("GPremove_ID_" + obj.id); + div.className = "GPlayerRemove"; + div.title = "Supprimer la couche"; + div.layerId = obj.id; + var context = this; + if (div.addEventListener) { + div.addEventListener("click", function (e) { + context._onDropLayerClick(e); + }); + } else if (div.attachEvent) { + // internet explorer + div.attachEvent("onclick", function (e) { + context._onDropLayerClick(e); + }); + } + return div; + }, + /** + * Creation de l'icone d'information du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement} container + */ + _createAdvancedToolInformationElement: function _createAdvancedToolInformationElement(obj) { + // exemple : + //
+ + var div = document.createElement("div"); + div.id = this._addUID("GPinfo_ID_" + obj.id); + div.className = "GPlayerInfo"; + div.title = "Informations/légende"; + div.layerId = obj.id; + // add event on click + var context = this; + if (div.addEventListener) { + div.addEventListener("click", function (e) { + context._onOpenLayerInfoClick(e); + }); + } else if (div.attachEvent) { + // internet explorer + div.attachEvent("onclick", function (e) { + context._onOpenLayerInfoClick(e); + }); + } + return div; + }, + /** + * Creation de l'icone de gestion de l'opacité du layer (DOM) + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement[]} array of two containers + */ + _createAdvancedToolOpacityElement: function _createAdvancedToolOpacityElement(obj) { + // exemple : + //
+ // + //
+ //
+ // 100 + // % + //
+ + var list = []; + + // curseur pour changer l'opacité + var divO = document.createElement("div"); + divO.id = this._addUID("GPopacity_ID_" + obj.id); + divO.className = "GPlayerOpacity"; + divO.title = "Opacité"; + var opacity = typeof obj.opacity !== "undefined" ? obj.opacity : 1; + opacity = Math.round(opacity * 100); + var input = document.createElement("input"); + input.id = this._addUID("GPopacityValueDiv_ID_" + obj.id); + input.type = "range"; + input.value = opacity; + + // add event for opacity change + var context = this; + if (input.addEventListener) { + input.addEventListener("change", function (e) { + context._onChangeLayerOpacity(e); + }); + } else if (input.attachEvent) { + // internet explorer + input.attachEvent("onchange", function (e) { + context._onChangeLayerOpacity(e); + }); + } + if (input.addEventListener) { + input.addEventListener("input", function (e) { + context._onChangeLayerOpacity(e); + }); + } else if (input.attachEvent) { + // internet explorer + input.attachEvent("oninput", function (e) { + context._onChangeLayerOpacity(e); + }); + } + divO.appendChild(input); + + // Valeur d'opacité + var divC = document.createElement("div"); + divC.id = this._addUID("GPopacityValueDiv_ID_" + obj.id); + divC.className = "GPlayerOpacityValue"; + var span = document.createElement("span"); + span.id = this._addUID("GPopacityValue_ID_" + obj.id); + span.innerHTML = opacity + "%"; + divC.appendChild(span); + list.push(divO); + list.push(divC); + return list; + }, + // ################################################################### // + // ############################ Layer info ########################### // + // ################################################################### // + + /** + * Creation du container du layer info (DOM) + * + * TODO GPlayerInfoPopup : ??? + * TODO GPlayerInfoLink : mettre en forme les échelles ! + * + * @param {Object} obj - options de la couche à ajouter dans le layer switcher + * + * @returns {DOMElement} container + */ + _createContainerLayerInfoElement: function _createContainerLayerInfoElement(obj) { + var container = document.createElement("div"); + container.id = this._addUID("GPlayerInfoContent"); + var title = document.createElement("div"); + title.id = this._addUID("GPlayerInfoTitle"); + title.innerHTML = obj.title; + container.appendChild(title); + if (obj.quicklookUrl) { + var quick = document.createElement("div"); + quick.id = this._addUID("GPlayerInfoQuicklook"); + quick.title = "Afficher un aperçu de la couche"; + var refquick = document.createElement("a"); + refquick.href = obj.quicklookUrl; + refquick.appendChild(quick); + container.appendChild(refquick); + } + var close = document.createElement("div"); + close.id = this._addUID("GPlayerInfoClose"); + close.title = "Fermer la fenêtre"; + var self = this; + /** Call event function on close click */ + var onCloseClick = function onCloseClick() { + document.getElementById(self._addUID("GPlayerInfoPanel")).className = "GPlayerInfoPanelClosed"; + var layers = document.getElementsByClassName("GPlayerInfoOpened"); + for (var i = 0; i < layers.length; i++) { + layers[i].className = "GPlayerInfo"; + } + }; + if (close.addEventListener) { + close.addEventListener("click", onCloseClick); + } else if (close.attachEvent) { + // internet explorer + close.attachEvent("onclick", onCloseClick); + } + container.appendChild(close); + var desc = document.createElement("div"); + desc.id = this._addUID("GPlayerInfoDescription"); + desc.innerHTML = obj.description; + container.appendChild(desc); + if (obj.metadata) { + var mtd = document.createElement("div"); + mtd.id = this._addUID("GPlayerInfoMetadata"); + var mtdtitle = document.createElement("div"); + mtdtitle.className = "GPlayerInfoSubtitle"; + mtdtitle.innerHTML = "Métadonnées"; + mtd.appendChild(mtdtitle); + for (var i = 0; i < obj.metadata.length; i++) { + var urlmtd = obj.metadata[i].url; + var mtdlink = document.createElement("div"); + mtdlink.className = "GPlayerInfoLink"; + var refmtd = document.createElement("a"); + refmtd.href = urlmtd; + refmtd.innerHTML = urlmtd; + mtdlink.appendChild(refmtd); + mtd.appendChild(mtdlink); + } + if (obj.metadata.length !== 0) { + container.appendChild(mtd); + } + } + if (obj.legends) { + var lgd = document.createElement("div"); + lgd.id = this._addUID("GPlayerInfoLegend"); + var lgdtitle = document.createElement("div"); + lgdtitle.className = "GPlayerInfoSubtitle"; + lgdtitle.innerHTML = "Légende"; + lgd.appendChild(lgdtitle); + var legends = {}; + var maxScale = obj.maxScaleDenominator || 560000000; + + // on crée un tableau temporaire pour ordonner les légendes selon le dénominateur d'échelle + for (var k = 0; k < obj.legends.length; k++) { + var minScale = obj.legends[k].minScaleDenominator; + if (minScale) { + var s = minScale.toString(); + minScale = Math.round(parseInt(s.substring(0, 3), 10) / 10) * Math.pow(10, s.length - 2); + } else { + minScale = 270; + } + legends[minScale] = obj.legends[k]; + } + for (var scale in legends) { + if (legends.hasOwnProperty(scale)) { + var urllgd = legends[scale].url; + // on n'affiche pas les légendes pointant vers "nolegend.jpg" + if (typeof urllgd === "string" && urllgd.toLowerCase().indexOf("nolegend.jpg") === -1) { + // TODO GPlayerInfoPopup + var lgdlink = document.createElement("div"); + lgdlink.className = "GPlayerInfoLink"; + maxScale = legends[scale].maxScaleDenominator || maxScale; + var reflgd = document.createElement("a"); + reflgd.href = urllgd; + reflgd.innerHTML = "Du 1/" + scale + " au 1/" + maxScale; + lgdlink.appendChild(reflgd); + lgd.appendChild(lgdlink); + } else { + delete legends[scale]; + } + } + } + if (Object.keys(legends).length !== 0) { + container.appendChild(lgd); + } + } + return container; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (LayerSwitcherDOM); + +/***/ }), +/* 104 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiDrag", function() { return MultiDragPlugin; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sortable", function() { return Sortable; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Swap", function() { return SwapPlugin; }); +/**! + * Sortable 1.14.0 + * @author RubaXa + * @author owenm + * @license MIT + */ +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + + keys.push.apply(keys, symbols); + } + + return keys; +} + +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; +} + +function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; +} + +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} + +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); +} + +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; +} + +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +var version = "1.14.0"; + +function userAgent(pattern) { + if (typeof window !== 'undefined' && window.navigator) { + return !! /*@__PURE__*/navigator.userAgent.match(pattern); + } +} + +var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i); +var Edge = userAgent(/Edge/i); +var FireFox = userAgent(/firefox/i); +var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i); +var IOS = userAgent(/iP(ad|od|hone)/i); +var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i); + +var captureMode = { + capture: false, + passive: false +}; + +function on(el, event, fn) { + el.addEventListener(event, fn, !IE11OrLess && captureMode); +} + +function off(el, event, fn) { + el.removeEventListener(event, fn, !IE11OrLess && captureMode); +} + +function matches( +/**HTMLElement*/ +el, +/**String*/ +selector) { + if (!selector) return; + selector[0] === '>' && (selector = selector.substring(1)); + + if (el) { + try { + if (el.matches) { + return el.matches(selector); + } else if (el.msMatchesSelector) { + return el.msMatchesSelector(selector); + } else if (el.webkitMatchesSelector) { + return el.webkitMatchesSelector(selector); + } + } catch (_) { + return false; + } + } + + return false; +} + +function getParentOrHost(el) { + return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode; +} + +function closest( +/**HTMLElement*/ +el, +/**String*/ +selector, +/**HTMLElement*/ +ctx, includeCTX) { + if (el) { + ctx = ctx || document; + + do { + if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) { + return el; + } + + if (el === ctx) break; + /* jshint boss:true */ + } while (el = getParentOrHost(el)); + } + + return null; +} + +var R_SPACE = /\s+/g; + +function toggleClass(el, name, state) { + if (el && name) { + if (el.classList) { + el.classList[state ? 'add' : 'remove'](name); + } else { + var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' '); + el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' '); + } + } +} + +function css(el, prop, val) { + var style = el && el.style; + + if (style) { + if (val === void 0) { + if (document.defaultView && document.defaultView.getComputedStyle) { + val = document.defaultView.getComputedStyle(el, ''); + } else if (el.currentStyle) { + val = el.currentStyle; + } + + return prop === void 0 ? val : val[prop]; + } else { + if (!(prop in style) && prop.indexOf('webkit') === -1) { + prop = '-webkit-' + prop; + } + + style[prop] = val + (typeof val === 'string' ? '' : 'px'); + } + } +} + +function matrix(el, selfOnly) { + var appliedTransforms = ''; + + if (typeof el === 'string') { + appliedTransforms = el; + } else { + do { + var transform = css(el, 'transform'); + + if (transform && transform !== 'none') { + appliedTransforms = transform + ' ' + appliedTransforms; + } + /* jshint boss:true */ + + } while (!selfOnly && (el = el.parentNode)); + } + + var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix; + /*jshint -W056 */ + + return matrixFn && new matrixFn(appliedTransforms); +} + +function find(ctx, tagName, iterator) { + if (ctx) { + var list = ctx.getElementsByTagName(tagName), + i = 0, + n = list.length; + + if (iterator) { + for (; i < n; i++) { + iterator(list[i], i); + } + } + + return list; + } + + return []; +} + +function getWindowScrollingElement() { + var scrollingElement = document.scrollingElement; + + if (scrollingElement) { + return scrollingElement; + } else { + return document.documentElement; + } +} +/** + * Returns the "bounding client rect" of given element + * @param {HTMLElement} el The element whose boundingClientRect is wanted + * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container + * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr + * @param {[Boolean]} undoScale Whether the container's scale() should be undone + * @param {[HTMLElement]} container The parent the element will be placed in + * @return {Object} The boundingClientRect of el, with specified adjustments + */ + + +function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) { + if (!el.getBoundingClientRect && el !== window) return; + var elRect, top, left, bottom, right, height, width; + + if (el !== window && el.parentNode && el !== getWindowScrollingElement()) { + elRect = el.getBoundingClientRect(); + top = elRect.top; + left = elRect.left; + bottom = elRect.bottom; + right = elRect.right; + height = elRect.height; + width = elRect.width; + } else { + top = 0; + left = 0; + bottom = window.innerHeight; + right = window.innerWidth; + height = window.innerHeight; + width = window.innerWidth; + } + + if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) { + // Adjust for translate() + container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312) + // Not needed on <= IE11 + + if (!IE11OrLess) { + do { + if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) { + var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container + + top -= containerRect.top + parseInt(css(container, 'border-top-width')); + left -= containerRect.left + parseInt(css(container, 'border-left-width')); + bottom = top + elRect.height; + right = left + elRect.width; + break; + } + /* jshint boss:true */ + + } while (container = container.parentNode); + } + } + + if (undoScale && el !== window) { + // Adjust for scale() + var elMatrix = matrix(container || el), + scaleX = elMatrix && elMatrix.a, + scaleY = elMatrix && elMatrix.d; + + if (elMatrix) { + top /= scaleY; + left /= scaleX; + width /= scaleX; + height /= scaleY; + bottom = top + height; + right = left + width; + } + } + + return { + top: top, + left: left, + bottom: bottom, + right: right, + width: width, + height: height + }; +} +/** + * Checks if a side of an element is scrolled past a side of its parents + * @param {HTMLElement} el The element who's side being scrolled out of view is in question + * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom') + * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom') + * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element + */ + + +function isScrolledPast(el, elSide, parentSide) { + var parent = getParentAutoScrollElement(el, true), + elSideVal = getRect(el)[elSide]; + /* jshint boss:true */ + + while (parent) { + var parentSideVal = getRect(parent)[parentSide], + visible = void 0; + + if (parentSide === 'top' || parentSide === 'left') { + visible = elSideVal >= parentSideVal; + } else { + visible = elSideVal <= parentSideVal; + } + + if (!visible) return parent; + if (parent === getWindowScrollingElement()) break; + parent = getParentAutoScrollElement(parent, false); + } + + return false; +} +/** + * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible) + * and non-draggable elements + * @param {HTMLElement} el The parent element + * @param {Number} childNum The index of the child + * @param {Object} options Parent Sortable's options + * @return {HTMLElement} The child at index childNum, or null if not found + */ + + +function getChild(el, childNum, options, includeDragEl) { + var currentChild = 0, + i = 0, + children = el.children; + + while (i < children.length) { + if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) { + if (currentChild === childNum) { + return children[i]; + } + + currentChild++; + } + + i++; + } + + return null; +} +/** + * Gets the last child in the el, ignoring ghostEl or invisible elements (clones) + * @param {HTMLElement} el Parent element + * @param {selector} selector Any other elements that should be ignored + * @return {HTMLElement} The last child, ignoring ghostEl + */ + + +function lastChild(el, selector) { + var last = el.lastElementChild; + + while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) { + last = last.previousElementSibling; + } + + return last || null; +} +/** + * Returns the index of an element within its parent for a selected set of + * elements + * @param {HTMLElement} el + * @param {selector} selector + * @return {number} + */ + + +function index(el, selector) { + var index = 0; + + if (!el || !el.parentNode) { + return -1; + } + /* jshint boss:true */ + + + while (el = el.previousElementSibling) { + if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) { + index++; + } + } + + return index; +} +/** + * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements. + * The value is returned in real pixels. + * @param {HTMLElement} el + * @return {Array} Offsets in the format of [left, top] + */ + + +function getRelativeScrollOffset(el) { + var offsetLeft = 0, + offsetTop = 0, + winScroller = getWindowScrollingElement(); + + if (el) { + do { + var elMatrix = matrix(el), + scaleX = elMatrix.a, + scaleY = elMatrix.d; + offsetLeft += el.scrollLeft * scaleX; + offsetTop += el.scrollTop * scaleY; + } while (el !== winScroller && (el = el.parentNode)); + } + + return [offsetLeft, offsetTop]; +} +/** + * Returns the index of the object within the given array + * @param {Array} arr Array that may or may not hold the object + * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find + * @return {Number} The index of the object in the array, or -1 + */ + + +function indexOfObject(arr, obj) { + for (var i in arr) { + if (!arr.hasOwnProperty(i)) continue; + + for (var key in obj) { + if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i); + } + } + + return -1; +} + +function getParentAutoScrollElement(el, includeSelf) { + // skip to window + if (!el || !el.getBoundingClientRect) return getWindowScrollingElement(); + var elem = el; + var gotSelf = false; + + do { + // we don't need to get elem css if it isn't even overflowing in the first place (performance) + if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) { + var elemCSS = css(elem); + + if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) { + if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement(); + if (gotSelf || includeSelf) return elem; + gotSelf = true; + } + } + /* jshint boss:true */ + + } while (elem = elem.parentNode); + + return getWindowScrollingElement(); +} + +function extend(dst, src) { + if (dst && src) { + for (var key in src) { + if (src.hasOwnProperty(key)) { + dst[key] = src[key]; + } + } + } + + return dst; +} + +function isRectEqual(rect1, rect2) { + return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width); +} + +var _throttleTimeout; + +function throttle(callback, ms) { + return function () { + if (!_throttleTimeout) { + var args = arguments, + _this = this; + + if (args.length === 1) { + callback.call(_this, args[0]); + } else { + callback.apply(_this, args); + } + + _throttleTimeout = setTimeout(function () { + _throttleTimeout = void 0; + }, ms); + } + }; +} + +function cancelThrottle() { + clearTimeout(_throttleTimeout); + _throttleTimeout = void 0; +} + +function scrollBy(el, x, y) { + el.scrollLeft += x; + el.scrollTop += y; +} + +function clone(el) { + var Polymer = window.Polymer; + var $ = window.jQuery || window.Zepto; + + if (Polymer && Polymer.dom) { + return Polymer.dom(el).cloneNode(true); + } else if ($) { + return $(el).clone(true)[0]; + } else { + return el.cloneNode(true); + } +} + +function setRect(el, rect) { + css(el, 'position', 'absolute'); + css(el, 'top', rect.top); + css(el, 'left', rect.left); + css(el, 'width', rect.width); + css(el, 'height', rect.height); +} + +function unsetRect(el) { + css(el, 'position', ''); + css(el, 'top', ''); + css(el, 'left', ''); + css(el, 'width', ''); + css(el, 'height', ''); +} + +var expando = 'Sortable' + new Date().getTime(); + +function AnimationStateManager() { + var animationStates = [], + animationCallbackId; + return { + captureAnimationState: function captureAnimationState() { + animationStates = []; + if (!this.options.animation) return; + var children = [].slice.call(this.el.children); + children.forEach(function (child) { + if (css(child, 'display') === 'none' || child === Sortable.ghost) return; + animationStates.push({ + target: child, + rect: getRect(child) + }); + + var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation + + + if (child.thisAnimationDuration) { + var childMatrix = matrix(child, true); + + if (childMatrix) { + fromRect.top -= childMatrix.f; + fromRect.left -= childMatrix.e; + } + } + + child.fromRect = fromRect; + }); + }, + addAnimationState: function addAnimationState(state) { + animationStates.push(state); + }, + removeAnimationState: function removeAnimationState(target) { + animationStates.splice(indexOfObject(animationStates, { + target: target + }), 1); + }, + animateAll: function animateAll(callback) { + var _this = this; + + if (!this.options.animation) { + clearTimeout(animationCallbackId); + if (typeof callback === 'function') callback(); + return; + } + + var animating = false, + animationTime = 0; + animationStates.forEach(function (state) { + var time = 0, + target = state.target, + fromRect = target.fromRect, + toRect = getRect(target), + prevFromRect = target.prevFromRect, + prevToRect = target.prevToRect, + animatingRect = state.rect, + targetMatrix = matrix(target, true); + + if (targetMatrix) { + // Compensate for current animation + toRect.top -= targetMatrix.f; + toRect.left -= targetMatrix.e; + } + + target.toRect = toRect; + + if (target.thisAnimationDuration) { + // Could also check if animatingRect is between fromRect and toRect + if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect + (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) { + // If returning to same place as started from animation and on same axis + time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options); + } + } // if fromRect != toRect: animate + + + if (!isRectEqual(toRect, fromRect)) { + target.prevFromRect = fromRect; + target.prevToRect = toRect; + + if (!time) { + time = _this.options.animation; + } + + _this.animate(target, animatingRect, toRect, time); + } + + if (time) { + animating = true; + animationTime = Math.max(animationTime, time); + clearTimeout(target.animationResetTimer); + target.animationResetTimer = setTimeout(function () { + target.animationTime = 0; + target.prevFromRect = null; + target.fromRect = null; + target.prevToRect = null; + target.thisAnimationDuration = null; + }, time); + target.thisAnimationDuration = time; + } + }); + clearTimeout(animationCallbackId); + + if (!animating) { + if (typeof callback === 'function') callback(); + } else { + animationCallbackId = setTimeout(function () { + if (typeof callback === 'function') callback(); + }, animationTime); + } + + animationStates = []; + }, + animate: function animate(target, currentRect, toRect, duration) { + if (duration) { + css(target, 'transition', ''); + css(target, 'transform', ''); + var elMatrix = matrix(this.el), + scaleX = elMatrix && elMatrix.a, + scaleY = elMatrix && elMatrix.d, + translateX = (currentRect.left - toRect.left) / (scaleX || 1), + translateY = (currentRect.top - toRect.top) / (scaleY || 1); + target.animatingX = !!translateX; + target.animatingY = !!translateY; + css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)'); + this.forRepaintDummy = repaint(target); // repaint + + css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : '')); + css(target, 'transform', 'translate3d(0,0,0)'); + typeof target.animated === 'number' && clearTimeout(target.animated); + target.animated = setTimeout(function () { + css(target, 'transition', ''); + css(target, 'transform', ''); + target.animated = false; + target.animatingX = false; + target.animatingY = false; + }, duration); + } + } + }; +} + +function repaint(target) { + return target.offsetWidth; +} + +function calculateRealTime(animatingRect, fromRect, toRect, options) { + return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation; +} + +var plugins = []; +var defaults = { + initializeByDefault: true +}; +var PluginManager = { + mount: function mount(plugin) { + // Set default static properties + for (var option in defaults) { + if (defaults.hasOwnProperty(option) && !(option in plugin)) { + plugin[option] = defaults[option]; + } + } + + plugins.forEach(function (p) { + if (p.pluginName === plugin.pluginName) { + throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once"); + } + }); + plugins.push(plugin); + }, + pluginEvent: function pluginEvent(eventName, sortable, evt) { + var _this = this; + + this.eventCanceled = false; + + evt.cancel = function () { + _this.eventCanceled = true; + }; + + var eventNameGlobal = eventName + 'Global'; + plugins.forEach(function (plugin) { + if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable + + if (sortable[plugin.pluginName][eventNameGlobal]) { + sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({ + sortable: sortable + }, evt)); + } // Only fire plugin event if plugin is enabled in this sortable, + // and plugin has event defined + + + if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) { + sortable[plugin.pluginName][eventName](_objectSpread2({ + sortable: sortable + }, evt)); + } + }); + }, + initializePlugins: function initializePlugins(sortable, el, defaults, options) { + plugins.forEach(function (plugin) { + var pluginName = plugin.pluginName; + if (!sortable.options[pluginName] && !plugin.initializeByDefault) return; + var initialized = new plugin(sortable, el, sortable.options); + initialized.sortable = sortable; + initialized.options = sortable.options; + sortable[pluginName] = initialized; // Add default options from plugin + + _extends(defaults, initialized.defaults); + }); + + for (var option in sortable.options) { + if (!sortable.options.hasOwnProperty(option)) continue; + var modified = this.modifyOption(sortable, option, sortable.options[option]); + + if (typeof modified !== 'undefined') { + sortable.options[option] = modified; + } + } + }, + getEventProperties: function getEventProperties(name, sortable) { + var eventProperties = {}; + plugins.forEach(function (plugin) { + if (typeof plugin.eventProperties !== 'function') return; + + _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name)); + }); + return eventProperties; + }, + modifyOption: function modifyOption(sortable, name, value) { + var modifiedValue; + plugins.forEach(function (plugin) { + // Plugin must exist on the Sortable + if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin + + if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') { + modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value); + } + }); + return modifiedValue; + } +}; + +function dispatchEvent(_ref) { + var sortable = _ref.sortable, + rootEl = _ref.rootEl, + name = _ref.name, + targetEl = _ref.targetEl, + cloneEl = _ref.cloneEl, + toEl = _ref.toEl, + fromEl = _ref.fromEl, + oldIndex = _ref.oldIndex, + newIndex = _ref.newIndex, + oldDraggableIndex = _ref.oldDraggableIndex, + newDraggableIndex = _ref.newDraggableIndex, + originalEvent = _ref.originalEvent, + putSortable = _ref.putSortable, + extraEventProperties = _ref.extraEventProperties; + sortable = sortable || rootEl && rootEl[expando]; + if (!sortable) return; + var evt, + options = sortable.options, + onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature + + if (window.CustomEvent && !IE11OrLess && !Edge) { + evt = new CustomEvent(name, { + bubbles: true, + cancelable: true + }); + } else { + evt = document.createEvent('Event'); + evt.initEvent(name, true, true); + } + + evt.to = toEl || rootEl; + evt.from = fromEl || rootEl; + evt.item = targetEl || rootEl; + evt.clone = cloneEl; + evt.oldIndex = oldIndex; + evt.newIndex = newIndex; + evt.oldDraggableIndex = oldDraggableIndex; + evt.newDraggableIndex = newDraggableIndex; + evt.originalEvent = originalEvent; + evt.pullMode = putSortable ? putSortable.lastPutMode : undefined; + + var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable)); + + for (var option in allEventProperties) { + evt[option] = allEventProperties[option]; + } + + if (rootEl) { + rootEl.dispatchEvent(evt); + } + + if (options[onName]) { + options[onName].call(sortable, evt); + } +} + +var _excluded = ["evt"]; + +var pluginEvent = function pluginEvent(eventName, sortable) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + originalEvent = _ref.evt, + data = _objectWithoutProperties(_ref, _excluded); + + PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({ + dragEl: dragEl, + parentEl: parentEl, + ghostEl: ghostEl, + rootEl: rootEl, + nextEl: nextEl, + lastDownEl: lastDownEl, + cloneEl: cloneEl, + cloneHidden: cloneHidden, + dragStarted: moved, + putSortable: putSortable, + activeSortable: Sortable.active, + originalEvent: originalEvent, + oldIndex: oldIndex, + oldDraggableIndex: oldDraggableIndex, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex, + hideGhostForTarget: _hideGhostForTarget, + unhideGhostForTarget: _unhideGhostForTarget, + cloneNowHidden: function cloneNowHidden() { + cloneHidden = true; + }, + cloneNowShown: function cloneNowShown() { + cloneHidden = false; + }, + dispatchSortableEvent: function dispatchSortableEvent(name) { + _dispatchEvent({ + sortable: sortable, + name: name, + originalEvent: originalEvent + }); + } + }, data)); +}; + +function _dispatchEvent(info) { + dispatchEvent(_objectSpread2({ + putSortable: putSortable, + cloneEl: cloneEl, + targetEl: dragEl, + rootEl: rootEl, + oldIndex: oldIndex, + oldDraggableIndex: oldDraggableIndex, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex + }, info)); +} + +var dragEl, + parentEl, + ghostEl, + rootEl, + nextEl, + lastDownEl, + cloneEl, + cloneHidden, + oldIndex, + newIndex, + oldDraggableIndex, + newDraggableIndex, + activeGroup, + putSortable, + awaitingDragStarted = false, + ignoreNextClick = false, + sortables = [], + tapEvt, + touchEvt, + lastDx, + lastDy, + tapDistanceLeft, + tapDistanceTop, + moved, + lastTarget, + lastDirection, + pastFirstInvertThresh = false, + isCircumstantialInvert = false, + targetMoveDistance, + // For positioning ghost absolutely +ghostRelativeParent, + ghostRelativeParentInitialScroll = [], + // (left, top) +_silent = false, + savedInputChecked = []; +/** @const */ + +var documentExists = typeof document !== 'undefined', + PositionGhostAbsolutely = IOS, + CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float', + // This will not pass for IE9, because IE9 DnD only works on anchors +supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'), + supportCssPointerEvents = function () { + if (!documentExists) return; // false when <= IE11 + + if (IE11OrLess) { + return false; + } + + var el = document.createElement('x'); + el.style.cssText = 'pointer-events:auto'; + return el.style.pointerEvents === 'auto'; +}(), + _detectDirection = function _detectDirection(el, options) { + var elCSS = css(el), + elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), + child1 = getChild(el, 0, options), + child2 = getChild(el, 1, options), + firstChildCSS = child1 && css(child1), + secondChildCSS = child2 && css(child2), + firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, + secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width; + + if (elCSS.display === 'flex') { + return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal'; + } + + if (elCSS.display === 'grid') { + return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal'; + } + + if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') { + var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right'; + return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal'; + } + + return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal'; +}, + _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) { + var dragElS1Opp = vertical ? dragRect.left : dragRect.top, + dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, + dragElOppLength = vertical ? dragRect.width : dragRect.height, + targetS1Opp = vertical ? targetRect.left : targetRect.top, + targetS2Opp = vertical ? targetRect.right : targetRect.bottom, + targetOppLength = vertical ? targetRect.width : targetRect.height; + return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2; +}, + +/** + * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold. + * @param {Number} x X position + * @param {Number} y Y position + * @return {HTMLElement} Element of the first found nearest Sortable + */ +_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) { + var ret; + sortables.some(function (sortable) { + var threshold = sortable[expando].options.emptyInsertThreshold; + if (!threshold || lastChild(sortable)) return; + var rect = getRect(sortable), + insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, + insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold; + + if (insideHorizontally && insideVertically) { + return ret = sortable; + } + }); + return ret; +}, + _prepareGroup = function _prepareGroup(options) { + function toFn(value, pull) { + return function (to, from, dragEl, evt) { + var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name; + + if (value == null && (pull || sameGroup)) { + // Default pull value + // Default pull and put value if same group + return true; + } else if (value == null || value === false) { + return false; + } else if (pull && value === 'clone') { + return value; + } else if (typeof value === 'function') { + return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt); + } else { + var otherGroup = (pull ? to : from).options.group.name; + return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1; + } + }; + } + + var group = {}; + var originalGroup = options.group; + + if (!originalGroup || _typeof(originalGroup) != 'object') { + originalGroup = { + name: originalGroup + }; + } + + group.name = originalGroup.name; + group.checkPull = toFn(originalGroup.pull, true); + group.checkPut = toFn(originalGroup.put); + group.revertClone = originalGroup.revertClone; + options.group = group; +}, + _hideGhostForTarget = function _hideGhostForTarget() { + if (!supportCssPointerEvents && ghostEl) { + css(ghostEl, 'display', 'none'); + } +}, + _unhideGhostForTarget = function _unhideGhostForTarget() { + if (!supportCssPointerEvents && ghostEl) { + css(ghostEl, 'display', ''); + } +}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position + + +if (documentExists) { + document.addEventListener('click', function (evt) { + if (ignoreNextClick) { + evt.preventDefault(); + evt.stopPropagation && evt.stopPropagation(); + evt.stopImmediatePropagation && evt.stopImmediatePropagation(); + ignoreNextClick = false; + return false; + } + }, true); +} + +var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) { + if (dragEl) { + evt = evt.touches ? evt.touches[0] : evt; + + var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY); + + if (nearest) { + // Create imitation event + var event = {}; + + for (var i in evt) { + if (evt.hasOwnProperty(i)) { + event[i] = evt[i]; + } + } + + event.target = event.rootEl = nearest; + event.preventDefault = void 0; + event.stopPropagation = void 0; + + nearest[expando]._onDragOver(event); + } + } +}; + +var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) { + if (dragEl) { + dragEl.parentNode[expando]._isOutsideThisEl(evt.target); + } +}; +/** + * @class Sortable + * @param {HTMLElement} el + * @param {Object} [options] + */ + + +function Sortable(el, options) { + if (!(el && el.nodeType && el.nodeType === 1)) { + throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el)); + } + + this.el = el; // root element + + this.options = options = _extends({}, options); // Export instance + + el[expando] = this; + var defaults = { + group: null, + sort: true, + disabled: false, + store: null, + handle: null, + draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*', + swapThreshold: 1, + // percentage; 0 <= x <= 1 + invertSwap: false, + // invert always + invertedSwapThreshold: null, + // will be set to same as swapThreshold if default + removeCloneOnHide: true, + direction: function direction() { + return _detectDirection(el, this.options); + }, + ghostClass: 'sortable-ghost', + chosenClass: 'sortable-chosen', + dragClass: 'sortable-drag', + ignore: 'a, img', + filter: null, + preventOnFilter: true, + animation: 0, + easing: null, + setData: function setData(dataTransfer, dragEl) { + dataTransfer.setData('Text', dragEl.textContent); + }, + dropBubble: false, + dragoverBubble: false, + dataIdAttr: 'data-id', + delay: 0, + delayOnTouchOnly: false, + touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1, + forceFallback: false, + fallbackClass: 'sortable-fallback', + fallbackOnBody: false, + fallbackTolerance: 0, + fallbackOffset: { + x: 0, + y: 0 + }, + supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari, + emptyInsertThreshold: 5 + }; + PluginManager.initializePlugins(this, el, defaults); // Set default options + + for (var name in defaults) { + !(name in options) && (options[name] = defaults[name]); + } + + _prepareGroup(options); // Bind all private methods + + + for (var fn in this) { + if (fn.charAt(0) === '_' && typeof this[fn] === 'function') { + this[fn] = this[fn].bind(this); + } + } // Setup drag mode + + + this.nativeDraggable = options.forceFallback ? false : supportDraggable; + + if (this.nativeDraggable) { + // Touch start threshold cannot be greater than the native dragstart threshold + this.options.touchStartThreshold = 1; + } // Bind events + + + if (options.supportPointer) { + on(el, 'pointerdown', this._onTapStart); + } else { + on(el, 'mousedown', this._onTapStart); + on(el, 'touchstart', this._onTapStart); + } + + if (this.nativeDraggable) { + on(el, 'dragover', this); + on(el, 'dragenter', this); + } + + sortables.push(this.el); // Restore sorting + + options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager + + _extends(this, AnimationStateManager()); +} + +Sortable.prototype = +/** @lends Sortable.prototype */ +{ + constructor: Sortable, + _isOutsideThisEl: function _isOutsideThisEl(target) { + if (!this.el.contains(target) && target !== this.el) { + lastTarget = null; + } + }, + _getDirection: function _getDirection(evt, target) { + return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction; + }, + _onTapStart: function _onTapStart( + /** Event|TouchEvent */ + evt) { + if (!evt.cancelable) return; + + var _this = this, + el = this.el, + options = this.options, + preventOnFilter = options.preventOnFilter, + type = evt.type, + touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt, + target = (touch || evt).target, + originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, + filter = options.filter; + + _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. + + + if (dragEl) { + return; + } + + if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) { + return; // only left button and enabled + } // cancel dnd if original target is content editable + + + if (originalTarget.isContentEditable) { + return; + } // Safari ignores further event handling after mousedown + + + if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') { + return; + } + + target = closest(target, options.draggable, el, false); + + if (target && target.animated) { + return; + } + + if (lastDownEl === target) { + // Ignoring duplicate `down` + return; + } // Get the index of the dragged element within its parent + + + oldIndex = index(target); + oldDraggableIndex = index(target, options.draggable); // Check filter + + if (typeof filter === 'function') { + if (filter.call(this, evt, target, this)) { + _dispatchEvent({ + sortable: _this, + rootEl: originalTarget, + name: 'filter', + targetEl: target, + toEl: el, + fromEl: el + }); + + pluginEvent('filter', _this, { + evt: evt + }); + preventOnFilter && evt.cancelable && evt.preventDefault(); + return; // cancel dnd + } + } else if (filter) { + filter = filter.split(',').some(function (criteria) { + criteria = closest(originalTarget, criteria.trim(), el, false); + + if (criteria) { + _dispatchEvent({ + sortable: _this, + rootEl: criteria, + name: 'filter', + targetEl: target, + fromEl: el, + toEl: el + }); + + pluginEvent('filter', _this, { + evt: evt + }); + return true; + } + }); + + if (filter) { + preventOnFilter && evt.cancelable && evt.preventDefault(); + return; // cancel dnd + } + } + + if (options.handle && !closest(originalTarget, options.handle, el, false)) { + return; + } // Prepare `dragstart` + + + this._prepareDragStart(evt, touch, target); + }, + _prepareDragStart: function _prepareDragStart( + /** Event */ + evt, + /** Touch */ + touch, + /** HTMLElement */ + target) { + var _this = this, + el = _this.el, + options = _this.options, + ownerDocument = el.ownerDocument, + dragStartFn; + + if (target && !dragEl && target.parentNode === el) { + var dragRect = getRect(target); + rootEl = el; + dragEl = target; + parentEl = dragEl.parentNode; + nextEl = dragEl.nextSibling; + lastDownEl = target; + activeGroup = options.group; + Sortable.dragged = dragEl; + tapEvt = { + target: dragEl, + clientX: (touch || evt).clientX, + clientY: (touch || evt).clientY + }; + tapDistanceLeft = tapEvt.clientX - dragRect.left; + tapDistanceTop = tapEvt.clientY - dragRect.top; + this._lastX = (touch || evt).clientX; + this._lastY = (touch || evt).clientY; + dragEl.style['will-change'] = 'all'; + + dragStartFn = function dragStartFn() { + pluginEvent('delayEnded', _this, { + evt: evt + }); + + if (Sortable.eventCanceled) { + _this._onDrop(); + + return; + } // Delayed drag has been triggered + // we can re-enable the events: touchmove/mousemove + + + _this._disableDelayedDragEvents(); + + if (!FireFox && _this.nativeDraggable) { + dragEl.draggable = true; + } // Bind the events: dragstart/dragend + + + _this._triggerDragStart(evt, touch); // Drag start event + + + _dispatchEvent({ + sortable: _this, + name: 'choose', + originalEvent: evt + }); // Chosen item + + + toggleClass(dragEl, options.chosenClass, true); + }; // Disable "draggable" + + + options.ignore.split(',').forEach(function (criteria) { + find(dragEl, criteria.trim(), _disableDraggable); + }); + on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent); + on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent); + on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent); + on(ownerDocument, 'mouseup', _this._onDrop); + on(ownerDocument, 'touchend', _this._onDrop); + on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox) + + if (FireFox && this.nativeDraggable) { + this.options.touchStartThreshold = 4; + dragEl.draggable = true; + } + + pluginEvent('delayStart', this, { + evt: evt + }); // Delay is impossible for native DnD in Edge or IE + + if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) { + if (Sortable.eventCanceled) { + this._onDrop(); + + return; + } // If the user moves the pointer or let go the click or touch + // before the delay has been reached: + // disable the delayed drag + + + on(ownerDocument, 'mouseup', _this._disableDelayedDrag); + on(ownerDocument, 'touchend', _this._disableDelayedDrag); + on(ownerDocument, 'touchcancel', _this._disableDelayedDrag); + on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler); + on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler); + options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler); + _this._dragStartTimer = setTimeout(dragStartFn, options.delay); + } else { + dragStartFn(); + } + } + }, + _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( + /** TouchEvent|PointerEvent **/ + e) { + var touch = e.touches ? e.touches[0] : e; + + if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) { + this._disableDelayedDrag(); + } + }, + _disableDelayedDrag: function _disableDelayedDrag() { + dragEl && _disableDraggable(dragEl); + clearTimeout(this._dragStartTimer); + + this._disableDelayedDragEvents(); + }, + _disableDelayedDragEvents: function _disableDelayedDragEvents() { + var ownerDocument = this.el.ownerDocument; + off(ownerDocument, 'mouseup', this._disableDelayedDrag); + off(ownerDocument, 'touchend', this._disableDelayedDrag); + off(ownerDocument, 'touchcancel', this._disableDelayedDrag); + off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler); + off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler); + off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler); + }, + _triggerDragStart: function _triggerDragStart( + /** Event */ + evt, + /** Touch */ + touch) { + touch = touch || evt.pointerType == 'touch' && evt; + + if (!this.nativeDraggable || touch) { + if (this.options.supportPointer) { + on(document, 'pointermove', this._onTouchMove); + } else if (touch) { + on(document, 'touchmove', this._onTouchMove); + } else { + on(document, 'mousemove', this._onTouchMove); + } + } else { + on(dragEl, 'dragend', this); + on(rootEl, 'dragstart', this._onDragStart); + } + + try { + if (document.selection) { + // Timeout neccessary for IE9 + _nextTick(function () { + document.selection.empty(); + }); + } else { + window.getSelection().removeAllRanges(); + } + } catch (err) {} + }, + _dragStarted: function _dragStarted(fallback, evt) { + + awaitingDragStarted = false; + + if (rootEl && dragEl) { + pluginEvent('dragStarted', this, { + evt: evt + }); + + if (this.nativeDraggable) { + on(document, 'dragover', _checkOutsideTargetEl); + } + + var options = this.options; // Apply effect + + !fallback && toggleClass(dragEl, options.dragClass, false); + toggleClass(dragEl, options.ghostClass, true); + Sortable.active = this; + fallback && this._appendGhost(); // Drag start event + + _dispatchEvent({ + sortable: this, + name: 'start', + originalEvent: evt + }); + } else { + this._nulling(); + } + }, + _emulateDragOver: function _emulateDragOver() { + if (touchEvt) { + this._lastX = touchEvt.clientX; + this._lastY = touchEvt.clientY; + + _hideGhostForTarget(); + + var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY); + var parent = target; + + while (target && target.shadowRoot) { + target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY); + if (target === parent) break; + parent = target; + } + + dragEl.parentNode[expando]._isOutsideThisEl(target); + + if (parent) { + do { + if (parent[expando]) { + var inserted = void 0; + inserted = parent[expando]._onDragOver({ + clientX: touchEvt.clientX, + clientY: touchEvt.clientY, + target: target, + rootEl: parent + }); + + if (inserted && !this.options.dragoverBubble) { + break; + } + } + + target = parent; // store last element + } + /* jshint boss:true */ + while (parent = parent.parentNode); + } + + _unhideGhostForTarget(); + } + }, + _onTouchMove: function _onTouchMove( + /**TouchEvent*/ + evt) { + if (tapEvt) { + var options = this.options, + fallbackTolerance = options.fallbackTolerance, + fallbackOffset = options.fallbackOffset, + touch = evt.touches ? evt.touches[0] : evt, + ghostMatrix = ghostEl && matrix(ghostEl, true), + scaleX = ghostEl && ghostMatrix && ghostMatrix.a, + scaleY = ghostEl && ghostMatrix && ghostMatrix.d, + relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent), + dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), + dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging + + if (!Sortable.active && !awaitingDragStarted) { + if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) { + return; + } + + this._onDragStart(evt, true); + } + + if (ghostEl) { + if (ghostMatrix) { + ghostMatrix.e += dx - (lastDx || 0); + ghostMatrix.f += dy - (lastDy || 0); + } else { + ghostMatrix = { + a: 1, + b: 0, + c: 0, + d: 1, + e: dx, + f: dy + }; + } + + var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")"); + css(ghostEl, 'webkitTransform', cssMatrix); + css(ghostEl, 'mozTransform', cssMatrix); + css(ghostEl, 'msTransform', cssMatrix); + css(ghostEl, 'transform', cssMatrix); + lastDx = dx; + lastDy = dy; + touchEvt = touch; + } + + evt.cancelable && evt.preventDefault(); + } + }, + _appendGhost: function _appendGhost() { + // Bug if using scale(): https://stackoverflow.com/questions/2637058 + // Not being adjusted for + if (!ghostEl) { + var container = this.options.fallbackOnBody ? document.body : rootEl, + rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container), + options = this.options; // Position absolutely + + if (PositionGhostAbsolutely) { + // Get relatively positioned parent + ghostRelativeParent = container; + + while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) { + ghostRelativeParent = ghostRelativeParent.parentNode; + } + + if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) { + if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement(); + rect.top += ghostRelativeParent.scrollTop; + rect.left += ghostRelativeParent.scrollLeft; + } else { + ghostRelativeParent = getWindowScrollingElement(); + } + + ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent); + } + + ghostEl = dragEl.cloneNode(true); + toggleClass(ghostEl, options.ghostClass, false); + toggleClass(ghostEl, options.fallbackClass, true); + toggleClass(ghostEl, options.dragClass, true); + css(ghostEl, 'transition', ''); + css(ghostEl, 'transform', ''); + css(ghostEl, 'box-sizing', 'border-box'); + css(ghostEl, 'margin', 0); + css(ghostEl, 'top', rect.top); + css(ghostEl, 'left', rect.left); + css(ghostEl, 'width', rect.width); + css(ghostEl, 'height', rect.height); + css(ghostEl, 'opacity', '0.8'); + css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed'); + css(ghostEl, 'zIndex', '100000'); + css(ghostEl, 'pointerEvents', 'none'); + Sortable.ghost = ghostEl; + container.appendChild(ghostEl); // Set transform-origin + + css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%'); + } + }, + _onDragStart: function _onDragStart( + /**Event*/ + evt, + /**boolean*/ + fallback) { + var _this = this; + + var dataTransfer = evt.dataTransfer; + var options = _this.options; + pluginEvent('dragStart', this, { + evt: evt + }); + + if (Sortable.eventCanceled) { + this._onDrop(); + + return; + } + + pluginEvent('setupClone', this); + + if (!Sortable.eventCanceled) { + cloneEl = clone(dragEl); + cloneEl.draggable = false; + cloneEl.style['will-change'] = ''; + + this._hideClone(); + + toggleClass(cloneEl, this.options.chosenClass, false); + Sortable.clone = cloneEl; + } // #1143: IFrame support workaround + + + _this.cloneId = _nextTick(function () { + pluginEvent('clone', _this); + if (Sortable.eventCanceled) return; + + if (!_this.options.removeCloneOnHide) { + rootEl.insertBefore(cloneEl, dragEl); + } + + _this._hideClone(); + + _dispatchEvent({ + sortable: _this, + name: 'clone' + }); + }); + !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events + + if (fallback) { + ignoreNextClick = true; + _this._loopId = setInterval(_this._emulateDragOver, 50); + } else { + // Undo what was set in _prepareDragStart before drag started + off(document, 'mouseup', _this._onDrop); + off(document, 'touchend', _this._onDrop); + off(document, 'touchcancel', _this._onDrop); + + if (dataTransfer) { + dataTransfer.effectAllowed = 'move'; + options.setData && options.setData.call(_this, dataTransfer, dragEl); + } + + on(document, 'drop', _this); // #1276 fix: + + css(dragEl, 'transform', 'translateZ(0)'); + } + + awaitingDragStarted = true; + _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt)); + on(document, 'selectstart', _this); + moved = true; + + if (Safari) { + css(document.body, 'user-select', 'none'); + } + }, + // Returns true - if no further action is needed (either inserted or another condition) + _onDragOver: function _onDragOver( + /**Event*/ + evt) { + var el = this.el, + target = evt.target, + dragRect, + targetRect, + revert, + options = this.options, + group = options.group, + activeSortable = Sortable.active, + isOwner = activeGroup === group, + canSort = options.sort, + fromSortable = putSortable || activeSortable, + vertical, + _this = this, + completedFired = false; + + if (_silent) return; + + function dragOverEvent(name, extra) { + pluginEvent(name, _this, _objectSpread2({ + evt: evt, + isOwner: isOwner, + axis: vertical ? 'vertical' : 'horizontal', + revert: revert, + dragRect: dragRect, + targetRect: targetRect, + canSort: canSort, + fromSortable: fromSortable, + target: target, + completed: completed, + onMove: function onMove(target, after) { + return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after); + }, + changed: changed + }, extra)); + } // Capture animation state + + + function capture() { + dragOverEvent('dragOverAnimationCapture'); + + _this.captureAnimationState(); + + if (_this !== fromSortable) { + fromSortable.captureAnimationState(); + } + } // Return invocation when dragEl is inserted (or completed) + + + function completed(insertion) { + dragOverEvent('dragOverCompleted', { + insertion: insertion + }); + + if (insertion) { + // Clones must be hidden before folding animation to capture dragRectAbsolute properly + if (isOwner) { + activeSortable._hideClone(); + } else { + activeSortable._showClone(_this); + } + + if (_this !== fromSortable) { + // Set ghost class to new sortable's ghost class + toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false); + toggleClass(dragEl, options.ghostClass, true); + } + + if (putSortable !== _this && _this !== Sortable.active) { + putSortable = _this; + } else if (_this === Sortable.active && putSortable) { + putSortable = null; + } // Animation + + + if (fromSortable === _this) { + _this._ignoreWhileAnimating = target; + } + + _this.animateAll(function () { + dragOverEvent('dragOverAnimationComplete'); + _this._ignoreWhileAnimating = null; + }); + + if (_this !== fromSortable) { + fromSortable.animateAll(); + fromSortable._ignoreWhileAnimating = null; + } + } // Null lastTarget if it is not inside a previously swapped element + + + if (target === dragEl && !dragEl.animated || target === el && !target.animated) { + lastTarget = null; + } // no bubbling and not fallback + + + if (!options.dragoverBubble && !evt.rootEl && target !== document) { + dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted + + + !insertion && nearestEmptyInsertDetectEvent(evt); + } + + !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation(); + return completedFired = true; + } // Call when dragEl has been inserted + + + function changed() { + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); + + _dispatchEvent({ + sortable: _this, + name: 'change', + toEl: el, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex, + originalEvent: evt + }); + } + + if (evt.preventDefault !== void 0) { + evt.cancelable && evt.preventDefault(); + } + + target = closest(target, options.draggable, el, true); + dragOverEvent('dragOver'); + if (Sortable.eventCanceled) return completedFired; + + if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) { + return completed(false); + } + + ignoreNextClick = false; + + if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list + : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) { + vertical = this._getDirection(evt, target) === 'vertical'; + dragRect = getRect(dragEl); + dragOverEvent('dragOverValid'); + if (Sortable.eventCanceled) return completedFired; + + if (revert) { + parentEl = rootEl; // actualization + + capture(); + + this._hideClone(); + + dragOverEvent('revert'); + + if (!Sortable.eventCanceled) { + if (nextEl) { + rootEl.insertBefore(dragEl, nextEl); + } else { + rootEl.appendChild(dragEl); + } + } + + return completed(true); + } + + var elLastChild = lastChild(el, options.draggable); + + if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) { + // Insert to end of list + // If already at end of list: Do not insert + if (elLastChild === dragEl) { + return completed(false); + } // if there is a last element, it is the target + + + if (elLastChild && el === evt.target) { + target = elLastChild; + } + + if (target) { + targetRect = getRect(target); + } + + if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) { + capture(); + el.appendChild(dragEl); + parentEl = el; // actualization + + changed(); + return completed(true); + } + } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) { + // Insert to start of list + var firstChild = getChild(el, 0, options, true); + + if (firstChild === dragEl) { + return completed(false); + } + + target = firstChild; + targetRect = getRect(target); + + if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) { + capture(); + el.insertBefore(dragEl, firstChild); + parentEl = el; // actualization + + changed(); + return completed(true); + } + } else if (target.parentNode === el) { + targetRect = getRect(target); + var direction = 0, + targetBeforeFirstSwap, + differentLevel = dragEl.parentNode !== el, + differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), + side1 = vertical ? 'top' : 'left', + scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'), + scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0; + + if (lastTarget !== target) { + targetBeforeFirstSwap = targetRect[side1]; + pastFirstInvertThresh = false; + isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel; + } + + direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target); + var sibling; + + if (direction !== 0) { + // Check if target is beside dragEl in respective direction (ignoring hidden elements) + var dragIndex = index(dragEl); + + do { + dragIndex -= direction; + sibling = parentEl.children[dragIndex]; + } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl)); + } // If dragEl is already beside target: Do not insert + + + if (direction === 0 || sibling === target) { + return completed(false); + } + + lastTarget = target; + lastDirection = direction; + var nextSibling = target.nextElementSibling, + after = false; + after = direction === 1; + + var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after); + + if (moveVector !== false) { + if (moveVector === 1 || moveVector === -1) { + after = moveVector === 1; + } + + _silent = true; + setTimeout(_unsilent, 30); + capture(); + + if (after && !nextSibling) { + el.appendChild(dragEl); + } else { + target.parentNode.insertBefore(dragEl, after ? nextSibling : target); + } // Undo chrome's scroll adjustment (has no effect on other browsers) + + + if (scrolledPastTop) { + scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop); + } + + parentEl = dragEl.parentNode; // actualization + // must be done before animation + + if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) { + targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]); + } + + changed(); + return completed(true); + } + } + + if (el.contains(dragEl)) { + return completed(false); + } + } + + return false; + }, + _ignoreWhileAnimating: null, + _offMoveEvents: function _offMoveEvents() { + off(document, 'mousemove', this._onTouchMove); + off(document, 'touchmove', this._onTouchMove); + off(document, 'pointermove', this._onTouchMove); + off(document, 'dragover', nearestEmptyInsertDetectEvent); + off(document, 'mousemove', nearestEmptyInsertDetectEvent); + off(document, 'touchmove', nearestEmptyInsertDetectEvent); + }, + _offUpEvents: function _offUpEvents() { + var ownerDocument = this.el.ownerDocument; + off(ownerDocument, 'mouseup', this._onDrop); + off(ownerDocument, 'touchend', this._onDrop); + off(ownerDocument, 'pointerup', this._onDrop); + off(ownerDocument, 'touchcancel', this._onDrop); + off(document, 'selectstart', this); + }, + _onDrop: function _onDrop( + /**Event*/ + evt) { + var el = this.el, + options = this.options; // Get the index of the dragged element within its parent + + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); + pluginEvent('drop', this, { + evt: evt + }); + parentEl = dragEl && dragEl.parentNode; // Get again after plugin event + + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); + + if (Sortable.eventCanceled) { + this._nulling(); + + return; + } + + awaitingDragStarted = false; + isCircumstantialInvert = false; + pastFirstInvertThresh = false; + clearInterval(this._loopId); + clearTimeout(this._dragStartTimer); + + _cancelNextTick(this.cloneId); + + _cancelNextTick(this._dragStartId); // Unbind events + + + if (this.nativeDraggable) { + off(document, 'drop', this); + off(el, 'dragstart', this._onDragStart); + } + + this._offMoveEvents(); + + this._offUpEvents(); + + if (Safari) { + css(document.body, 'user-select', ''); + } + + css(dragEl, 'transform', ''); + + if (evt) { + if (moved) { + evt.cancelable && evt.preventDefault(); + !options.dropBubble && evt.stopPropagation(); + } + + ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl); + + if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') { + // Remove clone(s) + cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl); + } + + if (dragEl) { + if (this.nativeDraggable) { + off(dragEl, 'dragend', this); + } + + _disableDraggable(dragEl); + + dragEl.style['will-change'] = ''; // Remove classes + // ghostClass is added in dragStarted + + if (moved && !awaitingDragStarted) { + toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false); + } + + toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event + + _dispatchEvent({ + sortable: this, + name: 'unchoose', + toEl: parentEl, + newIndex: null, + newDraggableIndex: null, + originalEvent: evt + }); + + if (rootEl !== parentEl) { + if (newIndex >= 0) { + // Add event + _dispatchEvent({ + rootEl: parentEl, + name: 'add', + toEl: parentEl, + fromEl: rootEl, + originalEvent: evt + }); // Remove event + + + _dispatchEvent({ + sortable: this, + name: 'remove', + toEl: parentEl, + originalEvent: evt + }); // drag from one list and drop into another + + + _dispatchEvent({ + rootEl: parentEl, + name: 'sort', + toEl: parentEl, + fromEl: rootEl, + originalEvent: evt + }); + + _dispatchEvent({ + sortable: this, + name: 'sort', + toEl: parentEl, + originalEvent: evt + }); + } + + putSortable && putSortable.save(); + } else { + if (newIndex !== oldIndex) { + if (newIndex >= 0) { + // drag & drop within the same list + _dispatchEvent({ + sortable: this, + name: 'update', + toEl: parentEl, + originalEvent: evt + }); + + _dispatchEvent({ + sortable: this, + name: 'sort', + toEl: parentEl, + originalEvent: evt + }); + } + } + } + + if (Sortable.active) { + /* jshint eqnull:true */ + if (newIndex == null || newIndex === -1) { + newIndex = oldIndex; + newDraggableIndex = oldDraggableIndex; + } + + _dispatchEvent({ + sortable: this, + name: 'end', + toEl: parentEl, + originalEvent: evt + }); // Save sorting + + + this.save(); + } + } + } + + this._nulling(); + }, + _nulling: function _nulling() { + pluginEvent('nulling', this); + rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null; + savedInputChecked.forEach(function (el) { + el.checked = true; + }); + savedInputChecked.length = lastDx = lastDy = 0; + }, + handleEvent: function handleEvent( + /**Event*/ + evt) { + switch (evt.type) { + case 'drop': + case 'dragend': + this._onDrop(evt); + + break; + + case 'dragenter': + case 'dragover': + if (dragEl) { + this._onDragOver(evt); + + _globalDragOver(evt); + } + + break; + + case 'selectstart': + evt.preventDefault(); + break; + } + }, + + /** + * Serializes the item into an array of string. + * @returns {String[]} + */ + toArray: function toArray() { + var order = [], + el, + children = this.el.children, + i = 0, + n = children.length, + options = this.options; + + for (; i < n; i++) { + el = children[i]; + + if (closest(el, options.draggable, this.el, false)) { + order.push(el.getAttribute(options.dataIdAttr) || _generateId(el)); + } + } + + return order; + }, + + /** + * Sorts the elements according to the array. + * @param {String[]} order order of the items + */ + sort: function sort(order, useAnimation) { + var items = {}, + rootEl = this.el; + this.toArray().forEach(function (id, i) { + var el = rootEl.children[i]; + + if (closest(el, this.options.draggable, rootEl, false)) { + items[id] = el; + } + }, this); + useAnimation && this.captureAnimationState(); + order.forEach(function (id) { + if (items[id]) { + rootEl.removeChild(items[id]); + rootEl.appendChild(items[id]); + } + }); + useAnimation && this.animateAll(); + }, + + /** + * Save the current sorting + */ + save: function save() { + var store = this.options.store; + store && store.set && store.set(this); + }, + + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * @param {HTMLElement} el + * @param {String} [selector] default: `options.draggable` + * @returns {HTMLElement|null} + */ + closest: function closest$1(el, selector) { + return closest(el, selector || this.options.draggable, this.el, false); + }, + + /** + * Set/get option + * @param {string} name + * @param {*} [value] + * @returns {*} + */ + option: function option(name, value) { + var options = this.options; + + if (value === void 0) { + return options[name]; + } else { + var modifiedValue = PluginManager.modifyOption(this, name, value); + + if (typeof modifiedValue !== 'undefined') { + options[name] = modifiedValue; + } else { + options[name] = value; + } + + if (name === 'group') { + _prepareGroup(options); + } + } + }, + + /** + * Destroy + */ + destroy: function destroy() { + pluginEvent('destroy', this); + var el = this.el; + el[expando] = null; + off(el, 'mousedown', this._onTapStart); + off(el, 'touchstart', this._onTapStart); + off(el, 'pointerdown', this._onTapStart); + + if (this.nativeDraggable) { + off(el, 'dragover', this); + off(el, 'dragenter', this); + } // Remove draggable attributes + + + Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) { + el.removeAttribute('draggable'); + }); + + this._onDrop(); + + this._disableDelayedDragEvents(); + + sortables.splice(sortables.indexOf(this.el), 1); + this.el = el = null; + }, + _hideClone: function _hideClone() { + if (!cloneHidden) { + pluginEvent('hideClone', this); + if (Sortable.eventCanceled) return; + css(cloneEl, 'display', 'none'); + + if (this.options.removeCloneOnHide && cloneEl.parentNode) { + cloneEl.parentNode.removeChild(cloneEl); + } + + cloneHidden = true; + } + }, + _showClone: function _showClone(putSortable) { + if (putSortable.lastPutMode !== 'clone') { + this._hideClone(); + + return; + } + + if (cloneHidden) { + pluginEvent('showClone', this); + if (Sortable.eventCanceled) return; // show clone at dragEl or original position + + if (dragEl.parentNode == rootEl && !this.options.group.revertClone) { + rootEl.insertBefore(cloneEl, dragEl); + } else if (nextEl) { + rootEl.insertBefore(cloneEl, nextEl); + } else { + rootEl.appendChild(cloneEl); + } + + if (this.options.group.revertClone) { + this.animate(dragEl, cloneEl); + } + + css(cloneEl, 'display', ''); + cloneHidden = false; + } + } +}; + +function _globalDragOver( +/**Event*/ +evt) { + if (evt.dataTransfer) { + evt.dataTransfer.dropEffect = 'move'; + } + + evt.cancelable && evt.preventDefault(); +} + +function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) { + var evt, + sortable = fromEl[expando], + onMoveFn = sortable.options.onMove, + retVal; // Support for new CustomEvent feature + + if (window.CustomEvent && !IE11OrLess && !Edge) { + evt = new CustomEvent('move', { + bubbles: true, + cancelable: true + }); + } else { + evt = document.createEvent('Event'); + evt.initEvent('move', true, true); + } + + evt.to = toEl; + evt.from = fromEl; + evt.dragged = dragEl; + evt.draggedRect = dragRect; + evt.related = targetEl || toEl; + evt.relatedRect = targetRect || getRect(toEl); + evt.willInsertAfter = willInsertAfter; + evt.originalEvent = originalEvent; + fromEl.dispatchEvent(evt); + + if (onMoveFn) { + retVal = onMoveFn.call(sortable, evt, originalEvent); + } + + return retVal; +} + +function _disableDraggable(el) { + el.draggable = false; +} + +function _unsilent() { + _silent = false; +} + +function _ghostIsFirst(evt, vertical, sortable) { + var rect = getRect(getChild(sortable.el, 0, sortable.options, true)); + var spacer = 10; + return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left; +} + +function _ghostIsLast(evt, vertical, sortable) { + var rect = getRect(lastChild(sortable.el, sortable.options.draggable)); + var spacer = 10; + return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer; +} + +function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) { + var mouseOnAxis = vertical ? evt.clientY : evt.clientX, + targetLength = vertical ? targetRect.height : targetRect.width, + targetS1 = vertical ? targetRect.top : targetRect.left, + targetS2 = vertical ? targetRect.bottom : targetRect.right, + invert = false; + + if (!invertSwap) { + // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold + if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) { + // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2 + // check if past first invert threshold on side opposite of lastDirection + if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) { + // past first invert threshold, do not restrict inverted threshold to dragEl shadow + pastFirstInvertThresh = true; + } + + if (!pastFirstInvertThresh) { + // dragEl shadow (target move distance shadow) + if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow + : mouseOnAxis > targetS2 - targetMoveDistance) { + return -lastDirection; + } + } else { + invert = true; + } + } else { + // Regular + if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) { + return _getInsertDirection(target); + } + } + } + + invert = invert || invertSwap; + + if (invert) { + // Invert of regular + if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) { + return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1; + } + } + + return 0; +} +/** + * Gets the direction dragEl must be swapped relative to target in order to make it + * seem that dragEl has been "inserted" into that element's position + * @param {HTMLElement} target The target whose position dragEl is being inserted at + * @return {Number} Direction dragEl must be swapped + */ + + +function _getInsertDirection(target) { + if (index(dragEl) < index(target)) { + return 1; + } else { + return -1; + } +} +/** + * Generate id + * @param {HTMLElement} el + * @returns {String} + * @private + */ + + +function _generateId(el) { + var str = el.tagName + el.className + el.src + el.href + el.textContent, + i = str.length, + sum = 0; + + while (i--) { + sum += str.charCodeAt(i); + } + + return sum.toString(36); +} + +function _saveInputCheckedState(root) { + savedInputChecked.length = 0; + var inputs = root.getElementsByTagName('input'); + var idx = inputs.length; + + while (idx--) { + var el = inputs[idx]; + el.checked && savedInputChecked.push(el); + } +} + +function _nextTick(fn) { + return setTimeout(fn, 0); +} + +function _cancelNextTick(id) { + return clearTimeout(id); +} // Fixed #973: + + +if (documentExists) { + on(document, 'touchmove', function (evt) { + if ((Sortable.active || awaitingDragStarted) && evt.cancelable) { + evt.preventDefault(); + } + }); +} // Export utils + + +Sortable.utils = { + on: on, + off: off, + css: css, + find: find, + is: function is(el, selector) { + return !!closest(el, selector, el, false); + }, + extend: extend, + throttle: throttle, + closest: closest, + toggleClass: toggleClass, + clone: clone, + index: index, + nextTick: _nextTick, + cancelNextTick: _cancelNextTick, + detectDirection: _detectDirection, + getChild: getChild +}; +/** + * Get the Sortable instance of an element + * @param {HTMLElement} element The element + * @return {Sortable|undefined} The instance of Sortable + */ + +Sortable.get = function (element) { + return element[expando]; +}; +/** + * Mount a plugin to Sortable + * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted + */ + + +Sortable.mount = function () { + for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) { + plugins[_key] = arguments[_key]; + } + + if (plugins[0].constructor === Array) plugins = plugins[0]; + plugins.forEach(function (plugin) { + if (!plugin.prototype || !plugin.prototype.constructor) { + throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin)); + } + + if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils); + PluginManager.mount(plugin); + }); +}; +/** + * Create sortable instance + * @param {HTMLElement} el + * @param {Object} [options] + */ + + +Sortable.create = function (el, options) { + return new Sortable(el, options); +}; // Export + + +Sortable.version = version; + +var autoScrolls = [], + scrollEl, + scrollRootEl, + scrolling = false, + lastAutoScrollX, + lastAutoScrollY, + touchEvt$1, + pointerElemChangedInterval; + +function AutoScrollPlugin() { + function AutoScroll() { + this.defaults = { + scroll: true, + forceAutoScrollFallback: false, + scrollSensitivity: 30, + scrollSpeed: 10, + bubbleScroll: true + }; // Bind all private methods + + for (var fn in this) { + if (fn.charAt(0) === '_' && typeof this[fn] === 'function') { + this[fn] = this[fn].bind(this); + } + } + } + + AutoScroll.prototype = { + dragStarted: function dragStarted(_ref) { + var originalEvent = _ref.originalEvent; + + if (this.sortable.nativeDraggable) { + on(document, 'dragover', this._handleAutoScroll); + } else { + if (this.options.supportPointer) { + on(document, 'pointermove', this._handleFallbackAutoScroll); + } else if (originalEvent.touches) { + on(document, 'touchmove', this._handleFallbackAutoScroll); + } else { + on(document, 'mousemove', this._handleFallbackAutoScroll); + } + } + }, + dragOverCompleted: function dragOverCompleted(_ref2) { + var originalEvent = _ref2.originalEvent; + + // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached) + if (!this.options.dragOverBubble && !originalEvent.rootEl) { + this._handleAutoScroll(originalEvent); + } + }, + drop: function drop() { + if (this.sortable.nativeDraggable) { + off(document, 'dragover', this._handleAutoScroll); + } else { + off(document, 'pointermove', this._handleFallbackAutoScroll); + off(document, 'touchmove', this._handleFallbackAutoScroll); + off(document, 'mousemove', this._handleFallbackAutoScroll); + } + + clearPointerElemChangedInterval(); + clearAutoScrolls(); + cancelThrottle(); + }, + nulling: function nulling() { + touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null; + autoScrolls.length = 0; + }, + _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) { + this._handleAutoScroll(evt, true); + }, + _handleAutoScroll: function _handleAutoScroll(evt, fallback) { + var _this = this; + + var x = (evt.touches ? evt.touches[0] : evt).clientX, + y = (evt.touches ? evt.touches[0] : evt).clientY, + elem = document.elementFromPoint(x, y); + touchEvt$1 = evt; // IE does not seem to have native autoscroll, + // Edge's autoscroll seems too conditional, + // MACOS Safari does not have autoscroll, + // Firefox and Chrome are good + + if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) { + autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change + + var ogElemScroller = getParentAutoScrollElement(elem, true); + + if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) { + pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour + + pointerElemChangedInterval = setInterval(function () { + var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true); + + if (newElem !== ogElemScroller) { + ogElemScroller = newElem; + clearAutoScrolls(); + } + + autoScroll(evt, _this.options, newElem, fallback); + }, 10); + lastAutoScrollX = x; + lastAutoScrollY = y; + } + } else { + // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll + if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) { + clearAutoScrolls(); + return; + } + + autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false); + } + } + }; + return _extends(AutoScroll, { + pluginName: 'scroll', + initializeByDefault: true + }); +} + +function clearAutoScrolls() { + autoScrolls.forEach(function (autoScroll) { + clearInterval(autoScroll.pid); + }); + autoScrolls = []; +} + +function clearPointerElemChangedInterval() { + clearInterval(pointerElemChangedInterval); +} + +var autoScroll = throttle(function (evt, options, rootEl, isFallback) { + // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521 + if (!options.scroll) return; + var x = (evt.touches ? evt.touches[0] : evt).clientX, + y = (evt.touches ? evt.touches[0] : evt).clientY, + sens = options.scrollSensitivity, + speed = options.scrollSpeed, + winScroller = getWindowScrollingElement(); + var scrollThisInstance = false, + scrollCustomFn; // New scroll root, set scrollEl + + if (scrollRootEl !== rootEl) { + scrollRootEl = rootEl; + clearAutoScrolls(); + scrollEl = options.scroll; + scrollCustomFn = options.scrollFn; + + if (scrollEl === true) { + scrollEl = getParentAutoScrollElement(rootEl, true); + } + } + + var layersOut = 0; + var currentParent = scrollEl; + + do { + var el = currentParent, + rect = getRect(el), + top = rect.top, + bottom = rect.bottom, + left = rect.left, + right = rect.right, + width = rect.width, + height = rect.height, + canScrollX = void 0, + canScrollY = void 0, + scrollWidth = el.scrollWidth, + scrollHeight = el.scrollHeight, + elCSS = css(el), + scrollPosX = el.scrollLeft, + scrollPosY = el.scrollTop; + + if (el === winScroller) { + canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible'); + canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible'); + } else { + canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll'); + canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll'); + } + + var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX); + var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY); + + if (!autoScrolls[layersOut]) { + for (var i = 0; i <= layersOut; i++) { + if (!autoScrolls[i]) { + autoScrolls[i] = {}; + } + } + } + + if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) { + autoScrolls[layersOut].el = el; + autoScrolls[layersOut].vx = vx; + autoScrolls[layersOut].vy = vy; + clearInterval(autoScrolls[layersOut].pid); + + if (vx != 0 || vy != 0) { + scrollThisInstance = true; + /* jshint loopfunc:true */ + + autoScrolls[layersOut].pid = setInterval(function () { + // emulate drag over during autoscroll (fallback), emulating native DnD behaviour + if (isFallback && this.layer === 0) { + Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely + + } + + var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0; + var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0; + + if (typeof scrollCustomFn === 'function') { + if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') { + return; + } + } + + scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY); + }.bind({ + layer: layersOut + }), 24); + } + } + + layersOut++; + } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false))); + + scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not +}, 30); + +var drop = function drop(_ref) { + var originalEvent = _ref.originalEvent, + putSortable = _ref.putSortable, + dragEl = _ref.dragEl, + activeSortable = _ref.activeSortable, + dispatchSortableEvent = _ref.dispatchSortableEvent, + hideGhostForTarget = _ref.hideGhostForTarget, + unhideGhostForTarget = _ref.unhideGhostForTarget; + if (!originalEvent) return; + var toSortable = putSortable || activeSortable; + hideGhostForTarget(); + var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent; + var target = document.elementFromPoint(touch.clientX, touch.clientY); + unhideGhostForTarget(); + + if (toSortable && !toSortable.el.contains(target)) { + dispatchSortableEvent('spill'); + this.onSpill({ + dragEl: dragEl, + putSortable: putSortable + }); + } +}; + +function Revert() {} + +Revert.prototype = { + startIndex: null, + dragStart: function dragStart(_ref2) { + var oldDraggableIndex = _ref2.oldDraggableIndex; + this.startIndex = oldDraggableIndex; + }, + onSpill: function onSpill(_ref3) { + var dragEl = _ref3.dragEl, + putSortable = _ref3.putSortable; + this.sortable.captureAnimationState(); + + if (putSortable) { + putSortable.captureAnimationState(); + } + + var nextSibling = getChild(this.sortable.el, this.startIndex, this.options); + + if (nextSibling) { + this.sortable.el.insertBefore(dragEl, nextSibling); + } else { + this.sortable.el.appendChild(dragEl); + } + + this.sortable.animateAll(); + + if (putSortable) { + putSortable.animateAll(); + } + }, + drop: drop +}; + +_extends(Revert, { + pluginName: 'revertOnSpill' +}); + +function Remove() {} + +Remove.prototype = { + onSpill: function onSpill(_ref4) { + var dragEl = _ref4.dragEl, + putSortable = _ref4.putSortable; + var parentSortable = putSortable || this.sortable; + parentSortable.captureAnimationState(); + dragEl.parentNode && dragEl.parentNode.removeChild(dragEl); + parentSortable.animateAll(); + }, + drop: drop +}; + +_extends(Remove, { + pluginName: 'removeOnSpill' +}); + +var lastSwapEl; + +function SwapPlugin() { + function Swap() { + this.defaults = { + swapClass: 'sortable-swap-highlight' + }; + } + + Swap.prototype = { + dragStart: function dragStart(_ref) { + var dragEl = _ref.dragEl; + lastSwapEl = dragEl; + }, + dragOverValid: function dragOverValid(_ref2) { + var completed = _ref2.completed, + target = _ref2.target, + onMove = _ref2.onMove, + activeSortable = _ref2.activeSortable, + changed = _ref2.changed, + cancel = _ref2.cancel; + if (!activeSortable.options.swap) return; + var el = this.sortable.el, + options = this.options; + + if (target && target !== el) { + var prevSwapEl = lastSwapEl; + + if (onMove(target) !== false) { + toggleClass(target, options.swapClass, true); + lastSwapEl = target; + } else { + lastSwapEl = null; + } + + if (prevSwapEl && prevSwapEl !== lastSwapEl) { + toggleClass(prevSwapEl, options.swapClass, false); + } + } + + changed(); + completed(true); + cancel(); + }, + drop: function drop(_ref3) { + var activeSortable = _ref3.activeSortable, + putSortable = _ref3.putSortable, + dragEl = _ref3.dragEl; + var toSortable = putSortable || this.sortable; + var options = this.options; + lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false); + + if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) { + if (dragEl !== lastSwapEl) { + toSortable.captureAnimationState(); + if (toSortable !== activeSortable) activeSortable.captureAnimationState(); + swapNodes(dragEl, lastSwapEl); + toSortable.animateAll(); + if (toSortable !== activeSortable) activeSortable.animateAll(); + } + } + }, + nulling: function nulling() { + lastSwapEl = null; + } + }; + return _extends(Swap, { + pluginName: 'swap', + eventProperties: function eventProperties() { + return { + swapItem: lastSwapEl + }; + } + }); +} + +function swapNodes(n1, n2) { + var p1 = n1.parentNode, + p2 = n2.parentNode, + i1, + i2; + if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return; + i1 = index(n1); + i2 = index(n2); + + if (p1.isEqualNode(p2) && i1 < i2) { + i2++; + } + + p1.insertBefore(n2, p1.children[i1]); + p2.insertBefore(n1, p2.children[i2]); +} + +var multiDragElements = [], + multiDragClones = [], + lastMultiDragSelect, + // for selection with modifier key down (SHIFT) +multiDragSortable, + initialFolding = false, + // Initial multi-drag fold when drag started +folding = false, + // Folding any other time +dragStarted = false, + dragEl$1, + clonesFromRect, + clonesHidden; + +function MultiDragPlugin() { + function MultiDrag(sortable) { + // Bind all private methods + for (var fn in this) { + if (fn.charAt(0) === '_' && typeof this[fn] === 'function') { + this[fn] = this[fn].bind(this); + } + } + + if (sortable.options.supportPointer) { + on(document, 'pointerup', this._deselectMultiDrag); + } else { + on(document, 'mouseup', this._deselectMultiDrag); + on(document, 'touchend', this._deselectMultiDrag); + } + + on(document, 'keydown', this._checkKeyDown); + on(document, 'keyup', this._checkKeyUp); + this.defaults = { + selectedClass: 'sortable-selected', + multiDragKey: null, + setData: function setData(dataTransfer, dragEl) { + var data = ''; + + if (multiDragElements.length && multiDragSortable === sortable) { + multiDragElements.forEach(function (multiDragElement, i) { + data += (!i ? '' : ', ') + multiDragElement.textContent; + }); + } else { + data = dragEl.textContent; + } + + dataTransfer.setData('Text', data); + } + }; + } + + MultiDrag.prototype = { + multiDragKeyDown: false, + isMultiDrag: false, + delayStartGlobal: function delayStartGlobal(_ref) { + var dragged = _ref.dragEl; + dragEl$1 = dragged; + }, + delayEnded: function delayEnded() { + this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1); + }, + setupClone: function setupClone(_ref2) { + var sortable = _ref2.sortable, + cancel = _ref2.cancel; + if (!this.isMultiDrag) return; + + for (var i = 0; i < multiDragElements.length; i++) { + multiDragClones.push(clone(multiDragElements[i])); + multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex; + multiDragClones[i].draggable = false; + multiDragClones[i].style['will-change'] = ''; + toggleClass(multiDragClones[i], this.options.selectedClass, false); + multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false); + } + + sortable._hideClone(); + + cancel(); + }, + clone: function clone(_ref3) { + var sortable = _ref3.sortable, + rootEl = _ref3.rootEl, + dispatchSortableEvent = _ref3.dispatchSortableEvent, + cancel = _ref3.cancel; + if (!this.isMultiDrag) return; + + if (!this.options.removeCloneOnHide) { + if (multiDragElements.length && multiDragSortable === sortable) { + insertMultiDragClones(true, rootEl); + dispatchSortableEvent('clone'); + cancel(); + } + } + }, + showClone: function showClone(_ref4) { + var cloneNowShown = _ref4.cloneNowShown, + rootEl = _ref4.rootEl, + cancel = _ref4.cancel; + if (!this.isMultiDrag) return; + insertMultiDragClones(false, rootEl); + multiDragClones.forEach(function (clone) { + css(clone, 'display', ''); + }); + cloneNowShown(); + clonesHidden = false; + cancel(); + }, + hideClone: function hideClone(_ref5) { + var _this = this; + + var sortable = _ref5.sortable, + cloneNowHidden = _ref5.cloneNowHidden, + cancel = _ref5.cancel; + if (!this.isMultiDrag) return; + multiDragClones.forEach(function (clone) { + css(clone, 'display', 'none'); + + if (_this.options.removeCloneOnHide && clone.parentNode) { + clone.parentNode.removeChild(clone); + } + }); + cloneNowHidden(); + clonesHidden = true; + cancel(); + }, + dragStartGlobal: function dragStartGlobal(_ref6) { + var sortable = _ref6.sortable; + + if (!this.isMultiDrag && multiDragSortable) { + multiDragSortable.multiDrag._deselectMultiDrag(); + } + + multiDragElements.forEach(function (multiDragElement) { + multiDragElement.sortableIndex = index(multiDragElement); + }); // Sort multi-drag elements + + multiDragElements = multiDragElements.sort(function (a, b) { + return a.sortableIndex - b.sortableIndex; + }); + dragStarted = true; + }, + dragStarted: function dragStarted(_ref7) { + var _this2 = this; + + var sortable = _ref7.sortable; + if (!this.isMultiDrag) return; + + if (this.options.sort) { + // Capture rects, + // hide multi drag elements (by positioning them absolute), + // set multi drag elements rects to dragRect, + // show multi drag elements, + // animate to rects, + // unset rects & remove from DOM + sortable.captureAnimationState(); + + if (this.options.animation) { + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + css(multiDragElement, 'position', 'absolute'); + }); + var dragRect = getRect(dragEl$1, false, true, true); + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + setRect(multiDragElement, dragRect); + }); + folding = true; + initialFolding = true; + } + } + + sortable.animateAll(function () { + folding = false; + initialFolding = false; + + if (_this2.options.animation) { + multiDragElements.forEach(function (multiDragElement) { + unsetRect(multiDragElement); + }); + } // Remove all auxiliary multidrag items from el, if sorting enabled + + + if (_this2.options.sort) { + removeMultiDragElements(); + } + }); + }, + dragOver: function dragOver(_ref8) { + var target = _ref8.target, + completed = _ref8.completed, + cancel = _ref8.cancel; + + if (folding && ~multiDragElements.indexOf(target)) { + completed(false); + cancel(); + } + }, + revert: function revert(_ref9) { + var fromSortable = _ref9.fromSortable, + rootEl = _ref9.rootEl, + sortable = _ref9.sortable, + dragRect = _ref9.dragRect; + + if (multiDragElements.length > 1) { + // Setup unfold animation + multiDragElements.forEach(function (multiDragElement) { + sortable.addAnimationState({ + target: multiDragElement, + rect: folding ? getRect(multiDragElement) : dragRect + }); + unsetRect(multiDragElement); + multiDragElement.fromRect = dragRect; + fromSortable.removeAnimationState(multiDragElement); + }); + folding = false; + insertMultiDragElements(!this.options.removeCloneOnHide, rootEl); + } + }, + dragOverCompleted: function dragOverCompleted(_ref10) { + var sortable = _ref10.sortable, + isOwner = _ref10.isOwner, + insertion = _ref10.insertion, + activeSortable = _ref10.activeSortable, + parentEl = _ref10.parentEl, + putSortable = _ref10.putSortable; + var options = this.options; + + if (insertion) { + // Clones must be hidden before folding animation to capture dragRectAbsolute properly + if (isOwner) { + activeSortable._hideClone(); + } + + initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location + + if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) { + // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible + var dragRectAbsolute = getRect(dragEl$1, false, true, true); + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted + // while folding, and so that we can capture them again because old sortable will no longer be fromSortable + + parentEl.appendChild(multiDragElement); + }); + folding = true; + } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out + + + if (!isOwner) { + // Only remove if not folding (folding will remove them anyways) + if (!folding) { + removeMultiDragElements(); + } + + if (multiDragElements.length > 1) { + var clonesHiddenBefore = clonesHidden; + + activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden + + + if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) { + multiDragClones.forEach(function (clone) { + activeSortable.addAnimationState({ + target: clone, + rect: clonesFromRect + }); + clone.fromRect = clonesFromRect; + clone.thisAnimationDuration = null; + }); + } + } else { + activeSortable._showClone(sortable); + } + } + } + }, + dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) { + var dragRect = _ref11.dragRect, + isOwner = _ref11.isOwner, + activeSortable = _ref11.activeSortable; + multiDragElements.forEach(function (multiDragElement) { + multiDragElement.thisAnimationDuration = null; + }); + + if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) { + clonesFromRect = _extends({}, dragRect); + var dragMatrix = matrix(dragEl$1, true); + clonesFromRect.top -= dragMatrix.f; + clonesFromRect.left -= dragMatrix.e; + } + }, + dragOverAnimationComplete: function dragOverAnimationComplete() { + if (folding) { + folding = false; + removeMultiDragElements(); + } + }, + drop: function drop(_ref12) { + var evt = _ref12.originalEvent, + rootEl = _ref12.rootEl, + parentEl = _ref12.parentEl, + sortable = _ref12.sortable, + dispatchSortableEvent = _ref12.dispatchSortableEvent, + oldIndex = _ref12.oldIndex, + putSortable = _ref12.putSortable; + var toSortable = putSortable || this.sortable; + if (!evt) return; + var options = this.options, + children = parentEl.children; // Multi-drag selection + + if (!dragStarted) { + if (options.multiDragKey && !this.multiDragKeyDown) { + this._deselectMultiDrag(); + } + + toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1)); + + if (!~multiDragElements.indexOf(dragEl$1)) { + multiDragElements.push(dragEl$1); + dispatchEvent({ + sortable: sortable, + rootEl: rootEl, + name: 'select', + targetEl: dragEl$1, + originalEvt: evt + }); // Modifier activated, select from last to dragEl + + if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) { + var lastIndex = index(lastMultiDragSelect), + currentIndex = index(dragEl$1); + + if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) { + // Must include lastMultiDragSelect (select it), in case modified selection from no selection + // (but previous selection existed) + var n, i; + + if (currentIndex > lastIndex) { + i = lastIndex; + n = currentIndex; + } else { + i = currentIndex; + n = lastIndex + 1; + } + + for (; i < n; i++) { + if (~multiDragElements.indexOf(children[i])) continue; + toggleClass(children[i], options.selectedClass, true); + multiDragElements.push(children[i]); + dispatchEvent({ + sortable: sortable, + rootEl: rootEl, + name: 'select', + targetEl: children[i], + originalEvt: evt + }); + } + } + } else { + lastMultiDragSelect = dragEl$1; + } + + multiDragSortable = toSortable; + } else { + multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1); + lastMultiDragSelect = null; + dispatchEvent({ + sortable: sortable, + rootEl: rootEl, + name: 'deselect', + targetEl: dragEl$1, + originalEvt: evt + }); + } + } // Multi-drag drop + + + if (dragStarted && this.isMultiDrag) { + folding = false; // Do not "unfold" after around dragEl if reverted + + if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) { + var dragRect = getRect(dragEl$1), + multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')'); + if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null; + toSortable.captureAnimationState(); + + if (!initialFolding) { + if (options.animation) { + dragEl$1.fromRect = dragRect; + multiDragElements.forEach(function (multiDragElement) { + multiDragElement.thisAnimationDuration = null; + + if (multiDragElement !== dragEl$1) { + var rect = folding ? getRect(multiDragElement) : dragRect; + multiDragElement.fromRect = rect; // Prepare unfold animation + + toSortable.addAnimationState({ + target: multiDragElement, + rect: rect + }); + } + }); + } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert + // properly they must all be removed + + + removeMultiDragElements(); + multiDragElements.forEach(function (multiDragElement) { + if (children[multiDragIndex]) { + parentEl.insertBefore(multiDragElement, children[multiDragIndex]); + } else { + parentEl.appendChild(multiDragElement); + } + + multiDragIndex++; + }); // If initial folding is done, the elements may have changed position because they are now + // unfolding around dragEl, even though dragEl may not have his index changed, so update event + // must be fired here as Sortable will not. + + if (oldIndex === index(dragEl$1)) { + var update = false; + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement.sortableIndex !== index(multiDragElement)) { + update = true; + return; + } + }); + + if (update) { + dispatchSortableEvent('update'); + } + } + } // Must be done after capturing individual rects (scroll bar) + + + multiDragElements.forEach(function (multiDragElement) { + unsetRect(multiDragElement); + }); + toSortable.animateAll(); + } + + multiDragSortable = toSortable; + } // Remove clones if necessary + + + if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') { + multiDragClones.forEach(function (clone) { + clone.parentNode && clone.parentNode.removeChild(clone); + }); + } + }, + nullingGlobal: function nullingGlobal() { + this.isMultiDrag = dragStarted = false; + multiDragClones.length = 0; + }, + destroyGlobal: function destroyGlobal() { + this._deselectMultiDrag(); + + off(document, 'pointerup', this._deselectMultiDrag); + off(document, 'mouseup', this._deselectMultiDrag); + off(document, 'touchend', this._deselectMultiDrag); + off(document, 'keydown', this._checkKeyDown); + off(document, 'keyup', this._checkKeyUp); + }, + _deselectMultiDrag: function _deselectMultiDrag(evt) { + if (typeof dragStarted !== "undefined" && dragStarted) return; // Only deselect if selection is in this sortable + + if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable + + if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click + + if (evt && evt.button !== 0) return; + + while (multiDragElements.length) { + var el = multiDragElements[0]; + toggleClass(el, this.options.selectedClass, false); + multiDragElements.shift(); + dispatchEvent({ + sortable: this.sortable, + rootEl: this.sortable.el, + name: 'deselect', + targetEl: el, + originalEvt: evt + }); + } + }, + _checkKeyDown: function _checkKeyDown(evt) { + if (evt.key === this.options.multiDragKey) { + this.multiDragKeyDown = true; + } + }, + _checkKeyUp: function _checkKeyUp(evt) { + if (evt.key === this.options.multiDragKey) { + this.multiDragKeyDown = false; + } + } + }; + return _extends(MultiDrag, { + // Static methods & properties + pluginName: 'multiDrag', + utils: { + /** + * Selects the provided multi-drag item + * @param {HTMLElement} el The element to be selected + */ + select: function select(el) { + var sortable = el.parentNode[expando]; + if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return; + + if (multiDragSortable && multiDragSortable !== sortable) { + multiDragSortable.multiDrag._deselectMultiDrag(); + + multiDragSortable = sortable; + } + + toggleClass(el, sortable.options.selectedClass, true); + multiDragElements.push(el); + }, + + /** + * Deselects the provided multi-drag item + * @param {HTMLElement} el The element to be deselected + */ + deselect: function deselect(el) { + var sortable = el.parentNode[expando], + index = multiDragElements.indexOf(el); + if (!sortable || !sortable.options.multiDrag || !~index) return; + toggleClass(el, sortable.options.selectedClass, false); + multiDragElements.splice(index, 1); + } + }, + eventProperties: function eventProperties() { + var _this3 = this; + + var oldIndicies = [], + newIndicies = []; + multiDragElements.forEach(function (multiDragElement) { + oldIndicies.push({ + multiDragElement: multiDragElement, + index: multiDragElement.sortableIndex + }); // multiDragElements will already be sorted if folding + + var newIndex; + + if (folding && multiDragElement !== dragEl$1) { + newIndex = -1; + } else if (folding) { + newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')'); + } else { + newIndex = index(multiDragElement); + } + + newIndicies.push({ + multiDragElement: multiDragElement, + index: newIndex + }); + }); + return { + items: _toConsumableArray(multiDragElements), + clones: [].concat(multiDragClones), + oldIndicies: oldIndicies, + newIndicies: newIndicies + }; + }, + optionListeners: { + multiDragKey: function multiDragKey(key) { + key = key.toLowerCase(); + + if (key === 'ctrl') { + key = 'Control'; + } else if (key.length > 1) { + key = key.charAt(0).toUpperCase() + key.substr(1); + } + + return key; + } + } + }); +} + +function insertMultiDragElements(clonesInserted, rootEl) { + multiDragElements.forEach(function (multiDragElement, i) { + var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)]; + + if (target) { + rootEl.insertBefore(multiDragElement, target); + } else { + rootEl.appendChild(multiDragElement); + } + }); +} +/** + * Insert multi-drag clones + * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted + * @param {HTMLElement} rootEl + */ + + +function insertMultiDragClones(elementsInserted, rootEl) { + multiDragClones.forEach(function (clone, i) { + var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)]; + + if (target) { + rootEl.insertBefore(clone, target); + } else { + rootEl.appendChild(clone); + } + }); +} + +function removeMultiDragElements() { + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement); + }); +} + +Sortable.mount(new AutoScrollPlugin()); +Sortable.mount(Remove, Revert); + +/* harmony default export */ __webpack_exports__["default"] = (Sortable); + + + +/***/ }), +/* 105 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(106); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } + + + + + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("BoostRelief"); + +/** + * @classdesc + * Control to exagerate the elevation + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.BoostRelief + * @param {Object} brOptions - control options + * @param {Object} [brOptions.scale] - Defines the scale used to boost the relief + * @param {Number} [brOptions.scale.min] - Minimum of the scale - 1 by default + * @param {Number} [brOptions.scale.max] - Maximum of the scale - 50 by default + * @param {Number} [brOptions.scale.step] - Step of the scale - 1 by default + * @param {Boolean} [brOptions.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading. + * @param {Boolean} [brOptions.defaultBoost = 1] - Default boost value applied to the widget and the elevation layers when loaded + * @example + * var boostRelief = new itowns.control.BoostRelief({ + * scale : { + * max : 30, + * step : 2 + * }, + * defaultBoost : 6 + * }) + */ +function BoostRelief(brOptions) { + brOptions = brOptions || {}; + var options = brOptions.options || {}; + if (!(this instanceof BoostRelief)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + if (_typeof(options) !== "object") { + throw new Error("ERROR WRONG_TYPE : options should be an object"); + } + this._initialize(); + var container = this._initContainer(brOptions); + var targetDiv = document.getElementById(options.target) || null; + _Widget__WEBPACK_IMPORTED_MODULE_4__["default"].call(this, { + name: "BoostRelief", + element: container, + target: targetDiv + }); +} + +/* + * @lends module:BoostRelief + */ +BoostRelief.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__["default"].prototype, {}); + +// retrieves methods of the common class BoostReliefDOM +_Common_Utils__WEBPACK_IMPORTED_MODULE_1__["default"].assign(BoostRelief.prototype, _Common_Controls_BoostReliefDOM__WEBPACK_IMPORTED_MODULE_3__["default"]); + +/** + * Constructor (alias) + * + * @private + */ +BoostRelief.prototype.constructor = BoostRelief; + +// ################################################################### // +// ############## public methods (getters, setters) ################## // +// ################################################################### // + +/** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ +BoostRelief.prototype.setGlobe = function (globe) { + // TODO - removing listeners + // this._globe.removeLayerListener(layers[j], GlobeViewExtended.EVENTS.Relief_PROPERTY_CHANGED, this._callbacks.onReliefLayerCallBack); + // deletes the layerSwitcher DOM + if (!globe) { + while (this._element.hasChildNodes()) { + this._element.removeChild(this._element.lastChild); + } + this._element.parentNode.removeChild(this._element); + } + // calls original setGlobe method + _Widget__WEBPACK_IMPORTED_MODULE_4__["default"].prototype.setGlobe.call(this, globe); +}; + +/** + * Collapse or display control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ +BoostRelief.prototype.setCollapsed = function (collapsed) { + if (collapsed === undefined) { + logger.error("BoostRelief:setCollapsed - missing collapsed parameter"); + return; + } + if (typeof collapsed !== "boolean") { + logger.error("BoostRelief:setCollapsed - collapsed parameter is not a boolean"); + return; + } + var isCollapsed = this.getCollapsed(); + if (collapsed && isCollapsed || !collapsed && !isCollapsed) { + return; + } + var controlDiv = document.getElementById(this._addUID("GPBoostReliefListContainer")); + if (collapsed) { + controlDiv.style.display = "block"; + document.getElementById(this._addUID("GPshowBoostReliefList")).checked = true; + } else { + controlDiv.style.display = "none"; + document.getElementById(this._addUID("GPshowBoostReliefList")).checked = false; + } +}; + +/** + * Returns true if widget is collapsed (minimize), false otherwise + * @return {Boolean} is collapsed + */ +BoostRelief.prototype.getCollapsed = function () { + return document.getElementById(this._addUID("GPshowBoostReliefList")).checked; +}; + +// ################################################################### // +// ##################### init component ############################## // +// ################################################################### // + +/** + * Initialize BoostRelief control (called by constructor) + * + * @private + */ +BoostRelief.prototype._initialize = function () { + // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page) + this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__["default"].generate(); + + // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...) + this._layers = {}; + + // callbacks + this._callbacks = {}; +}; + +/** + * Creates control main container + * + * @method _initContainer + * @param {Object} brOptions - control options + * @returns {DOMElement} container - widget container + * @private + */ +BoostRelief.prototype._initContainer = function (brOptions) { + var container = this._createMainContainerElement(); + + // adds in the main container the layer display selector + var inputShow = this._createMainBoostReliefShowElement(brOptions.collapsed); + container.appendChild(inputShow); + + // adds the layer list in the main container + var divA = this._boostReliefListContainer = this._createMainBoostReliefListContainer(); + var boostReliefList = this._createAdvancedToolElement(brOptions); + divA.appendChild(boostReliefList); + container.appendChild(divA); + + // adds the widget picto in the main container + var picto = this._createMainPictoElement(); + container.appendChild(picto); + if (brOptions.collapsed) { + divA.style.display = "block"; + } else { + divA.style.display = "none"; + } + return container; +}; + +// ################################################################### // +// ######################### DOM events ############################## // +// ################################################################### // + +/** + * Changes layer relief on layer relief picto click + * + * @method _onChangeLayerRelief + * @param {Object} e - HTML event + * @private + */ + +BoostRelief.prototype._onChangeLayerRelief = function (e) { + var reliefValue = parseInt(e.target.value); + var reliefId = document.getElementById(this._addUID("GPreliefValue")); + reliefId.innerHTML = "x" + reliefValue; + this._updateLayersRelief(reliefValue); +}; + +/** + * Updates relief values of all elevation layers + * + * @method _updateLayerRelief + * @param {Number} reliefValue - relief value + * @private + */ + +BoostRelief.prototype._updateLayersRelief = function (reliefValue) { + var globe = this.getGlobe(); + function updateScale(layer, value) { + layer.scale = value; + globe.notifyChange(layer); + } + // if the scale of a single elevationLayer change, we update the scale of all others + var elevationLayers = globe.getElevationLayers(); + for (var i = 0; i < elevationLayers.length; i++) { + updateScale(elevationLayers[i], reliefValue); + } +}; + +/** + * Updates relief slider and all elevation layers with the given boost value + * + * @method changeBoost + * @param {Number} reliefValue - relief value + */ + +BoostRelief.prototype.changeBoost = function (reliefValue) { + var layerReliefInput = document.getElementById(this._addUID("GPreliefValueDiv")); + if (!layerReliefInput) { + logger.error("BoostRelief:changeBoost - boostRelief slider not loaded"); + return; + } + + // the reliefValue given must me in the slider range + if (reliefValue > layerReliefInput.max) { + reliefValue = layerReliefInput.max; + } + if (reliefValue < layerReliefInput.min) { + reliefValue = layerReliefInput.min; + } + + // updates the relief of all the elevationlayers + this._updateLayersRelief(reliefValue); + + // updates the slider cursor + layerReliefInput.value = reliefValue; + + // updates the slider text + var layerReliefSpan = document.getElementById(this._addUID("GPreliefValue")); + if (layerReliefSpan) { + layerReliefSpan.innerHTML = "x" + reliefValue; + } +}; + +/** + * Gets layer id from div id + * + * @method _resolveLayerId + * @param {String} divId - HTML div id + * @returns {String} layer id + * @private + */ +BoostRelief.prototype._resolveLayerId = function (divId) { + var divName = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__["default"].name(divId); // ex GPvisibilityPicto_ID_26 + return divName.substring(divName.indexOf("_ID_") + 4); // ex. 26 +}; + +/* harmony default export */ __webpack_exports__["default"] = (BoostRelief); + +/***/ }), +/* 106 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +var BoostReliefDOM = { + // ################################################################### // + // ######################### Main container ########################## // + // ################################################################### // + + /** + * Add uuid to the tag ID + * @param {String} id - id selector + * @returns {String} uid - id selector with an unique id + */ + _addUID: function _addUID(id) { + var uid = this._uid ? id + "-" + this._uid : id; + return uid; + }, + /** + * Creation du container principal (DOM) + * + * @returns {DOMElement} container - layer switcher DOM element + */ + _createMainContainerElement: function _createMainContainerElement() { + var container = document.createElement("div"); + container.id = this._addUID("GPboostRelief"); + container.className = "GPwidget"; + return container; + }, + /** + * Creation du selecteur (caché) pour l'affichage/masquage des slides de boostRelief (DOM) + * + * @param {Boolean} collapsed - option indiquant si le control est déplié + * + * @returns {DOMElement} checkbox DOM + */ + _createMainBoostReliefShowElement: function _createMainBoostReliefShowElement(collapsed) { + var input = document.createElement("input"); + input.id = this._addUID("GPshowBoostReliefList"); + input.type = "checkbox"; + if (collapsed) { + input.checked = true; + } + return input; + }, + // ################################################################### // + // ############################ Relief tool ########################### // + // ################################################################### // + + /** + * Creation du container des outils avancés du layer (DOM) + * + * @param {Object} brOptions - options du control boostRelief + * + * @returns {DOMElement} container + */ + _createAdvancedToolElement: function _createAdvancedToolElement(brOptions) { + // exemple : + //
+ // + //
+ var container = document.createElement("div"); + container.className = "GPlayerAdvancedToolsRelief"; + var array = this._createAdvancedToolReliefElement(brOptions.scale, brOptions.defaultBoost); + for (var j = 0; j < array.length; j++) { + container.appendChild(array[j]); + } + return container; + }, + /** + * Creation de l'icone de gestion du relief du layer (DOM) + * + * @param {Object} scale - définition de l'echelle que le slider utilise (min,max,step) + * @param {Number} defaultBoost - valeur d'exageration par défaut + * + * @returns {DOMElement[]} array of two containers + */ + _createAdvancedToolReliefElement: function _createAdvancedToolReliefElement(scale, defaultBoost) { + // exemple : + //
+ // Layer1 + //
+ // + //
+ // + //
+ //
+ // 100 + // % + //
+ + var list = []; + + // curseur pour changer l'exageration du relief + var divB = document.createElement("div"); + divB.className = "GPlayerRelief"; + divB.title = "Relief"; + + // le relief est à un facteur 1 par défaut + var relief = 1; + var input = document.createElement("input"); + input.id = this._addUID("GPreliefValueDiv"); + input.type = "range"; + + // echelle de 1 à 50 par defaut + if (!scale) { + scale = { + min: 1, + max: 50, + step: 1 + }; + } + ; + input.min = scale.min || 1; + input.max = scale.max || 50; + input.step = scale.step || 1; + + // le relief est à un facteur 1 par défaut + var defaultBoostValue = 1; + if (defaultBoost) { + defaultBoostValue = defaultBoost; + } + + // the reliefValue given must me in the slider range + if (defaultBoostValue > input.max) { + defaultBoostValue = input.max; + } + if (defaultBoostValue < input.min) { + defaultBoostValue = input.min; + } + + // mise à jour des couches et du slider une fois le controle ajouté + input.value = defaultBoostValue; + + // add event for relief change + var context = this; + if (input.addEventListener) { + input.addEventListener("change", function (e) { + context._onChangeLayerRelief(e); + }); + } else if (input.attachEvent) { + // internet explorer + input.attachEvent("onchange", function (e) { + context._onChangeLayerRelief(e); + }); + } + if (input.addEventListener) { + input.addEventListener("input", function (e) { + context._onChangeLayerRelief(e); + }); + } else if (input.attachEvent) { + // internet explorer + input.attachEvent("oninput", function (e) { + context._onChangeLayerRelief(e); + }); + } + divB.appendChild(input); + + // Valeur d'echelle du relief + var divC = document.createElement("div"); + divC.id = this._addUID("GPreliefValueDiv"); + divC.className = "GPlayerReliefValue"; + var span = document.createElement("span"); + span.id = this._addUID("GPreliefValue"); + span.innerHTML = "x" + relief; + divC.appendChild(span); + list.push(divB); + list.push(divC); + return list; + }, + /** + * Création du conteneur principal des couches MNT boostRelief (DOM) + * + * @returns {DOMElement} div DOM + */ + _createMainBoostReliefListContainer: function _createMainBoostReliefListContainer() { + var div = document.createElement("div"); + div.id = this._addUID("GPBoostReliefListContainer"); + div.className = "GPpanel"; + return div; + }, + /** + * Show boostRelief control + * @param {Boolean} isDesktop - specifies if the support is desktop or tactile + * + * @returns {DOMElement} DOM element + */ + + _createMainPictoElement: function _createMainPictoElement() { + var self = this; + var label = document.createElement("label"); + label.id = this._addUID("GPshowBoostReliefListPicto"); + label.className = "GPshowAdvancedToolPicto"; + label.htmlFor = this._addUID("GPshowBoostReliefList"); + label.title = "Afficher/Masquer le control d'exageration du relief"; + var spanOpenClose = document.createElement("span"); + spanOpenClose.id = this._addUID("GPshowBoostReliefOpenClose"); + spanOpenClose.className = "GPshowAdvancedToolOpen"; + + /** Evenement de type 'click' sur le picto du controle */ + label.addEventListener("click", function () { + if (document.getElementById(self._addUID("GPshowBoostReliefList")).checked) { + document.getElementById(self._addUID("GPBoostReliefListContainer")).style.display = "none"; + } else { + document.getElementById(self._addUID("GPBoostReliefListContainer")).style.display = "block"; + } + }); + label.appendChild(spanOpenClose); + return label; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (BoostReliefDOM); + +/***/ }), +/* 107 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(108); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(98); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_4__); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } + + + + + + +/** + * @classdesc + * Control to display buildings on the map + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.Buildings + * @param {Object} buildingsOptions - control options + * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT + * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground + * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation + * @param {Integer} [buildingsOptions.minZoom = 15] - minimum level of zoom the buildings are displayed. 15 by default. Lower is the value, lower are the performances. + * @example + * var buildings = new itowns.control.Buildings ({ + * MNT : false, + * buildingsOnGround : false, + * target : “controlDiv” + * }) + */ +function Buildings(buildingsOptions) { + var options = buildingsOptions || {}; + if (!(this instanceof Buildings)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + if (_typeof(options) !== "object") { + throw new Error("ERROR WRONG_TYPE : options should be an object"); + } + options = this.setOptions(options); + this._initialize(options); + var container = this._initContainer(options); + var targetDiv = document.getElementById(options.target) || null; + _Widget__WEBPACK_IMPORTED_MODULE_3__["default"].call(this, { + name: "Buildings", + element: container, + target: targetDiv + }); +} + +/* + * @lends module:Buildings + */ +Buildings.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_3__["default"].prototype, {}); + +// retrieves methods of the common class BuildingsDOM +_Common_Utils__WEBPACK_IMPORTED_MODULE_0__["default"].assign(Buildings.prototype, _Common_Controls_BuildingsDOM__WEBPACK_IMPORTED_MODULE_2__["default"]); + +/** + * Constructor (alias) + * + * @private + */ +Buildings.prototype.constructor = Buildings; + +// ################################################################### // +// ############## public methods (getters, setters) ################## // +// ################################################################### // + +/** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ +Buildings.prototype.setGlobe = function (globe) { + if (!globe) { + while (this._element.hasChildNodes()) { + this._element.removeChild(this._element.lastChild); + } + this._element.parentNode.removeChild(this._element); + } + // calls original setGlobe method + _Widget__WEBPACK_IMPORTED_MODULE_3__["default"].prototype.setGlobe.call(this, globe); +}; + +// ################################################################### // +// ##################### init component ############################## // +// ################################################################### // + +/** + * Initialize Buildings control (called by constructor) + * + * @param {Object} options - control options + * + * @private + */ +Buildings.prototype._initialize = function (options) { + // id of the control ; used to suffix the CSS id (handles cases with severel controls on the same page) + this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_1__["default"].generate(); + + // {Object} control layers list. Each key is a layer id, and its value is an object of layers options (layer, id, relief, visibility, title, description...) + this._options = options; + + // callbacks + this._callbacks = {}; +}; + +/** + * Creates control main container + * + * @method _initContainer + * @param {Object} options - control options + * @returns {DOMElement} container - widget container + * @private + */ +Buildings.prototype._initContainer = function (options) { + var container = this._createMainContainerElement(); + + // adds the widget picto in the main container + var picto = this._createMainPictoElement(); + container.appendChild(picto); + return container; +}; + +/** + * Adds the default french ELEVATION.ELEVATIONGRIDCOVERAGE MNT to the globe + * + * @method addMNT + * @param {Object} globe - globeView + * @private + */ +Buildings.prototype.addMNT = function (globe) { + var mntLayer = { + type: "elevation", + id: "IGN_MNT_HIGHRES", + noDataValue: -99999, + source: { + protocol: "wmts", + url: "https://data.geopf.fr/wmts", + name: "ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES", + attribution: [{ + name: "IGN", + attribution: "IGN Grandes Echelles", + url: "http://www.ign.fr", + constraints: [{ + crs: "EPSG:4326" + }] + }], + updateStrategy: { + type: 1, + options: { + groups: [3, 7, 11, 14] + } + }, + networkOptions: { + crossOrigin: "omit" + }, + format: "image/x-bil;bits=32", + crs: "EPSG:4326", + tileMatrixSet: "WGS84G", + tileMatrixSetLimits: { + 6: { + minTileRow: 13, + maxTileRow: 36, + minTileCol: 62, + maxTileCol: 80 + }, + 7: { + minTileRow: 27, + maxTileRow: 73, + minTileCol: 124, + maxTileCol: 160 + }, + 8: { + minTileRow: 55, + maxTileRow: 146, + minTileCol: 248, + maxTileCol: 320 + }, + 9: { + minTileRow: 110, + maxTileRow: 292, + minTileCol: 497, + maxTileCol: 640 + }, + 10: { + minTileRow: 221, + maxTileRow: 585, + minTileCol: 994, + maxTileCol: 1281 + }, + 11: { + minTileRow: 442, + maxTileRow: 1171, + minTileCol: 1989, + maxTileCol: 2563 + }, + 12: { + minTileRow: 885, + maxTileRow: 2343, + minTileCol: 3978, + maxTileCol: 5126 + }, + 13: { + minTileRow: 1770, + maxTileRow: 4687, + minTileCol: 7957, + maxTileCol: 10253 + }, + 14: { + minTileRow: 3540, + maxTileRow: 9375, + minTileCol: 15914, + maxTileCol: 20507 + } + } + } + }; + function createWMTSSourceFromConfig(config) { + config.source = new itowns__WEBPACK_IMPORTED_MODULE_4__["WMTSSource"](config.source); + return config; + } + ; + function addElevationLayerFromConfig(config, globe) { + var layer = new itowns__WEBPACK_IMPORTED_MODULE_4__["ElevationLayer"](config.id, config); + globe.addLayer(layer); + } + ; + var mntConfig = createWMTSSourceFromConfig(mntLayer); + addElevationLayerFromConfig(mntConfig, globe); +}; + +/** + * Adds or removes the buildings layer on click + * + * @method addBuildings + * @param {options} options for the buildings control + */ +Buildings.prototype.addBuildings = function (options) { + var vectorStyle = "https://wxs.ign.fr/static/vectorTiles/styles/PLAN.IGN/essentiels/standard.json"; + var layerId = "VTBuilding"; + // ---------- DISPLAY VECTOR TILED BUILDING DATA AS 3D MESHES : ---------- + // Define the source of the building data : those are vector tiled data from the geoportail. + var buildingsSource = new itowns__WEBPACK_IMPORTED_MODULE_4__["VectorTilesSource"]({ + style: vectorStyle, + // We only want to display buildings related data. + // We remove some buildings without alti_sol property (it causes graphical) + filter: function filter(layer) { + return layer["source-layer"].includes("bati_surf") && !layer["filter"].includes("CIMETIERE_SURF") && !layer["filter"].includes("FOOT_SURF") && !layer["filter"].includes("TENNIS_SURF") && !layer["filter"].includes("MULTI_SPORT_SURF") && layer.paint["fill-color"]; + } + }); + + // Defines if the buildings must be displayed on the MNT or at the zero level + var baseAltitude; + var extrusionHeight; + // To extend the extrusion on the ground when altitude is not accurate, we add a delta parameter + var delta = 10; + if (options.buildingsOnGround) { + baseAltitude = 0; + extrusionHeight = function extrusionHeight(p) { + return p.hauteur || 0; + }; + } else { + baseAltitude = function baseAltitude(p) { + return p.alti_sol - delta || 0; + }; + extrusionHeight = function extrusionHeight(p) { + return p.hauteur + delta || 0; + }; + } + + // Create a FeatureGeometryLayer to support building data. + var buildingsLayer = new itowns__WEBPACK_IMPORTED_MODULE_4__["FeatureGeometryLayer"](layerId, { + source: buildingsSource, + zoom: { + min: options.minZoom + }, + accurate: false, + style: new itowns__WEBPACK_IMPORTED_MODULE_4__["Style"]({ + fill: { + base_altitude: baseAltitude, + extrusion_height: extrusionHeight + } + }) + }); + this.getGlobe().addLayer(buildingsLayer); + + // initial settings for buildings visibility and button + this.getGlobe().setLayerVisibility(layerId, options.defaultVisibility); + if (options.defaultVisibility === true) { + this._toggleBuildingsButton(this.getElement(), "off"); + } else { + this._toggleBuildingsButton(this.getElement(), "on"); + } +}; + +/** + * Set the buildings visibility on click + * + * @method setBuildingsVisibility + * @param {Tring} layerId - layer id for the building layer + */ +Buildings.prototype.setBuildingsVisibility = function (layerId) { + if (this.getGlobe().getFeatureGeometryLayers()[0].visible === true) { + this.getGlobe().setLayerVisibility(layerId, false); + this._toggleBuildingsButton(this.getElement(), "on"); + } else { + this.getGlobe().setLayerVisibility(layerId, true); + this._toggleBuildingsButton(this.getElement(), "off"); + } +}; + +/** + * Set the button picture on click + * + * @method _toggleBuildingsButton + * @param {DOM} element - DOM element of the buildings Widget + * @param {String} mode - "on" or "off" to display the deactivated or activated buildings image + * + * @private + */ +Buildings.prototype._toggleBuildingsButton = function (element, mode) { + if (mode === "on") { + element.lastChild.classList.remove("buildingsOff"); + element.lastChild.classList.add("buildingsOn"); + } else { + element.lastChild.classList.remove("buildingsOn"); + element.lastChild.classList.add("buildingsOff"); + } +}; + +/** + * onWidgetAdded : function called when globeVewExtended.addwidget is called + * + * @method onWidgetAdded + * @param {Object} widget - buildings widget + * + * @private + */ +Buildings.prototype.onWidgetAdded = function (widget) { + var widgetOptions = widget.getOptions(); + if (widgetOptions.MNT !== false) { + this.addMNT(widget.getGlobe()); + } + this.addBuildings(widgetOptions); + this.addListener(this.getElement()); +}; + +/** + * addListener : adds the clic listener to handle buildings visibility on the given element + * + * @param {DOM} element - DOM element where the listener has to be added + * + * @private + */ +Buildings.prototype.addListener = function (element) { + element.onclick = function () { + this.setBuildingsVisibility("VTBuilding"); + }.bind(this); +}; + +/** + * setOptions : set the options of the widget + * + * @param {Object} options - options to set + * @returns {Object} buildingOptions - widget options + * @private + */ +Buildings.prototype.setOptions = function (options) { + var buildingsOptions = {}; + buildingsOptions.MNT = options.MNT !== false; + buildingsOptions.buildingsOnGround = options.buildingsOnGround || false; + buildingsOptions.defaultVisibility = options.defaultVisibility !== false; + buildingsOptions.minZoom = options.minZoom || 15; + // common widget options + buildingsOptions.target = options.target; + buildingsOptions.name = options.name; + buildingsOptions.element = options.element; + buildingsOptions.position = options.position; + return buildingsOptions; +}; +/* harmony default export */ __webpack_exports__["default"] = (Buildings); + +/***/ }), +/* 108 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +var BuildingsDOM = { + // ################################################################### // + // ######################### Main container ########################## // + // ################################################################### // + + /** + * Add uuid to the tag ID + * @param {String} id - id selector + * @returns {String} uid - id selector with an unique id + */ + _addUID: function _addUID(id) { + var uid = this._uid ? id + "-" + this._uid : id; + return uid; + }, + /** + * Creation du container principal (DOM) + * + * @returns {DOMElement} container - layer switcher DOM element + */ + _createMainContainerElement: function _createMainContainerElement() { + var container = document.createElement("div"); + container.id = this._addUID("GPbuildings"); + container.className = "GPwidget"; + return container; + }, + /** + * Show buildings control + * @param {Boolean} isDesktop - specifies if the support is desktop or tactile + * + * @returns {DOMElement} DOM element + */ + + _createMainPictoElement: function _createMainPictoElement() { + var label = document.createElement("label"); + label.id = this._addUID("GPshowBuildingsPicto"); + label.title = "Afficher/Masquer les bâtiments 3D"; + return label; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (BuildingsDOM); + +/***/ }), +/* 109 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96); +/* harmony import */ var _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(110); +/* harmony import */ var _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(111); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } + + + + + + + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_1__["default"].getLogger("Attributions"); + +/** + * @classdesc + * Control to manage layers attributions + * + * @constructor + * @alias itowns.control.Attributions + * @extends {itowns.control.Widget} + * @param {Object} aOptions - control options + * @param {Object} [aOptions.options] - Itowns.control.Control options + * @param {Boolean} [aOptions.options.collapsed = false] - Specify if the control has to be opened or not. + * @fires attributions:update + * @example + * var attribution = new itowns.control.Attritbution({ + * options : { + * collapsed: true + * } + * }); + * // listeners for attributions update : + * attribution.addEventListener("attributions:update", function (e) {...}); + */ +function Attributions(aOptions) { + aOptions = aOptions || {}; + var options = aOptions.options || {}; + if (!(this instanceof Attributions)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + if (_typeof(options) !== "object") { + throw new Error("ERROR WRONG_TYPE : options should be an object"); + } + this._initialize(options); + var container = this._initContainer(options); + _Widget__WEBPACK_IMPORTED_MODULE_6__["default"].call(this, { + name: "Attributions", + element: container, + target: options.target, + position: options.position + }); +} + +/* + * @lends module:Attributions + */ +Attributions.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_6__["default"].prototype, {}); + +// retrieves methods of the common class AttributionDOM +_Common_Utils__WEBPACK_IMPORTED_MODULE_2__["default"].assign(Attributions.prototype, _Common_Controls_AttributionDOM__WEBPACK_IMPORTED_MODULE_5__["default"]); + +/** + * Constructor (alias) + * + * @private + */ +Attributions.prototype.constructor = Attributions; + +// ################################################################### // +// ############## public methods (getters, setters) ################## // +// ################################################################### // + +/** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ +Attributions.prototype.setGlobe = function (globe) { + // info : this function is called after a globe.addWidget() or a globe.removeWidget() + + if (globe) { + // In the case of the adding of a control to the globe + var self = this; + + // Adding of the listeners + + // At every globe movement, attributions may be updated, + // according to layers on globe, and their visibility. + this._callbacks.onPreRenderCallBack = function (e) { + var allLayers = e.colorLayersId.concat(e.elevationLayersId); + self._inRangeUpdate(allLayers, e.extent); + }; + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack); + globe.preRenderEventFetchViewExtent(); + globe.preRenderEventFetchLayersDisplayed(); + } else { + // delete listener + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.PRE_RENDER, this._callbacks.onPreRenderCallBack); + + // delete DOM + while (this._element.hasChildNodes()) { + this._element.removeChild(this._element.lastChild); + } + this._element.parentNode.removeChild(this._element); + } + + // call original setGlobe method + _Widget__WEBPACK_IMPORTED_MODULE_6__["default"].prototype.setGlobe.call(this, globe); +}; + +/** + * Collapse or display control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ +Attributions.prototype.setCollapsed = function (collapsed) { + if (collapsed === undefined) { + logger.error("Attributions:setCollapsed - missing collapsed parameter"); + return; + } + var isCollapsed = this.getCollapsed(); + if (collapsed && isCollapsed || !collapsed && !isCollapsed) { + return; + } + document.getElementById(this._addUID("GPshowAttributionsList")).checked = !collapsed; +}; + +/** + * Returns true if widget is collapsed (minimize), false otherwise + * + * @return {Boolean} collapsed + */ +Attributions.prototype.getCollapsed = function () { + return !document.getElementById(this._addUID("GPshowAttributionsList")).checked; +}; + +// ################################################################### // +// ##################### init component ############################## // +// ################################################################### // + +/** + * Initialize Attributions control (called by constructor) + * + * @param {Object} options - Itowns.control.Control options + * @private + */ +Attributions.prototype._initialize = function (options) { + // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page) + this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_3__["default"].generate(); + + // div which will contain the list divs. + this._AttributionContainer = null; + + // callbacks + this._callbacks = {}; + + // options + this._options = options; +}; + +/** + * Creates control main container + * + * @method _initContainer + * @param {Object} options - control options + * @returns {DOMElement} container - widget container + * @private + */ +Attributions.prototype._initContainer = function (options) { + var container = this._createMainContainerElement(); + + // adds in the main container the layer display selector + var inputShow = this._createMainAttributionsShowElement(); + container.appendChild(inputShow); + + // handles the "collapsed" mode + if (!options.collapsed) { + inputShow.checked = "checked"; + } + // adds the layer list in the main container + var divA = this._attributionListContainer = this._createMainAttributionsListContainer(); + var ulA = this._createAttributionsList(); + divA.appendChild(ulA); + container.appendChild(divA); + + // adds the widget picto in the main container + var picto = this._createMainPictoElement(options.collapsed); + container.appendChild(picto); + return container; +}; + +/** + * Checks layers range + * + * @method _inRangeUpdate + * @param {Array} layersDisplayed - Id of the layers diplayed on screen + * @param {Object} extent - The globe view extent + * @private + */ + +Attributions.prototype._inRangeUpdate = function (layersDisplayed, extent) { + var globe = this.getGlobe(); + var scaleDenominator = 1 / globe.getScale(); + var attributions = new Map(); + for (var h = 0; h < layersDisplayed.length; h++) { + var layer = globe.getLayerById(layersDisplayed[h]); + var ori = layer.source.attribution; + if (ori) { + for (var j = 0; j < ori.length; j++) { + // if the attribution is already added, we skip to not add it several times + if (attributions.has(ori[j].name)) { + continue; + } + ; + // if no constraints are associated to the originator, we just add the attribution + if (!ori[j].constraints || !ori[j].constraints[0]) { + // adds the attribution in the Map() called 'attributions' + attributions.set(ori[j].name, ori[j]); + continue; + } + // if the minScaleDenominator exists + if (ori[j].constraints[0].minScaleDenominator) { + // if min/maxScaleDenominator are equals, we display the attribution corresponding to the zoom level associated to the scale denominator + if (ori[j].constraints[0].minScaleDenominator === ori[j].constraints[0].maxScaleDenominator) { + // retrieves the zoom level + var attributionZoomLevel = _Common_Utils_LayerUtils__WEBPACK_IMPORTED_MODULE_4__["default"].getZoomLevelFromScaleDenominator(ori[j].constraints[0].minScaleDenominator); + // selects the scaledenominators around the corresponding zoom level + var maxAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel - 1]) / (0.00028 * 2); + var minAttributionScaleDenominator = (this._resolutionsWGS84[attributionZoomLevel] + this._resolutionsWGS84[attributionZoomLevel + 1]) / (0.00028 * 2); + if (!(maxAttributionScaleDenominator > scaleDenominator && scaleDenominator > minAttributionScaleDenominator)) { + continue; + } + // either, we check we are located between the minScaleDenominator and the maxScaleDenominator + } else if (!(ori[j].constraints[0].minScaleDenominator < scaleDenominator && scaleDenominator < ori[j].constraints[0].maxScaleDenominator)) { + continue; + } + } + // checks if 'bbox" exists + if (ori[j].constraints[0].bbox) { + // checks if we are into the bbox limits + var intersectsX = ori[j].constraints[0].bbox.left <= extent.east && extent.west <= ori[j].constraints[0].bbox.right; + var intersectsY = ori[j].constraints[0].bbox.bottom <= extent.north && extent.south <= ori[j].constraints[0].bbox.top; + if (intersectsX && intersectsY) { + // adds the attribution in the Map() called 'attributions' + attributions.set(ori[j].name, ori[j]); + } + // if 'bbox' attribute doesn't exist + } else if (!ori[j].constraints[0].bbox) { + attributions.set(ori[j].name, ori[j]); + } + } + } + } + if (attributions.size) { + this._updateAttributionListContainer(attributions); + /** + * event triggered when the attributions are updated + * + * @event attributions:update + * @type Object + * @property {Map} attributions - list of attributions + */ + this.dispatchEvent({ + type: "attributions:update", + attributions: attributions + }); + } +}; + +// ################################################################### // +// ######################### DOM events ############################## // +// ################################################################### // + +/** + * Updates the layer list container + * + * @method _updateAttributionListContainer + * @param {Map} attributions - map of attributions + * @private + */ +Attributions.prototype._updateAttributionListContainer = function (attributions) { + var element = document.getElementById(this._addUID("GPAttributionsList")); + if (document.getElementById(this._addUID("GPAttributionsList"))) { + document.getElementById(this._addUID("GPAttributionsList")).parentNode.removeChild(element); + } + var ul = this._createAttributionsList(); + attributions.forEach(function (a) { + if (a.name) { + var li = document.createElement("li"); + var link = document.createElement("a"); + link.href = a.url; + link.innerHTML = a.name + " "; + link.target = "_blank"; + li.id = a.name.replace(/\s/g, ""); + li.appendChild(link); + ul.appendChild(li); + } + }); + this._attributionListContainer.appendChild(ul); +}; +Attributions.prototype._resolutionsWGS84 = { + 0: 156543.033928041, + 1: 78271.51696402048, + 2: 39135.758482010235, + 3: 19567.87924100512, + 4: 9783.93962050256, + 5: 4891.96981025128, + 6: 2445.98490512564, + 7: 1222.99245256282, + 8: 611.49622628141, + 9: 305.7481131407048, + 10: 152.8740565703525, + 11: 76.43702828517624, + 12: 38.21851414258813, + 13: 19.10925707129406, + 14: 9.554628535647032, + 15: 4.777314267823516, + 16: 2.388657133911758, + 17: 1.194328566955879, + 18: 0.5971642834779395, + 19: 0.2985821417389697, + 20: 0.1492910708694849, + 21: 0.0746455354347424 +}; +/* harmony default export */ __webpack_exports__["default"] = (Attributions); + +/***/ }), +/* 110 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** +* @module LayerUtils +* @alias Gp.LayerUtils +* @description +* ... +* +* @example +* getZoomLevelFromScaleDenominator(); +* getAttributions(); +* intersects(); +*/ +var LayerUtils = { + /** + * Obtenir le ZoomLevel à partir du ScaleDenominator + * @function getZoomLevelFromScaleDenominator + * @param {Number} scaleDenominator - the scale denominator + * @param {String} crs - the crs + * + * @returns {Integer} zoom level + */ + getZoomLevelFromScaleDenominator: function getZoomLevelFromScaleDenominator(scaleDenominator, crs) { + // ------------------------------------------------- // + // Code issu de l'API Geoportal/Catalogue/Config.js // + // ------------------------------------------------- // + // var configuration = Gp.Config; + // var general = configuration.generalOptions; + // var layers = configuration.layersContext; + // + // for (var tms in general.tileMatrixSets) { + // var tileMatrixSet = general.tileMatrixSets[tms]; + // // IGN's WMTS bug : epsg:nnnn instead of EPSG:nnnn + // var crs = tileMatrixSet.supportedCRS = tileMatrixSet.supportedCRS.replace(/epsg/,"EPSG"); + // + // if (!Geoportal.Catalogue.CRSRESOLUTIONS.hasOwnProperty(crs)) { + // var p= new OpenLayers.Projection(crs); + // Geoportal.Catalogue.CRSRESOLUTIONS[crs]= []; + // var matrixIds= tileMatrixSet.matrixIds; + // for (var i= 0, li= matrixIds.length; i} params.extent - map current geographical extent (EPSG:4326) : [top, left, bottom, right] = [maxy, minx, miny, maxx] + * @param {Number} params.zoom - map current zoom + * @param {String} params.crs - map current projection code (ex "EPSG:2154") + * @param {Boolean} params.visibility - layer visibility + * @param {Gp.Services.Config.Originator} params.originators - resource originators (from Gp.Config.layers[].originators) + * @returns {Object} attributions - associative array, mapping originators url (keys) with their properties : html attributions elements + */ + getAttributions: function getAttributions(params) { + var zoom = params.zoom; + var attributions = []; + if (params.originators != null && params.visibility) { + // drawLogo = boolean, true if attribution should be displayed (zoom, extent), false otherwise + var drawLogo; + for (var j = 0, jl = params.originators.length; j < jl; j++) { + drawLogo = true; + var originator = params.originators[j]; + var constraints = params.originators[j].constraints || []; + for (var k = 0, kl = constraints.length; k < kl; k++) { + var constraint = constraints[k]; + drawLogo = true; + var minZoomLevel = this.getZoomLevelFromScaleDenominator(constraint.maxScaleDenominator, params.crs); + var maxZoomLevel = this.getZoomLevelFromScaleDenominator(constraint.minScaleDenominator, params.crs) || 21; + + // min zoom constraints + if (minZoomLevel && minZoomLevel > zoom) { + drawLogo = false; + } + + // max zoom constraints + if (drawLogo && maxZoomLevel && maxZoomLevel < zoom) { + drawLogo = false; + } + + // bbox constraints + var bbox = constraint.bbox; + if (drawLogo && bbox) { + drawLogo = false; + var viewExtent = params.extent; + if (viewExtent) { + var bounds = [bbox.top, bbox.left, bbox.bottom, bbox.right]; + if (this.intersects(viewExtent, bounds)) { + // at least one constraint matches the map ones + drawLogo = true; + break; + } + } + } + } + if (drawLogo) { + // on a un originator qui correspond au zoom et à l'étendue. + + var logo = originator.logo; + var url = originator.url; + var name = originator.name ? originator.name : ""; + var text = originator.attribution; + var container = document.createElement("div"); + container.className = "gp-control-attribution"; + + // on crée un lien dans tous les cas (même s'il ne pointe pas vers une référence), pour avoir accès à la class CSS (pour surcharge) + var link = null; + link = document.createElement("a"); + link.className = "gp-control-attribution-link"; + link.target = "_blank"; + container.appendChild(link); + if (url) { + link.href = url; + } + var bImage = !!logo; + var image = null; + // si on a un logo, on l'affiche à l'interieur du lien + if (bImage) { + image = document.createElement("img"); + if (link) { + image.className = "gp-control-attribution-image"; + link.appendChild(image); + } else { + image.className = ""; + container.appendChild(image); + } + image.src = logo; + image.title = text || name; + image.style.height = "30px"; + image.style.width = "30px"; + } else { + // sinon, on affiche le nom de l'originator, ou sa description ou l'url. + if (name) { + link.textContent = name; + } else if (text) { + link.textContent = text; + } else if (url) { + link.textContent = url; + } else { + link.textContent = ""; + } + } + attributions.push(container.innerHTML + " "); + } + } + } + return attributions; + }, + /** + * Determines if one extent (extent1) intersects another (extent2) + * + * @function intersects + * @param {Array.} extent1 - First extent : [top, left, bottom, right] = [maxy, minx, miny, maxx] + * @param {Array.} extent2 - Second extent : [top, left, bottom, right] = [maxy, minx, miny, maxx] + * @return {Boolean} intersects - True if the two extents intersect, false otherwise. + */ + intersects: function intersects(extent1, extent2) { + var intersectsX = extent1[1] <= extent2[3] && extent2[1] <= extent1[3]; + var intersectsY = extent1[2] <= extent2[0] && extent2[2] <= extent1[0]; + return intersectsX && intersectsY; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (LayerUtils); + +/***/ }), +/* 111 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// FIXME not use !? +var AttributionDOM = { + // ################################################################### // + // ######################### Main container ########################## // + // ################################################################### // + + /** + * Add uuid to the tag ID + * @param {String} id - id selector + * @returns {String} uid - id selector with an unique id + */ + _addUID: function _addUID(id) { + var uid = this._uid ? id + "-" + this._uid : id; + return uid; + }, + /** + * Creation du container principal (DOM) + * + * @returns {DOMElement} div DOM + */ + _createMainContainerElement: function _createMainContainerElement() { + var container = document.createElement("div"); + container.id = this._addUID("GPAttribution"); + container.className = "GPwidget"; + return container; + }, + /** + * Creation du selecteur (caché) pour l'affichage/masquage des attributions (DOM) + * + * @returns {DOMElement} checkbox DOM + */ + _createMainAttributionsShowElement: function _createMainAttributionsShowElement() { + var input = document.createElement("input"); + input.id = this._addUID("GPshowAttributionsList"); + input.type = "checkbox"; + return input; + }, + /** + * Création de l'élément liste des attributions (DOM) + * + * @returns {DOMElement} liste DOM + */ + _createAttributionsList: function _createAttributionsList() { + var ul = document.createElement("ul"); + ul.id = this._addUID("GPAttributionsList"); + return ul; + }, + /** + * Création du conteneur principal des attributions (DOM) + * + * @returns {DOMElement} div DOM + */ + _createMainAttributionsListContainer: function _createMainAttributionsListContainer() { + var div = document.createElement("div"); + div.id = this._addUID("GPAttributionsListContainer"); + return div; + }, + /** + * Création du container du picto du controle (DOM) + * @param {Boolean} collapsed - collapsed + * @returns {DOMElement} label DOM + */ + _createMainPictoElement: function _createMainPictoElement(collapsed) { + var self = this; + var label = document.createElement("label"); + label.id = this._addUID("GPshowAttributionsListPicto"); + label.className = "GPshowAdvancedToolPicto"; + label.htmlFor = this._addUID("GPshowAttributionsList"); + label.title = "Afficher/masquer les attributions"; + var spanOpen = document.createElement("span"); + spanOpen.id = this._addUID("GPshowAttributionsListOpenClose"); + spanOpen.className = "GPshowAdvancedToolOpen"; + spanOpen.innerHTML = collapsed ? "i" : "»"; + /** Evenement de type 'click' sur le picto du controle */ + spanOpen.addEventListener("click", function () { + spanOpen.innerHTML = document.getElementById(self._addUID("GPshowAttributionsList")).checked ? "i" : "»"; + }); + label.appendChild(spanOpen); + return label; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (AttributionDOM); + +/***/ }), +/* 112 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(113); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } + + + + + + +/** + * @classdesc + * Control to display the scalebar with itowns + * + * @constructor + * @alias itowns.control.Scale + * @extends {itowns.control.Widget} + * @alias itowns.control.Scale + * @param {Object} options - widget options + * @param {String} options.target - HTML target element or HTML target element id + * @param {String} options.position - "absolute" or "relative" + * @example + * var scale = new itowns.control.Scale(); + * + */ +function Scale(options) { + if (!(this instanceof Scale)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + if (_typeof(options) !== "object") { + throw new Error("ERROR WRONG_TYPE : options should be an object"); + } + this._initialize(); + var container = this._initContainer(); + _Widget__WEBPACK_IMPORTED_MODULE_4__["default"].call(this, { + name: "GraphicScale", + element: container, + target: options.target, + position: options.position + }); +} + +/* + * @lends module:Scale + */ +Scale.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__["default"].prototype, {}); + +// retrieves methods of the common class ScaleDOM +_Common_Utils__WEBPACK_IMPORTED_MODULE_1__["default"].assign(Scale.prototype, _Common_Controls_ScaleDOM__WEBPACK_IMPORTED_MODULE_3__["default"]); + +/** + * Constructor (alias) + * + * @private + */ +Scale.prototype.constructor = Scale; + +// ################################################################### // +// ############## public methods (getters, setters) ################## // +// ################################################################### // + +/** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ +Scale.prototype.setGlobe = function (globe) { + // info : this function is called after a globe.addWidget() or a globe.removeWidget() + + if (globe) { + // In the case of the adding of a control to the globe + var self = this; + /** + * Definition of the scaleControl callback : + * when the view is changing, we recalculate the graphic scale + */ + this._callbacks.onChangedViewCallback = function () { + var value = globe.pixelsToMeters(200); + value = Math.floor(value); + var digit = Math.pow(10, value.toString().length - 1); + value = Math.round(value / digit) * digit; + var pix = globe.metersToPixels(value); + var unit = "m"; + if (value >= 1000) { + value /= 1000; + unit = "km"; + } + self.getElement().innerHTML = value + " " + unit; + self.getElement().style.width = pix + "px"; + }; + // Ajout des listeners + // initialization + if (globe.isInitialized()) { + this._callbacks.onChangedViewCallback(); + } else { + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback); + } + + // At every globe range movement, scale bar may be updated, + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback); + } else if (globe == null) { + // we remove the listeners linked to the scalecontrol which has been deleted + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.GLOBE_INITIALIZED, this._callbacks.onChangedViewCallback); + this._globe.forget(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.RANGE_CHANGED, this._callbacks.onChangedViewCallback); + + // if globe == null we remove the scale control + // delete the scaleControl DOM + while (this.getElement().hasChildNodes()) { + this.getElement().removeChild(this.getElement().lastChild); + } + this.getElement().parentNode.removeChild(this.getElement()); + } + + // call original setGlobe method + _Widget__WEBPACK_IMPORTED_MODULE_4__["default"].prototype.setGlobe.call(this, globe); +}; + +// ################################################################### // +// ##################### init component ############################## // +// ################################################################### // + +/** + * Initialize Scale control (called by constructor) + * + * @private + */ +Scale.prototype._initialize = function () { + // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page) + this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__["default"].generate(); + + // div which will contain the list divs. + this._ScaleContainer = null; + + // callbacks + this._callbacks = {}; +}; + +/** + * Create control main container + * + * @method _initContainer + * @returns {DOMElement} container - widget container + * @private + */ +Scale.prototype._initContainer = function () { + var container = this._createMainContainerElement(); + return container; +}; +/* harmony default export */ __webpack_exports__["default"] = (Scale); + +/***/ }), +/* 113 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +var ScaleDOM = { + /** + * Add uuid to the tag ID + * @param {String} id - id selector + * @returns {String} uid - id selector with an unique id + */ + _addUID: function _addUID(id) { + var uid = this._uid ? id + "-" + this._uid : id; + return uid; + }, + /** + * Main container (DOM) + * + * @returns {DOMElement} DOM element + */ + _createMainContainerElement: function _createMainContainerElement() { + var container = document.createElement("div"); + container.id = this._addUID("GPscaleContainer"); + container.className = "GPwidget"; + return container; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (ScaleDOM); + +/***/ }), +/* 114 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96); +/* harmony import */ var _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(115); +/* harmony import */ var _Widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } + + + + + + +/** + * @classdesc + * Control to display the MiniGlobe with itowns + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.MiniGlobe + * @param {Object} [options] - control options + * @param {Object} [options.layer] - custom itowns layer to display on the mini globe + * @example + * var miniglobe = new itowns.control.MiniGlobe(); + * + */ +function MiniGlobe(options) { + options = options || {}; + if (!(this instanceof MiniGlobe)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + if (_typeof(options) !== "object") { + throw new Error("ERROR WRONG_TYPE : options should be an object"); + } + this._initialize(); + var container = this._initContainer(); + this._options = options; + _Widget__WEBPACK_IMPORTED_MODULE_4__["default"].call(this, { + name: "Overview", + element: container, + target: options.target, + position: options.position + }); +} + +/* + * @lends module:MiniGlobe + */ +MiniGlobe.prototype = Object.create(_Widget__WEBPACK_IMPORTED_MODULE_4__["default"].prototype, {}); + +// retrieves methods of the common class MiniGlobeDOM +_Common_Utils__WEBPACK_IMPORTED_MODULE_1__["default"].assign(MiniGlobe.prototype, _Common_Controls_MiniGlobeDOM__WEBPACK_IMPORTED_MODULE_3__["default"]); + +/** + * Constructor (alias) + * + * @private + */ +MiniGlobe.prototype.constructor = MiniGlobe; + +// ################################################################### // +// ############## public methods (getters, setters) ################## // +// ################################################################### // + +/** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ +MiniGlobe.prototype.setGlobe = function (globe) { + // info : this function is called after a globe.addWidget() or a globe.removeWidget() + + if (globe) { + // In the case of the adding of a control to the globe + var minDistance = 6650000; + var maxDistance = 30000000; + var positionOnGlobe = globe.getCenter(); + var miniView = new _GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"](this._element, positionOnGlobe, { + // `limit globe' subdivision level: + // we're don't need a precise globe model + // since the mini globe will always be seen from a far point of view (see minDistance above) + maxSubdivisionLevel: 6, + sseSubdivisionThreshold: 3, + // Don't instance default controls since miniview's camera will be synced + // on the main view's one (see globeView.onAfterRender) + noControls: true + }); + miniView.setBackground(); + var updateMiniGlobeHandler = function updateMiniGlobeHandler() { + // clamp distance camera from globe + var distanceCamera = globe.getGlobeView().camera.camera3D.position.length(); + var distance = Math.min(Math.max(distanceCamera, minDistance), maxDistance); + var camera = miniView.getGlobeView().camera.camera3D; + var cameraTargetPosition = globe.getGlobeView().controls.getCameraTargetPosition(); + // Update target miniview's camera + camera.position.copy(cameraTargetPosition).setLength(distance); + camera.lookAt(cameraTargetPosition); + miniView.notifyChange(camera); + }; + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.AFTER_RENDER, updateMiniGlobeHandler); + if (globe.isInitialized()) { + updateMiniGlobeHandler(); + } else { + globe.listen(_GlobeViewExtended__WEBPACK_IMPORTED_MODULE_0__["default"].EVENTS.GLOBE_INITIALIZED, updateMiniGlobeHandler); + } + + /** + * Add one imagery layer to the miniview (by default, the ortho) + */ + var miniGlobeLayer = this._options.layer; + miniView.addLayer(miniGlobeLayer); + // save as property of the control the globe created for the overview + this._globeObj = miniView; + } else if (globe == null) { + // if globe == null we remove the overview control + // we delete the overview control DOM + while (this.getElement().hasChildNodes()) { + this.getElement().removeChild(this.getElement().lastChild); + } + this.getElement().parentNode.removeChild(this.getElement()); + } + + // call original setGlobe method + _Widget__WEBPACK_IMPORTED_MODULE_4__["default"].prototype.setGlobe.call(this, globe); +}; + +// ################################################################### // +// ##################### init component ############################## // +// ################################################################### // + +/** + * Initialize MiniGlobe control (called by constructor) + * + * @private + */ +MiniGlobe.prototype._initialize = function () { + // id of the widget : usefull to suffix the CSS ids (to handle cases with several widgets on the same page) + this._uid = _Common_Utils_SelectorID__WEBPACK_IMPORTED_MODULE_2__["default"].generate(); + + // div which will contain the list divs. + this._MiniGlobeContainer = null; + + // callbacks + this._callbacks = {}; +}; + +/** + * Creates control main container + * + * @method _initContainer + * @returns {DOMElement} container - widget container + * @private + */ +MiniGlobe.prototype._initContainer = function () { + var container = this._createMainContainerElement(); + return container; +}; +/* harmony default export */ __webpack_exports__["default"] = (MiniGlobe); + +/***/ }), +/* 115 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +var MiniGlobeDOM = { + /** + * Add uuid to the tag ID + * @param {String} id - id selector + * @returns {String} uid - id selector with an unique id + */ + _addUID: function _addUID(id) { + var uid = this._uid ? id + "-" + this._uid : id; + return uid; + }, + /** + * Main container (DOM) + * + * @returns {DOMElement} DOM element + */ + _createMainContainerElement: function _createMainContainerElement() { + var container = document.createElement("div"); + container.id = this._addUID("GPminiglobeContainer"); + container.className = "GPwidget"; + container.style.width = "100px"; + container.style.height = "100px"; + return container; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (MiniGlobeDOM); + +/***/ }), +/* 116 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(117); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); +var _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(1, 1); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__); + + + + + + +/* import Extent from "itowns/Core/Geographic/Extent"; +import WMTSSource from "itowns/Source/WMTSSource"; +import ColorLayer from "itowns/Layer/ColorLayer"; */ + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__["default"].getLogger("wmtsLayer"); + +/** + * @classdesc + * Geoportal WMTS source creation + * + * @constructor + * @alias itowns.layer.GeoportalWMTS + * @param {Object} options - options for function call. + * @param {String} options.layer - Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalWMTS = new itowns.layer.GeoportalWMTS({ + * layer : "ORTHOIMAGERY.ORTHOPHOTOS" + * }); + */ +function LayerWMTS(options) { + if (!(this instanceof LayerWMTS)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + + // check layer params + if (!options.layer) { + throw new Error("ERROR PARAM_MISSING : layer"); + } + if (typeof options.layer !== "string") { + throw new Error("ERROR WRONG TYPE : layer"); + } + + // par defaut + if (typeof options.ssl === "undefined") { + options.ssl = true; + } + + // Check if configuration is loaded + if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].isConfigLoaded()) { + throw new Error("ERROR : Configuration has to be loaded"); + } + var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerId(options.layer, "WMTS"); + if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerParams(options.layer, "WMTS")) { + var config = {}; + var wmtsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerParams(options.layer, "WMTS"); + if (wmtsParams.projection === "EPSG:3857") { + wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__["Extent"]("EPSG:4326", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top).as("EPSG:3857"); + } else { + wmtsParams.projection = "EPSG:4326"; + wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__["Extent"]("EPSG:4326", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top); + } + if (Object.entries(wmtsParams.tileMatrixSetLimits).length === 0 && wmtsParams.tileMatrixSetLimits.constructor === Object) { + wmtsParams.tileMatrixSetLimits = undefined; + } + + // les originators ne sont pas renvoyés dans la configuration, on prend donc ceux donnés par l'utilisateur + if (options.itownsParams && options.itownsParams.source && options.itownsParams.source.attribution) { + wmtsParams.originators = options.itownsParams.source.attribution; + } + + // si ssl = false on fait du http + // par défaut, ssl = true, on fait du https + var protocol = options.ssl === false ? "http://" : "https://"; + config.id = layerId; + config.source = new itowns__WEBPACK_IMPORTED_MODULE_5__["WMTSSource"]({ + protocol: "wmts", + url: wmtsParams.url.replace(/(http|https):\/\//, protocol), + networkOptions: { + crossOrigin: "omit" + }, + updateStrategy: { + type: 0, + options: {} + }, + projection: wmtsParams.projection, + attribution: wmtsParams.originators, + name: options.layer, + format: wmtsParams.format, + tileMatrixSet: wmtsParams.TMSLink, + tileMatrixSetLimits: wmtsParams.tileMatrixSetLimits, + extent: { + west: wmtsParams.extent.west, + east: wmtsParams.extent.east, + south: wmtsParams.extent.south, + north: wmtsParams.extent.north + } + }); + + // ajout du tag gp-itowns-ext dans les requêtes WMTS + config.source.url = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__["default"].Helper.normalyzeUrl(config.source.url, { + "gp-itowns-ext": _package_json__WEBPACK_IMPORTED_MODULE_4__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_4__.version + }, false); + + // récupération des autres paramètres passés par l'utilisateur + _Common_Utils__WEBPACK_IMPORTED_MODULE_1__["default"].mergeParams(config, options.itownsParams); + + // add legends and metadata (to be added to LayerSwitcher control) + // we take in priority the explicit options given by the user + config.legends = options.legends || wmtsParams.legends; + config.metadata = options.metadata || wmtsParams.metadata; + config.description = options.description || wmtsParams.description; + config.title = options.title || wmtsParams.title; + config.quicklookUrl = options.quicklookUrl || wmtsParams.quicklookUrl; + return new itowns__WEBPACK_IMPORTED_MODULE_5__["ColorLayer"](config.id, config); + } else { + // If layer is not in Gp.Config + logger.error("ERROR layer id (layer name: " + options.layer + " / service: WMTS ) was not found !?"); + } +} + +/* + * Constructor (alias) + */ +LayerWMTS.prototype.constructor = LayerWMTS; +/* harmony default export */ __webpack_exports__["default"] = (LayerWMTS); + +/***/ }), +/* 117 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/** + * @module Config + * @alias [private] Config + * @description + * ... + * + * @example + * isConfigLoaded(); + */ +var Config = { + /** + * Config + * + * @public + * @type {Object} + */ + configuration: {}, + /** + * Check if the configuration is loaded + * + * @returns {Boolean} True if Config is loaded, false otherwise + */ + isConfigLoaded: function isConfigLoaded() { + // config already loaded ! + if (this.configuration && Object.keys(this.configuration).length !== 0) { + return true; + } + var scope = typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : {}; + if (scope.Gp && scope.Gp.Config && scope.Gp.Config.layers && Object.keys(scope.Gp.Config.layers).length !== 0) { + /** ts-syntax */this.configuration = scope.Gp.Config; + return true; + } + return false; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (Config); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32))) + +/***/ }), +/* 118 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(117); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); +var _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(1, 1); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__); + + + + + + +/* import Extent from "itowns/Core/Geographic/Extent"; +import WMSSource from "itowns/Source/WMSSource"; +import ColorLayer from "itowns/Layer/ColorLayer"; */ + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__["default"].getLogger("wmsLayer"); + +/** + * @classdesc + * Geoportal WMTS source creation + * + * @constructor + * @alias itowns.layer.GeoportalWMS + * @param {Object} options - options for function call. + * @param {String} options.layer - Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalWMS = new itowns.layer.GeoportalWMS({ + * layer : "ORTHOIMAGERY.ORTHOPHOTOS" + * }); + */ +function LayerWMS(options) { + if (!(this instanceof LayerWMS)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + + // check layer params + if (!options.layer) { + throw new Error("ERROR PARAM_MISSING : layer"); + } + if (typeof options.layer !== "string") { + throw new Error("ERROR WRONG TYPE : layer"); + } + + // par defaut + if (typeof options.ssl === "undefined") { + options.ssl = true; + } + + // Check if configuration is loaded + if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].isConfigLoaded()) { + throw new Error("ERROR : Configuration has to be loaded"); + } + var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerId(options.layer, "WMS"); + if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerParams(options.layer, "WMS")) { + var config = {}; + var wmsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerParams(options.layer, "WMS"); + if (wmsParams.projection === "EPSG:3857") { + wmsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__["Extent"]("EPSG:4326", wmsParams.extent.left, wmsParams.extent.right, wmsParams.extent.bottom, wmsParams.extent.top).as("EPSG:3857"); + } else { + wmsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__["Extent"]("EPSG:4326", wmsParams.extent.left, wmsParams.extent.right, wmsParams.extent.bottom, wmsParams.extent.top); + } + + // les originators ne sont pas renvoyés dans la configuration, on prend donc ceux donnés par l'utilisateur + if (options.itownsParams && options.itownsParams.source && options.itownsParams.source.attribution) { + wmsParams.originators = options.itownsParams.source.attribution; + } + + // si ssl = false on fait du http + // par défaut, ssl = true, on fait du https + var protocol = options.ssl === false ? "http://" : "https://"; + config.id = layerId; + config.source = new itowns__WEBPACK_IMPORTED_MODULE_5__["WMSSource"]({ + protocol: "wms", + version: wmsParams.version, + attribution: wmsParams.originators, + url: wmsParams.url.replace(/(http|https):\/\//, protocol), + name: options.layer, + projection: wmsParams.projection, + style: "", + heightMapWidth: 256, + waterMask: false, + networkOptions: { + crossOrigin: "omit" + }, + updateStrategy: { + type: 0, + options: {} + }, + format: wmsParams.format, + extent: { + west: wmsParams.extent.west, + east: wmsParams.extent.east, + south: wmsParams.extent.south, + north: wmsParams.extent.north + } + }); + + // ajout du tag gp-itowns-ext dans les requêtes WMS + config.source.url = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__["default"].Helper.normalyzeUrl(config.source.url, { + "gp-itowns-ext": _package_json__WEBPACK_IMPORTED_MODULE_4__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_4__.version + }, false); + + // récupération des autres paramètres passés par l'utilisateur + _Common_Utils__WEBPACK_IMPORTED_MODULE_1__["default"].mergeParams(config, options.itownsParams); + + // add legends and metadata (to be added to LayerSwitcher control) + // we take in priority the explicit options given by the user + config.legends = options.legends || wmsParams.legends; + config.metadata = options.metadata || wmsParams.metadata; + config.description = options.description || wmsParams.description; + config.title = options.title || wmsParams.title; + config.quicklookUrl = options.quicklookUrl || wmsParams.quicklookUrl; + return new itowns__WEBPACK_IMPORTED_MODULE_5__["ColorLayer"](config.id, config); + } else { + // If layer is not in Gp.Config + logger.error("ERROR layer id (layer name: " + options.layer + " / service: WMS ) was not found !?"); + } +} + +/* + * Constructor (alias) + */ +LayerWMS.prototype.constructor = LayerWMS; +/* harmony default export */ __webpack_exports__["default"] = (LayerWMS); + +/***/ }), +/* 119 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); +/* harmony import */ var _Common_Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(117); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); +var _package_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(1, 1); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_5__); +/* globals self */ + + + + + + +/* import Extent from "itowns/Core/Geographic/Extent"; +import WMTSSource from "itowns/Source/WMTSSource"; +import ElevationLayer from "itowns/Layer/ElevationLayer"; */ + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_3__["default"].getLogger("elevationLayer"); + +/** + * @classdesc + * Geoportal elevation source creation + * + * @constructor + * @alias itowns.layer.GeoportalElevation + * @param {Object} options - options for function call. + * @param {String} options.layer - Elevation layer name (e.g. "ELEVATION.ELEVATIONGRIDCOVERAGE") + * @param {Boolean} [options.ssl] - if set true, enforce protocol https (only for nodejs) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - options to overload default geoportal layer options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalElevation = new itowns.layer.GeoportalElevation({ + * layer : "ELEVATION.ELEVATIONGRIDCOVERAGE" + * }); + */ +function LayerElevation(options) { + if (!(this instanceof LayerElevation)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + + // check layer params + if (!options.layer) { + throw new Error("ERROR PARAM_MISSING : layer"); + } + if (typeof options.layer !== "string") { + throw new Error("ERROR WRONG TYPE : layer"); + } + + // par defaut + if (typeof options.ssl === "undefined") { + options.ssl = false; + } + + // Check if configuration is loaded + if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].isConfigLoaded()) { + throw new Error("ERROR : Configuration has to be loaded"); + } + var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerId(options.layer, "WMTS"); + if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerParams(options.layer, "WMTS")) { + var config = {}; + var wmtsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_2__["default"].configuration.getLayerParams(options.layer, "WMTS"); + if (wmtsParams.projection === "EPSG:3857") { + wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__["Extent"]("EPSG:4326", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top).as("EPSG:3857"); + } else { + wmtsParams.projection = "EPSG:4326"; + wmtsParams.extent = new itowns__WEBPACK_IMPORTED_MODULE_5__["Extent"]("EPSG:4326", wmtsParams.extent.left, wmtsParams.extent.right, wmtsParams.extent.bottom, wmtsParams.extent.top); + } + // les originators ne sont pas renvoyés dans la configuration, on prend donc ceux donnés par l'utilisateur + if (options.itownsParams && options.itownsParams.source && options.itownsParams.source.attribution) { + wmtsParams.originators = options.itownsParams.source.attribution; + } + // gestion de mixContent dans l'url du service... + var ctx = typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : null; + var protocol = ctx ? ctx.location && ctx.location.protocol && ctx.location.protocol.indexOf("https:") === 0 ? "https://" : "http://" : options.ssl ? "https://" : "http://"; + config.id = layerId; + config.noDataValue = -99999; + config.updateStrategy = { + type: 0, + options: { + groups: [11, 14] + } + }; + config.source = new itowns__WEBPACK_IMPORTED_MODULE_5__["WMTSSource"]({ + protocol: "wmts", + url: wmtsParams.url.replace(/(http|https):\/\//, protocol), + networkOptions: { + crossOrigin: "omit" + }, + attribution: wmtsParams.originators, + projection: wmtsParams.projection, + name: options.layer, + format: "image/x-bil;bits=32", + tileMatrixSet: wmtsParams.TMSLink, + tileMatrixSetLimits: wmtsParams.tileMatrixSetLimits, + extent: { + west: wmtsParams.extent.west, + east: wmtsParams.extent.east, + south: wmtsParams.extent.south, + north: wmtsParams.extent.north + } + }); + + // ajout du tag gp-itowns-ext dans les requêtes WMTS elevation + config.source.url = geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__["default"].Helper.normalyzeUrl(config.source.url, { + "gp-itowns-ext": _package_json__WEBPACK_IMPORTED_MODULE_4__.itownsExtVersion || _package_json__WEBPACK_IMPORTED_MODULE_4__.version + }, false); + + // récupération des autres paramètres passés par l'utilisateur + _Common_Utils__WEBPACK_IMPORTED_MODULE_1__["default"].mergeParams(config, options.itownsParams); + + // add legends and metadata (to be added to LayerSwitcher control) + // we take in priority the explicit options given by the user + config.legends = options.legends || wmtsParams.legends; + config.metadata = options.metadata || wmtsParams.metadata; + config.description = options.description || wmtsParams.description; + config.title = options.title || wmtsParams.title; + config.quicklookUrl = options.quicklookUrl || wmtsParams.quicklookUrl; + return new itowns__WEBPACK_IMPORTED_MODULE_5__["ElevationLayer"](config.id, config); + } else { + // If layer is not in Gp.Config + logger.log("[source WMTS] ERROR : " + options.layer + " cannot be found in Geoportal Configuration. Make sure that this resource is included in your contract key."); + } +} + +/* + * Constructor (alias) + */ +LayerElevation.prototype.constructor = LayerElevation; +/* harmony default export */ __webpack_exports__["default"] = (LayerElevation); + +/***/ }), +/* 120 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); +/* harmony import */ var _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(117); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94); +/* harmony import */ var itowns__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(itowns__WEBPACK_IMPORTED_MODULE_2__); + + + +/* import Extent from "itowns/Core/Geographic/Extent"; +import WMSSource from "itowns/Source/WMSSource"; +import ColorLayer from "itowns/Layer/ColorLayer"; */ + +var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("vectorTileLayer"); + +/** + * @classdesc + * Geoportal VT source creation + * + * @constructor + * @alias itowns.layer.VectorTileLayer + * @param {Object} options - options for function call. + * @param {String} options.id - id to give to the layer + * @param {String} options.layer - Layer name (e.g. "PLAN.IGN") + * @param {String} [options.url] - Url to the vector Tile json style + * @param {String} [options.urlService] - Url to the pbf file. Retrieved in the style file by default. + * @param {Function} [options.filter] - Filter applied to the vector layer style. Fill/Line layer type by default. + * @param {Object} [options.attributions] - Attributions of the layer. + * @param {Object} [options.zoom] - Between which zoom levels the layer is displayed (zoom.min and zoom.max) + * @example + * var vectorTileLayer = new itowns.layer.VectorTileLayer({ + * layer : "PLAN.IGN" + * }); + */ +function VectorTileLayer(options) { + if (!(this instanceof VectorTileLayer)) { + throw new TypeError("ERROR CLASS_CONSTRUCTOR"); + } + + // check layer params + if (!options.layer) { + throw new Error("ERROR PARAM_MISSING : layer"); + } + if (typeof options.layer !== "string") { + throw new Error("ERROR WRONG TYPE : layer"); + } + + // Check if configuration is loaded + if (!_Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__["default"].isConfigLoaded()) { + throw new Error("ERROR : Configuration has to be loaded"); + } + var layerId = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__["default"].configuration.getLayerId(options.layer, "TMS"); + if (layerId && _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__["default"].configuration.getLayerParams(options.layer, "TMS")) { + var config = {}; + var tmsParams = _Common_Utils_Config__WEBPACK_IMPORTED_MODULE_1__["default"].configuration.getLayerParams(options.layer, "TMS"); + + // si ssl = false on fait du http + // par défaut, ssl = true, on fait du https + var protocol = options.ssl === false ? "http://" : "https://"; + config.id = layerId; + config.source = new itowns__WEBPACK_IMPORTED_MODULE_2__["VectorTilesSource"]({ + style: tmsParams.url.replace(/(http|https):\/\//, protocol), + url: options.urlService, + attribution: options.attributions, + filter: options.filter, + zoom: options.zoom + }); + + // FIXME wait for next itowns release to remove this + config.isValidData = function () { + return false; + }; + return new itowns__WEBPACK_IMPORTED_MODULE_2__["ColorLayer"](config.id, config); + } else { + // If layer is not in Gp.Config + logger.error("ERROR layer id (layer name: " + options.layer + " / service: TMS ) was not found !?"); + } +} +; + +/* + * Constructor (alias) + */ +VectorTileLayer.prototype.constructor = VectorTileLayer; +/* harmony default export */ __webpack_exports__["default"] = (VectorTileLayer); + +/***/ }), +/* 121 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); + +(function () { + var scripts = document.getElementsByTagName("script"); + var key = scripts[scripts.length - 1].getAttribute("data-key"); + var url = scripts[scripts.length - 1].getAttribute("data-url"); + var timeout = scripts[scripts.length - 1].getAttribute("data-timeout"); + + // callback + var success = function success() { + // Pas de messages en mode prod + // console.log("GetConfig success!"); + }; + + // callback + var error = function error(e) { + throw new Error("Configuration load failed : " + e.message); + }; + if (!key && !url) { + // pas de message d'information ! + // console.log("WARNING : parameters missing 'data-key' and 'data-url', the loading of configuration can not be done !"); + return; + } + var options = { + apiKey: key, + sync: true, + onSuccess: success, + onFailure: error + }; + if (url) { + options.customConfigFile = url; + options.callbackSuffix = ""; + } + if (timeout) { + options.timeOut = timeout; + } + + // test d'existance de la varibale globale Gp.Config + if (!window.Gp) { + // appel du service + geoportal_access_lib__WEBPACK_IMPORTED_MODULE_0__["default"].Services.getConfig(options); + } +})(); + +/***/ }), +/* 122 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); + + +/** +* @module ProxyUtils +* @alias Gp.ProxyUtils +* @description +* ... +* +* @example +* proxifyUrl(); +*/ +var ProxyUtils = { + /** + * Ajoute un proxy aux url des couches vecteurs si besoin. + * + * @function proxifyUrl + * @param {String} url - Url to proxify. + * @param {Object} [proxyOptions] - Object defining proxy options. + * @param {String} proxyOptions.proxyUrl - Proxy URL. + * @param {Array.} [proxyOptions.noProxyDomains] - Proxy will not be used for this list of domain names. + * + * @returns {String} proxy url + */ + proxifyUrl: function proxifyUrl(url, proxyOptions) { + // logger + + var logger = _Common_Utils_LoggerByDefault__WEBPACK_IMPORTED_MODULE_0__["default"].getLogger("proxifyUrl"); + if (!proxyOptions || !proxyOptions.hasOwnProperty("proxyUrl") || proxyOptions.proxyUrl === null || proxyOptions.proxyUrl.trim().length === 0) { + return url; + } + // on regarde si l'url nest pas dans les domaines sans proxy + if (proxyOptions.noProxyDomains && Array.isArray(proxyOptions.noProxyDomains) && proxyOptions.noProxyDomains.length > 0) { + for (var i in proxyOptions.noProxyDomains) { + logger.trace("[ProxyUtils] proxifyUrl : analyzing " + proxyOptions.noProxyDomains[i]); + if (url.indexOf(proxyOptions.noProxyDomains[i]) !== -1) { + logger.info("[ProxyUtils] proxifyUrl : " + url + " found in noProxyDomains list (" + proxyOptions.noProxyDomains[i] + ")."); + return url; + } + } + } + return proxyOptions.proxyUrl + encodeURIComponent(url); + } +}; +/* harmony default export */ __webpack_exports__["default"] = (ProxyUtils); + +/***/ }), +/* 123 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * @module ColorUtils + * @alias Gp.ColorUtils + * @description + * ... + * + * @example + * arrayTorgba(); + * arrayToHex(); + * rgbaToHex(); + * hexToRgba(); + * isHex(); + * isRGB(); + */ +var ColorUtils = { + /** + * Number to hex conversion + * + * @param {Number} number - 0-255 + * @returns {String} hex value + */ + hex: function hex(number) { + if (number > 255) { + throw new Error("'" + number + "'' is greater than 255(0xff);"); + } + var str = Number(number).toString(16); + return ("0" + str).slice(-2); + }, + /** + * Hexa to number conversion + * + * @param {*} hexa 00-FF + * @returns {Number} number value + */ + num: function num(hexa) { + return parseInt(hexa, 16); + }, + /** + * Converts an array ([255,255,255,1]) to rgba string + * + * @function arrayToRgba + * @param {Array} values - array of values + * @returns {String} A color of RGB or RGBA format + */ + arrayToRgba: function arrayToRgba(values) { + if (!Array.isArray(values)) { + throw new Error("Not an array !"); + } + var red = values[0]; + var green = values[1]; + var blue = values[2]; + var alpha = values[3] || 1; + var result = "rgba(" + red + ", " + green + ", " + blue + ", " + parseFloat(alpha) + ")"; + return result; + }, + /** + * Converts an array ([255,255,255,1]) to #RRGGBBAA + * + * @function arrayToHex + * @param {Array} values - array of values + * @returns {Object} hex and opacity formated values + */ + arrayToHex: function arrayToHex(values) { + if (!Array.isArray(values)) { + throw new Error("Not an array !"); + } + var red = values[0]; + var green = values[1]; + var blue = values[2]; + var alpha = values[3]; + var elems = [this.hex(red), this.hex(green), this.hex(blue)]; + var result = {}; + result.hex = "#" + elems.join(""); + if (alpha) { + // elems.push(hex(alpha)); + result.opacity = parseFloat(alpha); + } + return result; + }, + /** + * Converts rgba string to #RRGGBBAA + * (Code adapted from : https://gist.github.com/mstssk/afda4ce9e5c335fd79cd) + * + * @function rgbaToHex + * @param {String} rgba - A color of RGB or RGBA format. + * @returns {Object} hex and opacity formated values + */ + rgbaToHex: function rgbaToHex(rgba) { + var regex = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/; + var parsed = regex.exec(rgba); + if (!parsed) { + throw new Error("Invalid format: " + rgba); + } + var red = parsed[1]; + var green = parsed[2]; + var blue = parsed[3]; + var alpha = parsed[4]; + var elems = [this.hex(red), this.hex(green), this.hex(blue)]; + var result = {}; + result.hex = "#" + elems.join(""); + if (alpha) { + // elems.push(hex(alpha)); + result.opacity = parseFloat(alpha); + } + return result; + }, + /** + * Converts hex color and opacity value to rgba string. + * (Code adapted from : http://stackoverflow.com/a/5624139) + * + * @function hexToRgba + * @param {String} hex - A color value on RGB format (hexa). + * @param {Number} opacity - A opacity value. + * @returns {String} A color of RGB or RGBA format + */ + hexToRgba: function hexToRgba(hex, opacity) { + // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") + var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; + if (!hex) { + throw new Error("Invalid format"); + } + hex = hex.replace(shorthandRegex, function (m, r, g, b) { + return r + r + g + g + b + b; + }); + var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + rgb = rgb ? { + r: parseInt(rgb[1], 16), + g: parseInt(rgb[2], 16), + b: parseInt(rgb[3], 16) + } : null; + var result = rgb ? "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + opacity + ")" : null; + return result; + }, + /** + * Determine if value is a correct hexa color. + * @param {*} value - hex color (#FFFFFF) + * @returns {Boolean} True if value is a hexa color + */ + isHex: function isHex(value) { + if (!value) { + return false; + } + if (value.charAt(0) !== "#") { + return false; + } + var regex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i; + var parsed = regex.exec(value); + if (!parsed) { + return false; + } + return true; + }, + /** + * Determine if value is a correct rgba color. + * @param {*} value - rgba color (rgba(125,125,125,1)) + * @returns {Boolean} True if value is a rgba color + */ + isRGB: function isRGB(value) { + if (!value) { + return false; + } + var regex = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/; + var parsed = regex.exec(value); + if (!parsed) { + return false; + } + return true; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (ColorUtils); + +/***/ }), +/* 124 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** +* @module MathUtils +* @alias Gp.MathUtils +* @description +* ... +* +* @example +* modulo(); +* decimalToDMS(); +* toInteger(); +* isInteger(); +* toFloat(); +*/ +var MathUtils = { + /** + * Reste de la division euclidienne + * @function modulo + * @param {Number} a - divisor + * @param {Number} b - quotient + * @returns {Number} Modulo + */ + modulo: function modulo(a, b) { + var r = a % b; + return r * b < 0 ? r + b : r; + }, + /** + * Transform degrees, minutes, seconds form decimal degrees - + * Largely inspired by the private function degreesToStringHDMS from ol/coordinate.js + * + * @function decimalToDMS + * @param {Number} degrees - decimal degrees + * @param {Array} hemispheres - "NS" ou "EO" + * @param {Number} numDigits - number of digits for seconds + * @returns {Object} DMS coordinate + */ + decimalToDMS: function decimalToDMS(degrees, hemispheres, numDigits) { + var normalizedDegrees = this.modulo(degrees + 180, 360) - 180; + var x = Math.abs(3600 * normalizedDegrees); + var dflPrecision = numDigits || 0; + var precision = Math.pow(10, dflPrecision); + var deg = Math.floor(x / 3600); + var min = Math.floor((x - deg * 3600) / 60); + var sec = x - deg * 3600 - min * 60; + sec = Math.ceil(sec * precision) / precision; + if (sec >= 60) { + sec = 0; + min += 1; + } + if (min >= 60) { + min = 0; + deg += 1; + } + var direction = hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0); + return { + d: deg, + m: min, + s: sec, + direction: direction + }; + }, + /** + * Converts string to Integer + * + * @function toInteger + * @param {String} s - string number + * @param {Numeric} base - between 2 and 36 + * @returns {null|Numeric} result + */ + toInteger: function toInteger(s, base) { + var _base = base || 10; + var n = parseInt(s, _base); + if (!isNaN(n) && isFinite(n)) { + return n; + } + return null; + }, + /** + * check if s represents an integer + * + * @function isInteger + * @param {String} s - string number + * @returns {Boolean} is integer + */ + isInteger: function isInteger(s) { + if (isNaN(s)) { + return false; + } + var v = parseFloat(s); + return (v | 0) === v; + }, + /** + * Converts s to float + * + * @function toFloat + * @param {String} s - string number + * @returns {null|Numeric} result + */ + toFloat: function toFloat(s) { + var n = parseFloat(s); + if (!isNaN(n) && isFinite(n)) { + return n; + } + return null; + } +}; +/* harmony default export */ __webpack_exports__["default"] = (MathUtils); + +/***/ }) +/******/ ]); +}); \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/GpPluginItowns.css b/itowns-2.5.0-beta/dist/GpPluginItowns.css new file mode 100644 index 000000000..8e955b651 --- /dev/null +++ b/itowns-2.5.0-beta/dist/GpPluginItowns.css @@ -0,0 +1,72 @@ +/*! + * @brief French Geoportal Extension for Itowns + * + * This software is released under the licence CeCILL-B (Free BSD compatible) + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * @see http://www.cecill.info/ + * + * @copyright copyright (c) IGN + * @license CeCILL-B + * @author IGN + * @version 2.5.0-beta + * @date 21/09/2023 + * + */ + +/*! + * Sortable -- JavaScript library for reorderable drag-and-drop lists on modern + * browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, + * React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap. + * + * Released under MIT LICENSE + * + * Copyright Lebedev Konstantin + * https://github.com/SortableJS/Sortable + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @version 1.14.0 + */ + +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.4 + */ + +/*! + * @overview Proj4js - Javascript reprojection library. + * + * @authors + * - Mike Adair madairATdmsolutions.ca + * - Richard Greenwood richATgreenwoodmap.com + * - Didier Richard didier.richardATign.fr + * - Stephen Irons stephen.ironsATclear.net.nz + * - Olivier Terral oterralATgmail.com + * - Calvin Metcalf cmetcalfATappgeo.com + * + * @copyright Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/proj4js/proj4js/master/LICENSE.md + * @version 2.7.5 + */div[id^=GPboostRelief-]{font-size:11px;width:150px}div[id^=GPboostRelief-] label{display:block}div[id^=GPBoostReliefListContainer-]{position:relative;width:100%;height:28px;padding-left:8px;line-height:28px}.GPlayerRelief,.GPlayerReliefValue{position:absolute;top:0}.GPlayerRelief{width:calc(100% - 60px);height:28px;padding-left:8px}.GPlayerReliefValue{width:32px;left:calc(100% - 40px);line-height:28px;font-size:10px;font-style:italic;cursor:default}label[id^=GPshowBoostReliefPicto]{display:inline-block}input[id^=GPshowBoostRelief-]+label{display:block}input[id^=GPshowBoostRelief-]+label+div,input[id^=GPshowBoostRelief-]:checked+label{display:none}input[id^=GPshowBoostRelief-]:checked+label+div{display:block}div[id^=GPboostRelief-] input[type=checkbox]:checked+label+.GPlayerAdvancedToolsRelief{max-height:28px;opacity:1}.GPlayerAdvancedToolsRelief{display:block;position:relative;width:100%;border-bottom:1px dotted #ccc;background-color:#fff}.GPlayerReliefLayerId{position:relative;width:100px;height:28px;padding-left:8px;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.GPlayerRelief input{-webkit-appearance:none;-moz-appearance:none;background:none;display:block;width:100%;height:100%;margin:0;padding:0;overflow:hidden;cursor:pointer}.GPlayerRelief input[type=range]:focus{box-shadow:none;outline:none}.GPlayerRelief input[type=range]::-webkit-slider-runnable-track{-webkit-appearance:none;height:3px}.GPlayerRelief input[type=range]::-webkit-slider-thumb:before{position:absolute;top:0;right:50%;left:-200px;height:3px;pointer-events:none}.GPlayerRelief input[type=range]::-webkit-slider-thumb{width:9px;height:17px;-webkit-appearance:none;border:2px solid #fff;background-color:#505050;position:relative;top:-7px}.GPlayerRelief input[type=range]::-moz-range-track{width:80px;height:3px}.GPlayerRelief input[type=range]::-moz-range-thumb{width:5px;height:13px;border:2px solid #fff;border-radius:0;box-shadow:0;background-color:#505050;position:relative}.GPlayerRelief input[type=range]::-ms-track{border:0;border-color:transparent;border-radius:0;border-width:0;color:transparent;height:3px;width:80px}.GPlayerRelief input[type=range]::-ms-fill-lower,.GPlayerRelief input[type=range]::-ms-fill-upper{background:transparent;border-radius:0}.GPlayerRelief input[type=range]::-ms-thumb{width:5px;height:13px;border:2px solid #fff;background-color:#505050}.GPlayerRelief input[type=range]::-ms-tooltip{display:none}div[id^=GPbuildings-]{font-size:11px}div[id^=GPbuildings-] label{display:block}label[id^=GPshowBuildingsPicto]{display:inline-block;cursor:pointer}label[id^=GPshowDrawingPicto-]{display:inline-block}input[id^=GPshowDrawing-]+label{display:block}input[id^=GPshowDrawing-]+label+div,input[id^=GPshowDrawing-]:checked+label{display:none}input[id^=GPshowDrawing-]:checked+label+div{display:block}div[id^=GPdrawingPanel-]{width:240px;overflow:hidden}div[id^=GPdrawingBasicPanel-]{padding:10px 15px}.GPdrawingCoords,.GPdrawingLabel{display:inline-block;line-height:20px}.GPdrawingLabel{width:80px;font-weight:700}.GPdrawingCoords{width:110px}.marker-input-radio{display:none}input.marker-input-radio:checked+label{border:1px solid red}div[id^=GPelevationPathPanelInfo]{display:none}.GPelevationPathCalcWaitingContainerHidden,.GPelevationPathCalcWaitingContainerVisible{position:absolute;top:32px;bottom:0;left:0;right:0;background-color:hsla(0,0%,100%,.9);font-size:1.5em;font-weight:700;overflow:hidden}.GPelevationPathInformationsContainerHidden,.GPelevationPathInformationsContainerVisible{position:absolute;top:32px;bottom:0;left:0;right:0;background-color:hsla(0,0%,100%,.9);font-size:13px;font-weight:700;overflow:hidden}.GPelevationPathCalcWaitingContainerVisible,.GPelevationPathInformationsContainerVisible{display:-webkit-flex;display:-webkit-box;display:-ms-flexbox;display:flex}.GPelevationPathInformationsContainerVisible{flex-direction:column}.GPelevationPathCalcWaitingContainerHidden,.GPelevationPathInformationsContainerHidden{display:none}.GPelevationPathCalcWaiting,.GPelevationPathInformations{margin:auto}.GPelevationPathInformations{font-size:.8em}.GPelevationPathCalcWaitingContainerHidden,.GPelevationPathCalcWaitingContainerVisible,.GPelevationPathInformationsContainerHidden,.GPelevationPathInformationsContainerVisible{border-radius:5px}#profileElevationRaw{resize:none;padding:unset}#profileElevationByDefault{display:-webkit-flex;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;height:100%}.altiPathValue{font-weight:700;fill:#5e5e5e}.altiPathCoords{font-style:italic;fill:#5e5e5e}.tooltipInit{opacity:0}.tooltipFadeIn{transition:opacity .3s ease 0ms,transform 50ms ease 0s,top 50ms ease 0s,left 50ms ease 0s;opacity:1}.tooltipFadeOut{transition:opacity .5s ease 0ms;opacity:0}.axis-d3>text{fill:#5e5e5e;font-family:Verdana;font-size:10px;opacity:1;text-anchor:end}.axis-d3{fill:none;stroke:#5e5e5e;stroke-width:1;shape-rendering:crispEdges}.area-d3{fill:#c77a04;stroke:#5e5e5e;stroke-width:0;fill-opacity:.4}.line-d3{fill:none;stroke:#c77a04;stroke-width:1px}.grid-d3 .tick{stroke:#d3d3d3;opacity:.7}.grid-d3 path{stroke-width:0}.overlay-d3{fill:none;pointer-events:all}.focusLine-d3{fill:none;stroke:#c77a04;stroke-width:.5px}.focusCircle-d3{fill:#c77a04}div.tooltip-d3{position:inherit;text-align:left;width:80px;height:45px;padding:5px;font:8px sans-serif;background:#fff;border:0;border-radius:8px;pointer-events:none}.GPwidget{position:absolute;font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:13px;color:#333}.GPwidget input[type=button],.GPwidget input[type=text]{-webkit-appearance:none;color:#333}.GPwidget input[type=checkbox]{display:none}.GPwidget select{padding-left:3px;border-radius:3px}.GPwidget form{margin-bottom:0}.GPwidget *{box-sizing:border-box}.GPwaiting,.GPwidget *{background-repeat:no-repeat}.GPwaiting{background-image:url(data:image/gif;base64,R0lGODlhNAA0AIQSAAFkpSZ5sAGV3k2Ruiao3kOj1/GUBk225pe/B4S83XrK75HH3qrS5szMzNbW1sHe797e3ubm5v///////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAQAfACwAAAAANAA0AAAF5uAnjmRpnmiqrmzrvnAsz3T9FXhh72Ke8zWfDzgT/ogxIw55cjgiJ6XOhKjaII1sNio8Vb8ImnbMXVLBVhl2vI2hvzIHOwt9veGxyLwhu4dlcw59bzVjgjNoPHU2f0yOj5CRkpMocg2HjwaaBitzmZuaKWuGTKCgKHt8SKabqHulrJwno1qYQLGyJ56OrCuWtrChlMPExcbHH4s1ymK1NJZtM4Fxu3mvMXvMLdBj2ip60zG0WoBzENLVJL+66TDj7GQmbOc1EE9N4SURDvSRqcgj/gH8wC0LsGPtAK7pN7Chw4cQSYQAACH5BAUBAB8ALBYABAAaACcAAAVw4PdBTQOJaKquX+k2bJw6b+nIcu3isV7yLFrttioYczWWcVmICYkq5hKolB6pKOsUm9Vyu9JvKiyOls/otHqNQ7gR6ff7LJeX63Mx3n3f0+txeWyDhIVlBmsGiopoi45njo9fkZKTlIhil42RaYsxIQAh+QQFAQAfACwWAAkAGgAnAAAFdOAnjmQZOVCprmTjuikrf289y/Ub32SUuw6e6teICEuO31GVfC1Zxqd0Sq1arYVsAavNUrvdKVgrHm+l5jMazPVe3/C4/IN4I+73Kn5P3fOffn+AgXUqBocGK4QriIiKfoaNjip4LJKTT5eHU5qJnJJWjVUhACH5BAUBAB8ALAkAFgAnABoAAAV04CeOZGmepdM0Duq+5yo3cO2qcwPZPJnLveBvFezhZrsi76cM4lrNqHRKrVpPhmoBZuh2o4VwGOUtK8VoU9lcRKdJazbP/R7Fv236tnQ/If4IJ3pYa36Af4JuLl6Gh4gmYlKOgFclk4+VIpeBmSOTnZaUTSEAIfkEBQEAHwAsBAAWACcAGgAABXfg9xmkIZ5oqq5rWbJwnLqubLP0e+9nTvJAnwnIyxGJtaNyyWw6n1Ao4hmRIa7XpaPBbbCw4OO2y1WBw0Ryt4o6o3cRNdeRcmfTcojZvSr4CytyXntvKH9/gWR6X3cph4crEQ6LSo+IUYaWgJgnmpucIpagjpc3IQAh+QQFAQAfACwEAAkAGgAnAAAFb+AnjqJhkmiamqyhvmjLwrA806p946Tu8isbMNca1ozIpHLJTCKeiCYUupxOlVaqMxvdZqtWqbZJLpvPyEK5wGYz23AlPJ6c0412t9yucjQaDi98KX+FDTBtfYZ/gUmLhUqPf0p+i42Oi00QfxAiIQAh+QQFAQAfACwEAAQAGgAnAAAFc+AnjmRZGqhhrmyasrDounE7o/V64yvi6zuTb4gA0oTEn+lYSg5zSGcROpJOqVUntknc9rzgsHhMLhXOhTEaHV6vwW62N36G09tutbzM7/v/JhFlDYQNDmKFhYdeEYmFYA6OhIJbEJINYZdhlolkEA6UUCEAIfkEAQEAHwAsBAAEACcAGgAABXXgJ45kWSIoYq5sS6apK8swPN9mHeP8p6O9UmG4+qlMhmRryCwUa6uk1LBqMp9A5FQptBKDW2nX6+SFxSRyuXemjpvBz5lljYu2srX9vu/7/4CBgh8NhQ6DK4WKDYgkEIuGjSKQipKElIySj5CHlpSWIw6RoCEAOw==);background-position:50%}.GPpanel{background-color:#fff}.GPpanelHeader{position:relative;width:100%}.GPpanelTitle{width:100%;height:100%;text-align:center;font-weight:700}.GPpanelClose,.GPpanelInfo,.GPpanelReduce{position:absolute;cursor:pointer}.GPshowAdvancedToolPicto{position:relative;box-sizing:border-box;cursor:pointer}.GPshowAdvancedToolOpen{position:absolute;display:block;box-sizing:border-box}.GPflexInput{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex;transition:max-height .3s ease-out,opacity .3s ease-out}.GPflexInput>*{display:block;height:28px;line-height:26px;border:1px solid #999;border-radius:0}.GPflexInput :not(:last-child){border-right:none}.GPflexInput :first-child{border-radius:3px 0 0 3px}.GPflexInput :last-child{border-radius:0 3px 3px 0}.GPflexInput>:not(input){overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.GPflexInput>input{padding:0 5px;min-width:0}.GPflexInput>input,.GPflexInput>select{-webkit-flex:1;-webkit-box-flex:1;-ms-flex:1;flex:1}.GPflexInput>select{padding-right:7px}.GPflexInput>label{background-color:#f2f2f2;color:#666;padding-left:7px;padding-right:9px;cursor:pointer}.GPinputSelect{border:1px solid #999;color:#333}.GPinputSelect,input.GPinputSubmit{display:block;height:28px;line-height:26px;margin:auto;cursor:pointer}input.GPinputSubmit{width:80px;padding:0;background:none;border:none;border-radius:3px;font-family:Helvetica Neue,Arial,Helvetica,sans-serif;color:#fff;font-weight:700;opacity:.8;transition:opacity .2s ease-out}input.GPinputSubmit:hover{opacity:1}.GPadvancedAutoCompleteList,.GPautoCompleteList{z-index:2;display:none;position:absolute;max-height:140px;background-color:#fff;border:1px solid #999;overflow-y:hidden}.GPadvancedAutoCompleteList{width:calc(100% - 28px);border-top:none;font-size:.9em}.GPautoCompleteProposal{width:100%;height:28px;line-height:16px;padding:6px 10px;color:#5e5e5e;font-size:1em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}.GPautoCompleteProposal:hover{color:#000;background-color:#cedbef}.GPshowMoreOptions{display:block;position:absolute;width:28px;height:28px;cursor:pointer;transition:all .5s ease-out 0s}input[type=checkbox]:checked+.GPshowMoreOptions{-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}label[id^=GPgetFeatureInfoPicto]{display:inline-block}div[id^=GPgetFeatureInfo-]+label{display:block}span[id^=GPgetFeatureInfoActivate],span[id^=GPgetFeatureInfoDeactivate]{position:absolute;display:block;transition:border-radius .5s ease-out 0s,opacity .5s ease-out 0s}span[id^=GPgetFeatureInfoActivate]{background-position:0 0;opacity:1}span[id^=GPgetFeatureInfoDeactivate]{opacity:0}div[id^=GPgetFeatureInfo-] input[type=checkbox]:not(:checked)+label[id^=GPgetFeatureInfoPicto] span[id^=GPgetFeatureInfoDeactivate]{opacity:1}div[id^=GPisochron-]{top:140px}label[id^=GPshowIsochronPicto]{display:inline-block}input[id^=GPshowIsochron-]+label{display:block}input[id^=GPshowIsochron-]+label+div,input[id^=GPshowIsochron-]:checked+label{display:none}input[id^=GPshowIsochron-]:checked+label+div{display:block}div[id^=GPisochronPanel-]{width:280px}.GPisochronCalcWaitingContainerHidden,.GPisochronCalcWaitingContainerVisible{position:absolute;top:32px;bottom:0;left:0;right:0;background-color:hsla(0,0%,100%,.9);font-size:1.5em;font-weight:700;overflow:hidden}.GPisochronCalcWaitingContainerVisible{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex}.GPisochronCalcWaitingContainerHidden{display:none}.GPisochronCalcWaiting{margin:auto}form[id^=GPisochronForm]{padding:15px}.GPisochronFormMini{max-height:58px;overflow:hidden}.GPisochronFormMini div[id^=GPisochronReset-],.GPisochronFormMini label[id^=GPshowIsoExclusionsPicto-]{display:none}.GPisochronOriginVisible{display:block}.GPisochronOriginHidden{display:none}.GPisochronOriginPointerImg{width:28px;background-color:#f2f2f2;cursor:pointer}input[id^=GPisochronOriginPointer]+.GPisochronOriginPointerImg{background-position:-1px -1px}input[id^=GPisochronOriginPointer]:checked+.GPisochronOriginPointerImg{background-position:-29px -1px}input[id^=GPisochronSubmit]{margin-top:5px}div[id^=GPisochronChoice]{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex;width:160px;-webkit-justify-content:space-between;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:15px auto 5px}.GPisochronChoiceAlt input{display:none}.GPisochronChoiceAltImg{display:block;width:28px;height:28px;margin:auto;cursor:pointer}input[id^=GPisochronChoiceAltChron]+.GPisochronChoiceAltImg{background-position:-56px 0}input[id^=GPisochronChoiceAltChron]:checked+.GPisochronChoiceAltImg{background-position:-84px 0}input[id^=GPisochronChoiceAltDist]+.GPisochronChoiceAltImg{background-position:-112px 0}input[id^=GPisochronChoiceAltDist]:checked+.GPisochronChoiceAltImg{background-position:-140px 0}.GPisochronChoiceAlt span{cursor:pointer;display:block;color:#999}.GPisochronValueHidden{display:none}div[id^=GPisochronValueChron],div[id^=GPisochronValueDist]{width:220px;margin:auto}div[id^=GPisochronModeChoice]{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-justify-content:space-between;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:15px 0}.GPisochronModeLabel{display:block;text-align:center;margin-bottom:5px}div[id^=GPisochronTransportChoice] input{display:none}.GPisochronTransportImg{display:inline-block;width:28px;height:28px;cursor:pointer}.GPisochronTransportImg:first-of-type{margin-left:18px;margin-right:10px}input[id^=GPisochronTransportCar]+.GPisochronTransportImg{background-position:-168px 0}input[id^=GPisochronTransportCar]:checked+.GPisochronTransportImg{background-position:-196px 0}input[id^=GPisochronTransportPedestrian]+.GPisochronTransportImg{background-position:-224px 0}input[id^=GPisochronTransportPedestrian]:checked+.GPisochronTransportImg{background-position:-252px 0}select[id^=GPisochronDirectionSelect]{width:80px}input[id^=GPshowIsoExclusions]{display:none}.GPshowIsoExclusionsPicto{top:250px;right:0;transition:all .5s ease-out 0s}input[id^=GPshowIsoExclusions]+label+div[id^=GPisoExclusions]{max-height:0;opacity:0;margin-bottom:0}input[id^=GPshowIsoExclusions]:checked+label+div[id^=GPisoExclusions]{display:block;max-height:60px;opacity:1;margin-bottom:15px}div[id^=GPisoExclusions]{transition:max-height .5s ease-in-out .25s,opacity .5s ease-in-out .25s,margin .3s ease-in-out .25s;overflow:hidden}.GPisoExclusionsLabel{display:block;text-align:center;margin-bottom:10px;font-weight:700;line-height:16px}.GPisoExclusionsOptions{display:-webkit-flex;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.GPisoExclusionsOption{display:block;height:28px;line-height:26px;color:#a77;background-color:#fee;padding-left:28px;padding-right:5px;border:1px solid #a77;border-radius:3px;cursor:pointer}input:checked+.GPisoExclusionsOption{background-color:#efe;background-position:0 -28px;color:#797;border:1px solid #797}div[id^=GPisochronReset]{position:absolute;margin-top:5px;width:28px;height:28px;border-radius:3px;opacity:.8;background-position:-281px 0;transition:opacity .2s ease-out;cursor:pointer}div[id^=GPisochronReset]:hover{opacity:1}div[id^=GPlayerSwitcher-]{font-size:11px}div[id^=GPlayerSwitcher-] [draggable]{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;user-select:none;-khtml-user-drag:element;-webkit-user-drag:element}div[id^=GPlayerSwitcher-] input[type=checkbox]+div,div[id^=GPlayerSwitcher-] input[type=checkbox]+label+div{max-height:0}div[id^=GPlayerSwitcher-] label{display:block}label[id^=GPshowLayersListPicto]{position:relative;float:right;display:block;opacity:1;transition:opacity .5s ease-out 0s,box-shadow .5s ease-out 0s,border .5s ease-out 0s,border-radius .5s ease-out 0s;cursor:pointer}span[id^=GPshowLayersListClose],span[id^=GPshowLayersListOpen]{position:absolute;display:block;transition:border-radius .5s ease-out 0s,opacity .5s ease-out 0s}span[id^=GPshowLayersListOpen]{background-position:0 0;opacity:1}span[id^=GPshowLayersListClose]{opacity:0}div[id^=GPlayerSwitcher-] input[type=checkbox]:checked+div+label[id^=GPshowLayersListPicto]{border-top-left-radius:0;border-top-right-radius:0}div[id^=GPlayerSwitcher-] input[type=checkbox]:checked+div+label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListClose]{opacity:1}div[id^=GPlayersList]{position:relative;width:180px;border-bottom-right-radius:0;opacity:0;overflow:auto;transition:max-height .5s ease-out 0s,opacity .5s ease-out .25s}div[id^=GPlayerSwitcher-] input[type=checkbox]:checked+div[id^=GPlayersList]{max-height:232px;opacity:1;transition:max-height .5s ease-in 0s,opacity .25s ease-in 0s}.GPlayerSwitcher_layer{position:relative;top:0;background-color:#fff;border-bottom:1px dotted #ccc;overflow:hidden}div[id^=GPlayersList] .GPlayerSwitcher_layer:last-child{border-bottom:none}.GPlayerAdvancedTools,.GPlayerBasicTools{position:relative;width:100%;height:28px}.GPlayerInfo,.GPlayerInfoOpened,.GPlayerRemove,.GPlayerVisibility{width:28px;height:28px;cursor:pointer}.GPlayerInfo,.GPlayerInfoOpened,.GPlayerName,.GPlayerOpacity,.GPlayerOpacityValue,.GPlayerRemove,.GPlayerVisibility{position:absolute;top:0}.GPghostLayer{opacity:0}.GPlayerBasicTools{background-color:#fff}.GPlayerVisibility{left:0;background-position:-28px 0}input[type=checkbox]:checked+.GPlayerVisibility{background-position:0 0}.GPlayerName{left:28px;width:calc(100% - 56px);line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-left:4px;cursor:move}.outOfRange .GPlayerName{color:#aaa}.GPshowLayerAdvancedTools{top:0;right:0;background-position:-112px 0}.GPlayerAdvancedTools{display:block;max-height:0;opacity:0;transition:max-height .5s ease-out 0s,opacity .5s ease-out 0s}div[id^=GPlayerSwitcher-] input[type=checkbox]:checked+label+.GPlayerAdvancedTools{max-height:28px;opacity:1}.GPlayerInfo{left:0;background-position:-55px 0}.GPlayerInfoOpened{left:0;background-position:-83px 0}.GPlayerOpacity{left:28px;width:calc(100% - 100px);height:28px;padding-left:8px}.GPlayerOpacityValue{width:32px;left:calc(100% - 60px);line-height:28px;font-size:10px;font-style:italic;cursor:default}.GPlayerRemove{right:0;background-position:-140px 0}.GPlayerOpacity input{-webkit-appearance:none;-moz-appearance:none;background:none;display:block;width:100%;height:100%;margin:0;padding:0;overflow:hidden;cursor:pointer}.GPlayerOpacity input[type=range]:focus{box-shadow:none;outline:none}.GPlayerOpacity input[type=range]::-webkit-slider-runnable-track{-webkit-appearance:none;height:3px}.GPlayerOpacity input[type=range]::-webkit-slider-thumb:before{position:absolute;top:0;right:50%;left:-200px;height:3px;pointer-events:none}.GPlayerOpacity input[type=range]::-webkit-slider-thumb{width:9px;height:17px;-webkit-appearance:none;border:2px solid #fff;background-color:#505050;position:relative;top:-7px}.GPlayerOpacity input[type=range]::-moz-range-track{width:80px;height:3px}.GPlayerOpacity input[type=range]::-moz-range-thumb{width:5px;height:13px;border:2px solid #fff;border-radius:0;box-shadow:0;background-color:#505050;position:relative}.GPlayerOpacity input[type=range]::-ms-track{border:0;border-color:transparent;border-radius:0;border-width:0;color:transparent;height:3px;width:80px}.GPlayerOpacity input[type=range]::-ms-fill-lower,.GPlayerOpacity input[type=range]::-ms-fill-upper{background:transparent;border-radius:0}.GPlayerOpacity input[type=range]::-ms-thumb{width:5px;height:13px;border:2px solid #fff;background-color:#505050}.GPlayerOpacity input[type=range]::-ms-tooltip{display:none}div[id^=GPlayerInfoPanel]{position:absolute;top:0;overflow-y:hidden;padding-top:10px;padding-bottom:10px}.GPlayerInfoPanelOpened{display:block}.GPlayerInfoPanelClosed{display:none}div[id^=GPlayerInfoContent]{position:relative;width:280px;max-height:200px;overflow-y:auto;padding-left:10px;padding-right:10px}div[id^=GPlayerInfoTitle]{width:calc(100% - 52px);margin:auto auto 10px;padding-bottom:5px;text-align:center;font-size:1.1em;font-weight:700}div[id^=GPlayerInfoQuicklook]{position:absolute;top:-2px;left:10px;width:20px;height:20px;cursor:pointer}div[id^=GPlayerInfoClose]{position:absolute;top:-8px;right:10px;width:28px;height:28px;cursor:pointer}div[id^=GPlayerInfoDescription]{font-size:.9em}.GPlayerInfoSubtitle{padding-left:35px;font-weight:700;margin-top:10px;margin-bottom:4px}.GPlayerInfoLink,.GPlayerInfoPopup{line-height:20px;padding-left:23px;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;color:#999;background-repeat:no-repeat;cursor:pointer}.GPlayerInfoLink{background-position:0 -20px}.GPlayerInfoLink:hover,.GPlayerInfoPopup:hover{color:#333}.GPlayerInfoLink a,.GPlayerInfoLink a:visited .GPlayerInfoLink a:focus .GPlayerInfoLink a:hover{text-decoration:none;color:inherit}.GPlocationStageFlexInput{max-height:28px;opacity:1}.GPlocationStageFlexInputHidden{max-height:0;opacity:0;overflow:hidden}.GPlocationOriginVisible{display:block}.GPlocationOriginHidden{display:none}label.GPlocationOriginPointerImg[id*=GPlocationOriginPointerImg]{width:28px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-right:1px solid #999}input[id*=GPlocationOriginPointer]+.GPlocationOriginPointerImg{background-position:-1px -1px}input[id*=GPlocationOriginPointer]:checked+.GPlocationOriginPointerImg{background-position:-29px -1px}.GPlocationStageRemove,div[id^=GPlocationStageAdd]{width:28px;border:none;cursor:pointer}.GPlocationStageRemove{background-position:-84px 0}div[id^=GPlocationStageAdd]{background-position:-56px 0}label[id^=GPshowMeasureAreaPicto-]{display:inline-block}input[id^=GPshowMeasureArea-]+label{display:block}input[id^=GPshowMeasureArea-]:checked+label{display:block;background-color:rgba(0,60,136,.5)}input[id^=GPshowMeasureArea-]+label+div,input[id^=GPshowMeasureArea-]:checked+label+div{display:block}label[id^=GPshowMeasureAzimuthPicto-]{display:inline-block}input[id^=GPshowMeasureAzimuth-]+label{display:block}input[id^=GPshowMeasureAzimuth-]:checked+label{display:block;background-color:rgba(0,60,136,.5)}input[id^=GPshowMeasureAzimuth-]+label+div,input[id^=GPshowMeasureAzimuth-]:checked+label+div{display:block}label[id^=GPshowMeasureLengthPicto-]{display:inline-block}input[id^=GPshowMeasureLength-]+label{display:block}input[id^=GPshowMeasureLength-]:checked+label{display:block;background-color:rgba(0,60,136,.5)}input[id^=GPshowMeasureLength-]+label+div,input[id^=GPshowMeasureLength-]:checked+label+div{display:block}.GPmeasureTooltip{position:relative;background:rgba(0,0,0,.5);border-radius:4px;color:#fff;padding:4px 8px;white-space:nowrap}.GPmeasureTooltip-measure{font-weight:700}.GPmeasureTooltip-info{font-size:.75em;text-align:center}.GPmeasureTooltip-static{background-color:#fc3;color:#000;border:1px solid #fff}.GPmeasureTooltip-hidden{display:none}.GPmeasureTooltip-info:before,.GPmeasureTooltip-measure:before,.GPmeasureTooltip-static:before{border-top:6px solid rgba(0,0,0,.5);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.GPmeasureTooltip-static:before{border-top-color:#fc3}label[id^=GPshowMousePositionPicto]{display:inline-block}input[id^=GPshowMousePosition-]+label{display:block}input[id^=GPshowMousePosition-]+label+div,input[id^=GPshowMousePosition-]:checked+label{display:none}input[id^=GPshowMousePosition-]:checked+label+div{display:block}div[id^=GPmousePositionPanel-]{width:300px;overflow:hidden}div[id^=GPmousePositionBasicPanel]{padding:10px 15px;position:relative}.GPmousePositionCoords,.GPmousePositionLabel{display:inline-block;line-height:20px}.GPmousePositionLabel{width:80px;font-weight:700}.GPmousePositionCoords{width:110px}.GPshowMousePositionSettingsPicto{bottom:5px;right:0;transition:all .5s ease-out 0s}div[id^=GPmousePosition-] input[type=checkbox]:checked+.GPshowMousePositionSettingsPicto{bottom:100px}div[id^=GPmousePositionSettings-]{display:block;max-height:0;opacity:0;transition:max-height .5s ease-out 0s,opacity .5s ease-out 0s}div[id^=GPmousePosition-] input[type=checkbox]:checked+label+div[id^=GPmousePositionSettings-]{max-height:95px;opacity:1}div[id^=GPmousePositionSettings-]{height:95px;padding-left:0 15px;overflow:hidden}.GPmousePositionSettingsLabel{display:block;margin:auto;text-align:center;font-weight:700;line-height:16px}.GPmousePositionSettingsSelect{width:180px;margin-top:5px}div[id^=GPmousePositionCoordinate-] input.error{border:1px solid red}div[id^=GPmousePositionCoordinate-] input[readonly]{border:1px solid transparent;padding:2px;text-align:right}input[id^=GPmousePositionLat-],input[id^=GPmousePositionLon-]{width:120px}span[id^=GPmousePositionAlt-]{display:inline-block;padding:2px;width:120px;line-height:20px;text-align:right}.GPSexagesimal,.GPSexagesimalsec{margin:0;border:1px solid #ccc;border-radius:4px}input:read-only.GPSexagesimal,input:read-only.GPSexagesimalsec{text-align:right}.GPSexagesimal{width:30px}.GPSexagesimalsec{width:45px}.GPmousePositionSexagesimalLabel{font-size:1.2em;vertical-align:middle;padding:0}select.GPmousePositionDirection{border:1px solid #999;margin-left:2px}select.GPmousePositionDirection:disabled{border:none;background:transparent;color:#000;-webkit-appearance:none;-moz-appearance:none}select.GPmousePositionDirection:disabled::-ms-expand{display:none}select.GPmousePositionDirection:disabled::-ms-value{color:#000}.GPmousePositionAltitudeUnits,.GPmousePositionUnits{margin-left:5px}.GPmousePositionPanelEditTools{position:absolute;top:20px;right:5px}.GPmousePositionEditTool{width:18px;height:18px;display:inline-block;cursor:pointer}span[id^=GPmousePositionCloseEdit]{background-position:-18px 0;margin-left:5px}img[id^=GPmousePositionMarker]:hover{cursor:pointer;opacity:.7}#GPmapCenter{display:none;position:absolute;top:50%;left:50%;width:50px;height:50px;margin-top:-25px;margin-left:-25px}#GPmapCenter.GPmapCenterVisible{display:block}[id^=GPreverseGeocoding-]{top:180px}[id^=GPshowReverseGeocodingPicto-]{display:inline-block}[id^=GPshowReverseGeocoding-]+label{display:block}[id^=GPshowReverseGeocoding-]+label+div,[id^=GPshowReverseGeocoding-]:checked+label{display:none}[id^=GPshowReverseGeocoding-]:checked+label+div{display:block}div[id^=GPreverseGeocodingResultsClose]{top:0;right:0;width:30px;height:32px}[id^=GPreverseGeocodingPanel-]{width:280px}.GPreverseGeocodingComponentHidden{display:none}div[id^=GPreverseGeocodingReturnPicto-]{position:absolute;width:26px;height:26px;border-radius:3px;opacity:1;background-position:0 0;cursor:pointer}.GPreverseGeocodingReturnPictoHidden{display:none}[id^=GPreverseGeocodingForm-]{position:relative;max-height:270px;overflow-y:auto;padding-left:15px;padding-right:15px;padding-top:10px}.GPreverseGeocodingCodeLabel,.GPreverseGeocodingFilterLabel{max-width:105px}.GPreverseGeocodingCode,.GPreverseGeocodingCodeLabel{margin-top:5px;margin-bottom:0}.GPreverseGeocodingFilterInput,.GPreverseGeocodingFilterLabel{margin-bottom:5px}input[id^=GPreverseGeocodingSubmit-]{margin-top:5px;margin-bottom:15px;width:100px}.GPreverseGeocodingCalcWaitingContainerHidden,.GPreverseGeocodingCalcWaitingContainerVisible{position:absolute;top:32px;bottom:0;left:0;right:0;background-color:hsla(0,0%,100%,.9);font-size:1.5em;font-weight:700;overflow:hidden}.GPreverseGeocodingCalcWaitingContainerVisible{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex}.GPreverseGeocodingCalcWaitingContainerHidden{display:none}.GPreverseGeocodingCalcWaiting{margin:auto}div[id^=GPreverseGeocodingResultsList-]{position:relative;max-height:210px;overflow-y:auto}div[id^=GProute-]{top:100px}label[id^=GPshowRoutePicto]{display:inline-block}input[id^=GPshowRoute-]+label{display:block}input[id^=GPshowRoute-]+label+div,input[id^=GPshowRoute-]:checked+label{display:none}input[id^=GPshowRoute-]:checked+label+div{display:block}div[id^=GProutePanel-]{width:320px}.GProuteComponentHidden{display:none}.GProuteCalcWaitingContainerHidden,.GProuteCalcWaitingContainerVisible{position:absolute;top:32px;bottom:0;left:0;right:0;background-color:hsla(0,0%,100%,.9);font-size:1.5em;font-weight:700;overflow:hidden}.GProuteCalcWaitingContainerVisible{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex}.GProuteCalcWaitingContainerHidden{display:none}.GProuteCalcWaiting{margin:auto}form[id^=GProuteForm]{padding:15px}.GProuteFormMini{max-height:58px;overflow:hidden;-webkit-transform:translateY(-5px);transform:translateY(-5px)}.GProuteStageFlexInput{max-height:28px;opacity:1}.GProuteStageFlexInputHidden{max-height:0;opacity:0;overflow:hidden}form[id^=GProuteForm]>.GPlocationStageFlexInput{margin-top:5px}form[id^=GProuteForm]>.GPlocationStageFlexInputHidden{margin-top:0}form[id^=GProuteForm].GProuteFormMini .GPlocationStageFlexInput:first-child{margin-top:5px}.GProuteOriginVisible{display:block}.GProuteOriginHidden{display:none}label.GProuteOriginPointerImg[id*=GProuteOriginPointerImg]{width:28px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-right:1px solid #999}input[id*=GProuteOriginPointer]+.GProuteOriginPointerImg{background-position:-1px -1px}input[id*=GProuteOriginPointer]:checked+.GProuteOriginPointerImg{background-position:-29px -1px}.GProuteStageRemove,div[id^=GProuteStageAdd]{width:28px;border:none;cursor:pointer}.GProuteFormMini .GProuteStageRemove,.GProuteFormMini div[id^=GProuteStageAdd]{display:none}.GProuteStageRemove{background-position:-84px 0}div[id^=GProuteStageAdd]{background-position:-56px 0}div[id^=GProuteModeChoice]{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around;margin:15px 0}.GProuteModeLabel{display:block;text-align:center;margin-bottom:5px}div[id^=GProuteTransportChoice] input{display:none}.GProuteTransportImg{display:inline-block;width:28px;height:28px;cursor:pointer}.GProuteTransportImg:first-of-type{margin-left:18px;margin-right:10px}input[id^=GProuteTransportCar]+.GProuteTransportImg{background-position:-112px 0}input[id^=GProuteTransportCar]:checked+.GProuteTransportImg{background-position:-140px 0}input[id^=GProuteTransportPedestrian]+.GProuteTransportImg{background-position:-168px 0}input[id^=GProuteTransportPedestrian]:checked+.GProuteTransportImg{background-position:-196px 0}select[id^=GProuteComputationSelect]{width:100px}input[id^=GPshowRouteExclusions]{display:none}.GPshowRouteExclusionsPicto{right:0;transition:all .3s ease-out 0s}input[id^=GPshowRouteExclusions]+label+div[id^=GProuteExclusions]{max-height:0;opacity:0;margin-bottom:0}input[id^=GPshowRouteExclusions]:checked+label+div[id^=GProuteExclusions]{display:block;max-height:60px;opacity:1;margin-bottom:15px}div[id^=GProuteExclusions]{transition:max-height .5s ease-in-out .25s,opacity .5s ease-in-out .25s,margin .3s ease-in-out .25s;overflow:hidden}.GProuteExclusionsLabel{display:block;text-align:center;margin-bottom:10px;font-weight:700;line-height:16px}.GProuteExclusionsOptions{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.GProuteExclusionsOption{display:block;height:28px;line-height:26px;color:#a77;background-color:#fee;padding-left:28px;padding-right:5px;border:1px solid #a77;border-radius:3px;cursor:pointer}input:checked+.GProuteExclusionsOption{background-color:#efe;background-position:0 -28px;color:#797;border:1px solid #797}div[id^=GProuteReset]{position:absolute;width:28px;height:28px;border-radius:3px;opacity:.8;background-position:-224px 0;transition:opacity .2s ease-out;cursor:pointer}div[id^=GProuteReset]:hover{opacity:1}div[id^=GProuteResultsPanel]{padding:15px}.GProuteResultStage{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex}div[id^=GProuteResultsStages]{margin-bottom:15px}.GProuteResultStageLabel,.GProuteResultStageValue,.GProuteResultsValueLabel,div[id^=GProuteResultsValueDist],div[id^=GProuteResultsValueTime]{display:inline-block;line-height:18px}.GProuteResultStageLabel,.GProuteResultsValueLabel{color:#666}.GProuteResultStageLabel{width:60px}.GProuteResultsValueLabel{width:65px}.GProuteResultStageValue{-webkit-flex:1;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis}div[id^=GProuteResultsValueDist],div[id^=GProuteResultsValueTime]{width:80px;font-weight:700}div[id^=GProuteResults-]{display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-justify-content:space-between;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:10px}select[id^=GProuteResultsComputationSelect]{width:100px}div[id^=GProuteResultsNew]{width:28px;height:28px;border-radius:3px;opacity:.8;background-position:-224px 0;transition:opacity .2s ease-out;cursor:pointer}div[id^=GProuteResultsNew]:hover{opacity:1}.GPfakeBorder{display:inline-block;height:14px;width:60px;border-bottom:1px solid #999}.GPfakeBorderLeft{margin-left:15px}input[id^=GProuteResultsShowDetails]+label,input[id^=GProuteResultsShowDetails]+label+label{width:130px;line-height:28px;vertical-align:top;text-align:center;font-weight:700;cursor:pointer;transition:color .2s ease-out}input[id^=GProuteResultsShowDetails]+label,input[id^=GProuteResultsShowDetails]:checked+label+label{display:inline-block}input[id^=GProuteResultsShowDetails]+label+label,input[id^=GProuteResultsShowDetails]:checked+label{display:none}input[id^=GProuteResultsShowDetails]+label+label+div+div[id^=GProuteResultsDetails]{max-height:0;opacity:0}input[id^=GProuteResultsShowDetails]:checked+label+label+div+div[id^=GProuteResultsDetails]{max-height:200px;opacity:1}div[id^=GProuteResultsDetails]{overflow-y:auto;transition:max-height .5s ease-in-out .25s,opacity .5s ease-in-out .25s}.GProuteResultsDetailsInstruction,.GProuteResultsDetailsNumber{display:inline-block;margin-top:4px;line-height:16px;color:#666}.GProuteResultsDetailsNumber{font-weight:700;width:22px;text-align:right;vertical-align:top}.GProuteResultsDetailsInstruction{width:calc(100% - 30px);padding-left:5px}input[id^=GPshowSearchEngine-]{display:none}label[id^=GPshowSearchEnginePicto]{display:inline-block;transition:border-radius 0s ease-out 0s;transition-delay:.5s}input[id^=GPshowSearchEngine-]:checked+label{border-top-right-radius:0;border-bottom-right-radius:0;transition-delay:0s}input[id^=GPshowSearchEngine-]+label+form[id^=GPsearchInput-]{max-width:0;border:none;transition:max-width .5s ease-out 0s}input[id^=GPshowSearchEngine-]:checked+label+form[id^=GPsearchInput-]{max-width:280px}input[id^=GPshowSearchEngine-]+label+form[id^=GPsearchInput-]+div[id^=GPshowAdvancedSearch]{display:none}input[id^=GPshowSearchEngine-]:checked+label+form[id^=GPsearchInput-]+div[id^=GPshowAdvancedSearch]{display:inline-block}div[id^=GPautoCompleteList]{display:none}input[id^=GPshowSearchEngine-]:checked+label+form[id^=GPsearchInput-]+div[id^=GPautoCompleteList]{display:block}form[id^=GPsearchInput-]{display:inline-block;position:relative;left:-3px;width:280px;overflow:hidden}form[id^=GPsearchInput-] input{display:block;width:100%;height:100%;border:1px solid #999;border-top-right-radius:5px;border-bottom-right-radius:5px;padding:0 30px 0 5px;color:#333;font-size:1em}form[id^=GPsearchInput-] input:disabled{background-color:#ddd;color:#999}div[id^=GPsearchInputReset]{position:absolute;background-position:-30px 0;cursor:pointer}div[id^=GPadvancedSearchClose],div[id^=GPgeocodeResultsClose],div[id^=GPsearchInputReset]{top:0;right:0;width:30px;height:32px}div[id^=GPgeocodeResultsClose]{background-position:0 0}div[id^=GPadvancedSearchClose]{background-repeat:no-repeat}div[id^=GPshowAdvancedSearch]{transition:border-radius 0s ease-out 0s;transition-delay:.5s}div[id^=GPadvancedSearchPanel]{display:none;width:280px;vertical-align:top;overflow:hidden}form[id^=GPadvancedSearchForm]{max-height:220px;overflow-y:auto;padding-left:15px;padding-right:15px}.GPadvancedSearchCodeLabel,.GPadvancedSearchFilterLabel{max-width:105px}.GPadvancedSearchCode,.GPadvancedSearchCodeLabel,div[id^=GPadvancedSearchFilters]{margin-top:15px}.GPadvancedSearchFilterInput,.GPadvancedSearchFilterLabel{margin-bottom:5px}input[id^=GPadvancedSearchSubmit]{margin-top:10px;margin-bottom:15px}div[id^=GPautoCompleteList],div[id^=GPgeocodeResultsList]{width:280px}div[id^=GPautoCompleteList]{top:35px}div[id^=GPgeocodeResultsList]{display:none;position:absolute;top:40px;border-radius:4px;overflow:hidden}div[id^=GPgeocodeResults-]{background-color:#fff;max-height:140px;overflow-y:auto}#GPmapLoading{display:none;position:absolute;z-index:50;top:50%;left:50%;width:50px;height:50px;margin-top:-25px;margin-left:-25px}#GPmapLoading.GPmapLoadingVisible{display:block}#GPmapLoading{background-image:url(data:image/gif;base64,R0lGODlhNAA0AIQSAAFkpSZ5sAGV3k2Ruiao3kOj1/GUBk225pe/B4S83XrK75HH3qrS5szMzNbW1sHe797e3ubm5v///////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAQAfACwAAAAANAA0AAAF5uAnjmRpnmiqrmzrvnAsz3T9FXhh72Ke8zWfDzgT/ogxIw55cjgiJ6XOhKjaII1sNio8Vb8ImnbMXVLBVhl2vI2hvzIHOwt9veGxyLwhu4dlcw59bzVjgjNoPHU2f0yOj5CRkpMocg2HjwaaBitzm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AFc+AnjmRZGqhhrmyasrDounE7o/V64yvi6zuTb4gA0oTEn+lYSg5zSGcROpJOqVUntknc9rzgsHhMLhXOhTEaHV6vwW62N36G09tutbzM7/v/JhFlDYQNDmKFhYdeEYmFYA6OhIJbEJINYZdhlolkEA6UUCEAIfkEAQEAHwAsBAAEACcAGgAABXXgJ45kWSIoYq5sS6apK8swPN9mHeP8p6O9UmG4+qlMhmRryCwUa6uk1LBqMp9A5FQptBKDW2nX6+SFxSRyuXemjpvBz5lljYu2srX9vu/7/4CBgh8NhQ6DK4WKDYgkEIuGjSKQipKElIySj5CHlpSWIw6RoCEAOw==)}.GPpanel{box-shadow:0 0 6px #000;border-radius:4px}.GPpanelHeader{height:32px;padding:3px;background-color:#9db1bd;border-top-left-radius:4px;border-top-right-radius:4px}.GPpanelTitle{line-height:26px;border-top-left-radius:2px;border-top-right-radius:2px;background-color:#366291;color:#fff}.GPpanelClose{top:3px;right:3px;width:26px;height:26px;background-position:-26px 0}.GPshowAdvancedToolPicto{width:32px;height:32px;padding:3px;background-color:hsla(0,0%,100%,.4);border-radius:4px}.GPshowAdvancedToolPicto:hover{background-color:hsla(0,0%,100%,.6)}.GPshowAdvancedToolOpen{width:26px;height:26px;background-color:rgba(0,60,136,.5);border-radius:2px}.GPshowAdvancedToolPicto:hover .GPshowAdvancedToolOpen{background-color:rgba(0,60,136,.7)}input.GPinputSubmit{background-color:#366291}.GPshowMoreOptionsImage{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAA7ElEQVRIx+3UvUoDQRSG4ffMLhbaLIEFvQSxtN1ALiGymkswpZVoupS6Vt6BYBMWf+s0Kaa1FG9BEBYbDQRnj4UKqTRgtjtPeWaYb4YPBowxpmmyyKbs6PpJVCfVan3wOOzN5te2huVK692dq0jHn+abf53lFrqWMlKRfjKNxu1Bmf6M24MyTabRWEX6KKOlvRAgO77ZQ/UCqBDXdSqzmnAPbKDs+yK/XGrgV+jtNlrfAcn36BVxXX+y89BYh+kbrQ+JrgBiDbsva1SNdhhigi/yzBd5FmKCdfivQIDOYbk+3+HkrPds35kx5lef+y50/JHC/FoAAAAASUVORK5CYII=)}div[id^=GPAttribution-]{display:flex;bottom:8px;right:8px;width:calc(90% - 1.3em);z-index:1}div[id^=GPAttributionsListContainer-]{display:none;width:80%;height:80%;background:#fff;opacity:.5;border-radius:4px;z-index:0;position:absolute}div[id^=GPAttributionsListContainer-] ul{display:flex;margin:auto;list-style:none}label[id^=GPshowAttributionsListPicto-]{display:flex;z-index:auto;position:relative;margin-left:auto}input[id^=GPshowAttributionsList-]:checked+div[id^=GPAttributionsListContainer-]{display:flex}input[id^=GPshowAttributionsList-]:checked+div[id^=GPAttributionsListContainer-]+label[id^=GPshowAttributionsListPicto-]{background-color:transparent}span[id^=GPshowAttributionsListOpenClose-]{color:#fff;font-size:1.6em;font-weight:700;text-align:center;line-height:1.2em}div[id^=GPAttributionsListContainer-] li:before{content:" | "}div[id^=GPAttributionsListContainer-] ul li:first-child:before{content:""}div[id^=GPAttributionsListContainer-] a:link,div[id^=GPAttributionsListContainer-] a:visited{text-decoration:none}div[id^=GPboostRelief-]{top:8px;left:8px;z-index:1}label[id^=GPshowBoostReliefPicto-]{margin-left:auto}label[id^=GPshowBoostReliefListPicto-],label[id^=GPshowBoostReliefPicto-]{display:flex;z-index:1;position:relative}span[id^=GPshowBoostReliefOpenClose-]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAA5ElEQVRIx+2VTQ+CMBBE31Y0hnjz//9RDYwHi6nYLiVF4sE5Qd9OPwayNQBJARBgwMBTwcwUeQeMQADukR/MbKzxf0jSNLGm5y35W1H6no618vlODjGGt+KEn2KMJZ71AwRJMjOLrAdeE03jCb8CZ4dn/ZJk6fESA7mMW3kx4y3fwwyeJB0pSNJFUu/woj9kxgZ83Ra47/92dJ0Hlzazlv+1j9yGueUiX1+sqjs7Cj+Vf2nnXn2x16XXRUv+7jxe/jXdoFSbMptdfNnFc7y2riqd2gibeuDa77RUH/b8pa31NDW+B1R2l0Qaq9wyAAAAAElFTkSuQmCC)}.spanClose span[id^=GPshowBoostReliefOpenClose-]{background-position:0 0}.spanOpen span[id^=GPshowBoostReliefOpenClose-]{background-position:-26px 0}.GPlayerRelief input[type=range]::-webkit-slider-runnable-track{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=)}.GPlayerRelief input[type=range]::-moz-range-track{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=)}.GPlayerRelief input[type=range]::-ms-track{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=)}div[id^=GPbuildings-]{top:8px;right:8px;z-index:1;padding:3px;background-color:hsla(0,0%,100%,.4);border-radius:4px}label[id^=GPshowBuildingsPicto-]{display:flex;height:28px;width:28px;z-index:1;position:relative;margin-left:auto;width:26px;height:26px;background-color:rgba(0,60,136,.5);border-radius:2px}label[id^=GPshowBuildingsPicto-].buildingsOn{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAZS3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjaxZxZciu7jkX/OYoaQrInh8M24s2ghl8LJCXLkm3Z73zUcVxLllJMEM3GBghdNf73P1P9D/+Sc0E5H1PIIVz8c9llU3iSrv2vrN/6cuv3/qOc9/Tn19X9DcNLlke7/0zhXH97Xd8XuC2oL/+wUGrnjfr5jezO+ulpoXMjKxIZnvSzUD4LWbPf0GeBciQNOcXHLdSxH8/ntxr4T8mvedNJ3A/Pf7uI9rrnPtaYYbW9+G1s2gJY+c8oW3gS+K2t50LNi4X/5BVr9ZFEFPmFnu7/MhJNEdV9edEnq9yf6a9fV8/WcuZcYp+UHO6PX76utP/aKkv1D3d26Twzn18vU88t0ZP2l/JnT3PtmV0UF1B1OJu6bWU947rKLeTWSSFawDoBH0o8yk/mJ+HVDVfoV7sqP01nbTDX1E53XfTUYz023RDRmaFM5Ikxzdj1YrLRZNOs2M/Jj54m2my7TdiyYXbLq+Yui163zVdT626JO3fNpUazmLjAn3/UXz8wp4SC1le66wq5jBFlI4ZYTn5zGRbZdlixpx9+nv+JXS0W9KJlCZGMYuteonr9gQR2Gdpyoedxx6CO/SyAiri1RxhtsQBWIzZ00Fc0JmqNIhMGKohurDMVC2jvTUdI46wN2CYZuTUfiXpdarzhZcXrgBmW8MRXxDbZFozlnMd/okv4UPHWO+998NEnn30JNrjgQwgxCCiWaKNT0ccQY0wxx5JscsmnkGJKKaeSTbaAps8hx5xyzqVwz8LKhU8XLiilmmqrq17VUGNNNdfScJ/mmm+hxZZabqWbbjv40UOPPfXcy9ADVxpu+BFGHGnkITFipl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Omluc3RhbmNlSUQ9InhtcC5paWQ6ZTY5MGI1ZDctNjc4Mi00YmFlLTk3ZjEtMmMwNjQ2ODY4ODgxIgogICAgICBzdEV2dDpzb2Z0d2FyZUFnZW50PSJHaW1wIDIuMTAgKExpbnV4KSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMi0wNi0xNFQxNzo1MTozMCswMjowMCIvPgogICAgIDxyZGY6bGkKICAgICAgc3RFdnQ6YWN0aW9uPSJzYXZlZCIKICAgICAgc3RFdnQ6Y2hhbmdlZD0iLyIKICAgICAgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDo1MjAzZmE0Ny1kYTQ0LTQ0MmItODM3MS1hM2JkZDY2MmZjNTQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkdpbXAgMi4xMCAoTGludXgpIgogICAgICBzdEV2dDp3aGVuPSIyMDIyLTA2LTE1VDEyOjI2OjMxKzAyOjAwIi8+CiAgICA8L3JkZjpTZXE+CiAgIDwveG1wTU06SGlzdG9yeT4KICA8L3JkZjpEZXNjcmlwdGlvbj4KIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/PlXnzYgAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmBg8KGh/rWMUxAAAAyUlEQVRIx+1Wuw7CMAy0oyAGEAMb/P9PsnBdUsmynMS1YgQSt6Rtoju/YpfojyB4FREAdEWYOVUEDUREBcBDbd4jIjCwzJOZN3ItAK4/UU1uj9RmzTKoqPf3p4R2z07ZQhdPTiS8QtVIHslV3uz9jLwfXrHaI9AkvTNuj0ZWMjNri4+Eaxi6USO0vh0K3ShkqeWdgertzNpTT1HIDl4nIufG+YqEVBrD1tyYTcvIrCkjwkZ2E8/fXwxmmETyn71/gGVCAEr0clrYAONE4R0PSBonAAAAAElFTkSuQmCC)}label[id^=GPshowBuildingsPicto-].buildingsOff{background-image:url(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CiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkdpbXAgMi4xMCAoTGludXgpIgogICAgICBzdEV2dDp3aGVuPSIyMDIyLTA2LTE1VDEyOjI2OjMxKzAyOjAwIi8+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjM1MDAzNzUxLWE5ODYtNDk1Yy1iMThiLTA3NTMzNDY0ZmExMSIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChMaW51eCkiCiAgICAgIHN0RXZ0OndoZW49IjIwMjItMDYtMjlUMTU6Mjk6MDkrMDI6MDAiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+VUdqhwAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB+YGHQ0dCa+SbzYAAADhSURBVEjHxVZBDsMgDItZtB027QH9/w+3Sy/NLkVCESQZAuoLUithbJwEiIiQAgDQYCRaBNQUzVDHo05sHRgAeBRJTXlJnohos+yRApYSqaDcFxHp1n1ZagAgr0lEXitSxwC++rSeTT1pTGojnqVIF+yxiijjjhNeGnuJntPCUKkHKtehRJlEW1V+t2yKpDHVSGqVPdy6WTOJLcusFhQp6ksGH0dmjF57xgc7JI/Tsb2VLo88//d6265rSkfdi757R0ULenvtaNmbIZLG5Pi7AfhEJmroudWooxuA41+SlqIfMHbgRNt5fX8AAAAASUVORK5CYII=)}div[id^=GPlayerSwitcher-]{top:8px;right:8px;z-index:1}label[id^=GPshowLayersListPicto]{width:38px;height:38px}span[id^=GPshowLayersListClose],span[id^=GPshowLayersListOpen]{top:3px;left:3px;width:32px;height:32px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAACAklEQVRo3u3YsWsUQRgF8DMoBlFzikUQbMRGSG1xJ8QYWxFrMb3YpFI7g1jYibX4B4ilqI2EgIeVkE4sLCIWYmOCEVEUfxZ+J8uy5wVvZ3c192CbY/Z78958OzfzWq0xxhjjfwNmML1dxU9gFZvopCZro90wAxb8whomU5Hsw1V8wEfcwoEGiJ/EmzDgQmrhedRuBK7FXFYxkVp4D6fRwcO6jcDBzPzOJBdeMLZWI3AneB9VKrwJRuAovuA7ZkYttoiNjIDX6P5FnW6828cGFhMZ8CA47ta6+nV0AU7gBz7jSCUbX8Pa/1lw3Si78O6tGjFMeL9WAvHng+899pdVtBti8iKmcB3rGaFP4+ljPcZMFZjXw3yJ4nfiZfBeKtPVkzlReSOKOmIrY3o4W+I8L0fdV9iVor2GGdHviEErnkR48OzFu6h/LvUB449GVCk8w3czOJ5jR9nF+yv7GLOZ3+ewUvC95/eFFcxl3puNWr87ZcT5Hcan+OvrpHA3fxBazhmR74jCFQ/hy2UfhHAv6t1P2faDWnq+oCPyK95NdRbAcXzDVxyr4oIx1IgqhGc4nkTt21Xfs9tYKvo0BrT6UtlJEU5l9p5DdQUOtQQikfO9CJ4rTcjdKo3EcDHEv8WeJgWQyUPRyPnWwoCF1nZDXLQ2S8/5/jETpkdOesYYY4wi/ATOin+8BhQ7TwAAAABJRU5ErkJggg==)}span[id^=GPshowLayersListClose]{background-position:-32px 0}div[id^=GPlayerSwitcher-] input[type=checkbox]:checked+div+label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListOpen]{opacity:.7}div[id^=GPlayerSwitcher-] input[type=checkbox]:checked+div+label[id^=GPshowLayersListPicto] span[id^=GPshowLayersListClose]{background-color:rgba(0,60,136,.3)}div[id^=GPlayerSwitcher-] input[type=checkbox]:checked+div+label[id^=GPshowLayersListPicto] :hover span[id^=GPshowLayersListClose]{background-color:rgba(0,60,136,.4)}.GPlayerInfo,.GPlayerInfoOpened,.GPlayerRemove,.GPlayerVisibility,.GPshowLayerAdvancedTools{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAAAcCAYAAAD1EPTXAAAIgElEQVR42u2abWxT1xnHf8dOINhQXqpbRUEkiBECd0IghseLYhKhIAZkCIibfUFFQmpRPoAT8f62lQ8wSBaFJB/8CSEYIJoZglRKhFpFycgaJnspGZ1ZwoJITS23Fw2lyM40x/fsA7HLS4D4ha6p7u+Tfc699/Fzzv885znPNRgYGBgYGBgYGBgYGBgYGIwNhDEEBm+KnTt3zjWbzSuebotGo3+ura3952ifkTHWnL527Zr85ptvmDVrFkVFRWlbYDU1Ne+MGzduh5RyHZA/3NwLfBKJRBp37979bTr9WL7r8jumDHYg9XUg8gEk9Ar4RI+Kxs//sOnbsS5Qs9m8QkppF0LcAJBS2s1mM8CoBTrmIui2bdvkvXv3OHToUNoEevLkyXeBU8Ckl1zyWEq5taqqyp0Oe4X7Lr+LlK+0JyRbb1SXucfS3NTV1c0ymUwlUsoS4Fev8O8/QogOKeVnQojPnE7n39IWQc+dOyfb29vRNC3epigKRUVFbN68Oa2C9/v9MhAIcP/+fcLhMAAXLlwAICsrC7/fL2fMmCHSIM6PXrNYJwkhmurq6spTFemwOF9rTwqa7HsulY8lkQoh+qSUo7k0a1jEJcPXi5QjaF1dnfR6vaxZs4aioiK2b98e71NVFVVVcbvdOByOtAi1tbVVBgIB8vPzycvLo6WlhWAwSGtrK7m5uXzwwQf4fD5UVWXJkiVJ2aupqXknMzPzX8+vdKfTCUB9ff3zt3xnMplm79ixQ0t6WzfLF+zdOL4JAPu+y8/dIb8TJn32jd+Xayktir2X7ggp2/5t0Z3/+LD8v0/3/fzDpnHTwqZ6KURxx4myeT820WeMJoq5XC40TeP48ePEIlYsenV1dcmzZ88CcOLECVwuFwcOHJDHjh1LSjTBYFB6vV7C4TAlJSVkZ2eLWHtLSwsAb7/9NgAlJSV4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zBpvNxurVqxM6uCxatEjk5OTg8XgIBoMyFpVVVeXhw4cAzJw5k/z8fDRNY/LkyQSDQXnr1i1ycnKYP39+ogelq0nMwccpFGKSsCc+TlU0P2QOKoT4GngmgDzNhAkTGBwcfObalA5J7733HoqiUFtbSzgcRlVVzpw5Q0VFBVeuXBEOhwOXy4WqqgDU1taiKAoHDx5M6hS/YMECrFYrnZ2dRCIRFEWhu7ubR48eAbBq1Sq8Xm88Wnd2dmK1WhNeDACRSKQReJzA4A8MDQ01Jjt5elQkZA8YyBzKbEyHcH6oHFTX9a9jW/yECRNe6LdarfHUbDQCTagO2t7ejsPhQNO0Z/LLWB20paWFNWvWpK0O2t/fj6qq9PX1cfr0aSZOnMj69etRFAVFUbh79y75+flJ10GH/XIIIZpGMRZSSumoqqq6nIpf9j2XHFIwSnvC8ZfqTZdJI8W7m7KHhNkNkCGjjraa8mA6n9/Q0LBA1/VbU6dOZe7cuXR2djJnTgEAvb09LF++nDt37sQCzoLKysq/p1QHjVFVVSUAHA6H9Pl8z/TFDkfnz58X58+fT4ujK1euFLE3SV9++WU8/4zlN7G3V6m+SaqqqnLX1dWVCyFOvax+J4QY0HV9a6riBLhRXea277lULoU8BeJl9cIBKcXWdIsTYFiQhbwhTCbTA13XR3VI0nX9Qdoi6P+Tw4cPy5s3b/L+++9TXl7+Rn5zQ0ODEo1Gtwsh1gFzhpt7gatDQ0ONu3btephOe/b9TQrSvF1KnrEnEVczhzIb22p//ZAxysmTJ0OApbi4mLa2tngN9Kuv+om1AeHKykrrT0KgGzZskKFQiIaGBubNm2f8RfDHL9Bevv9H2Mvy+V6n01lgjJaBgYGBgYGBgYGBgYGBwU+F/wFeHcFLHB+SVgAAAABJRU5ErkJggg==)}.GPlayerOpacity input[type=range]::-webkit-slider-runnable-track{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=)}.GPlayerOpacity input[type=range]::-moz-range-track{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=)}.GPlayerOpacity input[type=range]::-ms-track{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAECAYAAAAZDrhMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAwSURBVDiNY/z379//v3//Mvz9+5fh379/DITYxKobKWYxMYwCisBoAFIIRgOQQgAADrTuhXfc36kAAAAASUVORK5CYII=)}div[id^=GPlayerInfoPanel]{right:190px}div[id^=GPlayerInfoTitle]{color:#366291;border-bottom:1px solid #366291}div[id^=GPlayerInfoQuicklook]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJTSURBVEiJ7ZZdSJNRGMd/59Vo9m6jQYKWRV/MQYGBXSStC2/S27YmXYfQZRexZiBhdNE2ke68qq5rY3rRjRFE1Du0KKIcwQYtaGpCH+r01ZrsPV2lc853c0IE+r87z3P+Px7OOc85B7adROFgcHDQAbRWYtR1fdTv9+vF8do1dCFanE7nU6vVagpbWFgglUq1A89NgQB2ux2Hw2EKVBRl45ypswqtq7BYM/oyD8emSE7rgMTVaKPTtac64E99mZtDKRZzeZobVABef55lPDPH6b2W+k0DH72aYjGX51rnEU4csAGQmJhnYCTNmx/qFSBa7DFdw+RXneYGdQUGcLLJxvF6C78M5VQpT5lNkebpzQJdjTaS0zqJifmVWGJynk/fflNXa7wr5Vm3htlsFsMwADjvtDCeEQyMpDm2bzcA6e85LLWwvy434vNFaqLRrnyhf03r9ff3q6qqthXGJhct9W9nrN1LeaUFoK7GeH/YujScmLWGhRCRl5YPl+nrM0oCNyN3INYL3AbxQAtd6AYhAWqqBX6JR14cOndpF8irB90f7Zl45AlssfW0oKdXIu8qQslshbOjba+SneIOxFavGSG6tKAn6u4ZCiBlsHCeFvKu85sd7AkgKg2ZAdCCnpCU3CtXodmNPaqFvF0rVfcMtyINbzlgRa139nrsDDL/DHCAzAL3twQE2kHYQWalFB1ayNuN4FbVwHjYewfkDSlFRzzsHXP3xI6C8rjU3LLv8l9poYurOywJguGjxCn5pz+HNncgFtkoVw2wCfBVUtWO/nP9AYuuwXn+Xm/WAAAAAElFTkSuQmCC)}div[id^=GPlayerInfoClose]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAgCAYAAAAFQMh/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGUSURBVEiJ7ZQxT8JQEMf/hxOsDg6GOGtiYgyy0I4Ormj8BBqpZW9HFhNxRKom8AU0tHFRRx1KYlwcQIkrzM4mGnoOtlJKsa/q2N/4ernfu97dAxISEhJ+CYkEyZq1y8w5O9NRUKk44VFMsm7VHIdf2kdb9aicM0JS8BkIuezH3PxgfekKd3cclEqaeQxQmYg2soXt10H74uGnvKkoMROveHFE2JHelusAkz9C0iwDINU9IErRYlTeyIr79vnNgtybBZB3j9ayhZ5b+S3cSvd9F2nY6a46+VfGEeqx1z9mlL9PmJqE4TsoFZSWps9BbHG4PPBdWBpT7Mkva8zOmJzZabYzT3uiUkBguCbUPAy5LMUsQGC4fEpvZdTgFyJanb5qfxKHSbkB4B6g/JccseQC4nCpne6W+gfKtX/V4sgjeyPppgGGb2VwaleLKkA8uphlAFB8WU/sw82JlviJHC4CHgG408oNO90pj6QAQGxXiyoRvPeZwfQclVcIWWspkm4a409lECZJNw1ZaynTYxISEhL+gU/lu7XSwAzyjAAAAABJRU5ErkJggg==)}.GPlayerInfoLink,.GPlayerInfoPopup{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJTSURBVEiJ7ZZdSJNRGMd/59Vo9m6jQYKWRV/MQYGBXSStC2/S27YmXYfQZRexZiBhdNE2ke68qq5rY3rRjRFE1Du0KKIcwQYtaGpCH+r01ZrsPV2lc853c0IE+r87z3P+Px7OOc85B7adROFgcHDQAbRWYtR1fdTv9+vF8do1dCFanE7nU6vVagpbWFgglUq1A89NgQB2ux2Hw2EKVBRl45ypswqtq7BYM/oyD8emSE7rgMTVaKPTtac64E99mZtDKRZzeZobVABef55lPDPH6b2W+k0DH72aYjGX51rnEU4csAGQmJhnYCTNmx/qFSBa7DFdw+RXneYGdQUGcLLJxvF6C78M5VQpT5lNkebpzQJdjTaS0zqJifmVWGJynk/fflNXa7wr5Vm3htlsFsMwADjvtDCeEQyMpDm2bzcA6e85LLWwvy434vNFaqLRrnyhf03r9ff3q6qqthXGJhct9W9nrN1LeaUFoK7GeH/YujScmLWGhRCRl5YPl+nrM0oCNyN3INYL3AbxQAtd6AYhAWqqBX6JR14cOndpF8irB90f7Zl45AlssfW0oKdXIu8qQslshbOjba+SneIOxFavGSG6tKAn6u4ZCiBlsHCeFvKu85sd7AkgKg2ZAdCCnpCU3CtXodmNPaqFvF0rVfcMtyINbzlgRa139nrsDDL/DHCAzAL3twQE2kHYQWalFB1ayNuN4FbVwHjYewfkDSlFRzzsHXP3xI6C8rjU3LLv8l9poYurOywJguGjxCn5pz+HNncgFtkoVw2wCfBVUtWO/nP9AYuuwXn+Xm/WAAAAAElFTkSuQmCC)}div[id^=GPminiglobeContainer-]{display:block;width:100px;height:100px;left:20px;bottom:20px;color:#fff}div[id^=GPmousePosition-]{bottom:8px;left:10px;z-index:2}span[id^=GPshowMousePositionOpen]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAaCAYAAAD43n+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD2SURBVFiF7ZbRDoIwDEUZ36oPRP9GMVF+k1c5vpQ4l24CFkfITsIDY2l70+6yqirsDITcdcSocxdQKHxhjTMEHIE7ED0CgAMuwNkyt7kgEfOUsJ0mSsRcZc9gLsoSoOWTG+C8707WfNqcNSfxRsmnA+qgMyOP1GjOSaxioCklKuyejRhJOtLLYyZI4muilosJC4y89957P2H/LMEJUapZaGzxpuAmrv3Gn0YuNIBFXZqaUMUodszNwjVbUWuQEDPatmrpueuOQu4fq+WoSbwD76uPas1BpwbgZJV/rctpI52KupmIaoHGMndh86wxcpZs1/4KO+UFLQ+rEigj9BAAAAAASUVORK5CYII=)}div[id^=GPmousePositionPanel-]{position:relative;left:0;top:0}div[id^=GPmousePositionPanelClose]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAaCAYAAAD43n+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD2SURBVFiF7ZbRDoIwDEUZ36oPRP9GMVF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F/GzqpJFSFyQ+s5kxVvYUZ53PNOFmDhtr3WP4EBADiNfKDf/zA73sKMog9eywFduwAws7GihF6iav8u5v/MEl9p0cP8n1mY2r+LcdoOMGPEWRUaRBy1P7r+8+fjKy96wp7XioDjK7OnXHOrE4FrJ/XRvxfoYzdj/k6JNfrYTYk++EcBxY9eny2bM2KpDo0gBM1aZ11xfORFj9ZZV4wAzs4/oluwXtQBv0nHe/P0vtav7HtF72tNo+O9eTSMTs8vX2DEWTWpAopUhjrrqti417GxEleHjXsdIU+dC/HIq4vPF7+wgne4gle4rp8J/rmsCjRV2DiZq6CpQvBymQtopMFeE2xfXL3sidWUW76A5R3fsL18o2XdRUZBoO3pw1QdGJNcvoNL1S+7p7KH1MNUGbAF//hUZVyvjKYKgbanDzN1wBpCyqHlmi2/OTzGw46QuocpA/+d+n1uXTyeGTbudUz9IfcYVQfGgkjZu6bD0PmojfJxJAhHrQX1zRt5PB3y1LmARxocLvXXq7WPOmHA77btB25q2ciEAUQjr9hrg5ei6WcohcPXnCAJwI5zDlVC8p7Ozft+2xHTFI7r1c/rI52FCMFZHfCbzqrJqH+sNSXVhJusKToyn+KIlxIpo0dIf/GOedfRu2Dd+tjQQDNJNZGhD7OZrz8XAbQLXDtpqQ6NGNX0pdKcfM3WNELJAURMBzmnTyHb9nskMdo0p95UPjW8E2Fyk9PIB5TQS2vJCoqJkYWmEiTCIsUAeHc0iWcArIti01Ujt89K/A+D1E+N+7GXOgAAAABJRU5ErkJggg==)}div[id^=GPscaleContainer-]{border:2px solid #fff;border-top:none;text-align:center;display:block;background-image:linear-gradient(hsla(0,0%,78.4%,.3),hsla(0,0%,78.4%,.3));height:18px;width:200px;color:#fff;font-family:Open Sans,sans-serif;font-size:16px;right:20px;bottom:20px} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/GpPluginItowns.js b/itowns-2.5.0-beta/dist/GpPluginItowns.js new file mode 100644 index 000000000..9094d27f9 --- /dev/null +++ b/itowns-2.5.0-beta/dist/GpPluginItowns.js @@ -0,0 +1,83 @@ +/*! + * @brief French Geoportal Extension for Itowns + * + * This software is released under the licence CeCILL-B (Free BSD compatible) + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * @see http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * @see http://www.cecill.info/ + * + * @copyright copyright (c) IGN + * @license CeCILL-B + * @author IGN + * @version 2.5.0-beta + * @date 21/09/2023 + * + */ +/*! + * Sortable -- JavaScript library for reorderable drag-and-drop lists on modern + * browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, + * React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap. + * + * Released under MIT LICENSE + * + * Copyright Lebedev Konstantin + * https://github.com/SortableJS/Sortable + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @version 1.14.0 + */ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.4 + */ +/*! + * @overview Proj4js - Javascript reprojection library. + * + * @authors + * - Mike Adair madairATdmsolutions.ca + * - Richard Greenwood richATgreenwoodmap.com + * - Didier Richard didier.richardATign.fr + * - Stephen Irons stephen.ironsATclear.net.nz + * - Olivier Terral oterralATgmail.com + * - Calvin Metcalf cmetcalfATappgeo.com + * + * @copyright Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/proj4js/proj4js/master/LICENSE.md + * @version 2.7.5 + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("itowns"),require("node-fetch"),require("xmldom")):"function"==typeof define&&define.amd?define("Gp",["itowns","require","require"],e):"object"==typeof exports?exports.Gp=e(require("itowns"),require("node-fetch"),require("xmldom")):t.Gp=e(t.itowns,t[void 0],t[void 0])}(this,(function(t,e,i){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=38)}([function(e,i){e.exports=t},function(t,e,i){"use strict";(function(t){var i={configuration:{},isConfigLoaded:function(){if(this.configuration&&0!==Object.keys(this.configuration).length)return!0;var e="undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==t?t:{};return!!(e.Gp&&e.Gp.Config&&e.Gp.Config.layers&&0!==Object.keys(e.Gp.Config.layers).length)&&(this.configuration=e.Gp.Config,!0)}};e.a=i}).call(this,i(5))},function(t){t.exports=JSON.parse('{"name":"geoportal-extensions","description":"French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries","version":"2.9.0","date":"21/09/2023","leafletExtName":"French Geoportal Extension for Leaflet","leafletExtVersion":"2.4.0-beta","olExtName":"French Geoportal Extension for OpenLayers","olExtVersion":"3.4.0-beta","itownsExtName":"French Geoportal Extension for Itowns","itownsExtVersion":"2.5.0-beta","main":"dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js","types":"dist/leaflet/index.d.ts, dist/openlayers/index.d.ts, dist/itowns/index.d.ts","module":"src/Leaflet/index.js, src/OpenLayers/index.js, src/Itowns/index.js","directories":{},"scripts":{"setup":"npm install","clean":"echo \\"Warning: target not yet implemented!\\" && exit 0","eslint":"eslint src/","test":"npm run test:serve","test:serve":"cd test && webpack-dev-server --hot --config webpack.test.serve.js","sample":"npm run sample:serve","sample:serve":"npm run sample:ol:serve","sample:itowns:serve":"webpack-dev-server --config build/webpack/webpack.config.itowns --mode=development --https --open-page samples/index-itowns-map.html --content-base . --output-public-path \'/dist/itowns/\' --port 9001 --open","sample:leaflet:serve":"webpack-dev-server --config build/webpack/webpack.config.leaflet --mode=development --https --open-page samples/index-leaflet-map.html --content-base . --output-public-path \'/dist/leaflet/\' --port 9001 --open","sample:ol:serve":"webpack-dev-server --config build/webpack/webpack.config.openlayers --mode=development --https --open-page samples/index-openlayers-map.html --content-base . --output-public-path \'/dist/openlayers/\' --port 9001 --open","generate-types:ol":"npx tsc -p build/types/tsconfig-openlayers.json","generate-types:leaflet":"npx tsc -p build/types/tsconfig-leaflet.json","generate-types:itowns":"npx tsc -p build/types/tsconfig-itowns.json","generate-jsdoc:ol":"jsdoc -c build/jsdoc/jsdoc-openlayers.json","generate-jsdoc:leaflet":"jsdoc -c build/jsdoc/jsdoc-leaflet.json","generate-jsdoc:itowns":"jsdoc -c build/jsdoc/jsdoc-itowns.json","doc":"npm run doc:serve","doc:serve":"npm run doc:ol:serve","doc:itowns:serve":"webpack-dev-server --hot --config build/webpack/webpack.config.itowns --content-base jsdoc/itowns --port 9001 --open","doc:leaflet:serve":"webpack-dev-server --hot --config build/webpack/webpack.config.leaflet --content-base jsdoc/leaflet --port 9001 --open","doc:ol:serve":"webpack-dev-server --hot --config build/webpack/webpack.config.openlayers --content-base jsdoc/openlayers --port 9001 --open","build:dev":"npm-run-all --print-label --print-name build:*:dev","build:prod":"npm-run-all --print-label --print-name build:*:prod","build:src":"npm-run-all --print-label --print-name build:*:src","build":"npm-run-all --print-label --print-name build:*:*","build:itowns":"npm-run-all --print-label --print-name build:itowns:*","build:itowns:dev":"webpack --config build/webpack/webpack.config.itowns --mode=development","build:itowns:prod":"webpack --config build/webpack/webpack.config.itowns --mode=production","build:itowns:src":"webpack --config build/webpack/webpack.config.itowns --mode=none","build:ol":"npm-run-all --print-label --print-name build:ol:*","build:ol:dev":"webpack --config build/webpack/webpack.config.openlayers --mode=development","build:ol:prod":"webpack --config build/webpack/webpack.config.openlayers --mode=production","build:ol:src":"webpack --config build/webpack/webpack.config.openlayers --mode=none","build:leaflet":"npm-run-all --print-label --print-name build:leaflet:*","build:leaflet:dev":"webpack --config build/webpack/webpack.config.leaflet --mode=development","build:leaflet:prod":"webpack --config build/webpack/webpack.config.leaflet --mode=production","build:leaflet:src":"webpack --config build/webpack/webpack.config.leaflet --mode=none"},"repository":{"type":"git","url":"https://github.com/IGNF/geoportal-extensions.git"},"author":"IGNF","keywords":["geoportail","javascript","OpenLayers","Leaflet","Itowns","3D"],"license":"CECILL-B","bugs":{"url":"https://github.com/IGNF/geoportal-extensions/issues"},"homepage":"https://github.com/IGNF/geoportal-extensions#readme","dependencies":{"@mapbox/mapbox-gl-style-spec":"13.20.1","eventbusjs":"0.2.0","geoportal-access-lib":"https://raw.githubusercontent.com/IGNF/geoportal-access-lib/release-3.4.0-beta/geoportal-access-lib-3.4.0-beta.tgz","itowns":"2.38.2","leaflet":"1.7.1","leaflet-draw":"1.0.4","loglevel":"^1.6.7","markdown-toc":"^1.2.0","ol":"6.9.0","ol-mapbox-style":"6.7.0","proj4":"2.7.5","proj4leaflet":"1.0.2","sortablejs":"1.14.0","three":"0.137.5","typescript":"^4.5.5","whatwg-fetch":"3.0.0"},"devDependencies":{"@babel/core":"^7.4.4","@babel/plugin-transform-template-literals":"^7.7.4","@babel/preset-env":"^7.4.4","babel-loader":"^8.0.5","chai":"^4.2.0","chalk":"^4.0.0","clean-webpack-plugin":"^3.0.0","copy-webpack-plugin":"^5.0.3","core-js":"^3.6.4","css-loader":"^3.4.2","eslint":"^6.8.0","eslint-config-standard":"^14.1.1","eslint-loader":"^4.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0","exports-loader":"^0.7.0","expose-loader":"^0.7.5","fs-extra":"^9.0.0","handlebars":"^4.7.5","handlebars-layouts":"^3.1.4","html-webpack-plugin":"^4.0.4","jsdoc-webpack-plugin":"^0.3.0","mini-css-extract-plugin":"^0.9.0","mocha":"^7.1.1","mocha-loader":"^5.0.0","npm-run-all":"^4.1.5","optimize-css-assets-webpack-plugin":"^5.0.1","path":"^0.12.7","replace-bundle-webpack-plugin":"^1.0.0","requirejs":"^2.3.6","responsive-loader":"^1.2.0","speed-measure-webpack-plugin":"^1.3.0","string-template":"^1.0.0","style-loader":"^1.1.3","terser-webpack-plugin":"^2.0.0","url-loader":"^4.0.0","webpack":"^4.30.0","webpack-cli":"^3.3.1","webpack-dev-server":"^3.3.1","webpack-node-externals":"^1.7.2"}}')},function(t,e,i){var n,r;!function(s,o){"use strict";void 0===(r="function"==typeof(n=function(){var t=function(){},e="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function n(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(e){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function r(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(i){return"debug"===i&&(i="log"),"undefined"!=typeof console&&("trace"===i&&e?r:void 0!==console[i]?n(console,i):void 0!==console.log?n(console,"log"):t)}function o(e,n){for(var r=0;r=0&&e<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(r=e,!1!==n&&function(t){var e=(i[t]||"silent").toUpperCase();if("undefined"!=typeof window&&a){try{return void(window.localStorage[a]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(t){}}}(e),o.call(s,e,t),"undefined"==typeof console&&e=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},v.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(m.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},v.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},v.prototype.number=function(t){if(!g.test(t)){if(m.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},v.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},v.prototype.keyword=function(t){if(f.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!m.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},v.prototype.neutral=function(t){if(p.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(g.test(t))return this.word=t,void(this.state=3);if(!m.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},v.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(r),r};function M(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?M[t]=u(arguments[1]):M[t]=b(arguments[1]):M[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?M.apply(e,t):M(t)}));if("string"==typeof t){if(t in M)return M[t]}else"EPSG"in t?M["EPSG:"+t.EPSG]=t:"ESRI"in t?M["ESRI:"+t.ESRI]=t:"IAU2000"in t?M["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(M);var w=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],E=["3857","900913","3785","102113"];function S(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in M}(t))return M[t];if(function(t){return w.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=b(t);if(function(t){var e=c(t,"authority");if(e){var i=c(e,"epsg");return i&&E.indexOf(i)>-1}}(e))return M["EPSG:3857"];var i=function(t){var e=c(t,"extension");if(e)return c(e,"proj4")}(e);return i?u(i):e}return function(t){return"+"===t[0]}(t)?u(t):void 0}var T=function(t,e){var i,n;if(t=t||{},!e)return t;for(n in e)void 0!==(i=e[n])&&(t[n]=i);return t},C=function(t,e,i){var n=t*e;return i/Math.sqrt(1-n*n)},P=function(t){return t<0?-1:1},R=function(t){return Math.abs(t)<=o?t:t-P(t)*s},A=function(t,i,n){var r=t*n,s=.5*t;return r=Math.pow((1-r)/(1+r),s),Math.tan(.5*(e-i))/r},L=function(t,i){for(var n,r,s=.5*t,o=e-2*Math.atan(i),a=0;a<=15;a++)if(n=t*Math.sin(o),o+=r=e-2*Math.atan(i*Math.pow((1-n)/(1+n),s))-o,Math.abs(r)<=1e-10)return o;return-9999};function I(t){return t}var D=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var i,s,o=t.x,a=t.y;if(a*n>90&&a*n<-90&&o*n>180&&o*n<-180)return null;if(Math.abs(Math.abs(a)-e)<=1e-10)return null;if(this.sphere)i=this.x0+this.a*this.k0*R(o-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(r+.5*a));else{var l=Math.sin(a),h=A(this.e,a,l);i=this.x0+this.a*this.k0*R(o-this.long0),s=this.y0-this.a*this.k0*Math.log(h)}return t.x=i,t.y=s,t},inverse:function(t){var i,n,r=t.x-this.x0,s=t.y-this.y0;if(this.sphere)n=e-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var o=Math.exp(-s/(this.a*this.k0));if(-9999===(n=L(this.e,o)))return null}return i=R(this.long0+r/(this.a*this.k0)),t.x=i,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:I,inverse:I,names:["longlat","identity"]}],N={},O=[];function G(t,e){var i=O.length;return t.names?(O[i]=t,t.names.forEach((function(t){N[t.toLowerCase()]=i})),this):(console.log(e),!0)}var k={start:function(){D.forEach(G)},add:G,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==N[e]&&O[N[e]]?O[N[e]]:void 0}},U={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},B=U.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};U.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var z={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},F={};function V(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:F[t]||null,isNull:!1}}function H(t){return t/3600*Math.PI/180}function W(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function j(t){return t.map((function(t){return[H(t.longitudeShift),H(t.latitudeShift)]}))}function q(t,e,i){return{name:W(t,e+8,e+16).trim(),parent:W(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function X(t,e,i,n){for(var r=e+176,s=[],o=0;o3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=2,l.datum_params[3]*=t,l.datum_params[4]*=t,l.datum_params[5]*=t,l.datum_params[6]=l.datum_params[6]/1e6+1))),a&&(l.datum_type=3,l.grids=a),l.a=n,l.b=r,l.es=s,l.ep2=o,l}(n.datumCode,n.datum_params,f.a,f.b,m.es,m.ep2,g);T(this,n),T(this,r),this.a=f.a,this.b=f.b,this.rf=f.rf,this.sphere=f.sphere,this.es=m.es,this.e=m.e,this.ep2=m.ep2,this.datum=v,this.init(),i(null,this)}else i(e)}else i(e)}function J(t,i,n){var r,s,o,a,l=t.x,h=t.y,c=t.z?t.z:0;if(h<-e&&h>-1.001*e)h=-e;else if(h>e&&h<1.001*e)h=e;else{if(h<-e)return{x:-1/0,y:-1/0,z:t.z};if(h>e)return{x:1/0,y:1/0,z:t.z}}return l>Math.PI&&(l-=2*Math.PI),s=Math.sin(h),a=Math.cos(h),o=s*s,{x:((r=n/Math.sqrt(1-i*o))+c)*a*Math.cos(l),y:(r+c)*a*Math.sin(l),z:(r*(1-i)+c)*s}}function Z(t,e,i,n){var r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_=t.x,x=t.y,b=t.z?t.z:0;if(r=Math.sqrt(_*_+x*x),s=Math.sqrt(_*_+x*x+b*b),r/i<1e-12){if(v=0,s/i<1e-12)return y=-n,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(x,_);o=b/s,u=(a=r/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),d=o*l,g=0;do{g++,h=e*(c=i/Math.sqrt(1-e*d*d))/(c+(y=r*u+b*d-c*(1-e*d*d))),m=(f=o*(l=1/Math.sqrt(1-h*(2-h)*a*a)))*u-(p=a*(1-h)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(f/Math.abs(p)),z:y}}function K(t){return 1===t||2===t}Y.projections=k,Y.projections.start();var Q=function(t,e,i){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return i;if(5===t.datum_type||5===e.datum_type)return i;var n=t.a,r=t.es;if(3===t.datum_type){if(0!==$(t,!1,i))return;n=6378137,r=.0066943799901413165}var s=e.a,o=e.b,a=e.es;return 3===e.datum_type&&(s=6378137,o=6356752.314,a=.0066943799901413165),r!==a||n!==s||K(t.datum_type)||K(e.datum_type)?(i=J(i,r,n),K(t.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+a*t.z)+n,y:h*(l*t.x+t.y-o*t.z)+r,z:h*(-a*t.x+o*t.y+t.z)+s}}}(i,t.datum_type,t.datum_params)),K(e.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6],c=(t.x-n)/h,u=(t.y-r)/h,d=(t.z-s)/h;return{x:c+l*u-a*d,y:-l*c+u+o*d,z:a*c-o*u+d}}}(i,e.datum_type,e.datum_params)),i=Z(i,a,s,o),3!==e.datum_type||0===$(e,!0,i)?i:void 0):i};function $(t,e,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},s={x:Number.NaN,y:Number.NaN},o=[],a=0;ar.y||u>r.x||f1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=R(s.x+i.ll[0]),n.y=s.y+i.ll[1]}else isNaN(s.x)||(n.x=t.x+s.x,n.y=t.y+s.y);return n}function et(t,e){var i,n={x:t.x/e.del[0],y:t.y/e.del[1]},r=Math.floor(n.x),s=Math.floor(n.y),o=n.x-1*r,a=n.y-1*s,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;i=s*e.lim[0]+r;var h=e.cvs[i][0],c=e.cvs[i][1];i++;var u=e.cvs[i][0],d=e.cvs[i][1];i+=e.lim[0];var p=e.cvs[i][0],f=e.cvs[i][1];i--;var m=e.cvs[i][0],g=e.cvs[i][1],v=o*a,y=o*(1-a),_=(1-o)*(1-a),x=(1-o)*a;return l.x=_*h+y*u+x*m+v*p,l.y=_*c+y*d+x*g+v*f,l}var it=function(t,e,i){var n,r,s,o=i.x,a=i.y,l=i.z||0,h={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==i.z)switch(0===s?(n=o,r=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(n=a,r=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(n=l,r="z"),t.axis[s]){case"e":h[r]=n;break;case"w":h[r]=-n;break;case"n":h[r]=n;break;case"s":h[r]=-n;break;case"u":void 0!==i[r]&&(h.z=n);break;case"d":void 0!==i[r]&&(h.z=-n);break;default:return null}return h},nt=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function rt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function st(t,e,r,s){var o;if(Array.isArray(r)&&(r=nt(r)),function(t){rt(t.x),rt(t.y)}(r),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(r=st(t,o=new Y("WGS84"),r,s),t=o),s&&"enu"!==t.axis&&(r=it(t,!1,r)),"longlat"===t.projName)r={x:r.x*i,y:r.y*i,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=Q(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*n,y:r.y*n,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),s&&"enu"!==e.axis?it(e,!0,r):r}var ot=Y("WGS84");function at(t,e,i,n){var r,s,o;return Array.isArray(i)?(r=st(t,e,i,n)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(i.splice(3)):[r.x,r.y,i[2]].concat(i.splice(3)):[r.x,r.y].concat(i.splice(2)):[r.x,r.y]):(s=st(t,e,i,n),2===(o=Object.keys(i)).length||o.forEach((function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;s[n]=i[n]})),s)}function lt(t){return t instanceof Y?t:t.oProj?t.oProj:Y(t)}function ht(t,e,i){t=lt(t);var n,r=!1;return void 0===e?(e=t,t=ot,r=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=ot,r=!0),e=lt(e),i?at(t,e,i):(n={forward:function(i,n){return at(t,e,i,n)},inverse:function(i,n){return at(e,t,i,n)}},r&&(n.oProj=e),n)}var ct=65,ut=73,dt=79,pt={forward:ft,inverse:function(t){var e=yt(xt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:mt};function ft(t,e){return e=e||5,function(t,e){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g="00000"+t.easting,v="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,u=t.northing,d=t.zoneNumber,p=_t(d),f=Math.floor(c/1e5),m=Math.floor(u/1e5)%20,i=f,n=m,s="AJSAJS".charCodeAt(r=p-1),o="AFAFAF".charCodeAt(r),h=!1,(a=s+i-1)>90&&(a=a-90+ct-1,h=!0),(a===ut||sut||(a>ut||sdt||(a>dt||s90&&(a=a-90+ct-1),(l=o+n)>86?(l=l-86+ct-1,h=!0):h=!1,(l===ut||out||(l>ut||odt||(l>dt||o86&&(l=l-86+ct-1),String.fromCharCode(a)+String.fromCharCode(l))+g.substr(g.length-5,e)+v.substr(v.length-5,e)}(function(t){var e,i,n,r,s,o,a,l=t.lat,h=t.lon,c=6378137,u=gt(l),d=gt(h);a=Math.floor((h+180)/6)+1,180===h&&(a=60),l>=56&&l<64&&h>=3&&h<12&&(a=32),l>=72&&l<84&&(h>=0&&h<9?a=31:h>=9&&h<21?a=33:h>=21&&h<33?a=35:h>=33&&h<42&&(a=37)),o=gt(6*(a-1)-180+3),e=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),n=.006739496752268451*Math.cos(u)*Math.cos(u),r=Math.cos(u)*(d-o),s=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p,f,m=.9996*e*(r+(1-i+n)*r*r*r/6+(5-18*i+i*i+72*n-.39089081163157013)*r*r*r*r*r/120)+5e5,g=.9996*(s+e*Math.tan(u)*(r*r/2+(5-i+9*n+4*n*n)*r*r*r*r/24+(61-58*i+i*i+600*n-2.2240339282485886)*r*r*r*r*r*r/720));return l<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(m),zoneNumber:a,zoneLetter:(p=l,f="Z",84>=p&&p>=72?f="X":72>p&&p>=64?f="W":64>p&&p>=56?f="V":56>p&&p>=48?f="U":48>p&&p>=40?f="T":40>p&&p>=32?f="S":32>p&&p>=24?f="R":24>p&&p>=16?f="Q":16>p&&p>=8?f="P":8>p&&p>=0?f="N":0>p&&p>=-8?f="M":-8>p&&p>=-16?f="L":-16>p&&p>=-24?f="K":-24>p&&p>=-32?f="J":-32>p&&p>=-40?f="H":-40>p&&p>=-48?f="G":-48>p&&p>=-56?f="F":-56>p&&p>=-64?f="E":-64>p&&p>=-72?f="D":-72>p&&p>=-80&&(f="C"),f)}}({lat:t[1],lon:t[0]}),e)}function mt(t){var e=yt(xt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function gt(t){return t*(Math.PI/180)}function vt(t){return t/Math.PI*180}function yt(t){var e=t.northing,i=t.easting,n=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var s,o,a,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,g=e;n<"N"&&(g-=1e7),c=6*(r-1)-180+3,d=(u=g/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),s=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),a=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*s);var v=d-s*Math.tan(d)/l*(h*h/2-(5+3*o+10*a-4*a*a-.06065547077041606)*h*h*h*h/24+(61+90*o+298*a+45*o*o-1.6983531815716497-3*a*a)*h*h*h*h*h*h/720);v=vt(v);var y,_=(h-(1+2*o+a)*h*h*h/6+(5-2*a+28*o-3*a*a+.05391597401814761+24*o*o)*h*h*h*h*h/120)/Math.cos(d);if(_=c+vt(_),t.accuracy){var x=yt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:x.lat,right:x.lon,bottom:v,left:_}}else y={lat:v,lon:_};return y}function _t(t){var e=t%6;return 0===e&&(e=6),e}function xt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,n=null,r="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;r+=e,s++}var o=parseInt(r,10);if(0===s||s+3>i)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;n=t.substring(s,s+=2);for(var l=_t(o),h=function(t,e){for(var i="AJSAJS".charCodeAt(e-1),n=1e5,r=!1;i!==t.charCodeAt(0);){if(++i===ut&&i++,i===dt&&i++,i>90){if(r)throw"Bad character: "+t;i=ct,r=!0}n+=1e5}return n}(n.charAt(0),l),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i="AFAFAF".charCodeAt(e-1),n=0,r=!1;i!==t.charCodeAt(0);){if(++i===ut&&i++,i===dt&&i++,i>86){if(r)throw"Bad character: "+t;i=ct,r=!0}n+=1e5}return n}(n.charAt(1),l);c0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),v=parseFloat(f)*d),{easting:g+h,northing:v+c,zoneLetter:a,zoneNumber:o,accuracy:d}}function bt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Mt(t,e,i){if(!(this instanceof Mt))return new Mt(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Mt.fromMGRS=function(t){return new Mt(mt(t))},Mt.prototype.toMGRS=function(t){return ft([this.x,this.y],t)};var wt=.01068115234375,Et=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*wt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*wt)));var i=t*t;return e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,e[3]=i*(.3645833333333333-.005696614583333333*t),e[4]=i*t*.3076171875,e},St=function(t,e,i,n){return i*=e,e*=e,n[0]*t-i*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))},Tt=function(t,e,i){for(var n=1/(1-e),r=t,s=20;s;--s){var o=Math.sin(r),a=1-e*o*o;if(r-=a=(St(r,o,Math.cos(r),i)-t)*(a*Math.sqrt(a))*n,Math.abs(a)<1e-10)return r}return r},Ct={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Et(this.es),this.ml0=St(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,i,n,r=t.x,s=t.y,o=R(r-this.long0),a=Math.sin(s),l=Math.cos(s);if(this.es){var h=l*o,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>1e-10?Math.tan(s):0,f=Math.pow(p,2),m=Math.pow(f,2);e=1-this.es*Math.pow(a,2),h/=Math.sqrt(e);var g=St(s,a,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+m+14*u-58*f*u+c/42*(61+179*m-m*f-479*f)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+a*o*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+m-58*f+270*u-330*f*u+c/56*(1385+543*m-m*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,n=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(n))>=1){if(v-1>1e-10)return 93;n=0}else n=Math.acos(n);s<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=i,t.y=n,t},inverse:function(t){var i,n,r,s,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(i=this.ml0+a/this.k0,n=Tt(i,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,u=this.ep2*Math.pow(h,2),d=Math.pow(u,2),p=Math.pow(c,2),f=Math.pow(p,2);i=1-this.es*Math.pow(l,2);var m=o*Math.sqrt(i)/this.k0,g=Math.pow(m,2);r=n-(i*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*u*p+u-4*d-g/30*(61+90*p-252*u*p+45*f+46*u-g/56*(1385+3633*p+4095*f+1574*f*p)))),s=R(this.long0+m*(1-g/6*(1+2*p+u-g/20*(5+28*p+24*f+8*u*p+6*u-g/42*(61+662*p+1320*f+720*f*p))))/h)}else r=e*P(a),s=0;else{var v=Math.exp(o/this.k0),y=.5*(v-1/v),_=this.lat0+a/this.k0,x=Math.cos(_);i=Math.sqrt((1-Math.pow(x,2))/(1+Math.pow(y,2))),r=Math.asin(i),a<0&&(r=-r),s=0===y&&0===x?0:R(Math.atan2(y,x)+this.long0)}return t.x=s,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Pt=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Rt=function(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),n=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(n,2))},At=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}(e*(1+e/(Rt(1,e)+1))),t<0?-e:e},Lt=function(t,e){for(var i,n=2*Math.cos(2*e),r=t.length-1,s=t[r],o=0;--r>=0;)i=n*s-o+t[r],o=s,s=i;return e+i*Math.sin(2*e)},It=function(t,e,i){for(var n,r,s=Math.sin(e),o=Math.cos(e),a=Pt(i),l=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(i),h=2*o*l,c=-2*s*a,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)n=f,r=p,d=h*(f=d)-n-c*(p=m)+t[u],m=c*f-r+h*p;return[(h=s*l)*d-(c=o*a)*m,h*m+c*d]},Dt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ct.init.apply(this),this.forward=Ct.forward,this.inverse=Ct.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),i*=e,this.cgb[1]=i*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i*=e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),i*=e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(e*(-24832/14175)-2.4)),i*=e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i*=e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),i*=e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i*=e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i*=e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i*=e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var n=Lt(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var i,n=2*Math.cos(e),r=t.length-1,s=t[r],o=0;--r>=0;)i=n*s-o+t[r],o=s,s=i;return Math.sin(e)*i}(this.gtu,2*n))},forward:function(t){var e=R(t.x-this.long0),i=t.y;i=Lt(this.cbg,i);var n=Math.sin(i),r=Math.cos(i),s=Math.sin(e),o=Math.cos(e);i=Math.atan2(n,o*r),e=Math.atan2(s*r,Rt(n,r*o)),e=At(Math.tan(e));var a,l,h=It(this.gtu,2*i,2*e);return i+=h[0],e+=h[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,i,n=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(r=(r-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var s=It(this.utg,2*r,2*n);r+=s[0],n+=s[1],n=Math.atan(Pt(n));var o=Math.sin(r),a=Math.cos(r),l=Math.sin(n),h=Math.cos(n);r=Math.atan2(o*h,Rt(l,h*a)),n=Math.atan2(l,h*a),e=R(n+this.long0),i=Lt(this.cgb,r)}else e=1/0,i=1/0;return t.x=e,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Nt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(R(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*i,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Dt.init.apply(this),this.forward=Dt.forward,this.inverse=Dt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},Ot=function(t,e){return Math.pow((1-t)/(1+t),e)},Gt={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+r)/(Math.pow(Math.tan(.5*this.lat0+r),this.C)*Ot(this.e*t,this.ratexp))},forward:function(t){var i=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+r),this.C)*Ot(this.e*Math.sin(n),this.ratexp))-e,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,n=t.y,s=Math.pow(Math.tan(.5*n+r)/this.K,1/this.C),o=20;o>0&&(n=2*Math.atan(s*Ot(this.e*Math.sin(t.y),-.5*this.e))-e,!(Math.abs(n-t.y)<1e-14));--o)t.y=n;return o?(t.x=i,t.y=n,t):null},names:["gauss"]},kt={init:function(){Gt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,i,n,r;return t.x=R(t.x-this.long0),Gt.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),n=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*n),t.x=r*i*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*i*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,i,n,r,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),i=Math.cos(o),r=Math.asin(i*this.sinc0+t.y*e*this.cosc0/s),n=Math.atan2(t.x*e,s*this.cosc0*i-t.y*this.sinc0*e)}else r=this.phic0,n=0;return t.x=n,t.y=r,Gt.inverse.apply(this,[t]),t.x=R(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Ut={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+P(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/A(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=C(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-e,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,n,r,s,o,a,l=t.x,h=t.y,c=Math.sin(h),u=Math.cos(h),d=R(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=1e-10&&Math.abs(h+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(d)),t.x=this.a*i*u*Math.sin(d)+this.x0,t.y=this.a*i*(this.coslat0*c-this.sinlat0*u*Math.cos(d))+this.y0,t):(n=2*Math.atan(this.ssfn_(h,c,this.e))-e,s=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(o=A(this.e,h*this.con,this.con*c),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(l-this.long0),t.y=this.y0-this.con*a*Math.cos(l-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(i=2*this.a*this.k0/(1+s*Math.cos(d)),t.y=i*r):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*s*Math.cos(d))),t.y=i*(this.cosX0*r-this.sinX0*s*Math.cos(d))+this.y0),t.x=i*s*Math.sin(d)+this.x0,t))},inverse:function(t){var i,n,r,s,o;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var l=2*Math.atan(a/(2*this.a*this.k0));return i=this.long0,n=this.lat0,a<=1e-10?(t.x=i,t.y=n,t):(n=Math.asin(Math.cos(l)*this.sinlat0+t.y*Math.sin(l)*this.coslat0/a),i=Math.abs(this.coslat0)<1e-10?this.lat0>0?R(this.long0+Math.atan2(t.x,-1*t.y)):R(this.long0+Math.atan2(t.x,t.y)):R(this.long0+Math.atan2(t.x*Math.sin(l),a*this.coslat0*Math.cos(l)-t.y*this.sinlat0*Math.sin(l))),t.x=i,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return n=this.lat0,i=this.long0,t.x=i,t.y=n,t;t.x*=this.con,t.y*=this.con,r=a*this.cons/(2*this.a*this.k0),n=this.con*L(this.e,r),i=this.con*R(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,a<=1e-10?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+t.y*Math.sin(s)*this.cosX0/a),i=R(this.long0+Math.atan2(t.x*Math.sin(s),a*this.cosX0*Math.cos(s)-t.y*this.sinX0*Math.sin(s)))),n=-1*L(this.e,Math.tan(.5*(e+o)));return t.x=i,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,i,n){return i*=n,Math.tan(.5*(e+t))*Math.pow((1-i)/(1+i),.5*n)}},Bt={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,n=1/this.rf,r=2*n-Math.pow(n,2),s=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+i)+this.K,r=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,i=t.y-this.y0,n=e/this.R,r=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(r))),a=this.lambda0+o/this.alpha,l=0,h=s,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=h,t},names:["somerc"]},zt={init:function(){var t,n,o,a,l,h,c,u,d,p,f,m,g,v=0,y=0,_=0,x=0,b=0,M=0,w=0;this.no_off=(g="object"==typeof(m=this).PROJECTION?Object.keys(m.PROJECTION)[0]:m.PROJECTION,"no_uoff"in m||"no_off"in m||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var E=!1;"alpha"in this&&(E=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),E&&(w=this.alpha),S&&(v=this.rectified_grid_angle*i),E||S)y=this.longc;else if(_=this.long1,b=this.lat1,x=this.long2,M=this.lat2,Math.abs(b-M)<=1e-7||(t=Math.abs(b))<=1e-7||Math.abs(t-e)<=1e-7||Math.abs(Math.abs(this.lat0)-e)<=1e-7||Math.abs(Math.abs(M)-e)<=1e-7)throw new Error;var T=1-this.es;n=Math.sqrt(T),Math.abs(this.lat0)>1e-10?(u=Math.sin(this.lat0),o=Math.cos(this.lat0),t=1-this.es*u*u,this.B=o*o,this.B=Math.sqrt(1+this.es*this.B*this.B/T),this.A=this.B*this.k0*n/t,(l=(a=this.B*n/(o*Math.sqrt(t)))*a-1)<=0?l=0:(l=Math.sqrt(l),this.lat0<0&&(l=-l)),this.E=l+=a,this.E*=Math.pow(A(this.e,this.lat0,u),this.B)):(this.B=1/n,this.A=this.k0,this.E=a=l=1),E||S?(E?(f=Math.asin(Math.sin(w)/a),S||(v=w)):(f=v,w=Math.asin(a*Math.sin(f))),this.lam0=y-Math.asin(.5*(l-1/l)*Math.tan(f))/this.B):(h=Math.pow(A(this.e,b,Math.sin(b)),this.B),c=Math.pow(A(this.e,M,Math.sin(M)),this.B),l=this.E/h,d=(c-h)/(c+h),p=((p=this.E*this.E)-c*h)/(p+c*h),(t=_-x)<-Math.pi?x-=s:t>Math.pi&&(x+=s),this.lam0=R(.5*(_+x)-Math.atan(p*Math.tan(.5*this.B*(_-x))/d)/this.B),f=Math.atan(2*Math.sin(this.B*R(_-this.lam0))/(l-1/l)),v=w=Math.asin(a*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(w))),this.lat0<0&&(this.u_0=-this.u_0)),l=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(r-l)),this.v_pole_s=this.ArB*Math.log(Math.tan(r+l))},forward:function(t){var i,n,r,s,o,a,l,h,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-e)>1e-10){if(i=.5*((o=this.E/Math.pow(A(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/o)),n=.5*(o+a),s=Math.sin(this.B*t.x),r=(i*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;h=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*t.x),l=Math.abs(a)<1e-7?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+s*this.singam,a)}else h=t.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(c.x=l,c.y=h):(l-=this.u_0,c.x=h*this.cosrot+l*this.sinrot,c.y=l*this.cosrot-h*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var i,n,r,s,o,a,l,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,i=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=.5*((r=Math.exp(-this.BrA*n))-1/r),o=.5*(r+1/r),l=((a=Math.sin(this.BrA*i))*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(l)-1)<1e-10)h.x=0,h.y=l<0?-e:e;else{if(h.y=this.E/Math.sqrt((1+l)/(1-l)),h.y=L(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(s*this.cosgam-a*this.singam,Math.cos(this.BrA*i))}return h.x+=this.lam0,h},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Ft={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),n=C(this.e,e,i),r=A(this.e,this.lat1,e),s=Math.sin(this.lat2),o=Math.cos(this.lat2),a=C(this.e,s,o),l=A(this.e,this.lat2,s),h=A(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(n/a)/Math.log(r/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=P(n)*(e-2e-10));var r,s,o=Math.abs(Math.abs(n)-e);if(o>1e-10)r=A(this.e,n,Math.sin(n)),s=this.a*this.f0*Math.pow(r,this.ns);else{if((o=n*this.ns)<=0)return null;s=0}var a=this.ns*R(i-this.long0);return t.x=this.k0*(s*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,t},inverse:function(t){var i,n,r,s,o,a=(t.x-this.x0)/this.k0,l=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(a*a+l*l),n=1):(i=-Math.sqrt(a*a+l*l),n=-1);var h=0;if(0!==i&&(h=Math.atan2(n*a,n*l)),0!==i||this.ns>0){if(n=1/this.ns,r=Math.pow(i/(this.a*this.f0),n),-9999===(s=L(this.e,r)))return null}else s=-e;return o=R(h/this.ns+this.long0),t.x=o,t.y=s,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"]},Vt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y,c=R(l-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),n=-c*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),s=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(r)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,i,n,r,s,o,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),i=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(e)),t.x=this.long0-i/this.alfa,o=e,a=0;var h=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(a=1),o=t.y,h+=1}while(0===a&&h<15);return h>=15?null:t},names:["Krovak","krovak"]},Ht=function(t,e,i,n,r){return t*r-e*Math.sin(2*r)+i*Math.sin(4*r)-n*Math.sin(6*r)},Wt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},jt=function(t){return.375*t*(1+.25*t*(1+.46875*t))},qt=function(t){return.05859375*t*t*(1+.75*t)},Xt=function(t){return t*t*t*(35/3072)},Yt=function(t,e,i){var n=e*i;return t/Math.sqrt(1-n*n)},Jt=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e},$t={init:function(){var t,i=Math.abs(this.lat0);if(Math.abs(i-e)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Qt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,i=[];return i[0]=.3333333333333333*t,e=t*t,i[0]+=.17222222222222222*e,i[1]=.06388888888888888*e,e*=t,i[0]+=.10257936507936508*e,i[1]+=.0664021164021164*e,i[2]=.016415012942191543*e,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Qt(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,n,s,o,a,l,h,c,u,d,p=t.x,f=t.y;if(p=R(p-this.long0),this.sphere){if(a=Math.sin(f),d=Math.cos(f),s=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+d*s:1+this.sinph0*a+this.cosph0*d*s)<=1e-10)return null;i=(n=Math.sqrt(2/n))*d*Math.sin(p),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*d*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(f+this.lat0)<1e-10)return null;n=r-.5*f,i=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(p),n*=s}}else{switch(h=0,c=0,u=0,s=Math.cos(p),o=Math.sin(p),a=Math.sin(f),l=Qt(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(h=l/this.qp,c=Math.sqrt(1-h*h)),this.mode){case this.OBLIQ:u=1+this.sinb1*h+this.cosb1*c*s;break;case this.EQUIT:u=1+c*s;break;case this.N_POLE:u=e+f,l=this.qp-l;break;case this.S_POLE:u=f-e,l=this.qp+l}if(Math.abs(u)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),n=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*h-this.sinb1*c*s):(u=Math.sqrt(2/(1+c*s)))*h*this.ymf,i=this.xmf*u*c*o;break;case this.N_POLE:case this.S_POLE:l>=0?(i=(u=Math.sqrt(l))*o,n=s*(this.mode===this.S_POLE?u:-u)):i=n=0}}return t.x=this.a*i+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,n,r,s,o,a,l,h,c,u,d=t.x/this.a,p=t.y/this.a;if(this.sphere){var f,m=0,g=0;if((n=.5*(f=Math.sqrt(d*d+p*p)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(n),m=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(f)<=1e-10?0:Math.asin(p*g/f),d*=g,p=m*f;break;case this.OBLIQ:n=Math.abs(f)<=1e-10?this.lat0:Math.asin(m*this.sinph0+p*g*this.cosph0/f),d*=g*this.cosph0,p=(m-Math.sin(n)*this.sinph0)*f;break;case this.N_POLE:p=-p,n=e-n;break;case this.S_POLE:n-=e}i=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,p):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,p*=this.dd,(a=Math.sqrt(d*d+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;s=2*Math.asin(.5*a/this.rq),r=Math.cos(s),d*=s=Math.sin(s),this.mode===this.OBLIQ?(l=r*this.sinb1+p*s*this.cosb1/a,o=this.qp*l,p=a*this.cosb1*r-p*this.sinb1*s):(l=p*s/a,o=this.qp*l,p=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(o=d*d+p*p))return t.x=this.long0,t.y=this.lat0,t;l=1-o/this.qp,this.mode===this.S_POLE&&(l=-l)}i=Math.atan2(d,p),h=Math.asin(l),c=this.apa,u=h+h,n=h+c[0]*Math.sin(u)+c[1]*Math.sin(u+u)+c[2]*Math.sin(u+u+u)}return t.x=R(this.long0+i),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},te=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)},ee={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=C(this.e3,this.sin_po,this.cos_po),this.qs1=Qt(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=C(this.e3,this.sin_po,this.cos_po),this.qs2=Qt(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Qt(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var n=Qt(this.e3,this.sin_phi,this.cos_phi),r=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*R(e-this.long0),o=r*Math.sin(s)+this.x0,a=this.rh-r*Math.cos(s)+this.y0;return t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),r=0,0!==e&&(r=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(i=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,i)),s=R(r/this.ns0+this.long0),t.x=s,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var i,n,r,s,o=te(.5*e);if(t<1e-10)return o;for(var a=t*t,l=1;l<=25;l++)if(o+=s=.5*(r=1-(n=t*(i=Math.sin(o)))*n)*r/Math.cos(o)*(e/(1-a)-i/r+.5/t*Math.log((1-n)/(1+n))),Math.abs(s)<=1e-7)return o;return null}},ie={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y;return n=R(l-this.long0),e=Math.sin(h),i=Math.cos(h),r=Math.cos(n),(s=this.sin_p14*e+this.cos_p14*i*r)>0||Math.abs(s)<=1e-10?(o=this.x0+1*this.a*i*Math.sin(n)/s,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*r)/s):(o=this.x0+this.infinity_dist*i*Math.sin(n),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*r)),t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),i=Math.sin(r),n=Math.cos(r),o=te(n*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i),s=R(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t},names:["gnom"]},ne={init:function(){this.sphere||(this.k0=C(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,i,n=t.x,r=t.y,s=R(n-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var o=Qt(this.e,Math.sin(r));e=this.x0+this.a*this.k0*s,i=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=i,t},inverse:function(t){var i,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=R(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,i){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-n)<1e-6)return i<0?-1*e:e;for(var r,s,o,a,l=Math.asin(.5*i),h=0;h<30;h++)if(s=Math.sin(l),o=Math.cos(l),a=t*s,l+=r=Math.pow(1-a*a,2)/(2*o)*(i/(1-t*t)-s/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return l;return NaN}(this.e,2*t.y*this.k0/this.a),i=R(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=n,t},names:["cea"]},re={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,i=t.y,n=R(e-this.long0),r=Jt(i-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*r,t},inverse:function(t){var e=t.x,i=t.y;return t.x=R(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Jt(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},se={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wt(this.es),this.e1=jt(this.es),this.e2=qt(this.es),this.e3=Xt(this.es),this.ml0=this.a*Ht(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,n,r=t.x,s=t.y,o=R(r-this.long0);if(n=o*Math.sin(s),this.sphere)Math.abs(s)<=1e-10?(e=this.a*o,i=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(s),i=this.a*(Jt(s-this.lat0)+(1-Math.cos(n))/Math.tan(s)));else if(Math.abs(s)<=1e-10)e=this.a*o,i=-1*this.ml0;else{var a=Yt(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(n),i=this.a*Ht(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(n))}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){var e,i,n,r,s,o,a,l,h;if(n=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=1e-10)e=R(n/this.a+this.long0),i=0;else{var c;for(o=this.lat0+r/this.a,a=n*n/this.a/this.a+o*o,l=o,s=20;s;--s)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+a)*c)/((l-o)/c-1),Math.abs(h)<=1e-10){i=l;break}e=R(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(r+this.ml0)<=1e-10)i=0,e=R(this.long0+n/this.a);else{var u,d,p,f,m;for(o=(this.ml0+r)/this.a,a=n*n/this.a/this.a+o*o,l=o,s=20;s;--s)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*Ht(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(o*(u*(f=d/this.a)+1)-f-.5*u*(f*f+a))/(this.es*Math.sin(2*l)*(f*f+a-2*o*f)/(4*u)+(o-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=1e-10){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=R(this.long0+Math.asin(n*u/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},names:["Polyconic","poly"]},oe={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var i,n=e.x,r=e.y-this.lat0,s=n-this.long0,o=r/t*1e-5,a=s,l=1,h=0;for(i=1;i<=10;i++)l*=o,h+=this.A[i]*l;var c,u=h,d=a,p=1,f=0,m=0,g=0;for(i=1;i<=6;i++)c=f*u+p*d,p=p*u-f*d,f=c,m=m+this.B_re[i]*p-this.B_im[i]*f,g=g+this.B_im[i]*p+this.B_re[i]*f;return e.x=g*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var i,n,r=e.x,s=e.y,o=r-this.x0,a=(s-this.y0)/this.a,l=o/this.a,h=1,c=0,u=0,d=0;for(i=1;i<=6;i++)n=c*a+h*l,h=h*a-c*l,c=n,u=u+this.C_re[i]*h-this.C_im[i]*c,d=d+this.C_im[i]*h+this.C_re[i]*c;for(var p=0;p.999999999999&&(i=.999999999999),e=Math.asin(i);var n=R(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var r=Math.asin(i);return t.x=n,t.y=r,t},names:["Mollweide","moll"]},ce={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wt(this.es),this.e1=jt(this.es),this.e2=qt(this.es),this.e3=Xt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=C(this.e,this.sinphi,this.cosphi),this.ml1=Ht(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=C(this.e,this.sinphi,this.cosphi),this.ml2=Ht(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Ht(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,i=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var r=Ht(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-r)}var s=this.ns*R(i-this.long0),o=this.x0+e*Math.sin(s),a=this.y0+this.rh-e*Math.cos(s);return t.x=o,t.y=a,t},inverse:function(t){var e,i,n,r;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(0!==i&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return r=R(this.long0+s/this.ns),n=Jt(this.g-i/this.a),t.x=r,t.y=n,t;var o=this.g-i/this.a;return n=Zt(o,this.e0,this.e1,this.e2,this.e3),r=R(this.long0+s/this.ns),t.x=r,t.y=n,t},names:["Equidistant_Conic","eqdc"]},ue={init:function(){this.R=this.a},forward:function(t){var i,n,r=t.x,s=t.y,o=R(r-this.long0);Math.abs(s)<=1e-10&&(i=this.x0+this.R*o,n=this.y0);var a=te(2*Math.abs(s/Math.PI));(Math.abs(o)<=1e-10||Math.abs(Math.abs(s)-e)<=1e-10)&&(i=this.x0,n=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var l=.5*Math.abs(Math.PI/o-o/Math.PI),h=l*l,c=Math.sin(a),u=Math.cos(a),d=u/(c+u-1),p=d*d,f=d*(2/c-1),m=f*f,g=Math.PI*this.R*(l*(d-m)+Math.sqrt(h*(d-m)*(d-m)-(m+h)*(p-m)))/(m+h);o<0&&(g=-g),i=this.x0+g;var v=h+d;return g=Math.PI*this.R*(f*v-l*Math.sqrt((m+h)*(h+1)-v*v))/(m+h),n=s>=0?this.y0+g:this.y0-g,t.x=i,t.y=n,t},inverse:function(t){var e,i,n,r,s,o,a,l,h,c,u,d;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(n=t.x/u)*n+(r=t.y/u)*r,u=3*(r*r/(l=-2*(o=-Math.abs(r)*(1+s))+1+2*r*r+s*s)+(2*(a=o-2*r*r+n*n)*a*a/l/l/l-9*o*a/l/l)/27)/(h=(o-a*a/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=t.y>=0?(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(n)<1e-10?this.long0:R(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(n*n-r*r)+s*s))/2/n),t.x=e,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},de={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_,x,b,M,w,E=t.x,S=t.y,T=Math.sin(t.y),C=Math.cos(t.y),P=R(E-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(e-S)*Math.sin(P),t.y=this.y0-this.a*(e-S)*Math.cos(P),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(e+S)*Math.sin(P),t.y=this.y0+this.a*(e+S)*Math.cos(P),t):(_=this.sin_p12*T+this.cos_p12*C*Math.cos(P),y=(v=Math.acos(_))?v/Math.sin(v):1,t.x=this.x0+this.a*y*C*Math.sin(P),t.y=this.y0+this.a*y*(this.cos_p12*T-this.sin_p12*C*Math.cos(P)),t):(i=Wt(this.es),n=jt(this.es),r=qt(this.es),s=Xt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(o=this.a*Ht(i,n,r,s,e),a=this.a*Ht(i,n,r,s,S),t.x=this.x0+(o-a)*Math.sin(P),t.y=this.y0-(o-a)*Math.cos(P),t):Math.abs(this.sin_p12+1)<=1e-10?(o=this.a*Ht(i,n,r,s,e),a=this.a*Ht(i,n,r,s,S),t.x=this.x0+(o+a)*Math.sin(P),t.y=this.y0+(o+a)*Math.cos(P),t):(l=T/C,h=Yt(this.a,this.e,this.sin_p12),c=Yt(this.a,this.e,T),u=Math.atan((1-this.es)*l+this.es*h*this.sin_p12/(c*C)),x=0===(d=Math.atan2(Math.sin(P),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(P)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(d)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(P)*Math.cos(u)/Math.sin(d)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),v=h*x*(1-(b=x*x)*(g=(f=this.e*this.cos_p12*Math.cos(d)/Math.sqrt(1-this.es))*f)*(1-g)/6+(M=b*x)/8*(m=p*f)*(1-2*g)+(w=M*x)/120*(g*(4-7*g)-3*p*p*(1-7*g))-w*x/48*m),t.x=this.x0+v*Math.sin(d),t.y=this.y0+v*Math.cos(d),t))},inverse:function(t){var i,n,r,s,o,a,l,h,c,u,d,p,f,m,g,v,y,_,x,b,M,w,E;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*e*this.a)return;return n=i/this.a,r=Math.sin(n),s=Math.cos(n),o=this.long0,Math.abs(i)<=1e-10?a=this.lat0:(a=te(s*this.sin_p12+t.y*r*this.cos_p12/i),l=Math.abs(this.lat0)-e,o=Math.abs(l)<=1e-10?this.lat0>=0?R(this.long0+Math.atan2(t.x,-t.y)):R(this.long0-Math.atan2(-t.x,t.y)):R(this.long0+Math.atan2(t.x*r,i*this.cos_p12*s-t.y*this.sin_p12*r))),t.x=o,t.y=a,t}return h=Wt(this.es),c=jt(this.es),u=qt(this.es),d=Xt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*Ht(h,c,u,d,e),i=Math.sqrt(t.x*t.x+t.y*t.y),a=Zt((p-i)/this.a,h,c,u,d),o=R(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*Ht(h,c,u,d,e),i=Math.sqrt(t.x*t.x+t.y*t.y),a=Zt((i-p)/this.a,h,c,u,d),o=R(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),g=Math.atan2(t.x,t.y),f=Yt(this.a,this.e,this.sin_p12),v=Math.cos(g),_=-(y=this.e*this.cos_p12*v)*y/(1-this.es),x=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),w=1-_*(M=(b=i/f)-_*(1+_)*Math.pow(b,3)/6-x*(1+3*_)*Math.pow(b,4)/24)*M/2-b*M*M*M/6,m=Math.asin(this.sin_p12*Math.cos(M)+this.cos_p12*Math.sin(M)*v),o=R(this.long0+Math.asin(Math.sin(g)*Math.sin(M)/Math.cos(m))),E=Math.sin(m),a=Math.atan2((E-this.es*w*this.sin_p12)*Math.tan(m),E*(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]},pe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,i,n,r,s,o,a,l=t.x,h=t.y;return n=R(l-this.long0),e=Math.sin(h),i=Math.cos(h),r=Math.cos(n),((s=this.sin_p14*e+this.cos_p14*i*r)>0||Math.abs(s)<=1e-10)&&(o=1*this.a*i*Math.sin(n),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*r)),t.x=o,t.y=a,t},inverse:function(t){var i,n,r,s,o,a,l;return t.x-=this.x0,t.y-=this.y0,i=Math.sqrt(t.x*t.x+t.y*t.y),n=te(i/this.a),r=Math.sin(n),s=Math.cos(n),a=this.long0,Math.abs(i)<=1e-10?(l=this.lat0,t.x=a,t.y=l,t):(l=te(s*this.sin_p14+t.y*r*this.cos_p14/i),o=Math.abs(this.lat0)-e,Math.abs(o)<=1e-10?(a=this.lat0>=0?R(this.long0+Math.atan2(t.x,-t.y)):R(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=l,t):(a=R(this.long0+Math.atan2(t.x*r,i*this.cos_p14*s-t.y*this.sin_p14*r)),t.x=a,t.y=l,t))},names:["ortho"]},fe=1,me=2,ge=3,ve=4,ye=5,_e=6,xe=1,be=2,Me=3,we=4;function Ee(t,i,n,s){var a;return t<1e-10?(s.value=xe,a=0):(a=Math.atan2(i,n),Math.abs(a)<=r?s.value=xe:a>r&&a<=e+r?(s.value=be,a-=e):a>e+r||a<=-(e+r)?(s.value=Me,a=a>=0?a-o:a+o):(s.value=we,a+=e)),a}function Se(t,e){var i=t+e;return i<-o?i+=s:i>+o&&(i-=s),i}var Te,Ce={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=e-r/2?this.face=ye:this.lat0<=-(e-r/2)?this.face=_e:Math.abs(this.long0)<=r?this.face=fe:Math.abs(this.long0)<=e+r?this.face=this.long0>0?me:ve:this.face=ge,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,n,s,a,l,h,c={x:0,y:0},u={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===ye)a=e-i,n>=r&&n<=e+r?(u.value=xe,s=n-e):n>e+r||n<=-(e+r)?(u.value=be,s=n>0?n-o:n+o):n>-(e+r)&&n<=-r?(u.value=Me,s=n+e):(u.value=we,s=n);else if(this.face===_e)a=e+i,n>=r&&n<=e+r?(u.value=xe,s=-n+e):n=-r?(u.value=be,s=-n):n<-r&&n>=-(e+r)?(u.value=Me,s=-n-e):(u.value=we,s=n>0?-n+o:-n-o);else{var d,p,f,m,g,v;this.face===me?n=Se(n,+e):this.face===ge?n=Se(n,+o):this.face===ve&&(n=Se(n,-e)),m=Math.sin(i),g=Math.cos(i),v=Math.sin(n),d=g*Math.cos(n),p=g*v,f=m,this.face===fe?s=Ee(a=Math.acos(d),f,p,u):this.face===me?s=Ee(a=Math.acos(p),f,-d,u):this.face===ge?s=Ee(a=Math.acos(-d),f,-p,u):this.face===ve?s=Ee(a=Math.acos(-p),f,d,u):(a=s=0,u.value=xe)}return h=Math.atan(12/o*(s+Math.acos(Math.sin(s)*Math.cos(r))-e)),l=Math.sqrt((1-Math.cos(a))/(Math.cos(h)*Math.cos(h))/(1-Math.cos(Math.atan(1/Math.cos(s))))),u.value===be?h+=e:u.value===Me?h+=o:u.value===we&&(h+=1.5*o),c.x=l*Math.cos(h),c.y=l*Math.sin(h),c.x=c.x*this.a+this.x0,c.y=c.y*this.a+this.y0,t.x=c.x,t.y=c.y,t},inverse:function(t){var i,n,r,s,a,l,h,c,u,d,p,f,m={lam:0,phi:0},g={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?g.value=xe:t.y>=0&&t.y>=Math.abs(t.x)?(g.value=be,i-=e):t.x<0&&-t.x>=Math.abs(t.y)?(g.value=Me,i=i<0?i+o:i-o):(g.value=we,i+=e),u=o/12*Math.tan(i),a=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),l=Math.atan(a),(h=1-(r=Math.cos(i))*r*(s=Math.tan(n))*s*(1-Math.cos(Math.atan(1/Math.cos(l)))))<-1?h=-1:h>1&&(h=1),this.face===ye)c=Math.acos(h),m.phi=e-c,g.value===xe?m.lam=l+e:g.value===be?m.lam=l<0?l+o:l-o:g.value===Me?m.lam=l-e:m.lam=l;else if(this.face===_e)c=Math.acos(h),m.phi=c-e,g.value===xe?m.lam=-l+e:g.value===be?m.lam=-l:g.value===Me?m.lam=-l-e:m.lam=l<0?-l-o:-l+o;else{var v,y,_;u=(v=h)*v,y=(u+=(_=u>=1?0:Math.sqrt(1-u)*Math.sin(l))*_)>=1?0:Math.sqrt(1-u),g.value===be?(u=y,y=-_,_=u):g.value===Me?(y=-y,_=-_):g.value===we&&(u=y,y=_,_=-u),this.face===me?(u=v,v=-y,y=u):this.face===ge?(v=-v,y=-y):this.face===ve&&(u=v,v=y,y=-u),m.phi=Math.acos(-_)-e,m.lam=Math.atan2(y,v),this.face===me?m.lam=Se(m.lam,-e):this.face===ge?m.lam=Se(m.lam,-o):this.face===ve&&(m.lam=Se(m.lam,+e))}return 0!==this.es&&(d=m.phi<0?1:0,p=Math.tan(m.phi),f=this.b/Math.sqrt(p*p+this.one_minus_f_squared),m.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),d&&(m.phi=-m.phi)),m.lam+=this.long0,t.x=m.lam,t.y=m.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Pe=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Re=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ae=n/5,Le=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},Ie={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=R(t.x-this.long0),i=Math.abs(t.y),r=Math.floor(i*Ae);r<0?r=0:r>=18&&(r=17);var s={x:Le(Pe[r],i=n*(i-.08726646259971647*r))*e,y:Le(Re[r],i)};return t.y<0&&(s.y=-s.y),s.x=s.x*this.a*.8487+this.x0,s.y=s.y*this.a*1.3523+this.y0,s},inverse:function(t){var n={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(n.y>=1)n.x/=Pe[18][0],n.y=t.y<0?-e:e;else{var r=Math.floor(18*n.y);for(r<0?r=0:r>=18&&(r=17);;)if(Re[r][0]>n.y)--r;else{if(!(Re[r+1][0]<=n.y))break;++r}var s=Re[r],o=5*(n.y-s[0])/(Re[r+1][0]-s[0]);o=function(t,e,i,n){for(var r=e;n;--n){var s=t(r);if(r-=s,Math.abs(s)1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=function(t,e,i){for(var n=[],r=0;r1)for(var i=1;i0?s.replace("%var%",r.join(" - ")):s.replace("%var%","%var% (not specified)")}catch(t){}return s}},u={normalyzeParameters:function(t){var e=null;if(t){var i=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r||(r=""),i.push(n+"="+r)}e=i.join("&")}return e},normalyzeUrl:function(t,e,i){var n=t;if(t){var r=t.indexOf("?");-1===r&&(n+="?"),-1!==r&&r!==t.length-1&&(n+="&")}return e&&(n+="string"==typeof e?e:this.normalyzeParameters(e)),i&&(n=encodeURIComponent(n)),n},indent:function(t,e){return new Array((t||0)+1).join("\t")+e}},d=i(9),p=i.n(d),f={call:function(t){var e=h.getLogger("XHR");if(e.trace("[XHR::call()]"),p.a.polyfill(),!t.url)throw new Error("missing parameter : url is not defined !");if(!t.method)throw new Error("missing parameter : method is not defined !");t.format||(t.format="text");var i={};switch(i.url=t.url,i.data=t.data?t.data:null,i.method=t.method,i.timeOut=t.timeOut||0,i.scope=t.scope||this,i.proxy=t.proxy||null,i.content=t.content||null,i.headers=t.headers||{referer:"http://localhost"},t.method){case"DELETE":case"GET":break;case"PUT":case"POST":i.content=t.content?t.content:"application/x-www-form-urlencoded",i.headers=t.headers?t.headers:{referer:"http://localhost"};break;case"HEAD":case"OPTIONS":throw new Error("HTTP method not yet supported !");default:throw new Error("HTTP method unknown !")}switch(t.format){case"text":this.__call(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;case"json":this.__callJSON(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;case"xml":this.__callXML(i).then((function(i){e.trace(i),t.onResponse.call(this,i)})).catch((function(e){t.onFailure.call(this,e)}));break;default:throw new Error("This output Format is not yet supported !")}},__call:function(t){var e=h.getLogger("XHR");return e.trace("[XHR::__call()]"),new Promise((function(n,r){var s="POST"===t.method||"PUT"===t.method?1:0;t.data&&("object"==typeof t.data&&Object.keys(t.data).length||"string"==typeof t.data&&t.data.length)&&!s&&("Geocode"===t.scope.CLASSNAME||"ReverseGeocode"===t.scope.CLASSNAME?t.url=t.url+t.data:t.url=u.normalyzeUrl(t.url,t.data)),e.trace("URL = ",t.url);var o=null;if("undefined"==typeof window){var a=i(6),l={headers:{Referer:"https://localhost"}};return t.data&&"string"==typeof t.data&&s&&(l={method:t.method,body:t.data,headers:{"Content-Type":t.content,Referer:"https://localhost"}}),a(t.url,l).then((function(t){if(t.ok)n(t.text());else{var e="Errors Occured on Http Request (status : '"+t.statusText+"' | url : '"+t.url+"')",i=t.status;r({message:e,status:i})}})).catch((function(t){r({message:t,status:-1})}))}if(window.XMLHttpRequest){e.trace("XMLHttpRequest"),(o=new XMLHttpRequest).open(t.method,t.url,!0),o.overrideMimeType=t.content;var h=null;t.timeOut>0&&(e.trace("XHR - TimeOut actif !"),h=window.setTimeout((function(){r({message:"TimeOut Occured on Http Request with XMLHttpRequest !",status:-1})}),t.timeOut)),s&&(e.trace("data = ",t.data),o.setRequestHeader("Content-type",t.content)),o.onerror=function(t){console.log(t),r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},o.ontimeout=function(t){console.log(t),r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},o.onreadystatechange=function(t){if(4===o.readyState)if(200===o.status)window.clearTimeout(h),n(o.response);else{var e="Errors Occured on Http Request (status : '"+t.target.statusText+"' | url : '"+t.target.responseURL+"' | response : '"+t.target.response+"')",i=t.target.status;r({message:e,status:i})}};var c=t.data&&s?t.data:null;o.send(c)}else{if(!window.XDomainRequest)throw new Error("CORS not supported");e.trace("XDomainRequest"),(o=new XDomainRequest).open(t.method,t.url),o.overrideMimeType=t.content,t.timeOut>0&&(o.timeout=t.timeout,e.trace("XHR - TimeOut actif !")),s&&o.setRequestHeader("Content-type",t.content),o.onerror=function(){r(new Error("Errors Occured on Http Request with XMLHttpRequest !"))},o.ontimeout=function(){r(new Error("TimeOut Occured on Http Request with XMLHttpRequest !"))},o.onload=function(t){if(200===o.status)n(o.responseText);else{var e="Errors Occured on Http Request (status : '"+t.target.statusText+"' | url : '"+t.target.responseURL+"')",i=t.target.status;r({message:e,status:i})}};var d=t.data&&s?t.data:null;o.send(d)}}))},__callJSON:function(t){return this.__call(t).then(JSON.parse).catch((function(e){console.log("_callJSON failed on : ",t.url,e)}))},__callXML:function(t){return this.__call(t).then((function(t){var e;"undefined"==typeof window?e=(new(0,i(7).DOMParser)).parseFromString(t,"text/xml"):window.DOMParser?e=(new window.DOMParser).parseFromString(t,"text/xml"):((e=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,e.loadXML(t));return e})).catch((function(e){console.log("__callXML failed on : ",t.url,e)}))}},m={uuid:(n=Math.floor(Date.now()),function(){return n++}),call:function(t){var e=h.getLogger("JSONP");if(e.trace("[JSONP::call ()]"),!t)throw e.error("missing parameter : options !"),new Error("missing parameter : options !");if(!t.url)throw e.error("missing parameter : options.url !"),new Error("missing parameter : options.url !");if(t.timeOut||(e.info("setting 'options.timeOut' default value"),t.timeOut=0),!t.onResponse)throw e.error("missing parameter : options.onResponse !"),new Error("missing parameter : options.onResponse !");var i="string"==typeof t.callbackSuffix?t.callbackSuffix:this.uuid(),n=!1,r=!1,s=t.url.indexOf("callback=");if(-1!==s){n=!0;var o=t.url.indexOf("&",s);-1===o&&(o=t.url.length);var a=t.url.substring(s+9,o);a&&(r=!0,t.callbackName=a,e.info("setting 'options.callbackName' value ("+t.callbackName+") from 'options.url' parameter"))}if(!n){var l=t.url.indexOf("?");-1===l?t.url=t.url+"?callback=":l===t.url.length?t.url=t.url+"callback=":t.url=t.url+"&callback=",e.info("setting callback default key in 'options.url' : "+t.url)}var c=!!t.callbackName||r;if(r||(t.callbackName||(e.info("setting 'options.callbackName' default value"),t.callbackName="callback",(i||""===i)&&(t.callbackName+=i)),t.url=t.url.replace("callback=","callback="+t.callbackName),e.info("setting callback function name in 'options.url' : "+t.url)),t.onTimeOut||(e.info("setting 'options.onTimeOut' default value"),t.onTimeOut=function(){console.log("TimeOut while invoking url : "+t.url)}),!c){var u=this,d=null;t.timeOut>0&&(d=window.setTimeout((function(){window[t.callbackName]=function(){},t.onTimeOut(),u._deleteScript(i)}),t.timeOut)),window[t.callbackName]=function(e){window.clearTimeout(d),t.onResponse(e),u._deleteScript(i)}}this._createScript(i,t.url)},_createScript:function(t,e){var i,n=document.getElementById("results"+t);(i=document.createElement("script")).setAttribute("type","text/javascript"),i.setAttribute("src",e),i.setAttribute("charset","UTF-8"),i.setAttribute("id","results"+t),i.setAttribute("async","true");var r=document.documentElement||document.getElementsByTagName("head")[0];null===n?r.appendChild(i):r.replaceChild(i,n)},_deleteScript:function(t){var e=document.getElementById("results"+t);if(e){var i=e.parentNode||document.documentElement;if(!i)return;i.removeChild(e)}}},g={send:function(t){var e=t||{method:"GET",protocol:"XHR",timeOut:0,format:null,wrap:!0,nocache:!0,output:"json",callback:null,callbackSuffix:null};if("undefined"!=typeof window||"JSONP"!==t.protocol){if("XHR"===t.protocol||"json"===t.format?e.wrap=!1:"JSONP"===t.protocol&&"xml"===t.format&&(e.wrap=!0),e.callback=null,e.output=e.wrap?"json":null,e.wrap){var i={};i.output=e.output,i.callback=e.callback,delete i.callback,e.url=u.normalyzeUrl(t.url,i)}switch(e.protocol){case"XHR":"GET"===t.method&&t.nocache&&(e.url=u.normalyzeUrl(e.url,{t:(new Date).getTime()})),f.call(e);break;case"JSONP":e.data&&(e.url=u.normalyzeUrl(e.url,e.data)),m.call(e);break;default:throw new Error("protocol not supported (XHR|JSONP) !")}}else console.log("Value (s) for parameter (s) 'protocol=JSONP (instead use XHR)' not supported to NodeJS")}};function v(t){if(!(this instanceof v))throw new TypeError("ErrorService constructor cannot be called as a function.");var e=t;"string"==typeof t||t instanceof String?(this.message=t,this.status=-1,this.type=v.TYPE_UNKERR):(this.message=e.message||"undefined!?",this.type=e.type,this.status=e.status||-1),this.name="ErrorService",this.stack=(new Error).stack}v.TYPE_SRVERR="SERVICE_ERROR",v.TYPE_USEERR="USAGE_ERROR",v.TYPE_UNKERR="UNKNOWN_ERROR",v.prototype=Object.create(Error.prototype,{constructor:{value:v,writable:!0,configurable:!0}});var y=v,_={ssl:!0,url:function(t){return(!1===_.ssl?"http://":"https://")+"wxs.ign.fr"+t},newUrl:function(t,e){return(!1===_.ssl?"http://":"https://")+e+t},Alti:{new_key:{"elevation-json":"/altimetrie/1.0/calcul/alti/rest/elevation.json","elevation-xml":"/altimetrie/1.0/calcul/alti/rest/elevation.xml","profil-json":"/altimetrie/1.0/calcul/alti/rest/elevationLine.json","profil-xml":"/altimetrie/1.0/calcul/alti/rest/elevationLine.xml"},_key:{"elevation-json":"/calcul/alti/rest/elevation.json","elevation-xml":"/calcul/alti/rest/elevation.xml","profil-json":"/calcul/alti/rest/elevationLine.json","profil-xml":"/calcul/alti/rest/elevationLine.xml",wps:"/alti/wps"},newUrl:function(){},url:function(){return{"elevation-json":_.url(this._key["elevation-json"]),"elevation-xml":_.url(this._key["elevation-xml"]),"profil-json":_.url(this._key["profil-json"]),"profil-xml":_.url(this._key["profil-xml"])}}},ProcessIsoCurve:{new_key:"/itineraire/isochrone",_key:"/calcul/geoportail/isochrone/rest/1.0.0/isochrone",newUrl:function(){},url:function(){return _.url(this._key)}},Config:{_key:"https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/dist/",url:function(t){Array.isArray(t)||(t=t.split(","));for(var e=[],i=0;in(t,{credentials:"same-origin"}).then(t=>{if(t.ok)return t.json().then(t=>t).catch(t=>{throw new Error("Exception Json : "+t)});throw new Error("Exception HTTP : "+t.status+" (status code) !")}).catch(t=>new Promise((e,i)=>{i(t)})),o=[];for(let t=0;t{if(!t)throw new Error("results config empty !?");t.forEach(t=>{this.listConfigResults.push(t)})}).then(()=>{e.call(this,this.listConfigResults)}).catch(e=>{t.call(this,e)})},P=function(t,e){this.listConfigResults=[];for(var i=0;ie||t__IDENTIFIER__\x3c!-- __DATAINPUTS__ --\x3e__RAWDATAOUTPUT__',input:"__KEY____DATA__"}},namespaceByDefault:function(){return['xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"','xmlns="http://www.opengis.net/wps/1.0.0"','xmlns:wfs="http://www.opengis.net/wfs"','xmlns:wps="http://www.opengis.net/wps/1.0.0"','xmlns:ows="http://www.opengis.net/ows/1.1"','xmlns:gml="http://www.opengis.net/gml"','xmlns:ogc="http://www.opengis.net/ogc"','xmlns:wcs="http://www.opengis.net/wcs/1.1.1"','xmlns:xlink="http://www.w3.org/1999/xlink"'].join(" ")},schemaLocationByDefault:function(){return'xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"'},processRequestString:function(){this.logger.trace("WPS::processRequestString ()");var t="";if("POST"===this.method)t=this.template.post.value;else{if("GET"!==this.method)return this.logger.error("No other method supported by the service !"),!1;t=this.template.get.value}return t=(t=(t=(t=(t=t.replace(/__SERVICE__/g,this.paramservice)).replace(/__VERSION__/g,this.paramversion)).replace(/__RAWDATAOUTPUT__/g,this.paramrawdataoutput)).replace(/__IDENTIFIER__/g,this.paramidentifier)).replace(/__REQUEST__/g,this.paramrequest),"POST"===this.method&&(t=(t=t.replace(/__NAMESPACE__/g,this.namespaceByDefault)).replace(/__SCHEMALOCATION__/g,this.schemaLocationByDefault)),(t=t.replace(//g,this.__addDataInputs()))?(this.requestString=t,this.logger.trace("traduction tmpl",t),!0):(this.logger.warn("traduction tmpl : empty request !?"),!1)},__addDataInputs:function(){this.logger.trace("WPS::__addDataInputs ()");for(var t,e="GET"===this.method?this.template.get.input:this.template.post.input,i="GET"===this.method?";":"",n="",r=this,s=this.DataObject.getData(),o=0;o0)for(var o=n.getElementsByTagName("parsererror"),a=0;a0){var n=function(t){if(t.attributes.length>0){for(var e={},i=t.attributes,n=0;n0?e.index=e.filters.type[0]:e.index=e.filters.type),delete e.filters.type),e.filters.bbox&&(this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"),delete e.filters.bbox)),delete e.filterOptions),e.position&&(e.position.x&&(this.logger.warn("The parameter 'position.x' is deprecated"),e.position.lon||(e.position.lon=e.position.x),delete e.position.x),e.position.y&&(this.logger.warn("The parameter 'position.y' is deprecated"),e.position.lat||(e.position.lat=e.position.y),delete e.position.y)),e.returnFreeForm&&(this.logger.warn("The parameter 'returnFreeForm' is deprecated"),delete e.returnFreeForm),e.srs&&(this.logger.warn("The parameter 'srs' is deprecated"),delete e.srs),e},mt.prototype.buildRequest=function(t,e){var i={httpMethod:this.options.httpMethod,geocodeMethod:"search",query:this.options.query,index:this.options.index,returnTrueGeometry:this.options.returnTrueGeometry,position:this.options.position,maxResp:this.options.maximumResponses,filters:this.options.filters};this.request=ot.build(i),this.request?e.call(this,this.request):t.call(this,new y(c.getMessage("SERVICE_REQUEST_BUILD")))},mt.prototype.analyzeResponse=function(t,e){if(this.response){var i={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:e,scope:this};ft.build(i)}else t.call(this,new y(c.getMessage("SERVICE_RESPONSE_EMPTY")))};var gt=mt;function vt(t){if(!(this instanceof vt))throw new TypeError(c.getMessage("CLASS_CONSTRUCTOR","ReverseGeocode"));this.CLASSNAME="ReverseGeocode",this.logger=h.getLogger("Gp.Services.ReverseGeocode"),this.logger.trace("[Constructeur ReverseGeocode (options)]");var e=this.patchOptionConvertor(t);if(e.serverUrl||(e.serverUrl=x.ReverseGeocode.url()),w.apply(this,[e]),e.searchGeometry)this.options.searchGeometry=e.searchGeometry;else if(!e.position)throw new Error(c.getMessage("PARAM_MISSING","searchGeometry"));if(e.index||(this.options.index=e.index="StreetAddress"),e.filters)for(var i=Object.keys(e.filters),n=0;n0?e.index=e.filterOptions.type[0]:e.index=e.filterOptions.type),delete e.filterOptions.type),e.filterOptions.bbox&&(this.logger.warn("The parameter 'filterOptions.bbox' is deprecated"),e.searchGeometry||(e.searchGeometry=this.bbox2Json(e.filterOptions.bbox)),delete e.filterOptions.bbox),e.filterOptions.circle&&(this.logger.warn("The parameter 'filterOptions.circle' is deprecated"),e.searchGeometry||(e.searchGeometry=this.circle2Json(e.filterOptions.circle)),delete e.filterOptions.circle),e.filterOptions.polygon&&(this.logger.warn("The parameter 'filterOptions.polygon' is deprecated"),e.searchGeometry||(e.searchGeometry=this.polygon2Json(e.filterOptions.polygon)),delete e.filterOptions.polygon),!e.filters&&Object.keys(e.filterOptions).length>0&&(e.filters=e.filterOptions),delete e.filterOptions),e.position&&(e.position.x&&(this.logger.warn("The parameter 'position.x' is deprecated"),e.position.lon||(e.position.lon=e.position.x),delete e.position.x),e.position.y&&(this.logger.warn("The parameter 'position.y' is deprecated"),e.position.lat||(e.position.lat=e.position.y),delete e.position.y)),e.srs&&(this.logger.warn("The parameter 'srs' is deprecated"),delete e.srs),e},vt.prototype.buildRequest=function(t,e){var i={httpMethod:this.options.httpMethod,geocodeMethod:"reverse",searchGeometry:this.options.searchGeometry,index:this.options.index,position:this.options.position,returnTrueGeometry:this.options.returnTrueGeometry,maxResp:this.options.maximumResponses,filters:this.options.filters};this.request=ot.build(i),this.request?e.call(this,this.request):t.call(this,new y(c.getMessage("SERVICE_REQUEST_BUILD")))},vt.prototype.analyzeResponse=function(t,e){if(this.response){var i={response:this.response,rawResponse:this.options.rawResponse,onError:t,onSuccess:e,scope:this};ft.build(i)}else t.call(this,new y(c.getMessage("SERVICE_RESPONSE_EMPTY")))},vt.prototype.bbox2Json=function(t){return{type:"Polygon",coordinates:[[[t.left,t.top],[t.right,t.top],[t.right,t.bottom],[t.left,t.bottom],[t.left,t.top]]]}},vt.prototype.circle2Json=function(t){return{type:"Circle",radius:t.radius,coordinates:[t.x,t.y]}},vt.prototype.polygon2Json=function(t){for(var e={type:"Polygon",coordinates:[[]]},i=0;i=s&&r<=o},_checkDMSDegrees:function(t,e){if(isNaN(e.value))return!1;var i=parseFloat(e.value);if((0|i)!==i)return!1;var n=Number(e.dataset.min),r=Number(e.dataset.max);if(ir)return!1;var s=document.getElementById(this._addUID("GPmousePosition"+t+"Minutes")),o=document.getElementById(this._addUID("GPmousePosition"+t+"Seconds"));return i>=r?(s.dataset.max=0,o.dataset.max=0):(s.dataset.max=59,o.dataset.max=59.9999),!0},GPdisplayCoords:function(t){if(t){var e=document.getElementById(this._addUID("GPmousePositionLonLabel")),i=document.getElementById(this._addUID("GPmousePositionLatLabel"));if(t.x||t.y?(i.innerHTML="X : ",e.innerHTML="Y : "):t.e||t.n?(i.innerHTML="E : ",e.innerHTML="N : "):(i.innerHTML="Latitude : ",e.innerHTML="Longitude : "),"object"===oe(t.lat)&&"object"===oe(t.lng)){var n={lng:"Lon",lat:"Lat"},r=["Degrees","Minutes","Seconds"];for(var s in n)for(var o=0;o>8&255]+he[t>>16&255]+he[t>>24&255]+"-"+he[255&e]+he[e>>8&255]+"-"+he[e>>16&15|64]+he[e>>24&255]+"-"+he[63&i|128]+he[i>>8&255]+"-"+he[i>>16&255]+he[i>>24&255]+he[255&n]+he[n>>8&255]+he[n>>16&255]+he[n>>24&255]).toUpperCase()}function pe(t,e,i){return Math.max(e,Math.min(i,t))}function fe(t,e){return(t%e+e)%e}function me(t,e,i){return(1-i)*t+i*e}function ge(t){return 0==(t&t-1)&&0!==t}function ve(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}class ye{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}ye.prototype.isVector2=!0;class _e{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,l){const h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=r,h[5]=a,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],h=i[4],c=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],_=n[7],x=n[2],b=n[5],M=n[8];return r[0]=s*f+o*v+a*x,r[3]=s*m+o*y+a*b,r[6]=s*g+o*_+a*M,r[1]=l*f+h*v+c*x,r[4]=l*m+h*y+c*b,r[7]=l*g+h*_+c*M,r[2]=u*f+d*v+p*x,r[5]=u*m+d*y+p*b,r[8]=u*g+d*_+p*M,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8];return e*s*h-e*o*l-i*r*h+i*o*a+n*r*l-n*s*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=t[8],c=h*s-o*l,u=o*a-h*r,d=l*r-s*a,p=e*c+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=c*f,t[1]=(n*l-h*i)*f,t[2]=(o*i-n*s)*f,t[3]=u*f,t[4]=(h*e-n*a)*f,t[5]=(n*r-o*e)*f,t[6]=d*f,t[7]=(i*a-l*e)*f,t[8]=(s*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,s,o){const a=Math.cos(r),l=Math.sin(r);return this.set(i*a,i*l,-i*(a*s+l*o)+s+t,-n*l,n*a,-n*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],s=n[3],o=n[6],a=n[1],l=n[4],h=n[7];return n[0]=e*r+i*a,n[3]=e*s+i*l,n[6]=e*o+i*h,n[1]=-i*r+e*a,n[4]=-i*s+e*l,n[7]=-i*o+e*h,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}function xe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>65535)return!0;return!1}_e.prototype.isMatrix3=!0;Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function be(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const Me={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},we={h:0,s:0,l:0},Ee={h:0,s:0,l:0};function Se(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function Te(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ce(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Pe{constructor(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=fe(t,1),e=pe(e,0,1),i=pe(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=Se(r,n,t+1/3),this.g=Se(r,n,t),this.b=Se(r,n,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Me[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Te(t.r),this.g=Te(t.g),this.b=Te(t.b),this}copyLinearToSRGB(t){return this.r=Ce(t.r),this.g=Ce(t.g),this.b=Ce(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),s=Math.min(e,i,n);let o,a;const l=(s+r)/2;if(s===r)o=0,a=0;else{const t=r-s;switch(a=l<=.5?t/(r+s):t/(2-r-s),r){case e:o=(i-n)/t+(i2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=be("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&this.version++}}function De(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Ae.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Ie.DEFAULT_IMAGE=void 0,Ie.DEFAULT_MAPPING=300,Ie.prototype.isTexture=!0;class Ne{constructor(t=0,e=0,i=0,n=1){this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const s=t.elements,o=s[0],a=s[4],l=s[8],h=s[1],c=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-h)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(a+h)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(o+1)/2,s=(c+1)/2,m=(f+1)/2,g=(a+h)/4,v=(l+d)/4,y=(u+p)/4;return t>s&&t>m?t<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=g/i,r=v/i):s>m?s<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(s),i=g/n,r=y/n):m<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(m),i=v/r,n=y/r),this.set(i,n,r,e),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(h-a)*(h-a));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(h-a)/m,this.w=Math.acos((o+c+f-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}Ne.prototype.isVector4=!0;class Oe extends le{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Ne(0,0,t,e),this.scissorTest=!1,this.viewport=new Ne(0,0,t,e),this.texture=new Ie(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:1006,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Object.assign({},t.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Oe.prototype.isWebGLRenderTarget=!0;(class extends Oe{constructor(t,e,i){super(t,e);const n=this.texture;this.texture=[];for(let t=0;t=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,o=Math.sin(o*s)/r}const r=o*i;if(a=a*t+u*r,l=l*t+d*r,h=h*t+p*r,c=c*t+f*r,t===1-o){const t=1/Math.sqrt(a*a+l*l+h*h+c*c);a*=t,l*=t,h*=t,c*=t}}t[e]=a,t[e+1]=l,t[e+2]=h,t[e+3]=c}static multiplyQuaternionsFlat(t,e,i,n,r,s){const o=i[n],a=i[n+1],l=i[n+2],h=i[n+3],c=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=o*p+h*c+a*d-l*u,t[e+1]=a*p+h*u+l*c-o*d,t[e+2]=l*p+h*d+o*u-a*c,t[e+3]=h*p-o*c-a*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,s=t._order,o=Math.cos,a=Math.sin,l=o(i/2),h=o(n/2),c=o(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(s){case"XYZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"YXZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"ZXY":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"ZYX":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"YZX":this._x=u*h*c+l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c-u*d*p;break;case"XZY":this._x=u*h*c-l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],o=e[5],a=e[9],l=e[2],h=e[6],c=e[10],u=i+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(h-a)*t,this._y=(r-l)*t,this._z=(s-n)*t}else if(i>o&&i>c){const t=2*Math.sqrt(1+i-o-c);this._w=(h-a)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+l)/t}else if(o>c){const t=2*Math.sqrt(1+o-i-c);this._w=(r-l)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(a+h)/t}else{const t=2*Math.sqrt(1+c-i-o);this._w=(s-n)/t,this._x=(r+l)/t,this._y=(a+h)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(pe(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,s=t._w,o=e._x,a=e._y,l=e._z,h=e._w;return this._x=i*h+s*o+n*l-r*a,this._y=n*h+s*a+r*o-i*l,this._z=r*h+s*l+i*a-n*o,this._w=s*h-i*o-n*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,s=this._w;let o=s*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),h=Math.atan2(l,o),c=Math.sin((1-e)*h)/l,u=Math.sin(e*h)/l;return this._w=s*c+this._w*u,this._x=i*c+this._x*u,this._y=n*c+this._y*u,this._z=r*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}ke.prototype.isQuaternion=!0;class Ue{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ze.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ze.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,l=a*e+s*n-o*i,h=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=l*a+u*-r+h*-o-c*-s,this.y=h*a+u*-s+c*-r-l*-o,this.z=c*a+u*-o+l*-s-h*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Be.copy(this).projectOnVector(t),this.sub(Be)}reflect(t){return this.sub(Be.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(pe(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}Ue.prototype.isVector3=!0;const Be=new Ue,ze=new ke;class Fe{constructor(t=new Ue(1/0,1/0,1/0),e=new Ue(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.length;ar&&(r=l),h>s&&(s=h),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.count;ar&&(r=l),h>s&&(s=h),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,He),He.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Ke),Qe.subVectors(this.max,Ke),je.subVectors(t.a,Ke),qe.subVectors(t.b,Ke),Xe.subVectors(t.c,Ke),Ye.subVectors(qe,je),Je.subVectors(Xe,qe),Ze.subVectors(je,Xe);let e=[0,-Ye.z,Ye.y,0,-Je.z,Je.y,0,-Ze.z,Ze.y,Ye.z,0,-Ye.x,Je.z,0,-Je.x,Ze.z,0,-Ze.x,-Ye.y,Ye.x,0,-Je.y,Je.x,0,-Ze.y,Ze.x,0];return!!ei(e,je,qe,Xe,Qe)&&(e=[1,0,0,0,1,0,0,0,1],!!ei(e,je,qe,Xe,Qe)&&($e.crossVectors(Ye,Je),e=[$e.x,$e.y,$e.z],ei(e,je,qe,Xe,Qe)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return He.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(He).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Ve[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ve[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ve[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ve[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ve[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ve[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ve[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ve[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ve)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}Fe.prototype.isBox3=!0;const Ve=[new Ue,new Ue,new Ue,new Ue,new Ue,new Ue,new Ue,new Ue],He=new Ue,We=new Fe,je=new Ue,qe=new Ue,Xe=new Ue,Ye=new Ue,Je=new Ue,Ze=new Ue,Ke=new Ue,Qe=new Ue,$e=new Ue,ti=new Ue;function ei(t,e,i,n,r){for(let s=0,o=t.length-3;s<=o;s+=3){ti.fromArray(t,s);const o=r.x*Math.abs(ti.x)+r.y*Math.abs(ti.y)+r.z*Math.abs(ti.z),a=e.dot(ti),l=i.dot(ti),h=n.dot(ti);if(Math.max(-Math.max(a,l,h),Math.min(a,l,h))>o)return!1}return!0}const ii=new Fe,ni=new Ue,ri=new Ue,si=new Ue;class oi{constructor(t=new Ue,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):ii.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){si.subVectors(t,this.center);const e=si.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.add(si.multiplyScalar(i/t)),this.radius+=i}return this}union(t){return!0===this.center.equals(t.center)?ri.set(0,0,1).multiplyScalar(t.radius):ri.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(ni.copy(t.center).add(ri)),this.expandByPoint(ni.copy(t.center).sub(ri)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ai=new Ue,li=new Ue,hi=new Ue,ci=new Ue,ui=new Ue,di=new Ue,pi=new Ue;class fi{constructor(t=new Ue,e=new Ue(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ai)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=ai.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ai.copy(this.direction).multiplyScalar(e).add(this.origin),ai.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){li.copy(t).add(e).multiplyScalar(.5),hi.copy(e).sub(t).normalize(),ci.copy(this.origin).sub(li);const r=.5*t.distanceTo(e),s=-this.direction.dot(hi),o=ci.dot(this.direction),a=-ci.dot(hi),l=ci.lengthSq(),h=Math.abs(1-s*s);let c,u,d,p;if(h>0)if(c=s*a-o,u=s*o-a,p=r*h,c>=0)if(u>=-p)if(u<=p){const t=1/h;c*=t,u*=t,d=c*(c+s*u+2*o)+u*(s*c+u+2*a)+l}else u=r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;else u=-r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;else u<=-p?(c=Math.max(0,-(-s*r+o)),u=c>0?-r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+l):u<=p?(c=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(c=Math.max(0,-(s*r+o)),u=c>0?r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+l);else u=s>0?-r:r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(c).add(this.origin),n&&n.copy(hi).multiplyScalar(u).add(li),d}intersectSphere(t,e){ai.subVectors(t.center,this.origin);const i=ai.dot(this.direction),n=ai.dot(ai)-i*i,r=t.radius*t.radius;if(n>r)return null;const s=Math.sqrt(r-n),o=i-s,a=i+s;return o<0&&a<0?null:o<0?this.at(a,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,o,a;const l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),h>=0?(r=(t.min.y-u.y)*h,s=(t.max.y-u.y)*h):(r=(t.max.y-u.y)*h,s=(t.min.y-u.y)*h),i>s||r>n?null:((r>i||i!=i)&&(i=r),(s=0?(o=(t.min.z-u.z)*c,a=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,a=(t.min.z-u.z)*c),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,ai)}intersectTriangle(t,e,i,n,r){ui.subVectors(e,t),di.subVectors(i,t),pi.crossVectors(ui,di);let s,o=this.direction.dot(pi);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}ci.subVectors(this.origin,t);const a=s*this.direction.dot(di.crossVectors(ci,di));if(a<0)return null;const l=s*this.direction.dot(ui.cross(ci));if(l<0)return null;if(a+l>o)return null;const h=-s*ci.dot(pi);return h<0?null:this.at(h/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class mi{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,l,h,c,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 mi).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/gi.setFromMatrixColumn(t,0).length(),r=1/gi.setFromMatrixColumn(t,1).length(),s=1/gi.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),l=Math.sin(n),h=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){const t=s*h,i=s*c,n=o*h,r=o*c;e[0]=a*h,e[4]=-a*c,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-o*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*h,i=a*c,n=l*h,r=l*c;e[0]=t+r*o,e[4]=n*o-i,e[8]=s*l,e[1]=s*c,e[5]=s*h,e[9]=-o,e[2]=i*o-n,e[6]=r+t*o,e[10]=s*a}else if("ZXY"===t.order){const t=a*h,i=a*c,n=l*h,r=l*c;e[0]=t-r*o,e[4]=-s*c,e[8]=n+i*o,e[1]=i+n*o,e[5]=s*h,e[9]=r-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*h,i=s*c,n=o*h,r=o*c;e[0]=a*h,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*c,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*h,e[4]=r-t*c,e[8]=n*c+i,e[1]=c,e[5]=s*h,e[9]=-o*h,e[2]=-l*h,e[6]=i*c+n,e[10]=t-r*c}else if("XZY"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*h,e[4]=-c,e[8]=l*h,e[1]=t*c+r,e[5]=s*h,e[9]=i*c-n,e[2]=n*c-i,e[6]=o*h,e[10]=r*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(yi,t,_i)}lookAt(t,e,i){const n=this.elements;return Mi.subVectors(t,e),0===Mi.lengthSq()&&(Mi.z=1),Mi.normalize(),xi.crossVectors(i,Mi),0===xi.lengthSq()&&(1===Math.abs(i.z)?Mi.x+=1e-4:Mi.z+=1e-4,Mi.normalize(),xi.crossVectors(i,Mi)),xi.normalize(),bi.crossVectors(Mi,xi),n[0]=xi.x,n[4]=bi.x,n[8]=Mi.x,n[1]=xi.y,n[5]=bi.y,n[9]=Mi.y,n[2]=xi.z,n[6]=bi.z,n[10]=Mi.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[4],a=i[8],l=i[12],h=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],_=i[11],x=i[15],b=n[0],M=n[4],w=n[8],E=n[12],S=n[1],T=n[5],C=n[9],P=n[13],R=n[2],A=n[6],L=n[10],I=n[14],D=n[3],N=n[7],O=n[11],G=n[15];return r[0]=s*b+o*S+a*R+l*D,r[4]=s*M+o*T+a*A+l*N,r[8]=s*w+o*C+a*L+l*O,r[12]=s*E+o*P+a*I+l*G,r[1]=h*b+c*S+u*R+d*D,r[5]=h*M+c*T+u*A+d*N,r[9]=h*w+c*C+u*L+d*O,r[13]=h*E+c*P+u*I+d*G,r[2]=p*b+f*S+m*R+g*D,r[6]=p*M+f*T+m*A+g*N,r[10]=p*w+f*C+m*L+g*O,r[14]=p*E+f*P+m*I+g*G,r[3]=v*b+y*S+_*R+x*D,r[7]=v*M+y*T+_*A+x*N,r[11]=v*w+y*C+_*L+x*O,r[15]=v*E+y*P+_*I+x*G,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],o=t[5],a=t[9],l=t[13],h=t[2],c=t[6],u=t[10],d=t[14];return t[3]*(+r*a*c-n*l*c-r*o*u+i*l*u+n*o*d-i*a*d)+t[7]*(+e*a*d-e*l*u+r*s*u-n*s*d+n*l*h-r*a*h)+t[11]*(+e*l*c-e*o*d-r*s*c+i*s*d+r*o*h-i*l*h)+t[15]*(-n*o*h-e*a*c+e*o*u+n*s*c-i*s*u+i*a*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=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[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,l=r*s,h=r*o;return this.set(l*s+i,l*o-n*a,l*a+n*o,0,l*o+n*a,h*o+i,h*a-n*s,0,l*a-n*o,h*a+n*s,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,s){return this.set(1,i,r,0,t,1,s,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,s=e._y,o=e._z,a=e._w,l=r+r,h=s+s,c=o+o,u=r*l,d=r*h,p=r*c,f=s*h,m=s*c,g=o*c,v=a*l,y=a*h,_=a*c,x=i.x,b=i.y,M=i.z;return n[0]=(1-(f+g))*x,n[1]=(d+_)*x,n[2]=(p-y)*x,n[3]=0,n[4]=(d-_)*b,n[5]=(1-(u+g))*b,n[6]=(m+v)*b,n[7]=0,n[8]=(p+y)*M,n[9]=(m-v)*M,n[10]=(1-(u+f))*M,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=gi.set(n[0],n[1],n[2]).length();const s=gi.set(n[4],n[5],n[6]).length(),o=gi.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],vi.copy(this);const a=1/r,l=1/s,h=1/o;return vi.elements[0]*=a,vi.elements[1]*=a,vi.elements[2]*=a,vi.elements[4]*=l,vi.elements[5]*=l,vi.elements[6]*=l,vi.elements[8]*=h,vi.elements[9]*=h,vi.elements[10]*=h,e.setFromRotationMatrix(vi),i.x=r,i.y=s,i.z=o,this}makePerspective(t,e,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(e-t),l=2*r/(i-n),h=(e+t)/(e-t),c=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,n,r,s){const o=this.elements,a=1/(e-t),l=1/(i-n),h=1/(s-r),c=(e+t)*a,u=(i+n)*l,d=(s+r)*h;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}mi.prototype.isMatrix4=!0;const gi=new Ue,vi=new mi,yi=new Ue(0,0,0),_i=new Ue(1,1,1),xi=new Ue,bi=new Ue,Mi=new Ue,wi=new mi,Ei=new ke;class Si{constructor(t=0,e=0,i=0,n=Si.DefaultOrder){this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,r=n[0],s=n[4],o=n[8],a=n[1],l=n[5],h=n[9],c=n[2],u=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(pe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-pe(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-c,r),this._z=0);break;case"ZXY":this._x=Math.asin(pe(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-pe(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(pe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-c,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-pe(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return wi.makeRotationFromQuaternion(t),this.setFromRotationMatrix(wi,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Ei.setFromEuler(this),this.setFromQuaternion(Ei,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new Ue(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Si.prototype.isEuler=!0,Si.DefaultOrder="XYZ",Si.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Ti{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0){n.children=[];for(let e=0;e0){n.animations=[];for(let e=0;e0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),o.length>0&&(i.images=o),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h)}return i.object=n,i;function s(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){Fi.subVectors(n,e),Vi.subVectors(i,e),Hi.subVectors(t,e);const s=Fi.dot(Fi),o=Fi.dot(Vi),a=Fi.dot(Hi),l=Vi.dot(Vi),h=Vi.dot(Hi),c=s*l-o*o;if(0===c)return r.set(-2,-1,-1);const u=1/c,d=(l*a-o*h)*u,p=(s*h-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,Wi),Wi.x>=0&&Wi.y>=0&&Wi.x+Wi.y<=1}static getUV(t,e,i,n,r,s,o,a){return this.getBarycoord(t,e,i,n,Wi),a.set(0,0),a.addScaledVector(r,Wi.x),a.addScaledVector(s,Wi.y),a.addScaledVector(o,Wi.z),a}static isFrontFacing(t,e,i,n){return Fi.subVectors(i,e),Vi.subVectors(t,e),Fi.cross(Vi).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Fi.subVectors(this.c,this.b),Vi.subVectors(this.a,this.b),.5*Fi.cross(Vi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Ki.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Ki.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return Ki.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return Ki.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Ki.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,n=this.b,r=this.c;let s,o;ji.subVectors(n,i),qi.subVectors(r,i),Yi.subVectors(t,i);const a=ji.dot(Yi),l=qi.dot(Yi);if(a<=0&&l<=0)return e.copy(i);Ji.subVectors(t,n);const h=ji.dot(Ji),c=qi.dot(Ji);if(h>=0&&c<=h)return e.copy(n);const u=a*c-h*l;if(u<=0&&a>=0&&h<=0)return s=a/(a-h),e.copy(i).addScaledVector(ji,s);Zi.subVectors(t,r);const d=ji.dot(Zi),p=qi.dot(Zi);if(p>=0&&d<=p)return e.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(i).addScaledVector(qi,o);const m=h*p-d*c;if(m<=0&&c-h>=0&&d-p>=0)return Xi.subVectors(r,n),o=(c-h)/(c-h+(d-p)),e.copy(n).addScaledVector(Xi,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(i).addScaledVector(ji,s).addScaledVector(qi,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Qi=0;class $i extends le{constructor(){super(),Object.defineProperty(this,"id",{value:Qi++}),this.uuid=de(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}$i.prototype.isMaterial=!0;class tn extends $i{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Pe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}tn.prototype.isMeshBasicMaterial=!0;const en=new Ue,nn=new ye;class rn{constructor(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),yn.copy(i.boundingSphere),yn.applyMatrix4(r),!1===t.ray.intersectsSphere(yn))return;if(gn.copy(r).invert(),vn.copy(t.ray).applyMatrix4(gn),null!==i.boundingBox&&!1===vn.intersectsBox(i.boundingBox))return;let s;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative,h=i.attributes.uv,c=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=u.length;ii.far?null:{distance:h,point:In.clone(),object:t}}(t,e,i,n,_n,xn,bn,Ln);if(p){a&&(Pn.fromBufferAttribute(a,h),Rn.fromBufferAttribute(a,c),An.fromBufferAttribute(a,u),p.uv=Ki.getUV(Ln,_n,xn,bn,Pn,Rn,An,new ye)),l&&(Pn.fromBufferAttribute(l,h),Rn.fromBufferAttribute(l,c),An.fromBufferAttribute(l,u),p.uv2=Ki.getUV(Ln,_n,xn,bn,Pn,Rn,An,new ye));const t={a:h,b:c,c:u,normal:new Ue,materialIndex:0};Ki.getNormal(_n,xn,bn,t.normal),p.face=t}return p}Dn.prototype.isMesh=!0;class On extends mn{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const o=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const a=[],l=[],h=[],c=[];let u=0,d=0;function p(t,e,i,n,r,s,p,f,m,g,v){const y=s/m,_=p/g,x=s/2,b=p/2,M=f/2,w=m+1,E=g+1;let S=0,T=0;const C=new Ue;for(let s=0;s0?1:-1,h.push(C.x,C.y,C.z),c.push(a/m),c.push(1-s/g),S+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}Bn.prototype.isShaderMaterial=!0;class zn extends zi{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new mi,this.projectionMatrix=new mi,this.projectionMatrixInverse=new mi}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}zn.prototype.isCamera=!0;class Fn extends zn{constructor(t=50,e=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*ue*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*ce*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*ue*Math.atan(Math.tan(.5*ce*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,n,r,s){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*ce*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/o,n*=s.width/t,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}Fn.prototype.isPerspectiveCamera=!0;class Vn extends zi{constructor(t,e,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new Fn(90,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new Ue(1,0,0)),this.add(n);const r=new Fn(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Ue(-1,0,0)),this.add(r);const s=new Fn(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ue(0,1,0)),this.add(s);const o=new Fn(90,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Ue(0,-1,0)),this.add(o);const a=new Fn(90,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Ue(0,0,1)),this.add(a);const l=new Fn(90,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ue(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,s,o,a,l]=this.children,h=t.xr.enabled,c=t.getRenderTarget();t.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(c),t.xr.enabled=h,i.texture.needsPMREMUpdate=!0}}class Hn extends Ie{constructor(t,e,i,n,r,s,o,a,l,h){super(t=void 0!==t?t:[],e=void 0!==e?e:301,i,n,r,s,o,a,l,h),this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}Hn.prototype.isCubeTexture=!0;class Wn extends Oe{constructor(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),super(t,t,e),e=e||{},this.texture=new Hn(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:1006}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=1023,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={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 \n\t\t\t\t\t#include \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 \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"},n=new On(5,5,5),r=new Bn({name:"CubemapFromEquirect",uniforms:Gn(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Dn(n,r),o=e.minFilter;1008===e.minFilter&&(e.minFilter=1006);return new Vn(1,10,this).update(t,s),e.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}Wn.prototype.isWebGLCubeRenderTarget=!0;const jn=new Ue,qn=new Ue,Xn=new _e;class Yn{constructor(t=new Ue(1,0,0),e=0){this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=jn.subVectors(i,e).cross(qn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta(jn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||Xn.getNormalMatrix(t),n=this.coplanarPoint(jn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Yn.prototype.isPlane=!0;const Jn=new oi,Zn=new Ue;class Kn{constructor(t=new Yn,e=new Yn,i=new Yn,n=new Yn,r=new Yn,s=new Yn){this.planes=[t,e,i,n,r,s]}set(t,e,i,n,r,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],h=i[6],c=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,c-a,f-u,y-m).normalize(),e[1].setComponents(o+n,c+a,f+u,y+m).normalize(),e[2].setComponents(o+r,c+l,f+d,y+g).normalize(),e[3].setComponents(o-r,c-l,f-d,y-g).normalize(),e[4].setComponents(o-s,c-h,f-p,y-v).normalize(),e[5].setComponents(o+s,c+h,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Jn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Jn)}intersectsSprite(t){return Jn.center.set(0,0,0),Jn.radius=.7071067811865476,Jn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Jn)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)0?t.max.x:t.min.x,Zn.y=n.normal.y>0?t.max.y:t.min.y,Zn.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Zn)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Qn(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function $n(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version 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}\nfloat 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}\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",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + 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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\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 )\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 )\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",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; }\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 color ) { return dot( color, vec3( 0.3333 ) ); }\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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\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}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\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}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.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\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\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\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\treturn texture2D( envMap, uv ).rgb;\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + 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 ), m0, cubeUV_maxMipLevel );\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_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 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, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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\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 )\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 )\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:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#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\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\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\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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 GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\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( ( ior - 1.0 ) / ( 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, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\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}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\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:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\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, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\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#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\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\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_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\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, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).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( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\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 OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( 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( 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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - 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_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, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#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 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\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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 shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\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 shadow;\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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#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 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 mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\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 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:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\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.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.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ 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.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\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\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, vUv );\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 toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( 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}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\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\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 framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\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 ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\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;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \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 \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 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 SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},ir={common:{diffuse:{value:new Pe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new _e},uv2Transform:{value:new _e},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ye(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new _e}},sprite:{diffuse:{value:new Pe(16777215)},opacity:{value:1},center:{value:new ye(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new _e}}},nr={basic:{uniforms:kn([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.fog]),vertexShader:er.meshbasic_vert,fragmentShader:er.meshbasic_frag},lambert:{uniforms:kn([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.fog,ir.lights,{emissive:{value:new Pe(0)}}]),vertexShader:er.meshlambert_vert,fragmentShader:er.meshlambert_frag},phong:{uniforms:kn([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.fog,ir.lights,{emissive:{value:new Pe(0)},specular:{value:new Pe(1118481)},shininess:{value:30}}]),vertexShader:er.meshphong_vert,fragmentShader:er.meshphong_frag},standard:{uniforms:kn([ir.common,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.roughnessmap,ir.metalnessmap,ir.fog,ir.lights,{emissive:{value:new Pe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag},toon:{uniforms:kn([ir.common,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.gradientmap,ir.fog,ir.lights,{emissive:{value:new Pe(0)}}]),vertexShader:er.meshtoon_vert,fragmentShader:er.meshtoon_frag},matcap:{uniforms:kn([ir.common,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.fog,{matcap:{value:null}}]),vertexShader:er.meshmatcap_vert,fragmentShader:er.meshmatcap_frag},points:{uniforms:kn([ir.points,ir.fog]),vertexShader:er.points_vert,fragmentShader:er.points_frag},dashed:{uniforms:kn([ir.common,ir.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:er.linedashed_vert,fragmentShader:er.linedashed_frag},depth:{uniforms:kn([ir.common,ir.displacementmap]),vertexShader:er.depth_vert,fragmentShader:er.depth_frag},normal:{uniforms:kn([ir.common,ir.bumpmap,ir.normalmap,ir.displacementmap,{opacity:{value:1}}]),vertexShader:er.meshnormal_vert,fragmentShader:er.meshnormal_frag},sprite:{uniforms:kn([ir.sprite,ir.fog]),vertexShader:er.sprite_vert,fragmentShader:er.sprite_frag},background:{uniforms:{uvTransform:{value:new _e},t2D:{value:null}},vertexShader:er.background_vert,fragmentShader:er.background_frag},cube:{uniforms:kn([ir.envmap,{opacity:{value:1}}]),vertexShader:er.cube_vert,fragmentShader:er.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:er.equirect_vert,fragmentShader:er.equirect_frag},distanceRGBA:{uniforms:kn([ir.common,ir.displacementmap,{referencePosition:{value:new Ue},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:er.distanceRGBA_vert,fragmentShader:er.distanceRGBA_frag},shadow:{uniforms:kn([ir.lights,ir.fog,{color:{value:new Pe(0)},opacity:{value:1}}]),vertexShader:er.shadow_vert,fragmentShader:er.shadow_frag}};function rr(t,e,i,n,r,s){const o=new Pe(0);let a,l,h=!0===r?0:1,c=null,u=0,d=null;function p(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,s)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),h=e,p(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,p(o,h)},render:function(i,r){let s=!1,f=!0===r.isScene?r.background:null;f&&f.isTexture&&(f=e.get(f));const m=t.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(f=null),null===f?p(o,h):f&&f.isColor&&(p(f,1),s=!0),(t.autoClear||s)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||306===f.mapping)?(void 0===l&&(l=new Dn(new On(1,1,1),new Bn({name:"BackgroundCubeMaterial",uniforms:Gn(nr.cube.uniforms),vertexShader:nr.cube.vertexShader,fragmentShader:nr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=f,l.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,c===f&&u===f.version&&d===t.toneMapping||(l.material.needsUpdate=!0,c=f,u=f.version,d=t.toneMapping),i.unshift(l,l.geometry,l.material,0,0,null)):f&&f.isTexture&&(void 0===a&&(a=new Dn(new tr(2,2),new Bn({name:"BackgroundMaterial",uniforms:Gn(nr.background.uniforms),vertexShader:nr.background.vertexShader,fragmentShader:nr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),a.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&u===f.version&&d===t.toneMapping||(a.material.needsUpdate=!0,c=f,u=f.version,d=t.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null))}}}function sr(t,e,i,n){const r=t.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},l=d(null);let h=l;function c(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function u(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function d(t){const e=[],i=[],n=[];for(let t=0;t=0){let s=l[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const e=s.normalized,o=s.itemSize,l=i.get(s);if(void 0===l)continue;const h=l.buffer,c=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,l=i.stride,d=s.offset;if(i&&i.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==i.precision?i.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),h=!0===i.logarithmicDepthBuffer,c=t.getParameter(34930),u=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),y=u>0,_=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:h,maxTextures:c,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:y&&_,maxSamples:s?t.getParameter(36183):0}}function lr(t){const e=this;let i=null,n=0,r=!1,s=!1;const o=new Yn,a=new _e,l={value:null,needsUpdate:!1};function h(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,i,n,r){const s=null!==t?t.length:0;let h=null;if(0!==s){if(h=l.value,!0!==r||null===h){const e=n+4*s,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===h||h.length0){const o=new Wn(s.height/2);return o.fromEquirectangularTexture(t,r),e.set(r,o),r.addEventListener("dispose",n),i(o.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}nr.physical={uniforms:kn([nr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ye(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Pe(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Pe(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Pe(1,1,1)},specularColorMap:{value:null}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag};class cr extends zn{constructor(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,s){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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,s=i+t,o=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}cr.prototype.isOrthographicCamera=!0;class ur extends Bn{constructor(t){super(t),this.type="RawShaderMaterial"}}ur.prototype.isRawShaderMaterial=!0;const dr=Math.pow(2,8),pr=[.125,.215,.35,.446,.526,.582],fr=5+pr.length,mr=new cr,{_lodPlanes:gr,_sizeLods:vr,_sigmas:yr}=Sr(),_r=new Pe;let xr=null;const br=(1+Math.sqrt(5))/2,Mr=1/br,wr=[new Ue(1,1,1),new Ue(-1,1,1),new Ue(1,1,-1),new Ue(-1,1,-1),new Ue(0,br,Mr),new Ue(0,br,-Mr),new Ue(Mr,0,br),new Ue(-Mr,0,br),new Ue(br,Mr,0),new Ue(-br,Mr,0)];class Er{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const e=new Float32Array(t),i=new Ue(0,1,0);return new ur({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ar(),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 \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})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){xr=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=Rr(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=Pr(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t2?dr:0,dr,dr),a.setRenderTarget(n),d&&a.render(u,r),a.render(t,r)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=h,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const i=this._renderer,n=301===t.mapping||302===t.mapping;n?(null===this._cubemapShader&&(this._cubemapShader=Rr()),this._cubemapShader.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectShader&&(this._equirectShader=Pr());const r=n?this._cubemapShader:this._equirectShader,s=new Dn(gr[0],r),o=r.uniforms;o.envMap.value=t,n||o.texelSize.value.set(1/t.image.width,1/t.image.height),Cr(e,0,0,3*dr,2*dr),i.setRenderTarget(e),i.render(s,mr)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,i=Math.exp(-e*e/2);m.push(i),0===t?g+=i:t4?n-8+4:0),3*v,2*v),a.setRenderTarget(e),a.render(h,mr)}}function Sr(){const t=[],e=[],i=[];let n=8;for(let r=0;r4?o=pr[r-8+4-1]:0===r&&(o=0),i.push(o);const a=1/(s-1),l=-a/2,h=1+a/2,c=[l,l,h,l,h,h,l,l,h,h,l,h],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,p*d*t),v.set(c,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const _=new mn;_.setAttribute("position",new rn(g,p)),_.setAttribute("uv",new rn(v,f)),_.setAttribute("faceIndex",new rn(y,m)),t.push(_),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function Tr(t){const e=new Oe(3*dr,3*dr,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Cr(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Pr(){const t=new ye(1,1);return new ur({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:t}},vertexShader:Ar(),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 vec2 texelSize;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = texture2D ( envMap, uv ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Rr(){return new ur({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ar(),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 Ar(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\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 Lr(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,o=303===s||304===s,a=301===s||302===s;if(o||a){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let n=e.get(r);return null===i&&(i=new Er(t)),n=o?i.fromEquirectangular(r,n):i.fromCubemap(r,n),e.set(r,n),n.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let i=0;i<6;i++)void 0!==t[i]&&e++;return 6===e}(s)){null===i&&(i=new Er(t));const s=o?i.fromEquirectangular(r):i.fromCubemap(r);return e.set(r,s),r.addEventListener("dispose",n),s.texture}return null}}}return r},dispose:function(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function Ir(t){const e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Dr(t,e,i,n){const r={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",o),delete r[a.id];const l=s.get(a);l&&(e.remove(l),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],n=t.index,r=t.attributes.position;let o=0;if(null!==n){const t=n.array;o=n.version;for(let e=0,n=t.length;ee.maxTextureSize&&(u=Math.ceil(c/e.maxTextureSize),c=e.maxTextureSize);const d=new Float32Array(c*u*4*n),p=new Gr(d,c,u,n);p.format=1023,p.type=1015,p.needsUpdate=!0;const f=4*l;for(let e=0;e0)return t;const r=e*i;let s=Xr[r];if(void 0===s&&(s=new Float32Array(r),Xr[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function $r(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i/gm;function io(t){return t.replace(eo,no)}function no(t,e){const i=er[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return io(i)}const ro=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,so=/#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 oo(t){return t.replace(so,lo).replace(ro,ao)}function ao(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),lo(t,e,i,n)}function lo(t,e,i,n){let r="";for(let t=parseInt(e);t0&&(m+="\n"),g=[d,p].filter(Qs).join("\n"),g.length>0&&(g+="\n")):(m=[ho(i),"#define SHADER_NAME "+i.shaderName,p,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Qs).join("\n"),g=[d,ho(i),"#define SHADER_NAME "+i.shaderName,p,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.envMap?"#define "+c:"",i.envMap?"#define "+u:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?er.tonemapping_pars_fragment:"",0!==i.toneMapping?Ks("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.transparent?"":"#define OPAQUE",er.encodings_pars_fragment,Zs("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Qs).join("\n")),o=io(o),o=$s(o,i),o=to(o,i),a=io(a),a=$s(a,i),a=to(a,i),o=oo(o),a=oo(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(v="#version 300 es\n",m=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#define varying in","300 es"===i.glslVersion?"":"layout(location = 0) out highp vec4 pc_fragColor;","300 es"===i.glslVersion?"":"#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"+g);const y=v+g+a,_=Xs(r,35633,v+m+o),x=Xs(r,35632,y);if(r.attachShader(f,_),r.attachShader(f,x),void 0!==i.index0AttributeName?r.bindAttribLocation(f,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(f,0,"position"),r.linkProgram(f),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(f).trim(),e=r.getShaderInfoLog(_).trim(),i=r.getShaderInfoLog(x).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(f,35714)){n=!1;const e=Js(r,_,"vertex"),i=Js(r,x,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:m},fragmentShader:{log:i,prefix:g}})}let b,M;return r.deleteShader(_),r.deleteShader(x),this.getUniforms=function(){return void 0===b&&(b=new qs(r,f)),b},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r0,A=s.clearcoat>0;return{isWebGL2:c,shaderID:M,shaderName:s.type,vertexShader:E,fragmentShader:S,defines:s.defines,customVertexShaderID:T,customFragmentShaderID:C,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:f,outputEncoding:null===P?t.outputEncoding:!0===P.isXRRenderTarget?P.texture.encoding:3e3,map:!!s.map,matcap:!!s.matcap,envMap:!!b,envMapMode:b&&b.mapping,envMapCubeUV:!!b&&(306===b.mapping||307===b.mapping),lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:1===s.normalMapType,tangentSpaceNormalMap:0===s.normalMapType,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&3001===s.map.encoding,clearcoat:A,clearcoatMap:A&&!!s.clearcoatMap,clearcoatRoughnessMap:A&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:A&&!!s.clearcoatNormalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,transparent:s.transparent,alphaMap:!!s.alphaMap,alphaTest:R,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!y.geometry&&!!y.geometry.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!y.geometry&&!!y.geometry.attributes.color&&4===y.geometry.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!_,useFog:s.fog,fogExp2:_&&_.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===y.isSkinnedMesh&&w>0,maxBones:w,useVertexTexture:d,morphTargets:!!y.geometry&&!!y.geometry.morphAttributes.position,morphNormals:!!y.geometry&&!!y.geometry.morphAttributes.normal,morphTargetsCount:y.geometry&&y.geometry.morphAttributes.position?y.geometry.morphAttributes.position.length:0,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,depthPacking:void 0!==s.depthPacking&&s.depthPacking,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.maxBones),t.push(e.morphTargetsCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection)}(i,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0);e.supportsVertexTextures&&a.enable(1);e.instancing&&a.enable(2);e.instancingColor&&a.enable(3);e.map&&a.enable(4);e.matcap&&a.enable(5);e.envMap&&a.enable(6);e.envMapCubeUV&&a.enable(7);e.lightMap&&a.enable(8);e.aoMap&&a.enable(9);e.emissiveMap&&a.enable(10);e.bumpMap&&a.enable(11);e.normalMap&&a.enable(12);e.objectSpaceNormalMap&&a.enable(13);e.tangentSpaceNormalMap&&a.enable(14);e.clearcoat&&a.enable(15);e.clearcoatMap&&a.enable(16);e.clearcoatRoughnessMap&&a.enable(17);e.clearcoatNormalMap&&a.enable(18);e.displacementMap&&a.enable(19);e.specularMap&&a.enable(20);e.roughnessMap&&a.enable(21);e.metalnessMap&&a.enable(22);e.gradientMap&&a.enable(23);e.alphaMap&&a.enable(24);e.alphaTest&&a.enable(25);e.vertexColors&&a.enable(26);e.vertexAlphas&&a.enable(27);e.vertexUvs&&a.enable(28);e.vertexTangents&&a.enable(29);e.uvsVertexOnly&&a.enable(30);e.fog&&a.enable(31);t.push(a.mask),a.disableAll(),e.useFog&&a.enable(0);e.flatShading&&a.enable(1);e.logarithmicDepthBuffer&&a.enable(2);e.skinning&&a.enable(3);e.useVertexTexture&&a.enable(4);e.morphTargets&&a.enable(5);e.morphNormals&&a.enable(6);e.premultipliedAlpha&&a.enable(7);e.shadowMapEnabled&&a.enable(8);e.physicallyCorrectLights&&a.enable(9);e.doubleSided&&a.enable(10);e.flipSided&&a.enable(11);e.depthPacking&&a.enable(12);e.dithering&&a.enable(13);e.specularIntensityMap&&a.enable(14);e.specularColorMap&&a.enable(15);e.transmission&&a.enable(16);e.transmissionMap&&a.enable(17);e.thicknessMap&&a.enable(18);e.sheen&&a.enable(19);e.sheenColorMap&&a.enable(20);e.sheenRoughnessMap&&a.enable(21);e.decodeVideoTexture&&a.enable(22);e.transparent&&a.enable(23);t.push(a.mask)}(i,e),i.push(t.outputEncoding)),i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=g[t.type];let i;if(e){const t=nr[e];i=Un.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=h.length;t0?n.push(c):!0===o.transparent?r.push(c):i.push(c)},unshift:function(t,e,o,a,l,h){const c=s(t,e,o,a,l,h);o.transmission>0?n.unshift(c):!0===o.transparent?r.unshift(c):i.unshift(c)},finish:function(){for(let i=e,n=t.length;i1&&i.sort(t||vo),n.length>1&&n.sort(e||yo),r.length>1&&r.sort(e||yo)}}}function xo(){let t=new WeakMap;return{get:function(e,i){let n;return!1===t.has(e)?(n=new _o,t.set(e,[n])):i>=t.get(e).length?(n=new _o,t.get(e).push(n)):n=t.get(e)[i],n},dispose:function(){t=new WeakMap}}}function bo(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new Ue,color:new Pe};break;case"SpotLight":i={position:new Ue,direction:new Ue,color:new Pe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ue,color:new Pe,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ue,skyColor:new Pe,groundColor:new Pe};break;case"RectAreaLight":i={color:new Pe,position:new Ue,halfWidth:new Ue,halfHeight:new Ue}}return t[e.id]=i,i}}}let Mo=0;function wo(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Eo(t,e){const i=new bo,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new Ue);const s=new Ue,o=new mi,a=new mi;return{setup:function(s,o){let a=0,l=0,h=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let c=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0;s.sort(wo);const y=!0!==o?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=ir.LTC_FLOAT_1,r.rectAreaLTC2=ir.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=ir.LTC_HALF_1,r.rectAreaLTC2=ir.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=h;const _=r.hash;_.directionalLength===c&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===p&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===v||(r.directional.length=c,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,_.directionalLength=c,_.pointLength=u,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=v,r.version=Mo++)},setupView:function(t,e){let i=0,n=0,l=0,h=0,c=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=i.get(n).length?(s=new So(t,e),i.get(n).push(s)):s=i.get(n)[r],s},dispose:function(){i=new WeakMap}}}class Co extends $i{constructor(t){super(),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.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}Co.prototype.isMeshDepthMaterial=!0;class Po extends $i{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new Ue,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}Po.prototype.isMeshDistanceMaterial=!0;function Ro(t,e,i){let n=new Kn;const r=new ye,s=new ye,o=new Ne,a=new Co({depthPacking:3201}),l=new Po,h={},c=i.maxTextureSize,u={0:1,1:0,2:2},d=new Bn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ye},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 \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}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const f=new mn;f.setAttribute("position",new rn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Dn(f,d),g=this;function v(i,n){const r=e.update(m);d.defines.VSM_SAMPLES!==i.blurSamples&&(d.defines.VSM_SAMPLES=i.blurSamples,p.defines.VSM_SAMPLES=i.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,d,m,null),p.uniforms.shadow_pass.value=i.mapPass.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,p,m,null)}function y(e,i,n,r,s,o,c){let d=null;const p=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(d=void 0!==p?p:!0===r.isPointLight?l:a,t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const t=d.uuid,e=n.uuid;let i=h[t];void 0===i&&(i={},h[t]=i);let r=i[e];void 0===r&&(r=d.clone(),i[e]=r),d=r}return d.visible=n.visible,d.wireframe=n.wireframe,d.side=3===c?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],d.alphaMap=n.alphaMap,d.alphaTest=n.alphaTest,d.clipShadows=n.clipShadows,d.clippingPlanes=n.clippingPlanes,d.clipIntersection=n.clipIntersection,d.displacementMap=n.displacementMap,d.displacementScale=n.displacementScale,d.displacementBias=n.displacementBias,d.wireframeLinewidth=n.wireframeLinewidth,d.linewidth=n.linewidth,!0===r.isPointLight&&!0===d.isMeshDistanceMaterial&&(d.referencePosition.setFromMatrixPosition(r.matrixWorld),d.nearDistance=s,d.farDistance=o),d}function _(i,r,s,o,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===a)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,h=e.length;lc||r.y>c)&&(r.x>c&&(s.x=Math.floor(c/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>c&&(s.y=Math.floor(c/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const t={minFilter:1006,magFilter:1006,format:1023};u.map=new Oe(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.mapPass=new Oe(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:1003,magFilter:1003,format:1023};u.map=new Oe(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const f=u.getViewportCount();for(let t=0;t=1):-1!==R.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),C=P>=2);let A=null,L={};const I=t.getParameter(3088),D=t.getParameter(2978),N=(new Ne).fromArray(I),O=(new Ne).fromArray(D);function G(e,i,n){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;en||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?ve:Math.floor,s=n(r*t.width),o=n(r*t.height);void 0===f&&(f=g(s,o));const a=i?g(s,o):f;a.width=s,a.height=o;return a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return ge(t.width)&&ge(t.height)}function _(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function x(e){t.generateMipmap(e)}function b(i,n,r,s,o=!1){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let l=n;return 6403===n&&(5126===r&&(l=33326),5131===r&&(l=33325),5121===r&&(l=33321)),33319===n&&(5126===r&&(l=33328),5131===r&&(l=33327),5121===r&&(l=33323)),6408===n&&(5126===r&&(l=34836),5131===r&&(l=34842),5121===r&&(l=3001===s&&!1===o?35907:32856),32819===r&&(l=32854),32820===r&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||e.get("EXT_color_buffer_float"),l}function M(t,e,i){return!0===_(t,i)||t.isFramebufferTexture&&1003!==t.minFilter&&1006!==t.minFilter?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function w(t){return 1003===t||1004===t||1005===t?9728:9729}function E(e){const i=e.target;i.removeEventListener("dispose",E),function(e){const i=n.get(e);if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture),n.remove(e)}(i),i.isVideoTexture&&p.delete(i),o.memory.textures--}function S(e){const i=e.target;i.removeEventListener("dispose",S),function(e){const i=e.texture,r=n.get(e),s=n.get(i);if(!e)return;void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void D(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function P(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?function(e,n,r){if(6!==n.image.length)return;I(e,n),i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const o=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),l=n.image[0]&&n.image[0].isDataTexture,c=[];for(let t=0;t<6;t++)c[t]=o||l?l?n.image[t].image:n.image[t]:v(n.image[t],!1,!0,h),c[t]=U(n,c[t]);const u=c[0],d=y(u)||a,p=s.convert(n.format,n.encoding),f=s.convert(n.type),m=b(n.internalFormat,p,f,n.encoding),g=a&&!0!==n.isVideoTexture,w=void 0===e.__version;let E,S=M(n,u,d);if(L(34067,n,d),o){g&&w&&i.texStorage2D(34067,S,m,u.width,u.height);for(let t=0;t<6;t++){E=c[t].mipmaps;for(let e=0;e0&&S++,i.texStorage2D(34067,S,m,c[0].width,c[0].height));for(let t=0;t<6;t++)if(l){g?i.texSubImage2D(34069+t,0,0,0,c[t].width,c[t].height,p,f,c[t].data):i.texImage2D(34069+t,0,m,c[t].width,c[t].height,0,p,f,c[t].data);for(let e=0;e1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function I(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",E),e.__webglTexture=t.createTexture(),o.memory.textures++)}function D(e,n,r){let o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),I(e,n),i.activeTexture(33984+r),i.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const l=function(t){return!a&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(n)&&!1===y(n.image);let h=v(n.image,l,!1,c);h=U(n,h);const u=y(h)||a,d=s.convert(n.format,n.encoding);let p,f=s.convert(n.type),m=b(n.internalFormat,d,f,n.encoding,n.isVideoTexture);L(o,n,u);const g=n.mipmaps,w=a&&!0!==n.isVideoTexture,E=void 0===e.__version,S=M(n,h,u);if(n.isDepthTexture)m=6402,a?m=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===m&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,f=s.convert(n.type)),1027===n.format&&6402===m&&(m=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,f=s.convert(n.type))),w&&E?i.texStorage2D(3553,1,m,h.width,h.height):i.texImage2D(3553,0,m,h.width,h.height,0,d,f,null);else if(n.isDataTexture)if(g.length>0&&u){w&&E&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t0&&u){w&&E&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),T+=1,t},this.resetTextureUnits=function(){T=0},this.setTexture2D=C,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?D(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?D(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=P,this.rebindTextures=function(t,e,i){const r=n.get(t);void 0!==e&&N(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==i&&G(t)},this.setupRenderTarget=function(e){const l=e.texture,h=n.get(e),c=n.get(l);e.addEventListener("dispose",S),!0!==e.isWebGLMultipleRenderTargets&&(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=l.version,o.memory.textures++);const u=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=l.isDataTexture3D||l.isDataTexture2DArray,f=y(e)||a;if(u){h.__webglFramebuffer=[];for(let e=0;e<6;e++)h.__webglFramebuffer[e]=t.createFramebuffer()}else if(h.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){const i=e.texture;for(let e=0,r=i.length;ea+h?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=a-h&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}class ko extends Ie{constructor(t,e,i,n,r,s,o,a,l,h){if(1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),super(null,n,r,s,o,a,h,i,l),this.image={width:t,height:e},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==a?a:1003,this.flipY=!1,this.generateMipmaps=!1}}ko.prototype.isDepthTexture=!0;class Uo extends le{constructor(t,e){super();const i=this;let n=null,r=1,s=null,o="local-floor";const a=t.extensions.has("WEBGL_multisampled_render_to_texture");let l=null,h=null,c=null,u=null,d=!1,p=null;const f=e.getContextAttributes();let m=null,g=null;const v=[],y=new Map,_=new Fn;_.layers.enable(1),_.viewport=new Ne;const x=new Fn;x.layers.enable(2),x.viewport=new Ne;const b=[_,x],M=new Do;M.layers.enable(1),M.layers.enable(2);let w=null,E=null;function S(t){const e=y.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function T(){y.forEach((function(t,e){t.disconnect(e)})),y.clear(),w=null,E=null,t.setRenderTarget(m),u=null,c=null,h=null,n=null,g=null,I.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function C(t){const e=n.inputSources;for(let t=0;t0&&(e.alphaTest.value=i.alphaTest);const n=t.get(i).envMap;let r,s;n&&(e.envMap.value=n,e.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap?r=i.emissiveMap:i.clearcoatMap?r=i.clearcoatMap:i.clearcoatNormalMap?r=i.clearcoatNormalMap:i.clearcoatRoughnessMap?r=i.clearcoatRoughnessMap:i.specularIntensityMap?r=i.specularIntensityMap:i.specularColorMap?r=i.specularColorMap:i.transmissionMap?r=i.transmissionMap:i.thicknessMap?r=i.thicknessMap:i.sheenColorMap?r=i.sheenColorMap:i.sheenRoughnessMap&&(r=i.sheenRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),i.aoMap?s=i.aoMap:i.lightMap&&(s=i.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uv2Transform.value.copy(s.matrix))}function i(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,s,o){n.isMeshBasicMaterial?e(t,n):n.isMeshLambertMaterial?(e(t,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,n)):n.isMeshToonMaterial?(e(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshPhongMaterial?(e(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshStandardMaterial?(e(t,n),n.isMeshPhysicalMaterial?function(t,e,n){i(t,e),t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap);e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}(t,n,o):i(t,n)):n.isMeshMatcapMaterial?(e(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDepthMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDistanceMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?(e(t,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,s):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function zo(t={}){const e=void 0!==t.canvas?t.canvas:function(){const t=be("canvas");return t.style.display="block",t}(),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,s=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,h=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let u=null,d=null;const p=[],f=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const m=this;let g=!1,v=0,y=0,_=null,x=-1,b=null;const M=new Ne,w=new Ne;let E=null,S=e.width,T=e.height,C=1,P=null,R=null;const A=new Ne(0,0,S,T),L=new Ne(0,0,S,T);let I=!1;const D=new Kn;let N=!1,O=!1,G=null;const k=new mi,U=new Ue,B={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function z(){return null===_?C:1}let F,V,H,W,j,q,X,Y,J,Z,K,Q,$,tt,et,it,nt,rt,st,ot,at,lt,ht,ct=i;function ut(t,i){for(let n=0;n0&&function(t,e,i){if(null===G){const t=!0===o&&!0===V.isWebGL2;G=new(t?Ge:Oe)(1024,1024,{generateMipmaps:!0,type:null!==lt.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001,useRenderToTexture:F.has("WEBGL_multisampled_render_to_texture")})}const n=m.getRenderTarget();m.setRenderTarget(G),m.clear();const r=m.toneMapping;m.toneMapping=0,Mt(t,e,i),m.toneMapping=r,q.updateMultisampleRenderTarget(G),q.updateRenderTargetMipmap(G),m.setRenderTarget(n)}(r,e,i),n&&H.viewport(M.copy(n)),r.length>0&&Mt(r,e,i),s.length>0&&Mt(s,e,i),a.length>0&&Mt(a,e,i)}function Mt(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?f[f.length-1]:null,p.pop(),u=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return _},this.setRenderTargetTextures=function(t,e,i){j.get(t.texture).__webglTexture=e,j.get(t.depthTexture).__webglTexture=i;const n=j.get(t);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||t.useRenderToTexture&&(console.warn("render-to-texture extension was disabled because an external texture was provided"),t.useRenderToTexture=!1,t.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(t,e){const i=j.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){_=t,v=e,y=i;let n=!0;if(t){const e=j.get(t);void 0!==e.__useDefaultFramebuffer?(H.bindFramebuffer(36160,null),n=!1):void 0===e.__webglFramebuffer?q.setupRenderTarget(t):e.__hasExternalTextures&&q.rebindTextures(t,j.get(t.texture).__webglTexture,j.get(t.depthTexture).__webglTexture)}let r=null,s=!1,o=!1;if(t){const i=t.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(o=!0);const n=j.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=n[e],s=!0):r=t.useRenderbuffer?j.get(t).__webglMultisampledFramebuffer:n,M.copy(t.viewport),w.copy(t.scissor),E=t.scissorTest}else M.copy(A).multiplyScalar(C).floor(),w.copy(L).multiplyScalar(C).floor(),E=I;if(H.bindFramebuffer(36160,r)&&V.drawBuffers&&n&&H.drawBuffers(t,r),H.viewport(M),H.scissor(w),H.setScissorTest(E),s){const n=j.get(t.texture);ct.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(o){const n=j.get(t.texture),r=e||0;ct.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}x=-1},this.readRenderTargetPixels=function(t,e,i,n,r,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=j.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){H.bindFramebuffer(36160,a);try{const o=t.texture,a=o.format,l=o.type;if(1023!==a&<.convert(a)!==ct.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=1016===l&&(F.has("EXT_color_buffer_half_float")||V.isWebGL2&&F.has("EXT_color_buffer_float"));if(!(1009===l||lt.convert(l)===ct.getParameter(35738)||1015===l&&(V.isWebGL2||F.has("OES_texture_float")||F.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ct.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&ct.readPixels(e,i,n,r,lt.convert(a),lt.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const t=null!==_?j.get(_).__webglFramebuffer:null;H.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){if(!0!==e.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n);q.setTexture2D(e,0),ct.copyTexSubImage2D(3553,i,0,0,t.x,t.y,r,s),H.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,o=lt.convert(i.format),a=lt.convert(i.type);q.setTexture2D(i,0),ct.pixelStorei(37440,i.flipY),ct.pixelStorei(37441,i.premultiplyAlpha),ct.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?ct.texSubImage2D(3553,n,t.x,t.y,r,s,o,a,e.image.data):e.isCompressedTexture?ct.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):ct.texSubImage2D(3553,n,t.x,t.y,o,a,e.image),0===n&&i.generateMipmaps&&ct.generateMipmap(3553),H.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(m.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=lt.convert(n.format),h=lt.convert(n.type);let c;if(n.isDataTexture3D)q.setTexture3D(n,0),c=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");q.setTexture2DArray(n,0),c=35866}ct.pixelStorei(37440,n.flipY),ct.pixelStorei(37441,n.premultiplyAlpha),ct.pixelStorei(3317,n.unpackAlignment);const u=ct.getParameter(3314),d=ct.getParameter(32878),p=ct.getParameter(3316),f=ct.getParameter(3315),g=ct.getParameter(32877),v=i.isCompressedTexture?i.mipmaps[0]:i.image;ct.pixelStorei(3314,v.width),ct.pixelStorei(32878,v.height),ct.pixelStorei(3316,t.min.x),ct.pixelStorei(3315,t.min.y),ct.pixelStorei(32877,t.min.z),i.isDataTexture||i.isDataTexture3D?ct.texSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,h,v.data):i.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ct.compressedTexSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,v.data)):ct.texSubImage3D(c,r,e.x,e.y,e.z,s,o,a,l,h,v),ct.pixelStorei(3314,u),ct.pixelStorei(32878,d),ct.pixelStorei(3316,p),ct.pixelStorei(3315,f),ct.pixelStorei(32877,g),0===r&&n.generateMipmaps&&ct.generateMipmap(c),H.unbindTexture()},this.initTexture=function(t){q.setTexture2D(t,0),H.unbindTexture()},this.resetState=function(){v=0,y=0,_=null,H.reset(),ht.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}zo.prototype.isWebGLRenderer=!0;(class extends zo{}).prototype.isWebGL1Renderer=!0;class Fo{constructor(t,e=25e-5){this.name="",this.color=new Pe(t),this.density=e}clone(){return new Fo(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Fo.prototype.isFogExp2=!0;class Vo{constructor(t,e=1,i=1e3){this.name="",this.color=new Pe(t),this.near=e,this.far=i}clone(){return new Vo(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Vo.prototype.isFog=!0;class Ho extends zi{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}Ho.prototype.isScene=!0;class Wo{constructor(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=de()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;nt.far||e.push({distance:a,point:Jo.clone(),uv:Ki.getUV(Jo,ea,ia,na,ra,sa,oa,new ye),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function la(t,e,i,n,r,s){Qo.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?($o.x=s*Qo.x-r*Qo.y,$o.y=r*Qo.x+s*Qo.y):$o.copy(Qo),t.copy(e),t.x+=$o.x,t.y+=$o.y,t.applyMatrix4(ta)}aa.prototype.isSprite=!0;const ha=new Ue,ca=new Ne,ua=new Ne,da=new Ue,pa=new mi;class fa extends Dn{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new mi,this.bindMatrixInverse=new mi}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Ne,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;ia)continue;u.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(u);dt.far||e.push({distance:d,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,s.start),n=Math.min(r.count,s.start+s.count)-1;ia)continue;u.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(u);nt.far||e.push({distance:n,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Ra.prototype.isLine=!0;const Aa=new Ue,La=new Ue;class Ia extends Ra{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function za(t,e,i,n,r,s,o){const a=Ga.distanceSqToPoint(t);if(ar.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:o})}}Ba.prototype.isPoints=!0;(class extends Ie{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.minFilter=void 0!==s?s:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){h.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}).prototype.isVideoTexture=!0;(class extends Ie{constructor(t,e,i){super({width:t,height:e}),this.format=i,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}).prototype.isFramebufferTexture=!0;class Fa extends Ie{constructor(t,e,i,n,r,s,o,a,l,h,c,u){super(null,s,o,a,l,h,n,r,c,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}Fa.prototype.isCompressedTexture=!0;(class extends Ie{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.needsUpdate=!0}}).prototype.isCanvasTexture=!0;new Ue,new Ue,new Ue,new Ki;class Va{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let n=0;const r=i.length;let s;s=e||t*i[r-1];let o,a=0,l=r-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=i[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,i[n]===s)return n/(r-1);const h=i[n];return(n+(s-h)/(i[n+1]-h))/(r-1)}getTangent(t,e){let i=t-1e-4,n=t+1e-4;i<0&&(i=0),n>1&&(n=1);const r=this.getPoint(i),s=this.getPoint(n),o=e||(r.isVector2?new ye:new Ue);return o.copy(s).sub(r).normalize(),o}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new Ue,n=[],r=[],s=[],o=new Ue,a=new mi;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new Ue)}r[0]=new Ue,s[0]=new Ue;let l=Number.MAX_VALUE;const h=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);h<=l&&(l=h,i.set(1,0,0)),c<=l&&(l=c,i.set(0,1,0)),u<=l&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(pe(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(pe(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(o.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Ha extends Va{constructor(t=0,e=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const i=e||new ye,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)n;)r-=n;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===h&&l===r-1&&(l=r-2,h=1),this.closed||l>0?o=n[(l-1)%r]:(qa.subVectors(n[0],n[1]).add(n[0]),o=qa);const c=n[l%r],u=n[(l+1)%r];if(this.closed||l+2n.length-2?n.length-1:s+1],c=n[s>n.length-3?n.length-1:s+2];return i.set(Ka(o,a.x,l.x,h.x,c.x),Ka(o,a.y,l.y,h.y,c.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){const t=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-t/o;return s.getPointAt(a,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class hl extends ll{constructor(t){super(t),this.uuid=de(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,n=this.holes.length;i80*i){a=h=t[0],l=c=t[1];for(let e=i;eh&&(h=u),d>c&&(c=d);p=Math.max(h-a,c-l),p=0!==p?1/p:0}return pl(s,o,i,a,l,p),o};function ul(t,e,i,n,r){let s,o;if(r===function(t,e,i,n){let r=0;for(let s=e,o=i-n;s0)for(s=e;s=e;s-=n)o=Il(s,t[s],t[s+1],o);return o&&Tl(o,o.next)&&(Dl(o),o=o.next),o}function dl(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!Tl(n,n.next)&&0!==Sl(n.prev,n,n.next))n=n.next;else{if(Dl(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function pl(t,e,i,n,r,s,o){if(!t)return;!o&&s&&function(t,e,i,n){let r=t;do{null===r.z&&(r.z=bl(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,s,o,a,l,h=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(o>1)}(r)}(t,n,r,s);let a,l,h=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?ml(t,n,r,s):fl(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),Dl(t),t=l.next,h=l.next;else if((t=l)===h){o?1===o?pl(t=gl(dl(t),e,i),e,i,n,r,s,2):2===o&&vl(t,e,i,n,r,s):pl(dl(t),e,i,n,r,s,1);break}}function fl(t){const e=t.prev,i=t,n=t.next;if(Sl(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(wl(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Sl(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ml(t,e,i,n){const r=t.prev,s=t,o=t.next;if(Sl(r,s,o)>=0)return!1;const a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=bl(a,l,e,i,n),d=bl(h,c,e,i,n);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Sl(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Sl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Sl(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&wl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Sl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function gl(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!Tl(r,s)&&Cl(r,n,n.next,s)&&Al(r,s)&&Al(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),Dl(n),Dl(n.next),n=t=s),n=n.next}while(n!==t);return dl(n)}function vl(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&El(o,t)){let a=Ll(o,t);return o=dl(o,o.next),a=dl(a,a.next),pl(o,e,i,n,r,s),void pl(a,e,i,n,r,s)}t=t.next}o=o.next}while(o!==t)}function yl(t,e){return t.x-e.x}function _l(t,e){if(e=function(t,e){let i=e;const n=t.x,r=t.y;let s,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o){if(o=t,t===n){if(r===i.y)return i;if(r===i.next.y)return i.next}s=i.x=i.x&&i.x>=l&&n!==i.x&&wl(rs.x||i.x===s.x&&xl(s,i)))&&(s=i,u=c)),i=i.next}while(i!==a);return s}(t,e)){const i=Ll(e,t);dl(e,e.next),dl(i,i.next)}}function xl(t,e){return Sl(t.prev,t,e.prev)<0&&Sl(e.next,t,t.next)<0}function bl(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ml(t){let e=t,i=t;do{(e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function El(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Cl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Al(t,e)&&Al(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(Sl(t.prev,t,e.prev)||Sl(t,e.prev,e))||Tl(t,e)&&Sl(t.prev,t,t.next)>0&&Sl(e.prev,e,e.next)>0)}function Sl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Tl(t,e){return t.x===e.x&&t.y===e.y}function Cl(t,e,i,n){const r=Rl(Sl(t,e,i)),s=Rl(Sl(t,e,n)),o=Rl(Sl(i,n,t)),a=Rl(Sl(i,n,e));return r!==s&&o!==a||(!(0!==r||!Pl(t,i,e))||(!(0!==s||!Pl(t,n,e))||(!(0!==o||!Pl(i,t,n))||!(0!==a||!Pl(i,e,n)))))}function Pl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Rl(t){return t>0?1:t<0?-1:0}function Al(t,e){return Sl(t.prev,t,t.next)<0?Sl(t,e,t.next)>=0&&Sl(t,t.prev,e)>=0:Sl(t,e,t.prev)<0||Sl(t,t.next,e)<0}function Ll(t,e){const i=new Nl(t.i,t.x,t.y),n=new Nl(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Il(t,e,i,n){const r=new Nl(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Dl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Nl(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ol{static area(t){const e=t.length;let i=0;for(let n=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function kl(t,e){for(let i=0;iNumber.EPSILON){const u=Math.sqrt(c),d=Math.sqrt(l*l+h*h),p=e.x-a/u,f=e.y+o/u,m=((i.x-h/d-p)*h-(i.y+l/d-f)*l)/(o*h-a*l);n=p+o*m-t.x,r=f+a*m-t.y;const g=n*n+r*r;if(g<=2)return new ye(n,r);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(h)&&(t=!0),t?(n=-a,r=o,s=Math.sqrt(c)):(n=o,r=a,s=Math.sqrt(c/2))}return new ye(n/s,r/s)}const L=[];for(let t=0,e=T.length,i=e-1,n=t+1;t=0;t--){const e=t/p,i=c*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=T.length;t=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}Hl.prototype.isMeshPhysicalMaterial=!0;class Wl extends $i{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Pe(16777215),this.specular=new Pe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this}}Wl.prototype.isMeshPhongMaterial=!0;class jl extends $i{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Pe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}jl.prototype.isMeshToonMaterial=!0;class ql extends $i{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}ql.prototype.isMeshNormalMaterial=!0;class Xl extends $i{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Pe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Xl.prototype.isMeshLambertMaterial=!0;class Yl extends $i{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Pe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this}}Yl.prototype.isMeshMatcapMaterial=!0;class Jl extends wa{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}Jl.prototype.isLineDashedMaterial=!0;const Zl={arraySlice:function(t,e,i){return Zl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let s=0,o=0;o!==n;++s){const n=i[s]*e;for(let i=0;i!==e;++i)r[o++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(e.push(s.time),i.push.apply(i,o)),s=t[r++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(e.push(s.time),o.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(e.push(s.time),i.push(o)),s=t[r++]}while(void 0!==s)},subclip:function(t,e,i,n,r=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t=n)){l.push(e.times[t]);for(let i=0;is.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=n.times[u]){const t=u*l+a,e=t+l-a;d=Zl.arraySlice(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=l-a;t.evaluate(s),d=Zl.arraySlice(t.resultBuffer,e,i)}if("quaternion"===r){(new ke).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let t=0;t=r)break t;{const o=e[1];t=r)break e}s=i,i=0}}for(;i>>1;te;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Zl.arraySlice(i,r,s),this.values=Zl.arraySlice(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&Zl.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=Zl.arraySlice(this.times),e=Zl.arraySlice(this.values),i=this.getValueSize(),n=2302===this.getInterpolation(),r=t.length-1;let s=1;for(let o=1;o0){t[s]=t[r];for(let t=r*i,n=s*i,o=0;o!==i;++o)e[n+o]=e[t+o];++s}return s!==t.length?(this.times=Zl.arraySlice(t,0,s),this.values=Zl.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=Zl.arraySlice(this.times,0),e=Zl.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}eh.prototype.TimeBufferType=Float32Array,eh.prototype.ValueBufferType=Float32Array,eh.prototype.DefaultInterpolation=2301;class ih extends eh{}ih.prototype.ValueTypeName="bool",ih.prototype.ValueBufferType=Array,ih.prototype.DefaultInterpolation=2300,ih.prototype.InterpolantFactoryMethodLinear=void 0,ih.prototype.InterpolantFactoryMethodSmooth=void 0;class nh extends eh{}nh.prototype.ValueTypeName="color";class rh extends eh{}rh.prototype.ValueTypeName="number";class sh extends Kl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-e)/(n-e);let l=t*o;for(let t=l+o;l!==t;l+=4)ke.slerpFlat(r,0,s,l-o,s,l,a);return r}}class oh extends eh{InterpolantFactoryMethodLinear(t){return new sh(this.times,this.values,this.getValueSize(),t)}}oh.prototype.ValueTypeName="quaternion",oh.prototype.DefaultInterpolation=2301,oh.prototype.InterpolantFactoryMethodSmooth=void 0;class ah extends eh{}ah.prototype.ValueTypeName="string",ah.prototype.ValueBufferType=Array,ah.prototype.DefaultInterpolation=2300,ah.prototype.InterpolantFactoryMethodLinear=void 0,ah.prototype.InterpolantFactoryMethodSmooth=void 0;class lh extends eh{}lh.prototype.ValueTypeName="vector";class hh{constructor(t,e=-1,i,n=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=de(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(ch(i[t]).scale(n));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(eh.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],o=[];Zl.flattenJSON(i,s,o,n),0!==s.length&&r.push(new t(e,s,o))}},n=[],r=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==mh[t])return void mh[t].push({onLoad:e,onProgress:i,onError:n});mh[t]=[],mh[t].push({onLoad:e,onProgress:i,onError:n});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body.getReader)return e;const i=mh[t],n=e.body.getReader(),r=e.headers.get("Content-Length"),s=r?parseInt(r):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){n.read().then(({done:n,value:r})=>{if(n)t.close();else{a+=r.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=i.length;t{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,o));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then(t=>n.decode(t))}}}).then(e=>{uh.add(t,e);const i=mh[t];delete mh[t];for(let t=0,n=i.length;t{const i=mh[t];if(void 0===i)throw this.manager.itemError(t),e;delete mh[t];for(let t=0,n=i.length;t{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class vh extends fh{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=uh.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const o=be("img");function a(){h(),uh.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){h(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class yh extends fh{constructor(t){super(t)}load(t,e,i,n){const r=new Hn,s=new vh(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(i){s.load(t[i],(function(t){r.images[i]=t,o++,6===o&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(let e=0;e0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){o.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){ke.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){const s=this._workIndex*r;ke.multiplyQuaternionsFlat(t,s,t,e,t,i),ke.slerpFlat(t,e,t,e,t,s,n)}_lerp(t,e,i,n,r){const s=1-n;for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]*s+t[i+o]*n}}_lerpAdditive(t,e,i,n,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[i+s]*n}}}const qh=new RegExp("[\\[\\]\\.:\\/]","g"),Xh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Yh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Jh=/(WCOD+)?/.source.replace("WCOD",Xh),Zh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Kh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qh=new RegExp("^"+Yh+Jh+Zh+Kh+"$"),$h=["material","materials","bones"];class tc{constructor(t,e,i){this.path=e,this.parsedPath=i||tc.parseTrackName(e),this.node=tc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new tc.Composite(t,e,i):new tc(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(qh,"")}static parseTrackName(t){const e=Qh.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==$h.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n=r){const s=r++,h=t[s];e[h.uuid]=l,t[l]=h,e[a]=s,t[s]=o;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[l];e[l]=n,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,h=this.nCachedObjects_,c=new Array(l);n=r.length,i[t]=n,s.push(t),o.push(e),r.push(c);for(let i=h,n=a.length;i!==n;++i){const n=a[i];c[i]=new tc(n,t,e)}return c}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=i,s[i]=a,s.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}}).prototype.isAnimationObjectGroup=!0;class ec{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:2400,endingEnd:2400};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,a[1]=r+i,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case 2500:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=2202===i;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}(class extends le{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,s=t._propertyBindings,o=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let h=l[a];void 0===h&&(h={},l[a]=h);for(let t=0;t!==r;++t){const r=n[t],l=r.name;let c=h[l];if(void 0!==c)++c.referenceCount,s[t]=c;else{if(c=s[t],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,a,l));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;c=new jh(tc.create(i,l,n),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,a,l),s[t]=c}o[t].resultBuffer=c.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==i;++o){e[o]._update(n,t,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return nc.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}rc.prototype.isBox2=!0;const sc=new Ue,oc=new Ue;const ac=new Ue,lc=new mi,hc=new mi;const cc=new Float32Array(1);new Int32Array(cc.buffer);Va.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Va.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},ll.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},class extends Ia{constructor(t=10,e=10,i=4473924,n=8947848){i=new Pe(i),n=new Pe(n);const r=e/2,s=t/e,o=t/2,a=[],l=[];for(let t=0,h=0,c=-o;t<=e;t++,c+=s){a.push(-o,0,c,o,0,c),a.push(c,0,-o,c,0,o);const e=t===r?i:n;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}const h=new mn;h.setAttribute("position",new an(a,3)),h.setAttribute("color",new an(l,3));super(h,new wa({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Ia{constructor(t){const e=function t(e){const i=[];e&&e.isBone&&i.push(e);for(let n=0;ns.geoBBox.right||i.south>s.geoBBox.top||i.east + * @author owenm + * @license MIT + */function xc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bc(t){for(var e=1;e=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function Tc(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Cc=Tc(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pc=Tc(/Edge/i),Rc=Tc(/firefox/i),Ac=Tc(/safari/i)&&!Tc(/chrome/i)&&!Tc(/android/i),Lc=Tc(/iP(ad|od|hone)/i),Ic=Tc(/chrome/i)&&Tc(/android/i),Dc={capture:!1,passive:!1};function Nc(t,e,i){t.addEventListener(e,i,!Cc&&Dc)}function Oc(t,e,i){t.removeEventListener(e,i,!Cc&&Dc)}function Gc(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function kc(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Uc(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&Gc(t,e):Gc(t,e))||n&&t===i)return t;if(t===i)break}while(t=kc(t))}return null}var Bc,zc=/\s+/g;function Fc(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(zc," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(zc," ")}}function Vc(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function Hc(t,e){var i="";if("string"==typeof t)i=t;else do{var n=Vc(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function Wc(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,s=n.length;if(i)for(;r=s:r<=s))return n;if(n===jc())break;n=Qc(n,!1)}return!1}function Yc(t,e,i,n){for(var r=0,s=0,o=t.children;s2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=Sc(i,hu);au.pluginEvent.bind(id)(t,e,bc({dragEl:du,parentEl:pu,ghostEl:fu,rootEl:mu,nextEl:gu,lastDownEl:vu,cloneEl:yu,cloneHidden:_u,dragStarted:Iu,putSortable:Su,activeSortable:id.active,originalEvent:n,oldIndex:xu,oldDraggableIndex:Mu,newIndex:bu,newDraggableIndex:wu,hideGhostForTarget:Qu,unhideGhostForTarget:$u,cloneNowHidden:function(){_u=!0},cloneNowShown:function(){_u=!1},dispatchSortableEvent:function(t){uu({sortable:e,name:t,originalEvent:n})}},r))};function uu(t){lu(bc({putSortable:Su,cloneEl:yu,targetEl:du,rootEl:mu,oldIndex:xu,oldDraggableIndex:Mu,newIndex:bu,newDraggableIndex:wu},t))}var du,pu,fu,mu,gu,vu,yu,_u,xu,bu,Mu,wu,Eu,Su,Tu,Cu,Pu,Ru,Au,Lu,Iu,Du,Nu,Ou,Gu,ku=!1,Uu=!1,Bu=[],zu=!1,Fu=!1,Vu=[],Hu=!1,Wu=[],ju="undefined"!=typeof document,qu=Lc,Xu=Pc||Cc?"cssFloat":"float",Yu=ju&&!Ic&&!Lc&&"draggable"in document.createElement("div"),Ju=function(){if(ju){if(Cc)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Zu=function(t,e){var i=Vc(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Yc(t,0,e),s=Yc(t,1,e),o=r&&Vc(r),a=s&&Vc(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+qc(r).width,h=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qc(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var c="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==c?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[Xu]||s&&"none"===i[Xu]&&l+h>n)?"vertical":"horizontal"},Ku=function(t){function e(t,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},n=t.group;n&&"object"==Mc(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},Qu=function(){!Ju&&fu&&Vc(fu,"display","none")},$u=function(){!Ju&&fu&&Vc(fu,"display","")};ju&&document.addEventListener("click",(function(t){if(Uu)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Uu=!1,!1}),!0);var td=function(t){if(du){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,s=t.clientY,Bu.some((function(t){var e=t[nu].options.emptyInsertThreshold;if(e&&!Jc(t)){var i=qc(t),n=r>=i.left-e&&r<=i.right+e,a=s>=i.top-e&&s<=i.bottom+e;return n&&a?o=t:void 0}})),o);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[nu]._onDragOver(i)}}var r,s,o},ed=function(t){du&&du.parentNode[nu]._isOutsideThisEl(t.target)};function id(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Ec({},e),t[nu]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Zu(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==id.supportPointer&&"PointerEvent"in window&&!Ac,emptyInsertThreshold:5};for(var n in au.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var r in Ku(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Yu,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Nc(t,"pointerdown",this._onTapStart):(Nc(t,"mousedown",this._onTapStart),Nc(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Nc(t,"dragover",this),Nc(t,"dragenter",this)),Bu.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Ec(this,ru())}function nd(t,e,i,n,r,s,o,a){var l,h,c=t[nu],u=c.options.onMove;return!window.CustomEvent||Cc||Pc?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=s||qc(e),l.willInsertAfter=a,l.originalEvent=o,t.dispatchEvent(l),u&&(h=u.call(c,l,o)),h}function rd(t){t.draggable=!1}function sd(){Hu=!1}function od(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function ad(t){return setTimeout(t,0)}function ld(t){return clearTimeout(t)}id.prototype={constructor:id,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Du=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,du):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,r=n.preventOnFilter,s=t.type,o=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(o||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,h=n.filter;if(function(t){Wu.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&Wu.push(n)}}(i),!du&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ac||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Uc(a,n.draggable,i,!1))&&a.animated||vu===a)){if(xu=Zc(a),Mu=Zc(a,n.draggable),"function"==typeof h){if(h.call(this,t,a,this))return uu({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),cu("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(h&&(h=h.split(",").some((function(n){if(n=Uc(l,n.trim(),i,!1))return uu({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),cu("filter",e,{evt:t}),!0}))))return void(r&&t.cancelable&&t.preventDefault());n.handle&&!Uc(l,n.handle,i,!1)||this._prepareDragStart(t,o,a)}}},_prepareDragStart:function(t,e,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!du&&i.parentNode===s){var l=qc(i);if(mu=s,pu=(du=i).parentNode,gu=du.nextSibling,vu=i,Eu=o.group,id.dragged=du,Tu={target:du,clientX:(e||t).clientX,clientY:(e||t).clientY},Au=Tu.clientX-l.left,Lu=Tu.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,du.style["will-change"]="all",n=function(){cu("delayEnded",r,{evt:t}),id.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Rc&&r.nativeDraggable&&(du.draggable=!0),r._triggerDragStart(t,e),uu({sortable:r,name:"choose",originalEvent:t}),Fc(du,o.chosenClass,!0))},o.ignore.split(",").forEach((function(t){Wc(du,t.trim(),rd)})),Nc(a,"dragover",td),Nc(a,"mousemove",td),Nc(a,"touchmove",td),Nc(a,"mouseup",r._onDrop),Nc(a,"touchend",r._onDrop),Nc(a,"touchcancel",r._onDrop),Rc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,du.draggable=!0),cu("delayStart",this,{evt:t}),!o.delay||o.delayOnTouchOnly&&!e||this.nativeDraggable&&(Pc||Cc))n();else{if(id.eventCanceled)return void this._onDrop();Nc(a,"mouseup",r._disableDelayedDrag),Nc(a,"touchend",r._disableDelayedDrag),Nc(a,"touchcancel",r._disableDelayedDrag),Nc(a,"mousemove",r._delayedDragTouchMoveHandler),Nc(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&Nc(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){du&&rd(du),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Oc(t,"mouseup",this._disableDelayedDrag),Oc(t,"touchend",this._disableDelayedDrag),Oc(t,"touchcancel",this._disableDelayedDrag),Oc(t,"mousemove",this._delayedDragTouchMoveHandler),Oc(t,"touchmove",this._delayedDragTouchMoveHandler),Oc(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Nc(document,"pointermove",this._onTouchMove):Nc(document,e?"touchmove":"mousemove",this._onTouchMove):(Nc(du,"dragend",this),Nc(mu,"dragstart",this._onDragStart));try{document.selection?ad((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ku=!1,mu&&du){cu("dragStarted",this,{evt:e}),this.nativeDraggable&&Nc(document,"dragover",ed);var i=this.options;!t&&Fc(du,i.dragClass,!1),Fc(du,i.ghostClass,!0),id.active=this,t&&this._appendGhost(),uu({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Cu){this._lastX=Cu.clientX,this._lastY=Cu.clientY,Qu();for(var t=document.elementFromPoint(Cu.clientX,Cu.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Cu.clientX,Cu.clientY))!==e;)e=t;if(du.parentNode[nu]._isOutsideThisEl(t),e)do{if(e[nu]){if(e[nu]._onDragOver({clientX:Cu.clientX,clientY:Cu.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);$u()}},_onTouchMove:function(t){if(Tu){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,r=t.touches?t.touches[0]:t,s=fu&&Hc(fu,!0),o=fu&&s&&s.a,a=fu&&s&&s.d,l=qu&&Gu&&Kc(Gu),h=(r.clientX-Tu.clientX+n.x)/(o||1)+(l?l[0]-Vu[0]:0)/(o||1),c=(r.clientY-Tu.clientY+n.y)/(a||1)+(l?l[1]-Vu[1]:0)/(a||1);if(!id.active&&!ku){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))n.right+10||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+10}(t,r,this)&&!m.animated){if(m===du)return L(!1);if(m&&s===t.target&&(o=m),o&&(i=qc(o)),!1!==nd(mu,s,du,e,o,i,t,!!o))return A(),s.appendChild(du),pu=s,I(),L(!0)}else if(m&&function(t,e,i){var n=qc(Yc(i.el,0,i.options,!0));return e?t.clientXc+h*s/2:lu-Ou)return-Nu}else if(l>c+h*(1-r)/2&&lu-h*s/2))return l>c+h/2?1:-1;return 0}(t,o,i,r,b?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Fu,Du===o))){var S=Zc(du);do{S-=v,_=pu.children[S]}while(_&&("none"===Vc(_,"display")||_===fu))}if(0===v||_===o)return L(!1);Du=o,Nu=v;var T=o.nextElementSibling,C=!1,P=nd(mu,s,du,e,o,i,t,C=1===v);if(!1!==P)return 1!==P&&-1!==P||(C=1===P),Hu=!0,setTimeout(sd,30),A(),C&&!T?s.appendChild(du):o.parentNode.insertBefore(du,C?T:o),w&&eu(w,0,E-w.scrollTop),pu=du.parentNode,void 0===y||Fu||(Ou=Math.abs(y-qc(o)[M])),I(),L(!0)}if(s.contains(du))return L(!1)}return!1}function R(a,l){cu(a,p,bc({evt:t,isOwner:c,axis:r?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:d,target:o,completed:L,onMove:function(i,n){return nd(mu,s,du,e,i,qc(i),t,n)},changed:I},l))}function A(){R("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function L(e){return R("dragOverCompleted",{insertion:e}),e&&(c?h._hideClone():h._showClone(p),p!==d&&(Fc(du,Su?Su.options.ghostClass:h.options.ghostClass,!1),Fc(du,a.ghostClass,!0)),Su!==p&&p!==id.active?Su=p:p===id.active&&Su&&(Su=null),d===p&&(p._ignoreWhileAnimating=o),p.animateAll((function(){R("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(o===du&&!du.animated||o===s&&!o.animated)&&(Du=null),a.dragoverBubble||t.rootEl||o===document||(du.parentNode[nu]._isOutsideThisEl(t.target),!e&&td(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){bu=Zc(du),wu=Zc(du,a.draggable),uu({sortable:p,name:"change",toEl:s,newIndex:bu,newDraggableIndex:wu,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Oc(document,"mousemove",this._onTouchMove),Oc(document,"touchmove",this._onTouchMove),Oc(document,"pointermove",this._onTouchMove),Oc(document,"dragover",td),Oc(document,"mousemove",td),Oc(document,"touchmove",td)},_offUpEvents:function(){var t=this.el.ownerDocument;Oc(t,"mouseup",this._onDrop),Oc(t,"touchend",this._onDrop),Oc(t,"pointerup",this._onDrop),Oc(t,"touchcancel",this._onDrop),Oc(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;bu=Zc(du),wu=Zc(du,i.draggable),cu("drop",this,{evt:t}),pu=du&&du.parentNode,bu=Zc(du),wu=Zc(du,i.draggable),id.eventCanceled||(ku=!1,Fu=!1,zu=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ld(this.cloneId),ld(this._dragStartId),this.nativeDraggable&&(Oc(document,"drop",this),Oc(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ac&&Vc(document.body,"user-select",""),Vc(du,"transform",""),t&&(Iu&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),fu&&fu.parentNode&&fu.parentNode.removeChild(fu),(mu===pu||Su&&"clone"!==Su.lastPutMode)&&yu&&yu.parentNode&&yu.parentNode.removeChild(yu),du&&(this.nativeDraggable&&Oc(du,"dragend",this),rd(du),du.style["will-change"]="",Iu&&!ku&&Fc(du,Su?Su.options.ghostClass:this.options.ghostClass,!1),Fc(du,this.options.chosenClass,!1),uu({sortable:this,name:"unchoose",toEl:pu,newIndex:null,newDraggableIndex:null,originalEvent:t}),mu!==pu?(bu>=0&&(uu({rootEl:pu,name:"add",toEl:pu,fromEl:mu,originalEvent:t}),uu({sortable:this,name:"remove",toEl:pu,originalEvent:t}),uu({rootEl:pu,name:"sort",toEl:pu,fromEl:mu,originalEvent:t}),uu({sortable:this,name:"sort",toEl:pu,originalEvent:t})),Su&&Su.save()):bu!==xu&&bu>=0&&(uu({sortable:this,name:"update",toEl:pu,originalEvent:t}),uu({sortable:this,name:"sort",toEl:pu,originalEvent:t})),id.active&&(null!=bu&&-1!==bu||(bu=xu,wu=Mu),uu({sortable:this,name:"end",toEl:pu,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){cu("nulling",this),mu=du=pu=fu=gu=yu=vu=_u=Tu=Cu=Iu=bu=wu=xu=Mu=Du=Nu=Su=Eu=id.dragged=id.ghost=id.clone=id.active=null,Wu.forEach((function(t){t.checked=!0})),Wu.length=Pu=Ru=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":du&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,r=i.length,s=this.options;n1&&(e=1),e<0&&(e=0);var i=document.getElementById(this._addUID("GPopacityValueDiv_ID_"+t));i&&(i.value=Math.round(100*e));var n=document.getElementById(this._addUID("GPopacityValue_ID_"+t));n&&(n.innerHTML=Math.round(100*e)+"%")},Cd.prototype._onVisibilityLayerClick=function(t){var e=this.getGlobe(),i=this._resolveLayerId(t.target.id);e.setLayerVisibility(i,t.target.checked)},Cd.prototype._updateLayerVisibility=function(t,e){var i=document.getElementById(this._addUID("GPvisibility_ID_"+t));i&&(i.checked=e)},Cd.prototype._onOpenLayerInfoClick=function(t){var e,i,n=this._resolveLayerId(t.target.id),r=this._layers[n],s=document.getElementById(t.target.id);if("GPlayerInfoOpened"===s.className)return void 0!==s.classList&&(s.classList.remove("GPlayerInfoOpened"),s.classList.add("GPlayerInfo")),void 0!==(e=document.getElementById(this._addUID("GPlayerInfoPanel"))).classList&&(e.classList.remove("GPpanel"),e.classList.remove("GPlayerInfoPanelOpened"),e.classList.add("GPlayerInfoPanelClosed")),i=document.getElementById(this._addUID("GPlayerInfoContent")),void e.removeChild(i);for(var o=document.getElementsByClassName("GPlayerInfoOpened"),a=0;a=0;n&&!i.inRange?(i.inRange=!0,document.getElementById(this._addUID("GPlayerSwitcher_ID_"+i.id)).classList.remove("outOfRange")):!n&&i.inRange&&(i.inRange=!1,document.getElementById(this._addUID("GPlayerSwitcher_ID_"+i.id)).classList.add("outOfRange"))}}},Cd.prototype._updateLayerListContainer=function(){if(this._layerListContainer){for(var t=this.getGlobe();this._layerListContainer.firstChild;)this._layerListContainer.removeChild(this._layerListContainer.firstChild);for(var e=t.getColorLayers().sort((function(t,e){return e.sequence-t.sequence})),i=0;ir.max&&(s=r.max),se.max&&(t=e.max),te&&(n=!1),n&&d&&dn&&n>c))continue}else if(!(o[a].constraints[0].minScaleDenominator=1e3&&(i/=1e3,s="km"),e.getElement().innerHTML=i+" "+s,e.getElement().style.width=r+"px"},t.isInitialized()?this._callbacks.onChangedViewCallback():t.listen(ee.EVENTS.GLOBE_INITIALIZED,this._callbacks.onChangedViewCallback),t.listen(ee.EVENTS.RANGE_CHANGED,this._callbacks.onChangedViewCallback)}else if(null==t){for(this._globe.forget(ee.EVENTS.GLOBE_INITIALIZED,this._callbacks.onChangedViewCallback),this._globe.forget(ee.EVENTS.RANGE_CHANGED,this._callbacks.onChangedViewCallback);this.getElement().hasChildNodes();)this.getElement().removeChild(this.getElement().lastChild);this.getElement().parentNode.removeChild(this.getElement())}pc.prototype.setGlobe.call(this,t)},qd.prototype._initialize=function(){this._uid=se.generate(),this._ScaleContainer=null,this._callbacks={}},qd.prototype._initContainer=function(){return this._createMainContainerElement()};var Xd=qd,Yd={_addUID:function(t){return this._uid?t+"-"+this._uid:t},_createMainContainerElement:function(){var t=document.createElement("div");return t.id=this._addUID("GPminiglobeContainer"),t.className="GPwidget",t.style.width="100px",t.style.height="100px",t}};function Jd(t){return(Jd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zd(t){if(t=t||{},!(this instanceof Zd))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if("object"!==Jd(t))throw new Error("ERROR WRONG_TYPE : options should be an object");this._initialize();var e=this._initContainer();this._options=t,pc.call(this,{name:"Overview",element:e,target:t.target,position:t.position})}Zd.prototype=Object.create(pc.prototype,{}),re.assign(Zd.prototype,Yd),Zd.prototype.constructor=Zd,Zd.prototype.setGlobe=function(t){if(t){var e=t.getCenter(),i=new ee(this._element,e,{maxSubdivisionLevel:6,sseSubdivisionThreshold:3,noControls:!0});i.setBackground();var n=function(){var e=t.getGlobeView().camera.camera3D.position.length(),n=Math.min(Math.max(e,665e4),3e7),r=i.getGlobeView().camera.camera3D,s=t.getGlobeView().controls.getCameraTargetPosition();r.position.copy(s).setLength(n),r.lookAt(s),i.notifyChange(r)};t.listen(ee.EVENTS.AFTER_RENDER,n),t.isInitialized()?n():t.listen(ee.EVENTS.GLOBE_INITIALIZED,n);var r=this._options.layer;i.addLayer(r),this._globeObj=i}else if(null==t){for(;this.getElement().hasChildNodes();)this.getElement().removeChild(this.getElement().lastChild);this.getElement().parentNode.removeChild(this.getElement())}pc.prototype.setGlobe.call(this,t)},Zd.prototype._initialize=function(){this._uid=se.generate(),this._MiniGlobeContainer=null,this._callbacks={}},Zd.prototype._initContainer=function(){return this._createMainContainerElement()};var Kd=Zd,Qd=i(1),$d=l.getLogger("wmtsLayer");function tp(t){if(!(this instanceof tp))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!0),!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"WMTS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"WMTS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"WMTS");"EPSG:3857"===n.projection?n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):(n.projection="EPSG:4326",n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top)),0===Object.entries(n.tileMatrixSetLimits).length&&n.tileMatrixSetLimits.constructor===Object&&(n.tileMatrixSetLimits=void 0),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Qt.WMTSSource({protocol:"wmts",url:n.url.replace(/(http|https):\/\//,s),networkOptions:{crossOrigin:"omit"},updateStrategy:{type:0,options:{}},projection:n.projection,attribution:n.originators,name:t.layer,format:n.format,tileMatrixSet:n.TMSLink,tileMatrixSetLimits:n.tileMatrixSetLimits,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Kt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),re.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Qt.ColorLayer(i.id,i)}$d.error("ERROR layer id (layer name: "+t.layer+" / service: WMTS ) was not found !?")}tp.prototype.constructor=tp;var ep=tp,ip=l.getLogger("wmsLayer");function np(t){if(!(this instanceof np))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!0),!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"WMS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"WMS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"WMS");"EPSG:3857"===n.projection?n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Qt.WMSSource({protocol:"wms",version:n.version,attribution:n.originators,url:n.url.replace(/(http|https):\/\//,s),name:t.layer,projection:n.projection,style:"",heightMapWidth:256,waterMask:!1,networkOptions:{crossOrigin:"omit"},updateStrategy:{type:0,options:{}},format:n.format,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Kt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),re.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Qt.ColorLayer(i.id,i)}ip.error("ERROR layer id (layer name: "+t.layer+" / service: WMS ) was not found !?")}np.prototype.constructor=np;var rp=np,sp=l.getLogger("elevationLayer");function op(t){if(!(this instanceof op))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(void 0===t.ssl&&(t.ssl=!1),!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"WMTS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"WMTS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"WMTS");"EPSG:3857"===n.projection?n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top).as("EPSG:3857"):(n.projection="EPSG:4326",n.extent=new Qt.Extent("EPSG:4326",n.extent.left,n.extent.right,n.extent.bottom,n.extent.top)),t.itownsParams&&t.itownsParams.source&&t.itownsParams.source.attribution&&(n.originators=t.itownsParams.source.attribution);var s="undefined"!=typeof window?window:"undefined"!=typeof self?self:null,o=s?s.location&&s.location.protocol&&0===s.location.protocol.indexOf("https:")?"https://":"http://":t.ssl?"https://":"http://";return i.id=e,i.noDataValue=-99999,i.updateStrategy={type:0,options:{groups:[11,14]}},i.source=new Qt.WMTSSource({protocol:"wmts",url:n.url.replace(/(http|https):\/\//,o),networkOptions:{crossOrigin:"omit"},attribution:n.originators,projection:n.projection,name:t.layer,format:"image/x-bil;bits=32",tileMatrixSet:n.TMSLink,tileMatrixSetLimits:n.tileMatrixSetLimits,extent:{west:n.extent.west,east:n.extent.east,south:n.extent.south,north:n.extent.north}}),i.source.url=Kt.Helper.normalyzeUrl(i.source.url,{"gp-itowns-ext":r.itownsExtVersion||r.version},!1),re.mergeParams(i,t.itownsParams),i.legends=t.legends||n.legends,i.metadata=t.metadata||n.metadata,i.description=t.description||n.description,i.title=t.title||n.title,i.quicklookUrl=t.quicklookUrl||n.quicklookUrl,new Qt.ElevationLayer(i.id,i)}sp.log("[source WMTS] ERROR : "+t.layer+" cannot be found in Geoportal Configuration. Make sure that this resource is included in your contract key.")}op.prototype.constructor=op;var ap=op,lp=l.getLogger("vectorTileLayer");function hp(t){if(!(this instanceof hp))throw new TypeError("ERROR CLASS_CONSTRUCTOR");if(!t.layer)throw new Error("ERROR PARAM_MISSING : layer");if("string"!=typeof t.layer)throw new Error("ERROR WRONG TYPE : layer");if(!Qd.a.isConfigLoaded())throw new Error("ERROR : Configuration has to be loaded");var e=Qd.a.configuration.getLayerId(t.layer,"TMS");if(e&&Qd.a.configuration.getLayerParams(t.layer,"TMS")){var i={},n=Qd.a.configuration.getLayerParams(t.layer,"TMS"),r=!1===t.ssl?"http://":"https://";return i.id=e,i.source=new Qt.VectorTilesSource({style:n.url.replace(/(http|https):\/\//,r),url:t.urlService,attribution:t.attributions,filter:t.filter,zoom:t.zoom}),i.isValidData=function(){return!1},new Qt.ColorLayer(i.id,i)}lp.error("ERROR layer id (layer name: "+t.layer+" / service: TMS ) was not found !?")}hp.prototype.constructor=hp;var cp=hp;!function(){var t=document.getElementsByTagName("script"),e=t[t.length-1].getAttribute("data-key"),i=t[t.length-1].getAttribute("data-url"),n=t[t.length-1].getAttribute("data-timeout");if(e||i){var r={apiKey:e,sync:!0,onSuccess:function(){},onFailure:function(t){throw new Error("Configuration load failed : "+t.message)}};i&&(r.customConfigFile=i,r.callbackSuffix=""),n&&(r.timeOut=n),window.Gp||Kt.Services.getConfig(r)}}();var up={proxifyUrl:function(t,e){var i=l.getLogger("proxifyUrl");if(!e||!e.hasOwnProperty("proxyUrl")||null===e.proxyUrl||0===e.proxyUrl.trim().length)return t;if(e.noProxyDomains&&Array.isArray(e.noProxyDomains)&&e.noProxyDomains.length>0)for(var n in e.noProxyDomains)if(i.trace("[ProxyUtils] proxifyUrl : analyzing "+e.noProxyDomains[n]),-1!==t.indexOf(e.noProxyDomains[n]))return i.info("[ProxyUtils] proxifyUrl : "+t+" found in noProxyDomains list ("+e.noProxyDomains[n]+")."),t;return e.proxyUrl+encodeURIComponent(t)}},dp={hex:function(t){if(t>255)throw new Error("'"+t+"'' is greater than 255(0xff);");return("0"+Number(t).toString(16)).slice(-2)},num:function(t){return parseInt(t,16)},arrayToRgba:function(t){if(!Array.isArray(t))throw new Error("Not an array !");var e=t[0],i=t[1],n=t[2],r=t[3]||1;return"rgba("+e+", "+i+", "+n+", "+parseFloat(r)+")"},arrayToHex:function(t){if(!Array.isArray(t))throw new Error("Not an array !");var e=t[0],i=t[1],n=t[2],r=t[3],s=[this.hex(e),this.hex(i),this.hex(n)],o={};return o.hex="#"+s.join(""),r&&(o.opacity=parseFloat(r)),o},rgbaToHex:function(t){var e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/.exec(t);if(!e)throw new Error("Invalid format: "+t);var i=e[1],n=e[2],r=e[3],s=e[4],o=[this.hex(i),this.hex(n),this.hex(r)],a={};return a.hex="#"+o.join(""),s&&(a.opacity=parseFloat(s)),a},hexToRgba:function(t,e){if(!t)throw new Error("Invalid format");t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return(i=i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null)?"rgba("+i.r+", "+i.g+", "+i.b+", "+e+")":null},isHex:function(t){if(!t)return!1;if("#"!==t.charAt(0))return!1;return!!/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t)},isRGB:function(t){if(!t)return!1;return!!/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(0?.?\d+)\s*)?\)/.exec(t)}},pp={modulo:function(t,e){var i=t%e;return i*e<0?i+e:i},decimalToDMS:function(t,e,i){var n=this.modulo(t+180,360)-180,r=Math.abs(3600*n),s=i||0,o=Math.pow(10,s),a=Math.floor(r/3600),l=Math.floor((r-3600*a)/60),h=r-3600*a-60*l;return(h=Math.ceil(h*o)/o)>=60&&(h=0,l+=1),l>=60&&(l=0,a+=1),{d:a,m:l,s:h,direction:e.charAt(n<0?1:0)}},toInteger:function(t,e){var i=parseInt(t,e||10);return!isNaN(i)&&isFinite(i)?i:null},isInteger:function(t){if(isNaN(t))return!1;var e=parseFloat(t);return(0|e)===e},toFloat:function(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}};function fp(t){return(fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var mp=Kt.Services,gp=Kt.Error,vp=Kt.Helper,yp=Kt.Protocols,_p=Kt.servicesDate,xp=Kt.servicesVersion;function bp(t,e){return function t(e,i){for(var n in e)e.hasOwnProperty(n)&&(i.hasOwnProperty(n)?"object"===fp(e[n])&&t(e[n],i[n]):i[n]=e[n])}(t,e)}var Mp=r.itownsExtVersion||r.version,wp=r.date,Ep={control:{}};Ep.control.MousePosition=_c,Ep.control.LayerSwitcher=Pd,Ep.control.BoostRelief=Dd,Ep.control.Buildings=kd,Ep.control.Attributions=Hd,Ep.control.Scale=Xd,Ep.control.MiniGlobe=Kd,Ep.layer={},Ep.layer.GeoportalWMTS=ep,Ep.layer.GeoportalWMS=rp,Ep.layer.GeoportalElevation=ap,Ep.layer.VectorTileLayer=cp,Ep.CRS=mc,Ep.GlobeViewExtended=ee,window.itowns&&(bp(Ep,window.itowns),bp(window.itowns,Ep))}])})); \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts b/itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts new file mode 100644 index 000000000..100081bbe --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts @@ -0,0 +1,179 @@ +export default CRS; +declare var CRS: { + /** + * CRS : WGS84 + * + * @property EPSG:4326 + * @private + */ + "EPSG:4326": string; + /** + * CRS : PseudoMercator + * + * @property EPSG:3857 + * @private + */ + "EPSG:3857": string; + /** + * CRS : Lambert 93 + * + * @property EPSG:2154 + * @private + */ + "EPSG:2154": string; + /** + * CRS : Lambert 2 extended + * + * @property EPSG:27572 + * @private + */ + "EPSG:27572": string; + /** + * CRS : UTM 20N (Guadeloupe, Martinique) + * + * @property EPSG:32620 + * @private + */ + "EPSG:32620": string; + /** + * CRS : UTM 21N (Saint-Pierre-et-Miquelon) + * + * @property EPSG:4467 + * @private + */ + "EPSG:4467": string; + /** + * CRS : UTM 22N (Guyane) + * + * @property EPSG:2972 + * @private + */ + "EPSG:2972": string; + /** + * CRS : UTM 30N (France métropolitaine) + * + * @property EPSG:32630 + * @private + */ + "EPSG:32630": string; + /** + * CRS : UTM 31N (France métropolitaine) + * + * @property EPSG:32631 + * @private + */ + "EPSG:32631": string; + /** + * CRS : UTM 32N (France métropolitaine) + * + * @property EPSG:32632 + * @private + */ + "EPSG:32632": string; + /** + * CRS : UTM 38S (Mayotte) + * + * @property EPSG:4471 + * @private + */ + "EPSG:4471": string; + /** + * CRS : UTM 40S (Réunion) + * + * @property EPSG:2975 + * @private + */ + "EPSG:2975": string; + /** + * CRS : UTM 5S (Polynésie) + * + * @property EPSG:3296 + * @private + */ + "EPSG:3296": string; + /** + * CRS : UTM 6S (Polynésie) + * + * @property EPSG:3297 + * @private + */ + "EPSG:3297": string; + /** + * CRS : UTM 7S (Polynésie) + * + * @property EPSG:32707 + * @private + */ + "EPSG:32707": string; + /** + * CRS : UTM 8S (Polynésie) + * + * @property EPSG:32708 + * @private + */ + "EPSG:32708": string; + /** + * CRS : UTM 12N (Ile de Clipperton) + * + * @property EPSG:26912 + * @private + */ + "EPSG:26912": string; + /** + * CRS : UTM 42S (Iles Kerguelen) + * + * @property EPSG:32742 + * @private + */ + "EPSG:32742": string; + /** + * CRS : UTM 39S (Iles Crozet) + * + * @property EPSG:32739 + * @private + */ + "EPSG:32739": string; + /** + * CRS : UTM 43S (Iles St-Paul et Amsterdam) + * + * @property EPSG:32743 + * @private + */ + "EPSG:32743": string; + /** + * CRS : Stéréographique polaire (Terre Adelie) + * + * @property EPSG:2986 + * @private + */ + "EPSG:2986": string; + /** + * CRS : UTM 37S (Iles du canal de Mozambique) + * + * @property EPSG:32737 + * @private + */ + "EPSG:32737": string; + /** + * CRS : UTM 38S (Iles du canal de Mozambique) + * + * @property EPSG:32738 + * @private + */ + "EPSG:32738": string; + /** + * CRS : UTM 1S (Wallis-et-Futuna) + * + * @property EPSG:2988 + * @private + */ + "EPSG:2988": string; + /** + * CRS : RGNC91-93 (Nouvelle-Calédonie) + * + * @property EPSG:3163 + * @private + */ + "EPSG:3163": string; +}; +//# sourceMappingURL=CRS.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts.map new file mode 100644 index 000000000..df64d8bf2 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/CRS/CRS.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CRS.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/CRS/CRS.js"],"names":[],"mappings":";AAAA;IAEI;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;EAEL"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts new file mode 100644 index 000000000..3bd9f0749 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts @@ -0,0 +1,112 @@ +export default Attributions; +/** + * @classdesc + * Control to manage layers attributions + * + * @constructor + * @alias itowns.control.Attributions + * @extends {itowns.control.Widget} + * @param {Object} aOptions - control options + * @param {Object} [aOptions.options] - Itowns.control.Control options + * @param {Boolean} [aOptions.options.collapsed = false] - Specify if the control has to be opened or not. + * @fires attributions:update + * @example + * var attribution = new itowns.control.Attritbution({ + * options : { + * collapsed: true + * } + * }); + * // listeners for attributions update : + * attribution.addEventListener("attributions:update", function (e) {...}); + */ +declare function Attributions(aOptions: { + options?: { + collapsed?: boolean | undefined; + } | undefined; +}): void; +declare class Attributions { + /** + * @classdesc + * Control to manage layers attributions + * + * @constructor + * @alias itowns.control.Attributions + * @extends {itowns.control.Widget} + * @param {Object} aOptions - control options + * @param {Object} [aOptions.options] - Itowns.control.Control options + * @param {Boolean} [aOptions.options.collapsed = false] - Specify if the control has to be opened or not. + * @fires attributions:update + * @example + * var attribution = new itowns.control.Attritbution({ + * options : { + * collapsed: true + * } + * }); + * // listeners for attributions update : + * attribution.addEventListener("attributions:update", function (e) {...}); + */ + constructor(aOptions: { + options?: { + collapsed?: boolean | undefined; + } | undefined; + }); + /** + * Constructor (alias) + * + * @private + */ + private constructor; + /** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ + setGlobe(globe: GlobeViewExtended): void; + /** + * Collapse or display control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ + setCollapsed(collapsed: boolean): void; + /** + * Returns true if widget is collapsed (minimize), false otherwise + * + * @return {Boolean} collapsed + */ + getCollapsed(): boolean; + private _initialize; + _uid: number | undefined; + _AttributionContainer: any; + _callbacks: {} | undefined; + _options: Object | undefined; + private _initContainer; + _attributionListContainer: any; + private _inRangeUpdate; + private _updateAttributionListContainer; + _resolutionsWGS84: { + 0: number; + 1: number; + 2: number; + 3: number; + 4: number; + 5: number; + 6: number; + 7: number; + 8: number; + 9: number; + 10: number; + 11: number; + 12: number; + 13: number; + 14: number; + 15: number; + 16: number; + 17: number; + 18: number; + 19: number; + 20: number; + 21: number; + }; +} +import GlobeViewExtended from "../GlobeViewExtended"; +//# sourceMappingURL=Attributions.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts.map new file mode 100644 index 000000000..ba17139ac --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Attributions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Attributions.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/Attributions.js"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAZ6B,OAAO;;;SAoCnC;;IA5CD;;;;;;;;;;;;;;;;;;;OAmBG;IACH;QAZ6B,OAAO;;;OAoCnC;IAUD;;;;OAIG;IACH,oBAAkC;IAMlC;;;;OAIG;IACH,gBAFW,iBAAiB,QAkC3B;IAED;;;;OAIG;IACH,uCAWC;IAED;;;;OAIG;IACH,wBAEC;IAYoC,oBAYpC;IAVG,yBAAiC;IAGjC,2BAAiC;IAGjC,2BAAoB;IAGpB,6BAAuB;IAWa,uBAsBvC;IAVc,+BAA4E;IAqBnD,uBAuEvC;IAawD,wCAoBxD;IAED;;;;;;;;;;;;;;;;;;;;;;;MAAwC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts new file mode 100644 index 000000000..8fc237cfb --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts @@ -0,0 +1,107 @@ +export default BoostRelief; +/** + * @classdesc + * Control to exagerate the elevation + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.BoostRelief + * @param {Object} brOptions - control options + * @param {Object} [brOptions.scale] - Defines the scale used to boost the relief + * @param {Number} [brOptions.scale.min] - Minimum of the scale - 1 by default + * @param {Number} [brOptions.scale.max] - Maximum of the scale - 50 by default + * @param {Number} [brOptions.scale.step] - Step of the scale - 1 by default + * @param {Boolean} [brOptions.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading. + * @param {Boolean} [brOptions.defaultBoost = 1] - Default boost value applied to the widget and the elevation layers when loaded + * @example + * var boostRelief = new itowns.control.BoostRelief({ + * scale : { + * max : 30, + * step : 2 + * }, + * defaultBoost : 6 + * }) + */ +declare function BoostRelief(brOptions: { + scale?: { + min?: number | undefined; + max?: number | undefined; + step?: number | undefined; + } | undefined; + collapsed?: boolean | undefined; + defaultBoost?: boolean | undefined; +}): void; +declare class BoostRelief { + /** + * @classdesc + * Control to exagerate the elevation + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.BoostRelief + * @param {Object} brOptions - control options + * @param {Object} [brOptions.scale] - Defines the scale used to boost the relief + * @param {Number} [brOptions.scale.min] - Minimum of the scale - 1 by default + * @param {Number} [brOptions.scale.max] - Maximum of the scale - 50 by default + * @param {Number} [brOptions.scale.step] - Step of the scale - 1 by default + * @param {Boolean} [brOptions.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading. + * @param {Boolean} [brOptions.defaultBoost = 1] - Default boost value applied to the widget and the elevation layers when loaded + * @example + * var boostRelief = new itowns.control.BoostRelief({ + * scale : { + * max : 30, + * step : 2 + * }, + * defaultBoost : 6 + * }) + */ + constructor(brOptions: { + scale?: { + min?: number | undefined; + max?: number | undefined; + step?: number | undefined; + } | undefined; + collapsed?: boolean | undefined; + defaultBoost?: boolean | undefined; + }); + /** + * Constructor (alias) + * + * @private + */ + private constructor; + /** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ + setGlobe(globe: GlobeViewExtended): void; + /** + * Collapse or display control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ + setCollapsed(collapsed: boolean): void; + /** + * Returns true if widget is collapsed (minimize), false otherwise + * @return {Boolean} is collapsed + */ + getCollapsed(): boolean; + private _initialize; + _uid: number | undefined; + _layers: {} | undefined; + _callbacks: {} | undefined; + private _initContainer; + _boostReliefListContainer: any; + private _onChangeLayerRelief; + private _updateLayersRelief; + /** + * Updates relief slider and all elevation layers with the given boost value + * + * @method changeBoost + * @param {Number} reliefValue - relief value + */ + changeBoost(reliefValue: number): void; + private _resolveLayerId; +} +//# sourceMappingURL=BoostRelief.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts.map new file mode 100644 index 000000000..304a00a4b --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/BoostRelief.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BoostRelief.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/BoostRelief.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAf8B,KAAK;;;;;IAIJ,SAAS;IACT,YAAY;SAkC1C;;IA/CD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH;QAf8B,KAAK;;;;;QAIJ,SAAS;QACT,YAAY;OAkC1C;IAUD;;;;OAIG;IACH,oBAAiC;IAMjC;;;;OAIG;IACH,yCAYC;IAED;;;;OAIG;IACH,uCAsBC;IAED;;;OAGG;IACH,wBAEC;IAWmC,oBASnC;IAPG,yBAAiC;IAGjC,wBAAiB;IAGjB,2BAAoB;IAWe,uBAyBtC;IAjBc,+BAA2E;IA+B7C,6BAO5C;IAU2C,4BAa3C;IAED;;;;;OAKG;IAEH,uCA2BC;IAUuC,wBAGvC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts new file mode 100644 index 000000000..cc5452043 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts @@ -0,0 +1,95 @@ +export default Buildings; +/** + * @classdesc + * Control to display buildings on the map + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.Buildings + * @param {Object} buildingsOptions - control options + * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT + * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground + * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation + * @param {Integer} [buildingsOptions.minZoom = 15] - minimum level of zoom the buildings are displayed. 15 by default. Lower is the value, lower are the performances. + * @example + * var buildings = new itowns.control.Buildings ({ + * MNT : false, + * buildingsOnGround : false, + * target : “controlDiv” + * }) + */ +declare function Buildings(buildingsOptions: { + MNT?: boolean | undefined; + buildingsOnGround?: boolean | undefined; + defaultVisibility?: boolean | undefined; + minZoom?: any; +}): void; +declare class Buildings { + /** + * @classdesc + * Control to display buildings on the map + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.Buildings + * @param {Object} buildingsOptions - control options + * @param {Boolean} [buildingsOptions.MNT = true] - Adds and displays the MNT + * @param {Boolean} [buildingsOptions.buildingsOnGround = false] - Display the buildings at their elevation or on the ground + * @param {Boolean} [buildingsOptions.defaultVisibility = true] - Visibility of the Buildings Layer at the initialisation + * @param {Integer} [buildingsOptions.minZoom = 15] - minimum level of zoom the buildings are displayed. 15 by default. Lower is the value, lower are the performances. + * @example + * var buildings = new itowns.control.Buildings ({ + * MNT : false, + * buildingsOnGround : false, + * target : “controlDiv” + * }) + */ + constructor(buildingsOptions: { + MNT?: boolean | undefined; + buildingsOnGround?: boolean | undefined; + defaultVisibility?: boolean | undefined; + minZoom?: any; + }); + /** + * Constructor (alias) + * + * @private + */ + private constructor; + /** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ + setGlobe(globe: GlobeViewExtended): void; + private _initialize; + _uid: number | undefined; + _options: Object | undefined; + _callbacks: {} | undefined; + private _initContainer; + private addMNT; + /** + * Adds or removes the buildings layer on click + * + * @method addBuildings + * @param {options} options for the buildings control + */ + addBuildings(options: { + MNT?: boolean | undefined; + buildingsOnGround?: boolean | undefined; + defaultVisibility?: boolean | undefined; + minZoom?: any; + }): void; + /** + * Set the buildings visibility on click + * + * @method setBuildingsVisibility + * @param {Tring} layerId - layer id for the building layer + */ + setBuildingsVisibility(layerId: Tring): void; + private _toggleBuildingsButton; + private onWidgetAdded; + private addListener; + private setOptions; +} +//# sourceMappingURL=Buildings.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts.map new file mode 100644 index 000000000..6d9220753 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Buildings.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Buildings.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/Buildings.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAXsC,GAAG;IACH,iBAAiB;IACjB,iBAAiB;IACjB,OAAO;SAgC5C;;IA3CD;;;;;;;;;;;;;;;;;;OAkBG;IACH;QAXsC,GAAG;QACH,iBAAiB;QACjB,iBAAiB;QACjB,OAAO;OAgC5C;IAUD;;;;OAIG;IACH,oBAA+B;IAM/B;;;;OAIG;IACH,yCASC;IAaiC,oBASjC;IAPG,yBAAiC;IAGjC,6BAAuB;IAGvB,2BAAoB;IAWa,uBAQpC;IAS4B,eAoG5B;IAED;;;;;OAKG;IACH;;;;;aAuDC;IAED;;;;;OAKG;IACH,6CAQC;IAW4C,+BAQ5C;IAUmC,sBASnC;IASiC,oBAIjC;IASgC,mBAahC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts new file mode 100644 index 000000000..020d7f7ff --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts @@ -0,0 +1,163 @@ +export default LayerSwitcher; +/** + * @classdesc + * Control to manage globe layers : their order, visibility and opacity, and display their informations (title, description, legends, metadata...) + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.LayerSwitcher + * @param {Object} lsOptions - control options + * @param {Array} [lsOptions.layers] - list of layers to be configured. Each array element is an object, with following properties : + * @param {String} [lsOptions.layers.id] - ol.layer.Layer layer to be configured (that has been added to globe) + * @param {Object} [lsOptions.layers.config] - custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties : + * @param {String} [lsOptions.layers.config.title] - layer alias, to be displayed in widget layer list. E.g. : "Cartes IGN" + * @param {String} [lsOptions.layers.config.description] - layer description, to be displayed on title hover, or in layer information panel. + * @param {String} [lsOptions.layers.config.quicklookUrl] - link to a quick look image for this layer. + * @param {Array} [lsOptions.layers.config.legends] - array of layer legends. Each array element is an object, with following properties : + * - url (String, mandatory) : link to a legend + * - minScaleDenominator (Number, optional) : min scale denominator for legend validity. + * @param {Array} [lsOptions.layers.config.metadata] - array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata + * @param {Object} [lsOptions.options] - Itowns.control.Control options + * @param {Boolean} [lsOptions.options.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading. + * @example + * var layerSwitcher = new itowns.control.LayerSwitcher({ + * layers : [ + * { + * id : "myLayer", + * config : { + * title : "test layer name 1", + * description : "test layer desc 1", + * } + * } + * ], + * options : { + * collapsed : false + * } + * )); + */ +declare function LayerSwitcher(lsOptions: { + layers?: any[] | undefined; +}): void; +declare class LayerSwitcher { + /** + * @classdesc + * Control to manage globe layers : their order, visibility and opacity, and display their informations (title, description, legends, metadata...) + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.LayerSwitcher + * @param {Object} lsOptions - control options + * @param {Array} [lsOptions.layers] - list of layers to be configured. Each array element is an object, with following properties : + * @param {String} [lsOptions.layers.id] - ol.layer.Layer layer to be configured (that has been added to globe) + * @param {Object} [lsOptions.layers.config] - custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties : + * @param {String} [lsOptions.layers.config.title] - layer alias, to be displayed in widget layer list. E.g. : "Cartes IGN" + * @param {String} [lsOptions.layers.config.description] - layer description, to be displayed on title hover, or in layer information panel. + * @param {String} [lsOptions.layers.config.quicklookUrl] - link to a quick look image for this layer. + * @param {Array} [lsOptions.layers.config.legends] - array of layer legends. Each array element is an object, with following properties : + * - url (String, mandatory) : link to a legend + * - minScaleDenominator (Number, optional) : min scale denominator for legend validity. + * @param {Array} [lsOptions.layers.config.metadata] - array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata + * @param {Object} [lsOptions.options] - Itowns.control.Control options + * @param {Boolean} [lsOptions.options.collapsed = true] - Specify if widget has to be collapsed (true) or not (false) on globe loading. + * @example + * var layerSwitcher = new itowns.control.LayerSwitcher({ + * layers : [ + * { + * id : "myLayer", + * config : { + * title : "test layer name 1", + * description : "test layer desc 1", + * } + * } + * ], + * options : { + * collapsed : false + * } + * )); + */ + constructor(lsOptions: { + layers?: any[] | undefined; + }); + _addedLayerConf: {}; + /** + * Constructor (alias) + * + * @private + */ + private constructor; + /** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ + setGlobe(globe: GlobeViewExtended): void; + /** + * Adds a new layer to control (when added to globe) or add new layer configuration + * + * @param {Object} layer - layer to add to layer switcher + * @param {Object} [config] - additional options for layer configuration + * @param {Object} [config.title] - layer title (default is layer identifier) + * @param {Object} [config.description] - layer description (default is null) + * @param {Object} [config.legends] - layer legends (default is an empty array) + * @param {Object} [config.metadata] - layer metadata (default is an empty array) + * @param {Object} [config.quicklookUrl] - layer quicklookUrl (default is null) + * @example + * layerSwitcher.addLayer({ + * layer : gpParcels, + * config : { + * title : "Parcelles cadastrales", + * description : "description de la couche", + * quicklookUrl : "http://quicklookUrl.fr" + * } + * }) + */ + addLayer(layer: Object, config?: { + title?: Object | undefined; + description?: Object | undefined; + legends?: Object | undefined; + metadata?: Object | undefined; + quicklookUrl?: Object | undefined; + } | undefined): void; + /** + * Removes a layer from control + * + * @param {Object} layerId - layer to remove to layer switcher + */ + removeLayer(layerId: Object): void; + /** + * Collapse or display control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ + setCollapsed(collapsed: boolean): void; + /** + * Returns true if widget is collapsed (minimize), false otherwise + * @return {Boolean} is collapsed + */ + getCollapsed(): boolean; + private _initialize; + _uid: number | undefined; + _layers: {} | undefined; + _layerListContainer: any; + _callbacks: {} | undefined; + _options: Object | undefined; + _initLayers: any[] | undefined; + private _getLayerConf; + private _layerDisplayedInLayerSwitcher; + private _initContainer; + private _addGlobeLayers; + private _createLayerDiv; + private _onChangeLayerOpacity; + private _updateLayerOpacity; + private _onVisibilityLayerClick; + private _updateLayerVisibility; + private _onOpenLayerInfoClick; + private _onDropLayerClick; + private _onDragAndDropLayerClick; + private _inRangeUpdate; + private _updateLayerListContainer; + private _getLayerInfo; + private _resolveLayerId; +} +import GlobeViewExtended from "../GlobeViewExtended"; +//# sourceMappingURL=LayerSwitcher.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts.map new file mode 100644 index 000000000..e4dc2b193 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/LayerSwitcher.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LayerSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/LayerSwitcher.js"],"names":[],"mappings":";AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IA5B6B,MAAM;SA2DlC;;IAnED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH;QA5B6B,MAAM;OA2DlC;IAVG,oBAAyB;IAoB7B;;;;OAIG;IACH,oBAAmC;IAMnC;;;;OAIG;IACH,gBAFW,iBAAiB,QA0I3B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,gBAjBW,MAAM;;;;;;yBAsHhB;IAED;;;;OAIG;IACH,qBAFW,MAAM,QAoBhB;IAED;;;;OAIG;IACH,uCAkBC;IAED;;;OAGG;IACH,wBAEC;IAaqC,oBAgBrC;IAdG,yBAAiC;IAGjC,wBAAiB;IAGjB,yBAA+B;IAG/B,2BAAoB;IAGpB,6BAAuB;IACvB,+BAAyB;IAWW,sBAOvC;IAUwD,uCAOxD;IAUwC,uBA4BxC;IASyC,wBAyDzC;IAUyC,wBAkBzC;IAa+C,8BAQ/C;IAU6C,4BAiB7C;IASiD,gCAKjD;IAUgD,+BAKhD;IAS+C,8BA8D/C;IAS2C,0BAS3C;IASkD,iCAsBlD;IASwC,uBAmBxC;IAQmD,kCAyBnD;IAeuC,sBAUvC;IAUyC,wBAGzC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts new file mode 100644 index 000000000..d5e575830 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts @@ -0,0 +1,58 @@ +export default MiniGlobe; +/** + * @classdesc + * Control to display the MiniGlobe with itowns + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.MiniGlobe + * @param {Object} [options] - control options + * @param {Object} [options.layer] - custom itowns layer to display on the mini globe + * @example + * var miniglobe = new itowns.control.MiniGlobe(); + * + */ +declare function MiniGlobe(options?: { + layer?: Object | undefined; +} | undefined): void; +declare class MiniGlobe { + /** + * @classdesc + * Control to display the MiniGlobe with itowns + * + * @constructor + * @extends {itowns.control.Widget} + * @alias itowns.control.MiniGlobe + * @param {Object} [options] - control options + * @param {Object} [options.layer] - custom itowns layer to display on the mini globe + * @example + * var miniglobe = new itowns.control.MiniGlobe(); + * + */ + constructor(options?: { + layer?: Object | undefined; + } | undefined); + _options: { + layer?: Object | undefined; + }; + /** + * Constructor (alias) + * + * @private + */ + private constructor; + /** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ + setGlobe(globe: GlobeViewExtended): void; + _globeObj: GlobeViewExtended | undefined; + private _initialize; + _uid: number | undefined; + _MiniGlobeContainer: any; + _callbacks: {} | undefined; + private _initContainer; +} +import GlobeViewExtended from "../GlobeViewExtended"; +//# sourceMappingURL=MiniGlobe.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts.map new file mode 100644 index 000000000..fd93503ca --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/MiniGlobe.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniGlobe.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/MiniGlobe.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;GAYG;AACH;;qBAwBC;;IArCD;;;;;;;;;;;;OAYG;IACH;;mBAwBC;IAVG;;MAAuB;IAoB3B;;;;OAIG;IACH,oBAA+B;IAM/B;;;;OAIG;IACH,gBAFW,iBAAiB,QA0D3B;IAZO,yCAAyB;IAuBC,oBASjC;IAPG,yBAAiC;IAGjC,yBAA+B;IAG/B,2BAAoB;IAUa,uBAIpC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts new file mode 100644 index 000000000..09a3fe0c7 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts @@ -0,0 +1,255 @@ +export default MousePosition; +/** + * @classdesc + * + * MousePosition Control. + * + * @constructor + * @alias itowns.control.MousePosition + * @extends {itowns.control.Control} + * @param {Object} options - options for function call. + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {Boolean} [options.collapsed = true] - Specify if MousePosition control should be collapsed at startup. Default is true. + * @param {Array} [options.systems] - list of projection systems, default are Geographical ("EPSG:4326"), Web Mercator ("EPSG:3857"), Lambert 93 ("EPSG:2154") and extended Lambert 2 ("EPSG:27572"). + * Each array element (=system) is an object with following properties : + * @param {String} options.systems.crs - Proj4 crs alias (from proj4 defs). e.g. : "EPSG:4326". Required + * @param {String} [options.systems.label] - CRS label to be displayed in control. Default is crs code (e.g. "EPSG:4326") + * @param {String} options.systems.type - CRS units type for coordinates conversion : "Geographical" or "Metric". Default: "Metric" + * @param {Object} [options.systems.geoBBox] - Aera covered by the system (WGS84 coordinates). + * @param {Number} options.systems.geoBBox.right - Right bound. + * @param {Number} options.systems.geoBBox.left - Left bound. + * @param {Number} options.systems.geoBBox.top - Top bound. + * @param {Number} options.systems.geoBBox.bottom - Bottom bound. + * @param {Array} [options.units] - list of coordinates units, to be displayed in control units list. + * Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates, + * and "M" or "KM" for metric coordinates + * @param {Array} [options.displayAltitude = true] - activate (true) or deactivate (false) the altitude panel. True by default + * @param {Array} [options.displayCoordinates = true] - activate (true) or deactivate (false) the coordinates panel. True by default + * @param {Object} [options.altitude] - elevation configuration + * @param {Object} [options.altitude.serviceOptions] - options of elevation service + * @param {Number} [options.altitude.responseDelay] - latency for altitude request, 500 ms by default + * @param {Number} [options.altitude.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default + * @example + * var mousePosition = new itowns.control.MousePosition({ + * collapsed : false, + * displayCoordinates : true, + * displayAltitude : true, + * altitude : { + * triggerDelay : 100, + * responseDelay : 500, + * serviceOptions : {} + * }, + * systems : [ + * { + * crs : "EPSG:3857", + * label : "Mercator", + * type : "Metric" + * }, + * { + * crs : "EPSG:32620", + * label : "UTM 20N (Guadeloupe, Martinique)", + * type : "Metric", + * geoBBox : { + * left: -66.00, + * bottom : 0.00, + * right : -60.00, + * top : 84.00 + * } + * } + * ], + * units : ["DEC", "DMS"] + * }); + */ +declare function MousePosition(options: { + ssl?: boolean | undefined; + collapsed?: boolean | undefined; + systems?: any[] | undefined; +}): void; +declare class MousePosition { + /** + * @classdesc + * + * MousePosition Control. + * + * @constructor + * @alias itowns.control.MousePosition + * @extends {itowns.control.Control} + * @param {Object} options - options for function call. + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {Boolean} [options.collapsed = true] - Specify if MousePosition control should be collapsed at startup. Default is true. + * @param {Array} [options.systems] - list of projection systems, default are Geographical ("EPSG:4326"), Web Mercator ("EPSG:3857"), Lambert 93 ("EPSG:2154") and extended Lambert 2 ("EPSG:27572"). + * Each array element (=system) is an object with following properties : + * @param {String} options.systems.crs - Proj4 crs alias (from proj4 defs). e.g. : "EPSG:4326". Required + * @param {String} [options.systems.label] - CRS label to be displayed in control. Default is crs code (e.g. "EPSG:4326") + * @param {String} options.systems.type - CRS units type for coordinates conversion : "Geographical" or "Metric". Default: "Metric" + * @param {Object} [options.systems.geoBBox] - Aera covered by the system (WGS84 coordinates). + * @param {Number} options.systems.geoBBox.right - Right bound. + * @param {Number} options.systems.geoBBox.left - Left bound. + * @param {Number} options.systems.geoBBox.top - Top bound. + * @param {Number} options.systems.geoBBox.bottom - Bottom bound. + * @param {Array} [options.units] - list of coordinates units, to be displayed in control units list. + * Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates, + * and "M" or "KM" for metric coordinates + * @param {Array} [options.displayAltitude = true] - activate (true) or deactivate (false) the altitude panel. True by default + * @param {Array} [options.displayCoordinates = true] - activate (true) or deactivate (false) the coordinates panel. True by default + * @param {Object} [options.altitude] - elevation configuration + * @param {Object} [options.altitude.serviceOptions] - options of elevation service + * @param {Number} [options.altitude.responseDelay] - latency for altitude request, 500 ms by default + * @param {Number} [options.altitude.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default + * @example + * var mousePosition = new itowns.control.MousePosition({ + * collapsed : false, + * displayCoordinates : true, + * displayAltitude : true, + * altitude : { + * triggerDelay : 100, + * responseDelay : 500, + * serviceOptions : {} + * }, + * systems : [ + * { + * crs : "EPSG:3857", + * label : "Mercator", + * type : "Metric" + * }, + * { + * crs : "EPSG:32620", + * label : "UTM 20N (Guadeloupe, Martinique)", + * type : "Metric", + * geoBBox : { + * left: -66.00, + * bottom : 0.00, + * right : -60.00, + * top : 84.00 + * } + * } + * ], + * units : ["DEC", "DMS"] + * }); + */ + constructor(options: { + ssl?: boolean | undefined; + collapsed?: boolean | undefined; + systems?: any[] | undefined; + }); + _callbacks: {}; + /** + * Constructor (alias) + */ + constructor: typeof MousePosition; + /** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ + setGlobe(globe: GlobeViewExtended): void; + _centerElement: any; + /** + * Sets additional projection system + * + * @param {Object} system - Projection system defined in the Itowns/CRS/CRS.js class + * @param {String} system.crs - Proj4 crs alias (from proj4 defs) e.g. "EPSG:4326" + * @param {String} [system.label] - CRS label to be displayed in control. Default is system.crs alias + * @param {String} [system.type] - CRS units type for coordinates conversion (one of control options.units). Default is "Metric" + */ + addSystem(system: { + crs: string; + label?: string | undefined; + type?: string | undefined; + }): void; + /** + * Sets additional projection systems + * + * @param {Array} systems - Array of system object, with following properties : + * @param {String} systems.crs - Proj4 CRS alias (from proj4 defs) e.g. "EPSG:4326" + * @param {String} systems.label - CRS label (for coordinates conversion) + * @param {String} systems.type - CRS units type to be displayed in control (one of control options.units). Default is "Metric" + */ + addSystems(systems: any[]): void; + /** + * Removes projection system (in case there are several system with same code, only the first one will be removed) + * + * @param {String} systemCrs - CRS alias (from proj4 defs) + */ + removeSystem(systemCrs: string): void; + /** + * Sets control units (to be displayed) + * + * @param {Array} units - list of all coordinates units, to be displayed in control units list. + * Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates, + * and "M" or "KM" for metric coordinates + */ + setUnits(units: any[]): void; + _projectionUnits: {} | undefined; + /** + * Sets control altitude options (useless if displayAltitude == false) + * + * @param {Object} options - altitude options + * @param {Object} [options.serviceOptions] - options of elevation service + * @param {Number} [options.responseDelay] - latency for elevation request, 500 ms by default + * @param {Number} [options.triggerDelay] - immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default + */ + setAltitudeOptions(options: { + serviceOptions?: Object | undefined; + responseDelay?: number | undefined; + triggerDelay?: number | undefined; + }): void; + /** + * Displays or hides elevation panel + * + * @param {Boolean} displayAltitude - true to display elevation panel, false to hide it + */ + displayAltitude(displayAltitude: boolean): void; + /** + * Displays or hides coordinates panel + * + * @param {Boolean} displayCoordinates - true to display coordinates panel, false to hide it + */ + displayCoordinates(displayCoordinates: boolean): void; + /** + * Collapses or displays control main container + * + * @param {Boolean} collapsed - True to collapse control, False to display it + */ + setCollapsed(collapsed: boolean): void; + private _initialize; + options: Object | undefined; + /** {Boolean} specify if MousePosition control is collapsed (true) or not (false) */ + collapsed: any; + _uid: number | undefined; + _projectionSystems: any[] | undefined; + _isDesktop: boolean | undefined; + _timer: any; + _currentProjectionSystems: any; + _currentProjectionType: any; + _currentProjectionUnits: any; + _projectionUnitsContainer: any; + _showMousePositionContainer: any; + private _initProjectionSystems; + private _initProjectionUnits; + private _initContainer; + _projectionSystemsContainer: any; + private _setElevationPanel; + private _setCoordinatesPanel; + private _setSettingsPanel; + private _setTypeUnitsPanel; + private _displayDEC; + private _displayDMS; + private _displayRAD; + private _displayGON; + private _displayMeter; + private _displayKMeter; + private _setCoordinate; + private _setElevation; + private onMoveStopped; + private onMouseMove; + private onGlobeMove; + private onRequestAltitude; + private onShowMousePositionClick; + private onMousePositionProjectionSystemChange; + private _setCurrentSystem; + private onMousePositionProjectionSystemMouseOver; + private onMousePositionProjectionUnitsChange; +} +import GlobeViewExtended from "../GlobeViewExtended"; +//# sourceMappingURL=MousePosition.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts.map new file mode 100644 index 000000000..1b442962a --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/MousePosition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MousePosition.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/MousePosition.js"],"names":[],"mappings":";AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH;IApD6B,GAAG;IACH,SAAS;IACT,OAAO;SA4EnC;;IAvFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4DG;IACH;QApD6B,GAAG;QACH,SAAS;QACT,OAAO;OA4EnC;IAbG,eAAoB;IAsBxB;;OAEG;IACH,kCAAmC;IAEnC;;;;OAIG;IACH,gBAFW,iBAAiB,QA8B3B;IA1BO,oBAA6C;IAgCrD;;;;;;;OAOG;IACH;;;;aAsCC;IAED;;;;;;;OAOG;IACH,iCAWC;IAED;;;;OAIG;IACH,sCAkDC;IAED;;;;;;OAMG;IACH,6BAUC;IALG,iCAA0B;IAO9B;;;;;;;OAOG;IACH;;;;aAaC;IAED;;;;OAIG;IACH,gDAMC;IAED;;;;OAIG;IACH,sDAOC;IAED;;;;OAIG;IACH,uCAcC;IAaqC,oBA0ErC;IAvEG,4BAA4B;IAE5B,oFAAoF;IACpF,eAAuC;IA2BvC,yBAAiC;IAGjC,sCAA4B;IAQ5B,gCAAuC;IAQvC,YAAgD;IAGhD,+BAA2D;IAG3D,4BAA6D;IAG7D,6BAAyF;IAGzF,+BAAqC;IAGrC,iCAAuC;IAkBM,+BAgDhD;IAU8C,6BA+D9C;IAiBwC,uBAuCxC;IATiB,iCAA2G;IAmBhF,2BAU5C;IAU8C,6BAO9C;IAU2C,0BAU3C;IAU4C,2BAsB5C;IAcqC,oBAKrC;IAUqC,oBAKrC;IAUqC,oBAKrC;IAUqC,oBAKrC;IAUuC,sBAOvC;IAUwC,uBAMxC;IAcwC,uBA0DxC;IAUuC,sBAIvC;IAUuC,sBAEvC;IAWqC,oBA2BrC;IAUqC,oBAkBrC;IAe2C,0BAwD3C;IAUkD,iCAiClD;IAW+D,8CAK/D;IAS2C,0BA0B3C;IAUkE,iDA8ClE;IAW8D,6CAU9D"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts new file mode 100644 index 000000000..78f5fc329 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts @@ -0,0 +1,60 @@ +export default Scale; +/** + * @classdesc + * Control to display the scalebar with itowns + * + * @constructor + * @alias itowns.control.Scale + * @extends {itowns.control.Widget} + * @alias itowns.control.Scale + * @param {Object} options - widget options + * @param {String} options.target - HTML target element or HTML target element id + * @param {String} options.position - "absolute" or "relative" + * @example + * var scale = new itowns.control.Scale(); + * + */ +declare function Scale(options: { + target: string; + position: string; +}): void; +declare class Scale { + /** + * @classdesc + * Control to display the scalebar with itowns + * + * @constructor + * @alias itowns.control.Scale + * @extends {itowns.control.Widget} + * @alias itowns.control.Scale + * @param {Object} options - widget options + * @param {String} options.target - HTML target element or HTML target element id + * @param {String} options.position - "absolute" or "relative" + * @example + * var scale = new itowns.control.Scale(); + * + */ + constructor(options: { + target: string; + position: string; + }); + /** + * Constructor (alias) + * + * @private + */ + private constructor; + /** + * Bind globe to control + * + * @param {GlobeViewExtended} globe - the globe + */ + setGlobe(globe: GlobeViewExtended): void; + private _initialize; + _uid: number | undefined; + _ScaleContainer: any; + _callbacks: {} | undefined; + private _initContainer; +} +import GlobeViewExtended from "../GlobeViewExtended"; +//# sourceMappingURL=Scale.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts.map new file mode 100644 index 000000000..c2875be13 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Scale.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Scale.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/Scale.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;GAcG;AACH;IAN4B,MAAM;IACN,QAAQ;SA0BnC;;IApCD;;;;;;;;;;;;;;OAcG;IACH;QAN4B,MAAM;QACN,QAAQ;OA0BnC;IAUD;;;;OAIG;IACH,oBAA2B;IAM3B;;;;OAIG;IACH,gBAFW,iBAAiB,QAkD3B;IAW6B,oBAS7B;IAPG,yBAAiC;IAGjC,qBAA2B;IAG3B,2BAAoB;IAUS,uBAIhC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts new file mode 100644 index 000000000..b6cf4b8df --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts @@ -0,0 +1,18 @@ +export default PositionFormater; +declare namespace PositionFormater { + const NORTH: string; + const SOUTH: string; + const EAST: string; + const WEST: string; + const digitSecond: number; + const digitDecimal: number; + const digitRadian: number; + function roundToDecimal(inputNum: any, numPoints: any): number; + function decimalToRadian(location: any): number; + function decimalToGrade(location: any): number; + function decimalToDMS(location: any, hemisphere: any): string; + function decimalLatToDMS(location: any): string; + function decimalLongToDMS(location: any): string; + function DMSToDecimal(degrees: any, minutes: any, seconds: any, hemisphere: any): number; +} +//# sourceMappingURL=PositionFormater.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts.map new file mode 100644 index 000000000..0fa3a519c --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Utils/PositionFormater.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PositionFormater.d.ts","sourceRoot":"","sources":["../../../../../src/Itowns/Controls/Utils/PositionFormater.js"],"names":[],"mappings":";;;;;;;;;IAiCqB,+DAGhB;IAEiB,gDAGjB;IAEgB,+CAGhB;IAEc,8DAiBd;IAEiB,gDAGjB;IAEkB,iDAGlB;IAEc,yFAMd"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts b/itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts new file mode 100644 index 000000000..bedcbeb5d --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts @@ -0,0 +1,123 @@ +export default Widget; +/** +* @classdesc +* iTowns Widget class. +* Every geoportal control inherits of this class. +* +* @constructor +* @alias itowns.control.Widget +* @param {Object} options - options for function call. +* @param {String} options.name - Name of the widget. +* @param {Object} options.element - HTML element of the widget +* @param {Object|String} options.target - HTML element or HTML element id where to put the widget +* @param {String} options.position - "absolute" or "relative" +* @example +* var myWidget = new itowns.control.Widget({ +* name : "myWidget", +* element : myWidgetDiv, +* target : myWidgetTargetDiv, +* position: "absolute" +* }); +*/ +declare function Widget(options: { + name: string; + element: Object; + target: Object | string; + position: string; +}): void; +declare class Widget { + /** + * @classdesc + * iTowns Widget class. + * Every geoportal control inherits of this class. + * + * @constructor + * @alias itowns.control.Widget + * @param {Object} options - options for function call. + * @param {String} options.name - Name of the widget. + * @param {Object} options.element - HTML element of the widget + * @param {Object|String} options.target - HTML element or HTML element id where to put the widget + * @param {String} options.position - "absolute" or "relative" + * @example + * var myWidget = new itowns.control.Widget({ + * name : "myWidget", + * element : myWidgetDiv, + * target : myWidgetTargetDiv, + * position: "absolute" + * }); + */ + constructor(options: { + name: string; + element: Object; + target: Object | string; + position: string; + }); + _name: string | null; + _element: Object | null; + _position: string | null; + _target: HTMLElement | null; + _globe: Object | null; + /** + * Constructor (alias) + */ + constructor: typeof Widget; + /** + * Return the widget's container element. + * + * @method + * @return {HTMLElement} widget's container element. + */ + getElement(): HTMLElement; + /** + * Associates the widget to a specified target div. + * + * @method + * @param {HTMLElement|String} target - widget target div html element or target div id. + * @param {String} position - html position attribute. + */ + setTarget(target: HTMLElement | string, position: string): void; + /** + * Return the widget's target div. + * + * @method + * @return {HTMLElement} widget's target div. + */ + getTarget(): HTMLElement; + /** + * Return the widget's element position. + * + * @method + * @return {String} widget's element position. + */ + getPosition(): string; + /** + * Get the globe associated with the widget. Undefined if the widget is not added to a globe. + * + * @method + * @return {Object} globe + */ + getGlobe(): Object; + /** + * Associate a globe to the widget. + * + * @method + * @param {Object} globe - Globe to associate to the widget. + */ + setGlobe(globe: Object): void; + /** + * Get the options associated with the widget. + * + * @method + * @return {Object} options + */ + getOptions(): Object; + /** + * Set the options of the control + * + * @method + * @param {Object} options - Options to associate to the widget. + */ + setOptions(options: Object): void; + _options: Object | undefined; +} +//# sourceMappingURL=Widget.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts.map new file mode 100644 index 000000000..aa7662cf3 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Controls/Widget.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Widget.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Controls/Widget.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;;;EAmBE;AACF;IAZ2B,IAAI;IACJ,OAAO,EAAxB,MAAM;IACkB,MAAM,EAA9B,MAAM,SAAO;IACI,QAAQ;SAmBlC;;IA9BD;;;;;;;;;;;;;;;;;;;MAmBE;IACF;QAZ2B,IAAI;QACJ,OAAO,EAAxB,MAAM;QACkB,MAAM,EAA9B,MAAM,SAAO;QACI,QAAQ;OAmBlC;IATG,qBAA+D;IAC/D,wBAAwE;IACxE,yBAA2E;IAC3E,4BAAmB;IACnB,sBAAkB;IAYtB;;OAEG;IACH,2BAA4B;IAE5B;;;;;OAKG;IACH,cAFY,WAAW,CAItB;IAED;;;;;;OAMG;IACH,kBAHW,WAAW,SAAO,0BAc5B;IAED;;;;;OAKG;IACH,aAFY,WAAW,CAItB;IAYD;;;;;OAKG;IACH,sBAEC;IAED;;;;;OAKG;IACH,YAFY,MAAM,CAIjB;IAED;;;;;OAKG;IACH,gBAFW,MAAM,QAIhB;IAED;;;;;OAKG;IACH,cAFY,MAAM,CAIjB;IAED;;;;;OAKG;IACH,oBAFW,MAAM,QAIhB;IADG,6BAAuB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts b/itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts new file mode 100644 index 000000000..7bf49edec --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts @@ -0,0 +1,412 @@ +export default GlobeViewExtended; +/** + * @classdesc + * + * Extended itowns.GlobeView. + * + * @constructor + * @extends {itowns.GlobeView} + * @param {HTMLElement} viewerDiv - Where to instanciate the Three.js scene in the DOM + * @param {Object} coordCarto - longitude, latitude, altitude + * @param {Object} [options] - Optional properties which includes Itowns GlobeView optional properties (see Itowns documentation). + * @param {Boolean} [options.renderer.isWebGL2=True] - is an Itowns GlobeView optional property to enable webgl 2.0 for THREE.js. + * @param {String} [options.position="relative"] - "absolute" or "relative" + */ +declare function GlobeViewExtended(viewerDiv: HTMLElement, coordCarto: Object, options?: Object | undefined): void; +declare class GlobeViewExtended { + /** + * @classdesc + * + * Extended itowns.GlobeView. + * + * @constructor + * @extends {itowns.GlobeView} + * @param {HTMLElement} viewerDiv - Where to instanciate the Three.js scene in the DOM + * @param {Object} coordCarto - longitude, latitude, altitude + * @param {Object} [options] - Optional properties which includes Itowns GlobeView optional properties (see Itowns documentation). + * @param {Boolean} [options.renderer.isWebGL2=True] - is an Itowns GlobeView optional property to enable webgl 2.0 for THREE.js. + * @param {String} [options.position="relative"] - "absolute" or "relative" + */ + constructor(viewerDiv: HTMLElement, coordCarto: Object, options?: Object | undefined); + _viewerDiv: HTMLElement; + _widgets: any[]; + _isInitialized: boolean; + _globeView: any; + /** + * intializes the evenements map + */ + _initEventMap(): void; + /** + * Constructor (alias) + */ + constructor: typeof GlobeViewExtended; + /** + * Get GlobeViex Object (parent) + * @returns {Object} itowns GlobeView object + */ + getGlobeView(): Object; + /** + * Indicates if the globe is initialized or not + * + * @return {Boolean} isInitialized + * + */ + isInitialized(): boolean; + /** + * Detects when the camera movement stops, then launch the callback given as parameter + * + * @param {Function} cb - The function to execute when the event occures. + * + */ + onCameraMoveStop(cb: Function): void; + /** + * Disables globe controls until the globe rendering is completed + */ + freezeControl(): void; + /** + * Associates a function to trigger when an event is received. + * + * @param {String} type - the event type. Can be any of {@link EVENTS} + * @param {Function} callback - The function to execute when the event occures. + * @return {Object} key - The event key + * + */ + listen(type: string, callback: Function): Object; + /** + * Associates a function to trigger when a layer event is received. + * + * @param {Object} layer - The itowns layer. + * @param {String} type - the event type. Can be any of {@link EVENTS}. + * @param {Function} callback - The function to execute when the event occures. + * @return {Object} key - The event key + * + */ + addLayerListener(layer: Object, type: string, callback: Function): Object; + /** + * Returns the target of a given event type + * + * @param {String} type - the event type. Can be any of {@link EVENTS} + * @return {Object} target - The event target. + * + */ + _getEventTarget(type: string): Object; + /** + * Cancels an event listening + * + * @param {Object} key - The event key + * + */ + forgetByKey(key: Object): void; + /** + * Cancels an layer event listening + * + * @param {Object} layer - The itowns layer + * @param {String} type - the event type + * @param {Function} callback - The function to execute when the event occures + * + */ + removeLayerListener(layer: Object, type: string, callback: Function): void; + /** + * Cancels an event listening + * + * @param {Object} type - The event type + * @param {Function} callback - The event handler + */ + forget(type: Object, callback: Function): void; + /** + * Overload itowns.GlobeView addLayer method + * + * @param {Object} layer - The itowns layer + * @return {Promise} promise + */ + addLayer(layer: Object): Promise; + /** + * Overload itowns.GlobeView removeLayer method + * + * @param {String} layerId - The layer id + */ + removeLayer(layerId: string): void; + /** + * Set layer opacity + * + * @param {String} layerId - Layer id + * @param {Number} opacityValue - opacity value in [0 1] + */ + setLayerOpacity(layerId: string, opacityValue: number): void; + /** + * Set layer visibility + * + * @param {String} layerId - Layer id + * @param {Boolean} visible - New visibility of the layer + */ + setLayerVisibility(layerId: string, visible: boolean): void; + /** + * Move layer to the specified index + * + * @param {String} layerId - Layer id + * @param {Boolean} index - new index of the layer + */ + moveLayerToIndex(layerId: string, index: boolean): void; + /** + * Remove event listener from the globe + * + * @param {String} type - event type + * @param {Function} callback - event handler + */ + removeEventListener(type: string, callback: Function): void; + /** + * Defines if the current view extent have to be computed on pre-render event + * + * @param {Boolean} b - tells if the view extent info should be fetched by the event PRE_RENDER + */ + preRenderEventFetchViewExtent(b: boolean): void; + _fetchExtent: boolean | undefined; + /** + * Defines if the list of the color layers displayed have to be computed on pre-render event + * + * @param {Boolean} b - tells if the displayed color layers info should be fetched by the event PRE_RENDER + */ + preRenderEventFetchColorLayersDisplayed(b: boolean): void; + _fetchVisibleColorLayers: boolean | undefined; + /** + * Defines if the list of the elevation layers displayed have to be computed on pre-render event + * + * @param {Boolean} b - tells if the displayed elevation layers info should be fetched by the event PRE_RENDER + */ + preRenderEventFetchElevationLayersDisplayed(b: boolean): void; + _fetchVisibleElevationLayers: boolean | undefined; + /** + * Defines if the list of the layers of all types displayed have to be computed on pre-render event + * + * @param {Boolean} b - tells if both displayed color layers and displayed elevation layers infos should be fetched by the event PRE_RENDER + */ + preRenderEventFetchLayersDisplayed(b: boolean): void; + /** + * Get layer by its id + * + * @param {String} layerId - Layer id + * @return {Object} layer Object + */ + getLayerById(layerId: string): Object; + /** + * Get color layer by its id + * + * @param {String} layerId - Color layer id + * @return {Object} layer Object + */ + getColorLayerById(layerId: string): Object; + /** + * Get imagery layers + * + * @return {Array} imagery layers + */ + getColorLayers(): any[]; + /** + * Get vector layers + * + * @return {Array} vector layers + */ + getVectorLayers(): any[]; + /** + * Get featureGeometry layers + * + * @return {Array} imagery layers + */ + getFeatureGeometryLayers(): any[]; + /** + * Get elevation layers + * + * @return {Array} elevation layers + */ + getElevationLayers(): any[]; + /** + * Get the current view extent + * + * @returns {Array} current view extent + */ + getExtent(): any[]; + /** + * Add a widget to the globe + * + * @param {Object} widget - The Widget object to add + */ + addWidget(widget: Object): void; + /** + * Returns all widgets. + * + * @return {Array} widgets - The array of widgets. + */ + getWidgets(): any[]; + /** + * Removes a widget. + * + * @param {Object} widget - The Widget object to remove + */ + removeWidget(widget: Object): void; + /** + * Get html target element + * + * @return {HTMLElement} Globe container element + */ + getTargetElement(): HTMLElement; + /** + * Returns current view scale + * + * @return {Number} Scale + */ + getScale(): number; + /** + * Sets tilt + * + * @param {Number} tilt - Tilt value + * @return {Promise} - Promise when setTilt is done + */ + setTilt(tilt: number): Promise; + /** + * Returns tilt + * + * @return {Number} - Tilt + */ + getTilt(): number; + /** + * Sets azimuth + * + * @param {Number} azimuth - Azimuth value + * @return {Promise} - Promise when setAzimuth is done + */ + setAzimuth(azimuth: number): Promise; + /** + * Returns azimuth + * + * @return {Number} azimuth + */ + getAzimuth(): number; + /** + * Gets the coordinate in lat,lon for a given pixel. + * + * @param {Number} x - The pixel x-position inside the Globe element. + * @param {Number} y - The pixel y-position inside the Globe element. + * @return {Coordinates} position + */ + getCoordinateFromPixel(x: number, y: number): Coordinates; + /** + * Gets the coordinate in lat,lon for a given mouse position. + * + * @param {MouseEvent} mouseEvent - A mouse event. + * @return {Coordinates} position + */ + getCoordinateFromMouseEvent(mouseEvent: MouseEvent): Coordinates; + /** + * Get all visible features that intersect a pixel + * + * @param {MouseEvent} mouseEvent - A mouse event. + * @return {Promise} promise + */ + getFeaturesAtMousePosition(mouseEvent: MouseEvent): Promise; + /** + * Changes the center of the scene on screen to the specified in lat, lon. + * + * @param {Object} center - Center object + * @param {Number} center.longitude - Coordinate longitude WGS84 in degree + * @param {Number} center.latitude - Coordinate latitude WGS84 in degree + * @return {Promise} A promise that resolves when the next 'globe initilazed' event fires. + */ + setCameraTargetGeoPosition(center: { + longitude: number; + latitude: number; + }): Promise; + /** + * Retuns the coordinates of the central point on screen in lat,lon and alt + * + * @return {Object} center + */ + getCenter(): Object; + /** + * Returns the actual zoom. + * + * @return {Number} zoom + */ + getZoom(): number; + /** + * Sets the current zoom. + * + * @param {Number} zoom - The zoom + * @return {Promise} promise + */ + setZoom(zoom: number): Promise; + /** + * To convert the projection in meters on the globe of a number of pixels of screen + * @param {Number} pixels - count pixels to project + * @return {Number} projection in meters on globe + */ + pixelsToMeters(pixels: number): number; + /** + * Projection on screen in pixels of length in meter on globe + * @param {Number} value - Length in meter on globe + * @return {Number} projection in pixels on screen + */ + metersToPixels(value: number): number; + /** + * Returns the "range": the distance in meters between the camera and the current central point on the screen. + * @return {Number} number + */ + getRange(): number; + /** + * @return {THREE.Vector3} position + */ + getCameraTargetPosition(): THREE.Vector3; + /** + * To get the layer event infos + * + * @param {Object} evt - event + * @returns {Object} object with event properties + */ + getLayerEventInfos(evt: Object): Object; + /** + * Sets background (specific to miniglobe) + */ + setBackground(): void; + /** + * Sets camera position + * @param {THREE.Vector3} target - Target position + * @param {Number} distance - Distance from target + */ + setCameraPosition(target: THREE.Vector3, distance: number): void; + /** + * Sets camera orientation to look at specified target + * @param {THREE.Vector3} target - Target position + */ + lookAt(target: THREE.Vector3): void; + /** + * Notifies the scene it needs to be updated + * @param {String} styleUrl - style url + * @returns {Object} json object + */ + parseMapboxStyle(styleUrl: string): Object; + /** + * Notifies the scene it needs to be updated + */ + notifyChange(): void; + /** + * Resizes itowns + * + * @param {Integer} width - canvas width in pixels + * @param {Integer} height - canvas height in pixels + */ + resize(width: Integer, height: Integer): void; + /** + * Transform to itowns coordinates + * + * @param {Object} coordCarto - longitude, latitude, altitude + * @returns {Object} itowns coordinates + */ + _transformCoords(coordCarto: Object): Object; + /** + * Transform from itowns coordinates + * + * @param {Object} itownsCoord - itowns coordinates + * @returns {Object} coordinates + */ + _fromItownsCoords(itownsCoord: Object): Object; +} +//# sourceMappingURL=GlobeViewExtended.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts.map new file mode 100644 index 000000000..bbf4cc0cb --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/GlobeViewExtended.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GlobeViewExtended.d.ts","sourceRoot":"","sources":["../../../src/Itowns/GlobeViewExtended.js"],"names":[],"mappings":";AAeA;;;;;;;;;;;;GAYG;AACH,8CANW,WAAW,cACX,MAAM,sCA6DhB;;IArED;;;;;;;;;;;;OAYG;IACH,uBANW,WAAW,cACX,MAAM,gCA6DhB;IA9CG,wBAA2B;IAG3B,gBAAkB;IAMlB,wBAA2B;IAG3B,gBAAoE;IAoCxE;;OAEG;IACH,sBA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BAEC;IAED;;;;;;OAMG;IACH,0DAKC;IAED;;;;;OAKG;IACH,wCAHW,UAAU,eAMpB;IAED;;;;;OAKG;IACH,uCAHW,UAAU,gBAoCpB;IAED;;;;;;;OAOG;IACH;QAJ0B,SAAS;QACT,QAAQ;qBAMjC;IAED;;;;OAIG;IACH,aAFY,MAAM,CAKjB;IAED;;;;OAIG;IACH,kBAEC;IAED;;;;;OAKG;IACH,oCAEC;IAED;;;;OAIG;IACH,uCAEC;IAED;;;;OAIG;IACH,sCAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;OAEG;IACH,yCAEC;IAED;;;;;OAKG;IACH,wBAHW,MAAM,GACJ,MAAM,CASlB;IAED;;OAEG;IACH,sBAKC;IAED;;;;OAIG;IACH,iEAEC;IAED;;;OAGG;IACH,oCAEC;IAED;;;;OAIG;IACH,oCAFa,MAAM,CAIlB;IAED;;OAEG;IACH,qBAEC;IAED;;;;;MAKE;IACF,8CAGC;IAED;;;;;MAKE;IACF,6BAHU,MAAM,GACJ,MAAM,CAgBjB;IAED;;;;;MAKE;IACF,+BAHU,MAAM,GACJ,MAAM,CAQjB"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts new file mode 100644 index 000000000..43b19aa66 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts @@ -0,0 +1,69 @@ +export default LayerElevation; +/** + * @classdesc + * Geoportal elevation source creation + * + * @constructor + * @alias itowns.layer.GeoportalElevation + * @param {Object} options - options for function call. + * @param {String} options.layer - Elevation layer name (e.g. "ELEVATION.ELEVATIONGRIDCOVERAGE") + * @param {Boolean} [options.ssl] - if set true, enforce protocol https (only for nodejs) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - options to overload default geoportal layer options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalElevation = new itowns.layer.GeoportalElevation({ + * layer : "ELEVATION.ELEVATIONGRIDCOVERAGE" + * }); + */ +declare function LayerElevation(options: { + layer: string; + ssl?: boolean | undefined; + apiKey?: string | undefined; + legends?: any[] | undefined; + metadata?: any[] | undefined; + title?: string | undefined; + description?: string | undefined; + quicklookUrl?: string | undefined; + itownsParams?: Object | undefined; +}): any; +declare class LayerElevation { + /** + * @classdesc + * Geoportal elevation source creation + * + * @constructor + * @alias itowns.layer.GeoportalElevation + * @param {Object} options - options for function call. + * @param {String} options.layer - Elevation layer name (e.g. "ELEVATION.ELEVATIONGRIDCOVERAGE") + * @param {Boolean} [options.ssl] - if set true, enforce protocol https (only for nodejs) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - options to overload default geoportal layer options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalElevation = new itowns.layer.GeoportalElevation({ + * layer : "ELEVATION.ELEVATIONGRIDCOVERAGE" + * }); + */ + constructor(options: { + layer: string; + ssl?: boolean | undefined; + apiKey?: string | undefined; + legends?: any[] | undefined; + metadata?: any[] | undefined; + title?: string | undefined; + description?: string | undefined; + quicklookUrl?: string | undefined; + itownsParams?: Object | undefined; + }); + constructor: typeof LayerElevation; +} +//# sourceMappingURL=LayerElevation.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts.map new file mode 100644 index 000000000..beb069710 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerElevation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LayerElevation.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Layer/LayerElevation.js"],"names":[],"mappings":";AAiBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAd2B,KAAK;IACH,GAAG;IACJ,MAAM;IACP,OAAO;IACP,QAAQ;IACP,KAAK;IACL,WAAW;IACX,YAAY;IACZ,YAAY;QAoGvC;;IAnHD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAd2B,KAAK;QACH,GAAG;QACJ,MAAM;QACP,OAAO;QACP,QAAQ;QACP,KAAK;QACL,WAAW;QACX,YAAY;QACZ,YAAY;OAoGvC;IAKD,mCAAoC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts new file mode 100644 index 000000000..d0526b024 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts @@ -0,0 +1,69 @@ +export default LayerWMS; +/** + * @classdesc + * Geoportal WMTS source creation + * + * @constructor + * @alias itowns.layer.GeoportalWMS + * @param {Object} options - options for function call. + * @param {String} options.layer - Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalWMS = new itowns.layer.GeoportalWMS({ + * layer : "ORTHOIMAGERY.ORTHOPHOTOS" + * }); + */ +declare function LayerWMS(options: { + layer: string; + ssl?: boolean | undefined; + apiKey?: string | undefined; + legends?: any[] | undefined; + metadata?: any[] | undefined; + title?: string | undefined; + description?: string | undefined; + quicklookUrl?: string | undefined; + itownsParams?: Object | undefined; +}): any; +declare class LayerWMS { + /** + * @classdesc + * Geoportal WMTS source creation + * + * @constructor + * @alias itowns.layer.GeoportalWMS + * @param {Object} options - options for function call. + * @param {String} options.layer - Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalWMS = new itowns.layer.GeoportalWMS({ + * layer : "ORTHOIMAGERY.ORTHOPHOTOS" + * }); + */ + constructor(options: { + layer: string; + ssl?: boolean | undefined; + apiKey?: string | undefined; + legends?: any[] | undefined; + metadata?: any[] | undefined; + title?: string | undefined; + description?: string | undefined; + quicklookUrl?: string | undefined; + itownsParams?: Object | undefined; + }); + constructor: typeof LayerWMS; +} +//# sourceMappingURL=LayerWMS.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts.map new file mode 100644 index 000000000..5bb54fcbe --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMS.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LayerWMS.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Layer/LayerWMS.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAd2B,KAAK;IACH,GAAG;IACJ,MAAM;IACP,OAAO;IACP,QAAQ;IACP,KAAK;IACL,WAAW;IACX,YAAY;IACZ,YAAY;QAkGvC;;IAjHD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAd2B,KAAK;QACH,GAAG;QACJ,MAAM;QACP,OAAO;QACP,QAAQ;QACP,KAAK;QACL,WAAW;QACX,YAAY;QACZ,YAAY;OAkGvC;IAKD,6BAA8B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts new file mode 100644 index 000000000..66c79dc67 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts @@ -0,0 +1,69 @@ +export default LayerWMTS; +/** + * @classdesc + * Geoportal WMTS source creation + * + * @constructor + * @alias itowns.layer.GeoportalWMTS + * @param {Object} options - options for function call. + * @param {String} options.layer - Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalWMTS = new itowns.layer.GeoportalWMTS({ + * layer : "ORTHOIMAGERY.ORTHOPHOTOS" + * }); + */ +declare function LayerWMTS(options: { + layer: string; + ssl?: boolean | undefined; + apiKey?: string | undefined; + legends?: any[] | undefined; + metadata?: any[] | undefined; + title?: string | undefined; + description?: string | undefined; + quicklookUrl?: string | undefined; + itownsParams?: Object | undefined; +}): any; +declare class LayerWMTS { + /** + * @classdesc + * Geoportal WMTS source creation + * + * @constructor + * @alias itowns.layer.GeoportalWMTS + * @param {Object} options - options for function call. + * @param {String} options.layer - Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS") + * @param {Boolean} [options.ssl = true] - use of ssl or not (default true, service requested using https protocol) + * @param {String} [options.apiKey] - Access key to Geoportal platform + * @param {Array} [options.legends] - Overloads the default legends objects associated to the layer + * @param {Array} [options.metadata] - Overloads the default Metadata objects associated to the layer + * @param {String} [options.title] - Overloads the default title of the layer + * @param {String} [options.description] - Overloads the default description of the layer + * @param {String} [options.quicklookUrl] - Overloads the default quicklookUrl of the layer + * @param {Object} [options.itownsParams] - other options for itowns.GlobeView.addLayer function (see {@link http://www.itowns-project.org/itowns/API_Doc/GlobeView.html#addLayer GlobeView.addLayer}) + * @example + * var geoportalWMTS = new itowns.layer.GeoportalWMTS({ + * layer : "ORTHOIMAGERY.ORTHOPHOTOS" + * }); + */ + constructor(options: { + layer: string; + ssl?: boolean | undefined; + apiKey?: string | undefined; + legends?: any[] | undefined; + metadata?: any[] | undefined; + title?: string | undefined; + description?: string | undefined; + quicklookUrl?: string | undefined; + itownsParams?: Object | undefined; + }); + constructor: typeof LayerWMTS; +} +//# sourceMappingURL=LayerWMTS.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts.map new file mode 100644 index 000000000..7897ccde5 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/LayerWMTS.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LayerWMTS.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Layer/LayerWMTS.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAd2B,KAAK;IACH,GAAG;IACJ,MAAM;IACP,OAAO;IACP,QAAQ;IACP,KAAK;IACL,WAAW;IACX,YAAY;IACZ,YAAY;QAqGvC;;IApHD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAd2B,KAAK;QACH,GAAG;QACJ,MAAM;QACP,OAAO;QACP,QAAQ;QACP,KAAK;QACL,WAAW;QACX,YAAY;QACZ,YAAY;OAqGvC;IAKD,8BAA+B"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts b/itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts new file mode 100644 index 000000000..c16f21c35 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts @@ -0,0 +1,61 @@ +export default VectorTileLayer; +/** + * @classdesc + * Geoportal VT source creation + * + * @constructor + * @alias itowns.layer.VectorTileLayer + * @param {Object} options - options for function call. + * @param {String} options.id - id to give to the layer + * @param {String} options.layer - Layer name (e.g. "PLAN.IGN") + * @param {String} [options.url] - Url to the vector Tile json style + * @param {String} [options.urlService] - Url to the pbf file. Retrieved in the style file by default. + * @param {Function} [options.filter] - Filter applied to the vector layer style. Fill/Line layer type by default. + * @param {Object} [options.attributions] - Attributions of the layer. + * @param {Object} [options.zoom] - Between which zoom levels the layer is displayed (zoom.min and zoom.max) + * @example + * var vectorTileLayer = new itowns.layer.VectorTileLayer({ + * layer : "PLAN.IGN" + * }); + */ +declare function VectorTileLayer(options: { + id: string; + layer: string; + url?: string | undefined; + urlService?: string | undefined; + filter?: Function | undefined; + attributions?: Object | undefined; + zoom?: Object | undefined; +}): any; +declare class VectorTileLayer { + /** + * @classdesc + * Geoportal VT source creation + * + * @constructor + * @alias itowns.layer.VectorTileLayer + * @param {Object} options - options for function call. + * @param {String} options.id - id to give to the layer + * @param {String} options.layer - Layer name (e.g. "PLAN.IGN") + * @param {String} [options.url] - Url to the vector Tile json style + * @param {String} [options.urlService] - Url to the pbf file. Retrieved in the style file by default. + * @param {Function} [options.filter] - Filter applied to the vector layer style. Fill/Line layer type by default. + * @param {Object} [options.attributions] - Attributions of the layer. + * @param {Object} [options.zoom] - Between which zoom levels the layer is displayed (zoom.min and zoom.max) + * @example + * var vectorTileLayer = new itowns.layer.VectorTileLayer({ + * layer : "PLAN.IGN" + * }); + */ + constructor(options: { + id: string; + layer: string; + url?: string | undefined; + urlService?: string | undefined; + filter?: Function | undefined; + attributions?: Object | undefined; + zoom?: Object | undefined; + }); + constructor: typeof VectorTileLayer; +} +//# sourceMappingURL=VectorTileLayer.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts.map new file mode 100644 index 000000000..db0c76ea2 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Layer/VectorTileLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VectorTileLayer.d.ts","sourceRoot":"","sources":["../../../../src/Itowns/Layer/VectorTileLayer.js"],"names":[],"mappings":";AAaA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAZ2B,EAAE;IACF,KAAK;IACJ,GAAG;IACH,UAAU;IACR,MAAM;IACR,YAAY;IACZ,IAAI;QAsD/B;;IAnED;;;;;;;;;;;;;;;;;;OAkBG;IACH;QAZ2B,EAAE;QACF,KAAK;QACJ,GAAG;QACH,UAAU;QACR,MAAM;QACR,YAAY;QACZ,IAAI;OAsD/B;IAKD,oCAAqC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Styles.d.ts b/itowns-2.5.0-beta/dist/Itowns/Styles.d.ts new file mode 100644 index 000000000..93815f397 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Styles.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=Styles.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/Styles.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/Styles.d.ts.map new file mode 100644 index 000000000..d678868cf --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/Styles.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../src/Itowns/Styles.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/index.d.ts b/itowns-2.5.0-beta/dist/Itowns/index.d.ts new file mode 100644 index 000000000..6ba2c9edb --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/index.d.ts @@ -0,0 +1,49 @@ +export { default as LayerUtils } from "../Common/Utils/LayerUtils"; +export { default as ProxyUtils } from "../Common/Utils/ProxyUtils"; +export { default as ColorUtils } from "../Common/Utils/ColorUtils"; +export { default as MathUtils } from "../Common/Utils/MathUtils"; +export { default as Logger } from "../Common/Utils/LoggerByDefault"; +/** Version */ +export const itownsExtVersion: any; +/** Publication date */ +export const itownsExtDate: any; +export var Services: any; +export var Error: any; +export var Helper: any; +export var Protocols: any; +export var servicesDate: any; +export var servicesVersion: any; +declare namespace Itowns { + export namespace control { + export { MousePosition }; + export { LayerSwitcher }; + export { BoostRelief }; + export { Buildings }; + export { Attributions }; + export { Scale }; + export { MiniGlobe }; + } + export namespace layer { + export { GeoportalWMTS }; + export { GeoportalWMS }; + export { GeoportalElevation }; + export { VectorTileLayer }; + } + export { CRS }; + export { GlobeViewExtended }; +} +import MousePosition from "./Controls/MousePosition"; +import LayerSwitcher from "./Controls/LayerSwitcher"; +import BoostRelief from "./Controls/BoostRelief"; +import Buildings from "./Controls/Buildings"; +import Attributions from "./Controls/Attributions"; +import Scale from "./Controls/Scale"; +import MiniGlobe from "./Controls/MiniGlobe"; +import GeoportalWMTS from "./Layer/LayerWMTS"; +import GeoportalWMS from "./Layer/LayerWMS"; +import GeoportalElevation from "./Layer/LayerElevation"; +import VectorTileLayer from "./Layer/VectorTileLayer"; +import CRS from "./CRS/CRS"; +import GlobeViewExtended from "./GlobeViewExtended"; +export { Itowns as itownsExtended }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/itowns-2.5.0-beta/dist/Itowns/index.d.ts.map b/itowns-2.5.0-beta/dist/Itowns/index.d.ts.map new file mode 100644 index 000000000..7b169c636 --- /dev/null +++ b/itowns-2.5.0-beta/dist/Itowns/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Itowns/index.js"],"names":[],"mappings":";;;;;AAuHA,cAAc;AACd,mCAAoE;AACpE,uBAAuB;AACvB,gCAAsC;AA7DtC,yBAA2B;AAC3B,sBAAqB;AACrB,uBAAuB;AACvB,0BAA6B;AAC7B,6BAAmC;AACnC,gCAAyC"} \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/GlobeViewExtended.html b/itowns-2.5.0-beta/jsdoc/GlobeViewExtended.html new file mode 100644 index 000000000..0ae3fed1e --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/GlobeViewExtended.html @@ -0,0 +1,9018 @@ + + + + + + + + + + + + + Class: GlobeViewExtended + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: GlobeViewExtended

+ + + + +
+ + +

+ +

+ + +

Extended itowns.GlobeView.

+ + + +
+
+ + + + +
+
+

+ + new GlobeViewExtended(viewerDiv, coordCarto, options) +

+ + +
+ Itowns/GlobeViewExtended.js, line 29 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
viewerDiv + + +HTMLElement + + + + + + + + + + +

Where to instanciate the Three.js scene in the DOM

coordCarto + + +Object + + + + + + + + + + +

longitude, latitude, altitude

options + + +Object + + + + + + + optional + + + + + +

Optional properties which includes Itowns GlobeView optional properties (see Itowns documentation).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
renderer.isWebGL2 + + +Boolean + + + + + + True + + + + + optional + + + + + +

is an Itowns GlobeView optional property to enable webgl 2.0 for THREE.js.

position + + +String + + + + + + "relative" + + + + + optional + + + + + +

"absolute" or "relative"

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + +
+ + +

Extends

+ +
    +
  • itowns.GlobeView
  • +
+ + + + + + + + + + + +

Members

+ +
+ +
+
+

constructor

+
+ + +
+
+ +
+

Constructor (alias)

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

+ + _fromItownsCoords(itownsCoord){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 859 +
+ +
+ + +
+
+ + +
+

Transform from itowns coordinates

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
itownsCoord + + +Object + + + + + +

itowns coordinates

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + _getEventTarget(type){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 223 +
+ +
+ + +
+
+ + +
+

Returns the target of a given event type

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + + +

the event type. Can be any of EVENTS

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+- The event target. +
+ + + + + +
+ + + +
+
+

+ + _initEventMap() +

+ + +
+ Itowns/GlobeViewExtended.js, line 90 +
+ +
+ + +
+
+ + +
+

intializes the evenements map

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + _transformCoords(coordCarto){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 837 +
+ +
+ + +
+
+ + +
+

Transform to itowns coordinates

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
coordCarto + + +Object + + + + + +

longitude, latitude, altitude

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+coordinates +
+ + + + + +
+ + + +
+
+

+ + addLayer(layer){Promise} +

+ + +
+ Itowns/GlobeViewExtended.js, line 299 +
+ +
+ + +
+
+ + +
+

Overload itowns.GlobeView addLayer method

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layer + + +Object + + + + + +

The itowns layer

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + addLayerListener(layer, type, callback){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 203 +
+ +
+ + +
+
+ + +
+

Associates a function to trigger when a layer event is received.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layer + + +Object + + + + + +

The itowns layer.

type + + +String + + + + + +

the event type. Can be any of EVENTS.

callback + + +function + + + + + +

The function to execute when the event occures.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+- The event key +
+ + + + + +
+ + + +
+
+

+ + addWidget(widget) +

+ + +
+ Itowns/GlobeViewExtended.js, line 527 +
+ +
+ + +
+
+ + +
+

Add a widget to the globe

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
widget + + +Object + + + + + +

The Widget object to add

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + forget(type, callback) +

+ + +
+ Itowns/GlobeViewExtended.js, line 282 +
+ +
+ + +
+
+ + +
+

Cancels an event listening

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +Object + + + + + +

The event type

callback + + +function + + + + + +

The event handler

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + forgetByKey(key) +

+ + +
+ Itowns/GlobeViewExtended.js, line 252 +
+ +
+ + +
+
+ + +
+

Cancels an event listening

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +Object + + + + + +

The event key

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + freezeControl() +

+ + +
+ Itowns/GlobeViewExtended.js, line 153 +
+ +
+ + +
+
+ + +
+

Disables globe controls until the globe rendering is completed

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + getAzimuth(){Number} +

+ + +
+ Itowns/GlobeViewExtended.js, line 617 +
+ +
+ + +
+
+ + +
+

Returns azimuth

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getCameraTargetPosition(){THREE.Vector3} +

+ + +
+ Itowns/GlobeViewExtended.js, line 758 +
+ +
+ + +
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getCenter(){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 705 +
+ +
+ + +
+
+ + +
+

Retuns the coordinates of the central point on screen in lat,lon and alt

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getColorLayerById(layerId){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 448 +
+ +
+ + +
+
+ + +
+

Get color layer by its id

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +String + + + + + +

Color layer id

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+Object +
+ + + + + +
+ + + +
+
+

+ + getColorLayers(){Array} +

+ + +
+ Itowns/GlobeViewExtended.js, line 466 +
+ +
+ + +
+
+ + +
+

Get imagery layers

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+layers +
+ + + + + +
+ + + +
+
+

+ + getCoordinateFromMouseEvent(mouseEvent){Coordinates} +

+ + +
+ Itowns/GlobeViewExtended.js, line 641 +
+ +
+ + +
+
+ + +
+

Gets the coordinate in lat,lon for a given mouse position.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mouseEvent + + +MouseEvent + + + + + +

A mouse event.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getCoordinateFromPixel(x, y){Coordinates} +

+ + +
+ Itowns/GlobeViewExtended.js, line 628 +
+ +
+ + +
+
+ + +
+

Gets the coordinate in lat,lon for a given pixel.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
x + + +Number + + + + + +

The pixel x-position inside the Globe element.

y + + +Number + + + + + +

The pixel y-position inside the Globe element.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getElevationLayers(){Array} +

+ + +
+ Itowns/GlobeViewExtended.js, line 505 +
+ +
+ + +
+
+ + +
+

Get elevation layers

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+layers +
+ + + + + +
+ + + +
+
+

+ + getExtent(){Array} +

+ + +
+ Itowns/GlobeViewExtended.js, line 518 +
+ +
+ + +
+
+ + +
+

Get the current view extent

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+view extent +
+ + + + + +
+ + + +
+
+

+ + getFeatureGeometryLayers(){Array} +

+ + +
+ Itowns/GlobeViewExtended.js, line 492 +
+ +
+ + +
+
+ + +
+

Get featureGeometry layers

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+layers +
+ + + + + +
+ + + +
+
+

+ + getFeaturesAtMousePosition(mouseEvent){Promise} +

+ + +
+ Itowns/GlobeViewExtended.js, line 652 +
+ +
+ + +
+
+ + +
+

Get all visible features that intersect a pixel

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mouseEvent + + +MouseEvent + + + + + +

A mouse event.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getGlobeView(){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 121 +
+ +
+ + +
+
+ + +
+

Get GlobeViex Object (parent)

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+GlobeView object +
+ + + + + +
+ + + +
+
+

+ + getLayerById(layerId){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 429 +
+ +
+ + +
+
+ + +
+

Get layer by its id

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +String + + + + + +

Layer id

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+Object +
+ + + + + +
+ + + +
+
+

+ + getLayerEventInfos(evt){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 768 +
+ +
+ + +
+
+ + +
+

To get the layer event infos

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
evt + + +Object + + + + + +

event

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+with event properties +
+ + + + + +
+ + + +
+
+

+ + getRange(){Number} +

+ + +
+ Itowns/GlobeViewExtended.js, line 751 +
+ +
+ + +
+
+ + +
+

Returns the "range": the distance in meters between the camera and the current central point on the screen.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getScale(){Number} +

+ + +
+ Itowns/GlobeViewExtended.js, line 579 +
+ +
+ + +
+
+ + +
+

Returns current view scale

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getTargetElement(){HTMLElement} +

+ + +
+ Itowns/GlobeViewExtended.js, line 570 +
+ +
+ + +
+
+ + +
+

Get html target element

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element +
+ + + + + +
+ + + +
+
+

+ + getTilt(){Number} +

+ + +
+ Itowns/GlobeViewExtended.js, line 598 +
+ +
+ + +
+
+ + +
+

Returns tilt

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getVectorLayers(){Array} +

+ + +
+ Itowns/GlobeViewExtended.js, line 479 +
+ +
+ + +
+
+ + +
+

Get vector layers

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+layers +
+ + + + + +
+ + + +
+
+

+ + getWidgets(){Array} +

+ + +
+ Itowns/GlobeViewExtended.js, line 547 +
+ +
+ + +
+
+ + +
+

Returns all widgets.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+- The array of widgets. +
+ + + + + +
+ + + +
+
+

+ + getZoom(){Number} +

+ + +
+ Itowns/GlobeViewExtended.js, line 715 +
+ +
+ + +
+
+ + +
+

Returns the actual zoom.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + isInitialized(){Boolean} +

+ + +
+ Itowns/GlobeViewExtended.js, line 131 +
+ +
+ + +
+
+ + +
+

Indicates if the globe is initialized or not

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + listen(type, callback){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 170 +
+ +
+ + +
+
+ + +
+

Associates a function to trigger when an event is received.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + + +

the event type. Can be any of EVENTS

callback + + +function + + + + + +

The function to execute when the event occures.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+- The event key +
+ + + + + +
+ + + +
+
+

+ + lookAt(target) +

+ + +
+ Itowns/GlobeViewExtended.js, line 800 +
+ +
+ + +
+
+ + +
+

Sets camera orientation to look at specified target

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +THREE.Vector3 + + + + + +

Target position

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + metersToPixels(value){Number} +

+ + +
+ Itowns/GlobeViewExtended.js, line 743 +
+ +
+ + +
+
+ + +
+

Projection on screen in pixels of length in meter on globe

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + + +

Length in meter on globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+in pixels on screen +
+ + + + + +
+ + + +
+
+

+ + moveLayerToIndex(layerId, index) +

+ + +
+ Itowns/GlobeViewExtended.js, line 350 +
+ +
+ + +
+
+ + +
+

Move layer to the specified index

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +String + + + + + +

Layer id

index + + +Boolean + + + + + +

new index of the layer

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + notifyChange() +

+ + +
+ Itowns/GlobeViewExtended.js, line 816 +
+ +
+ + +
+
+ + +
+

Notifies the scene it needs to be updated

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + onCameraMoveStop(cb) +

+ + +
+ Itowns/GlobeViewExtended.js, line 141 +
+ +
+ + +
+
+ + +
+

Detects when the camera movement stops, then launch the callback given as parameter

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cb + + +function + + + + + +

The function to execute when the event occures.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + parseMapboxStyle(styleUrl){Object} +

+ + +
+ Itowns/GlobeViewExtended.js, line 809 +
+ +
+ + +
+
+ + +
+

Notifies the scene it needs to be updated

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
styleUrl + + +String + + + + + +

style url

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+object +
+ + + + + +
+ + + +
+
+

+ + pixelsToMeters(pixels){Number} +

+ + +
+ Itowns/GlobeViewExtended.js, line 734 +
+ +
+ + +
+
+ + +
+

To convert the projection in meters on the globe of a number of pixels of screen

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pixels + + +Number + + + + + +

count pixels to project

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+in meters on globe +
+ + + + + +
+ + + +
+
+

+ + preRenderEventFetchColorLayersDisplayed(b) +

+ + +
+ Itowns/GlobeViewExtended.js, line 391 +
+ +
+ + +
+
+ + +
+

Defines if the list of the color layers displayed have to be computed on pre-render event

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
b + + +Boolean + + + + + +

tells if the displayed color layers info should be fetched by the event PRE_RENDER

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + preRenderEventFetchElevationLayersDisplayed(b) +

+ + +
+ Itowns/GlobeViewExtended.js, line 403 +
+ +
+ + +
+
+ + +
+

Defines if the list of the elevation layers displayed have to be computed on pre-render event

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
b + + +Boolean + + + + + +

tells if the displayed elevation layers info should be fetched by the event PRE_RENDER

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + preRenderEventFetchLayersDisplayed(b) +

+ + +
+ Itowns/GlobeViewExtended.js, line 415 +
+ +
+ + +
+
+ + +
+

Defines if the list of the layers of all types displayed have to be computed on pre-render event

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
b + + +Boolean + + + + + +

tells if both displayed color layers and displayed elevation layers infos should be fetched by the event PRE_RENDER

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + preRenderEventFetchViewExtent(b) +

+ + +
+ Itowns/GlobeViewExtended.js, line 379 +
+ +
+ + +
+
+ + +
+

Defines if the current view extent have to be computed on pre-render event

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
b + + +Boolean + + + + + +

tells if the view extent info should be fetched by the event PRE_RENDER

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + removeEventListener(type, callback) +

+ + +
+ Itowns/GlobeViewExtended.js, line 360 +
+ +
+ + +
+
+ + +
+

Remove event listener from the globe

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + + +

event type

callback + + +function + + + + + +

event handler

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + removeLayer(layerId) +

+ + +
+ Itowns/GlobeViewExtended.js, line 316 +
+ +
+ + +
+
+ + +
+

Overload itowns.GlobeView removeLayer method

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +String + + + + + +

The layer id

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + removeLayerListener(layer, type, callback) +

+ + +
+ Itowns/GlobeViewExtended.js, line 268 +
+ +
+ + +
+
+ + +
+

Cancels an layer event listening

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layer + + +Object + + + + + +

The itowns layer

type + + +String + + + + + +

the event type

callback + + +function + + + + + +

The function to execute when the event occures

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + removeWidget(widget) +

+ + +
+ Itowns/GlobeViewExtended.js, line 556 +
+ +
+ + +
+
+ + +
+

Removes a widget.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
widget + + +Object + + + + + +

The Widget object to remove

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + resize(width, height) +

+ + +
+ Itowns/GlobeViewExtended.js, line 826 +
+ +
+ + +
+
+ + +
+

Resizes itowns

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
width + + +Integer + + + + + +

canvas width in pixels

height + + +Integer + + + + + +

canvas height in pixels

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setAzimuth(azimuth){Promise} +

+ + +
+ Itowns/GlobeViewExtended.js, line 608 +
+ +
+ + +
+
+ + +
+

Sets azimuth

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
azimuth + + +Number + + + + + +

Azimuth value

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+when setAzimuth is done + +
+ + + + + +
+ + + +
+
+

+ + setBackground() +

+ + +
+ Itowns/GlobeViewExtended.js, line 780 +
+ +
+ + +
+
+ + +
+

Sets background (specific to miniglobe)

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setCameraPosition(target, distance) +

+ + +
+ Itowns/GlobeViewExtended.js, line 792 +
+ +
+ + +
+
+ + +
+

Sets camera position

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +THREE.Vector3 + + + + + +

Target position

distance + + +Number + + + + + +

Distance from target

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setCameraTargetGeoPosition(center){Promise} +

+ + +
+ Itowns/GlobeViewExtended.js, line 695 +
+ +
+ + +
+
+ + +
+

Changes the center of the scene on screen to the specified in lat, lon.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
center + + +Object + + + + + +

Center object

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
longitude + + +Number + + + + + +

Coordinate longitude WGS84 in degree

latitude + + +Number + + + + + +

Coordinate latitude WGS84 in degree

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+promise that resolves when the next 'globe initilazed' event fires. +
+ + + + + +
+ + + +
+
+

+ + setLayerOpacity(layerId, opacityValue) +

+ + +
+ Itowns/GlobeViewExtended.js, line 326 +
+ +
+ + +
+
+ + +
+

Set layer opacity

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +String + + + + + +

Layer id

opacityValue + + +Number + + + + + +

opacity value in [0 1]

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setLayerVisibility(layerId, visible) +

+ + +
+ Itowns/GlobeViewExtended.js, line 338 +
+ +
+ + +
+
+ + +
+

Set layer visibility

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +String + + + + + +

Layer id

visible + + +Boolean + + + + + +

New visibility of the layer

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setTilt(tilt){Promise} +

+ + +
+ Itowns/GlobeViewExtended.js, line 589 +
+ +
+ + +
+
+ + +
+

Sets tilt

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
tilt + + +Number + + + + + +

Tilt value

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+when setTilt is done + +
+ + + + + +
+ + + +
+
+

+ + setZoom(zoom){Promise} +

+ + +
+ Itowns/GlobeViewExtended.js, line 725 +
+ +
+ + +
+
+ + +
+

Sets the current zoom.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
zoom + + +Number + + + + + +

The zoom

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.eot b/itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000000000000000000000000000000000000..423bd5d3a20b804f596e04e5cd02fb4f16cfcbc1 GIT binary patch literal 20290 zcma%iWl&r}+vUIvFu1!7?(XjH8r_pdkt+yM3f?|%^(0BwNn zKil^oY6VY{-1dR0Ma@N z|IbPR0e+! zN}8*7O64;}N}#)+k#j6FO>isk@k@Bh*}4HIZ8cU{OIG{HQ=j2X*xT%?IOBQpvTZW7IXToOwNzo|ejHaAwCN3nOc7m7e{ub?Y8i z9p3wwJ(%iCu~2*Rb;zUJG0b8esX)Om9*+v4m=T(1qO&}%tozG*k;kT*-plt){q_5c z=|<3=s%J;+5^v+e03X6T{0`e9cT7ovP0397X+n!3SBptlDu2Z(nI^J_Nr|Uj5|0C( zsH7C}(vTj#)-rQv+n%XGE}df=E4Dq-Cn{|U=>@EJ_c| zjH;t!H%Vd##NLSe`rbIC2J`CayTWN>e+qGMY?nW2xD$T@W0o1?#bj;oT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&2M^dIqd_ryiggPpNk(o6U zAr8RmCUVDv`Y}`Jg>IC1SOU-Um>OebWQ-U@3$^cX=a@PC2Xv#N*nMxuX%Z3MWyuc# zdht5);{lFmrJ1<}Iy6|#V&>ImK&0FtPvMUeVryH|Phak|%DKE%dX> zirfwG5c!54259+46CiR#=|i3r7UF{sL`dk2*)qpNS260^ID=lnH~a+n!=_*!c1KO+ zeLEYFMJ|vSr(yT8f6=T(q!R$-b@!krct(RK>41BP1dYm&R02naKL>yiG0(rirp^g- z-T4DY6?#NE=pvG@7CEg_HoL-_q>XR4Uc+8m&^&1K!X2|7p^}(d-9M + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.ttf b/itowns-2.5.0-beta/jsdoc/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..a498ef4e7c8b556fc36f580c5ff524025bb11c84 GIT binary patch literal 41236 zcmc${34B}Cl|TOOdr!M8>1nlW%aSZh@-ADltvHKgvhN959SD$s!WNdWGz16%Qr5Hq zLm`wxhZF|Lu$1?dP}&a6w6rkl;x0@`ftk{z3q#8?Eo6ReL;Ujlp8MoA3AF$DeLjCD zlHMl0d(S=h+;hHXc>)szLBX3Wc;?Jmx%k3A|K_)Xz-n-`X6~%nbC?xp1U3o#v85|A z*$bXrcnkLXvA_PjOE+x(^}IzP?0-`b#EZ|{a&=5-kZ#A1)#JSN{LL3!x?+FkN$j`a z{KgA5T(ud;J%V7qkIr9k$+hP<{q(UrvH!3j+*x_y#tj7~Z^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5+(3PJpPHs9eA&zc7t*$m~(Q@5eQz@*L%FeaDthrM(gPt{W|xJ6<;%jJnp&cRD?R|2?i1l;otJa7c=&IR|cfO}iPgAXoU zF)n=rEJ;yXtU+y_2o$M z<;3>o*x=>VXJ8m2FfI}pB@0aI1x7Fc6H0+G*1(hO#Xh^FK7+#3T;kC{(Tgt0ilE5vE{Wbju{JNMHlc`;mjsef%+5=SPAF<ZZjR&nzhtKRioIRA?tjIp-MDh$tB+H`e*{!{VV-PWx_BTM z@E@r$uU$lnG z!53>-18gbu^eF|AZPf_W!@UFwWzSx>*{LQW!N1fq9mn z2@b9W9u{2>pA4r`kEUtZ01uyH)Br-^Fr=%;HBzZ3)PC)R8Bx`vaF`kz)f003iw~ + + + + + + + + + + + + Global + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Global

+ + + + +
+ + +

+ +

+ + + + +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

PositionFormater

+
+ + +
+
+ +
+

...

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

+ + addBuildings(options) +

+ + +
+ Itowns/Controls/Buildings.js, line 242 +
+ +
+ + +
+
+ + +
+

Adds or removes the buildings layer on click

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +options + + + + + +

for the buildings control

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + changeBoost(reliefValue) +

+ + +
+ Itowns/Controls/BoostRelief.js, line 232 +
+ +
+ + +
+
+ + +
+

Updates relief slider and all elevation layers with the given boost value

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
reliefValue + + +Number + + + + + +

relief value

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setBuildingsVisibility(layerId) +

+ + +
+ Itowns/Controls/Buildings.js, line 305 +
+ +
+ + +
+
+ + +
+

Set the buildings visibility on click

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +Tring + + + + + +

layer id for the building layer

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +

Events

+ +
+ +
+
+

+ + attributions:update +

+ + +
+ Itowns/Controls/Attributions.js, line 266 +
+ +
+ + +
+
+ + +
+

event triggered when the attributions are updated

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
attributions + + +Map + + + +

list of attributions

+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/images/entete.png b/itowns-2.5.0-beta/jsdoc/images/entete.png new file mode 100644 index 0000000000000000000000000000000000000000..785651104951086de41c354e8ce645034279da22 GIT binary patch literal 119357 zcmXtg2{_d4_r5JlF_MyH>_v-RmN5(>T4c%limVw-mLW!C9YU`qgGBZ*l|tF~>|`1H zkir=IU=(A`zRdsQ`@8;Kml{{ics|c_o^$SV-}foT)Yy>gtl(J&1_rKscl94JFt8Q? zul?Csf#02XyU4&FEU4S}{$U4x1+zOv1K)EzziWkJU|@4R{bE!POh5fc0={=Fea*dG zeEpvKI5YV9`N_F@x})GvpF7KW`5-b^H3b;B`PwbJ+-ElGIm;?DT;iq1>O z-9M;5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+x)(;R+P{ftq z9xqj{7_JBlS2(vq`hw+I8JawBPF7xokd_);=|@Kut>TqSZpMxLFEZ4*DH23F4{3LH zIp8H32zNK+s*lde2Re^XHCcR~p895eU@M9dd<8dlHk+p9|hgLi5x&{4%# z8}VYSrY3$&fQ9HQRZlfv{$`^P!oA>?UlQU6M-zS*nCE<|q~^oxpK7=wYCNvH$GjT( zbAO~A18TIv$L!U`Ude<$|9~9Nm#JD;!)5}DMxznj+#8^S)33pPwmB--gtX$ z=YCC^JEX(ILlJ1#aIyk6?aPNBD#o=nHkW-76M3R>y{_~a7?*)U2g^g6RI&IbQfYK3 zm#(gz(6f&6Sf$x;jGxB!?B1J>?Jus8aHG+KD%z?1OO**+LD2SL+%X7>&l{v#4WQC3Z+MhY1EKS-^8q5uE@ literal 0 HcmV?d00001 diff --git a/itowns-2.5.0-beta/jsdoc/images/logoIGNsmall.png b/itowns-2.5.0-beta/jsdoc/images/logoIGNsmall.png new file mode 100644 index 0000000000000000000000000000000000000000..9b33003c3f7ea16300118bb3b7f58a8608b6d73f GIT binary patch literal 1010 zcmVX1^@s6oR$`P0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU#lu1NERCwCFm|I9yK@^7fG4s|%O1pRo zOT?}cM3Gq3Q;KL5lyrZ}qR4LaQuNeA5(W`yWnq_>f--#YL5d71$_|xXO+^YT0!vGd z1({lB_fPyMcEdh<&+H@p@S%I0GiR+?Yu2o-&os?A!!V+O34CA}3>s>R0kgp(Fdt0h zct3as{NNS%<+4s8mWTvKv{~q<0cUDJ2WaEZN?^E<2=;;&Fl2_;AZP~L!5D}2 z_JANLR`~7^+2A>7r`XJ;vyV3`+C z_?|RS%X8GFwOt5LgA}goHX+RfJvOOx5@a}}LKdjv+z%i*%)D(jYd>{B{N@EwmDGkF;gPq(29jyT8 z6zx=+Q~<_Xp1*C(ciAsoL9&ak4Xs0}1brTi%P!iwrC&0>gEAEo=Dz`+rr zY&t9=TBMPZn;2oMs=ykr&iE`Bn%!sm8I|`624;aeo&h(F1&u5krj$vScmemzwz)Yo z{HKBYSEj7&1}s;M(0Ops#?h-hqu+I%kq_@on|Uv2;0f?q!N^>V!(U-j z&BQsb1_`>=%+I#OYDl(CMeAeLsRYF!kExZw9!j((kJ;O`YgRK6og}c;GM4D&p1ENY z=KT)y-}0btq~j$tqMW^1riapO^8D0AdTHL{i7h>QO6=#dFv1u#sHAS6^}2&0yzn z3`{phR=rH!PA~0Ds7u}frrA`YTq2^-%~C#&2R4!obW#_a-v*HGWnodRR)d=ktxq~5 zk>rxLBcYdI0~_DJ&Lr5RPdI%7tH2>fK}S!)?l8U8Xbl_W;4H}>` g0ptHE{kH%E00FAFfHR!#!2kdN07*qoM6N<$fmq*#ibJVQ8upoSx*1IXtr@Q5r1 zs=p4xj7}P}D}aKMC9V-A!TD(=<%vb94CUqJdYO6I#mR{Use1WE>9gP2NHH)l7JIrl zhD5Z!ovQ2M94OMT|M#~$Ea?H$#JBLI1RgiwRAOt+GfEL_W|Qa1krHtgCw$pvDE&k5-&hNr=59JDg;D^f!7XH-DdHJsU z8Sbbm8>LMa-sM%`e{?H*5tD}5yY?WtYTcjrrKPVWY_jYfx8-f39X!X?{3bCaO$v + + + + + + + + + + + + Index + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Index

+ + + + + + + + + + + + + + + + + + + + + +
+

Geoportal Extension for Itowns API Reference

+

The Geoportal Extension for Itowns provides additionnal javascript functionalities (Controls) making access to french geoportal webservices easier when using Itowns javascript library.

+

This extension is not standalone and has to be used together with the Itowns library. In a web page, you thus have to include both Itowns and Geoportal Extension resources. For instance :

+
<!-- itowns -->
+<script src="path/to/itowns/js/itowns.js"></script>
+
+<!-- Geoportal Extension for Itowns -->
+<script src="path/to/GpPluginItowns.js" data-key="{your-geoportal-access-key}"></script>
+<link rel="stylesheet" href="path/to/GpPluginItowns.css" />
+
+

NB : to have complete access to this extension functionnalities, you need to freely provide a geoportal access key among the one available here : . Use it either when loading extension script (using the data-key attribute) or by conditinning their use to the onSuccess callback function of a Gp.Services.GetConfig() call with that key. Otherwhise some functionalities may not work as announced.

+

Geoportal Controls

+

Controls provided by the Geoportal Extension added to an itowns globe, allows user to interact with it.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Geoportal ControlDescription
itowns.control.AttributionsControl that has the capability of handling dynamic attributions depending on zoom level and positionning of the globe.
itowns.control.LayerSwitcherAllows users to manage layer organisation of the map
itowns.control.MousePositionControl that has the capability of displaying planar position and elevation of Mouse Position based on elevation service of the Geoportal Platform.
itowns.control.MiniGlobeAllows users to add a miniMap to their viewer
itowns.control.ScaleAllows users to add a graphic scalebar control to their viewer
+
+ + + + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.Attributions.html b/itowns-2.5.0-beta/jsdoc/itowns.control.Attributions.html new file mode 100644 index 000000000..86f108792 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.Attributions.html @@ -0,0 +1,3515 @@ + + + + + + + + + + + + + Class: Attributions + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: Attributions

+ + + + +
+ + +

+ itowns.control.Attributions +

+ + +

Control to manage layers attributions

+ + + +
+
+ + + + +
+
+

+ + new Attributions(aOptions) +

+ + +
+ Itowns/Controls/Attributions.js, line 31 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
aOptions + + +Object + + + + + +

control options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + + + optional + + + + + +

Itowns.control.Control options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
collapsed + + +Boolean + + + + + + false + + + + + optional + + + + + +

Specify if the control has to be opened or not.

+ +
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
Fires:
+ + + + + + + + + + + + +
Example
+ + + +
var attribution = new itowns.control.Attritbution({
+ options : {
+     collapsed: true
+ }
+});
+// listeners for attributions update :
+attribution.addEventListener("attributions:update", function (e) {...});
+ + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + getCollapsed(){Boolean} +

+ + +
+ Itowns/Controls/Attributions.js, line 138 +
+ +
+ + +
+
+ + +
+

Returns true if widget is collapsed (minimize), false otherwise

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 55 +
+ +
+ + +
+
+ + +
+

Return the widget's container element.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getGlobe(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 115 +
+ +
+ + +
+
+ + +
+

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getOptions(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 135 +
+ +
+ + +
+
+ + +
+

Get the options associated with the widget.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getPosition(){String} +

+ + +
+ Itowns/Controls/Widget.js, line 105 +
+ +
+ + +
+
+ + +
+

Return the widget's element position.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element position. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getTarget(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 85 +
+ +
+ + +
+
+ + +
+

Return the widget's target div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+target div. +
+ + + + + +
+ + + +
+
+

+ + setCollapsed(collapsed) +

+ + +
+ Itowns/Controls/Attributions.js, line 120 +
+ +
+ + +
+
+ + +
+

Collapse or display control main container

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
collapsed + + +Boolean + + + + + +

True to collapse control, False to display it

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/Attributions.js, line 81 +
+ +
+ + +
+
+ + +
+

Bind globe to control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +GlobeViewExtended + + + + + +

the globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setOptions(options) +

+ + +
+ Itowns/Controls/Widget.js, line 145 +
+ +
+ + +
+
+ + +
+

Set the options of the control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

Options to associate to the widget.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setTarget(target, position) +

+ + +
+ Itowns/Controls/Widget.js, line 66 +
+ +
+ + +
+
+ + +
+

Associates the widget to a specified target div.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +HTMLElement +| + +String + + + + + +

widget target div html element or target div id.

position + + +String + + + + + +

html position attribute.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.BoostRelief.html b/itowns-2.5.0-beta/jsdoc/itowns.control.BoostRelief.html new file mode 100644 index 000000000..52829e66a --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.BoostRelief.html @@ -0,0 +1,3644 @@ + + + + + + + + + + + + + Class: BoostRelief + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: BoostRelief

+ + + + +
+ + +

+ itowns.control.BoostRelief +

+ + +

Control to exagerate the elevation

+ + + +
+
+ + + + +
+
+

+ + new BoostRelief(brOptions) +

+ + +
+ Itowns/Controls/BoostRelief.js, line 32 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brOptions + + +Object + + + + + +

control options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
scale + + +Object + + + + + + + + + optional + + + + + +

Defines the scale used to boost the relief

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
min + + +Number + + + + + + + optional + + + + + +

Minimum of the scale - 1 by default

max + + +Number + + + + + + + optional + + + + + +

Maximum of the scale - 50 by default

step + + +Number + + + + + + + optional + + + + + +

Step of the scale - 1 by default

+ +
collapsed + + +Boolean + + + + + + true + + + + + optional + + + + + +

Specify if widget has to be collapsed (true) or not (false) on globe loading.

defaultBoost + + +Boolean + + + + + + 1 + + + + + optional + + + + + +

Default boost value applied to the widget and the elevation layers when loaded

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var boostRelief = new itowns.control.BoostRelief({
+     scale : {
+         max : 30,
+         step : 2
+     },
+     defaultBoost : 6
+})
+ + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + getCollapsed(){Boolean} +

+ + +
+ Itowns/Controls/BoostRelief.js, line 129 +
+ +
+ + +
+
+ + +
+

Returns true if widget is collapsed (minimize), false otherwise

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+collapsed +
+ + + + + +
+ + + +
+
+

+ + inherited + + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 55 +
+ +
+ + +
+
+ + +
+

Return the widget's container element.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getGlobe(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 115 +
+ +
+ + +
+
+ + +
+

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getOptions(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 135 +
+ +
+ + +
+
+ + +
+

Get the options associated with the widget.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getPosition(){String} +

+ + +
+ Itowns/Controls/Widget.js, line 105 +
+ +
+ + +
+
+ + +
+

Return the widget's element position.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element position. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getTarget(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 85 +
+ +
+ + +
+
+ + +
+

Return the widget's target div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+target div. +
+ + + + + +
+ + + +
+
+

+ + setCollapsed(collapsed) +

+ + +
+ Itowns/Controls/BoostRelief.js, line 101 +
+ +
+ + +
+
+ + +
+

Collapse or display control main container

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
collapsed + + +Boolean + + + + + +

True to collapse control, False to display it

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/BoostRelief.js, line 82 +
+ +
+ + +
+
+ + +
+

Bind globe to control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +GlobeViewExtended + + + + + +

the globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setOptions(options) +

+ + +
+ Itowns/Controls/Widget.js, line 145 +
+ +
+ + +
+
+ + +
+

Set the options of the control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

Options to associate to the widget.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setTarget(target, position) +

+ + +
+ Itowns/Controls/Widget.js, line 66 +
+ +
+ + +
+
+ + +
+

Associates the widget to a specified target div.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +HTMLElement +| + +String + + + + + +

widget target div html element or target div id.

position + + +String + + + + + +

html position attribute.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.Buildings.html b/itowns-2.5.0-beta/jsdoc/itowns.control.Buildings.html new file mode 100644 index 000000000..55297ec00 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.Buildings.html @@ -0,0 +1,3250 @@ + + + + + + + + + + + + + Class: Buildings + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: Buildings

+ + + + +
+ + +

+ itowns.control.Buildings +

+ + +

Control to display buildings on the map

+ + + +
+
+ + + + +
+
+

+ + new Buildings(buildingsOptions) +

+ + +
+ Itowns/Controls/Buildings.js, line 32 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buildingsOptions + + +Object + + + + + +

control options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
MNT + + +Boolean + + + + + + true + + + + + optional + + + + + +

Adds and displays the MNT

buildingsOnGround + + +Boolean + + + + + + false + + + + + optional + + + + + +

Display the buildings at their elevation or on the ground

defaultVisibility + + +Boolean + + + + + + true + + + + + optional + + + + + +

Visibility of the Buildings Layer at the initialisation

minZoom + + +Integer + + + + + + 15 + + + + + optional + + + + + +

minimum level of zoom the buildings are displayed. 15 by default. Lower is the value, lower are the performances.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var buildings = new itowns.control.Buildings ({
+     MNT : false,
+     buildingsOnGround : false,
+     target : “controlDiv”
+})
+ + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + inherited + + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 55 +
+ +
+ + +
+
+ + +
+

Return the widget's container element.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getGlobe(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 115 +
+ +
+ + +
+
+ + +
+

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getOptions(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 135 +
+ +
+ + +
+
+ + +
+

Get the options associated with the widget.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getPosition(){String} +

+ + +
+ Itowns/Controls/Widget.js, line 105 +
+ +
+ + +
+
+ + +
+

Return the widget's element position.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element position. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getTarget(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 85 +
+ +
+ + +
+
+ + +
+

Return the widget's target div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+target div. +
+ + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/Buildings.js, line 82 +
+ +
+ + +
+
+ + +
+

Bind globe to control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +GlobeViewExtended + + + + + +

the globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setTarget(target, position) +

+ + +
+ Itowns/Controls/Widget.js, line 66 +
+ +
+ + +
+
+ + +
+

Associates the widget to a specified target div.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +HTMLElement +| + +String + + + + + +

widget target div html element or target div id.

position + + +String + + + + + +

html position attribute.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.LayerSwitcher.html b/itowns-2.5.0-beta/jsdoc/itowns.control.LayerSwitcher.html new file mode 100644 index 000000000..e48dc1ff1 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.LayerSwitcher.html @@ -0,0 +1,4266 @@ + + + + + + + + + + + + + Class: LayerSwitcher + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: LayerSwitcher

+ + + + +
+ + +

+ itowns.control.LayerSwitcher +

+ + +

Control to manage globe layers : their order, visibility and opacity, and display their informations (title, description, legends, metadata...)

+ + + +
+
+ + + + +
+
+

+ + new LayerSwitcher(lsOptions) +

+ + +
+ Itowns/Controls/LayerSwitcher.js, line 46 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
lsOptions + + +Object + + + + + +

control options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layers + + +Array + + + + + + + optional + + + + + +

list of layers to be configured. Each array element is an object, with following properties :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + + + + optional + + + + + +

ol.layer.Layer layer to be configured (that has been added to globe)

config + + +Object + + + + + + + optional + + + + + +

custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
title + + +String + + + + + + + optional + + + + + +

layer alias, to be displayed in widget layer list. E.g. : "Cartes IGN"

description + + +String + + + + + + + optional + + + + + +

layer description, to be displayed on title hover, or in layer information panel.

quicklookUrl + + +String + + + + + + + optional + + + + + +

link to a quick look image for this layer.

legends + + +Array + + + + + + + optional + + + + + +

array of layer legends. Each array element is an object, with following properties :
+- url (String, mandatory) : link to a legend
+- minScaleDenominator (Number, optional) : min scale denominator for legend validity.

metadata + + +Array + + + + + + + optional + + + + + +

array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata

+ +
+ +
options + + +Object + + + + + + + optional + + + + + +

Itowns.control.Control options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
collapsed + + +Boolean + + + + + + true + + + + + optional + + + + + +

Specify if widget has to be collapsed (true) or not (false) on globe loading.

+ +
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var layerSwitcher = new itowns.control.LayerSwitcher({
+ layers : [
+     {
+         id : "myLayer",
+         config : {
+             title : "test layer name 1",
+             description : "test layer desc 1",
+         }
+     }
+ ],
+ options : {
+     collapsed : false
+ }
+));
+ + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + addLayer(layer, config) +

+ + +
+ Itowns/Controls/LayerSwitcher.js, line 261 +
+ +
+ + +
+
+ + +
+

Adds a new layer to control (when added to globe) or add new layer configuration

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layer + + +Object + + + + + + + + + + +

layer to add to layer switcher

config + + +Object + + + + + + + optional + + + + + +

additional options for layer configuration

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
title + + +Object + + + + + + + optional + + + + + +

layer title (default is layer identifier)

description + + +Object + + + + + + + optional + + + + + +

layer description (default is null)

legends + + +Object + + + + + + + optional + + + + + +

layer legends (default is an empty array)

metadata + + +Object + + + + + + + optional + + + + + +

layer metadata (default is an empty array)

quicklookUrl + + +Object + + + + + + + optional + + + + + +

layer quicklookUrl (default is null)

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
layerSwitcher.addLayer({
+      layer : gpParcels,
+      config : {
+          title : "Parcelles cadastrales",
+          description : "description de la couche",
+          quicklookUrl : "http://quicklookUrl.fr"
+      }
+  })
+ + + +
+ + + +
+
+

+ + getCollapsed(){Boolean} +

+ + +
+ Itowns/Controls/LayerSwitcher.js, line 418 +
+ +
+ + +
+
+ + +
+

Returns true if widget is collapsed (minimize), false otherwise

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+collapsed +
+ + + + + +
+ + + +
+
+

+ + inherited + + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 55 +
+ +
+ + +
+
+ + +
+

Return the widget's container element.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getGlobe(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 115 +
+ +
+ + +
+
+ + +
+

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getOptions(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 135 +
+ +
+ + +
+
+ + +
+

Get the options associated with the widget.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getPosition(){String} +

+ + +
+ Itowns/Controls/Widget.js, line 105 +
+ +
+ + +
+
+ + +
+

Return the widget's element position.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element position. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getTarget(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 85 +
+ +
+ + +
+
+ + +
+

Return the widget's target div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+target div. +
+ + + + + +
+ + + +
+
+

+ + removeLayer(layerId) +

+ + +
+ Itowns/Controls/LayerSwitcher.js, line 369 +
+ +
+ + +
+
+ + +
+

Removes a layer from control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layerId + + +Object + + + + + +

layer to remove to layer switcher

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setCollapsed(collapsed) +

+ + +
+ Itowns/Controls/LayerSwitcher.js, line 394 +
+ +
+ + +
+
+ + +
+

Collapse or display control main container

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
collapsed + + +Boolean + + + + + +

True to collapse control, False to display it

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/LayerSwitcher.js, line 103 +
+ +
+ + +
+
+ + +
+

Bind globe to control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +GlobeViewExtended + + + + + +

the globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setOptions(options) +

+ + +
+ Itowns/Controls/Widget.js, line 145 +
+ +
+ + +
+
+ + +
+

Set the options of the control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

Options to associate to the widget.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setTarget(target, position) +

+ + +
+ Itowns/Controls/Widget.js, line 66 +
+ +
+ + +
+
+ + +
+

Associates the widget to a specified target div.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +HTMLElement +| + +String + + + + + +

widget target div html element or target div id.

position + + +String + + + + + +

html position attribute.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.MiniGlobe.html b/itowns-2.5.0-beta/jsdoc/itowns.control.MiniGlobe.html new file mode 100644 index 000000000..8ee480bb6 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.MiniGlobe.html @@ -0,0 +1,3256 @@ + + + + + + + + + + + + + Class: MiniGlobe + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: MiniGlobe

+ + + + +
+ + +

+ itowns.control.MiniGlobe +

+ + +

Control to display the MiniGlobe with itowns

+ + + +
+
+ + + + +
+
+

+ + new MiniGlobe(options) +

+ + +
+ Itowns/Controls/MiniGlobe.js, line 20 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + + + optional + + + + + +

control options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layer + + +Object + + + + + + + optional + + + + + +

custom itowns layer to display on the mini globe

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var miniglobe = new itowns.control.MiniGlobe();
+ + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + inherited + + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 55 +
+ +
+ + +
+
+ + +
+

Return the widget's container element.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getGlobe(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 115 +
+ +
+ + +
+
+ + +
+

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getOptions(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 135 +
+ +
+ + +
+
+ + +
+

Get the options associated with the widget.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getPosition(){String} +

+ + +
+ Itowns/Controls/Widget.js, line 105 +
+ +
+ + +
+
+ + +
+

Return the widget's element position.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element position. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getTarget(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 85 +
+ +
+ + +
+
+ + +
+

Return the widget's target div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+target div. +
+ + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/MiniGlobe.js, line 70 +
+ +
+ + +
+
+ + +
+

Bind globe to control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +GlobeViewExtended + + + + + +

the globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setOptions(options) +

+ + +
+ Itowns/Controls/Widget.js, line 145 +
+ +
+ + +
+
+ + +
+

Set the options of the control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

Options to associate to the widget.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setTarget(target, position) +

+ + +
+ Itowns/Controls/Widget.js, line 66 +
+ +
+ + +
+
+ + +
+

Associates the widget to a specified target div.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +HTMLElement +| + +String + + + + + +

widget target div html element or target div id.

position + + +String + + + + + +

html position attribute.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.MousePosition.html b/itowns-2.5.0-beta/jsdoc/itowns.control.MousePosition.html new file mode 100644 index 000000000..65844bc71 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.MousePosition.html @@ -0,0 +1,4542 @@ + + + + + + + + + + + + + Class: MousePosition + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: MousePosition

+ + + + +
+ + +

+ itowns.control.MousePosition +

+ + +

MousePosition Control.

+ + + +
+
+ + + + +
+
+

+ + new MousePosition(options) +

+ + +
+ Itowns/Controls/MousePosition.js, line 75 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

options for function call.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
ssl + + +Boolean + + + + + + true + + + + + optional + + + + + +

use of ssl or not (default true, service requested using https protocol)

collapsed + + +Boolean + + + + + + true + + + + + optional + + + + + +

Specify if MousePosition control should be collapsed at startup. Default is true.

systems + + +Array + + + + + + + + + optional + + + + + +

list of projection systems, default are Geographical ("EPSG:4326"), Web Mercator ("EPSG:3857"), Lambert 93 ("EPSG:2154") and extended Lambert 2 ("EPSG:27572").
+Each array element (=system) is an object with following properties :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
crs + + +String + + + + + + + + + + +

Proj4 crs alias (from proj4 defs). e.g. : "EPSG:4326". Required

label + + +String + + + + + + + optional + + + + + +

CRS label to be displayed in control. Default is crs code (e.g. "EPSG:4326")

type + + +String + + + + + + + + + + +

CRS units type for coordinates conversion : "Geographical" or "Metric". Default: "Metric"

geoBBox + + +Object + + + + + + + optional + + + + + +

Aera covered by the system (WGS84 coordinates).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
right + + +Number + + + + + +

Right bound.

left + + +Number + + + + + +

Left bound.

top + + +Number + + + + + +

Top bound.

bottom + + +Number + + + + + +

Bottom bound.

+ +
+ +
units + + +Array + + + + + + + + + optional + + + + + +

list of coordinates units, to be displayed in control units list.
+Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates,
+and "M" or "KM" for metric coordinates

displayAltitude + + +Array + + + + + + true + + + + + optional + + + + + +

activate (true) or deactivate (false) the altitude panel. True by default

displayCoordinates + + +Array + + + + + + true + + + + + optional + + + + + +

activate (true) or deactivate (false) the coordinates panel. True by default

altitude + + +Object + + + + + + + + + optional + + + + + +

elevation configuration

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
serviceOptions + + +Object + + + + + + + optional + + + + + +

options of elevation service

responseDelay + + +Number + + + + + + + optional + + + + + +

latency for altitude request, 500 ms by default

triggerDelay + + +Number + + + + + + + optional + + + + + +

immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default

+ +
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var mousePosition = new itowns.control.MousePosition({
+     collapsed : false,
+     displayCoordinates : true,
+     displayAltitude : true,
+     altitude : {
+          triggerDelay : 100,
+          responseDelay : 500,
+          serviceOptions : {}
+     },
+     systems : [
+      {
+         crs : "EPSG:3857",
+         label : "Mercator",
+         type : "Metric"
+       },
+      {
+         crs : "EPSG:32620",
+         label : "UTM 20N (Guadeloupe, Martinique)",
+         type : "Metric",
+         geoBBox : {
+             left: -66.00,
+             bottom : 0.00,
+             right : -60.00,
+             top : 84.00
+         }
+       }
+     ],
+     units : ["DEC", "DMS"]
+ });
+ + + +
+ + +
+ + +

Extends

+ +
    +
  • itowns.control.Control
  • +
+ + + + + + + + + + + +

Members

+ +
+ +
+
+

collapsed

+
+ + +
+
+ +
+

{Boolean} specify if MousePosition control is collapsed (true) or not (false)

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

constructor

+
+ + +
+
+ +
+

Constructor (alias)

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

+ + addSystem(system) +

+ + +
+ Itowns/Controls/MousePosition.js, line 162 +
+ +
+ + +
+
+ + +
+

Sets additional projection system

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
system + + +Object + + + + + +

Projection system defined in the Itowns/CRS/CRS.js class

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
crs + + +String + + + + + + + + + + +

Proj4 crs alias (from proj4 defs) e.g. "EPSG:4326"

label + + +String + + + + + + + optional + + + + + +

CRS label to be displayed in control. Default is system.crs alias

type + + +String + + + + + + + optional + + + + + +

CRS units type for coordinates conversion (one of control options.units). Default is "Metric"

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + addSystems(systems) +

+ + +
+ Itowns/Controls/MousePosition.js, line 210 +
+ +
+ + +
+
+ + +
+

Sets additional projection systems

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
systems + + +Array + + + + + +

Array of system object, with following properties :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
crs + + +String + + + + + +

Proj4 CRS alias (from proj4 defs) e.g. "EPSG:4326"

label + + +String + + + + + +

CRS label (for coordinates conversion)

type + + +String + + + + + +

CRS units type to be displayed in control (one of control options.units). Default is "Metric"

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + displayAltitude(displayAltitude) +

+ + +
+ Itowns/Controls/MousePosition.js, line 327 +
+ +
+ + +
+
+ + +
+

Displays or hides elevation panel

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
displayAltitude + + +Boolean + + + + + +

true to display elevation panel, false to hide it

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + displayCoordinates(displayCoordinates) +

+ + +
+ Itowns/Controls/MousePosition.js, line 340 +
+ +
+ + +
+
+ + +
+

Displays or hides coordinates panel

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
displayCoordinates + + +Boolean + + + + + +

true to display coordinates panel, false to hide it

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + removeSystem(systemCrs) +

+ + +
+ Itowns/Controls/MousePosition.js, line 228 +
+ +
+ + +
+
+ + +
+

Removes projection system (in case there are several system with same code, only the first one will be removed)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
systemCrs + + +String + + + + + +

CRS alias (from proj4 defs)

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setAltitudeOptions(options) +

+ + +
+ Itowns/Controls/MousePosition.js, line 307 +
+ +
+ + +
+
+ + +
+

Sets control altitude options (useless if displayAltitude == false)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

altitude options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
serviceOptions + + +Object + + + + + + + optional + + + + + +

options of elevation service

responseDelay + + +Number + + + + + + + optional + + + + + +

latency for elevation request, 500 ms by default

triggerDelay + + +Number + + + + + + + optional + + + + + +

immobilisation time of movement on the globe to trigger the elevation calculation, 200 ms by default

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setCollapsed(collapsed) +

+ + +
+ Itowns/Controls/MousePosition.js, line 354 +
+ +
+ + +
+
+ + +
+

Collapses or displays control main container

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
collapsed + + +Boolean + + + + + +

True to collapse control, False to display it

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/MousePosition.js, line 120 +
+ +
+ + +
+
+ + +
+

Bind globe to control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +GlobeViewExtended + + + + + +

the globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setUnits(units) +

+ + +
+ Itowns/Controls/MousePosition.js, line 287 +
+ +
+ + +
+
+ + +
+

Sets control units (to be displayed)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
units + + +Array + + + + + +

list of all coordinates units, to be displayed in control units list.
+Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates,
+and "M" or "KM" for metric coordinates

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.Scale.html b/itowns-2.5.0-beta/jsdoc/itowns.control.Scale.html new file mode 100644 index 000000000..16aa68531 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.Scale.html @@ -0,0 +1,3265 @@ + + + + + + + + + + + + + Class: Scale + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: Scale

+ + + + +
+ + +

+ itowns.control.Scale +

+ + +

Control to display the scalebar with itowns

+ + + +
+
+ + + + +
+
+

+ + new Scale(options) +

+ + +
+ Itowns/Controls/Scale.js, line 22 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

widget options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +String + + + + + +

HTML target element or HTML target element id

position + + +String + + + + + +

"absolute" or "relative"

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var scale = new itowns.control.Scale();
+ + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + inherited + + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 55 +
+ +
+ + +
+
+ + +
+

Return the widget's container element.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getGlobe(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 115 +
+ +
+ + +
+
+ + +
+

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getOptions(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 135 +
+ +
+ + +
+
+ + +
+

Get the options associated with the widget.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + getPosition(){String} +

+ + +
+ Itowns/Controls/Widget.js, line 105 +
+ +
+ + +
+
+ + +
+

Return the widget's element position.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element position. +
+ + + + + +
+ + + +
+
+

+ + inherited + + getTarget(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 85 +
+ +
+ + +
+
+ + +
+

Return the widget's target div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+target div. +
+ + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/Scale.js, line 69 +
+ +
+ + +
+
+ + +
+

Bind globe to control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +GlobeViewExtended + + + + + +

the globe

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setOptions(options) +

+ + +
+ Itowns/Controls/Widget.js, line 145 +
+ +
+ + +
+
+ + +
+

Set the options of the control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

Options to associate to the widget.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + inherited + + setTarget(target, position) +

+ + +
+ Itowns/Controls/Widget.js, line 66 +
+ +
+ + +
+
+ + +
+

Associates the widget to a specified target div.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +HTMLElement +| + +String + + + + + +

widget target div html element or target div id.

position + + +String + + + + + +

html position attribute.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.control.Widget.html b/itowns-2.5.0-beta/jsdoc/itowns.control.Widget.html new file mode 100644 index 000000000..c6ca20021 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.control.Widget.html @@ -0,0 +1,3430 @@ + + + + + + + + + + + + + Class: Widget + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: Widget

+ + + + +
+ + +

+ itowns.control.Widget +

+ + +

iTowns Widget class.
+Every geoportal control inherits of this class.

+ + + +
+
+ + + + +
+
+

+ + new Widget(options) +

+ + +
+ Itowns/Controls/Widget.js, line 27 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

options for function call.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + + +

Name of the widget.

element + + +Object + + + + + +

HTML element of the widget

target + + +Object +| + +String + + + + + +

HTML element or HTML element id where to put the widget

position + + +String + + + + + +

"absolute" or "relative"

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var myWidget = new itowns.control.Widget({
+     name : "myWidget",
+     element : myWidgetDiv,
+     target : myWidgetTargetDiv,
+     position: "absolute"
+});
+ + + +
+ + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

constructor

+
+ + +
+
+ +
+

Constructor (alias)

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

+ + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 55 +
+ +
+ + +
+
+ + +
+

Return the widget's container element.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+container element. +
+ + + + + +
+ + + +
+
+

+ + getElement(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 95 +
+ +
+ + +
+
+ + +
+

Return the widget's element div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element div. +
+ + + + + +
+ + + +
+
+

+ + getGlobe(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 115 +
+ +
+ + +
+
+ + +
+

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getOptions(){Object} +

+ + +
+ Itowns/Controls/Widget.js, line 135 +
+ +
+ + +
+
+ + +
+

Get the options associated with the widget.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + getPosition(){String} +

+ + +
+ Itowns/Controls/Widget.js, line 105 +
+ +
+ + +
+
+ + +
+

Return the widget's element position.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+element position. +
+ + + + + +
+ + + +
+
+

+ + getTarget(){HTMLElement} +

+ + +
+ Itowns/Controls/Widget.js, line 85 +
+ +
+ + +
+
+ + +
+

Return the widget's target div.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+target div. +
+ + + + + +
+ + + +
+
+

+ + setGlobe(globe) +

+ + +
+ Itowns/Controls/Widget.js, line 125 +
+ +
+ + +
+
+ + +
+

Associate a globe to the widget.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
globe + + +Object + + + + + +

Globe to associate to the widget.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setOptions(options) +

+ + +
+ Itowns/Controls/Widget.js, line 145 +
+ +
+ + +
+
+ + +
+

Set the options of the control

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

Options to associate to the widget.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + setTarget(target, position) +

+ + +
+ Itowns/Controls/Widget.js, line 66 +
+ +
+ + +
+
+ + +
+

Associates the widget to a specified target div.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +HTMLElement +| + +String + + + + + +

widget target div html element or target div id.

position + + +String + + + + + +

html position attribute.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalElevation.html b/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalElevation.html new file mode 100644 index 000000000..a2609a061 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalElevation.html @@ -0,0 +1,2691 @@ + + + + + + + + + + + + + Class: GeoportalElevation + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: GeoportalElevation

+ + + + +
+ + +

+ itowns.layer.GeoportalElevation +

+ + +

Geoportal elevation source creation

+ + + +
+
+ + + + +
+
+

+ + new GeoportalElevation(options) +

+ + +
+ Itowns/Layer/LayerElevation.js, line 39 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

options for function call.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
layer + + +String + + + + + + + + + + +

Elevation layer name (e.g. "ELEVATION.ELEVATIONGRIDCOVERAGE")

ssl + + +Boolean + + + + + + + optional + + + + + +

if set true, enforce protocol https (only for nodejs)

apiKey + + +String + + + + + + + optional + + + + + +

Access key to Geoportal platform

legends + + +Array + + + + + + + optional + + + + + +

Overloads the default legends objects associated to the layer

metadata + + +Array + + + + + + + optional + + + + + +

Overloads the default Metadata objects associated to the layer

title + + +String + + + + + + + optional + + + + + +

Overloads the default title of the layer

description + + +String + + + + + + + optional + + + + + +

Overloads the default description of the layer

quicklookUrl + + +String + + + + + + + optional + + + + + +

Overloads the default quicklookUrl of the layer

itownsParams + + +Object + + + + + + + optional + + + + + +

options to overload default geoportal layer options for itowns.GlobeView.addLayer function (see GlobeView.addLayer)

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var geoportalElevation = new itowns.layer.GeoportalElevation({
+     layer  : "ELEVATION.ELEVATIONGRIDCOVERAGE"
+});
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMS.html b/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMS.html new file mode 100644 index 000000000..6a27dd753 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMS.html @@ -0,0 +1,2731 @@ + + + + + + + + + + + + + Class: GeoportalWMS + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: GeoportalWMS

+ + + + +
+ + +

+ itowns.layer.GeoportalWMS +

+ + +

Geoportal WMTS source creation

+ + + +
+
+ + + + +
+
+

+ + new GeoportalWMS(options) +

+ + +
+ Itowns/Layer/LayerWMS.js, line 38 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

options for function call.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
layer + + +String + + + + + + + + + + + + +

Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS")

ssl + + +Boolean + + + + + + true + + + + + optional + + + + + +

use of ssl or not (default true, service requested using https protocol)

apiKey + + +String + + + + + + + + + optional + + + + + +

Access key to Geoportal platform

legends + + +Array + + + + + + + + + optional + + + + + +

Overloads the default legends objects associated to the layer

metadata + + +Array + + + + + + + + + optional + + + + + +

Overloads the default Metadata objects associated to the layer

title + + +String + + + + + + + + + optional + + + + + +

Overloads the default title of the layer

description + + +String + + + + + + + + + optional + + + + + +

Overloads the default description of the layer

quicklookUrl + + +String + + + + + + + + + optional + + + + + +

Overloads the default quicklookUrl of the layer

itownsParams + + +Object + + + + + + + + + optional + + + + + +

other options for itowns.GlobeView.addLayer function (see GlobeView.addLayer)

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var geoportalWMS = new itowns.layer.GeoportalWMS({
+     layer  : "ORTHOIMAGERY.ORTHOPHOTOS"
+});
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMTS.html b/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMTS.html new file mode 100644 index 000000000..85b9f0dac --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.layer.GeoportalWMTS.html @@ -0,0 +1,2731 @@ + + + + + + + + + + + + + Class: GeoportalWMTS + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: GeoportalWMTS

+ + + + +
+ + +

+ itowns.layer.GeoportalWMTS +

+ + +

Geoportal WMTS source creation

+ + + +
+
+ + + + +
+
+

+ + new GeoportalWMTS(options) +

+ + +
+ Itowns/Layer/LayerWMTS.js, line 38 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

options for function call.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
layer + + +String + + + + + + + + + + + + +

Layer name (e.g. "ORTHOIMAGERY.ORTHOPHOTOS")

ssl + + +Boolean + + + + + + true + + + + + optional + + + + + +

use of ssl or not (default true, service requested using https protocol)

apiKey + + +String + + + + + + + + + optional + + + + + +

Access key to Geoportal platform

legends + + +Array + + + + + + + + + optional + + + + + +

Overloads the default legends objects associated to the layer

metadata + + +Array + + + + + + + + + optional + + + + + +

Overloads the default Metadata objects associated to the layer

title + + +String + + + + + + + + + optional + + + + + +

Overloads the default title of the layer

description + + +String + + + + + + + + + optional + + + + + +

Overloads the default description of the layer

quicklookUrl + + +String + + + + + + + + + optional + + + + + +

Overloads the default quicklookUrl of the layer

itownsParams + + +Object + + + + + + + + + optional + + + + + +

other options for itowns.GlobeView.addLayer function (see GlobeView.addLayer)

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var geoportalWMTS = new itowns.layer.GeoportalWMTS({
+     layer  : "ORTHOIMAGERY.ORTHOPHOTOS"
+});
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/itowns.layer.VectorTileLayer.html b/itowns-2.5.0-beta/jsdoc/itowns.layer.VectorTileLayer.html new file mode 100644 index 000000000..e4a526ad6 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/itowns.layer.VectorTileLayer.html @@ -0,0 +1,2629 @@ + + + + + + + + + + + + + Class: VectorTileLayer + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Class: VectorTileLayer

+ + + + +
+ + +

+ itowns.layer.VectorTileLayer +

+ + +

Geoportal VT source creation

+ + + +
+
+ + + + +
+
+

+ + new VectorTileLayer(options) +

+ + +
+ Itowns/Layer/VectorTileLayer.js, line 33 +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + + +

options for function call.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + + + + + + + +

id to give to the layer

layer + + +String + + + + + + + + + + +

Layer name (e.g. "PLAN.IGN")

url + + +String + + + + + + + optional + + + + + +

Url to the vector Tile json style

urlService + + +String + + + + + + + optional + + + + + +

Url to the pbf file. Retrieved in the style file by default.

filter + + +function + + + + + + + optional + + + + + +

Filter applied to the vector layer style. Fill/Line layer type by default.

attributions + + +Object + + + + + + + optional + + + + + +

Attributions of the layer.

zoom + + +Object + + + + + + + optional + + + + + +

Between which zoom levels the layer is displayed (zoom.min and zoom.max)

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ + + +
var vectorTileLayer = new itowns.layer.VectorTileLayer({
+     layer : "PLAN.IGN"
+});
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-ColorUtils.html b/itowns-2.5.0-beta/jsdoc/module-ColorUtils.html new file mode 100644 index 000000000..9d3d5d9f6 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-ColorUtils.html @@ -0,0 +1,2857 @@ + + + + + + + + + + + + + Module: ColorUtils + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: ColorUtils

+ + + + +
+ + +

+ Gp.ColorUtils +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
arrayTorgba();
+arrayToHex();
+rgbaToHex();
+hexToRgba();
+isHex();
+isRGB();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innerarrayToHex(values){Object} +

+ + +
+ Common/Utils/ColorUtils.js, line 60 +
+ +
+ + +
+
+ + +
+

Converts an array ([255,255,255,1]) to #RRGGBBAA

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
values + + +Array + + + + + +

array of values

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+and opacity formated values +
+ + + + + +
+ + + +
+
+

+ + innerarrayToRgba(values){String} +

+ + +
+ Common/Utils/ColorUtils.js, line 41 +
+ +
+ + +
+
+ + +
+

Converts an array ([255,255,255,1]) to rgba string

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
values + + +Array + + + + + +

array of values

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+color of RGB or RGBA format +
+ + + + + +
+ + + +
+
+

+ + innerhexToRgba(hex, opacity){String} +

+ + +
+ Common/Utils/ColorUtils.js, line 113 +
+ +
+ + +
+
+ + +
+

Converts hex color and opacity value to rgba string.
+(Code adapted from : http://stackoverflow.com/a/5624139)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hex + + +String + + + + + +

A color value on RGB format (hexa).

opacity + + +Number + + + + + +

A opacity value.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+color of RGB or RGBA format +
+ + + + + +
+ + + +
+
+

+ + innerrgbaToHex(rgba){Object} +

+ + +
+ Common/Utils/ColorUtils.js, line 85 +
+ +
+ + +
+
+ + +
+

Converts rgba string to #RRGGBBAA
+(Code adapted from : https://gist.github.com/mstssk/afda4ce9e5c335fd79cd)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
rgba + + +String + + + + + +

A color of RGB or RGBA format.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+and opacity formated values +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-Config.html b/itowns-2.5.0-beta/jsdoc/module-Config.html new file mode 100644 index 000000000..0b81cf990 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-Config.html @@ -0,0 +1,2315 @@ + + + + + + + + + + + + + Module: Config + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: Config

+ + + + +
+ + +

+ [private] Config +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
isConfigLoaded();
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-Draggable.html b/itowns-2.5.0-beta/jsdoc/module-Draggable.html new file mode 100644 index 000000000..903675500 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-Draggable.html @@ -0,0 +1,2511 @@ + + + + + + + + + + + + + Module: Draggable + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: Draggable

+ + + + +
+ + +

+ [private] Draggable +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
dragElement();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innerdragElement(element, header, container) +

+ + +
+ Common/Utils/Draggable.js, line 15 +
+ +
+ + +
+
+ + +
+

A draggable HTML element with JavaScript and CSS.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
element + + +DOMElement + + + + + +

element

header + + +DOMElement + + + + + +

header (optional)

container + + +DOMElement + + + + + +

container (optional)

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Example
+ + + +
// CSS :
+      // #element { position: absolute; }
+  // HTML :
+      // 
+ //
+ // + //
+ // JS : + var element = document.getElementById("element"); + Draggable.dragElement(element, header, container);
+ + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-Gp.html b/itowns-2.5.0-beta/jsdoc/module-Gp.html new file mode 100644 index 000000000..314757f03 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-Gp.html @@ -0,0 +1,2786 @@ + + + + + + + + + + + + + Module: Gp + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: Gp

+ + + + +
+ + +

+ Gp +

+ + + + +
+
+ + + + +

This is the global variable that is exposed in the browser environment.
+Content is composed of constructor, functions and properties...

+
+

ColorUtils: (...)
+LayerUtils: (...)
+MathUtils: (...)
+ProxyUtils: (...)
+Logger: (...)

+
+
+

itownsExtended: (...)

+
+
+

itownsExtVersion: "YYYY-MM-DD"
+itownsExtVersion: "X.X.X"

+
+
+

Error: (...)
+Helper: (...)
+Protocols: (...)
+Services: (...)
+servicesDate: "YYYY-MM-DD"
+servicesVersion: "X.X.X"

+
+

The following variables are aslo global :

+
    +
  • proj4,
  • +
  • itowns
  • +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

staticmodule:Gp.Error

+
+ + +
+
+ +
+

Error

+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

staticmodule:Gp.Helper

+
+ + +
+
+ +
+

Helper

+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

static,constantmodule:Gp.itownsExtDate

+
+ + +
+
+ +
+

Publication date

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

staticmodule:Gp.itownsExtended

+
+ + +
+
+ +
+

Expose extensions extended

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

static,constantmodule:Gp.itownsExtVersion

+
+ + +
+
+ +
+

Version

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

staticmodule:Gp.Protocols

+
+ + +
+
+ +
+

Protocols

+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

staticmodule:Gp.Services

+
+ + +
+
+ +
+

Services

+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

staticmodule:Gp.servicesDate

+
+ + +
+
+ +
+

servicesDate

+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

staticmodule:Gp.servicesVersion

+
+ + +
+
+ +
+

servicesVersion

+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-LayerUtils.html b/itowns-2.5.0-beta/jsdoc/module-LayerUtils.html new file mode 100644 index 000000000..7b668039a --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-LayerUtils.html @@ -0,0 +1,2886 @@ + + + + + + + + + + + + + Module: LayerUtils + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: LayerUtils

+ + + + +
+ + +

+ Gp.LayerUtils +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
getZoomLevelFromScaleDenominator();
+getAttributions();
+intersects();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innergetAttributions(params){Object} +

+ + +
+ Common/Utils/LayerUtils.js, line 184 +
+ +
+ + +
+
+ + +
+

Get attributions list for a layer, based on current zoom and extent

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params + + +Object + + + + + +

function params

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
extent + + +Array.<Float> + + + + + +

map current geographical extent (EPSG:4326) : [top, left, bottom, right] = [maxy, minx, miny, maxx]

zoom + + +Number + + + + + +

map current zoom

crs + + +String + + + + + +

map current projection code (ex "EPSG:2154")

visibility + + +Boolean + + + + + +

layer visibility

originators + + +Gp.Services.Config.Originator + + + + + +

resource originators (from Gp.Config.layers[].originators)

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+- associative array, mapping originators url (keys) with their properties : html attributions elements +
+ + + + + +
+ + + +
+
+

+ + innergetZoomLevelFromScaleDenominator(scaleDenominator, crs){Integer} +

+ + +
+ Common/Utils/LayerUtils.js, line 14 +
+ +
+ + +
+
+ + +
+

Obtenir le ZoomLevel à partir du ScaleDenominator

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
scaleDenominator + + +Number + + + + + +

the scale denominator

crs + + +String + + + + + +

the crs

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+level +
+ + + + + +
+ + + +
+
+

+ + innerintersects(extent1, extent2){Boolean} +

+ + +
+ Common/Utils/LayerUtils.js, line 300 +
+ +
+ + +
+
+ + +
+

Determines if one extent (extent1) intersects another (extent2)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
extent1 + + +Array.<Float> + + + + + +

First extent : [top, left, bottom, right] = [maxy, minx, miny, maxx]

extent2 + + +Array.<Float> + + + + + +

Second extent : [top, left, bottom, right] = [maxy, minx, miny, maxx]

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+- True if the two extents intersect, false otherwise. +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-LoggerByDefault.html b/itowns-2.5.0-beta/jsdoc/module-LoggerByDefault.html new file mode 100644 index 000000000..f2497ebdf --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-LoggerByDefault.html @@ -0,0 +1,2601 @@ + + + + + + + + + + + + + Module: LoggerByDefault + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: LoggerByDefault

+ + + + +
+ + +

+ [private] LoggerByDefault +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
getLogger();
+disableAll();
+enableAll();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innerdisableAll() +

+ + +
+ Common/Utils/LoggerByDefault.js, line 40 +
+ +
+ + +
+
+ + +
+

desactive tous les loggers

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + innerenableAll() +

+ + +
+ Common/Utils/LoggerByDefault.js, line 53 +
+ +
+ + +
+
+ + +
+

active tous les loggers

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + innergetLogger(name){Object} +

+ + +
+ Common/Utils/LoggerByDefault.js, line 15 +
+ +
+ + +
+
+ + +
+

creation d'un logger statique

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
name + + +String + + + + + + "default" + + + + + optional + + + + + +

the logger name

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-MathUtils.html b/itowns-2.5.0-beta/jsdoc/module-MathUtils.html new file mode 100644 index 000000000..745b3b5f6 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-MathUtils.html @@ -0,0 +1,3039 @@ + + + + + + + + + + + + + Module: MathUtils + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: MathUtils

+ + + + +
+ + +

+ Gp.MathUtils +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
modulo();
+decimalToDMS();
+toInteger();
+isInteger();
+toFloat();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innerdecimalToDMS(degrees, hemispheres, numDigits){Object} +

+ + +
+ Common/Utils/MathUtils.js, line 27 +
+ +
+ + +
+
+ + +
+

Transform degrees, minutes, seconds form decimal degrees -
+Largely inspired by the private function degreesToStringHDMS from ol/coordinate.js

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
degrees + + +Number + + + + + +

decimal degrees

hemispheres + + +Array + + + + + +

"NS" ou "EO"

numDigits + + +Number + + + + + +

number of digits for seconds

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+coordinate +
+ + + + + +
+ + + +
+
+

+ + innerisInteger(s){Boolean} +

+ + +
+ Common/Utils/MathUtils.js, line 84 +
+ +
+ + +
+
+ + +
+

check if s represents an integer

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
s + + +String + + + + + +

string number

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+integer +
+ + + + + +
+ + + +
+
+

+ + innermodulo(a, b){Number} +

+ + +
+ Common/Utils/MathUtils.js, line 15 +
+ +
+ + +
+
+ + +
+

Reste de la division euclidienne

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +Number + + + + + +

divisor

b + + +Number + + + + + +

quotient

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + innertoFloat(s){null|Numeric} +

+ + +
+ Common/Utils/MathUtils.js, line 100 +
+ +
+ + +
+
+ + +
+

Converts s to float

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
s + + +String + + + + + +

string number

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + innertoInteger(s, base){null|Numeric} +

+ + +
+ Common/Utils/MathUtils.js, line 67 +
+ +
+ + +
+
+ + +
+

Converts string to Integer

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
s + + +String + + + + + +

string number

base + + +Numeric + + + + + +

between 2 and 36

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-Parser.html b/itowns-2.5.0-beta/jsdoc/module-Parser.html new file mode 100644 index 000000000..b37966d88 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-Parser.html @@ -0,0 +1,2316 @@ + + + + + + + + + + + + + Module: Parser + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: Parser

+ + + + +
+ + +

+ Gp.Parser +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
parse();
+toString();
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-ProfileElevationPathDOM.html b/itowns-2.5.0-beta/jsdoc/module-ProfileElevationPathDOM.html new file mode 100644 index 000000000..07ba326ed --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-ProfileElevationPathDOM.html @@ -0,0 +1,2307 @@ + + + + + + + + + + + + + Module: ProfileElevationPathDOM + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: ProfileElevationPathDOM

+ + + + +
+ + +

+ [private] ProfileElevationPathDOM +

+ + + + +
+
+ + + + +

create DOM element

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-ProxyUtils.html b/itowns-2.5.0-beta/jsdoc/module-ProxyUtils.html new file mode 100644 index 000000000..684e1b37f --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-ProxyUtils.html @@ -0,0 +1,2562 @@ + + + + + + + + + + + + + Module: ProxyUtils + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: ProxyUtils

+ + + + +
+ + +

+ Gp.ProxyUtils +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
proxifyUrl();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innerproxifyUrl(url, proxyOptions){String} +

+ + +
+ Common/Utils/ProxyUtils.js, line 13 +
+ +
+ + +
+
+ + +
+

Ajoute un proxy aux url des couches vecteurs si besoin.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
url + + +String + + + + + + + + + + +

Url to proxify.

proxyOptions + + +Object + + + + + + + optional + + + + + +

Object defining proxy options.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxyUrl + + +String + + + + + + + + + + +

Proxy URL.

noProxyDomains + + +Array.<String> + + + + + + + optional + + + + + +

Proxy will not be used for this list of domain names.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+url +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-Register.html b/itowns-2.5.0-beta/jsdoc/module-Register.html new file mode 100644 index 000000000..7236862ab --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-Register.html @@ -0,0 +1,2982 @@ + + + + + + + + + + + + + Module: Register + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: Register

+ + + + +
+ + +

+ [private] Register +

+ + + + +
+
+ + + + +

Register definition for IGNF, and EPSG CRS.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
Gp.Register.IGNF.AMST63
+  // return : "+title=Amsterdam 1963 +proj=geocent +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs"
+Gp.Register.get("IGNF:AMST63")
+  // same as Gp.Register.IGNF.AMST63
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innerexist(name){Boolean} +

+ + +
+ Common/Utils/Register.js, line 54 +
+ +
+ + +
+
+ + +
+

does projection code exist ?

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + + +

ie. EPSG:2154 (Lambert)

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ + + +
Register.exist("EPSG:2154"); // true
+ + + +
+ + + +
+
+

+ + innerget(name){Object} +

+ + +
+ Common/Utils/Register.js, line 20 +
+ +
+ + +
+
+ + +
+

get the definition for a code

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + + +

ie. EPSG:2154 (Lambert)

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ + + +
Register.get("EPSG:2154");
+// "+title=RGF93 / Lambert-93 +proj=lcc +lat_1=49 ..."
+ + + +
+ + + +
+
+

+ + innerload(Proj4) +

+ + +
+ Common/Utils/Register.js, line 87 +
+ +
+ + +
+
+ + +
+

load all defs to proj4

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
Proj4 + + +Object + + + + + +

proj4 instance

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + innerloadByDefault(Proj4) +

+ + +
+ Common/Utils/Register.js, line 126 +
+ +
+ + +
+
+ + +
+

load defs by default to proj4

+

include into proj4 :

+
    +
  • WGS84
  • +
  • ['EPSG:4326']
  • +
  • ['EPSG:3785'], ['EPSG:3857'], GOOGLE, ['EPSG:900913'], ['EPSG:102113']
  • +
+
    +
  • +
+
    +
  • ["EPSG:2154"], ["EPSG:27571"], ["EPSG:27572"], ["EPSG:27573"], ["EPSG:2757"],
  • +
  • ["CRS:84"],
  • +
  • ["IGNF:LAMB93"],
  • +
  • ["IGNF:LAMBE"], ["IGNF:LAMB1"], ["IGNF:LAMB2"], ["IGNF:LAMB3"], ["IGNF:LAMB4"],
  • +
  • ["IGNF:RGF93G"],
  • +
  • ["IGNF:WGS84G"]
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
Proj4 + + +Object + + + + + +

proj4 instance

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + innerloadByName(Proj4, name){Boolean} +

+ + +
+ Common/Utils/Register.js, line 182 +
+ +
+ + +
+
+ + +
+

load only a def to proj4

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
Proj4 + + +Object + + + + + +

proj4 instance

name + + +String + + + + + +

ie. EPSG:2154 (Lambert)

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-SearchEngineUtils.html b/itowns-2.5.0-beta/jsdoc/module-SearchEngineUtils.html new file mode 100644 index 000000000..5bf293e78 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-SearchEngineUtils.html @@ -0,0 +1,2518 @@ + + + + + + + + + + + + + Module: SearchEngineUtils + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: SearchEngineUtils

+ + + + +
+ + +

+ [private] SearchEngineUtils +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
advancedSearchFiltersByDefault();
+zoomToResultsByDefault();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + inneradvancedSearchFiltersByDefault() +

+ + +
+ Common/Utils/SearchEngineUtils.js, line 12 +
+ +
+ + +
+
+ + +
+

Advanced Search Filters by default

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + innerzoomToResultsByDefault(info){Integer} +

+ + +
+ Common/Utils/SearchEngineUtils.js, line 98 +
+ +
+ + +
+
+ + +
+

Provides default zoom based on results.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
info + + +Object + + + + + +

location information

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+level +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-SelectorID.html b/itowns-2.5.0-beta/jsdoc/module-SelectorID.html new file mode 100644 index 000000000..dbf13550a --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-SelectorID.html @@ -0,0 +1,2763 @@ + + + + + + + + + + + + + Module: SelectorID + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: SelectorID

+ + + + +
+ + +

+ [private] SelectorID +

+ + + + +
+
+ + + + +

formalisme d'un tag ID :
+-> NAME(_ORDER)-1460636385836

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
Ex.
+  GProutePoints-1460636385836
+  GProutePoint_10-1460636385836
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innergenerate() +

+ + +
+ Common/Utils/SelectorID.js, line 15 +
+ +
+ + +
+
+ + +
+

Construction d'un identifiant statique basé sur le timestamp,
+et qui s'incremente de +1 à chaque appel

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + innerindex(id){String} +

+ + +
+ Common/Utils/SelectorID.js, line 46 +
+ +
+ + +
+
+ + +
+

numero d'identifiant du tag

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + + +

the id

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + innername(id){String} +

+ + +
+ Common/Utils/SelectorID.js, line 27 +
+ +
+ + +
+
+ + +
+

nom du tag

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + + +

the id

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + inneruuid(id){String} +

+ + +
+ Common/Utils/SelectorID.js, line 67 +
+ +
+ + +
+
+ + +
+

uuid du tag

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + + +

the id

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/module-Utils.html b/itowns-2.5.0-beta/jsdoc/module-Utils.html new file mode 100644 index 000000000..b45997628 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/module-Utils.html @@ -0,0 +1,2713 @@ + + + + + + + + + + + + + Module: Utils + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Geoportal Extension for Itowns API Reference

+
+
+ + +
+ + + + + +
+ +

Module: Utils

+ + + + +
+ + +

+ Gp.olUtils +

+ + + + +
+
+ + + + +

...

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ + + +
detectSupport();
+assign();
+mergeParams();
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + innerassign(dest, source){Object} +

+ + +
+ Common/Utils.js, line 46 +
+ +
+ + +
+
+ + +
+

Copies all source object members to dest

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
dest + + +Object + + + + + +

destination object where properties and method will be copied

source + + +Object + + + + + +

source object from which properties and method will be copied

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+ + innerdetectSupport(){Boolean} +

+ + +
+ Common/Utils.js, line 14 +
+ +
+ + +
+
+ + +
+

this method is called by the constructor.
+this information is useful to switch to touch mode.
+Detection : test for desktop or tactile

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+- true for desktop userAgent, false for mobile +
+ + + + + +
+ + + +
+
+

+ + innermergeParams(dest, source, replace) +

+ + +
+ Common/Utils.js, line 64 +
+ +
+ + +
+
+ + +
+

Merge two objects parameters (deeper than assign)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
dest + + +Object + + + + + +

destination object where properties and method will be merge

source + + +Object + + + + + +

source object from which properties and method will be merge

replace + + +Boolean + + + + + +

replace destination value by source if exists or not (true by default)

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+
+ +
+ Geoportail - Copyright (c) IGN, released under the CECILL-B license +
+ Documentation generated by JSDoc 3.6.11 on Thu Sep 21 2023 18:25:45 GMT+0000 (Coordinated Universal Time) +
+ + + + + + + \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/scripts/bootstrap.min.js b/itowns-2.5.0-beta/jsdoc/scripts/bootstrap.min.js new file mode 100644 index 000000000..1a6258efc --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/scripts/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.0.3 (http://getbootstrap.com) + * Copyright 2013 Twitter, Inc. + * Licensed under http://www.apache.org/licenses/LICENSE-2.0 + */ + +if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); \ No newline at end of file diff --git a/itowns-2.5.0-beta/jsdoc/scripts/jquery.min.js b/itowns-2.5.0-beta/jsdoc/scripts/jquery.min.js new file mode 100644 index 000000000..9a85bd346 --- /dev/null +++ b/itowns-2.5.0-beta/jsdoc/scripts/jquery.min.js @@ -0,0 +1,6 @@ +/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery.min.map +*/ +(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],p="2.0.3",f=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:p,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return f.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,p,f,h,d,g,m,y,v="sizzle"+-new Date,b=e.document,w=0,T=0,C=st(),k=st(),N=st(),E=!1,S=function(e,t){return e===t?(E=!0,0):0},j=typeof undefined,D=1<<31,A={}.hasOwnProperty,L=[],q=L.pop,H=L.push,O=L.push,F=L.slice,P=L.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",$=W.replace("w","w#"),B="\\["+M+"*("+W+")"+M+"*(?:([*^$|!~]?=)"+M+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+$+")|)|)"+M+"*\\]",I=":("+W+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+B.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=RegExp("^"+M+"*,"+M+"*"),X=RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=RegExp(M+"*[+~]"),Y=RegExp("="+M+"*([^\\]'\"]*)"+M+"*\\]","g"),V=RegExp(I),G=RegExp("^"+$+"$"),J={ID:RegExp("^#("+W+")"),CLASS:RegExp("^\\.("+W+")"),TAG:RegExp("^("+W.replace("w","w*")+")"),ATTR:RegExp("^"+B),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/^(?:input|select|textarea|button)$/i,et=/^h\d$/i,tt=/'|\\/g,nt=RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{O.apply(L=F.call(b.childNodes),b.childNodes),L[b.childNodes.length].nodeType}catch(it){O={apply:L.length?function(e,t){H.apply(e,F.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function ot(e,t,r,i){var o,s,a,u,l,f,g,m,x,w;if((t?t.ownerDocument||t:b)!==p&&c(t),t=t||p,r=r||[],!e||"string"!=typeof e)return r;if(1!==(u=t.nodeType)&&9!==u)return[];if(h&&!i){if(o=K.exec(e))if(a=o[1]){if(9===u){if(s=t.getElementById(a),!s||!s.parentNode)return r;if(s.id===a)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(a))&&y(t,s)&&s.id===a)return r.push(s),r}else{if(o[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=o[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&(!d||!d.test(e))){if(m=g=v,x=t,w=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(g=t.getAttribute("id"))?m=g.replace(tt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=f.length;while(l--)f[l]=m+mt(f[l]);x=U.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return O.apply(r,x.querySelectorAll(w)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,r,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>i.cacheLength&&delete t[e.shift()],t[n]=r}return t}function at(e){return e[v]=!0,e}function ut(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)i.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return at(function(t){return t=+t,at(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},n=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:b,r=t.defaultView;return t!==p&&9===t.nodeType&&t.documentElement?(p=t,f=t.documentElement,h=!s(t),r&&r.attachEvent&&r!==r.top&&r.attachEvent("onbeforeunload",function(){c()}),n.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ut(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),n.getById=ut(function(e){return f.appendChild(e).id=v,!t.getElementsByName||!t.getElementsByName(v).length}),n.getById?(i.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&h?t.getElementsByClassName(e):undefined},g=[],d=[],(n.qsa=Q.test(t.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll(":checked").length||d.push(":checked")}),ut(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&d.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")})),(n.matchesSelector=Q.test(m=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut(function(e){n.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",I)}),d=d.length&&RegExp(d.join("|")),g=g.length&&RegExp(g.join("|")),y=Q.test(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},S=f.compareDocumentPosition?function(e,r){if(e===r)return E=!0,0;var i=r.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(r);return i?1&i||!n.sortDetached&&r.compareDocumentPosition(e)===i?e===t||y(b,e)?-1:r===t||y(b,r)?1:l?P.call(l,e)-P.call(l,r):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],u=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:l?P.call(l,e)-P.call(l,n):0;if(o===s)return ct(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)u.unshift(r);while(a[i]===u[i])i++;return i?ct(a[i],u[i]):a[i]===b?-1:u[i]===b?1:0},t):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Y,"='$1']"),!(!n.matchesSelector||!h||g&&g.test(t)||d&&d.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&c(e);var r=i.attrHandle[t.toLowerCase()],o=r&&A.call(i.attrHandle,t.toLowerCase())?r(e,t,!h):undefined;return o===undefined?n.attributes||!h?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null:o},ot.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,o=0;if(E=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(S),E){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=ot.selectors={cacheLength:50,createPseudo:at,match:J,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[4]||e[5]||"").replace(nt,rt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return J.CHILD.test(e[0])?null:(e[3]&&e[4]!==undefined?e[2]=e[4]:n&&V.test(n)&&(t=gt(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,y=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){p=t;while(p=p[g])if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[v]||(m[v]={}),l=c[e]||[],h=l[0]===w&&l[1],f=l[0]===w&&l[2],p=h&&m.childNodes[h];while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[w,h,f];break}}else if(x&&(l=(t[v]||(t[v]={}))[e])&&l[0]===w)f=l[1];else while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if((a?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(x&&((p[v]||(p[v]={}))[e]=[w,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[v]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,o=r(e,t),s=o.length;while(s--)i=P.call(e,o[s]),e[i]=!(n[i]=o[s])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(z,"$1"));return r[v]?at(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return G.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return et.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},i.pseudos.nth=i.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=ft(t);function dt(){}dt.prototype=i.filters=i.pseudos,i.setFilters=new dt;function gt(e,t){var n,r,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=i.preFilter;while(a){(!n||(r=_.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=X.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(z," ")}),a=a.slice(n.length));for(s in i.filter)!(r=J[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ot.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,n){var i=t.dir,o=n&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,a){var u,l,c,p=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[v]||(t[v]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,a)||r,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[v]&&(r=bt(r)),i&&!i[v]&&(i=bt(i,o)),at(function(o,s,a,u){var l,c,p,f=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,f,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(p=l[c])&&(y[h[c]]=!(m[h[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?P.call(o,p):f[c])>-1&&(o[l]=!(s[l]=p))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):O.apply(s,y)})}function wt(e){var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,c=yt(function(e){return e===t},a,!0),p=yt(function(e){return P.call(t,e)>-1},a,!0),f=[function(e,n,r){return!s&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>l;l++)if(n=i.relative[e[l].type])f=[yt(vt(f),n)];else{if(n=i.filter[e[l].type].apply(null,e[l].matches),n[v]){for(r=++l;o>r;r++)if(i.relative[e[r].type])break;return bt(l>1&&vt(f),l>1&&mt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&wt(e.slice(l,r)),o>r&&wt(e=e.slice(r)),o>r&&mt(e))}f.push(n)}return vt(f)}function Tt(e,t){var n=0,o=t.length>0,s=e.length>0,a=function(a,l,c,f,h){var d,g,m,y=[],v=0,x="0",b=a&&[],T=null!=h,C=u,k=a||s&&i.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(u=l!==p&&l,r=n);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,c)){f.push(d);break}T&&(w=N,r=++n)}o&&((d=!m&&d)&&v--,a&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,c);if(a){if(v>0)while(x--)b[x]||y[x]||(y[x]=q.call(f));y=xt(y)}O.apply(f,y),T&&!a&&y.length>0&&v+t.length>1&&ot.uniqueSort(f)}return T&&(w=N,u=C),b};return o?at(a):a}a=ot.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[v]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ot(e,t[r],n);return n}function kt(e,t,r,o){var s,u,l,c,p,f=gt(e);if(!o&&1===f.length){if(u=f[0]=f[0].slice(0),u.length>2&&"ID"===(l=u[0]).type&&n.getById&&9===t.nodeType&&h&&i.relative[u[1].type]){if(t=(i.find.ID(l.matches[0].replace(nt,rt),t)||[])[0],!t)return r;e=e.slice(u.shift().value.length)}s=J.needsContext.test(e)?0:u.length;while(s--){if(l=u[s],i.relative[c=l.type])break;if((p=i.find[c])&&(o=p(l.matches[0].replace(nt,rt),U.test(u[0].type)&&t.parentNode||t))){if(u.splice(s,1),e=o.length&&mt(u),!e)return O.apply(r,o),r;break}}}return a(e,f)(o,t,!h,r,U.test(e)),r}n.sortStable=v.split("").sort(S).join("")===v,n.detectDuplicates=E,c(),n.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){return n?undefined:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?undefined:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||lt(R,function(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),x.find=ot,x.expr=ot.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ot.uniqueSort,x.text=ot.getText,x.isXMLDoc=ot.isXML,x.contains=ot.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(p){for(t=e.memory&&p,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(p[0],p[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!a||n&&!u||(t=t||[],t=[e,t.slice?t.slice():t],r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))x.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){var r;return t===undefined||t&&"string"==typeof t&&n===undefined?(r=this.get(e,t),r!==undefined?r:this.get(e,x.camelCase(t))):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),s=this.cache[o];if(t===undefined)this.cache[o]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):(i=x.camelCase(t),t in s?r=[t,i]:(r=i,r=r in s?[r]:r.match(w)||[])),n=r.length;while(n--)delete s[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.slice(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t) +};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n\f]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,i=0,o=x(this),s=e.match(w)||[];while(t=s[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,x(this).val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.bool.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,p,f,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(f=x.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},p=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,f.setup&&f.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),f.add&&(f.add.call(e,p),p.handler.guid||(p.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,p):h.push(p),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,p,f,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){p=x.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,f=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;while(o--)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));s&&!f.length&&(p.teardown&&p.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,p,f,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),f=x.event.special[d]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!x.isWindow(r)){for(l=f.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:f.bindType||d,p=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),p&&p.apply(a,n),p=c&&a[c],p&&x.acceptData(a)&&p.apply&&p.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||f._default&&f._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,s=e,a=this.fixHooks[i];a||(this.fixHooks[i]=a=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new x.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=o),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=/^(?:parents|prev(?:Until|All))/,Q=x.expr.match.needsContext,K={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(et(this,e||[],!0))},filter:function(e){return this.pushStack(et(this,e||[],!1))},is:function(e){return!!et(this,"string"==typeof e&&Q.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],s=Q.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function Z(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return Z(e,"nextSibling")},prev:function(e){return Z(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return e.contentDocument||x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(K[e]||x.unique(i),J.test(e)&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function et(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,nt=/<([\w:]+)/,rt=/<|&#?\w+;/,it=/<(?:script|style|link)/i,ot=/^(?:checkbox|radio)$/i,st=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^$|\/(?:java|ecma)script/i,ut=/^true\/(.*)/,lt=/^\s*\s*$/g,ct={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ct.optgroup=ct.option,ct.tbody=ct.tfoot=ct.colgroup=ct.caption=ct.thead,ct.th=ct.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(mt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&dt(mt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(mt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!it.test(e)&&!ct[(nt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(tt,"<$1>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(mt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=f.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,p=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&st.test(d))return this.each(function(r){var i=p.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(mt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,mt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,ht),l=0;s>l;l++)a=o[l],at.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(lt,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=mt(a),o=mt(e),r=0,i=o.length;i>r;r++)yt(o[r],s[r]);if(t)if(n)for(o=o||mt(e),s=s||mt(a),r=0,i=o.length;i>r;r++)gt(o[r],s[r]);else gt(e,a);return s=mt(a,"script"),s.length>0&&dt(s,!u&&mt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,p=e.length,f=t.createDocumentFragment(),h=[];for(;p>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(rt.test(i)){o=o||f.appendChild(t.createElement("div")),s=(nt.exec(i)||["",""])[1].toLowerCase(),a=ct[s]||ct._default,o.innerHTML=a[1]+i.replace(tt,"<$1>")+a[2],l=a[0];while(l--)o=o.lastChild;x.merge(h,o.childNodes),o=f.firstChild,o.textContent=""}else h.push(t.createTextNode(i));f.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=mt(f.appendChild(i),"script"),u&&dt(o),n)){l=0;while(i=o[l++])at.test(i.type||"")&&n.push(i)}return f},cleanData:function(e){var t,n,r,i,o,s,a=x.event.special,u=0;for(;(n=e[u])!==undefined;u++){if(F.accepts(n)&&(o=n[q.expando],o&&(t=q.cache[o]))){if(r=Object.keys(t.events||{}),r.length)for(s=0;(i=r[s])!==undefined;s++)a[i]?x.event.remove(n,i):x.removeEvent(n,i,t.handle);q.cache[o]&&delete q.cache[o]}delete L.cache[n[L.expando]]}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}});function pt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ht(e){var t=ut.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function dt(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function gt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=q.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function mt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function yt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ot.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var vt,xt,bt=/^(none|table(?!-c[ea]).+)/,wt=/^margin/,Tt=RegExp("^("+b+")(.*)$","i"),Ct=RegExp("^("+b+")(?!px)[a-z%]+$","i"),kt=RegExp("^([+-])=("+b+")","i"),Nt={BODY:"block"},Et={position:"absolute",visibility:"hidden",display:"block"},St={letterSpacing:0,fontWeight:400},jt=["Top","Right","Bottom","Left"],Dt=["Webkit","O","Moz","ms"];function At(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Dt.length;while(i--)if(t=Dt[i]+n,t in e)return t;return r}function Lt(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function qt(t){return e.getComputedStyle(t,null)}function Ht(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&Lt(r)&&(o[s]=q.access(r,"olddisplay",Rt(r.nodeName)))):o[s]||(i=Lt(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=qt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return Ht(this,!0)},hide:function(){return Ht(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Lt(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=vt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=At(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=kt.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=At(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=vt(e,t,r)),"normal"===i&&t in St&&(i=St[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),vt=function(e,t,n){var r,i,o,s=n||qt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Ct.test(a)&&wt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ot(e,t,n){var r=Tt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ft(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+jt[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+jt[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+jt[o]+"Width",!0,i))):(s+=x.css(e,"padding"+jt[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+jt[o]+"Width",!0,i)));return s}function Pt(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=qt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=vt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Ct.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ft(e,t,n||(s?"border":"content"),r,o)+"px"}function Rt(e){var t=o,n=Nt[e];return n||(n=Mt(e,t),"none"!==n&&n||(xt=(xt||x("